From c50502a5bd6071fab0bc569f8415e40684037ab5 Mon Sep 17 00:00:00 2001
From: BogDan Vatra <bogdan@kde.org>
Date: Sun, 28 Dec 2014 00:19:00 +0200
Subject: [PATCH 08/11] SDL_SetWindowGammaRamp fails on Andorid, so don't
bother to use it.
Set SDL_WINDOW_ALLOW_HIGHDPI even it seems it has no effect.
---
source/ps/VideoMode.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/source/ps/VideoMode.cpp b/source/ps/VideoMode.cpp
index 7ff6870..531123c 100644
a
|
b
|
bool CVideoMode::SetVideoMode(int w, int h, int bpp, bool fullscreen)
|
73 | 73 | { |
74 | 74 | #if SDL_VERSION_ATLEAST(2, 0, 0) |
75 | 75 | Uint32 flags = 0; |
| 76 | #if OS_ANDROID |
| 77 | flags |= SDL_WINDOW_ALLOW_HIGHDPI; |
| 78 | #endif |
76 | 79 | if (fullscreen) |
77 | 80 | flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; |
78 | 81 | |
… |
… |
bool CVideoMode::InitSDL()
|
291 | 294 | // (TODO: does that mean we need to call this when toggling fullscreen later?) |
292 | 295 | |
293 | 296 | #if SDL_VERSION_ATLEAST(2, 0, 0) |
| 297 | #if !OS_ANDROID |
294 | 298 | u16 ramp[256]; |
295 | 299 | SDL_CalculateGammaRamp(g_Gamma, ramp); |
296 | 300 | if (SDL_SetWindowGammaRamp(m_Window, ramp, ramp, ramp) < 0) |
297 | 301 | LOGWARNING(L"SDL_SetWindowGammaRamp failed"); |
| 302 | #endif |
298 | 303 | #else |
299 | 304 | # if OS_MACOSX |
300 | 305 | // Workaround for crash on Mavericks, see http://trac.wildfiregames.com/ticket/2272 |