45 #include <QtGui/QPlatformWindow> 53 , m_eglDisplay(display)
54 , m_eglSurface(surface)
58 qWarning(
"Createing QEGLPlatformContext with no surface");
62 EGLContext shareEglContext = shareContext ? shareContext->
eglContext() : 0;
65 qWarning(
"Could not create the egl context\n");
75 #ifdef QEGL_EXTRA_DEBUG 76 qWarning(
"QEglContext::~QEglContext(): %p\n",
this);
93 #ifdef QEGL_EXTRA_DEBUG 94 qWarning(
"QEglContext::makeCurrent: %p\n",
this);
99 qWarning(
"QEGLPlatformContext::makeCurrent: eglError: %d, this: %p \n", eglGetError(),
this);
100 #ifdef QEGL_EXTRA_DEBUG 104 const char *str = (
const char*)glGetString(
GL_VENDOR);
123 #ifdef QEGL_EXTRA_DEBUG 124 qWarning(
"QEglContext::doneCurrent:%p\n",
this);
127 bool ok = eglMakeCurrent(
m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
129 qWarning(
"QEGLPlatformContext::doneCurrent(): eglError: %d, this: %p \n", eglGetError(),
this);
133 #ifdef QEGL_EXTRA_DEBUG 134 qWarning(
"QEglContext::swapBuffers:%p\n",
this);
139 qWarning(
"QEGLPlatformContext::swapBuffers(): eglError: %d, this: %p \n", eglGetError(),
this);
143 #ifdef QEGL_EXTRA_DEBUG 144 qWarning(
"QEglContext::getProcAddress%p\n",
this);
147 return (
void *)eglGetProcAddress(
qPrintable(procName));
void makeCurrent()
Reimplement in subclass to do makeCurrent on native GL context.
void * getProcAddress(const QString &procName)
Reimplement in subclass to native getProcAddr calls.
QPlatformWindowFormat m_windowFormat
virtual void doneCurrent()
Reimplement in subclass to release current context.
EGLContext eglContext() const
The QString class provides a Unicode character string.
Q_GUI_EXPORT EGLDisplay display()
QEGLPlatformContext(EGLDisplay display, EGLConfig config, EGLint contextAttrs[], EGLSurface surface, EGLenum eglApi, QEGLPlatformContext *shareContext=0)
Q_CORE_EXPORT void qWarning(const char *,...)
virtual void makeCurrent()
Reimplement in subclass to do makeCurrent on native GL context.
void swapBuffers()
Reimplement in subclass to native swap buffers calls.
Q_CORE_EXPORT void qFatal(const char *,...)
QPlatformWindowFormat platformWindowFormat() const
QWidget has the function qplatformWindowFormat().
The QPlatformGLContext class provides an abstraction for native GL contexts.
QPlatformWindowFormat qt_qPlatformWindowFormatFromConfig(EGLDisplay display, const EGLConfig config)
#define showDebug(f, iface)
#define qPrintable(string)
#define GL_SHADING_LANGUAGE_VERSION
void doneCurrent()
Reimplement in subclass to release current context.