X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace%2Fglws_egl_xlib.cpp;h=7e86887510ee549ff9339f798d9cb78ec491b31f;hb=refs%2Fheads%2Fglx-copy-sub-buffer;hp=58824c29b2b897765e0af4c8fe36753e907ef79e;hpb=b14eab55d848d5c0055c4c512c36248e9578ce24;p=apitrace diff --git a/retrace/glws_egl_xlib.cpp b/retrace/glws_egl_xlib.cpp index 58824c2..7e86887 100644 --- a/retrace/glws_egl_xlib.cpp +++ b/retrace/glws_egl_xlib.cpp @@ -92,8 +92,9 @@ public: EGLSurface surface; EGLint api; - EglDrawable(const Visual *vis, int w, int h) : - Drawable(vis, w, h), api(EGL_OPENGL_ES_API) + EglDrawable(const Visual *vis, int w, int h, bool pbuffer) : + Drawable(vis, w, h, pbuffer), + api(EGL_OPENGL_ES_API) { XVisualInfo *visinfo = static_cast(visual)->visinfo; @@ -159,7 +160,7 @@ public: recreate(void) { EGLContext currentContext = eglGetCurrentContext(); EGLSurface currentDrawSurface = eglGetCurrentSurface(EGL_DRAW); - EGLSurface currentReadSurface = eglGetCurrentSurface(EGL_DRAW); + EGLSurface currentReadSurface = eglGetCurrentSurface(EGL_READ); bool rebindDrawSurface = currentDrawSurface == surface; bool rebindReadSurface = currentReadSurface == surface; @@ -192,8 +193,6 @@ public: Drawable::resize(w, h); - XResizeWindow(display, window, w, h); - // Tell the window manager to respect the requested size XSizeHints size_hints; size_hints.max_width = size_hints.min_width = w; @@ -201,6 +200,8 @@ public: size_hints.flags = PMinSize | PMaxSize; XSetWMNormalHints(display, window, &size_hints); + XResizeWindow(display, window, w, h); + waitForEvent(ConfigureNotify); eglWaitNative(EGL_CORE_NATIVE_ENGINE); @@ -243,6 +244,11 @@ public: Drawable::show(); } + void copySubBuffer(int x, int y, int width, int height) { + printf("glws_egl_xlib:copySubBuffer: Not yet implemented\n"); + exit(1); + } + void swapBuffers(void) { eglBindAPI(api); eglSwapBuffers(eglDisplay, surface); @@ -393,9 +399,9 @@ createVisual(bool doubleBuffer, Profile profile) { } Drawable * -createDrawable(const Visual *visual, int width, int height) +createDrawable(const Visual *visual, int width, int height, bool pbuffer) { - return new EglDrawable(visual, width, height); + return new EglDrawable(visual, width, height, pbuffer); } Context *