问题
I'm looking for a GUI toolkit to use in conjunction with OpenGL. QT looks promising but unfortunately it wraps most OpenGL functions in QT classes. Is there any way for me to create an OpenGL 3.3 context in QT and just use the standard C API?
回答1:
There's no need for you to use most of the QT specific OpenGL classes. You need the QGLWidget context itself, something to tell QT when to repaint the widget (that can just be a timer that calls updateGL() on your QTGLWidget 60 times a second) and the event handling. Just make a class that inherits from the QGLWiget and put your C-type OpenGL code in the paintGL() function.
If you want some sample code: https://github.com/dcbishop/g3test check in src/Application/QT*
回答2:
The QopenGL widget gives you the context, you then simply override the initialiseGL, paintGL methods and you can use raw openGL calls directly.
The Qt wrappers around PBO and VBOs are convenient to save doing all the manual DLL loading on Windows but aren't really necessary
来源:https://stackoverflow.com/questions/9796444/using-opengl-on-qt-without-the-wrappers