Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QQuickOpenGLUtils Namespace Reference

\inmodule QtQuick More...

Functions

Q_QUICK_EXPORT void resetOpenGLState ()
 Call this function to reset the current OpenGL context its default state.
 

Detailed Description

\inmodule QtQuick

Since
6.0

The QQuickOpenGLUtils namespace contains utilities for Qt Quick when used with an OpenGL backend.

Function Documentation

◆ resetOpenGLState()

void QQuickOpenGLUtils::resetOpenGLState ( )

Call this function to reset the current OpenGL context its default state.

The scene graph uses the OpenGL context and will both rely on and clobber its state. When mixing raw OpenGL commands with scene graph rendering, this function provides a convenient way of resetting the OpenGL context state back to its default values.

This function does not touch state in the fixed-function pipeline.

Warning
This function will only reset the OpenGL context in relation to what may be changed internally as part of the OpenGL scene graph. It does not reset anything that has been changed externally such as direct OpenGL calls done inside the application code if those same calls are not used internally (for example, various OpenGL 3.x or 4.x specific state).
Since
6.0

Definition at line 41 of file qquickopenglutils.cpp.

References QOpenGLFramebufferObject::bindDefault(), QOpenGLContext::currentContext(), QOpenGLFunctions::FixedFunctionPipeline, GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER, GL_FLOAT, GL_MAX_VERTEX_ATTRIBS, GL_TEXTURE0, QOpenGLFunctions::glActiveTexture(), QOpenGLFunctions::glBindBuffer(), QOpenGLFunctions::glBindTexture(), QOpenGLVertexArrayObjectHelper::glBindVertexArray(), QOpenGLFunctions::glBlendFunc(), QOpenGLFunctions::glClearColor(), QOpenGLFunctions::glClearDepthf(), QOpenGLFunctions::glColorMask(), QOpenGLFunctions::glDepthFunc(), QOpenGLFunctions::glDepthMask(), QOpenGLFunctions::glDisable(), QOpenGLFunctions::glDisableVertexAttribArray(), QOpenGLFunctions::glGetIntegerv(), QOpenGLFunctions::glStencilFunc(), QOpenGLFunctions::glStencilMask(), QOpenGLFunctions::glStencilOp(), QOpenGLFunctions::glUseProgram(), QOpenGLFunctions::glVertexAttribPointer(), i, QOpenGLVertexArrayObjectHelper::isValid(), QOpenGLFunctions::openGLFeatures(), and QOpenGLVertexArrayObjectHelper::vertexArrayObjectHelperForContext().

Referenced by QSGFramebufferObjectNode::render().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: