23 #if defined(__WIN32__)
25 #elif defined(__OS2__)
27 #elif !defined(__WINRT__)
37 #if defined(__EMSCRIPTEN__)
38 #include <emscripten.h>
53 #if !SDL_TIMERS_DISABLED
56 #if SDL_VIDEO_DRIVER_WINDOWS
57 extern int SDL_HelperWindowCreate(
void);
58 extern int SDL_HelperWindowDestroy(
void);
72 TerminateProcess(GetCurrentProcess(), exitcode);
75 ExitProcess(exitcode);
76 #elif defined(__EMSCRIPTEN__)
77 emscripten_cancel_main_loop();
78 emscripten_force_exit(exitcode);
80 #elif defined(__HAIKU__)
82 #elif defined(HAVE__EXIT)
91 #ifdef SDL_MAIN_NEEDED
151 SDL_SetError(
"Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?");
172 #if SDL_VIDEO_DRIVER_WINDOWS
174 if (SDL_HelperWindowCreate() < 0) {
180 #if !SDL_TIMERS_DISABLED
186 #if !SDL_EVENTS_DISABLED
194 return SDL_SetError(
"SDL not built with events support");
200 #if !SDL_TIMERS_DISABLED
208 return SDL_SetError(
"SDL not built with timer support");
214 #if !SDL_VIDEO_DISABLED
222 return SDL_SetError(
"SDL not built with video support");
228 #if !SDL_AUDIO_DISABLED
236 return SDL_SetError(
"SDL not built with audio support");
242 #if !SDL_JOYSTICK_DISABLED
250 return SDL_SetError(
"SDL not built with joystick support");
255 #if !SDL_JOYSTICK_DISABLED
263 return SDL_SetError(
"SDL not built with joystick support");
269 #if !SDL_HAPTIC_DISABLED
277 return SDL_SetError(
"SDL not built with haptic (force feedback) support");
283 #if !SDL_SENSOR_DISABLED
291 return SDL_SetError(
"SDL not built with sensor support");
315 #if !SDL_SENSOR_DISABLED
324 #if !SDL_JOYSTICK_DISABLED
346 #if !SDL_HAPTIC_DISABLED
355 #if !SDL_AUDIO_DISABLED
364 #if !SDL_VIDEO_DISABLED
376 #if !SDL_TIMERS_DISABLED
385 #if !SDL_EVENTS_DISABLED
415 for (
i = 0;
i < num_subsystems; ++
i) {
417 initialized |= (1 <<
i);
432 #if SDL_VIDEO_DRIVER_WINDOWS
433 SDL_HelperWindowDestroy();
437 #if !SDL_TIMERS_DISABLED
501 return "MacOS Classic";
515 return "QNX Neutrino";
529 return "PlayStation Portable";
531 return "Unknown (see SDL_platform.h)";
549 #if defined(__WIN32__)
551 #if (!defined(HAVE_LIBC) || defined(__WATCOMC__)) && !defined(SDL_STATIC_LIB)
555 _DllMainCRTStartup(HANDLE hModule,
556 DWORD ul_reason_for_call, LPVOID lpReserved)
558 switch (ul_reason_for_call) {
559 case DLL_PROCESS_ATTACH:
560 case DLL_THREAD_ATTACH:
561 case DLL_THREAD_DETACH:
562 case DLL_PROCESS_DETACH:
Uint32 SDL_WasInit(Uint32 flags)
int SDL_GetRevisionNumber(void)
Get the revision number of SDL that is linked against your program.
void SDL_SetMainReady(void)
static Uint8 SDL_SubsystemRefCount[32]
int SDL_InitSubSystem(Uint32 flags)
static SDL_bool SDL_PrivateShouldQuitSubsystem(Uint32 subsystem)
SDL_NORETURN void SDL_ExitProcess(int exitcode)
static void SDL_PrivateSubsystemRefCountIncr(Uint32 subsystem)
void SDL_QuitSubSystem(Uint32 flags)
static SDL_bool SDL_MainIsReady
static SDL_bool SDL_bInMainQuit
void SDL_GetVersion(SDL_version *ver)
Get the version of SDL that is linked against your program.
const char * SDL_GetRevision(void)
Get the code revision of SDL that is linked against your program.
static void SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem)
SDL_bool SDL_IsTablet()
Return true if the current device is a tablet.
const char * SDL_GetPlatform()
Gets the name of the platform.
static SDL_bool SDL_PrivateShouldInitSubsystem(Uint32 subsystem)
int SDL_Init(Uint32 flags)
#define SDL_INIT_EVERYTHING
#define SDL_INIT_GAMECONTROLLER
#define SDL_INIT_JOYSTICK
SDL_bool SDL_IsAndroidTablet(void)
void SDL_AssertionsQuit(void)
#define SDL_assert(condition)
SDL_FORCE_INLINE SDL_bool SDL_HasExactlyOneBitSet32(Uint32 x)
SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x)
#define SDL_LogResetPriorities
void SDL_EventsQuit(void)
void SDL_GameControllerQuit(void)
int SDL_GameControllerInit(void)
void SDL_HapticQuit(void)
int SDL_JoystickInit(void)
void SDL_JoystickQuit(void)
#define SDL_REVISION_NUMBER
void SDL_SensorQuit(void)
#define SDL_arraysize(array)
#define SDL_VERSION(x)
Macro to determine SDL version program was compiled against.
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Information the version of SDL in use.