• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

/home/hauberg/Dokumenter/Capture/humim-tracker-0.1/src/OpenTissue/OpenTissue/utility/gl/gl_material.h

Go to the documentation of this file.
00001 #ifndef OPENTISSUE_UTILITY_GL_GL_MATERIAL_H
00002 #define OPENTISSUE_UTILITY_GL_GL_MATERIAL_H
00003 //
00004 // OpenTissue Template Library
00005 // - A generic toolbox for physics-based modeling and simulation.
00006 // Copyright (C) 2008 Department of Computer Science, University of Copenhagen.
00007 //
00008 // OTTL is licensed under zlib: http://opensource.org/licenses/zlib-license.php
00009 //
00010 #include <OpenTissue/configuration.h>
00011 
00012 #include <OpenTissue/utility/gl/gl.h>
00013 #include <OpenTissue/utility/utility_material.h>
00014 
00015 namespace OpenTissue
00016 {
00017 
00018   namespace gl
00019   {
00020 
00025     class Material : public OpenTissue::utility::Material
00026     {
00027     public:
00028 
00029       void use()
00030       {
00031         if ( glIsEnabled( GL_COLOR_MATERIAL ) || !glIsEnabled( GL_LIGHTING ) )
00032         {
00033           glColor4f( m_diffuse[ 0 ], m_diffuse[ 1 ], m_diffuse[ 2 ], m_diffuse[ 3 ] );
00034         }
00035         else
00036         {
00037           glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT,   m_ambient    );
00038           glMaterialfv( GL_FRONT_AND_BACK, GL_DIFFUSE,   m_diffuse    );
00039           glMaterialfv( GL_FRONT_AND_BACK, GL_SPECULAR,  m_specular   );
00040           glMaterialfv( GL_FRONT_AND_BACK, GL_SHININESS, &m_shininess );
00041         }
00042       }
00043 
00044     };
00045 
00046   } // namespace gl
00047 
00048 } // namespace OpenTissue
00049 
00050 //OPENTISSUE_UTILITY_GL_GL_MATERIAL_H
00051 #endif

Generated on Thu Dec 1 2011 12:53:41 for HUMIM Tracker by  doxygen 1.7.1