mirror of
https://github.com/love2d/megasource.git
synced 2026-08-17 11:11:35 +02:00
Added SDL 1c0f6952e65e.
This commit is contained in:
@@ -108,7 +108,8 @@ typedef enum
|
||||
SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */
|
||||
SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ),
|
||||
SDL_WINDOW_FOREIGN = 0x00000800, /**< window not created by SDL */
|
||||
SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000 /**< window should be created in high-DPI mode if supported */
|
||||
SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000, /**< window should be created in high-DPI mode if supported */
|
||||
SDL_WINDOW_MOUSE_CAPTURE = 0x00004000 /**< window has mouse captured (unrelated to INPUT_GRABBED) */
|
||||
} SDL_WindowFlags;
|
||||
|
||||
/**
|
||||
@@ -790,6 +791,75 @@ extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window,
|
||||
Uint16 * green,
|
||||
Uint16 * blue);
|
||||
|
||||
/**
|
||||
* \brief Possible return values from the SDL_HitTest callback.
|
||||
*
|
||||
* \sa SDL_HitTest
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_HITTEST_NORMAL, /**< Region is normal. No special properties. */
|
||||
SDL_HITTEST_DRAGGABLE, /**< Region can drag entire window. */
|
||||
SDL_HITTEST_RESIZE_TOPLEFT,
|
||||
SDL_HITTEST_RESIZE_TOP,
|
||||
SDL_HITTEST_RESIZE_TOPRIGHT,
|
||||
SDL_HITTEST_RESIZE_RIGHT,
|
||||
SDL_HITTEST_RESIZE_BOTTOMRIGHT,
|
||||
SDL_HITTEST_RESIZE_BOTTOM,
|
||||
SDL_HITTEST_RESIZE_BOTTOMLEFT,
|
||||
SDL_HITTEST_RESIZE_LEFT
|
||||
} SDL_HitTestResult;
|
||||
|
||||
/**
|
||||
* \brief Callback used for hit-testing.
|
||||
*
|
||||
* \sa SDL_SetWindowHitTest
|
||||
*/
|
||||
typedef SDL_HitTestResult (SDLCALL *SDL_HitTest)(SDL_Window *win,
|
||||
const SDL_Point *area,
|
||||
void *data);
|
||||
|
||||
/**
|
||||
* \brief Provide a callback that decides if a window region has special properties.
|
||||
*
|
||||
* Normally windows are dragged and resized by decorations provided by the
|
||||
* system window manager (a title bar, borders, etc), but for some apps, it
|
||||
* makes sense to drag them from somewhere else inside the window itself; for
|
||||
* example, one might have a borderless window that wants to be draggable
|
||||
* from any part, or simulate its own title bar, etc.
|
||||
*
|
||||
* This function lets the app provide a callback that designates pieces of
|
||||
* a given window as special. This callback is run during event processing
|
||||
* if we need to tell the OS to treat a region of the window specially; the
|
||||
* use of this callback is known as "hit testing."
|
||||
*
|
||||
* Mouse input may not be delivered to your application if it is within
|
||||
* a special area; the OS will often apply that input to moving the window or
|
||||
* resizing the window and not deliver it to the application.
|
||||
*
|
||||
* Specifying NULL for a callback disables hit-testing. Hit-testing is
|
||||
* disabled by default.
|
||||
*
|
||||
* Platforms that don't support this functionality will return -1
|
||||
* unconditionally, even if you're attempting to disable hit-testing.
|
||||
*
|
||||
* Your callback may fire at any time, and its firing does not indicate any
|
||||
* specific behavior (for example, on Windows, this certainly might fire
|
||||
* when the OS is deciding whether to drag your window, but it fires for lots
|
||||
* of other reasons, too, some unrelated to anything you probably care about
|
||||
* _and when the mouse isn't actually at the location it is testing_).
|
||||
* Since this can fire at any time, you should try to keep your callback
|
||||
* efficient, devoid of allocations, etc.
|
||||
*
|
||||
* \param window The window to set hit-testing on.
|
||||
* \param callback The callback to call when doing a hit-test.
|
||||
* \param callback_data An app-defined void pointer passed to the callback.
|
||||
* \return 0 on success, -1 on error (including unsupported).
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetWindowHitTest(SDL_Window * window,
|
||||
SDL_HitTest callback,
|
||||
void *callback_data);
|
||||
|
||||
/**
|
||||
* \brief Destroy a window.
|
||||
*/
|
||||
@@ -914,7 +984,7 @@ extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void);
|
||||
* \param w Pointer to variable for storing the width, may be NULL
|
||||
* \param h Pointer to variable for storing the height, may be NULL
|
||||
*
|
||||
* This may differ from SDL_GetWindowSize if we're rendering to a high-DPI
|
||||
* This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
|
||||
* drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
|
||||
* platform with high-DPI support (Apple calls this "Retina"), and not disabled
|
||||
* by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
|
||||
|
||||
Reference in New Issue
Block a user