Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Where is it safe to initialize OpenGL?
bobthebuilder last edited by
Reading the documentation for QOpenGLFunctions, the example provided there initializes OpenGL in the constructor of a class that inherits from QOpenGLFunctions and QWindow. In the OpenGL Window Example, however, initialization is done in the render function with a boolean to check if OpenGL has already been initialized.
Why is the example code doing initialization in render? Is it unsafe to initialize OpenGL in the constructor?