Explicitly #ifdef'd out SDL 2.0.1+ function calls for Linux to avoid runtime function resolving problems when love is built with SDL 2.0.1+ headers but run using SDL 2.0.0.

This commit is contained in:
Alex Szpakowski
2014-03-31 03:45:22 -03:00
parent 2698fd2c2c
commit a22c4b5f92
2 changed files with 13 additions and 6 deletions
+3 -1
View File
@@ -27,6 +27,7 @@
#include "graphics/Graphics.h"
#include "window/Window.h"
#include "common/Exception.h"
#include "common/config.h"
#include <cmath>
@@ -427,7 +428,8 @@ Message *Event::convertWindowEvent(const SDL_Event &e) const
int px_w = e.window.data1;
int px_h = e.window.data2;
#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_Window *sdlwin = SDL_GetWindowFromID(e.window.windowID);
if (sdlwin)
SDL_GL_GetDrawableSize(sdlwin, &px_w, &px_h);
+10 -5
View File
@@ -116,7 +116,8 @@ 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
@@ -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
@@ -202,7 +204,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 +434,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 +637,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;