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);
glXWaitX();
Drawable::show();
}
+ void copySubBuffer(int x, int y, int width, int height) {
+ glXCopySubBufferMESA(display, window, x, y, width, height);
+
+ processKeys();
+ }
+
void swapBuffers(void) {
glXSwapBuffers(display, window);
void
init(void) {
+ XInitThreads();
+
display = XOpenDisplay(NULL);
if (!display) {
std::cerr << "error: unable to open display " << XDisplayName(NULL) << "\n";
Visual *
createVisual(bool doubleBuffer, Profile profile) {
if (profile != PROFILE_COMPAT &&
- profile != PROFILE_CORE) {
+ profile != PROFILE_CORE &&
+ profile != PROFILE_ES2) {
return NULL;
}
switch (profile) {
case PROFILE_COMPAT:
break;
+ case PROFILE_ES2:
+ attribs.add(GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_ES2_PROFILE_BIT_EXT);
+ break;
case PROFILE_CORE:
// XXX: This will invariable return a 3.2 context, when supported.
// We probably should have a PROFILE_CORE_XX per version.