History

Better SDL version checking

Olav Sørensen committed 4 years ago

Commit ef1339a1 parent d9f3b8e1 file · +7 −6Browse files

Unified · Split

src/ft2_main.c+7−6
@@ -60,7 +60,7 @@ int main(int argc, char *argv[]) · 59 unmodified lines
60 _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);60 _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
61#endif61#endif
62 62
63#if SDL_PATCHLEVEL < 563#if SDL_MAJOR_VERSION == 2 && SDL_MINOR_VERSION == 0 && SDL_PATCHLEVEL < 5
64#pragma message("WARNING: The SDL2 dev lib is older than ver 2.0.5. You'll get fullscreen mode issues and no audio input sampling.")64#pragma message("WARNING: The SDL2 dev lib is older than ver 2.0.5. You'll get fullscreen mode issues and no audio input sampling.")
65#pragma message("At least version 2.0.7 is recommended.")65#pragma message("At least version 2.0.7 is recommended.")
66#endif66#endif
@@ -93,12 +93,13 @@ int main(int argc, char *argv[]) · 26 unmodified lines
93 }93 }
94#endif94#endif
95 95
96#if SDL_PATCHLEVEL >= 4 // SDL 2.0.4 or later96#ifdef _WIN32
97 SDL_SetHint(SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4, "1"); // windows only - prevent ALT+F4 from exiting (FT2 uses ALT+F4)97
98 // ALT+F4 is used in FT2, but is "close program" in Windows...
99#if SDL_MAJOR_VERSION == 2 && SDL_MINOR_VERSION >= 0 && SDL_PATCHLEVEL >= 4
100 SDL_SetHint(SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4, "1");
98#endif101#endif
99 102
100#ifdef _WIN32
101
102#ifndef _MSC_VER103#ifndef _MSC_VER
103 SetProcessDPIAware();104 SetProcessDPIAware();
104#endif105#endif
@@ -126,7 +127,7 @@ int main(int argc, char *argv[]) · 21 unmodified lines
126 ** reinitialized in Windows and what not.127 ** reinitialized in Windows and what not.
127 ** Ref.: https://bugzilla.libsdl.org/show_bug.cgi?id=4391128 ** Ref.: https://bugzilla.libsdl.org/show_bug.cgi?id=4391
128 */129 */
129#if defined _WIN32 && SDL_PATCHLEVEL == 9130#if defined _WIN32 && SDL_MAJOR_VERSION == 2 && SDL_MINOR_VERSION == 0 && SDL_PATCHLEVEL == 9
130 if (SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) != 0)131 if (SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_JOYSTICK) != 0)
131#else132#else
132 if (SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO) != 0)133 if (SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO) != 0)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t