Skip to main content

PlottingOpenGL::GLFunctions

PlottingOpenGL::GLFunctions

Accessor for OpenGL functions in the current context. More…

#include <GLContext.hpp>

Public Functions

Name
QOpenGLFunctions * get()
QOpenGLExtraFunctions * getExtra()
Get extended OpenGL functions (OpenGL 3.x+).
bool hasCurrentContext()
Check if a valid OpenGL context is current.

Detailed Description

class PlottingOpenGL::GLFunctions;

Accessor for OpenGL functions in the current context.

Call GLFunctions::get() to obtain a pointer to the QOpenGLFunctions interface for the current context. Returns nullptr if no context is current.

Usage: auto* f = GLFunctions::get(); if (f) { f->glDrawArrays(GL_TRIANGLES, 0, 3); }

Public Functions Documentation

function get

static QOpenGLFunctions * get()

function getExtra

static QOpenGLExtraFunctions * getExtra()

Get extended OpenGL functions (OpenGL 3.x+).

Return: Pointer to QOpenGLExtraFunctions, or nullptr if no context

Use this for instanced rendering functions like glDrawArraysInstanced and glVertexAttribDivisor.

function hasCurrentContext

static bool hasCurrentContext()

Check if a valid OpenGL context is current.


Updated on 2026-11-13 at 20:25:41 +0000