SDL_sysvideo.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
  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. #include "SDL_internal.h"
  19. #ifndef SDL_sysvideo_h_
  20. #define SDL_sysvideo_h_
  21. #include <SDL3/SDL_vulkan.h>
  22. /* The SDL video driver */
  23. typedef struct SDL_VideoDisplay SDL_VideoDisplay;
  24. typedef struct SDL_VideoDevice SDL_VideoDevice;
  25. typedef struct SDL_VideoData SDL_VideoData;
  26. typedef struct SDL_DisplayData SDL_DisplayData;
  27. typedef struct SDL_DisplayModeData SDL_DisplayModeData;
  28. typedef struct SDL_WindowData SDL_WindowData;
  29. /* Define the SDL window structure, corresponding to toplevel windows */
  30. struct SDL_Window
  31. {
  32. SDL_WindowID id;
  33. char *title;
  34. SDL_Surface *icon;
  35. int x, y;
  36. int w, h;
  37. int min_w, min_h;
  38. int max_w, max_h;
  39. float min_aspect;
  40. float max_aspect;
  41. int last_pixel_w, last_pixel_h;
  42. SDL_WindowFlags flags;
  43. SDL_WindowFlags pending_flags;
  44. float display_scale;
  45. SDL_bool external_graphics_context;
  46. SDL_bool fullscreen_exclusive; /* The window is currently fullscreen exclusive */
  47. SDL_DisplayID last_fullscreen_exclusive_display; /* The last fullscreen_exclusive display */
  48. SDL_DisplayID last_displayID;
  49. /* Stored position and size for the window in the non-fullscreen state,
  50. * including when the window is maximized or tiled.
  51. *
  52. * This is the size and position to which the window should return when
  53. * leaving the fullscreen state.
  54. */
  55. SDL_Rect windowed;
  56. /* Stored position and size for the window in the base 'floating' state;
  57. * when not fullscreen, nor in a state such as maximized or tiled.
  58. *
  59. * This is the size and position to which the window should return when
  60. * it's maximized and SDL_RestoreWindow() is called.
  61. */
  62. SDL_Rect floating;
  63. /* Toggle for drivers to indicate that the current window state is tiled,
  64. * and sizes set non-programmatically shouldn't be cached.
  65. */
  66. SDL_bool tiled;
  67. /* Whether or not the initial position was defined */
  68. SDL_bool undefined_x;
  69. SDL_bool undefined_y;
  70. SDL_DisplayMode requested_fullscreen_mode;
  71. SDL_DisplayMode current_fullscreen_mode;
  72. float opacity;
  73. SDL_Surface *surface;
  74. SDL_bool surface_valid;
  75. SDL_bool is_repositioning; /* Set during an SDL_SetWindowPosition() call. */
  76. SDL_bool is_hiding;
  77. SDL_bool restore_on_show; /* Child was hidden recursively by the parent, restore when shown. */
  78. SDL_bool is_destroying;
  79. SDL_bool is_dropping; /* drag/drop in progress, expecting SDL_SendDropComplete(). */
  80. SDL_Rect mouse_rect;
  81. SDL_HitTest hit_test;
  82. void *hit_test_data;
  83. SDL_PropertiesID props;
  84. SDL_WindowData *driverdata;
  85. SDL_Window *prev;
  86. SDL_Window *next;
  87. SDL_Window *parent;
  88. SDL_Window *first_child;
  89. SDL_Window *prev_sibling;
  90. SDL_Window *next_sibling;
  91. };
  92. #define SDL_WINDOW_FULLSCREEN_VISIBLE(W) \
  93. ((((W)->flags & SDL_WINDOW_FULLSCREEN) != 0) && \
  94. (((W)->flags & SDL_WINDOW_HIDDEN) == 0) && \
  95. (((W)->flags & SDL_WINDOW_MINIMIZED) == 0))
  96. #define SDL_WINDOW_IS_POPUP(W) \
  97. (((W)->flags & (SDL_WINDOW_TOOLTIP | SDL_WINDOW_POPUP_MENU)) != 0)
  98. typedef struct
  99. {
  100. float SDR_white_point;
  101. float HDR_headroom;
  102. } SDL_HDRDisplayProperties;
  103. /*
  104. * Define the SDL display structure.
  105. * This corresponds to physical monitors attached to the system.
  106. */
  107. struct SDL_VideoDisplay
  108. {
  109. SDL_DisplayID id;
  110. char *name;
  111. int max_fullscreen_modes;
  112. int num_fullscreen_modes;
  113. SDL_DisplayMode *fullscreen_modes;
  114. SDL_DisplayMode desktop_mode;
  115. const SDL_DisplayMode *current_mode;
  116. SDL_DisplayOrientation natural_orientation;
  117. SDL_DisplayOrientation current_orientation;
  118. float content_scale;
  119. SDL_HDRDisplayProperties HDR;
  120. SDL_Window *fullscreen_window;
  121. SDL_VideoDevice *device;
  122. SDL_PropertiesID props;
  123. SDL_DisplayData *driverdata;
  124. };
  125. /* Video device flags */
  126. typedef enum
  127. {
  128. VIDEO_DEVICE_CAPS_MODE_SWITCHING_EMULATED = 0x01,
  129. VIDEO_DEVICE_CAPS_HAS_POPUP_WINDOW_SUPPORT = 0x02,
  130. VIDEO_DEVICE_CAPS_SENDS_FULLSCREEN_DIMENSIONS = 0x04,
  131. VIDEO_DEVICE_CAPS_FULLSCREEN_ONLY = 0x08,
  132. VIDEO_DEVICE_CAPS_SENDS_DISPLAY_CHANGES = 0x10,
  133. VIDEO_DEVICE_CAPS_DISABLE_MOUSE_WARP_ON_FULLSCREEN_TRANSITIONS = 0x20
  134. } DeviceCaps;
  135. /* Fullscreen operations */
  136. typedef enum
  137. {
  138. SDL_FULLSCREEN_OP_LEAVE = 0,
  139. SDL_FULLSCREEN_OP_ENTER,
  140. SDL_FULLSCREEN_OP_UPDATE
  141. } SDL_FullscreenOp;
  142. struct SDL_VideoDevice
  143. {
  144. /* * * */
  145. /* The name of this video driver */
  146. const char *name;
  147. /* * * */
  148. /* Initialization/Query functions */
  149. /*
  150. * Initialize the native video subsystem, filling in the list of
  151. * displays for this driver, returning 0 or -1 if there's an error.
  152. */
  153. int (*VideoInit)(SDL_VideoDevice *_this);
  154. /*
  155. * Reverse the effects VideoInit() -- called if VideoInit() fails or
  156. * if the application is shutting down the video subsystem.
  157. */
  158. void (*VideoQuit)(SDL_VideoDevice *_this);
  159. /*
  160. * Reinitialize the touch devices -- called if an unknown touch ID occurs.
  161. */
  162. void (*ResetTouch)(SDL_VideoDevice *_this);
  163. /* * * */
  164. /*
  165. * Display functions
  166. */
  167. /*
  168. * Refresh the display list
  169. */
  170. void (*RefreshDisplays)(SDL_VideoDevice *_this);
  171. /*
  172. * Get the bounds of a display
  173. */
  174. int (*GetDisplayBounds)(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect);
  175. /*
  176. * Get the usable bounds of a display (bounds minus menubar or whatever)
  177. */
  178. int (*GetDisplayUsableBounds)(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect);
  179. /*
  180. * Get a list of the available display modes for a display.
  181. */
  182. int (*GetDisplayModes)(SDL_VideoDevice *_this, SDL_VideoDisplay *display);
  183. /*
  184. * Setting the display mode is independent of creating windows, so
  185. * when the display mode is changed, all existing windows should have
  186. * their data updated accordingly, including the display surfaces
  187. * associated with them.
  188. */
  189. int (*SetDisplayMode)(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
  190. /* * * */
  191. /*
  192. * Window functions
  193. */
  194. int (*CreateSDLWindow)(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props);
  195. void (*SetWindowTitle)(SDL_VideoDevice *_this, SDL_Window *window);
  196. int (*SetWindowIcon)(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon);
  197. int (*SetWindowPosition)(SDL_VideoDevice *_this, SDL_Window *window);
  198. void (*SetWindowSize)(SDL_VideoDevice *_this, SDL_Window *window);
  199. void (*SetWindowMinimumSize)(SDL_VideoDevice *_this, SDL_Window *window);
  200. void (*SetWindowMaximumSize)(SDL_VideoDevice *_this, SDL_Window *window);
  201. void (*SetWindowAspectRatio)(SDL_VideoDevice *_this, SDL_Window *window);
  202. int (*GetWindowBordersSize)(SDL_VideoDevice *_this, SDL_Window *window, int *top, int *left, int *bottom, int *right);
  203. void (*GetWindowSizeInPixels)(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h);
  204. int (*SetWindowOpacity)(SDL_VideoDevice *_this, SDL_Window *window, float opacity);
  205. int (*SetWindowModalFor)(SDL_VideoDevice *_this, SDL_Window *modal_window, SDL_Window *parent_window);
  206. int (*SetWindowInputFocus)(SDL_VideoDevice *_this, SDL_Window *window);
  207. void (*ShowWindow)(SDL_VideoDevice *_this, SDL_Window *window);
  208. void (*HideWindow)(SDL_VideoDevice *_this, SDL_Window *window);
  209. void (*RaiseWindow)(SDL_VideoDevice *_this, SDL_Window *window);
  210. void (*MaximizeWindow)(SDL_VideoDevice *_this, SDL_Window *window);
  211. void (*MinimizeWindow)(SDL_VideoDevice *_this, SDL_Window *window);
  212. void (*RestoreWindow)(SDL_VideoDevice *_this, SDL_Window *window);
  213. void (*SetWindowBordered)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered);
  214. void (*SetWindowResizable)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable);
  215. void (*SetWindowAlwaysOnTop)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool on_top);
  216. int (*SetWindowFullscreen)(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_FullscreenOp fullscreen);
  217. void *(*GetWindowICCProfile)(SDL_VideoDevice *_this, SDL_Window *window, size_t *size);
  218. SDL_DisplayID (*GetDisplayForWindow)(SDL_VideoDevice *_this, SDL_Window *window);
  219. int (*SetWindowMouseRect)(SDL_VideoDevice *_this, SDL_Window *window);
  220. int (*SetWindowMouseGrab)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed);
  221. int (*SetWindowKeyboardGrab)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed);
  222. void (*DestroyWindow)(SDL_VideoDevice *_this, SDL_Window *window);
  223. int (*CreateWindowFramebuffer)(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch);
  224. int (*SetWindowFramebufferVSync)(SDL_VideoDevice *_this, SDL_Window *window, int vsync);
  225. int (*GetWindowFramebufferVSync)(SDL_VideoDevice *_this, SDL_Window *window, int *vsync);
  226. int (*UpdateWindowFramebuffer)(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects);
  227. void (*DestroyWindowFramebuffer)(SDL_VideoDevice *_this, SDL_Window *window);
  228. void (*OnWindowEnter)(SDL_VideoDevice *_this, SDL_Window *window);
  229. int (*UpdateWindowShape)(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *shape);
  230. int (*FlashWindow)(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation);
  231. int (*SetWindowFocusable)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool focusable);
  232. int (*SyncWindow)(SDL_VideoDevice *_this, SDL_Window *window);
  233. /* * * */
  234. /*
  235. * OpenGL support
  236. */
  237. int (*GL_LoadLibrary)(SDL_VideoDevice *_this, const char *path);
  238. SDL_FunctionPointer (*GL_GetProcAddress)(SDL_VideoDevice *_this, const char *proc);
  239. void (*GL_UnloadLibrary)(SDL_VideoDevice *_this);
  240. SDL_GLContext (*GL_CreateContext)(SDL_VideoDevice *_this, SDL_Window *window);
  241. int (*GL_MakeCurrent)(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context);
  242. SDL_EGLSurface (*GL_GetEGLSurface)(SDL_VideoDevice *_this, SDL_Window *window);
  243. int (*GL_SetSwapInterval)(SDL_VideoDevice *_this, int interval);
  244. int (*GL_GetSwapInterval)(SDL_VideoDevice *_this, int *interval);
  245. int (*GL_SwapWindow)(SDL_VideoDevice *_this, SDL_Window *window);
  246. int (*GL_DeleteContext)(SDL_VideoDevice *_this, SDL_GLContext context);
  247. void (*GL_DefaultProfileConfig)(SDL_VideoDevice *_this, int *mask, int *major, int *minor);
  248. /* * * */
  249. /*
  250. * Vulkan support
  251. */
  252. int (*Vulkan_LoadLibrary)(SDL_VideoDevice *_this, const char *path);
  253. void (*Vulkan_UnloadLibrary)(SDL_VideoDevice *_this);
  254. char const* const* (*Vulkan_GetInstanceExtensions)(SDL_VideoDevice *_this, Uint32 *count);
  255. SDL_bool (*Vulkan_CreateSurface)(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR *surface);
  256. void (*Vulkan_DestroySurface)(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, const struct VkAllocationCallbacks *allocator);
  257. /* * * */
  258. /*
  259. * Metal support
  260. */
  261. SDL_MetalView (*Metal_CreateView)(SDL_VideoDevice *_this, SDL_Window *window);
  262. void (*Metal_DestroyView)(SDL_VideoDevice *_this, SDL_MetalView view);
  263. void *(*Metal_GetLayer)(SDL_VideoDevice *_this, SDL_MetalView view);
  264. /* * * */
  265. /*
  266. * Event manager functions
  267. */
  268. int (*WaitEventTimeout)(SDL_VideoDevice *_this, Sint64 timeoutNS);
  269. void (*SendWakeupEvent)(SDL_VideoDevice *_this, SDL_Window *window);
  270. void (*PumpEvents)(SDL_VideoDevice *_this);
  271. /* Suspend the screensaver */
  272. int (*SuspendScreenSaver)(SDL_VideoDevice *_this);
  273. /* Text input */
  274. void (*StartTextInput)(SDL_VideoDevice *_this);
  275. void (*StopTextInput)(SDL_VideoDevice *_this);
  276. int (*SetTextInputRect)(SDL_VideoDevice *_this, const SDL_Rect *rect);
  277. void (*ClearComposition)(SDL_VideoDevice *_this);
  278. /* Screen keyboard */
  279. SDL_bool (*HasScreenKeyboardSupport)(SDL_VideoDevice *_this);
  280. void (*ShowScreenKeyboard)(SDL_VideoDevice *_this, SDL_Window *window);
  281. void (*HideScreenKeyboard)(SDL_VideoDevice *_this, SDL_Window *window);
  282. SDL_bool (*IsScreenKeyboardShown)(SDL_VideoDevice *_this, SDL_Window *window);
  283. /* Clipboard */
  284. const char **(*GetTextMimeTypes)(SDL_VideoDevice *_this, size_t *num_mime_types);
  285. int (*SetClipboardData)(SDL_VideoDevice *_this);
  286. void *(*GetClipboardData)(SDL_VideoDevice *_this, const char *mime_type, size_t *size);
  287. SDL_bool (*HasClipboardData)(SDL_VideoDevice *_this, const char *mime_type);
  288. /* If you implement *ClipboardData, you don't need to implement *ClipboardText */
  289. int (*SetClipboardText)(SDL_VideoDevice *_this, const char *text);
  290. char *(*GetClipboardText)(SDL_VideoDevice *_this);
  291. SDL_bool (*HasClipboardText)(SDL_VideoDevice *_this);
  292. /* These functions are only needed if the platform has a separate primary selection buffer */
  293. int (*SetPrimarySelectionText)(SDL_VideoDevice *_this, const char *text);
  294. char *(*GetPrimarySelectionText)(SDL_VideoDevice *_this);
  295. SDL_bool (*HasPrimarySelectionText)(SDL_VideoDevice *_this);
  296. /* MessageBox */
  297. int (*ShowMessageBox)(SDL_VideoDevice *_this, const SDL_MessageBoxData *messageboxdata, int *buttonID);
  298. /* Hit-testing */
  299. int (*SetWindowHitTest)(SDL_Window *window, SDL_bool enabled);
  300. /* Tell window that app enabled drag'n'drop events */
  301. void (*AcceptDragAndDrop)(SDL_Window *window, SDL_bool accept);
  302. /* Display the system-level window menu */
  303. void (*ShowWindowSystemMenu)(SDL_Window *window, int x, int y);
  304. /* * * */
  305. /* Data common to all drivers */
  306. SDL_ThreadID thread;
  307. SDL_bool checked_texture_framebuffer;
  308. SDL_bool is_dummy;
  309. SDL_bool suspend_screensaver;
  310. SDL_Window *wakeup_window;
  311. SDL_Mutex *wakeup_lock; /* Initialized only if WaitEventTimeout/SendWakeupEvent are supported */
  312. int num_displays;
  313. SDL_VideoDisplay **displays;
  314. SDL_Rect desktop_bounds;
  315. SDL_Window *windows;
  316. SDL_Window *grabbed_window;
  317. Uint32 clipboard_sequence;
  318. SDL_ClipboardDataCallback clipboard_callback;
  319. SDL_ClipboardCleanupCallback clipboard_cleanup;
  320. void *clipboard_userdata;
  321. char **clipboard_mime_types;
  322. size_t num_clipboard_mime_types;
  323. char *primary_selection_text;
  324. SDL_bool setting_display_mode;
  325. Uint32 device_caps;
  326. SDL_SystemTheme system_theme;
  327. SDL_bool text_input_active;
  328. /* * * */
  329. /* Data used by the GL drivers */
  330. struct
  331. {
  332. int red_size;
  333. int green_size;
  334. int blue_size;
  335. int alpha_size;
  336. int depth_size;
  337. int buffer_size;
  338. int stencil_size;
  339. int double_buffer;
  340. int accum_red_size;
  341. int accum_green_size;
  342. int accum_blue_size;
  343. int accum_alpha_size;
  344. int stereo;
  345. int multisamplebuffers;
  346. int multisamplesamples;
  347. int floatbuffers;
  348. int accelerated;
  349. int major_version;
  350. int minor_version;
  351. int flags;
  352. int profile_mask;
  353. int share_with_current_context;
  354. int release_behavior;
  355. int reset_notification;
  356. int framebuffer_srgb_capable;
  357. int no_error;
  358. int retained_backing;
  359. int egl_platform;
  360. int driver_loaded;
  361. char driver_path[256];
  362. void *dll_handle;
  363. } gl_config;
  364. SDL_EGLAttribArrayCallback egl_platformattrib_callback;
  365. SDL_EGLIntArrayCallback egl_surfaceattrib_callback;
  366. SDL_EGLIntArrayCallback egl_contextattrib_callback;
  367. /* * * */
  368. /* Cache current GL context; don't call the OS when it hasn't changed. */
  369. /* We have the global pointers here so Cocoa continues to work the way
  370. it always has, and the thread-local storage for the general case.
  371. */
  372. SDL_Window *current_glwin;
  373. SDL_GLContext current_glctx;
  374. SDL_TLSID current_glwin_tls;
  375. SDL_TLSID current_glctx_tls;
  376. /* Flag that stores whether it's allowed to call SDL_GL_MakeCurrent()
  377. * with a NULL window, but a non-NULL context. (Not allowed in most cases,
  378. * except on EGL under some circumstances.) */
  379. SDL_bool gl_allow_no_surface;
  380. /* * * */
  381. /* Data used by the Vulkan drivers */
  382. struct
  383. {
  384. SDL_FunctionPointer vkGetInstanceProcAddr;
  385. SDL_FunctionPointer vkEnumerateInstanceExtensionProperties;
  386. int loader_loaded;
  387. char loader_path[256];
  388. void *loader_handle;
  389. } vulkan_config;
  390. /* * * */
  391. /* Data private to this driver */
  392. SDL_VideoData *driverdata;
  393. struct SDL_GLDriverData *gl_data;
  394. #ifdef SDL_VIDEO_OPENGL_EGL
  395. struct SDL_EGL_VideoData *egl_data;
  396. #endif
  397. #if defined(SDL_VIDEO_OPENGL_ES) || defined(SDL_VIDEO_OPENGL_ES2)
  398. struct SDL_PrivateGLESData *gles_data;
  399. #endif
  400. /* * * */
  401. /* The function used to dispose of this structure */
  402. void (*free)(SDL_VideoDevice *_this);
  403. };
  404. typedef struct VideoBootStrap
  405. {
  406. const char *name;
  407. const char *desc;
  408. SDL_VideoDevice *(*create)(void);
  409. int (*ShowMessageBox)(const SDL_MessageBoxData *messageboxdata, int *buttonID); /* can be done without initializing backend! */
  410. } VideoBootStrap;
  411. /* Not all of these are available in a given build. Use #ifdefs, etc. */
  412. extern VideoBootStrap COCOA_bootstrap;
  413. extern VideoBootStrap X11_bootstrap;
  414. extern VideoBootStrap WINDOWS_bootstrap;
  415. extern VideoBootStrap WINRT_bootstrap;
  416. extern VideoBootStrap HAIKU_bootstrap;
  417. extern VideoBootStrap UIKIT_bootstrap;
  418. extern VideoBootStrap Android_bootstrap;
  419. extern VideoBootStrap PS2_bootstrap;
  420. extern VideoBootStrap PSP_bootstrap;
  421. extern VideoBootStrap VITA_bootstrap;
  422. extern VideoBootStrap RISCOS_bootstrap;
  423. extern VideoBootStrap N3DS_bootstrap;
  424. extern VideoBootStrap RPI_bootstrap;
  425. extern VideoBootStrap KMSDRM_bootstrap;
  426. extern VideoBootStrap DUMMY_bootstrap;
  427. extern VideoBootStrap DUMMY_evdev_bootstrap;
  428. extern VideoBootStrap Wayland_bootstrap;
  429. extern VideoBootStrap VIVANTE_bootstrap;
  430. extern VideoBootStrap Emscripten_bootstrap;
  431. extern VideoBootStrap OFFSCREEN_bootstrap;
  432. extern VideoBootStrap NGAGE_bootstrap;
  433. extern VideoBootStrap QNX_bootstrap;
  434. /* Use SDL_OnVideoThread() sparingly, to avoid regressions in use cases that currently happen to work */
  435. extern SDL_bool SDL_OnVideoThread(void);
  436. extern SDL_VideoDevice *SDL_GetVideoDevice(void);
  437. extern void SDL_SetSystemTheme(SDL_SystemTheme theme);
  438. extern SDL_DisplayID SDL_AddBasicVideoDisplay(const SDL_DisplayMode *desktop_mode);
  439. extern SDL_DisplayID SDL_AddVideoDisplay(const SDL_VideoDisplay *display, SDL_bool send_event);
  440. extern void SDL_DelVideoDisplay(SDL_DisplayID display, SDL_bool send_event);
  441. extern SDL_bool SDL_AddFullscreenDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode);
  442. extern void SDL_ResetFullscreenDisplayModes(SDL_VideoDisplay *display);
  443. extern void SDL_SetDesktopDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode);
  444. extern void SDL_SetCurrentDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode);
  445. extern void SDL_SetDisplayContentScale(SDL_VideoDisplay *display, float scale);
  446. extern void SDL_SetDisplayHDRProperties(SDL_VideoDisplay *display, const SDL_HDRDisplayProperties *HDR);
  447. extern int SDL_SetDisplayModeForDisplay(SDL_VideoDisplay *display, SDL_DisplayMode *mode);
  448. extern SDL_VideoDisplay *SDL_GetVideoDisplay(SDL_DisplayID display);
  449. extern SDL_DisplayID SDL_GetDisplayForWindowPosition(SDL_Window *window);
  450. extern SDL_VideoDisplay *SDL_GetVideoDisplayForWindow(SDL_Window *window);
  451. extern SDL_VideoDisplay *SDL_GetVideoDisplayForFullscreenWindow(SDL_Window *window);
  452. extern int SDL_GetDisplayIndex(SDL_DisplayID displayID);
  453. extern SDL_DisplayData *SDL_GetDisplayDriverData(SDL_DisplayID display);
  454. extern SDL_DisplayData *SDL_GetDisplayDriverDataForWindow(SDL_Window *window);
  455. extern int SDL_GetMessageBoxCount(void);
  456. extern void SDL_GL_DeduceMaxSupportedESProfile(int *major, int *minor);
  457. extern int SDL_RecreateWindow(SDL_Window *window, SDL_WindowFlags flags);
  458. extern SDL_bool SDL_HasWindows(void);
  459. extern void SDL_RelativeToGlobalForWindow(SDL_Window *window, int rel_x, int rel_y, int *abs_x, int *abs_y);
  460. extern void SDL_GlobalToRelativeForWindow(SDL_Window *window, int abs_x, int abs_y, int *rel_x, int *rel_y);
  461. extern void SDL_OnDisplayAdded(SDL_VideoDisplay *display);
  462. extern void SDL_OnDisplayMoved(SDL_VideoDisplay *display);
  463. extern void SDL_OnWindowShown(SDL_Window *window);
  464. extern void SDL_OnWindowHidden(SDL_Window *window);
  465. extern void SDL_OnWindowMoved(SDL_Window *window);
  466. extern void SDL_OnWindowResized(SDL_Window *window);
  467. extern void SDL_CheckWindowPixelSizeChanged(SDL_Window *window);
  468. extern void SDL_OnWindowPixelSizeChanged(SDL_Window *window);
  469. extern void SDL_OnWindowMinimized(SDL_Window *window);
  470. extern void SDL_OnWindowMaximized(SDL_Window *window);
  471. extern void SDL_OnWindowRestored(SDL_Window *window);
  472. extern void SDL_OnWindowEnter(SDL_Window *window);
  473. extern void SDL_OnWindowLeave(SDL_Window *window);
  474. extern void SDL_OnWindowFocusGained(SDL_Window *window);
  475. extern void SDL_OnWindowFocusLost(SDL_Window *window);
  476. extern void SDL_OnWindowDisplayChanged(SDL_Window *window);
  477. extern void SDL_UpdateWindowGrab(SDL_Window *window);
  478. extern int SDL_UpdateFullscreenMode(SDL_Window *window, SDL_FullscreenOp fullscreen, SDL_bool commit);
  479. extern SDL_Window *SDL_GetToplevelForKeyboardFocus(void);
  480. extern SDL_bool SDL_ShouldAllowTopmost(void);
  481. extern void SDL_ToggleDragAndDropSupport(void);
  482. #endif /* SDL_sysvideo_h_ */