Add new twindow setter functions: maximize() and center()

This commit is contained in:
Charles Dang 2015-12-23 04:03:07 +11:00
parent cb74629a88
commit d4cd7d5a6d
2 changed files with 21 additions and 0 deletions

View file

@ -71,6 +71,17 @@ void twindow::set_size(const int w, const int h)
SDL_SetWindowSize(window_, w, h);
}
void twindow::center()
{
SDL_SetWindowPosition(window_, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
}
void twindow::maximize()
{
SDL_SetWindowFullscreen(window_, 0);
SDL_MaximizeWindow(window_);
}
void twindow::full_screen()
{
SDL_SetWindowFullscreen(window_, SDL_WINDOW_FULLSCREEN_DESKTOP);

View file

@ -89,6 +89,16 @@ public:
*/
void set_size(const int w, const int h);
/**
* Dummy function for centering the window.
*/
void center();
/**
* Dummy function for setting the maximizing the screen.
*/
void maximize();
/**
* Dummy function for setting the screen to full screen mode.
*