Send resolution change notification when window is resized.

This commit is contained in:
King_DuckZ 2014-03-12 20:27:11 +01:00
parent 0c6275f41c
commit b627b69221
3 changed files with 20 additions and 3 deletions

View file

@ -75,7 +75,7 @@ namespace cloonel {
throw std::runtime_error(SDL_GetError());
parInitSDL.initialized = true;
SDL_Window* const win = SDL_CreateWindow(m_gameName.c_str(), 100, 100, m_WH.x(), m_WH.y(), SDL_WINDOW_SHOWN);
SDL_Window* const win = SDL_CreateWindow(m_gameName.c_str(), 100, 100, m_WH.x(), m_WH.y(), SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE);
if (!win)
throw std::runtime_error(SDL_GetError());
parInitSDL.window = win;
@ -105,4 +105,11 @@ namespace cloonel {
else
return nullptr;
}
///------------------------------------------------------------------------
///------------------------------------------------------------------------
void SDLMain::SetResolution (ushort2 parRes) {
m_WHScaling = GetScaling(parRes, m_WHRef);
m_WH = parRes;
}
} //namespace cloonel