*
**************************************************************************/
+#include <stdlib.h>
+#include <iostream>
+
#include "glimports.hpp"
#include "glws.hpp"
void
resize(unsigned w, unsigned h) {
+ glXWaitGL();
Drawable::resize(w, h);
XResizeWindow(display, window, w, h);
+ glXWaitX();
}
void swapBuffers(void) {
public:
GlxWindowSystem() {
display = XOpenDisplay(NULL);
+ if (!display) {
+ std::cerr << "error: unable to open display " << XDisplayName(NULL) << "\n";
+ exit(1);
+ }
screen = DefaultScreen(display);
}
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DEPTH_SIZE, 1,
+ GLX_STENCIL_SIZE, 1,
None
};
GLX_BLUE_SIZE, 1,
GLX_DOUBLEBUFFER,
GLX_DEPTH_SIZE, 1,
+ GLX_STENCIL_SIZE, 1,
None
};
makeCurrent(Drawable *drawable, Context *context)
{
if (!drawable || !context) {
- return glXMakeCurrent(display, NULL, NULL);
+ return glXMakeCurrent(display, None, NULL);
} else {
GlxDrawable *glxDrawable = dynamic_cast<GlxDrawable *>(drawable);
GlxContext *glxContext = dynamic_cast<GlxContext *>(context);