Add new twindow setter functions: maximize() and center()
This commit is contained in:
parent
cb74629a88
commit
d4cd7d5a6d
2 changed files with 21 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue