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<const EglVisual *>(visual)->visinfo;
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;
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;
size_hints.flags = PMinSize | PMaxSize;
XSetWMNormalHints(display, window, &size_hints);
+ XResizeWindow(display, window, w, h);
+
waitForEvent(ConfigureNotify);
eglWaitNative(EGL_CORE_NATIVE_ENGINE);
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);
}
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 *