mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
823b218051c2ba4f1b4d7ca3ab3f279d15222f01

Basically all platforms where SDL_main.h renames main() to SDL_main() use the platform-specific main() (or WinMain() or whatever) implementations in SDL_main_impl.h - and that renaming is enabled with: #if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) \ || defined(SDL_MAIN_USE_CALLBACKS) #define main SDL_main #endif The only exception is Android, where main() *is* renamed, but SDL_main_impl.h isn't used, because SDL_main() is called from Java. So I think it's cleaner and less error-prone (for adding additional platforms that need SDL_main() in the future), to use the same check for including SDL_main_impl.h as is used for `#define main SDL_main` and only list the exceptions (currently Android) there explicitly. If new platforms like Android turn up, they can easily be added there by inserting "|| defined(SDL_PLATFORM_WEIRDPLATFORM)" right next to the Android check. See also https://github.com/libsdl-org/SDL/issues/11068#issuecomment-2399907535
Simple DirectMedia Layer (SDL) Version 3.0
Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games.
More extensive documentation is available in the docs directory, starting with README.md. If you are migrating to SDL 3.0 from SDL 2.0, the changes are extensively documented in README-migration.md.
Enjoy!
Sam Lantinga (slouken@libsdl.org)
Languages
C
86.4%
C++
5.9%
Objective-C
3.4%
CMake
1.6%
Perl
0.8%
Other
1.7%