Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QGLXContext Class Reference

#include <qglxintegration.h>

+ Inheritance diagram for QGLXContext:
+ Collaboration diagram for QGLXContext:

Public Member Functions

 QGLXContext (Display *display, QXcbScreen *screen, const QSurfaceFormat &format, QPlatformOpenGLContext *share)
 
 QGLXContext (Display *display, GLXContext context, void *visualInfo, QPlatformOpenGLContext *share)
 
 ~QGLXContext ()
 
bool makeCurrent (QPlatformSurface *surface) override
 
void doneCurrent () override
 
void swapBuffers (QPlatformSurface *surface) override
 Reimplement in subclass to native swap buffers calls.
 
QFunctionPointer getProcAddress (const char *procName) override
 Reimplement in subclass to allow dynamic querying of OpenGL symbols.
 
QSurfaceFormat format () const override
 
bool isSharing () const override
 
bool isValid () const override
 
GLXContext nativeContext () const override
 
GLXContext glxContext () const
 
GLXFBConfig glxConfig () const
 
- Public Member Functions inherited from QPlatformOpenGLContext
 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.
 
QOpenGLContextcontext () const
 

Static Public Member Functions

static bool supportsThreading ()
 
static void queryDummyContext ()
 
- Static Public Member Functions inherited from QPlatformOpenGLContext
static bool parseOpenGLVersion (const QByteArray &versionString, int &major, int &minor)
 

Detailed Description

Definition at line 20 of file qglxintegration.h.

Constructor & Destructor Documentation

◆ QGLXContext() [1/2]

QGLXContext::QGLXContext ( Display display,
QXcbScreen screen,
const QSurfaceFormat format,
QPlatformOpenGLContext share 
)

◆ QGLXContext() [2/2]

QGLXContext::QGLXContext ( Display display,
GLXContext  context,
void visualInfo,
QPlatformOpenGLContext share 
)

◆ ~QGLXContext()

QGLXContext::~QGLXContext ( )

Definition at line 454 of file qglxintegration.cpp.

Member Function Documentation

◆ doneCurrent()

void QGLXContext::doneCurrent ( )
overridevirtual

Implements QPlatformOpenGLContext.

Definition at line 532 of file qglxintegration.cpp.

◆ format()

QSurfaceFormat QGLXContext::format ( ) const
overridevirtual

Implements QPlatformOpenGLContext.

Definition at line 565 of file qglxintegration.cpp.

◆ getProcAddress()

QFunctionPointer QGLXContext::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 560 of file qglxintegration.cpp.

◆ glxConfig()

GLXFBConfig QGLXContext::glxConfig ( ) const
inline

Definition at line 40 of file qglxintegration.h.

◆ glxContext()

GLXContext QGLXContext::glxContext ( ) const
inline

Definition at line 39 of file qglxintegration.h.

Referenced by QGLXContext(), QGLXContext(), and nativeContext().

+ Here is the caller graph for this function:

◆ isSharing()

bool QGLXContext::isSharing ( ) const
overridevirtual

Reimplemented from QPlatformOpenGLContext.

Definition at line 570 of file qglxintegration.cpp.

◆ isValid()

bool QGLXContext::isValid ( ) const
overridevirtual

Reimplemented from QPlatformOpenGLContext.

Definition at line 575 of file qglxintegration.cpp.

◆ makeCurrent()

bool QGLXContext::makeCurrent ( QPlatformSurface surface)
overridevirtual

Implements QPlatformOpenGLContext.

Definition at line 471 of file qglxintegration.cpp.

References QListSpecialMethodsBase< T >::contains(), QPlatformSurface::format(), QSurface::Offscreen, QGLXPbuffer::pbuffer(), Q_ASSERT, screen, screenForPlatformSurface(), QByteArray::split(), QSurface::supportsOpenGL(), QPlatformSurface::surface(), QSurface::surfaceClass(), QSurfaceFormat::swapInterval(), void, QSurface::Window, and window().

+ Here is the call graph for this function:

◆ nativeContext()

GLXContext QGLXContext::nativeContext ( ) const
inlineoverride

Definition at line 37 of file qglxintegration.h.

References glxContext().

+ Here is the call graph for this function:

◆ queryDummyContext()

void QGLXContext::queryDummyContext ( )
static

◆ supportsThreading()

bool QGLXContext::supportsThreading ( )
static

Definition at line 714 of file qglxintegration.cpp.

References queryDummyContext().

Referenced by QXcbGlxIntegration::supportsThreadedOpenGL().

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

◆ swapBuffers()

void QGLXContext::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 541 of file qglxintegration.cpp.

References QXcbWindow::needsSync(), QSurface::Offscreen, QXcbWindow::postSyncWindowRequest(), QPlatformSurface::surface(), QSurface::surfaceClass(), QSurface::Window, and xcb_window().

+ Here is the call graph for this function:

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