开发者

Calling a glut function exits the program

开发者 https://www.devze.com 2023-03-19 17:46 出处:网络
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 someth

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号