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
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 167 of file qwindowsglcontext.h.

Member Typedef Documentation

◆ GL_Proc

typedef void(* QWindowsGLContext::GL_Proc) ()

Definition at line 183 of file qwindowsglcontext.h.

Constructor & Destructor Documentation

◆ QWindowsGLContext() [1/2]

◆ QWindowsGLContext() [2/2]

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

Definition at line 1149 of file qwindowsglcontext.cpp.

References ok, GDI::qSurfaceFormatFromPixelFormat(), and qWarning.

+ Here is the call graph for this function:

◆ ~QWindowsGLContext()

QWindowsGLContext::~QWindowsGLContext ( )
override

Definition at line 1180 of file qwindowsglcontext.cpp.

References QOpenGLStaticContext::opengl32.

Member Function Documentation

◆ doneCurrent()

void QWindowsGLContext::doneCurrent ( )
overridevirtual

◆ format()

QSurfaceFormat QWindowsGLContext::format ( ) const
inlineoverridevirtual

Implements QPlatformOpenGLContext.

Definition at line 176 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 1332 of file qwindowsglcontext.cpp.

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

◆ isSharing()

bool QWindowsGLContext::isSharing ( ) const
inlineoverridevirtual

Reimplemented from QPlatformOpenGLContext.

Definition at line 174 of file qwindowsglcontext.h.

References QPlatformOpenGLContext::context(), and QOpenGLContext::shareHandle().

+ Here is the call graph for this function:

◆ isValid()

bool QWindowsGLContext::isValid ( ) const
inlineoverridevirtual

Reimplemented from QPlatformOpenGLContext.

Definition at line 175 of file qwindowsglcontext.h.

◆ makeCurrent()

◆ nativeContext()

HGLRC QWindowsGLContext::nativeContext ( ) const
inlineoverride

Definition at line 189 of file qwindowsglcontext.h.

◆ renderingContext()

HGLRC QWindowsGLContext::renderingContext ( ) const
inline

Definition at line 187 of file qwindowsglcontext.h.

Referenced by QWindowsGLContext().

+ Here is the caller graph for this function:

◆ 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 1243 of file qwindowsglcontext.cpp.

References findByHWND(), handleOf(), QOpenGLStaticContext::opengl32, qCDebug, qWarning, and QWindowsContext::verbose.

+ Here is the call graph for this function:

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