At what point does Qt create a simple OpenGL context? Should I use a QOpenGLContext?
Either where it is documented (for example, creating a QOpenGLWidget or QOpenGLWindow will automatically create a context), or you can create a context manually at any time by creating a QOpenGLContext object.
What is the difference between QSurface and QOpenGLWindow? The QOpenGLWindow example uses both classes.
A QSurface is a base class that represents a "pushed surface" (on or off the screen). QWindow is its on-screen implementation (representing a top-level window), so it inherits from QSurface . You can use QWindow with OpenGL or with a processor-based rasterizer.
Finally, QOpenGLWindow is a subclass of QWindow that offers some additional functionality and convenience by automatically creating and managing an OpenGL context (via QOpenGLContext ), having an additional partial update strategy (through the use of FBO), etc.
Can glew be used besides this qt material? Here are some questions related to configuring glew with qt, but I think I did not understand why glew is needed.
Qt is not in your way . And that does not change the use of OpenGL in any way. Just use Qt to create the window and context (in a fully cross-platform way), then you can use GLEW (to resolve OpenGL function pointers, extensions, etc.) or any third-party OpenGL abstraction.
peppe source share