Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QWindowsGLContext Class Reference

Open GL context. More...

#include <qwindowsglcontext.h>

Inheritance diagram for QWindowsGLContext:
Collaboration diagram for QWindowsGLContext:

Public Types

typedef void(* GL_Proc) ()

Public Member Functions

 QWindowsGLContext (QOpenGLStaticContext *staticContext, QOpenGLContext *context)
 QWindowsGLContext (QOpenGLStaticContext *staticContext, HGLRC context, HWND window)
 ~QWindowsGLContext () override
bool isSharing () const override
bool isValid () const override
QSurfaceFormat format () const override
void swapBuffers (QPlatformSurface *surface) override
 Reimplement in subclass to native swap buffers calls.
bool makeCurrent (QPlatformSurface *surface) override
void doneCurrent () override
QFunctionPointer getProcAddress (const char *procName) override
 Reimplement in subclass to allow dynamic querying of OpenGL symbols.
HGLRC renderingContext () const
HGLRC nativeContext () const override
Public Member Functions inherited from QWindowsOpenGLContext
virtual voidnativeDisplay () const
virtual voidnativeConfig () const
Public Member Functions inherited from QPlatformOpenGLContext
 QPlatformOpenGLContext ()
virtual ~QPlatformOpenGLContext ()
virtual void initialize ()
 Called after a new instance is constructed.
virtual GLuint defaultFramebufferObject (QPlatformSurface *surface) const
 Reimplement in subclass if your platform uses framebuffer objects for surfaces.
virtual void beginFrame ()
 Called when the RHI begins rendering a new frame in the context.
virtual void endFrame ()
 Called when the RHI ends rendering a in the context.
QOpenGLContextcontext () const

Additional Inherited Members

Static Public Member Functions inherited from QPlatformOpenGLContext
static bool parseOpenGLVersion (const QByteArray &versionString, int &major, int &minor)
Protected Member Functions inherited from QWindowsOpenGLContext
 QWindowsOpenGLContext ()=default

Detailed Description

Open GL context.

An Open GL context for use with several windows. As opposed to other implementations, activating a GL context for a window requires a HDC allocated for it. The first time this HDC is created for the window, the pixel format must be applied, which will affect the window as well. The HDCs are stored in a list of QOpenGLContextData and are released in doneCurrent().

Definition at line 168 of file qwindowsglcontext.h.

Member Typedef Documentation

◆ GL_Proc

typedef void(* QWindowsGLContext::GL_Proc) ()

Definition at line 184 of file qwindowsglcontext.h.

Constructor & Destructor Documentation

◆ QWindowsGLContext() [1/2]

QWindowsGLContext::QWindowsGLContext ( QOpenGLStaticContext * staticContext,
QOpenGLContext * context )
explicit

Definition at line 1029 of file qwindowsglcontext.cpp.

References QWindowsOpenGLAdditionalFormat::QWindowsOpenGLAdditionalFormat(), QOpenGLStaticContext::extensions, QOpenGLStaticContext::opengl32, QWindowsGLDirectRendering, QOpenGLStaticContext::sRGBCapableFramebuffer, and QWindowsContext::verbose.

Here is the call graph for this function:

◆ QWindowsGLContext() [2/2]

QWindowsGLContext::QWindowsGLContext ( QOpenGLStaticContext * staticContext,
HGLRC context,
HWND window )
explicit

Definition at line 1150 of file qwindowsglcontext.cpp.

◆ ~QWindowsGLContext()

QWindowsGLContext::~QWindowsGLContext ( )
override

Definition at line 1181 of file qwindowsglcontext.cpp.

References QOpenGLStaticContext::opengl32.

Member Function Documentation

◆ doneCurrent()

void QWindowsGLContext::doneCurrent ( )
overridevirtual

Implements QPlatformOpenGLContext.

Definition at line 1323 of file qwindowsglcontext.cpp.

References QOpenGLStaticContext::opengl32.

◆ format()

QSurfaceFormat QWindowsGLContext::format ( ) const
inlineoverridevirtual

Implements QPlatformOpenGLContext.

Definition at line 177 of file qwindowsglcontext.h.

◆ getProcAddress()

QFunctionPointer QWindowsGLContext::getProcAddress ( const char * procName)
overridevirtual

Reimplement in subclass to allow dynamic querying of OpenGL symbols.

As opposed to e.g. the wglGetProcAddress function on Windows, Qt expects this methods to be able to return valid function pointers even for standard OpenGL symbols.

Implements QPlatformOpenGLContext.

Definition at line 1333 of file qwindowsglcontext.cpp.

References QOpenGLStaticContext::opengl32, and QWindowsContext::verbose.

◆ isSharing()

bool QWindowsGLContext::isSharing ( ) const
inlineoverridevirtual

Reimplemented from QPlatformOpenGLContext.

Definition at line 175 of file qwindowsglcontext.h.

◆ isValid()

bool QWindowsGLContext::isValid ( ) const
inlineoverridevirtual

Reimplemented from QPlatformOpenGLContext.

Definition at line 176 of file qwindowsglcontext.h.

◆ makeCurrent()

bool QWindowsGLContext::makeCurrent ( QPlatformSurface * surface)
overridevirtual

◆ nativeContext()

HGLRC QWindowsGLContext::nativeContext ( ) const
inlineoverride

Definition at line 190 of file qwindowsglcontext.h.

◆ renderingContext()

HGLRC QWindowsGLContext::renderingContext ( ) const
inline

Definition at line 188 of file qwindowsglcontext.h.

◆ swapBuffers()

void QWindowsGLContext::swapBuffers ( QPlatformSurface * surface)
overridevirtual

Reimplement in subclass to native swap buffers calls.

The implementation must support being called in a thread different than the gui-thread.

Implements QPlatformOpenGLContext.

Definition at line 1244 of file qwindowsglcontext.cpp.

References QOpenGLStaticContext::opengl32, and QWindowsContext::verbose.


The documentation for this class was generated from the following files: