Qt 4.8
|
The QPlatformGLContext class provides an abstraction for native GL contexts. More...
#include <qplatformglcontext_qpa.h>
Public Functions | |
virtual void | doneCurrent () |
Reimplement in subclass to release current context. More... | |
virtual void * | getProcAddress (const QString &procName)=0 |
Reimplement in subclass to native getProcAddr calls. More... | |
virtual void | makeCurrent () |
Reimplement in subclass to do makeCurrent on native GL context. More... | |
virtual QPlatformWindowFormat | platformWindowFormat () const =0 |
QWidget has the function qplatformWindowFormat(). More... | |
QPlatformGLContext () | |
All subclasses needs to specify the platformWindow. More... | |
virtual void | swapBuffers ()=0 |
Reimplement in subclass to native swap buffers calls. More... | |
virtual | ~QPlatformGLContext () |
If this is the current context for the thread, doneCurrent is called. More... | |
Static Public Functions | |
static const QPlatformGLContext * | currentContext () |
Returns the last context which called makeCurrent. More... | |
Protected Variables | |
QScopedPointer< QPlatformGLContextPrivate > | d_ptr |
Private Functions | |
void | deleteQGLContext () |
Q_DECLARE_PRIVATE (QPlatformGLContext) | |
Q_DISABLE_COPY (QPlatformGLContext) | |
void * | qGLContextHandle () const |
void | setQGLContextHandle (void *handle, void(*qGLContextDeleteFunction)(void *)) |
Friends | |
class | QGLContext |
class | QWidgetPrivate |
The QPlatformGLContext class provides an abstraction for native GL contexts.
In QPA the way to support OpenGL or OpenVG or other technologies that requires a native GL context is through the QPlatformGLContext wrapper.
There is no factory function for QPlatformGLContexts, but rather only one accessor function. The only place to retrieve a QPlatformGLContext from is through a QPlatformWindow.
The context which is current for a specific thread can be collected by the currentContext() function. This is how QPlatformGLContext also makes it possible to use the QtOpenGL module withhout using QGLWidget. When using QGLContext::currentContext(), it will ask QPlatformGLContext for the currentContext. Then a corresponding QGLContext will be returned, which maps to the QPlatformGLContext.
Definition at line 56 of file qplatformglcontext_qpa.h.
|
explicit |
All subclasses needs to specify the platformWindow.
It can be a null window.
Definition at line 112 of file qplatformglcontext_qpa.cpp.
|
virtual |
If this is the current context for the thread, doneCurrent is called.
Definition at line 120 of file qplatformglcontext_qpa.cpp.
|
static |
Returns the last context which called makeCurrent.
This function is thread aware.
Definition at line 100 of file qplatformglcontext_qpa.cpp.
Referenced by QDri2Context::QDri2Context(), QWaylandGLContext::setEglSurface(), QWaylandReadbackEglContext::swapBuffers(), QWaylandReadbackGlxContext::swapBuffers(), and ~QPlatformGLContext().
|
private |
Definition at line 162 of file qplatformglcontext_qpa.cpp.
|
virtual |
Reimplement in subclass to release current context.
Typically this is calling makeCurrent with 0 "surface"
Reimplemented in EAGLPlatformContext, QBBGLContext, QGLXContext, QWaylandXCompositeGLXContext, QGLXContext, QWaylandReadbackEglContext, QWaylandReadbackGlxContext, QWaylandXCompositeEGLContext, QDri2Context, QWaylandGLContext, QDirectFbGLContext, and QEGLPlatformContext.
Definition at line 140 of file qplatformglcontext_qpa.cpp.
Referenced by QDirectFbGLContext::doneCurrent(), QEGLPlatformContext::doneCurrent(), QWaylandGLContext::doneCurrent(), QWaylandReadbackGlxContext::doneCurrent(), QWaylandXCompositeEGLContext::doneCurrent(), QWaylandReadbackEglContext::doneCurrent(), QDri2Context::doneCurrent(), QGLXContext::doneCurrent(), QWaylandXCompositeGLXContext::doneCurrent(), QBBGLContext::doneCurrent(), EAGLPlatformContext::doneCurrent(), QGLXContext::QGLXContext(), ~QPlatformGLContext(), and QPlatformGLThreadContext::~QPlatformGLThreadContext().
|
pure virtual |
Reimplement in subclass to native getProcAddr calls.
Note: its convenient to use qPrintable(const QString &str) to get the const char * pointer
Implemented in EAGLPlatformContext, QBBGLContext, QGLXContext, QWaylandXCompositeGLXContext, QGLXContext, QWaylandReadbackEglContext, QWaylandReadbackGlxContext, QWaylandXCompositeEGLContext, QDri2Context, QWaylandGLContext, QDirectFbGLContext, and QEGLPlatformContext.
|
virtual |
Reimplement in subclass to do makeCurrent on native GL context.
Reimplemented in EAGLPlatformContext, QBBGLContext, QGLXContext, QWaylandXCompositeGLXContext, QGLXContext, QWaylandReadbackEglContext, QWaylandReadbackGlxContext, QWaylandXCompositeEGLContext, QDri2Context, QWaylandGLContext, QDirectFbGLContext, and QEGLPlatformContext.
Definition at line 131 of file qplatformglcontext_qpa.cpp.
Referenced by QDirectFbGLContext::makeCurrent(), QEGLPlatformContext::makeCurrent(), QWaylandGLContext::makeCurrent(), QWaylandReadbackEglContext::makeCurrent(), QWaylandXCompositeEGLContext::makeCurrent(), QDri2Context::makeCurrent(), QWaylandReadbackGlxContext::makeCurrent(), QGLXContext::makeCurrent(), QWaylandXCompositeGLXContext::makeCurrent(), QBBGLContext::makeCurrent(), EAGLPlatformContext::makeCurrent(), and QGLXContext::QGLXContext().
|
pure virtual |
QWidget has the function qplatformWindowFormat().
That function is for the application programmer to request the format of the window and the context that he wants.
Reimplement this function in a subclass to indicate what format the glContext actually has.
Implemented in EAGLPlatformContext, QGLXContext, QBBGLContext, QWaylandXCompositeGLXContext, QGLXContext, QDri2Context, QWaylandReadbackEglContext, QWaylandReadbackGlxContext, QWaylandXCompositeEGLContext, QWaylandGLContext, QDirectFbGLContext, and QEGLPlatformContext.
Referenced by QGLWidget::event().
|
private |
|
private |
|
private |
Definition at line 149 of file qplatformglcontext_qpa.cpp.
Referenced by QGLWidget::event().
|
private |
Definition at line 155 of file qplatformglcontext_qpa.cpp.
|
pure virtual |
Reimplement in subclass to native swap buffers calls.
Implemented in EAGLPlatformContext, QBBGLContext, QGLXContext, QWaylandXCompositeGLXContext, QGLXContext, QWaylandReadbackEglContext, QWaylandReadbackGlxContext, QWaylandXCompositeEGLContext, QDri2Context, QWaylandGLContext, QDirectFbGLContext, and QEGLPlatformContext.
Referenced by QWaylandGLWindowSurface::flush().
|
friend |
Definition at line 78 of file qplatformglcontext_qpa.h.
|
friend |
Definition at line 79 of file qplatformglcontext_qpa.h.
|
protected |
Definition at line 74 of file qplatformglcontext_qpa.h.