2015-06-21 17:33:46 +02:00
|
|
|
/*
|
|
|
|
Simple DirectMedia Layer
|
2020-01-17 05:49:25 +01:00
|
|
|
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
2015-06-21 17:33:46 +02:00
|
|
|
|
|
|
|
This software is provided 'as-is', without any express or implied
|
|
|
|
warranty. In no event will the authors be held liable for any damages
|
|
|
|
arising from the use of this software.
|
|
|
|
|
|
|
|
Permission is granted to anyone to use this software for any purpose,
|
|
|
|
including commercial applications, and to alter it and redistribute it
|
|
|
|
freely, subject to the following restrictions:
|
|
|
|
|
|
|
|
1. The origin of this software must not be misrepresented; you must not
|
|
|
|
claim that you wrote the original software. If you use this software
|
|
|
|
in a product, an acknowledgment in the product documentation would be
|
|
|
|
appreciated but is not required.
|
|
|
|
2. Altered source versions must be plainly marked as such, and must not be
|
|
|
|
misrepresented as being the original software.
|
|
|
|
3. This notice may not be removed or altered from any source distribution.
|
|
|
|
*/
|
|
|
|
#include "../SDL_internal.h"
|
|
|
|
|
2016-11-21 06:34:54 +01:00
|
|
|
#ifndef SDL_sysvideo_h_
|
|
|
|
#define SDL_sysvideo_h_
|
2015-06-21 17:33:46 +02:00
|
|
|
|
|
|
|
#include "SDL_messagebox.h"
|
|
|
|
#include "SDL_shape.h"
|
|
|
|
#include "SDL_thread.h"
|
2019-08-05 17:35:32 +02:00
|
|
|
#include "SDL_metal.h"
|
2017-08-28 08:13:15 +02:00
|
|
|
|
|
|
|
#include "SDL_vulkan_internal.h"
|
2015-06-21 17:33:46 +02:00
|
|
|
|
|
|
|
/* The SDL video driver */
|
|
|
|
|
|
|
|
typedef struct SDL_WindowShaper SDL_WindowShaper;
|
|
|
|
typedef struct SDL_ShapeDriver SDL_ShapeDriver;
|
|
|
|
typedef struct SDL_VideoDisplay SDL_VideoDisplay;
|
|
|
|
typedef struct SDL_VideoDevice SDL_VideoDevice;
|
|
|
|
|
|
|
|
/* Define the SDL window-shaper structure */
|
|
|
|
struct SDL_WindowShaper
|
|
|
|
{
|
|
|
|
/* The window associated with the shaper */
|
|
|
|
SDL_Window *window;
|
|
|
|
|
|
|
|
/* The user's specified coordinates for the window, for once we give it a shape. */
|
|
|
|
Uint32 userx,usery;
|
|
|
|
|
|
|
|
/* The parameters for shape calculation. */
|
|
|
|
SDL_WindowShapeMode mode;
|
|
|
|
|
|
|
|
/* Has this window been assigned a shape? */
|
|
|
|
SDL_bool hasshape;
|
|
|
|
|
|
|
|
void *driverdata;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Define the SDL shape driver structure */
|
|
|
|
struct SDL_ShapeDriver
|
|
|
|
{
|
|
|
|
SDL_WindowShaper *(*CreateShaper)(SDL_Window * window);
|
|
|
|
int (*SetWindowShape)(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode);
|
|
|
|
int (*ResizeWindowShape)(SDL_Window *window);
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct SDL_WindowUserData
|
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
void *data;
|
|
|
|
struct SDL_WindowUserData *next;
|
|
|
|
} SDL_WindowUserData;
|
|
|
|
|
|
|
|
/* Define the SDL window structure, corresponding to toplevel windows */
|
|
|
|
struct SDL_Window
|
|
|
|
{
|
|
|
|
const void *magic;
|
|
|
|
Uint32 id;
|
|
|
|
char *title;
|
|
|
|
SDL_Surface *icon;
|
|
|
|
int x, y;
|
|
|
|
int w, h;
|
|
|
|
int min_w, min_h;
|
|
|
|
int max_w, max_h;
|
|
|
|
Uint32 flags;
|
|
|
|
Uint32 last_fullscreen_flags;
|
|
|
|
|
|
|
|
/* Stored position and size for windowed mode */
|
|
|
|
SDL_Rect windowed;
|
|
|
|
|
|
|
|
SDL_DisplayMode fullscreen_mode;
|
|
|
|
|
2016-01-05 08:46:10 +01:00
|
|
|
float opacity;
|
|
|
|
|
2015-06-21 17:33:46 +02:00
|
|
|
float brightness;
|
|
|
|
Uint16 *gamma;
|
|
|
|
Uint16 *saved_gamma; /* (just offset into gamma) */
|
|
|
|
|
|
|
|
SDL_Surface *surface;
|
|
|
|
SDL_bool surface_valid;
|
|
|
|
|
|
|
|
SDL_bool is_hiding;
|
|
|
|
SDL_bool is_destroying;
|
2016-01-05 07:42:00 +01:00
|
|
|
SDL_bool is_dropping; /* drag/drop in progress, expecting SDL_SendDropComplete(). */
|
2015-06-21 17:33:46 +02:00
|
|
|
|
|
|
|
SDL_WindowShaper *shaper;
|
|
|
|
|
|
|
|
SDL_HitTest hit_test;
|
|
|
|
void *hit_test_data;
|
|
|
|
|
|
|
|
SDL_WindowUserData *data;
|
|
|
|
|
|
|
|
void *driverdata;
|
|
|
|
|
|
|
|
SDL_Window *prev;
|
|
|
|
SDL_Window *next;
|
|
|
|
};
|
|
|
|
#define FULLSCREEN_VISIBLE(W) \
|
|
|
|
(((W)->flags & SDL_WINDOW_FULLSCREEN) && \
|
|
|
|
((W)->flags & SDL_WINDOW_SHOWN) && \
|
|
|
|
!((W)->flags & SDL_WINDOW_MINIMIZED))
|
|
|
|
|
|
|
|
/*
|
2018-08-23 06:48:28 +02:00
|
|
|
* Define the SDL display structure.
|
|
|
|
* This corresponds to physical monitors attached to the system.
|
2015-06-21 17:33:46 +02:00
|
|
|
*/
|
|
|
|
struct SDL_VideoDisplay
|
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
int max_display_modes;
|
|
|
|
int num_display_modes;
|
|
|
|
SDL_DisplayMode *display_modes;
|
|
|
|
SDL_DisplayMode desktop_mode;
|
|
|
|
SDL_DisplayMode current_mode;
|
2018-08-23 06:48:28 +02:00
|
|
|
SDL_DisplayOrientation orientation;
|
2015-06-21 17:33:46 +02:00
|
|
|
|
|
|
|
SDL_Window *fullscreen_window;
|
|
|
|
|
|
|
|
SDL_VideoDevice *device;
|
|
|
|
|
|
|
|
void *driverdata;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Forward declaration */
|
|
|
|
struct SDL_SysWMinfo;
|
|
|
|
|
|
|
|
/* Define the SDL video driver structure */
|
|
|
|
#define _THIS SDL_VideoDevice *_this
|
|
|
|
|
|
|
|
struct SDL_VideoDevice
|
|
|
|
{
|
|
|
|
/* * * */
|
|
|
|
/* The name of this video driver */
|
|
|
|
const char *name;
|
|
|
|
|
|
|
|
/* * * */
|
|
|
|
/* Initialization/Query functions */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialize the native video subsystem, filling in the list of
|
|
|
|
* displays for this driver, returning 0 or -1 if there's an error.
|
|
|
|
*/
|
|
|
|
int (*VideoInit) (_THIS);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Reverse the effects VideoInit() -- called if VideoInit() fails or
|
|
|
|
* if the application is shutting down the video subsystem.
|
|
|
|
*/
|
|
|
|
void (*VideoQuit) (_THIS);
|
|
|
|
|
2017-02-11 20:14:48 +01:00
|
|
|
/*
|
|
|
|
* Reinitialize the touch devices -- called if an unknown touch ID occurs.
|
|
|
|
*/
|
|
|
|
void (*ResetTouch) (_THIS);
|
|
|
|
|
2015-06-21 17:33:46 +02:00
|
|
|
/* * * */
|
|
|
|
/*
|
|
|
|
* Display functions
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Get the bounds of a display
|
|
|
|
*/
|
|
|
|
int (*GetDisplayBounds) (_THIS, SDL_VideoDisplay * display, SDL_Rect * rect);
|
|
|
|
|
2015-07-30 02:18:56 +02:00
|
|
|
/*
|
2018-08-23 06:48:28 +02:00
|
|
|
* Get the usable bounds of a display (bounds minus menubar or whatever)
|
2015-07-30 02:18:56 +02:00
|
|
|
*/
|
2018-08-23 06:48:28 +02:00
|
|
|
int (*GetDisplayUsableBounds) (_THIS, SDL_VideoDisplay * display, SDL_Rect * rect);
|
2015-07-30 02:18:56 +02:00
|
|
|
|
2016-01-05 05:52:40 +01:00
|
|
|
/*
|
2018-08-23 06:48:28 +02:00
|
|
|
* Get the dots/pixels-per-inch of a display
|
2016-01-05 05:52:40 +01:00
|
|
|
*/
|
2018-08-23 06:48:28 +02:00
|
|
|
int (*GetDisplayDPI) (_THIS, SDL_VideoDisplay * display, float * ddpi, float * hdpi, float * vdpi);
|
2016-01-05 05:52:40 +01:00
|
|
|
|
2015-06-21 17:33:46 +02:00
|
|
|
/*
|
|
|
|
* Get a list of the available display modes for a display.
|
|
|
|
*/
|
|
|
|
void (*GetDisplayModes) (_THIS, SDL_VideoDisplay * display);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Setting the display mode is independent of creating windows, so
|
|
|
|
* when the display mode is changed, all existing windows should have
|
|
|
|
* their data updated accordingly, including the display surfaces
|
|
|
|
* associated with them.
|
|
|
|
*/
|
|
|
|
int (*SetDisplayMode) (_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
|
|
|
|
|
|
|
|
/* * * */
|
|
|
|
/*
|
|
|
|
* Window functions
|
|
|
|
*/
|
2017-08-28 09:43:14 +02:00
|
|
|
int (*CreateSDLWindow) (_THIS, SDL_Window * window);
|
|
|
|
int (*CreateSDLWindowFrom) (_THIS, SDL_Window * window, const void *data);
|
2015-06-21 17:33:46 +02:00
|
|
|
void (*SetWindowTitle) (_THIS, SDL_Window * window);
|
|
|
|
void (*SetWindowIcon) (_THIS, SDL_Window * window, SDL_Surface * icon);
|
|
|
|
void (*SetWindowPosition) (_THIS, SDL_Window * window);
|
|
|
|
void (*SetWindowSize) (_THIS, SDL_Window * window);
|
|
|
|
void (*SetWindowMinimumSize) (_THIS, SDL_Window * window);
|
|
|
|
void (*SetWindowMaximumSize) (_THIS, SDL_Window * window);
|
2016-01-05 08:29:06 +01:00
|
|
|
int (*GetWindowBordersSize) (_THIS, SDL_Window * window, int *top, int *left, int *bottom, int *right);
|
2016-01-05 08:46:10 +01:00
|
|
|
int (*SetWindowOpacity) (_THIS, SDL_Window * window, float opacity);
|
2015-04-21 15:45:58 +02:00
|
|
|
int (*SetWindowModalFor) (_THIS, SDL_Window * modal_window, SDL_Window * parent_window);
|
2016-01-05 08:28:56 +01:00
|
|
|
int (*SetWindowInputFocus) (_THIS, SDL_Window * window);
|
2015-06-21 17:33:46 +02:00
|
|
|
void (*ShowWindow) (_THIS, SDL_Window * window);
|
|
|
|
void (*HideWindow) (_THIS, SDL_Window * window);
|
|
|
|
void (*RaiseWindow) (_THIS, SDL_Window * window);
|
|
|
|
void (*MaximizeWindow) (_THIS, SDL_Window * window);
|
|
|
|
void (*MinimizeWindow) (_THIS, SDL_Window * window);
|
|
|
|
void (*RestoreWindow) (_THIS, SDL_Window * window);
|
|
|
|
void (*SetWindowBordered) (_THIS, SDL_Window * window, SDL_bool bordered);
|
2016-09-30 04:52:41 +02:00
|
|
|
void (*SetWindowResizable) (_THIS, SDL_Window * window, SDL_bool resizable);
|
2015-06-21 17:33:46 +02:00
|
|
|
void (*SetWindowFullscreen) (_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
|
|
|
|
int (*SetWindowGammaRamp) (_THIS, SDL_Window * window, const Uint16 * ramp);
|
|
|
|
int (*GetWindowGammaRamp) (_THIS, SDL_Window * window, Uint16 * ramp);
|
|
|
|
void (*SetWindowGrab) (_THIS, SDL_Window * window, SDL_bool grabbed);
|
|
|
|
void (*DestroyWindow) (_THIS, SDL_Window * window);
|
|
|
|
int (*CreateWindowFramebuffer) (_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch);
|
|
|
|
int (*UpdateWindowFramebuffer) (_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects);
|
|
|
|
void (*DestroyWindowFramebuffer) (_THIS, SDL_Window * window);
|
|
|
|
void (*OnWindowEnter) (_THIS, SDL_Window * window);
|
|
|
|
|
|
|
|
/* * * */
|
|
|
|
/*
|
|
|
|
* Shaped-window functions
|
|
|
|
*/
|
|
|
|
SDL_ShapeDriver shape_driver;
|
|
|
|
|
|
|
|
/* Get some platform dependent window information */
|
|
|
|
SDL_bool(*GetWindowWMInfo) (_THIS, SDL_Window * window,
|
|
|
|
struct SDL_SysWMinfo * info);
|
|
|
|
|
|
|
|
/* * * */
|
|
|
|
/*
|
|
|
|
* OpenGL support
|
|
|
|
*/
|
|
|
|
int (*GL_LoadLibrary) (_THIS, const char *path);
|
|
|
|
void *(*GL_GetProcAddress) (_THIS, const char *proc);
|
|
|
|
void (*GL_UnloadLibrary) (_THIS);
|
|
|
|
SDL_GLContext(*GL_CreateContext) (_THIS, SDL_Window * window);
|
|
|
|
int (*GL_MakeCurrent) (_THIS, SDL_Window * window, SDL_GLContext context);
|
|
|
|
void (*GL_GetDrawableSize) (_THIS, SDL_Window * window, int *w, int *h);
|
|
|
|
int (*GL_SetSwapInterval) (_THIS, int interval);
|
|
|
|
int (*GL_GetSwapInterval) (_THIS);
|
2016-12-09 10:47:43 +01:00
|
|
|
int (*GL_SwapWindow) (_THIS, SDL_Window * window);
|
2015-06-21 17:33:46 +02:00
|
|
|
void (*GL_DeleteContext) (_THIS, SDL_GLContext context);
|
2017-09-03 01:35:32 +02:00
|
|
|
void (*GL_DefaultProfileConfig) (_THIS, int *mask, int *major, int *minor);
|
2015-06-21 17:33:46 +02:00
|
|
|
|
2017-08-28 04:15:57 +02:00
|
|
|
/* * * */
|
|
|
|
/*
|
|
|
|
* Vulkan support
|
|
|
|
*/
|
|
|
|
int (*Vulkan_LoadLibrary) (_THIS, const char *path);
|
|
|
|
void (*Vulkan_UnloadLibrary) (_THIS);
|
|
|
|
SDL_bool (*Vulkan_GetInstanceExtensions) (_THIS, SDL_Window *window, unsigned *count, const char **names);
|
|
|
|
SDL_bool (*Vulkan_CreateSurface) (_THIS, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface);
|
|
|
|
void (*Vulkan_GetDrawableSize) (_THIS, SDL_Window * window, int *w, int *h);
|
|
|
|
|
2019-08-05 17:35:32 +02:00
|
|
|
/* * * */
|
|
|
|
/*
|
|
|
|
* Metal support
|
|
|
|
*/
|
|
|
|
SDL_MetalView (*Metal_CreateView) (_THIS, SDL_Window * window);
|
|
|
|
void (*Metal_DestroyView) (_THIS, SDL_MetalView view);
|
2020-04-10 06:37:35 +02:00
|
|
|
void *(*Metal_GetLayer) (_THIS, SDL_MetalView view);
|
|
|
|
void (*Metal_GetDrawableSize) (_THIS, SDL_Window * window, int *w, int *h);
|
2019-08-05 17:35:32 +02:00
|
|
|
|
2015-06-21 17:33:46 +02:00
|
|
|
/* * * */
|
|
|
|
/*
|
|
|
|
* Event manager functions
|
|
|
|
*/
|
|
|
|
void (*PumpEvents) (_THIS);
|
|
|
|
|
|
|
|
/* Suspend the screensaver */
|
|
|
|
void (*SuspendScreenSaver) (_THIS);
|
|
|
|
|
|
|
|
/* Text input */
|
|
|
|
void (*StartTextInput) (_THIS);
|
|
|
|
void (*StopTextInput) (_THIS);
|
|
|
|
void (*SetTextInputRect) (_THIS, SDL_Rect *rect);
|
|
|
|
|
|
|
|
/* Screen keyboard */
|
|
|
|
SDL_bool (*HasScreenKeyboardSupport) (_THIS);
|
|
|
|
void (*ShowScreenKeyboard) (_THIS, SDL_Window *window);
|
|
|
|
void (*HideScreenKeyboard) (_THIS, SDL_Window *window);
|
|
|
|
SDL_bool (*IsScreenKeyboardShown) (_THIS, SDL_Window *window);
|
|
|
|
|
|
|
|
/* Clipboard */
|
|
|
|
int (*SetClipboardText) (_THIS, const char *text);
|
|
|
|
char * (*GetClipboardText) (_THIS);
|
|
|
|
SDL_bool (*HasClipboardText) (_THIS);
|
|
|
|
|
|
|
|
/* MessageBox */
|
|
|
|
int (*ShowMessageBox) (_THIS, const SDL_MessageBoxData *messageboxdata, int *buttonid);
|
|
|
|
|
|
|
|
/* Hit-testing */
|
|
|
|
int (*SetWindowHitTest)(SDL_Window * window, SDL_bool enabled);
|
|
|
|
|
2018-08-02 22:03:47 +02:00
|
|
|
/* Tell window that app enabled drag'n'drop events */
|
|
|
|
void (*AcceptDragAndDrop)(SDL_Window * window, SDL_bool accept);
|
|
|
|
|
2015-06-21 17:33:46 +02:00
|
|
|
/* * * */
|
|
|
|
/* Data common to all drivers */
|
2016-12-11 21:01:01 +01:00
|
|
|
SDL_bool is_dummy;
|
2015-06-21 17:33:46 +02:00
|
|
|
SDL_bool suspend_screensaver;
|
|
|
|
int num_displays;
|
|
|
|
SDL_VideoDisplay *displays;
|
|
|
|
SDL_Window *windows;
|
|
|
|
SDL_Window *grabbed_window;
|
|
|
|
Uint8 window_magic;
|
|
|
|
Uint32 next_object_id;
|
2016-12-11 21:01:01 +01:00
|
|
|
char *clipboard_text;
|
2015-06-21 17:33:46 +02:00
|
|
|
|
|
|
|
/* * * */
|
|
|
|
/* Data used by the GL drivers */
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int red_size;
|
|
|
|
int green_size;
|
|
|
|
int blue_size;
|
|
|
|
int alpha_size;
|
|
|
|
int depth_size;
|
|
|
|
int buffer_size;
|
|
|
|
int stencil_size;
|
|
|
|
int double_buffer;
|
|
|
|
int accum_red_size;
|
|
|
|
int accum_green_size;
|
|
|
|
int accum_blue_size;
|
|
|
|
int accum_alpha_size;
|
|
|
|
int stereo;
|
|
|
|
int multisamplebuffers;
|
|
|
|
int multisamplesamples;
|
|
|
|
int accelerated;
|
|
|
|
int major_version;
|
|
|
|
int minor_version;
|
|
|
|
int flags;
|
|
|
|
int profile_mask;
|
|
|
|
int share_with_current_context;
|
|
|
|
int release_behavior;
|
2017-08-19 21:02:03 +02:00
|
|
|
int reset_notification;
|
2015-06-21 17:33:46 +02:00
|
|
|
int framebuffer_srgb_capable;
|
2017-08-25 03:30:53 +02:00
|
|
|
int no_error;
|
2015-06-21 17:33:46 +02:00
|
|
|
int retained_backing;
|
|
|
|
int driver_loaded;
|
|
|
|
char driver_path[256];
|
|
|
|
void *dll_handle;
|
|
|
|
} gl_config;
|
|
|
|
|
|
|
|
/* * * */
|
|
|
|
/* Cache current GL context; don't call the OS when it hasn't changed. */
|
|
|
|
/* We have the global pointers here so Cocoa continues to work the way
|
|
|
|
it always has, and the thread-local storage for the general case.
|
|
|
|
*/
|
|
|
|
SDL_Window *current_glwin;
|
|
|
|
SDL_GLContext current_glctx;
|
|
|
|
SDL_TLSID current_glwin_tls;
|
|
|
|
SDL_TLSID current_glctx_tls;
|
|
|
|
|
opengl: Allow SDL_GL_MakeCurrent() to accept a NULL window (thanks, Martin!).
This allows you to bind surfaceless contexts on a background thread to, for
example, load assets in a separate context, for platforms that have different
requirements about sharing surfaces, etc.
Martin's notes on the matter:
"Here's a patch that enables passing NULL windows to SDL_GL_MakeCurrent, if
the involved APIs allow it. Currently, this is only the case for EGL, and
even then only if some specific extensions are present (which they usually
are).
If "surfaceless" contexts are not supported, SDL_GL_MakeCurrent continues to
generate an error (albeit with a more specific error message than it used to),
so this should not break anything that wasn't broken before."
(Please see https://bugzilla.libsdl.org/show_bug.cgi?id=3695 for more
discussion.)
Fixes Bugzilla #3695.
2020-04-13 20:44:21 +02:00
|
|
|
/* Flag that stores whether it's allowed to call SDL_GL_MakeCurrent()
|
|
|
|
* with a NULL window, but a non-NULL context. (Not allowed in most cases,
|
|
|
|
* except on EGL under some circumstances.) */
|
2020-04-13 20:45:40 +02:00
|
|
|
SDL_bool gl_allow_no_surface;
|
opengl: Allow SDL_GL_MakeCurrent() to accept a NULL window (thanks, Martin!).
This allows you to bind surfaceless contexts on a background thread to, for
example, load assets in a separate context, for platforms that have different
requirements about sharing surfaces, etc.
Martin's notes on the matter:
"Here's a patch that enables passing NULL windows to SDL_GL_MakeCurrent, if
the involved APIs allow it. Currently, this is only the case for EGL, and
even then only if some specific extensions are present (which they usually
are).
If "surfaceless" contexts are not supported, SDL_GL_MakeCurrent continues to
generate an error (albeit with a more specific error message than it used to),
so this should not break anything that wasn't broken before."
(Please see https://bugzilla.libsdl.org/show_bug.cgi?id=3695 for more
discussion.)
Fixes Bugzilla #3695.
2020-04-13 20:44:21 +02:00
|
|
|
|
2017-08-28 04:15:57 +02:00
|
|
|
/* * * */
|
|
|
|
/* Data used by the Vulkan drivers */
|
|
|
|
struct
|
|
|
|
{
|
2018-01-31 03:08:34 +01:00
|
|
|
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
|
|
|
|
PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties;
|
2017-08-28 04:15:57 +02:00
|
|
|
int loader_loaded;
|
|
|
|
char loader_path[256];
|
|
|
|
void *loader_handle;
|
|
|
|
} vulkan_config;
|
|
|
|
|
2015-06-21 17:33:46 +02:00
|
|
|
/* * * */
|
|
|
|
/* Data private to this driver */
|
|
|
|
void *driverdata;
|
|
|
|
struct SDL_GLDriverData *gl_data;
|
|
|
|
|
|
|
|
#if SDL_VIDEO_OPENGL_EGL
|
|
|
|
struct SDL_EGL_VideoData *egl_data;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
|
|
|
|
struct SDL_PrivateGLESData *gles_data;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* * * */
|
|
|
|
/* The function used to dispose of this structure */
|
|
|
|
void (*free) (_THIS);
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct VideoBootStrap
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
const char *desc;
|
|
|
|
int (*available) (void);
|
|
|
|
SDL_VideoDevice *(*create) (int devindex);
|
|
|
|
} VideoBootStrap;
|
|
|
|
|
2017-02-26 06:40:04 +01:00
|
|
|
/* Not all of these are available in a given build. Use #ifdefs, etc. */
|
2015-06-21 17:33:46 +02:00
|
|
|
extern VideoBootStrap COCOA_bootstrap;
|
|
|
|
extern VideoBootStrap X11_bootstrap;
|
|
|
|
extern VideoBootStrap DirectFB_bootstrap;
|
|
|
|
extern VideoBootStrap WINDOWS_bootstrap;
|
|
|
|
extern VideoBootStrap WINRT_bootstrap;
|
|
|
|
extern VideoBootStrap HAIKU_bootstrap;
|
|
|
|
extern VideoBootStrap PND_bootstrap;
|
|
|
|
extern VideoBootStrap UIKIT_bootstrap;
|
|
|
|
extern VideoBootStrap Android_bootstrap;
|
|
|
|
extern VideoBootStrap PSP_bootstrap;
|
|
|
|
extern VideoBootStrap RPI_bootstrap;
|
2017-08-02 19:22:48 +02:00
|
|
|
extern VideoBootStrap KMSDRM_bootstrap;
|
2015-06-21 17:33:46 +02:00
|
|
|
extern VideoBootStrap DUMMY_bootstrap;
|
|
|
|
extern VideoBootStrap Wayland_bootstrap;
|
|
|
|
extern VideoBootStrap NACL_bootstrap;
|
|
|
|
extern VideoBootStrap VIVANTE_bootstrap;
|
|
|
|
extern VideoBootStrap Emscripten_bootstrap;
|
2017-07-01 23:50:47 +02:00
|
|
|
extern VideoBootStrap QNX_bootstrap;
|
2019-09-24 22:36:48 +02:00
|
|
|
extern VideoBootStrap OFFSCREEN_bootstrap;
|
2015-06-21 17:33:46 +02:00
|
|
|
|
|
|
|
extern SDL_VideoDevice *SDL_GetVideoDevice(void);
|
|
|
|
extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);
|
|
|
|
extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display);
|
|
|
|
extern SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode);
|
2018-08-23 06:48:28 +02:00
|
|
|
extern int SDL_GetIndexOfDisplay(SDL_VideoDisplay *display);
|
|
|
|
extern SDL_VideoDisplay *SDL_GetDisplay(int displayIndex);
|
2015-06-21 17:33:46 +02:00
|
|
|
extern SDL_VideoDisplay *SDL_GetDisplayForWindow(SDL_Window *window);
|
|
|
|
extern void *SDL_GetDisplayDriverData( int displayIndex );
|
2019-12-08 20:33:06 +01:00
|
|
|
extern SDL_bool SDL_IsVideoContextExternal(void);
|
2015-06-21 17:33:46 +02:00
|
|
|
|
2017-01-10 17:54:33 +01:00
|
|
|
extern void SDL_GL_DeduceMaxSupportedESProfile(int* major, int* minor);
|
|
|
|
|
2015-06-21 17:33:46 +02:00
|
|
|
extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
|
2017-08-15 23:29:47 +02:00
|
|
|
extern SDL_bool SDL_HasWindows(void);
|
2015-06-21 17:33:46 +02:00
|
|
|
|
|
|
|
extern void SDL_OnWindowShown(SDL_Window * window);
|
|
|
|
extern void SDL_OnWindowHidden(SDL_Window * window);
|
|
|
|
extern void SDL_OnWindowResized(SDL_Window * window);
|
|
|
|
extern void SDL_OnWindowMinimized(SDL_Window * window);
|
|
|
|
extern void SDL_OnWindowRestored(SDL_Window * window);
|
|
|
|
extern void SDL_OnWindowEnter(SDL_Window * window);
|
|
|
|
extern void SDL_OnWindowLeave(SDL_Window * window);
|
|
|
|
extern void SDL_OnWindowFocusGained(SDL_Window * window);
|
|
|
|
extern void SDL_OnWindowFocusLost(SDL_Window * window);
|
|
|
|
extern void SDL_UpdateWindowGrab(SDL_Window * window);
|
|
|
|
extern SDL_Window * SDL_GetFocusWindow(void);
|
|
|
|
|
|
|
|
extern SDL_bool SDL_ShouldAllowTopmost(void);
|
|
|
|
|
2015-07-30 02:18:56 +02:00
|
|
|
extern float SDL_ComputeDiagonalDPI(int hpix, int vpix, float hinches, float vinches);
|
|
|
|
|
2018-08-02 22:03:47 +02:00
|
|
|
extern void SDL_ToggleDragAndDropSupport(void);
|
|
|
|
|
2016-11-21 06:34:54 +01:00
|
|
|
#endif /* SDL_sysvideo_h_ */
|
2015-06-21 17:33:46 +02:00
|
|
|
|
|
|
|
/* vi: set ts=4 sw=4 expandtab: */
|