简体   繁体   中英

Calling a glut function exits the program

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 within 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM