Game Programming using Qt 5 Beginner's Guide - Second Edition
by Pavel Strakhov, Witold Wysota, Lorenz Haas
Offscreen rendering
Sometimes, it is useful to render an OpenGL scene not to the screen but to some image that can be later processed externally or used as a texture in some other part of rendering. For that, the concept of Framebuffer Objects (FBO) was created. An FBO is a rendering surface that behaves like the regular device frame buffer, with the only exception that the resulting pixels do not land on the screen. An FBO target can be bound as a texture in an existing scene or dumped as an image to regular computer memory. In Qt, such an entity is represented by a QOpenGLFramebufferObject class.
Once you have a current OpenGL context, you can create an instance of QOpenGLFramebufferObject, using one of the available constructors. A mandatory ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access