Go to the documentation of this file.00001 #ifndef OPENTISSUE_UTILITY_GL_GL_COLOR_PICKER_H
00002 #define OPENTISSUE_UTILITY_GL_GL_COLOR_PICKER_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 #include <OpenTissue/utility/gl/gl.h>
00013
00014 namespace OpenTissue
00015 {
00016
00017 namespace gl
00018 {
00019
00023 template<typename T1,typename T2,typename T3,typename T4>
00024 inline void ColorPicker( T1 const red, T2 const green, T3 const blue, T4 const alpha, unsigned int face = GL_FRONT_AND_BACK)
00025 {
00026 if ( glIsEnabled( GL_COLOR_MATERIAL ) || !glIsEnabled( GL_LIGHTING ) )
00027 {
00028 glColor4f( (GLfloat) red, (GLfloat) green, (GLfloat) blue, (GLfloat) alpha );
00029 }
00030 else
00031 {
00032 GLfloat color[] = {(GLfloat) red, (GLfloat) green, (GLfloat) blue, (GLfloat) alpha};
00033 glMaterialfv( face, GL_DIFFUSE, color );
00034 }
00035 }
00036
00037 template<typename T1,typename T2,typename T3>
00038 inline void ColorPicker( T1 const red, T2 const green, T3 const blue)
00039 {
00040 ColorPicker(red,green,blue,0.0,GL_FRONT_AND_BACK);
00041 }
00042
00043 }
00044
00045 }
00046
00047
00048 #endif