mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Merged default into minor
--HG-- branch : minor
This commit is contained in:
@@ -70,10 +70,6 @@ Window::_currentMode::_currentMode()
|
||||
|
||||
bool Window::setWindow(int width, int height, WindowSettings *settings)
|
||||
{
|
||||
graphics::Graphics *gfx = (graphics::Graphics *) Module::findInstance("love.graphics.");
|
||||
if (gfx != nullptr)
|
||||
gfx->unSetMode();
|
||||
|
||||
WindowSettings f;
|
||||
|
||||
if (settings)
|
||||
@@ -116,11 +112,16 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
|
||||
if (f.borderless)
|
||||
sdlflags |= SDL_WINDOW_BORDERLESS;
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2,0,1)
|
||||
// FIXME: disabled in Linux for runtime SDL 2.0.0 compatibility.
|
||||
#if SDL_VERSION_ATLEAST(2,0,1) && !defined(LOVE_LINUX)
|
||||
if (f.highdpi)
|
||||
sdlflags |= SDL_WINDOW_ALLOW_HIGHDPI;
|
||||
#endif
|
||||
|
||||
graphics::Graphics *gfx = (graphics::Graphics *) Module::findInstance("love.graphics.");
|
||||
if (gfx != nullptr)
|
||||
gfx->unSetMode();
|
||||
|
||||
// Destroy and recreate the window if the dimensions or flags have changed.
|
||||
if (window)
|
||||
{
|
||||
@@ -130,7 +131,8 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
|
||||
Uint32 testflags = SDL_WINDOW_OPENGL | SDL_WINDOW_FULLSCREEN_DESKTOP
|
||||
| SDL_WINDOW_RESIZABLE | SDL_WINDOW_BORDERLESS;
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2,0,1)
|
||||
// FIXME: disabled in Linux for runtime SDL 2.0.0 compatibility.
|
||||
#if SDL_VERSION_ATLEAST(2,0,1) && !defined(LOVE_LINUX)
|
||||
testflags |= SDL_WINDOW_ALLOW_HIGHDPI;
|
||||
#endif
|
||||
|
||||
@@ -153,6 +155,8 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
created = false;
|
||||
|
||||
// In Windows and Linux, some GL attributes are set on window creation.
|
||||
setWindowGLAttributes(f.fsaa, f.sRGB);
|
||||
|
||||
@@ -202,7 +206,8 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
|
||||
int width = curMode.width;
|
||||
int height = curMode.height;
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2,0,1)
|
||||
// FIXME: disabled in Linux for runtime SDL 2.0.0 compatibility.
|
||||
#if SDL_VERSION_ATLEAST(2,0,1) && !defined(LOVE_LINUX)
|
||||
SDL_GL_GetDrawableSize(window, &width, &height);
|
||||
#endif
|
||||
|
||||
@@ -431,7 +436,8 @@ bool Window::setFullscreen(bool fullscreen, Window::FullscreenType fstype)
|
||||
int width = curMode.width;
|
||||
int height = curMode.height;
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2,0,1)
|
||||
// FIXME: disabled in Linux for runtime SDL 2.0.0 compatibility.
|
||||
#if SDL_VERSION_ATLEAST(2,0,1) && !defined(LOVE_LINUX)
|
||||
SDL_GL_GetDrawableSize(window, &width, &height);
|
||||
#endif
|
||||
|
||||
@@ -633,7 +639,8 @@ double Window::getPixelScale() const
|
||||
{
|
||||
double scale = 1.0;
|
||||
|
||||
#if SDL_VERSION_ATLEAST(2,0,1)
|
||||
// FIXME: disabled in Linux for runtime SDL 2.0.0 compatibility.
|
||||
#if SDL_VERSION_ATLEAST(2,0,1) && !defined(LOVE_LINUX)
|
||||
if (window)
|
||||
{
|
||||
int wheight;
|
||||
|
||||
Reference in New Issue
Block a user