Go to the documentation of this file.
23 #if defined(__WIN32__)
25 #elif defined(__OS2__)
27 #elif !defined(__WINRT__)
31 #if defined(__EMSCRIPTEN__)
32 #include <emscripten.h>
47 #if !SDL_TIMERS_DISABLED
50 #if SDL_VIDEO_DRIVER_WINDOWS
51 extern int SDL_HelperWindowCreate(
void);
52 extern int SDL_HelperWindowDestroy(
void);
66 TerminateProcess(GetCurrentProcess(), exitcode);
69 ExitProcess(exitcode);
70 #elif defined(__EMSCRIPTEN__)
71 emscripten_cancel_main_loop();
72 emscripten_force_exit(exitcode);
74 #elif defined(__HAIKU__)
76 #elif defined(HAVE__EXIT)
85 #ifdef SDL_MAIN_NEEDED
145 SDL_SetError(
"Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?");
162 #if SDL_VIDEO_DRIVER_WINDOWS
164 if (SDL_HelperWindowCreate() < 0) {
170 #if !SDL_TIMERS_DISABLED
176 #if !SDL_EVENTS_DISABLED
184 return SDL_SetError(
"SDL not built with events support");
190 #if !SDL_TIMERS_DISABLED
198 return SDL_SetError(
"SDL not built with timer support");
204 #if !SDL_VIDEO_DISABLED
212 return SDL_SetError(
"SDL not built with video support");
218 #if !SDL_AUDIO_DISABLED
226 return SDL_SetError(
"SDL not built with audio support");
232 #if !SDL_JOYSTICK_DISABLED
240 return SDL_SetError(
"SDL not built with joystick support");
245 #if !SDL_JOYSTICK_DISABLED
253 return SDL_SetError(
"SDL not built with joystick support");
259 #if !SDL_HAPTIC_DISABLED
267 return SDL_SetError(
"SDL not built with haptic (force feedback) support");
273 #if !SDL_SENSOR_DISABLED
281 return SDL_SetError(
"SDL not built with sensor support");
298 #if !SDL_SENSOR_DISABLED
307 #if !SDL_JOYSTICK_DISABLED
329 #if !SDL_HAPTIC_DISABLED
338 #if !SDL_AUDIO_DISABLED
347 #if !SDL_VIDEO_DISABLED
359 #if !SDL_TIMERS_DISABLED
368 #if !SDL_EVENTS_DISABLED
398 for (
i = 0;
i < num_subsystems; ++
i) {
400 initialized |= (1 <<
i);
415 #if SDL_VIDEO_DRIVER_WINDOWS
416 SDL_HelperWindowDestroy();
420 #if !SDL_TIMERS_DISABLED
484 return "MacOS Classic";
498 return "QNX Neutrino";
512 return "PlayStation Portable";
514 return "Unknown (see SDL_platform.h)";
532 #if defined(__WIN32__)
534 #if (!defined(HAVE_LIBC) || defined(__WATCOMC__)) && !defined(SDL_STATIC_LIB)
538 _DllMainCRTStartup(HANDLE hModule,
539 DWORD ul_reason_for_call, LPVOID lpReserved)
541 switch (ul_reason_for_call) {
542 case DLL_PROCESS_ATTACH:
543 case DLL_THREAD_ATTACH:
544 case DLL_THREAD_DETACH:
545 case DLL_PROCESS_DETACH:
const char * SDL_GetRevision(void)
Get the code revision of SDL that is linked against your program.
const char * SDL_GetPlatform()
Gets the name of the platform.
int SDL_GetRevisionNumber(void)
Get the revision number of SDL that is linked against your program.
static SDL_bool SDL_PrivateShouldInitSubsystem(Uint32 subsystem)
void SDL_HapticQuit(void)
static void SDL_PrivateSubsystemRefCountIncr(Uint32 subsystem)
int SDL_JoystickInit(void)
static Uint8 SDL_SubsystemRefCount[32]
Information the version of SDL in use.
#define SDL_LogResetPriorities
#define SDL_INIT_JOYSTICK
#define SDL_VERSION(x)
Macro to determine SDL version program was compiled against.
SDL_bool SDL_IsAndroidTablet(void)
int SDL_GameControllerInit(void)
void SDL_SensorQuit(void)
static void SDL_PrivateSubsystemRefCountDecr(Uint32 subsystem)
void SDL_GetVersion(SDL_version *ver)
Get the version of SDL that is linked against your program.
static SDL_bool SDL_bInMainQuit
SDL_FORCE_INLINE SDL_bool SDL_HasExactlyOneBitSet32(Uint32 x)
#define SDL_REVISION_NUMBER
void SDL_JoystickQuit(void)
static SDL_bool SDL_PrivateShouldQuitSubsystem(Uint32 subsystem)
void SDL_AssertionsQuit(void)
Uint32 SDL_WasInit(Uint32 flags)
SDL_NORETURN void SDL_ExitProcess(int exitcode)
#define SDL_assert(condition)
SDL_bool SDL_IsTablet()
Return true if the current device is a tablet.
#define SDL_arraysize(array)
int SDL_InitSubSystem(Uint32 flags)
void SDL_GameControllerQuit(void)
void SDL_SetMainReady(void)
SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x)
#define SDL_INIT_GAMECONTROLLER
void SDL_EventsQuit(void)
#define SDL_INIT_EVERYTHING
void SDL_QuitSubSystem(Uint32 flags)
int SDL_Init(Uint32 flags)
static SDL_bool SDL_MainIsReady
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)