47 #include "../../../eglconvenience/qeglconvenience.h" 49 #include <QtGui/QPlatformGLContext> 50 #include <QtGui/QPlatformWindowFormat> 51 #include <QtCore/QMutex> 55 , mEglDisplay(eglDisplay)
56 , mSurface(EGL_NO_SURFACE)
63 EGLContext shareEGLContext = EGL_NO_CONTEXT;
64 if (sharePlatformContext)
67 eglBindAPI(EGL_OPENGL_ES_API);
70 eglContextAttrs.
append(EGL_CONTEXT_CLIENT_VERSION);
72 eglContextAttrs.
append(EGL_NONE);
75 shareEGLContext, eglContextAttrs.
constData());
95 qWarning(
"makeCurrent with EGL_NO_SURFACE");
103 eglMakeCurrent(
mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
113 return (
void *) eglGetProcAddress(
string.toLatin1().
data());
118 bool wasCurrent =
false;
static const QPlatformGLContext * currentContext()
Returns the last context which called makeCurrent.
void * getProcAddress(const QString &)
Reimplement in subclass to native getProcAddr calls.
void makeCurrent()
Reimplement in subclass to do makeCurrent on native GL context.
EGLConfig q_configFromQPlatformWindowFormat(EGLDisplay display, const QPlatformWindowFormat &format, bool highestPixelFormat, int surfaceType)
virtual void doneCurrent()
Reimplement in subclass to release current context.
The QString class provides a Unicode character string.
void setEglSurface(EGLSurface surface)
void swapBuffers()
Reimplement in subclass to native swap buffers calls.
QPlatformWindowFormat mFormat
void append(const T &t)
Inserts value at the end of the vector.
Q_CORE_EXPORT void qWarning(const char *,...)
static const char * data(const QByteArray &arr)
virtual void makeCurrent()
Reimplement in subclass to do makeCurrent on native GL context.
EGLConfig eglConfig() const
The QPlatformGLContext class provides an abstraction for native GL contexts.
void doneCurrent()
Reimplement in subclass to release current context.
QPlatformWindowFormat qt_qPlatformWindowFormatFromConfig(EGLDisplay display, const EGLConfig config)
const T * constData() const
Returns a const pointer to the data stored in the vector.