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
QEGLPlatformContext Class Referenceabstract

An EGL context implementation. More...

#include <qeglplatformcontext_p.h>

Inheritance diagram for QEGLPlatformContext:
Collaboration diagram for QEGLPlatformContext:

Public Types

enum  Flag { NoSurfaceless = 0x01 }

Public Member Functions

 QEGLPlatformContext (const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, EGLConfig *config=nullptr, Flags flags={ })
 ~QEGLPlatformContext ()
void initialize () override
 Called after a new instance is constructed.
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
EGLContext nativeContext () const override
EGLConfig config () const override
EGLDisplay display () const override
virtual void invalidateContext () override
EGLContext eglContext () const
EGLDisplay eglDisplay () const
EGLConfig eglConfig () const
Public Member Functions inherited from QPlatformOpenGLContext
 QPlatformOpenGLContext ()
virtual ~QPlatformOpenGLContext ()
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

Static Public Member Functions

template<typename T>
static QOpenGLContextcreateFrom (EGLContext context, EGLDisplay contextDisplay, EGLDisplay platformDisplay, QOpenGLContext *shareContext)
Static Public Member Functions inherited from QPlatformOpenGLContext
static bool parseOpenGLVersion (const QByteArray &versionString, int &major, int &minor)

Protected Member Functions

 QEGLPlatformContext ()
virtual EGLSurface eglSurfaceForPlatformSurface (QPlatformSurface *surface)=0
virtual EGLSurface createTemporaryOffscreenSurface ()
virtual void destroyTemporaryOffscreenSurface (EGLSurface surface)
virtual void runGLChecks ()
bool checkGraphicsReset ()

Detailed Description

An EGL context implementation.

Since
5.2

Implement QPlatformOpenGLContext using EGL. To use it in platform plugins a subclass must be created since eglSurfaceForPlatformSurface() has to be reimplemented. This function is used for mapping platform surfaces (windows) to EGL surfaces and is necessary since different platform plugins may have different ways of handling native windows (for example, a plugin may choose not to back every platform window by a real EGL surface). Other than that, no further customization is necessary.

Definition at line 27 of file qeglplatformcontext_p.h.

Member Enumeration Documentation

◆ Flag

Enumerator
NoSurfaceless 

Definition at line 31 of file qeglplatformcontext_p.h.

Constructor & Destructor Documentation

◆ QEGLPlatformContext() [1/2]

QEGLPlatformContext::QEGLPlatformContext ( const QSurfaceFormat & format,
QPlatformOpenGLContext * share,
EGLDisplay display,
EGLConfig * config = nullptr,
Flags flags = { } )

Definition at line 112 of file qeglplatformcontext.cpp.

◆ ~QEGLPlatformContext()

QEGLPlatformContext::~QEGLPlatformContext ( )

Definition at line 535 of file qeglplatformcontext.cpp.

◆ QEGLPlatformContext() [2/2]

QEGLPlatformContext::QEGLPlatformContext ( )
inlineprotected

Definition at line 85 of file qeglplatformcontext_p.h.

Member Function Documentation

◆ checkGraphicsReset()

bool QEGLPlatformContext::checkGraphicsReset ( )
protected

Definition at line 985 of file qeglplatformcontext.cpp.

◆ config()

EGLConfig QEGLPlatformContext::config ( ) const
inlineoverride

Definition at line 75 of file qeglplatformcontext_p.h.

◆ createFrom()

template<typename T>
QOpenGLContext * QEGLPlatformContext::createFrom ( EGLContext context,
EGLDisplay contextDisplay,
EGLDisplay platformDisplay,
QOpenGLContext * shareContext )
inlinestatic

Definition at line 40 of file qeglplatformcontext_p.h.

◆ createTemporaryOffscreenSurface()

EGLSurface QEGLPlatformContext::createTemporaryOffscreenSurface ( )
protectedvirtual

Reimplemented in QEglFSContext, and QtWaylandClient::QWaylandGLContext.

Definition at line 316 of file qeglplatformcontext.cpp.

◆ destroyTemporaryOffscreenSurface()

void QEGLPlatformContext::destroyTemporaryOffscreenSurface ( EGLSurface surface)
protectedvirtual

Reimplemented in QEglFSContext, and QtWaylandClient::QWaylandGLContext.

Definition at line 334 of file qeglplatformcontext.cpp.

◆ display()

EGLDisplay QEGLPlatformContext::display ( ) const
inlineoverride

Definition at line 76 of file qeglplatformcontext_p.h.

◆ doneCurrent()

void QEGLPlatformContext::doneCurrent ( )
overridevirtual

◆ eglConfig()

EGLConfig QEGLPlatformContext::eglConfig ( ) const

Definition at line 980 of file qeglplatformcontext.cpp.

◆ eglContext()

EGLContext QEGLPlatformContext::eglContext ( ) const

Definition at line 970 of file qeglplatformcontext.cpp.

◆ eglDisplay()

EGLDisplay QEGLPlatformContext::eglDisplay ( ) const

Definition at line 975 of file qeglplatformcontext.cpp.

◆ eglSurfaceForPlatformSurface()

◆ format()

QSurfaceFormat QEGLPlatformContext::format ( ) const
overridevirtual

Implements QPlatformOpenGLContext.

Definition at line 965 of file qeglplatformcontext.cpp.

◆ getProcAddress()

QFunctionPointer QEGLPlatformContext::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 562 of file qeglplatformcontext.cpp.

◆ initialize()

void QEGLPlatformContext::initialize ( )
overridevirtual

Called after a new instance is constructed.

The default implementation does nothing.

Subclasses can use this function to perform additional initialization that relies on virtual functions.

Reimplemented from QPlatformOpenGLContext.

Reimplemented in QtWaylandClient::QWaylandGLContext.

Definition at line 308 of file qeglplatformcontext.cpp.

◆ invalidateContext()

virtual void QEGLPlatformContext::invalidateContext ( )
inlineoverridevirtual

Definition at line 78 of file qeglplatformcontext_p.h.

◆ isSharing()

bool QEGLPlatformContext::isSharing ( ) const
inlineoverridevirtual

Reimplemented from QPlatformOpenGLContext.

Definition at line 71 of file qeglplatformcontext_p.h.

◆ isValid()

bool QEGLPlatformContext::isValid ( ) const
inlineoverridevirtual

Reimplemented from QPlatformOpenGLContext.

Definition at line 72 of file qeglplatformcontext_p.h.

◆ makeCurrent()

bool QEGLPlatformContext::makeCurrent ( QPlatformSurface * surface)
overridevirtual

◆ nativeContext()

EGLContext QEGLPlatformContext::nativeContext ( ) const
inlineoverride

Definition at line 74 of file qeglplatformcontext_p.h.

◆ runGLChecks()

void QEGLPlatformContext::runGLChecks ( )
protectedvirtual

Reimplemented in QEglFSContext, and QtWaylandClient::QWaylandGLContext.

Definition at line 339 of file qeglplatformcontext.cpp.

◆ swapBuffers()

void QEGLPlatformContext::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.

Reimplemented in QQnxGLContext, QtWaylandClient::QWaylandGLContext, and QXcbEglContext.

Definition at line 551 of file qeglplatformcontext.cpp.


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