mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Added love.window (issue #6.) All window-related functions have been moved from love.graphics to love.window.
love.graphics.setCaption has been renamed to love.window.setTitle.
This commit is contained in:
@@ -55,8 +55,12 @@ Window::_currentMode::_currentMode()
|
||||
{
|
||||
}
|
||||
|
||||
bool Window::setWindow(int width, int height, WindowFlags *flags)
|
||||
bool Window::setWindow(int width, int height, graphics::Graphics *graphics, WindowFlags *flags)
|
||||
{
|
||||
|
||||
if (graphics)
|
||||
graphics->unSetMode();
|
||||
|
||||
bool fullscreen = false;
|
||||
bool vsync = true;
|
||||
int fsaa = 0;
|
||||
@@ -186,6 +190,9 @@ bool Window::setWindow(int width, int height, WindowFlags *flags)
|
||||
currentMode.flags.borderless = ((surface->flags & SDL_NOFRAME) != 0);
|
||||
currentMode.flags.centered = centered;
|
||||
|
||||
if (graphics)
|
||||
graphics->setMode(width, height);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
Window();
|
||||
~Window();
|
||||
|
||||
bool setWindow(int width = 800, int height = 600, WindowFlags *flags = 0);
|
||||
bool setWindow(int width = 800, int height = 600, graphics::Graphics *graphics = 0, WindowFlags *flags = 0);
|
||||
void getWindow(int &width, int &height, WindowFlags &flags) const;
|
||||
|
||||
bool checkWindowSize(int width, int height, bool fullscreen) const;
|
||||
|
||||
Reference in New Issue
Block a user