OpenGL window isn't opening

前端 未结 2 1222
渐次进展
渐次进展 2021-01-24 13:37

I have code from the OpenGLBook (openglbook.com) which compiles, but does not load. I have absolutely no idea why it\'s not loading. The code is as follows:

main

相关标签:
2条回答
  • 2021-01-24 14:26

    Try debugging! Place a breakpoint on your main function and step through until something causes the program to exit.

    As Nicol Bolas mentioned, you might not have a graphics card that supports OpenGL 4.2. Go on to AMD or nVidia's website and find out if your graphics card supports OpenGL 4.2. If not, then change the following line to whatever version your card supports.

    glutInitContextVersion(4, 2);
    
    0 讨论(0)
  • 2021-01-24 14:31
    glutInitContextVersion(4, 2);
    

    Does your current graphics driver actually support OpenGL 4.2? If not, then your window creation will fail. 4.2 is still rather new; try 4.1 instead.

    0 讨论(0)
提交回复
热议问题