Skip to content
Snippets Groups Projects
Commit b6878226 authored by Oliver Bock's avatar Oliver Bock
Browse files

Minor fix as calling SDL_FreeSurface is done automatically on SDL_Quit

parent aa3655b7
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,7 @@ bool WindowManager::initialize(const int width, const int height) ...@@ -50,6 +50,7 @@ bool WindowManager::initialize(const int width, const int height)
*/ */
// set common video flags // set common video flags
// (for OpenGL nothing more than SDL_OPENGL and SDL_FULLSCREEN should be used)
m_VideoModeFlags = SDL_OPENGL; m_VideoModeFlags = SDL_OPENGL;
// check fullscreen video mode // check fullscreen video mode
...@@ -105,6 +106,7 @@ bool WindowManager::initialize(const int width, const int height) ...@@ -105,6 +106,7 @@ bool WindowManager::initialize(const int width, const int height)
m_CurrentHeight = m_WindowedHeight; m_CurrentHeight = m_WindowedHeight;
m_VideoModeFlags |= SDL_RESIZABLE; m_VideoModeFlags |= SDL_RESIZABLE;
// finally, get surface
m_DisplaySurface = SDL_SetVideoMode( m_DisplaySurface = SDL_SetVideoMode(
m_CurrentWidth, m_CurrentWidth,
m_CurrentHeight, m_CurrentHeight,
...@@ -211,9 +213,8 @@ void WindowManager::eventLoop() ...@@ -211,9 +213,8 @@ void WindowManager::eventLoop()
else if (event.type == SDL_QUIT || else if (event.type == SDL_QUIT ||
(event.type == SDL_KEYDOWN && event.key.keysym.sym == SDLK_ESCAPE)) { (event.type == SDL_KEYDOWN && event.key.keysym.sym == SDLK_ESCAPE)) {
if (m_DisplaySurface) { // just exit (SDL_FreeSurface is called automatically)
SDL_FreeSurface(m_DisplaySurface); SDL_Quit();
}
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment