![]() |
Qt 6.x
The Qt SDK
|
Open GL context. More...
#include <qwindowsglcontext.h>
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 |
![]() | |
virtual void * | nativeDisplay () const |
virtual void * | nativeConfig () const |
![]() | |
QPlatformOpenGLContext () | |
virtual | ~QPlatformOpenGLContext () |
virtual void | initialize () |
Called after a new instance is constructed. | |
virtual QSurfaceFormat | format () const =0 |
virtual void | swapBuffers (QPlatformSurface *surface)=0 |
Reimplement in subclass to native swap buffers calls. | |
virtual GLuint | defaultFramebufferObject (QPlatformSurface *surface) const |
Reimplement in subclass if your platform uses framebuffer objects for surfaces. | |
virtual bool | makeCurrent (QPlatformSurface *surface)=0 |
virtual void | doneCurrent ()=0 |
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. | |
virtual bool | isSharing () const |
virtual bool | isValid () const |
virtual QFunctionPointer | getProcAddress (const char *procName)=0 |
Reimplement in subclass to allow dynamic querying of OpenGL symbols. | |
QOpenGLContext * | context () const |
Additional Inherited Members | |
![]() | |
static bool | parseOpenGLVersion (const QByteArray &versionString, int &major, int &minor) |
![]() | |
QWindowsOpenGLContext ()=default | |
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.
typedef void(* QWindowsGLContext::GL_Proc) () |
Definition at line 183 of file qwindowsglcontext.h.
|
explicit |
Definition at line 1028 of file qwindowsglcontext.cpp.
References ARB::choosePixelFormat(), GDI::choosePixelFormat(), QPlatformOpenGLContext::context(), ARB::createContext(), GDI::createContext(), createDummyGLWindow(), QOpenGLStaticContext::defaultFormat, QSurfaceFormat::DefaultRenderableType, describeFormats(), QWindowsIntegration::DisableArb, QOpenGLStaticContext::extensions, QOpenGLContext::format(), QWindowsOpenGLAdditionalFormat::formatFlags, GLint(), QOpenGLStaticContext::hasExtensions(), QWindowsIntegration::instance(), QSurfaceFormat::OpenGL, QOpenGLStaticContext::opengl32, QWindowsIntegration::options(), qCDebug, qErrnoWarning(), ARB::qSurfaceFormatFromHDC(), GDI::qSurfaceFormatFromPixelFormat(), qWarning, QWindowsGLDirectRendering, QWindowsGLRenderToPixmap, renderingContext(), QSurfaceFormat::setRenderableType(), QOpenGLContext::shareHandle(), QOpenGLStaticContext::sRGBCapableFramebuffer, testFlag(), QWindowsContext::verbose, and QOpenGLStaticContext::wglGetExtensionsStringARB.
|
explicit |
Definition at line 1149 of file qwindowsglcontext.cpp.
References ok, GDI::qSurfaceFormatFromPixelFormat(), and qWarning.
|
override |
Definition at line 1180 of file qwindowsglcontext.cpp.
References QOpenGLStaticContext::opengl32.
|
overridevirtual |
Implements QPlatformOpenGLContext.
Definition at line 1323 of file qwindowsglcontext.cpp.
References QOpenGLStaticContext::opengl32, qCDebug, and QWindowsContext::verbose.
|
inlineoverridevirtual |
Implements QPlatformOpenGLContext.
Definition at line 176 of file qwindowsglcontext.h.
|
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, qCDebug, QWindowsOpengl32DLL::resolve(), and QWindowsContext::verbose.
|
inlineoverridevirtual |
Reimplemented from QPlatformOpenGLContext.
Definition at line 174 of file qwindowsglcontext.h.
References QPlatformOpenGLContext::context(), and QOpenGLContext::shareHandle().
|
inlineoverridevirtual |
Reimplemented from QPlatformOpenGLContext.
Definition at line 175 of file qwindowsglcontext.h.
|
overridevirtual |
Implements QPlatformOpenGLContext.
Definition at line 1254 of file qwindowsglcontext.cpp.
References QSurfaceFormat::DoubleBuffer, findByHWND(), QPlatformSurface::format(), QOpenGLContextData::hdc, QOpenGLContextData::hwnd, QOpenGLStaticContext::opengl32, QWindowsWindow::OpenGLDoubleBuffered, QWindowsWindow::OpenGlPixelFormatInitialized, Q_ASSERT, qCDebug, qErrnoWarning(), QOpenGLContextData::renderingContext, QSurface::supportsOpenGL(), QPlatformSurface::surface(), QSurfaceFormat::swapBehavior(), QSurfaceFormat::swapInterval(), QWindowsContext::verbose, QOpenGLStaticContext::wglSwapInternalExt, and window().
|
inlineoverride |
Definition at line 189 of file qwindowsglcontext.h.
|
inline |
Definition at line 187 of file qwindowsglcontext.h.
Referenced by QWindowsGLContext().
|
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, QWindowsOpengl32DLL::swapBuffers(), and QWindowsContext::verbose.