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

#include <qcocoaglcontext.h>

+ Inheritance diagram for QCocoaGLContext:
+ Collaboration diagram for QCocoaGLContext:

Public Member Functions

 QCocoaGLContext (QOpenGLContext *context)
 
 QCocoaGLContext (NSOpenGLContext *context)
 
 ~QCocoaGLContext ()
 
void initialize () override
 Called after a new instance is constructed.
 
bool makeCurrent (QPlatformSurface *surface) override
 
void swapBuffers (QPlatformSurface *surface) override
 Reimplement in subclass to native swap buffers calls.
 
void doneCurrent () override
 
void update ()
 
QSurfaceFormat format () const override
 
bool isSharing () const override
 
bool isValid () const override
 
NSOpenGLContext * nativeContext () const override
 
QFunctionPointer getProcAddress (const char *procName) override
 Reimplement in subclass to allow dynamic querying of OpenGL symbols.
 
- 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
 

Friends

QDebug operator<< (QDebug debug, const QCocoaGLContext *screen)
 

Additional Inherited Members

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

Detailed Description

Definition at line 22 of file qcocoaglcontext.h.

Constructor & Destructor Documentation

◆ QCocoaGLContext() [1/2]

QCocoaGLContext::QCocoaGLContext ( QOpenGLContext * context)

Definition at line 27 of file qcocoaglcontext.mm.

◆ QCocoaGLContext() [2/2]

QCocoaGLContext::QCocoaGLContext ( NSOpenGLContext * context)

Definition at line 33 of file qcocoaglcontext.mm.

References nativeContext().

+ Here is the call graph for this function:

◆ ~QCocoaGLContext()

QCocoaGLContext::~QCocoaGLContext ( )

Definition at line 308 of file qcocoaglcontext.mm.

References release().

+ Here is the call graph for this function:

Member Function Documentation

◆ doneCurrent()

void QCocoaGLContext::doneCurrent ( )
overridevirtual

Implements QPlatformOpenGLContext.

Definition at line 467 of file qcocoaglcontext.mm.

References QThread::currentThread(), pool, and qCDebug.

+ Here is the call graph for this function:

◆ format()

QSurfaceFormat QCocoaGLContext::format ( ) const
overridevirtual

Implements QPlatformOpenGLContext.

Definition at line 481 of file qcocoaglcontext.mm.

◆ getProcAddress()

QFunctionPointer QCocoaGLContext::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 501 of file qcocoaglcontext.mm.

◆ initialize()

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

Definition at line 39 of file qcocoaglcontext.mm.

References QSurfaceFormat::alphaBufferSize(), QPlatformOpenGLContext::context(), QSurfaceFormat::DefaultRenderableType, QOpenGLContext::format(), GLint(), nativeContext(), QSurfaceFormat::OpenGL, qCDebug, qCWarning, qMakePair(), QSurfaceFormat::renderableType(), QSurfaceFormat::setRenderableType(), QSurfaceFormat::setVersion(), QSurfaceFormat::swapInterval(), and QSurfaceFormat::version().

+ Here is the call graph for this function:

◆ isSharing()

bool QCocoaGLContext::isSharing ( ) const
overridevirtual

Reimplemented from QPlatformOpenGLContext.

Definition at line 491 of file qcocoaglcontext.mm.

◆ isValid()

bool QCocoaGLContext::isValid ( ) const
overridevirtual

Reimplemented from QPlatformOpenGLContext.

Definition at line 486 of file qcocoaglcontext.mm.

◆ makeCurrent()

bool QCocoaGLContext::makeCurrent ( QPlatformSurface * surface)
overridevirtual

Implements QPlatformOpenGLContext.

Definition at line 313 of file qcocoaglcontext.mm.

References QThread::currentThread(), QBasicAtomicInteger< T >::fetchAndStoreRelaxed(), pool, Q_ASSERT, qCDebug, QSurface::supportsOpenGL(), QPlatformSurface::surface(), QSurface::surfaceClass(), update(), and QSurface::Window.

+ Here is the call graph for this function:

◆ nativeContext()

NSOpenGLContext * QCocoaGLContext::nativeContext ( ) const
override
Returns
the underlying NSOpenGLContext.

Definition at line 496 of file qcocoaglcontext.mm.

Referenced by QCocoaGLContext(), and initialize().

+ Here is the caller graph for this function:

◆ swapBuffers()

void QCocoaGLContext::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 434 of file qcocoaglcontext.mm.

References QThread::currentThread(), QSurface::Offscreen, pool, qCDebug, qCInfo, qCWarning, s_reentrancyMutex, QPlatformSurface::surface(), and QSurface::surfaceClass().

+ Here is the call graph for this function:

◆ update()

void QCocoaGLContext::update ( )

Definition at line 422 of file qcocoaglcontext.mm.

References pool, qCInfo, QT_IGNORE_DEPRECATIONS, s_reentrancyMutex, and update().

Referenced by makeCurrent(), and update().

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

Friends And Related Symbol Documentation

◆ operator<<

QDebug operator<< ( QDebug debug,
const QCocoaGLContext * screen )
friend

Definition at line 507 of file qcocoaglcontext.mm.


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