O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using multiple OpenGL versions

Earlier in this chapter, we discussed a family of QOpenGLFunctions classes that provide access to OpenGL functions included in a specific OpenGL profile. If your whole application can use one profile, you can just select the appropriate Qt class and use it. However, sometimes you don't want the application to shut down completely if the requested profile is not supported on the current system. Instead, you can relax your requirements and use an older OpenGL version and provide simplified but still working rendering for systems that don't support the new profile. In Qt, you can implement such an approach using QOpenGLContext::versionFunctions():

class MyWindow : public QOpenGLWindow { protected: QOpenGLFunctions_4_5_Core ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required