문제

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

도움이 되었습니까?

해결책

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!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top