I'm attempting to use OpenGL with Qt (relatively new to both of them), but whenever the program encounters a glut function like gluSolidCube
or similar, it simply exits. I'm sure I'm missing something very basic here, but I have tried putting the dll files everywhere w开发者_开发问答ithin the solution directories, to no avail. Calling initGlew
also does not make a difference.
Any help would be much appreciated.
NB: Other GL functions that do not require glut work perfectly fine.
GLUT is not part of OpenGL. It's a rather simple framework library and needs to be initialized by glutInit(&argc, argv);
in the main
entry point function. Without initialization GLUT functions will call exit
when invoked, thus terminating your program.
Technically I discourage using GLUT for doing something as simple as drawing a cube. The teapot maybe, but that's about it. Otherwise I say, don't use GLUT at all.
精彩评论