CopperSpice API  1.7.2
QPlatformOpenGLContext Class Referenceabstract

Provides an abstraction for native GL contexts. More...

Public Methods

virtual GLuint defaultFramebufferObject (QPlatformSurface *surface) const
 
virtual FP_Void getProcAddress (const QByteArray &procName) = 0
 
virtual void initialize ()
 
virtual void swapBuffers (QPlatformSurface *surface) = 0
 

Friends

class QOpenGLContext
 

Detailed Description

The QPlatformOpenGLContext class provides an abstraction for native GL contexts.

The correct way to support OpenGL technologies which require a native GL context is through the QPlatformOpenGLContext wrapper. There is no factory function for QPlatformOpenGLContexts, but rather only one accessor function. The only place to retrieve a QPlatformOpenGLContext from is through a QPlatformWindow.

The context which is current for a specific thread can be collected by the currentContext() function. This is how QPlatformOpenGLContext also makes it possible to use the GUI module without using QOpenGLWidget.

When using QOpenGLContext::currentContext(), it will ask QPlatformOpenGLContext for the currentContext. Then a corresponding QOpenGLContext will be returned, which maps to the QPlatformOpenGLContext.

Method Documentation

GLuint QPlatformOpenGLContext::defaultFramebufferObject ( QPlatformSurface surface) const
virtual

Reimplement in subclass if your platform uses framebuffer objects for surfaces. The default implementation returns 0.

FP_Void QPlatformOpenGLContext::getProcAddress ( const QByteArray procName)
pure virtual

Reimplement in subclass to native getProcAddr calls.

void QPlatformOpenGLContext::initialize ( )
virtual

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.

void QPlatformOpenGLContext::swapBuffers ( QPlatformSurface surface)
pure virtual

Reimplement in subclass to native swap buffers calls. The implementation must support being called in a thread different than the gui thread.