X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglwindow.cpp;h=3ae559050a406dcdfe6aeddb43925d9fa612a050;hb=935c50bdcc95fe95d39931182461a2b25ac30b9d;hp=530d33719f94567111fba56969fcfc3d3134d88e;hpb=1fbd1b60d9fffe40febe499315347762da007269;p=libs%2Fgui.git diff --git a/source/glwindow.cpp b/source/glwindow.cpp index 530d337..3ae5590 100644 --- a/source/glwindow.cpp +++ b/source/glwindow.cpp @@ -11,8 +11,6 @@ Distributed under the LGPL using namespace std; -#include - namespace Msp { GLDisplayOptions::GLDisplayOptions(): @@ -38,7 +36,7 @@ GLWindow::GLWindow(const DisplayOptions &dopt, const GLDisplayOptions &gl_dopt) GLWindow::~GLWindow() { - glXMakeCurrent(display, window, 0); + glXMakeCurrent(display, 0, 0); glXDestroyContext(display, context); } @@ -77,13 +75,14 @@ void GLWindow::init() if(!context) throw Exception("Couldn't create a GLX context"); - window=XCreateWindow(display, DefaultRootWindow(display), 0, 0, options.width, options.height, 0, CopyFromParent, InputOutput, CopyFromParent, 0, 0); - if(!window) - throw Exception("Couldn't create a window"); - - XSelectInput(display, window, ButtonPressMask|ButtonReleaseMask|PointerMotionMask|KeyPressMask|KeyReleaseMask); + create(); glXMakeCurrent(display, window, context); } +void GLWindow::on_resize() +{ + glViewport(0, 0, options.width, options.height); +} + } // namespace Msp