Original Post
I'm attempting to do a little something like this: But, i'm getting this error;
void COpenGLDriver::setFeature(Feature f, bool b) const
{
// Create a function pointer for gl functions depending on whether 'b'
// is true or false (enable or disable).
// Just so I wouldn't have to have and if/else pair for each feature.
void (*glFunc)(GLenum);
if( b )
glFunc = glEnable;
else
glFunc = glDisable;
switch(f){
// set feature for lighting
case FEATURE_LIGHTING:
glFunc(GL_LIGHTING);
break;
// set feature for depth testing
case FEATURE_DEPTH_TESTING:
glFunc(GL_DEPTH_TEST);
break;
default:
break;
};// switch
}
C:\Documents and Settings\Naim\My Documents\Programming\everything\engine\video\COpenGLDriver.cpp(795)
: error C2440: '=' : cannot convert from 'void (__stdcall *)(unsigned int)' to 'void (__cdecl *)(unsigned int)'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Is this because glEnable/Disable is within a dll?