mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-02-18 09:28:22 +00:00
SDL_syswm.h has been removed and replaced with window properties
This commit is contained in:
@@ -101,8 +101,8 @@ typedef enum
|
||||
|
||||
/* Window events */
|
||||
/* 0x200 was SDL_WINDOWEVENT, reserve the number for sdl2-compat */
|
||||
SDL_EVENT_SYSWM = 0x201, /**< System specific event */
|
||||
SDL_EVENT_WINDOW_SHOWN, /**< Window has been shown */
|
||||
/* 0x201 was SDL_EVENT_SYSWM, reserve the number for sdl2-compat */
|
||||
SDL_EVENT_WINDOW_SHOWN = 0x202, /**< Window has been shown */
|
||||
SDL_EVENT_WINDOW_HIDDEN, /**< Window has been hidden */
|
||||
SDL_EVENT_WINDOW_EXPOSED, /**< Window has been exposed and should be redrawn */
|
||||
SDL_EVENT_WINDOW_MOVED, /**< Window has been moved to data1, data2 */
|
||||
@@ -573,27 +573,6 @@ typedef struct SDL_UserEvent
|
||||
} SDL_UserEvent;
|
||||
|
||||
|
||||
struct SDL_SysWMmsg;
|
||||
typedef struct SDL_SysWMmsg SDL_SysWMmsg;
|
||||
|
||||
/**
|
||||
* A video driver dependent system event (event.syswm.*)
|
||||
*
|
||||
* This event is disabled by default, you can enable it with
|
||||
* SDL_SetEventEnabled()
|
||||
*
|
||||
* The `msg` is owned by SDL and should be copied if the application
|
||||
* wants to hold onto it beyond the scope of handling this event.
|
||||
*
|
||||
* \note If you want to use this event, you should include SDL_syswm.h.
|
||||
*/
|
||||
typedef struct SDL_SysWMEvent
|
||||
{
|
||||
Uint32 type; /**< ::SDL_EVENT_SYSWM */
|
||||
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
|
||||
SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */
|
||||
} SDL_SysWMEvent;
|
||||
|
||||
/**
|
||||
* General event structure
|
||||
*/
|
||||
@@ -623,10 +602,9 @@ typedef union SDL_Event
|
||||
SDL_SensorEvent sensor; /**< Sensor event data */
|
||||
SDL_QuitEvent quit; /**< Quit request event data */
|
||||
SDL_UserEvent user; /**< Custom event data */
|
||||
SDL_SysWMEvent syswm; /**< System dependent window event data */
|
||||
SDL_TouchFingerEvent tfinger; /**< Touch finger event data */
|
||||
SDL_DropEvent drop; /**< Drag and drop event data */
|
||||
SDL_ClipboardEvent clipboard; /**< Clipboard cancelled event data */
|
||||
SDL_ClipboardEvent clipboard; /**< Clipboard event data */
|
||||
|
||||
/* This is necessary for ABI compatibility between Visual C++ and GCC.
|
||||
Visual C++ will respect the push pack pragma and use 52 bytes (size of
|
||||
|
||||
@@ -417,7 +417,6 @@ extern "C" {
|
||||
* "0" - Don't log any events (default)
|
||||
* "1" - Log most events (other than the really spammy ones).
|
||||
* "2" - Include mouse and finger motion events.
|
||||
* "3" - Include SDL_SysWMEvent events.
|
||||
*
|
||||
* This is generally meant to be used to debug SDL itself, but can be useful
|
||||
* for application developers that need better visibility into what is going
|
||||
|
||||
@@ -124,7 +124,6 @@
|
||||
#define SDL_RENDER_DEVICE_RESET SDL_EVENT_RENDER_DEVICE_RESET
|
||||
#define SDL_RENDER_TARGETS_RESET SDL_EVENT_RENDER_TARGETS_RESET
|
||||
#define SDL_SENSORUPDATE SDL_EVENT_SENSOR_UPDATE
|
||||
#define SDL_SYSWMEVENT SDL_EVENT_SYSWM
|
||||
#define SDL_TEXTEDITING SDL_EVENT_TEXT_EDITING
|
||||
#define SDL_TEXTEDITING_EXT SDL_EVENT_TEXT_EDITING_EXT
|
||||
#define SDL_TEXTINPUT SDL_EVENT_TEXT_INPUT
|
||||
@@ -568,7 +567,6 @@
|
||||
#define SDL_RENDER_DEVICE_RESET SDL_RENDER_DEVICE_RESET_renamed_SDL_EVENT_RENDER_DEVICE_RESET
|
||||
#define SDL_RENDER_TARGETS_RESET SDL_RENDER_TARGETS_RESET_renamed_SDL_EVENT_RENDER_TARGETS_RESET
|
||||
#define SDL_SENSORUPDATE SDL_SENSORUPDATE_renamed_SDL_EVENT_SENSOR_UPDATE
|
||||
#define SDL_SYSWMEVENT SDL_SYSWMEVENT_renamed_SDL_EVENT_SYSWM
|
||||
#define SDL_TEXTEDITING SDL_TEXTEDITING_renamed_SDL_EVENT_TEXT_EDITING
|
||||
#define SDL_TEXTEDITING_EXT SDL_TEXTEDITING_EXT_renamed_SDL_EVENT_TEXT_EDITING_EXT
|
||||
#define SDL_TEXTINPUT SDL_TEXTINPUT_renamed_SDL_EVENT_TEXT_INPUT
|
||||
|
||||
@@ -40,14 +40,18 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Platform specific functions for Windows */
|
||||
/*
|
||||
* Platform specific functions for Windows
|
||||
*/
|
||||
#if defined(__WIN32__) || defined(__GDK__)
|
||||
|
||||
typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
|
||||
|
||||
typedef struct tagMSG MSG;
|
||||
typedef SDL_bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg);
|
||||
/**
|
||||
* Set a callback for every Windows message, run before TranslateMessage().
|
||||
*
|
||||
* The callback may modify the message, and should return SDL_TRUE if the message should continue to be processed, or SDL_FALSE to prevent further processing.
|
||||
*
|
||||
* \param callback The SDL_WindowsMessageHook function to call.
|
||||
* \param userdata a pointer to pass to every iteration of `callback`
|
||||
*
|
||||
@@ -96,7 +100,27 @@ extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo(SDL_DisplayID displayID,
|
||||
|
||||
#endif /* defined(__WIN32__) || defined(__WINGDK__) */
|
||||
|
||||
/* Platform specific functions for Linux */
|
||||
/*
|
||||
* Platform specific functions for UNIX
|
||||
*/
|
||||
|
||||
typedef union _XEvent XEvent;
|
||||
typedef SDL_bool (SDLCALL *SDL_X11EventHook)(void *userdata, XEvent *xevent);
|
||||
/**
|
||||
* Set a callback for every X11 event
|
||||
*
|
||||
* The callback may modify the event, and should return SDL_TRUE if the event should continue to be processed, or SDL_FALSE to prevent further processing.
|
||||
*
|
||||
* \param callback The SDL_X11EventHook function to call.
|
||||
* \param userdata a pointer to pass to every iteration of `callback`
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback, void *userdata);
|
||||
|
||||
/*
|
||||
* Platform specific functions for Linux
|
||||
*/
|
||||
#ifdef __LINUX__
|
||||
|
||||
/**
|
||||
@@ -130,7 +154,9 @@ extern DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID,
|
||||
|
||||
#endif /* __LINUX__ */
|
||||
|
||||
/* Platform specific functions for iOS */
|
||||
/*
|
||||
* Platform specific functions for iOS
|
||||
*/
|
||||
#ifdef __IOS__
|
||||
|
||||
#define SDL_iOSSetAnimationCallback(window, interval, callback, callbackParam) SDL_iPhoneSetAnimationCallback(window, interval, callback, callbackParam)
|
||||
@@ -190,7 +216,9 @@ extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled);
|
||||
#endif /* __IOS__ */
|
||||
|
||||
|
||||
/* Platform specific functions for Android */
|
||||
/*
|
||||
* Platform specific functions for Android
|
||||
*/
|
||||
#ifdef __ANDROID__
|
||||
|
||||
/**
|
||||
@@ -419,7 +447,9 @@ extern DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
|
||||
|
||||
#endif /* __ANDROID__ */
|
||||
|
||||
/* Platform specific functions for WinRT */
|
||||
/*
|
||||
* Platform specific functions for WinRT
|
||||
*/
|
||||
#ifdef __WINRT__
|
||||
|
||||
/**
|
||||
@@ -581,7 +611,9 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
|
||||
extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
|
||||
#endif
|
||||
|
||||
/* Functions used only by GDK */
|
||||
/*
|
||||
* Functions used only by GDK
|
||||
*/
|
||||
#ifdef __GDK__
|
||||
typedef struct XTaskQueueObject *XTaskQueueHandle;
|
||||
typedef struct XUser *XUserHandle;
|
||||
|
||||
@@ -1,387 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file SDL_syswm.h
|
||||
*
|
||||
* Include file for SDL custom system window manager hooks.
|
||||
*/
|
||||
|
||||
#ifndef SDL_syswm_h_
|
||||
#define SDL_syswm_h_
|
||||
|
||||
#include <SDL3/SDL_stdinc.h>
|
||||
#include <SDL3/SDL_error.h>
|
||||
#include <SDL3/SDL_platform_defines.h>
|
||||
#include <SDL3/SDL_video.h>
|
||||
|
||||
/**
|
||||
* SDL_syswm.h
|
||||
*
|
||||
* Your application has access to a special type of event ::SDL_EVENT_SYSWM,
|
||||
* which contains window-manager specific information and arrives whenever
|
||||
* an unhandled window event occurs. This event is ignored by default, but
|
||||
* you can enable it with SDL_SetEventEnabled().
|
||||
*/
|
||||
|
||||
/**
|
||||
* The available subsystems based on platform
|
||||
*/
|
||||
#ifndef SDL_DISABLE_SYSWM_PLATFORMS
|
||||
|
||||
#ifndef SDL_DISABLE_SYSWM_ANDROID
|
||||
#ifdef __ANDROID__
|
||||
#define SDL_ENABLE_SYSWM_ANDROID
|
||||
#endif
|
||||
#endif /* !SDL_DISABLE_SYSWM_ANDROID */
|
||||
|
||||
#ifndef SDL_DISABLE_SYSWM_COCOA
|
||||
#ifdef __MACOS__
|
||||
#define SDL_ENABLE_SYSWM_COCOA
|
||||
#endif
|
||||
#endif /* !SDL_DISABLE_SYSWM_COCOA */
|
||||
|
||||
#ifndef SDL_DISABLE_SYSWM_HAIKU
|
||||
#ifdef __HAIKU__
|
||||
#define SDL_ENABLE_SYSWM_HAIKU
|
||||
#endif
|
||||
#endif /* !SDL_DISABLE_SYSWM_HAIKU */
|
||||
|
||||
#ifndef SDL_DISABLE_SYSWM_KMSDRM
|
||||
#if defined(__LINUX__) || defined(__FREEBSD__) || defined(__OPENBSD__)
|
||||
#define SDL_ENABLE_SYSWM_KMSDRM
|
||||
#endif
|
||||
#endif /* !SDL_DISABLE_SYSWM_KMSDRM */
|
||||
|
||||
#ifndef SDL_DISABLE_SYSWM_RISCOS
|
||||
#ifdef __RISCOS__
|
||||
#define SDL_ENABLE_SYSWM_RISCOS
|
||||
#endif
|
||||
#endif /* !SDL_DISABLE_SYSWM_RISCOS */
|
||||
|
||||
#ifndef SDL_DISABLE_SYSWM_UIKIT
|
||||
#if defined(__IOS__) || defined(__TVOS__)
|
||||
#define SDL_ENABLE_SYSWM_UIKIT
|
||||
#endif
|
||||
#endif /* !SDL_DISABLE_SYSWM_UIKIT */
|
||||
|
||||
#ifndef SDL_DISABLE_SYSWM_VIVANTE
|
||||
/* Not enabled by default */
|
||||
#endif /* !SDL_DISABLE_SYSWM_VIVANTE */
|
||||
|
||||
#ifndef SDL_DISABLE_SYSWM_WAYLAND
|
||||
#if defined(__LINUX__) || defined(__FREEBSD__)
|
||||
#define SDL_ENABLE_SYSWM_WAYLAND
|
||||
#endif
|
||||
#endif /* !SDL_DISABLE_SYSWM_WAYLAND */
|
||||
|
||||
#ifndef SDL_DISABLE_SYSWM_WINDOWS
|
||||
#if defined(__WIN32__) || defined(__GDK__)
|
||||
#define SDL_ENABLE_SYSWM_WINDOWS
|
||||
#endif
|
||||
#endif /* !SDL_DISABLE_SYSWM_WINDOWS */
|
||||
|
||||
#ifndef SDL_DISABLE_SYSWM_WINRT
|
||||
#ifdef __WINRT__
|
||||
#define SDL_ENABLE_SYSWM_WINRT
|
||||
#endif
|
||||
#endif /* !SDL_DISABLE_SYSWM_WINRT */
|
||||
|
||||
#ifndef SDL_DISABLE_SYSWM_X11
|
||||
#if defined(__unix__) && !defined(__WIN32__) && !defined(__ANDROID__) && !defined(__QNX__)
|
||||
#define SDL_ENABLE_SYSWM_X11
|
||||
#endif
|
||||
#endif /* !SDL_DISABLE_SYSWM_X11 */
|
||||
|
||||
#endif /* !SDL_DISABLE_SYSWM_PLATFORMS */
|
||||
|
||||
/**
|
||||
* Forward declaration of types used by subsystems
|
||||
*/
|
||||
#ifndef SDL_DISABLE_SYSWM_TYPES
|
||||
|
||||
#if defined(SDL_ENABLE_SYSWM_ANDROID) && !defined(SDL_DISABLE_SYSWM_ANDROID_TYPES)
|
||||
typedef struct ANativeWindow ANativeWindow;
|
||||
typedef void *EGLSurface;
|
||||
#endif /* SDL_ENABLE_SYSWM_ANDROID */
|
||||
|
||||
#if defined(SDL_ENABLE_SYSWM_COCOA) && !defined(SDL_DISABLE_SYSWM_COCOA_TYPES)
|
||||
#ifdef __OBJC__
|
||||
@class NSWindow;
|
||||
#else
|
||||
typedef struct _NSWindow NSWindow;
|
||||
#endif
|
||||
#endif /* SDL_ENABLE_SYSWM_COCOA */
|
||||
|
||||
#if defined(SDL_ENABLE_SYSWM_KMSDRM) && !defined(SDL_DISABLE_SYSWM_KMSDRM_TYPES)
|
||||
struct gbm_device;
|
||||
#endif /* SDL_ENABLE_SYSWM_KMSDRM */
|
||||
|
||||
#if defined(SDL_ENABLE_SYSWM_UIKIT) && !defined(SDL_DISABLE_SYSWM_UIKIT_TYPES)
|
||||
#ifdef __OBJC__
|
||||
#include <UIKit/UIKit.h>
|
||||
#else
|
||||
typedef struct _UIWindow UIWindow;
|
||||
typedef struct _UIViewController UIViewController;
|
||||
#endif
|
||||
typedef Uint32 GLuint;
|
||||
#endif /* SDL_ENABLE_SYSWM_UIKIT */
|
||||
|
||||
#if defined(SDL_ENABLE_SYSWM_VIVANTE) && !defined(SDL_DISABLE_SYSWM_VIVANTE_TYPES)
|
||||
#include <SDL3/SDL_egl.h>
|
||||
#endif /* SDL_ENABLE_SYSWM_VIVANTE */
|
||||
|
||||
#if defined(SDL_ENABLE_SYSWM_WAYLAND) && !defined(SDL_DISABLE_SYSWM_WAYLAND_TYPES)
|
||||
struct wl_display;
|
||||
struct wl_egl_window;
|
||||
struct wl_surface;
|
||||
struct xdg_popup;
|
||||
struct xdg_positioner;
|
||||
struct xdg_surface;
|
||||
struct xdg_toplevel;
|
||||
#endif /* SDL_ENABLE_SYSWM_WAYLAND */
|
||||
|
||||
#if defined(SDL_ENABLE_SYSWM_WINDOWS) && !defined(SDL_DISABLE_SYSWM_WINDOWS_TYPES)
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#ifndef NOMINMAX /* don't define min() and max(). */
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#endif /* SDL_ENABLE_SYSWM_WINDOWS */
|
||||
|
||||
#if defined(SDL_ENABLE_SYSWM_WINRT) && !defined(SDL_DISABLE_SYSWM_WINRT_TYPES)
|
||||
#include <Inspectable.h>
|
||||
#endif /* SDL_ENABLE_SYSWM_WINRT */
|
||||
|
||||
#if defined(SDL_ENABLE_SYSWM_X11) && !defined(SDL_DISABLE_SYSWM_X11_TYPES)
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
#endif /* SDL_ENABLE_SYSWM_X11 */
|
||||
|
||||
#endif /* !SDL_DISABLE_SYSWM_TYPES */
|
||||
|
||||
|
||||
#include <SDL3/SDL_begin_code.h>
|
||||
/* Set up for C function definitions, even when using C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* This is the current version of structures in this file */
|
||||
#define SDL_SYSWM_CURRENT_VERSION 1
|
||||
#define SDL_SYSWM_INFO_SIZE_V1 (16 * (sizeof (void *) >= 8 ? sizeof (void *) : sizeof(Uint64)))
|
||||
#define SDL_SYSWM_CURRENT_INFO_SIZE SDL_SYSWM_INFO_SIZE_V1
|
||||
|
||||
/* This is the tag associated with a Metal view so you can find it */
|
||||
#define SDL_METALVIEW_TAG 255
|
||||
|
||||
|
||||
/**
|
||||
* These are the various supported windowing subsystems
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_SYSWM_UNKNOWN,
|
||||
SDL_SYSWM_ANDROID,
|
||||
SDL_SYSWM_COCOA,
|
||||
SDL_SYSWM_HAIKU,
|
||||
SDL_SYSWM_KMSDRM,
|
||||
SDL_SYSWM_RISCOS,
|
||||
SDL_SYSWM_UIKIT,
|
||||
SDL_SYSWM_VIVANTE,
|
||||
SDL_SYSWM_WAYLAND,
|
||||
SDL_SYSWM_WINDOWS,
|
||||
SDL_SYSWM_WINRT,
|
||||
SDL_SYSWM_X11
|
||||
} SDL_SYSWM_TYPE;
|
||||
|
||||
/**
|
||||
* The custom event structure.
|
||||
*/
|
||||
struct SDL_SysWMmsg
|
||||
{
|
||||
Uint32 version;
|
||||
Uint32 subsystem; /**< SDL_SYSWM_TYPE */
|
||||
|
||||
Uint32 padding[(2 * (sizeof (void *) >= 8 ? sizeof (void *) : sizeof(Uint64)) - 2 * sizeof(Uint32)) / sizeof(Uint32)];
|
||||
|
||||
union
|
||||
{
|
||||
#ifdef SDL_ENABLE_SYSWM_WINDOWS
|
||||
struct {
|
||||
HWND hwnd; /**< The window for the message */
|
||||
UINT msg; /**< The type of message */
|
||||
WPARAM wParam; /**< WORD message parameter */
|
||||
LPARAM lParam; /**< LONG message parameter */
|
||||
} win;
|
||||
#endif
|
||||
#ifdef SDL_ENABLE_SYSWM_X11
|
||||
struct {
|
||||
XEvent event;
|
||||
} x11;
|
||||
#endif
|
||||
/* Can't have an empty union */
|
||||
int dummy;
|
||||
} msg;
|
||||
};
|
||||
|
||||
/**
|
||||
* The custom window manager information structure.
|
||||
*
|
||||
* When this structure is returned, it holds information about which
|
||||
* low level system it is using, and will be one of SDL_SYSWM_TYPE.
|
||||
*/
|
||||
struct SDL_SysWMinfo
|
||||
{
|
||||
Uint32 version;
|
||||
Uint32 subsystem; /**< SDL_SYSWM_TYPE */
|
||||
|
||||
Uint32 padding[(2 * (sizeof (void *) >= 8 ? sizeof (void *) : sizeof(Uint64)) - 2 * sizeof(Uint32)) / sizeof(Uint32)];
|
||||
|
||||
union
|
||||
{
|
||||
#ifdef SDL_ENABLE_SYSWM_WINDOWS
|
||||
struct
|
||||
{
|
||||
HWND window; /**< The window handle */
|
||||
HDC hdc; /**< The window device context */
|
||||
HINSTANCE hinstance; /**< The instance handle */
|
||||
} win;
|
||||
#endif
|
||||
#ifdef SDL_ENABLE_SYSWM_WINRT
|
||||
struct
|
||||
{
|
||||
IInspectable * window; /**< The WinRT CoreWindow */
|
||||
} winrt;
|
||||
#endif
|
||||
#ifdef SDL_ENABLE_SYSWM_X11
|
||||
struct
|
||||
{
|
||||
Display *display; /**< The X11 display */
|
||||
int screen; /**< The X11 screen */
|
||||
Window window; /**< The X11 window */
|
||||
} x11;
|
||||
#endif
|
||||
#ifdef SDL_ENABLE_SYSWM_COCOA
|
||||
struct
|
||||
{
|
||||
#if defined(__OBJC__) && defined(__has_feature)
|
||||
#if __has_feature(objc_arc)
|
||||
NSWindow __unsafe_unretained *window; /**< The Cocoa window */
|
||||
#else
|
||||
NSWindow *window; /**< The Cocoa window */
|
||||
#endif
|
||||
#else
|
||||
NSWindow *window; /**< The Cocoa window */
|
||||
#endif
|
||||
} cocoa;
|
||||
#endif
|
||||
#ifdef SDL_ENABLE_SYSWM_UIKIT
|
||||
struct
|
||||
{
|
||||
#if defined(__OBJC__) && defined(__has_feature)
|
||||
#if __has_feature(objc_arc)
|
||||
UIWindow __unsafe_unretained *window; /**< The UIKit window */
|
||||
#else
|
||||
UIWindow *window; /**< The UIKit window */
|
||||
#endif
|
||||
#else
|
||||
UIWindow *window; /**< The UIKit window */
|
||||
#endif
|
||||
GLuint framebuffer; /**< The GL view's Framebuffer Object. It must be bound when rendering to the screen using GL. */
|
||||
GLuint colorbuffer; /**< The GL view's color Renderbuffer Object. It must be bound when SDL_GL_SwapWindow is called. */
|
||||
GLuint resolveFramebuffer; /**< The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */
|
||||
} uikit;
|
||||
#endif
|
||||
#ifdef SDL_ENABLE_SYSWM_WAYLAND
|
||||
struct
|
||||
{
|
||||
struct wl_display *display; /**< Wayland display */
|
||||
struct wl_surface *surface; /**< Wayland surface */
|
||||
struct wl_egl_window *egl_window; /**< Wayland EGL window (native window) */
|
||||
struct xdg_surface *xdg_surface; /**< Wayland xdg surface (window manager handle) */
|
||||
struct xdg_toplevel *xdg_toplevel; /**< Wayland xdg toplevel role */
|
||||
struct xdg_popup *xdg_popup; /**< Wayland xdg popup role */
|
||||
struct xdg_positioner *xdg_positioner; /**< Wayland xdg positioner, for popup */
|
||||
} wl;
|
||||
#endif
|
||||
|
||||
#ifdef SDL_ENABLE_SYSWM_ANDROID
|
||||
struct
|
||||
{
|
||||
ANativeWindow *window;
|
||||
EGLSurface surface;
|
||||
} android;
|
||||
#endif
|
||||
|
||||
#ifdef SDL_ENABLE_SYSWM_VIVANTE
|
||||
struct
|
||||
{
|
||||
EGLNativeDisplayType display;
|
||||
EGLNativeWindowType window;
|
||||
} vivante;
|
||||
#endif
|
||||
|
||||
#ifdef SDL_ENABLE_SYSWM_KMSDRM
|
||||
struct
|
||||
{
|
||||
int dev_index; /**< Device index (ex: the X in /dev/dri/cardX) */
|
||||
int drm_fd; /**< DRM FD (unavailable on Vulkan windows) */
|
||||
struct gbm_device *gbm_dev; /**< GBM device (unavailable on Vulkan windows) */
|
||||
} kmsdrm;
|
||||
#endif
|
||||
|
||||
/* Make sure this union has enough room for 14 pointers */
|
||||
void *dummy_ptrs[14];
|
||||
Uint64 dummy_ints[14];
|
||||
} info;
|
||||
};
|
||||
SDL_COMPILE_TIME_ASSERT(SDL_SysWMinfo_size, sizeof(struct SDL_SysWMinfo) == SDL_SYSWM_CURRENT_INFO_SIZE);
|
||||
|
||||
typedef struct SDL_SysWMinfo SDL_SysWMinfo;
|
||||
|
||||
|
||||
/**
|
||||
* Get driver-specific information about a window.
|
||||
*
|
||||
* You must include SDL_syswm.h for the declaration of SDL_SysWMinfo.
|
||||
*
|
||||
* \param window the window about which information is being requested
|
||||
* \param info an SDL_SysWMinfo structure filled in with window information
|
||||
* \param version the version of info being requested, should be
|
||||
* SDL_SYSWM_CURRENT_VERSION
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_GetWindowWMInfo(SDL_Window *window, SDL_SysWMinfo *info, Uint32 version);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include <SDL3/SDL_close_code.h>
|
||||
|
||||
#endif /* SDL_syswm_h_ */
|
||||
@@ -934,6 +934,55 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_GetWindowParent(SDL_Window *window);
|
||||
/**
|
||||
* Get the properties associated with a window.
|
||||
*
|
||||
* The following properties are provided by SDL:
|
||||
*
|
||||
* On Android:
|
||||
* "SDL.window.android.window" - the ANativeWindow associated with the window
|
||||
* "SDL.window.android.surface" - the EGLSurface associated with the window
|
||||
*
|
||||
* On iOS:
|
||||
* "SDL.window.uikit.window" - the (__unsafe_unretained) UIWindow associated with the window
|
||||
* "SDL.window.uikit.metal_view_tag" - the NSInteger tag assocated with metal views on the window
|
||||
*
|
||||
* On KMS/DRM:
|
||||
* "SDL.window.kmsdrm.dev_index" - the device index associated with the window (e.g. the X in /dev/dri/cardX)
|
||||
* "SDL.window.kmsdrm.drm_fd" - the DRM FD associated with the window
|
||||
* "SDL.window.kmsdrm.gbm_dev" - the GBM device associated with the window
|
||||
*
|
||||
* On macOS:
|
||||
* "SDL.window.cocoa.window" - the (__unsafe_unretained) NSWindow associated with the window
|
||||
* "SDL.window.cocoa.metal_view_tag" - the NSInteger tag assocated with metal views on the window
|
||||
*
|
||||
* On Vivante:
|
||||
* "SDL.window.vivante.display" - the EGLNativeDisplayType associated with the window
|
||||
* "SDL.window.vivante.window" - the EGLNativeWindowType associated with the window
|
||||
* "SDL.window.vivante.surface" - the EGLSurface associated with the window
|
||||
*
|
||||
* On UWP:
|
||||
* "SDL.window.winrt.window" - the IInspectable CoreWindow associated with the window
|
||||
*
|
||||
* On Windows:
|
||||
* "SDL.window.win32.hwnd" - the HWND associated with the window
|
||||
* "SDL.window.win32.hdc" - the HDC associated with the window
|
||||
* "SDL.window.win32.instance" - the HINSTANCE associated with the window
|
||||
*
|
||||
* On Wayland:
|
||||
* "SDL.window.wayland.display" - the wl_display associated with the window
|
||||
* "SDL.window.wayland.surface" - the wl_surface associated with the window
|
||||
* "SDL.window.wayland.egl_window" - the wl_egl_window associated with the window
|
||||
* "SDL.window.wayland.xdg_surface" - the xdg_surface associated with the window
|
||||
* "SDL.window.wayland.xdg_toplevel" - the xdg_toplevel role associated with the window
|
||||
* "SDL.window.wayland.xdg_popup" - the xdg_popup role associated with the window
|
||||
* "SDL.window.wayland.xdg_positioner" - the xdg_positioner associated with the window, in popup mode
|
||||
*
|
||||
* Note: The xdg_* window objects do not internally persist across window show/hide calls.
|
||||
* They will be null if the window is hidden and must be queried each time it is shown.
|
||||
*
|
||||
* On X11:
|
||||
* "SDL.window.x11.display" - the X11 Display associated with the window
|
||||
* "SDL.window.x11.screen" - the screen number associated with the window
|
||||
* "SDL.window.x11.window" - the X11 Window associated with the window
|
||||
*
|
||||
* \param window the window to query
|
||||
* \returns a valid property ID on success or 0 on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
|
||||
@@ -415,62 +415,6 @@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_X11_XSHAPE @SDL_VIDEO_DRIVER_X11_XSHAPE@
|
||||
#cmakedefine SDL_VIDEO_DRIVER_QNX @SDL_VIDEO_DRIVER_QNX@
|
||||
|
||||
#ifdef SDL_VIDEO_DRIVER_ANDROID
|
||||
#define SDL_ENABLE_SYSWM_ANDROID
|
||||
#else
|
||||
#define SDL_DISABLE_SYSWM_ANDROID
|
||||
#endif
|
||||
#ifdef SDL_VIDEO_DRIVER_COCOA
|
||||
#define SDL_ENABLE_SYSWM_COCOA
|
||||
#else
|
||||
#define SDL_DISABLE_SYSWM_COCOA
|
||||
#endif
|
||||
#ifdef SDL_VIDEO_DRIVER_HAIKU
|
||||
#define SDL_ENABLE_SYSWM_HAIKU
|
||||
#else
|
||||
#define SDL_DISABLE_SYSWM_HAIKU
|
||||
#endif
|
||||
#ifdef SDL_VIDEO_DRIVER_KMSDRM
|
||||
#define SDL_ENABLE_SYSWM_KMSDRM
|
||||
#else
|
||||
#define SDL_DISABLE_SYSWM_KMSDRM
|
||||
#endif
|
||||
#ifdef SDL_VIDEO_DRIVER_RISCOS
|
||||
#define SDL_ENABLE_SYSWM_RISCOS
|
||||
#else
|
||||
#define SDL_DISABLE_SYSWM_RISCOS
|
||||
#endif
|
||||
#ifdef SDL_VIDEO_DRIVER_UIKIT
|
||||
#define SDL_ENABLE_SYSWM_UIKIT
|
||||
#else
|
||||
#define SDL_DISABLE_SYSWM_UIKIT
|
||||
#endif
|
||||
#ifdef SDL_VIDEO_DRIVER_VIVANTE
|
||||
#define SDL_ENABLE_SYSWM_VIVANTE
|
||||
#else
|
||||
#define SDL_DISABLE_SYSWM_VIVANTE
|
||||
#endif
|
||||
#ifdef SDL_VIDEO_DRIVER_WAYLAND
|
||||
#define SDL_ENABLE_SYSWM_WAYLAND
|
||||
#else
|
||||
#define SDL_DISABLE_SYSWM_WAYLAND
|
||||
#endif
|
||||
#ifdef SDL_VIDEO_DRIVER_WINDOWS
|
||||
#define SDL_ENABLE_SYSWM_WINDOWS
|
||||
#else
|
||||
#define SDL_DISABLE_SYSWM_WINDOWS
|
||||
#endif
|
||||
#ifdef SDL_VIDEO_DRIVER_WINRT
|
||||
#define SDL_ENABLE_SYSWM_WINRT
|
||||
#else
|
||||
#define SDL_DISABLE_SYSWM_WINRT
|
||||
#endif
|
||||
#ifdef SDL_VIDEO_DRIVER_X11
|
||||
#define SDL_ENABLE_SYSWM_X11
|
||||
#else
|
||||
#define SDL_DISABLE_SYSWM_X11
|
||||
#endif
|
||||
|
||||
#cmakedefine SDL_VIDEO_RENDER_D3D @SDL_VIDEO_RENDER_D3D@
|
||||
#cmakedefine SDL_VIDEO_RENDER_D3D11 @SDL_VIDEO_RENDER_D3D11@
|
||||
#cmakedefine SDL_VIDEO_RENDER_D3D12 @SDL_VIDEO_RENDER_D3D12@
|
||||
|
||||
Reference in New Issue
Block a user