diff --git a/source/shared_lib/sources/platform/sdl/gl_wrap.cpp b/source/shared_lib/sources/platform/sdl/gl_wrap.cpp index 3250e1a1..4868d5c0 100644 --- a/source/shared_lib/sources/platform/sdl/gl_wrap.cpp +++ b/source/shared_lib/sources/platform/sdl/gl_wrap.cpp @@ -140,10 +140,16 @@ void PlatformContextGl::init(int colorBits, int depthBits, int stencilBits, } if(Window::getIsFullScreen()) { - SDL_SetWindowFullscreen(window,SDL_WINDOW_FULLSCREEN); + SDL_SetWindowDisplayMode(window,NULL); } - else { - SDL_SetWindowFullscreen(window,0); + + if(glcontext != NULL) { + if(Window::getIsFullScreen()) { + SDL_SetWindowFullscreen(window,SDL_WINDOW_FULLSCREEN); + } + else { + SDL_SetWindowFullscreen(window,0); + } } if(glcontext == NULL) { @@ -284,6 +290,11 @@ void PlatformContextGl::init(int colorBits, int depthBits, int stencilBits, //SDL_SetRelativeMouseMode(SDL_TRUE); SDL_SetRelativeMouseMode(SDL_FALSE); + +// if(Window::getIsFullScreen()) +// SDL_SetWindowGrab(window, SDL_TRUE); +// else +// SDL_SetWindowGrab(window, SDL_FALSE); } }