Reputation: 65
I am trying to specify the glutClosefunc for the tutorial at http://www.glprogramming.com/red/index.html but it doesnt seem to work...
my code looks like this:
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(250,250);
glutInitWindowPosition(100,100);
glutCreateWindow("hello");
init();
glutDisplayFunc(display);
glutCloseFunc(close); //This isnt working
glutMainLoop();
return(0);
}
Its currently coming up with freeglut ERROR: function called without first calling 'glutInit'
The code example was a C example... i converted the parameters in main to C++, but i didnt change glutInit...
oh yeah, you can see i am using freeglut instead of glut like the tutorial says as well
Upvotes: 0
Views: 1005
Reputation: 65
Ahh I figured it out.. I had, in my linker input, linked to glut32.lib
instead of freeglut.lib
and therefore freeglut wasnt initializing properly!
Upvotes: 1