Originally posted by hcrogma:
I Tried making a class using the exmaple of lesson 2 from NeHe tutorial....but get the following errors...could you please tell how to get around this problem.
Error : function call 'glutDisplayFunc(void)' does not match
'glutDisplayFunc(void (*)())'
myGLObject.cp line 160 glutDisplayFunc(DrawGLScene);
1.
Error : function call 'glutReshapeFunc(void)' does not match
'glutReshapeFunc(void (*)(int, int))'
myGLObject.cp line 161 glutReshapeFunc(ReSizeGLScene);
2.
Error : function call 'glutDisplayFunc(void)' does not match
'glutDisplayFunc(void (*)())'
myGLObject.cp line 160 glutDisplayFunc(DrawGLScene);
Error : function call 'glutReshapeFunc(void)' does not match
'glutReshapeFunc(void (*)(int, int))'
myGLObject.cp line 161 glutReshapeFunc(ReSizeGLScene);
#include"myGLObject.h"
GLvoid myGLObject::InitGL(GLvoid)
{
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // This Will Clear The Background Color To Black
glClearDepth(1.0); // Enables Clearing Of The Depth Buffer
glDepthFunc(GL_LESS); // The Type Of Depth Test To Do
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glShadeModel(GL_SMOOTH); // Enables Smooth Color Shading
glMatrixMode(GL_PROJECTION);
glLoadIdentity(); // Reset The Projection Matrix
gluPerspective(45.0f,(GLfloat)kWindowWidth/(GLfloat)kWindowHeight,0.1f,100.0f); // Calculate The Aspect Ratio Of The Window
glMatrixMode(GL_MODELVIEW);
}
// DrawGLScene