Browse Source

EglContext: Show window on exec(), make the context current only once.

pull/279/head
Vladimír Vondruš 14 years ago
parent
commit
b7df327466
  1. 7
      src/Contexts/EglContext.cpp

7
src/Contexts/EglContext.cpp

@ -98,8 +98,7 @@ EglContext::EglContext(int&, char**, const string& title, const Math::Vector2<GL
exit(1); exit(1);
} }
/* Show window and set OpenGL context as current */ /* Set OpenGL context as current */
XMapWindow(xDisplay, xWindow);
eglMakeCurrent(display, surface, surface, context); eglMakeCurrent(display, surface, surface, context);
/** @bug Fixme: GLEW initialization fails (thinks that the context is not created) */ /** @bug Fixme: GLEW initialization fails (thinks that the context is not created) */
@ -125,12 +124,14 @@ EglContext::~EglContext() {
} }
int EglContext::exec() { int EglContext::exec() {
/* Show window */
XMapWindow(xDisplay, xWindow);
/* Call viewportEvent for the first time */ /* Call viewportEvent for the first time */
viewportEvent(viewportSize); viewportEvent(viewportSize);
while(true) { while(true) {
/** @todo Handle at least window closing and resizing */ /** @todo Handle at least window closing and resizing */
eglMakeCurrent(display, surface, surface, context);
drawEvent(); drawEvent();
} }

Loading…
Cancel
Save