mirror of
https://github.com/love2d/love.git
synced 2026-08-18 03:34:23 +02:00
Slightly reduced internal reliance on specific module backends
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
|
||||
// LOVE
|
||||
#include "common/config.h"
|
||||
#include "graphics/Graphics.h"
|
||||
#include "Window.h"
|
||||
|
||||
// SDL
|
||||
@@ -59,10 +60,11 @@ Window::_currentMode::_currentMode()
|
||||
{
|
||||
}
|
||||
|
||||
bool Window::setWindow(int width, int height, graphics::Graphics *graphics, WindowFlags *flags)
|
||||
bool Window::setWindow(int width, int height, WindowFlags *flags)
|
||||
{
|
||||
if (graphics)
|
||||
graphics->unSetMode();
|
||||
graphics::Graphics *gfx = (graphics::Graphics *) Module::findInstance("love.graphics.");
|
||||
if (gfx)
|
||||
gfx->unSetMode();
|
||||
|
||||
bool fullscreen = false;
|
||||
bool vsync = true;
|
||||
@@ -191,8 +193,8 @@ bool Window::setWindow(int width, int height, graphics::Graphics *graphics, Wind
|
||||
currentMode.flags.borderless = ((surface->flags & SDL_NOFRAME) != 0);
|
||||
currentMode.flags.centered = centered;
|
||||
|
||||
if (graphics)
|
||||
graphics->setMode(width, height);
|
||||
if (gfx)
|
||||
gfx->setMode(width, height);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
Window();
|
||||
~Window();
|
||||
|
||||
bool setWindow(int width = 800, int height = 600, graphics::Graphics *graphics = 0, WindowFlags *flags = 0);
|
||||
bool setWindow(int width = 800, int height = 600, 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