summaryrefslogtreecommitdiff
path: root/glws_glx.cpp
diff options
context:
space:
mode:
authorJosé Fonseca <jose.r.fonseca@gmail.com>2011-04-09 16:09:31 +0100
committerJosé Fonseca <jose.r.fonseca@gmail.com>2011-04-09 16:09:31 +0100
commitce6bcdd4395c9efec37a26f6c1caf8944d75f6d0 (patch)
tree2564f83fee6ec322139f13ca7cc887c511f770d4 /glws_glx.cpp
parent0b210a5f07344b85d9d04348daa9078db622eb6a (diff)
Implement glws for WGL.
Diffstat (limited to 'glws_glx.cpp')
-rw-r--r--glws_glx.cpp31
1 files changed, 9 insertions, 22 deletions
diff --git a/glws_glx.cpp b/glws_glx.cpp
index be0a82b..3e25dc3 100644
--- a/glws_glx.cpp
+++ b/glws_glx.cpp
@@ -98,12 +98,9 @@ private:
int screen;
public:
- Drawable *currentDrawable;
- Context *currentContext;
-
XlibWindowSystem() {
- display = XOpenDisplay(NULL);
- screen = DefaultScreen(display);
+ display = XOpenDisplay(NULL);
+ screen = DefaultScreen(display);
}
~XlibWindowSystem() {
@@ -199,27 +196,17 @@ public:
Window win = drawable ? dynamic_cast<XlibDrawable *>(drawable)->window : NULL;
GLXContext ctx = context ? dynamic_cast<XlibContext *>(context)->context : NULL;
- bool ret = glXMakeCurrent(display, win, ctx);
-
- if (drawable && context && ret) {
- currentDrawable = drawable;
- currentContext = context;
- } else {
- currentDrawable = NULL;
- currentContext = NULL;
- }
-
- return ret;
+ return glXMakeCurrent(display, win, ctx);
}
bool
processEvents(void) {
- while (XPending(display) > 0) {
- XEvent event;
- XNextEvent(display, &event);
- // TODO
- }
- return true;
+ while (XPending(display) > 0) {
+ XEvent event;
+ XNextEvent(display, &event);
+ // TODO
+ }
+ return true;
}
};