diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2011-03-07 16:29:24 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-03-07 16:33:28 (GMT) |
commit | d9afcf0e84e438f89c1a8c5e26da51b06d8f61d0 (patch) | |
tree | c5f1bb28b0195b67a47ccf6ed8d007bc7af06435 /src/plugins/platforms/xcb/qxcbconnection.cpp | |
parent | cf264556fdea0d434e329e36c07a0ae6fa974f8b (diff) | |
download | Qt-d9afcf0e84e438f89c1a8c5e26da51b06d8f61d0.zip Qt-d9afcf0e84e438f89c1a8c5e26da51b06d8f61d0.tar.gz Qt-d9afcf0e84e438f89c1a8c5e26da51b06d8f61d0.tar.bz2 |
Lighthouse: Adding Native interface to getting the native eglcontext
in xcbplugin. I also reoredered how eglInitialize was executed,
(its not so lazy anymore)
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index a2f985e..da60311 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -58,6 +58,10 @@ #include <X11/Xlib-xcb.h> #endif +#ifdef XCB_USE_EGL //dont pull in eglext prototypes +#include <EGL/egl.h> +#endif + #ifdef XCB_USE_DRI2 #include <xcb/dri2.h> #include <xcb/xfixes.h> @@ -87,6 +91,13 @@ QXcbConnection::QXcbConnection(const char *displayName) m_connection = XGetXCBConnection(dpy); XSetEventQueueOwner(dpy, XCBOwnsEventQueue); m_xlib_display = dpy; +#ifdef XCB_USE_EGL + EGLDisplay eglDisplay = eglGetDisplay(dpy); + m_egl_display = eglDisplay; + EGLint major, minor; + eglBindAPI(EGL_OPENGL_ES_API); + m_has_egl = eglInitialize(eglDisplay,&major,&minor); +#endif //XCB_USE_EGL #else m_connection = xcb_connect(m_displayName.constData(), &primaryScreen); @@ -432,6 +443,11 @@ void QXcbConnection::initializeAllAtoms() { m_allAtoms[i] = xcb_intern_atom_reply(xcb_connection(), cookies[i], 0)->atom; } +bool QXcbConnection::hasEgl() const +{ + return m_has_egl; +} + #ifdef XCB_USE_DRI2 void QXcbConnection::initializeDri2() { |