From 41b316d071af26d38c1c7c712fcbef94ad4ae67f Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Sun, 2 Mar 2014 16:11:49 +0100 Subject: [PATCH] Make get_flags compile with SDL2. Not entirely sure which hardware flags need to be used, so only handle the resizeable flag. --- src/video.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/video.cpp b/src/video.cpp index e5d481d4f8a4..370954d55070 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -61,13 +61,22 @@ resize_lock::~resize_lock() static unsigned int get_flags(unsigned int flags) { + /* The wanted flags for the render need to be evaluated for SDL2. */ +#if !SDL_VERSION_ATLEAST(2, 0, 0) // SDL under Windows doesn't seem to like hardware surfaces // for some reason. #if !(defined(_WIN32) || defined(__APPLE__) || defined(__AMIGAOS4__)) flags |= SDL_HWSURFACE; #endif +#endif + + if((flags&SDL_FULLSCREEN) == 0) +#if SDL_VERSION_ATLEAST(2, 0, 0) + flags |= SDL_WINDOW_RESIZABLE; +#else flags |= SDL_RESIZABLE; +#endif return flags; }