using namespace std;
-#include <iostream>
-
namespace Msp {
GLDisplayOptions::GLDisplayOptions():
GLWindow::~GLWindow()
{
- glXMakeCurrent(display, window, 0);
+ glXMakeCurrent(display, 0, 0);
glXDestroyContext(display, context);
}
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