Slightly reduced internal reliance on specific module backends

This commit is contained in:
Alex Szpakowski
2013-08-03 16:30:37 -03:00
parent 2106ff2403
commit 3e57cfd174
7 changed files with 39 additions and 21 deletions
+7 -5
View File
@@ -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;
}
+1 -1
View File
@@ -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;