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
QOpenGLStaticContext Class Reference

Static Open GL context containing version information, extension function pointers, etc. More...

#include <qwindowsglcontext.h>

+ Inheritance diagram for QOpenGLStaticContext:
+ Collaboration diagram for QOpenGLStaticContext:

Public Types

enum  Extensions { SampleBuffers = 0x1 , sRGBCapableFramebuffer = 0x2 , Robustness = 0x4 }
 
typedef bool(APIENTRYWglGetPixelFormatAttribIVARB) (HDC hdc, int iPixelFormat, int iLayerPlane, uint nAttributes, const int *piAttributes, int *piValues)
 
typedef bool(APIENTRYWglChoosePixelFormatARB) (HDC hdc, const int *piAttribList, const float *pfAttribFList, uint nMaxFormats, int *piFormats, UINT *nNumFormats)
 
typedef HGLRC(APIENTRYWglCreateContextAttribsARB) (HDC, HGLRC, const int *)
 
typedef BOOL(APIENTRYWglSwapInternalExt) (int interval)
 
typedef int(APIENTRYWglGetSwapInternalExt) (void)
 
typedef const char *(APIENTRYWglGetExtensionsStringARB) (HDC)
 

Public Member Functions

bool hasExtensions () const
 
QWindowsOpenGLContextcreateContext (QOpenGLContext *context) override
 
QWindowsOpenGLContextcreateContext (HGLRC context, HWND window) override
 
voidmoduleHandle () const override
 
QOpenGLContext::OpenGLModuleType moduleType () const override
 
bool supportsThreadedOpenGL () const override
 
- Public Member Functions inherited from QWindowsStaticOpenGLContext
virtual ~QWindowsStaticOpenGLContext ()=default
 
virtual voidcreateWindowSurface (void *, void *, int *)
 
virtual void destroyWindowSurface (void *)
 

Static Public Member Functions

static QOpenGLStaticContextcreate (bool softwareRendering=false)
 
static QByteArray getGlString (unsigned int which)
 
- Static Public Member Functions inherited from QWindowsStaticOpenGLContext
static QWindowsStaticOpenGLContextcreate ()
 

Public Attributes

const QByteArray vendor
 
const QByteArray renderer
 
const QByteArray extensionNames
 
unsigned extensions
 
const QWindowsOpenGLContextFormat defaultFormat
 
WglGetPixelFormatAttribIVARB wglGetPixelFormatAttribIVARB
 
WglChoosePixelFormatARB wglChoosePixelFormatARB
 
WglCreateContextAttribsARB wglCreateContextAttribsARB
 
WglSwapInternalExt wglSwapInternalExt
 
WglGetSwapInternalExt wglGetSwapInternalExt
 
WglGetExtensionsStringARB wglGetExtensionsStringARB
 

Static Public Attributes

static QWindowsOpengl32DLL opengl32
 

Additional Inherited Members

- Protected Member Functions inherited from QWindowsStaticOpenGLContext
 QWindowsStaticOpenGLContext ()=default
 

Detailed Description

Static Open GL context containing version information, extension function pointers, etc.

Functions pending integration in the next version of OpenGL are post-fixed ARB.

No WGL or OpenGL functions are called directly from the windows plugin. Instead, the static context loads opengl32.dll and resolves the necessary functions. This allows building the plugin without linking to opengl32 and enables QT_OPENGL_DYNAMIC builds where both the EGL and WGL (this) based implementation of the context are built.

Note
Initialization requires an active context (see create()).
See also
QWindowsGLContext

Definition at line 101 of file qwindowsglcontext.h.

Member Typedef Documentation

◆ WglChoosePixelFormatARB

typedef bool(APIENTRY * QOpenGLStaticContext::WglChoosePixelFormatARB) (HDC hdc, const int *piAttribList, const float *pfAttribFList, uint nMaxFormats, int *piFormats, UINT *nNumFormats)

Definition at line 118 of file qwindowsglcontext.h.

◆ WglCreateContextAttribsARB

typedef HGLRC(APIENTRY * QOpenGLStaticContext::WglCreateContextAttribsARB) (HDC, HGLRC, const int *)

Definition at line 123 of file qwindowsglcontext.h.

◆ WglGetExtensionsStringARB

typedef const char *(APIENTRY * QOpenGLStaticContext::WglGetExtensionsStringARB) (HDC)

Definition at line 131 of file qwindowsglcontext.h.

◆ WglGetPixelFormatAttribIVARB

typedef bool(APIENTRY * QOpenGLStaticContext::WglGetPixelFormatAttribIVARB) (HDC hdc, int iPixelFormat, int iLayerPlane, uint nAttributes, const int *piAttributes, int *piValues)

Definition at line 113 of file qwindowsglcontext.h.

◆ WglGetSwapInternalExt

typedef int(APIENTRY * QOpenGLStaticContext::WglGetSwapInternalExt) (void)

Definition at line 128 of file qwindowsglcontext.h.

◆ WglSwapInternalExt

typedef BOOL(APIENTRY * QOpenGLStaticContext::WglSwapInternalExt) (int interval)

Definition at line 126 of file qwindowsglcontext.h.

Member Enumeration Documentation

◆ Extensions

Enumerator
SampleBuffers 
sRGBCapableFramebuffer 
Robustness 

Definition at line 106 of file qwindowsglcontext.h.

Member Function Documentation

◆ create()

QOpenGLStaticContext * QOpenGLStaticContext::create ( bool softwareRendering = false)
static

Definition at line 998 of file qwindowsglcontext.cpp.

References opengl32, qCDebug, and qWarning.

◆ createContext() [1/2]

QWindowsOpenGLContext * QOpenGLStaticContext::createContext ( HGLRC context,
HWND window )
overridevirtual

Implements QWindowsStaticOpenGLContext.

Definition at line 198 of file qwindowsglcontext.cpp.

References context, and window().

+ Here is the call graph for this function:

◆ createContext() [2/2]

QWindowsOpenGLContext * QOpenGLStaticContext::createContext ( QOpenGLContext * context)
overridevirtual

Implements QWindowsStaticOpenGLContext.

Definition at line 193 of file qwindowsglcontext.cpp.

References context.

◆ getGlString()

QByteArray QOpenGLStaticContext::getGlString ( unsigned int which)
static

Definition at line 991 of file qwindowsglcontext.cpp.

References opengl32, and QByteArray().

Referenced by QWindowsOpenGLContextFormat::current().

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

◆ hasExtensions()

bool QOpenGLStaticContext::hasExtensions ( ) const
inline

Definition at line 134 of file qwindowsglcontext.h.

References wglChoosePixelFormatARB, wglCreateContextAttribsARB, and wglGetPixelFormatAttribIVARB.

Referenced by QWindowsGLContext::QWindowsGLContext().

+ Here is the caller graph for this function:

◆ moduleHandle()

void * QOpenGLStaticContext::moduleHandle ( ) const
inlineoverridevirtual

Implements QWindowsStaticOpenGLContext.

Definition at line 142 of file qwindowsglcontext.h.

References opengl32.

◆ moduleType()

QOpenGLContext::OpenGLModuleType QOpenGLStaticContext::moduleType ( ) const
inlineoverridevirtual

Implements QWindowsStaticOpenGLContext.

Definition at line 143 of file qwindowsglcontext.h.

References QOpenGLContext::LibGL.

◆ supportsThreadedOpenGL()

bool QOpenGLStaticContext::supportsThreadedOpenGL ( ) const
inlineoverridevirtual

Reimplemented from QWindowsStaticOpenGLContext.

Definition at line 148 of file qwindowsglcontext.h.

References opengl32.

Member Data Documentation

◆ defaultFormat

const QWindowsOpenGLContextFormat QOpenGLStaticContext::defaultFormat

Definition at line 155 of file qwindowsglcontext.h.

Referenced by QWindowsGLContext::QWindowsGLContext().

◆ extensionNames

const QByteArray QOpenGLStaticContext::extensionNames

Definition at line 153 of file qwindowsglcontext.h.

◆ extensions

unsigned QOpenGLStaticContext::extensions

Definition at line 154 of file qwindowsglcontext.h.

Referenced by QWindowsGLContext::QWindowsGLContext().

◆ opengl32

◆ renderer

const QByteArray QOpenGLStaticContext::renderer

Definition at line 152 of file qwindowsglcontext.h.

◆ vendor

const QByteArray QOpenGLStaticContext::vendor

Definition at line 151 of file qwindowsglcontext.h.

◆ wglChoosePixelFormatARB

WglChoosePixelFormatARB QOpenGLStaticContext::wglChoosePixelFormatARB

Definition at line 158 of file qwindowsglcontext.h.

Referenced by hasExtensions().

◆ wglCreateContextAttribsARB

WglCreateContextAttribsARB QOpenGLStaticContext::wglCreateContextAttribsARB

Definition at line 159 of file qwindowsglcontext.h.

Referenced by hasExtensions().

◆ wglGetExtensionsStringARB

WglGetExtensionsStringARB QOpenGLStaticContext::wglGetExtensionsStringARB

Definition at line 162 of file qwindowsglcontext.h.

Referenced by QWindowsGLContext::QWindowsGLContext().

◆ wglGetPixelFormatAttribIVARB

WglGetPixelFormatAttribIVARB QOpenGLStaticContext::wglGetPixelFormatAttribIVARB

Definition at line 157 of file qwindowsglcontext.h.

Referenced by hasExtensions().

◆ wglGetSwapInternalExt

WglGetSwapInternalExt QOpenGLStaticContext::wglGetSwapInternalExt

Definition at line 161 of file qwindowsglcontext.h.

◆ wglSwapInternalExt

WglSwapInternalExt QOpenGLStaticContext::wglSwapInternalExt

Definition at line 160 of file qwindowsglcontext.h.

Referenced by QWindowsGLContext::makeCurrent().


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