44 #include <QtCore/QThreadStorage> 45 #include <QtCore/QThread> 75 void (*qGLContextDeleteFunction)(
void *handle);
88 qWarning(
"No QTLS available. currentContext wont work");
152 return d->qGLContextHandle;
158 d->qGLContextHandle = handle;
159 d->qGLContextDeleteFunction = qGLContextDeleteFunction;
165 if (
d->qGLContextDeleteFunction &&
d->qGLContextHandle) {
166 d->qGLContextDeleteFunction(
d->qGLContextHandle);
167 d->qGLContextDeleteFunction = 0;
168 d->qGLContextHandle = 0;
static const QPlatformGLContext * currentContext()
Returns the last context which called makeCurrent.
virtual void doneCurrent()
Reimplement in subclass to release current context.
static QThreadStorage< QPlatformGLThreadContext * > qplatformgl_context_storage
virtual ~QPlatformGLContextPrivate()
static void setCurrentContext(QPlatformGLContext *context)
static QThread * currentThread()
Returns a pointer to a QThread which manages the currently executing thread.
T & localData()
Returns a reference to the data that was set by the calling thread.
QPlatformGLContext * context
Q_CORE_EXPORT void qWarning(const char *,...)
virtual void makeCurrent()
Reimplement in subclass to do makeCurrent on native GL context.
QPlatformGLContextPrivate()
virtual ~QPlatformGLContext()
If this is the current context for the thread, doneCurrent is called.
The QPlatformGLContext class provides an abstraction for native GL contexts.
static QPlatformGLContext * staticSharedContext
void setLocalData(T t)
Sets the local data for the calling thread to data.
void setQGLContextHandle(void *handle, void(*qGLContextDeleteFunction)(void *))
~QPlatformGLThreadContext()
QPlatformGLContext()
All subclasses needs to specify the platformWindow.
The QThreadStorage class provides per-thread data storage.
void * qGLContextHandle() const