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

OpenGL windows and contexts

There are many ways you can perform OpenGL rendering in Qt. The most straightforward way that we will mainly use is to subclass QOpenGLWindow. It allows OpenGL to render your content directly to a whole window and is suitable if you draw everything in your application with OpenGL. You can make it a fullscreen window if you want. However, later we will also discuss other approaches that will allow you to integrate OpenGL content into a widget-based application.

The OpenGL context represents the overall state of the OpenGL pipeline, which guides the process of data processing and rendering to a particular device. In Qt, it is represented by the QOpenGLContext class. A related concept that needs explanation is the ...

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