QtOpenGL Reference Documentation

2D Painting Example

Overview

Helper Class Definition

Helper Class Implementation

Widget Class Definition

Widget Class Implementation

GLWidget Class Definition

GLWidget Class Implementation

Window Class Definition

Window Class Implementation

Running the Example

Changes to Qt OpenGL

Deprecated classes removed

QOpenGL classes migrated

The QOpenGLWidgets class

Selecting the OpenGL backend for RHI

Removal of ANGLE

Cube OpenGL ES 2.0 example

Initializing OpenGL ES 2.0

Loading Textures from Qt Resource Files

Cube Geometry

Perspective Projection

Orientation of the 3D Object

Hello GL2 Example

Hello GLES3 Example

Overview

Setting up in main.cpp

Implementing GLWindow

Animations

Shaders

Initializing OpenGL

Resizing the window

Painting

OpenGL Window Example

OpenGLWindow Super Class

Example OpenGL Rendering Sub Class

Introduction

Creating an OpenGL Debug Context

Creating and Initializing a QOpenGLDebugLogger

Reading the Internal OpenGL Debug Log

Real-time logging of messages

Inserting Messages in the Debug Log

Controlling the Debug Output

Performance

Antialiasing and Quality

State Changes

Mixing QPainter and OpenGL

Introduction

Writing Portable Shaders

Simple Shader Example

Binary Shaders and Programs

Caching Program Binaries

Security Considerations

Painting Techniques

OpenGL Function Calls, Headers and QOpenGLFunctions

Code Examples

Multisampling

Threading

Context Sharing

Resource Initialization and Cleanup

Limitations and Other Considerations

Alternatives

Stereoscopic rendering

QOpenGLWidget Stereoscopic Rendering Example

Setting the correct surface flag

Rendering twice

Qt OpenGL

Qt OpenGL and Qt Widgets

Qt OpenGL and Qt Quick

Using the Module

Building with CMake

Building with qmake

Examples

Reference

Module Evolution

Licenses and Trademarks

Textures Example

Qt OpenGL Examples

Qt OpenGL C++ Classes

Qt OpenGL Widgets C++ Classes