Permalink
Browse files

UIInterface : GL Context attributes must be set before SDL_Init()

  • Loading branch information...
efyx committed Apr 28, 2017
1 parent 24419ea commit e62986f4427bf0e25d1232212521751259251e67
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Interface/UIInterface.cpp
@@ -69,13 +69,13 @@ void UIInterface::setGLContextAttribute()
bool UIInterface::createWindow(int width, int height)
{
if (!m_Initialized) {
this->setGLContextAttribute();
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS) == -1) {
ndm_logf(NDM_LOG_ERROR, "UIInterface", "Can't init SDL: %s", SDL_GetError());
return false;
}
this->setGLContextAttribute();
m_Win = SDL_CreateWindow(
"nidium", 100, 100, width, height,
SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL /* | SDL_WINDOW_FULLSCREEN*/);

0 comments on commit e62986f

Please sign in to comment.