SDL_system.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2023 Sam Lantinga <[email protected]>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. /**
  19. * \file SDL_system.h
  20. *
  21. * \brief Include file for platform specific SDL API functions
  22. */
  23. #ifndef SDL_system_h_
  24. #define SDL_system_h_
  25. #include <SDL3/SDL_stdinc.h>
  26. #include <SDL3/SDL_keyboard.h>
  27. #include <SDL3/SDL_render.h>
  28. #include <SDL3/SDL_video.h>
  29. #include <SDL3/SDL_begin_code.h>
  30. /* Set up for C function definitions, even when using C++ */
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. /* Platform specific functions for Windows */
  35. #if defined(__WIN32__) || defined(__GDK__)
  36. typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
  37. /**
  38. * Set a callback for every Windows message, run before TranslateMessage().
  39. *
  40. * \param callback The SDL_WindowsMessageHook function to call.
  41. * \param userdata a pointer to pass to every iteration of `callback`
  42. *
  43. * \since This function is available since SDL 3.0.0.
  44. */
  45. extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
  46. #endif /* defined(__WIN32__) || defined(__GDK__) */
  47. #if defined(__WIN32__) || defined(__WINGDK__)
  48. /**
  49. * Get the D3D9 adapter index that matches the specified display.
  50. *
  51. * The returned adapter index can be passed to `IDirect3D9::CreateDevice` and
  52. * controls on which monitor a full screen application will appear.
  53. *
  54. * \param displayID the instance of the display to query
  55. * \returns the D3D9 adapter index on success or a negative error code on
  56. * failure; call SDL_GetError() for more information.
  57. *
  58. * \since This function is available since SDL 3.0.0.
  59. */
  60. extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID);
  61. typedef struct IDirect3DDevice9 IDirect3DDevice9;
  62. /**
  63. * Get the D3D9 device associated with a renderer.
  64. *
  65. * Once you are done using the device, you should release it to avoid a
  66. * resource leak.
  67. *
  68. * \param renderer the renderer from which to get the associated D3D device
  69. * \returns the D3D9 device associated with given renderer or NULL if it is
  70. * not a D3D9 renderer; call SDL_GetError() for more information.
  71. *
  72. * \since This function is available since SDL 3.0.0.
  73. */
  74. extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_GetRenderD3D9Device(SDL_Renderer * renderer);
  75. typedef struct ID3D11Device ID3D11Device;
  76. /**
  77. * Get the D3D11 device associated with a renderer.
  78. *
  79. * Once you are done using the device, you should release it to avoid a
  80. * resource leak.
  81. *
  82. * \param renderer the renderer from which to get the associated D3D11 device
  83. * \returns the D3D11 device associated with given renderer or NULL if it is
  84. * not a D3D11 renderer; call SDL_GetError() for more information.
  85. *
  86. * \since This function is available since SDL 3.0.0.
  87. */
  88. extern DECLSPEC ID3D11Device* SDLCALL SDL_GetRenderD3D11Device(SDL_Renderer * renderer);
  89. #endif /* defined(__WIN32__) || defined(__WINGDK__) */
  90. #if defined(__WIN32__) || defined(__GDK__)
  91. typedef struct ID3D12Device ID3D12Device;
  92. /**
  93. * Get the D3D12 device associated with a renderer.
  94. *
  95. * Once you are done using the device, you should release it to avoid a
  96. * resource leak.
  97. *
  98. * \param renderer the renderer from which to get the associated D3D12 device
  99. * \returns the D3D12 device associated with given renderer or NULL if it is
  100. * not a D3D12 renderer; call SDL_GetError() for more information.
  101. *
  102. * \since This function is available since SDL 3.0.0.
  103. */
  104. extern DECLSPEC ID3D12Device* SDLCALL SDL_RenderGetD3D12Device(SDL_Renderer* renderer);
  105. #endif /* defined(__WIN32__) || defined(__GDK__) */
  106. #if defined(__WIN32__) || defined(__WINGDK__)
  107. /**
  108. * Get the DXGI Adapter and Output indices for the specified display.
  109. *
  110. * The DXGI Adapter and Output indices can be passed to `EnumAdapters` and
  111. * `EnumOutputs` respectively to get the objects required to create a DX10 or
  112. * DX11 device and swap chain.
  113. *
  114. * \param displayID the instance of the display to query
  115. * \param adapterIndex a pointer to be filled in with the adapter index
  116. * \param outputIndex a pointer to be filled in with the output index
  117. * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError()
  118. * for more information.
  119. *
  120. * \since This function is available since SDL 3.0.0.
  121. */
  122. extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
  123. #endif /* defined(__WIN32__) || defined(__WINGDK__) */
  124. /* Platform specific functions for Linux */
  125. #ifdef __LINUX__
  126. /**
  127. * Sets the UNIX nice value for a thread.
  128. *
  129. * This uses setpriority() if possible, and RealtimeKit if available.
  130. *
  131. * \param threadID the Unix thread ID to change priority of.
  132. * \param priority The new, Unix-specific, priority value.
  133. * \returns 0 on success, or -1 on error.
  134. *
  135. * \since This function is available since SDL 3.0.0.
  136. */
  137. extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority);
  138. /**
  139. * Sets the priority (not nice level) and scheduling policy for a thread.
  140. *
  141. * This uses setpriority() if possible, and RealtimeKit if available.
  142. *
  143. * \param threadID The Unix thread ID to change priority of.
  144. * \param sdlPriority The new SDL_ThreadPriority value.
  145. * \param schedPolicy The new scheduling policy (SCHED_FIFO, SCHED_RR,
  146. * SCHED_OTHER, etc...)
  147. * \returns 0 on success or a negative error code on failure; call
  148. * SDL_GetError() for more information.
  149. *
  150. * \since This function is available since SDL 3.0.0.
  151. */
  152. extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
  153. #endif /* __LINUX__ */
  154. /* Platform specific functions for iOS */
  155. #ifdef __IOS__
  156. #define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
  157. /**
  158. * Use this function to set the animation callback on Apple iOS.
  159. *
  160. * The function prototype for `callback` is:
  161. *
  162. * ```c
  163. * void callback(void* callbackParam);
  164. * ```
  165. *
  166. * Where its parameter, `callbackParam`, is what was passed as `callbackParam`
  167. * to SDL_iPhoneSetAnimationCallback().
  168. *
  169. * This function is only available on Apple iOS.
  170. *
  171. * For more information see:
  172. * https://github.com/libsdl-org/SDL/blob/main/docs/README-ios.md
  173. *
  174. * This functions is also accessible using the macro
  175. * SDL_iOSSetAnimationCallback() since SDL 2.0.4.
  176. *
  177. * \param window the window for which the animation callback should be set
  178. * \param interval the number of frames after which **callback** will be
  179. * called
  180. * \param callback the function to call for every frame.
  181. * \param callbackParam a pointer that is passed to `callback`.
  182. * \returns 0 on success or a negative error code on failure; call
  183. * SDL_GetError() for more information.
  184. *
  185. * \since This function is available since SDL 3.0.0.
  186. *
  187. * \sa SDL_iPhoneSetEventPump
  188. */
  189. extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (SDLCALL *callback)(void*), void *callbackParam);
  190. #define SDL_iOSSetEventPump(enabled) SDL_iPhoneSetEventPump(enabled)
  191. /**
  192. * Use this function to enable or disable the SDL event pump on Apple iOS.
  193. *
  194. * This function is only available on Apple iOS.
  195. *
  196. * This functions is also accessible using the macro SDL_iOSSetEventPump()
  197. * since SDL 2.0.4.
  198. *
  199. * \param enabled SDL_TRUE to enable the event pump, SDL_FALSE to disable it
  200. *
  201. * \since This function is available since SDL 3.0.0.
  202. *
  203. * \sa SDL_iPhoneSetAnimationCallback
  204. */
  205. extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
  206. #endif /* __IOS__ */
  207. /* Platform specific functions for Android */
  208. #ifdef __ANDROID__
  209. /**
  210. * Get the Android Java Native Interface Environment of the current thread.
  211. *
  212. * This is the JNIEnv one needs to access the Java virtual machine from native
  213. * code, and is needed for many Android APIs to be usable from C.
  214. *
  215. * The prototype of the function in SDL's code actually declare a void* return
  216. * type, even if the implementation returns a pointer to a JNIEnv. The
  217. * rationale being that the SDL headers can avoid including jni.h.
  218. *
  219. * \returns a pointer to Java native interface object (JNIEnv) to which the
  220. * current thread is attached, or 0 on error.
  221. *
  222. * \since This function is available since SDL 3.0.0.
  223. *
  224. * \sa SDL_AndroidGetActivity
  225. */
  226. extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void);
  227. /**
  228. * Retrieve the Java instance of the Android activity class.
  229. *
  230. * The prototype of the function in SDL's code actually declares a void*
  231. * return type, even if the implementation returns a jobject. The rationale
  232. * being that the SDL headers can avoid including jni.h.
  233. *
  234. * The jobject returned by the function is a local reference and must be
  235. * released by the caller. See the PushLocalFrame() and PopLocalFrame() or
  236. * DeleteLocalRef() functions of the Java native interface:
  237. *
  238. * https://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html
  239. *
  240. * \returns the jobject representing the instance of the Activity class of the
  241. * Android application, or NULL on error.
  242. *
  243. * \since This function is available since SDL 3.0.0.
  244. *
  245. * \sa SDL_AndroidGetJNIEnv
  246. */
  247. extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void);
  248. /**
  249. * Query Android API level of the current device.
  250. *
  251. * - API level 31: Android 12
  252. * - API level 30: Android 11
  253. * - API level 29: Android 10
  254. * - API level 28: Android 9
  255. * - API level 27: Android 8.1
  256. * - API level 26: Android 8.0
  257. * - API level 25: Android 7.1
  258. * - API level 24: Android 7.0
  259. * - API level 23: Android 6.0
  260. * - API level 22: Android 5.1
  261. * - API level 21: Android 5.0
  262. * - API level 20: Android 4.4W
  263. * - API level 19: Android 4.4
  264. * - API level 18: Android 4.3
  265. * - API level 17: Android 4.2
  266. * - API level 16: Android 4.1
  267. * - API level 15: Android 4.0.3
  268. * - API level 14: Android 4.0
  269. * - API level 13: Android 3.2
  270. * - API level 12: Android 3.1
  271. * - API level 11: Android 3.0
  272. * - API level 10: Android 2.3.3
  273. *
  274. * \returns the Android API level.
  275. *
  276. * \since This function is available since SDL 3.0.0.
  277. */
  278. extern DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void);
  279. /**
  280. * Query if the application is running on Android TV.
  281. *
  282. * \returns SDL_TRUE if this is Android TV, SDL_FALSE otherwise.
  283. *
  284. * \since This function is available since SDL 3.0.0.
  285. */
  286. extern DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
  287. /**
  288. * Query if the application is running on a Chromebook.
  289. *
  290. * \returns SDL_TRUE if this is a Chromebook, SDL_FALSE otherwise.
  291. *
  292. * \since This function is available since SDL 3.0.0.
  293. */
  294. extern DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
  295. /**
  296. * Query if the application is running on a Samsung DeX docking station.
  297. *
  298. * \returns SDL_TRUE if this is a DeX docking station, SDL_FALSE otherwise.
  299. *
  300. * \since This function is available since SDL 3.0.0.
  301. */
  302. extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
  303. /**
  304. * Trigger the Android system back button behavior.
  305. *
  306. * \since This function is available since SDL 3.0.0.
  307. */
  308. extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
  309. /**
  310. See the official Android developer guide for more information:
  311. http://developer.android.com/guide/topics/data/data-storage.html
  312. */
  313. #define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01
  314. #define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02
  315. /**
  316. * Get the path used for internal storage for this application.
  317. *
  318. * This path is unique to your application and cannot be written to by other
  319. * applications.
  320. *
  321. * Your internal storage path is typically:
  322. * `/data/data/your.app.package/files`.
  323. *
  324. * \returns the path used for internal storage or NULL on failure; call
  325. * SDL_GetError() for more information.
  326. *
  327. * \since This function is available since SDL 3.0.0.
  328. *
  329. * \sa SDL_AndroidGetExternalStorageState
  330. */
  331. extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(void);
  332. /**
  333. * Get the current state of external storage.
  334. *
  335. * The current state of external storage, a bitmask of these values:
  336. * `SDL_ANDROID_EXTERNAL_STORAGE_READ`, `SDL_ANDROID_EXTERNAL_STORAGE_WRITE`.
  337. *
  338. * If external storage is currently unavailable, this will return 0.
  339. *
  340. * \param state filled with the current state of external storage. 0 if
  341. * external storage is currently unavailable.
  342. * \returns 0 on success or a negative error code on failure; call
  343. * SDL_GetError() for more information.
  344. *
  345. * \since This function is available since SDL 3.0.0.
  346. *
  347. * \sa SDL_AndroidGetExternalStoragePath
  348. */
  349. extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(Uint32 *state);
  350. /**
  351. * Get the path used for external storage for this application.
  352. *
  353. * This path is unique to your application, but is public and can be written
  354. * to by other applications.
  355. *
  356. * Your external storage path is typically:
  357. * `/storage/sdcard0/Android/data/your.app.package/files`.
  358. *
  359. * \returns the path used for external storage for this application on success
  360. * or NULL on failure; call SDL_GetError() for more information.
  361. *
  362. * \since This function is available since SDL 3.0.0.
  363. *
  364. * \sa SDL_AndroidGetExternalStorageState
  365. */
  366. extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void);
  367. /**
  368. * Request permissions at runtime.
  369. *
  370. * This blocks the calling thread until the permission is granted or denied.
  371. *
  372. * \param permission The permission to request.
  373. * \returns SDL_TRUE if the permission was granted, SDL_FALSE otherwise.
  374. *
  375. * \since This function is available since SDL 3.0.0.
  376. */
  377. extern DECLSPEC SDL_bool SDLCALL SDL_AndroidRequestPermission(const char *permission);
  378. /**
  379. * Shows an Android toast notification.
  380. *
  381. * Toasts are a sort of lightweight notification that are unique to Android.
  382. *
  383. * https://developer.android.com/guide/topics/ui/notifiers/toasts
  384. *
  385. * Shows toast in UI thread.
  386. *
  387. * For the `gravity` parameter, choose a value from here, or -1 if you don't
  388. * have a preference:
  389. *
  390. * https://developer.android.com/reference/android/view/Gravity
  391. *
  392. * \param message text message to be shown
  393. * \param duration 0=short, 1=long
  394. * \param gravity where the notification should appear on the screen.
  395. * \param xoffset set this parameter only when gravity >=0
  396. * \param yoffset set this parameter only when gravity >=0
  397. * \returns 0 on success or a negative error code on failure; call
  398. * SDL_GetError() for more information.
  399. *
  400. * \since This function is available since SDL 3.0.0.
  401. */
  402. extern DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
  403. /**
  404. * Send a user command to SDLActivity.
  405. *
  406. * Override "boolean onUnhandledMessage(Message msg)" to handle the message.
  407. *
  408. * \param command user command that must be greater or equal to 0x8000
  409. * \param param user parameter
  410. * \returns 0 on success or a negative error code on failure; call
  411. * SDL_GetError() for more information.
  412. *
  413. * \since This function is available since SDL 3.0.0.
  414. */
  415. extern DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
  416. #endif /* __ANDROID__ */
  417. /* Platform specific functions for WinRT */
  418. #ifdef __WINRT__
  419. /**
  420. * \brief WinRT / Windows Phone path types
  421. */
  422. typedef enum
  423. {
  424. /** \brief The installed app's root directory.
  425. Files here are likely to be read-only. */
  426. SDL_WINRT_PATH_INSTALLED_LOCATION,
  427. /** \brief The app's local data store. Files may be written here */
  428. SDL_WINRT_PATH_LOCAL_FOLDER,
  429. /** \brief The app's roaming data store. Unsupported on Windows Phone.
  430. Files written here may be copied to other machines via a network
  431. connection.
  432. */
  433. SDL_WINRT_PATH_ROAMING_FOLDER,
  434. /** \brief The app's temporary data store. Unsupported on Windows Phone.
  435. Files written here may be deleted at any time. */
  436. SDL_WINRT_PATH_TEMP_FOLDER
  437. } SDL_WinRT_Path;
  438. /**
  439. * \brief WinRT Device Family
  440. */
  441. typedef enum
  442. {
  443. /** \brief Unknown family */
  444. SDL_WINRT_DEVICEFAMILY_UNKNOWN,
  445. /** \brief Desktop family*/
  446. SDL_WINRT_DEVICEFAMILY_DESKTOP,
  447. /** \brief Mobile family (for example smartphone) */
  448. SDL_WINRT_DEVICEFAMILY_MOBILE,
  449. /** \brief XBox family */
  450. SDL_WINRT_DEVICEFAMILY_XBOX,
  451. } SDL_WinRT_DeviceFamily;
  452. /**
  453. * Retrieve a WinRT defined path on the local file system.
  454. *
  455. * Not all paths are available on all versions of Windows. This is especially
  456. * true on Windows Phone. Check the documentation for the given SDL_WinRT_Path
  457. * for more information on which path types are supported where.
  458. *
  459. * Documentation on most app-specific path types on WinRT can be found on
  460. * MSDN, at the URL:
  461. *
  462. * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
  463. *
  464. * \param pathType the type of path to retrieve, one of SDL_WinRT_Path
  465. * \returns a UCS-2 string (16-bit, wide-char) containing the path, or NULL if
  466. * the path is not available for any reason; call SDL_GetError() for
  467. * more information.
  468. *
  469. * \since This function is available since SDL 2.0.3.
  470. *
  471. * \sa SDL_WinRTGetFSPathUTF8
  472. */
  473. extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
  474. /**
  475. * Retrieve a WinRT defined path on the local file system.
  476. *
  477. * Not all paths are available on all versions of Windows. This is especially
  478. * true on Windows Phone. Check the documentation for the given SDL_WinRT_Path
  479. * for more information on which path types are supported where.
  480. *
  481. * Documentation on most app-specific path types on WinRT can be found on
  482. * MSDN, at the URL:
  483. *
  484. * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
  485. *
  486. * \param pathType the type of path to retrieve, one of SDL_WinRT_Path
  487. * \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if
  488. * the path is not available for any reason; call SDL_GetError() for
  489. * more information.
  490. *
  491. * \since This function is available since SDL 2.0.3.
  492. *
  493. * \sa SDL_WinRTGetFSPathUNICODE
  494. */
  495. extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType);
  496. /**
  497. * Detects the device family of WinRT platform at runtime.
  498. *
  499. * \returns a value from the SDL_WinRT_DeviceFamily enum.
  500. *
  501. * \since This function is available since SDL 3.0.0.
  502. */
  503. extern DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily();
  504. #endif /* __WINRT__ */
  505. /**
  506. * Query if the current device is a tablet.
  507. *
  508. * If SDL can't determine this, it will return SDL_FALSE.
  509. *
  510. * \returns SDL_TRUE if the device is a tablet, SDL_FALSE otherwise.
  511. *
  512. * \since This function is available since SDL 3.0.0.
  513. */
  514. extern DECLSPEC SDL_bool SDLCALL SDL_IsTablet(void);
  515. /* Functions used by iOS application delegates to notify SDL about state changes */
  516. /*
  517. * \since This function is available since SDL 3.0.0.
  518. */
  519. extern DECLSPEC void SDLCALL SDL_OnApplicationWillTerminate(void);
  520. /*
  521. * \since This function is available since SDL 3.0.0.
  522. */
  523. extern DECLSPEC void SDLCALL SDL_OnApplicationDidReceiveMemoryWarning(void);
  524. /*
  525. * \since This function is available since SDL 3.0.0.
  526. */
  527. extern DECLSPEC void SDLCALL SDL_OnApplicationWillResignActive(void);
  528. /*
  529. * \since This function is available since SDL 3.0.0.
  530. */
  531. extern DECLSPEC void SDLCALL SDL_OnApplicationDidEnterBackground(void);
  532. /*
  533. * \since This function is available since SDL 3.0.0.
  534. */
  535. extern DECLSPEC void SDLCALL SDL_OnApplicationWillEnterForeground(void);
  536. /*
  537. * \since This function is available since SDL 3.0.0.
  538. */
  539. extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
  540. #ifdef __IOS__
  541. /*
  542. * \since This function is available since SDL 3.0.0.
  543. */
  544. extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
  545. #endif
  546. /* Functions used only by GDK */
  547. #ifdef __GDK__
  548. typedef struct XTaskQueueObject * XTaskQueueHandle;
  549. /**
  550. * Gets a reference to the global async task queue handle for GDK,
  551. * initializing if needed.
  552. *
  553. * Once you are done with the task queue, you should call
  554. * XTaskQueueCloseHandle to reduce the reference count to avoid a resource
  555. * leak.
  556. *
  557. * \param outTaskQueue a pointer to be filled in with task queue handle.
  558. * \returns 0 on success or a negative error code on failure; call
  559. * SDL_GetError() for more information.
  560. *
  561. * \since This function is available since SDL 3.0.0.
  562. */
  563. extern DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue);
  564. #endif
  565. /* Ends C function definitions when using C++ */
  566. #ifdef __cplusplus
  567. }
  568. #endif
  569. #include <SDL3/SDL_close_code.h>
  570. #endif /* SDL_system_h_ */