Change return type from void to int, for functions that set an error

(SDL_SetError(), SDL_OutOfMemory(), SDL_Unsupported(), SDL_InvalidParam())

Update prototype to forward errors to generic layer, for the functions:
MoveCursor, WarpMouse, GL_DeleteContext, GetDisplayModes.

Check invalid parameter in SDL_SetTextInputRect() generic layer.
This commit is contained in:
Sylvain
2023-02-06 20:24:12 +01:00
committed by Sam Lantinga
parent 6c37d5b57f
commit c5c94a6be6
100 changed files with 472 additions and 389 deletions
+3 -1
View File
@@ -851,10 +851,12 @@ extern DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream);
* \param len the length of the audio buffer in bytes * \param len the length of the audio buffer in bytes
* \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME * \param volume ranges from 0 - 128, and should be set to SDL_MIX_MAXVOLUME
* for full audio volume * for full audio volume
* \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. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, extern DECLSPEC int SDLCALL SDL_MixAudioFormat(Uint8 * dst,
const Uint8 * src, const Uint8 * src,
SDL_AudioFormat format, SDL_AudioFormat format,
Uint32 len, int volume); Uint32 len, int volume);
+3 -1
View File
@@ -377,10 +377,12 @@ extern DECLSPEC int SDLCALL SDL_hid_get_feature_report(SDL_hid_device *dev, unsi
* Close a HID device. * Close a HID device.
* *
* \param dev A device handle returned from SDL_hid_open(). * \param dev A device handle returned from SDL_hid_open().
* \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. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC void SDLCALL SDL_hid_close(SDL_hid_device *dev); extern DECLSPEC int SDLCALL SDL_hid_close(SDL_hid_device *dev);
/** /**
* Get The Manufacturer String from a HID device. * Get The Manufacturer String from a HID device.
+6 -2
View File
@@ -493,10 +493,12 @@ extern DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndex(SDL_Joystick *joystick);
* \param joystick the SDL_Joystick obtained from SDL_OpenJoystick() * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick()
* \param player_index Player index to assign to this joystick, or -1 to clear * \param player_index Player index to assign to this joystick, or -1 to clear
* the player index and turn off player LEDs. * the player index and turn off player LEDs.
* \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. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC void SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index); extern DECLSPEC int SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index);
/** /**
* Get the implementation-dependent GUID for the joystick. * Get the implementation-dependent GUID for the joystick.
@@ -966,12 +968,14 @@ extern DECLSPEC int SDLCALL SDL_SendJoystickEffect(SDL_Joystick *joystick, const
* Close a joystick previously opened with SDL_OpenJoystick(). * Close a joystick previously opened with SDL_OpenJoystick().
* *
* \param joystick The joystick device to close * \param joystick The joystick device to close
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_OpenJoystick * \sa SDL_OpenJoystick
*/ */
extern DECLSPEC void SDLCALL SDL_CloseJoystick(SDL_Joystick *joystick); extern DECLSPEC int SDLCALL SDL_CloseJoystick(SDL_Joystick *joystick);
/** /**
* Get the battery level of a joystick as SDL_JoystickPowerLevel. * Get the battery level of a joystick as SDL_JoystickPowerLevel.
+3 -1
View File
@@ -310,12 +310,14 @@ extern DECLSPEC SDL_bool SDLCALL SDL_TextInputShown(void);
* *
* \param rect the SDL_Rect structure representing the rectangle to receive * \param rect the SDL_Rect structure representing the rectangle to receive
* text (ignored if NULL) * text (ignored if NULL)
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_StartTextInput * \sa SDL_StartTextInput
*/ */
extern DECLSPEC void SDLCALL SDL_SetTextInputRect(const SDL_Rect *rect); extern DECLSPEC int SDLCALL SDL_SetTextInputRect(const SDL_Rect *rect);
/** /**
* Check whether the platform has screen keyboard support. * Check whether the platform has screen keyboard support.
+3 -1
View File
@@ -364,13 +364,15 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id);
* this is desired for any reason. * this is desired for any reason.
* *
* \param cursor a cursor to make active * \param cursor a cursor to make active
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_CreateCursor * \sa SDL_CreateCursor
* \sa SDL_GetCursor * \sa SDL_GetCursor
*/ */
extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); extern DECLSPEC int SDLCALL SDL_SetCursor(SDL_Cursor * cursor);
/** /**
* Get the active cursor. * Get the active cursor.
+6 -2
View File
@@ -416,12 +416,14 @@ extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_CreatePixelFormat(Uint32 pixel_for
* Free an SDL_PixelFormat structure allocated by SDL_CreatePixelFormat(). * Free an SDL_PixelFormat structure allocated by SDL_CreatePixelFormat().
* *
* \param format the SDL_PixelFormat structure to free * \param format the SDL_PixelFormat structure to free
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_CreatePixelFormat * \sa SDL_CreatePixelFormat
*/ */
extern DECLSPEC void SDLCALL SDL_DestroyPixelFormat(SDL_PixelFormat *format); extern DECLSPEC int SDLCALL SDL_DestroyPixelFormat(SDL_PixelFormat *format);
/** /**
* Create a palette structure with the specified number of color entries. * Create a palette structure with the specified number of color entries.
@@ -478,12 +480,14 @@ extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
* Free a palette created with SDL_CreatePalette(). * Free a palette created with SDL_CreatePalette().
* *
* \param palette the SDL_Palette structure to be freed * \param palette the SDL_Palette structure to be freed
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_CreatePalette * \sa SDL_CreatePalette
*/ */
extern DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette * palette); extern DECLSPEC int SDLCALL SDL_DestroyPalette(SDL_Palette * palette);
/** /**
* Map an RGB triple to an opaque pixel value for a given pixel format. * Map an RGB triple to an opaque pixel value for a given pixel format.
+6 -2
View File
@@ -172,10 +172,12 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersection(const SDL_Rect * A,
* \param B an SDL_Rect structure representing the second rectangle * \param B an SDL_Rect structure representing the second rectangle
* \param result an SDL_Rect structure filled in with the union of rectangles * \param result an SDL_Rect structure filled in with the union of rectangles
* `A` and `B` * `A` and `B`
* \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. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC void SDLCALL SDL_GetRectUnion(const SDL_Rect * A, extern DECLSPEC int SDLCALL SDL_GetRectUnion(const SDL_Rect * A,
const SDL_Rect * B, const SDL_Rect * B,
SDL_Rect * result); SDL_Rect * result);
@@ -311,10 +313,12 @@ extern DECLSPEC SDL_bool SDLCALL SDL_GetRectIntersectionFloat(const SDL_FRect *
* \param B an SDL_FRect structure representing the second rectangle * \param B an SDL_FRect structure representing the second rectangle
* \param result an SDL_FRect structure filled in with the union of rectangles * \param result an SDL_FRect structure filled in with the union of rectangles
* `A` and `B` * `A` and `B`
* \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. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC void SDLCALL SDL_GetRectUnionFloat(const SDL_FRect * A, extern DECLSPEC int SDLCALL SDL_GetRectUnionFloat(const SDL_FRect * A,
const SDL_FRect * B, const SDL_FRect * B,
SDL_FRect * result); SDL_FRect * result);
+13 -4
View File
@@ -783,11 +783,14 @@ extern DECLSPEC int SDLCALL SDL_LockTextureToSurface(SDL_Texture *texture,
* *
* \param texture a texture locked by SDL_LockTexture() * \param texture a texture locked by SDL_LockTexture()
* *
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_LockTexture * \sa SDL_LockTexture
*/ */
extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture *texture); extern DECLSPEC int SDLCALL SDL_UnlockTexture(SDL_Texture *texture);
/** /**
* Set a texture as the current rendering target. * Set a texture as the current rendering target.
@@ -1408,6 +1411,8 @@ extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer *renderer,
* pixel. * pixel.
* *
* \param renderer the rendering context * \param renderer the rendering context
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
* *
* \threadsafety You may only call this function on the main thread. * \threadsafety You may only call this function on the main thread.
* *
@@ -1425,7 +1430,7 @@ extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer *renderer,
* \sa SDL_SetRenderDrawBlendMode * \sa SDL_SetRenderDrawBlendMode
* \sa SDL_SetRenderDrawColor * \sa SDL_SetRenderDrawColor
*/ */
extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); extern DECLSPEC int SDLCALL SDL_RenderPresent(SDL_Renderer *renderer);
/** /**
* Destroy the specified texture. * Destroy the specified texture.
@@ -1434,13 +1439,15 @@ extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer *renderer);
* to "Invalid texture". * to "Invalid texture".
* *
* \param texture the texture to destroy * \param texture the texture to destroy
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_CreateTexture * \sa SDL_CreateTexture
* \sa SDL_CreateTextureFromSurface * \sa SDL_CreateTextureFromSurface
*/ */
extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture *texture); extern DECLSPEC int SDLCALL SDL_DestroyTexture(SDL_Texture *texture);
/** /**
* Destroy the rendering context for a window and free associated textures. * Destroy the rendering context for a window and free associated textures.
@@ -1449,12 +1456,14 @@ extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture *texture);
* the SDL error message to "Invalid renderer". See SDL_GetError(). * the SDL error message to "Invalid renderer". See SDL_GetError().
* *
* \param renderer the rendering context * \param renderer the rendering context
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_CreateRenderer * \sa SDL_CreateRenderer
*/ */
extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer *renderer); extern DECLSPEC int SDLCALL SDL_DestroyRenderer(SDL_Renderer *renderer);
/** /**
* Force the rendering context to flush any pending commands to the underlying * Force the rendering context to flush any pending commands to the underlying
+60 -20
View File
@@ -821,12 +821,14 @@ extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window *window, const char *
* `SDL_WINDOWPOS_UNDEFINED` * `SDL_WINDOWPOS_UNDEFINED`
* \param y the y coordinate of the window, or `SDL_WINDOWPOS_CENTERED` or * \param y the y coordinate of the window, or `SDL_WINDOWPOS_CENTERED` or
* `SDL_WINDOWPOS_UNDEFINED` * `SDL_WINDOWPOS_UNDEFINED`
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_GetWindowPosition * \sa SDL_GetWindowPosition
*/ */
extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window *window, int x, int y); extern DECLSPEC int SDLCALL SDL_SetWindowPosition(SDL_Window *window, int x, int y);
/** /**
* Get the position of a window, in screen coordinates. * Get the position of a window, in screen coordinates.
@@ -837,12 +839,14 @@ extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window *window, int x, in
* \param window the window to query * \param window the window to query
* \param x a pointer filled in with the x position of the window, may be NULL * \param x a pointer filled in with the x position of the window, may be NULL
* \param y a pointer filled in with the y position of the window, may be NULL * \param y a pointer filled in with the y position of the window, may be NULL
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_SetWindowPosition * \sa SDL_SetWindowPosition
*/ */
extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window *window, int *x, int *y); extern DECLSPEC int SDLCALL SDL_GetWindowPosition(SDL_Window *window, int *x, int *y);
/** /**
* Set the size of a window's client area, in screen coordinates. * Set the size of a window's client area, in screen coordinates.
@@ -880,6 +884,8 @@ extern DECLSPEC int SDLCALL SDL_SetWindowSize(SDL_Window *window, int w, int h);
* \param window the window to query the width and height from * \param window the window to query the width and height from
* \param w a pointer filled in with the width of the window, may be NULL * \param w a pointer filled in with the width of the window, may be NULL
* \param h a pointer filled in with the height of the window, may be NULL * \param h a pointer filled in with the height of the window, may be NULL
* \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. * \since This function is available since SDL 3.0.0.
* *
@@ -887,7 +893,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowSize(SDL_Window *window, int w, int h);
* \sa SDL_GetWindowSizeInPixels * \sa SDL_GetWindowSizeInPixels
* \sa SDL_SetWindowSize * \sa SDL_SetWindowSize
*/ */
extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window *window, int *w, int *h); extern DECLSPEC int SDLCALL SDL_GetWindowSize(SDL_Window *window, int *w, int *h);
/** /**
* Get the size of a window's borders (decorations) around the client area, in * Get the size of a window's borders (decorations) around the client area, in
@@ -934,13 +940,15 @@ extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window *window, int *to
* \param w a pointer to variable for storing the width in pixels, may be NULL * \param w a pointer to variable for storing the width in pixels, may be NULL
* \param h a pointer to variable for storing the height in pixels, may be * \param h a pointer to variable for storing the height in pixels, may be
* NULL * NULL
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_CreateWindow * \sa SDL_CreateWindow
* \sa SDL_GetWindowSize * \sa SDL_GetWindowSize
*/ */
extern DECLSPEC void SDLCALL SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h); extern DECLSPEC int SDLCALL SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h);
/** /**
* Set the minimum size of a window's client area, in screen coordinates. * Set the minimum size of a window's client area, in screen coordinates.
@@ -966,13 +974,15 @@ extern DECLSPEC int SDLCALL SDL_SetWindowMinimumSize(SDL_Window *window, int min
* NULL * NULL
* \param h a pointer filled in with the minimum height of the window, may be * \param h a pointer filled in with the minimum height of the window, may be
* NULL * NULL
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_GetWindowMaximumSize * \sa SDL_GetWindowMaximumSize
* \sa SDL_SetWindowMinimumSize * \sa SDL_SetWindowMinimumSize
*/ */
extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window *window, int *w, int *h); extern DECLSPEC int SDLCALL SDL_GetWindowMinimumSize(SDL_Window *window, int *w, int *h);
/** /**
* Set the maximum size of a window's client area, in screen coordinates. * Set the maximum size of a window's client area, in screen coordinates.
@@ -998,13 +1008,15 @@ extern DECLSPEC int SDLCALL SDL_SetWindowMaximumSize(SDL_Window *window, int max
* NULL * NULL
* \param h a pointer filled in with the maximum height of the window, may be * \param h a pointer filled in with the maximum height of the window, may be
* NULL * NULL
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_GetWindowMinimumSize * \sa SDL_GetWindowMinimumSize
* \sa SDL_SetWindowMaximumSize * \sa SDL_SetWindowMaximumSize
*/ */
extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window *window, int *w, int *h); extern DECLSPEC int SDLCALL SDL_GetWindowMaximumSize(SDL_Window *window, int *w, int *h);
/** /**
* Set the border state of a window. * Set the border state of a window.
@@ -1017,12 +1029,14 @@ extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window *window, int *w
* *
* \param window the window of which to change the border state * \param window the window of which to change the border state
* \param bordered SDL_FALSE to remove border, SDL_TRUE to add border * \param bordered SDL_FALSE to remove border, SDL_TRUE to add border
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_GetWindowFlags * \sa SDL_GetWindowFlags
*/ */
extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered); extern DECLSPEC int SDLCALL SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered);
/** /**
* Set the user-resizable state of a window. * Set the user-resizable state of a window.
@@ -1035,12 +1049,14 @@ extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window *window, SDL_bool
* *
* \param window the window of which to change the resizable state * \param window the window of which to change the resizable state
* \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow * \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_GetWindowFlags * \sa SDL_GetWindowFlags
*/ */
extern DECLSPEC void SDLCALL SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable); extern DECLSPEC int SDLCALL SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable);
/** /**
* Set the window to always be above the others. * Set the window to always be above the others.
@@ -1051,80 +1067,94 @@ extern DECLSPEC void SDLCALL SDL_SetWindowResizable(SDL_Window *window, SDL_bool
* \param window The window of which to change the always on top state * \param window The window of which to change the always on top state
* \param on_top SDL_TRUE to set the window always on top, SDL_FALSE to * \param on_top SDL_TRUE to set the window always on top, SDL_FALSE to
* disable * disable
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_GetWindowFlags * \sa SDL_GetWindowFlags
*/ */
extern DECLSPEC void SDLCALL SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL_bool on_top); extern DECLSPEC int SDLCALL SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL_bool on_top);
/** /**
* Show a window. * Show a window.
* *
* \param window the window to show * \param window the window to show
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_HideWindow * \sa SDL_HideWindow
* \sa SDL_RaiseWindow * \sa SDL_RaiseWindow
*/ */
extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window *window); extern DECLSPEC int SDLCALL SDL_ShowWindow(SDL_Window *window);
/** /**
* Hide a window. * Hide a window.
* *
* \param window the window to hide * \param window the window to hide
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_ShowWindow * \sa SDL_ShowWindow
*/ */
extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window *window); extern DECLSPEC int SDLCALL SDL_HideWindow(SDL_Window *window);
/** /**
* Raise a window above other windows and set the input focus. * Raise a window above other windows and set the input focus.
* *
* \param window the window to raise * \param window the window to raise
* \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. * \since This function is available since SDL 3.0.0.
*/ */
extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window *window); extern DECLSPEC int SDLCALL SDL_RaiseWindow(SDL_Window *window);
/** /**
* Make a window as large as possible. * Make a window as large as possible.
* *
* \param window the window to maximize * \param window the window to maximize
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_MinimizeWindow * \sa SDL_MinimizeWindow
* \sa SDL_RestoreWindow * \sa SDL_RestoreWindow
*/ */
extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window *window); extern DECLSPEC int SDLCALL SDL_MaximizeWindow(SDL_Window *window);
/** /**
* Minimize a window to an iconic representation. * Minimize a window to an iconic representation.
* *
* \param window the window to minimize * \param window the window to minimize
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_MaximizeWindow * \sa SDL_MaximizeWindow
* \sa SDL_RestoreWindow * \sa SDL_RestoreWindow
*/ */
extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window *window); extern DECLSPEC int SDLCALL SDL_MinimizeWindow(SDL_Window *window);
/** /**
* Restore the size and position of a minimized or maximized window. * Restore the size and position of a minimized or maximized window.
* *
* \param window the window to restore * \param window the window to restore
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_MaximizeWindow * \sa SDL_MaximizeWindow
* \sa SDL_MinimizeWindow * \sa SDL_MinimizeWindow
*/ */
extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window *window); extern DECLSPEC int SDLCALL SDL_RestoreWindow(SDL_Window *window);
/** /**
* Set a window's fullscreen state. * Set a window's fullscreen state.
@@ -1222,13 +1252,15 @@ extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window *window, con
* *
* \param window the window for which the input grab mode should be set * \param window the window for which the input grab mode should be set
* \param grabbed SDL_TRUE to grab input or SDL_FALSE to release input * \param grabbed SDL_TRUE to grab input or SDL_FALSE to release input
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_GetGrabbedWindow * \sa SDL_GetGrabbedWindow
* \sa SDL_GetWindowGrab * \sa SDL_GetWindowGrab
*/ */
extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window *window, SDL_bool grabbed); extern DECLSPEC int SDLCALL SDL_SetWindowGrab(SDL_Window *window, SDL_bool grabbed);
/** /**
* Set a window's keyboard grab mode. * Set a window's keyboard grab mode.
@@ -1251,6 +1283,8 @@ extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window *window, SDL_bool grab
* *
* \param window The window for which the keyboard grab mode should be set. * \param window The window for which the keyboard grab mode should be set.
* \param grabbed This is SDL_TRUE to grab keyboard, and SDL_FALSE to release. * \param grabbed This is SDL_TRUE to grab keyboard, and SDL_FALSE to release.
* \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. * \since This function is available since SDL 3.0.0.
* *
@@ -1258,7 +1292,7 @@ extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window *window, SDL_bool grab
* \sa SDL_SetWindowMouseGrab * \sa SDL_SetWindowMouseGrab
* \sa SDL_SetWindowGrab * \sa SDL_SetWindowGrab
*/ */
extern DECLSPEC void SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bool grabbed); extern DECLSPEC int SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bool grabbed);
/** /**
* Set a window's mouse grab mode. * Set a window's mouse grab mode.
@@ -1267,6 +1301,8 @@ extern DECLSPEC void SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_b
* *
* \param window The window for which the mouse grab mode should be set. * \param window The window for which the mouse grab mode should be set.
* \param grabbed This is SDL_TRUE to grab mouse, and SDL_FALSE to release. * \param grabbed This is SDL_TRUE to grab mouse, and SDL_FALSE to release.
* \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. * \since This function is available since SDL 3.0.0.
* *
@@ -1274,7 +1310,7 @@ extern DECLSPEC void SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_b
* \sa SDL_SetWindowKeyboardGrab * \sa SDL_SetWindowKeyboardGrab
* \sa SDL_SetWindowGrab * \sa SDL_SetWindowGrab
*/ */
extern DECLSPEC void SDLCALL SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed); extern DECLSPEC int SDLCALL SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed);
/** /**
* Get a window's input grab mode. * Get a window's input grab mode.
@@ -1521,13 +1557,15 @@ extern DECLSPEC int SDLCALL SDL_FlashWindow(SDL_Window *window, SDL_FlashOperati
* the SDL error message to "Invalid window". See SDL_GetError(). * the SDL error message to "Invalid window". See SDL_GetError().
* *
* \param window the window to destroy * \param window the window to destroy
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_CreateWindow * \sa SDL_CreateWindow
* \sa SDL_CreateWindowFrom * \sa SDL_CreateWindowFrom
*/ */
extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window *window); extern DECLSPEC int SDLCALL SDL_DestroyWindow(SDL_Window *window);
/** /**
@@ -1933,12 +1971,14 @@ extern DECLSPEC int SDLCALL SDL_GL_SwapWindow(SDL_Window *window);
* Delete an OpenGL context. * Delete an OpenGL context.
* *
* \param context the OpenGL context to be deleted * \param context the OpenGL context to be deleted
* \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. * \since This function is available since SDL 3.0.0.
* *
* \sa SDL_GL_CreateContext * \sa SDL_GL_CreateContext
*/ */
extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); extern DECLSPEC int SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
/* @} *//* OpenGL support functions */ /* @} *//* OpenGL support functions */
+3 -3
View File
@@ -564,7 +564,7 @@ static void SDL_ResampleCVT_SRC(SDL_AudioCVT *cvt, const int chans, const SDL_Au
#endif /* HAVE_LIBSAMPLERATE_H */ #endif /* HAVE_LIBSAMPLERATE_H */
static void SDL_ResampleCVT(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat format) static int SDL_ResampleCVT(SDL_AudioCVT *cvt, const int chans, const SDL_AudioFormat format)
{ {
/* !!! FIXME in 2.1: there are ten slots in the filter list, and the theoretical maximum we use is six (seven with NULL terminator). /* !!! FIXME in 2.1: there are ten slots in the filter list, and the theoretical maximum we use is six (seven with NULL terminator).
!!! FIXME in 2.1: We need to store data for this resampler, because the cvt structure doesn't store the original sample rates, !!! FIXME in 2.1: We need to store data for this resampler, because the cvt structure doesn't store the original sample rates,
@@ -592,8 +592,7 @@ static void SDL_ResampleCVT(SDL_AudioCVT *cvt, const int chans, const SDL_AudioF
/* we keep no streaming state here, so pad with silence on both ends. */ /* we keep no streaming state here, so pad with silence on both ends. */
padding = (float *)SDL_calloc(paddingsamples ? paddingsamples : 1, sizeof(float)); padding = (float *)SDL_calloc(paddingsamples ? paddingsamples : 1, sizeof(float));
if (padding == NULL) { if (padding == NULL) {
SDL_OutOfMemory(); return SDL_OutOfMemory();
return;
} }
cvt->len_cvt = SDL_ResampleAudio(chans, inrate, outrate, padding, padding, src, srclen, dst, dstlen); cvt->len_cvt = SDL_ResampleAudio(chans, inrate, outrate, padding, padding, src, srclen, dst, dstlen);
@@ -605,6 +604,7 @@ static void SDL_ResampleCVT(SDL_AudioCVT *cvt, const int chans, const SDL_AudioF
if (cvt->filters[++cvt->filter_index]) { if (cvt->filters[++cvt->filter_index]) {
cvt->filters[cvt->filter_index](cvt, format); cvt->filters[cvt->filter_index](cvt, format);
} }
return 0;
} }
/* !!! FIXME: We only have this macro salsa because SDL_AudioCVT doesn't /* !!! FIXME: We only have this macro salsa because SDL_AudioCVT doesn't
+5 -4
View File
@@ -82,11 +82,11 @@ static const Uint8 mix8[] = {
#define ADJUST_VOLUME_U8(s, v) ((s) = ((((s) - 128) * (v)) / SDL_MIX_MAXVOLUME) + 128) #define ADJUST_VOLUME_U8(s, v) ((s) = ((((s) - 128) * (v)) / SDL_MIX_MAXVOLUME) + 128)
#define ADJUST_VOLUME_U16(s, v) ((s) = ((((s) - 32768) * (v)) / SDL_MIX_MAXVOLUME) + 32768) #define ADJUST_VOLUME_U16(s, v) ((s) = ((((s) - 32768) * (v)) / SDL_MIX_MAXVOLUME) + 32768)
void SDL_MixAudioFormat(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, int SDL_MixAudioFormat(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format,
Uint32 len, int volume) Uint32 len, int volume)
{ {
if (volume == 0) { if (volume == 0) {
return; return 0;
} }
switch (format) { switch (format) {
@@ -334,7 +334,8 @@ void SDL_MixAudioFormat(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format,
} break; } break;
default: /* If this happens... FIXME! */ default: /* If this happens... FIXME! */
SDL_SetError("SDL_MixAudioFormat(): unknown audio format"); return SDL_SetError("SDL_MixAudioFormat(): unknown audio format");
return;
} }
return 0;
} }
+4 -4
View File
@@ -184,21 +184,20 @@ void SDL_UDEV_Quit(void)
} }
} }
void SDL_UDEV_Scan(void) int SDL_UDEV_Scan(void)
{ {
struct udev_enumerate *enumerate = NULL; struct udev_enumerate *enumerate = NULL;
struct udev_list_entry *devs = NULL; struct udev_list_entry *devs = NULL;
struct udev_list_entry *item = NULL; struct udev_list_entry *item = NULL;
if (_this == NULL) { if (_this == NULL) {
return; return 0;
} }
enumerate = _this->syms.udev_enumerate_new(_this->udev); enumerate = _this->syms.udev_enumerate_new(_this->udev);
if (enumerate == NULL) { if (enumerate == NULL) {
SDL_UDEV_Quit(); SDL_UDEV_Quit();
SDL_SetError("udev_enumerate_new() failed"); return SDL_SetError("udev_enumerate_new() failed");
return;
} }
_this->syms.udev_enumerate_add_match_subsystem(enumerate, "input"); _this->syms.udev_enumerate_add_match_subsystem(enumerate, "input");
@@ -216,6 +215,7 @@ void SDL_UDEV_Scan(void)
} }
_this->syms.udev_enumerate_unref(enumerate); _this->syms.udev_enumerate_unref(enumerate);
return 0;
} }
SDL_bool SDL_bool
+1 -1
View File
@@ -100,7 +100,7 @@ extern void SDL_UDEV_Quit(void);
extern void SDL_UDEV_UnloadLibrary(void); extern void SDL_UDEV_UnloadLibrary(void);
extern int SDL_UDEV_LoadLibrary(void); extern int SDL_UDEV_LoadLibrary(void);
extern void SDL_UDEV_Poll(void); extern void SDL_UDEV_Poll(void);
extern void SDL_UDEV_Scan(void); extern int SDL_UDEV_Scan(void);
extern SDL_bool SDL_UDEV_GetProductInfo(const char *device_path, Uint16 *vendor, Uint16 *product, Uint16 *version); extern SDL_bool SDL_UDEV_GetProductInfo(const char *device_path, Uint16 *vendor, Uint16 *product, Uint16 *version);
extern int SDL_UDEV_AddCallback(SDL_UDEV_Callback cb); extern int SDL_UDEV_AddCallback(SDL_UDEV_Callback cb);
extern void SDL_UDEV_DelCallback(SDL_UDEV_Callback cb); extern void SDL_UDEV_DelCallback(SDL_UDEV_Callback cb);
+34 -34
View File
@@ -146,7 +146,7 @@ SDL_DYNAPI_PROC(void,SDL_ClearHints,(void),(),)
SDL_DYNAPI_PROC(void,SDL_ClearQueuedAudio,(SDL_AudioDeviceID a),(a),) SDL_DYNAPI_PROC(void,SDL_ClearQueuedAudio,(SDL_AudioDeviceID a),(a),)
SDL_DYNAPI_PROC(void,SDL_CloseAudioDevice,(SDL_AudioDeviceID a),(a),) SDL_DYNAPI_PROC(void,SDL_CloseAudioDevice,(SDL_AudioDeviceID a),(a),)
SDL_DYNAPI_PROC(void,SDL_CloseGamepad,(SDL_Gamepad *a),(a),) SDL_DYNAPI_PROC(void,SDL_CloseGamepad,(SDL_Gamepad *a),(a),)
SDL_DYNAPI_PROC(void,SDL_CloseJoystick,(SDL_Joystick *a),(a),) SDL_DYNAPI_PROC(int,SDL_CloseJoystick,(SDL_Joystick *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_CloseSensor,(SDL_Sensor *a),(a),) SDL_DYNAPI_PROC(void,SDL_CloseSensor,(SDL_Sensor *a),(a),)
SDL_DYNAPI_PROC(SDL_BlendMode,SDL_ComposeCustomBlendMode,(SDL_BlendFactor a, SDL_BlendFactor b, SDL_BlendOperation c, SDL_BlendFactor d, SDL_BlendFactor e, SDL_BlendOperation f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(SDL_BlendMode,SDL_ComposeCustomBlendMode,(SDL_BlendFactor a, SDL_BlendFactor b, SDL_BlendOperation c, SDL_BlendFactor d, SDL_BlendFactor e, SDL_BlendOperation f),(a,b,c,d,e,f),return)
SDL_DYNAPI_PROC(int,SDL_CondBroadcast,(SDL_cond *a),(a),return) SDL_DYNAPI_PROC(int,SDL_CondBroadcast,(SDL_cond *a),(a),return)
@@ -184,13 +184,13 @@ SDL_DYNAPI_PROC(Uint32,SDL_DequeueAudio,(SDL_AudioDeviceID a, void *b, Uint32 c)
SDL_DYNAPI_PROC(void,SDL_DestroyAudioStream,(SDL_AudioStream *a),(a),) SDL_DYNAPI_PROC(void,SDL_DestroyAudioStream,(SDL_AudioStream *a),(a),)
SDL_DYNAPI_PROC(void,SDL_DestroyCond,(SDL_cond *a),(a),) SDL_DYNAPI_PROC(void,SDL_DestroyCond,(SDL_cond *a),(a),)
SDL_DYNAPI_PROC(void,SDL_DestroyMutex,(SDL_mutex *a),(a),) SDL_DYNAPI_PROC(void,SDL_DestroyMutex,(SDL_mutex *a),(a),)
SDL_DYNAPI_PROC(void,SDL_DestroyPalette,(SDL_Palette *a),(a),) SDL_DYNAPI_PROC(int,SDL_DestroyPalette,(SDL_Palette *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_DestroyPixelFormat,(SDL_PixelFormat *a),(a),) SDL_DYNAPI_PROC(int,SDL_DestroyPixelFormat,(SDL_PixelFormat *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_DestroyRenderer,(SDL_Renderer *a),(a),) SDL_DYNAPI_PROC(int,SDL_DestroyRenderer,(SDL_Renderer *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_DestroySemaphore,(SDL_sem *a),(a),) SDL_DYNAPI_PROC(void,SDL_DestroySemaphore,(SDL_sem *a),(a),)
SDL_DYNAPI_PROC(void,SDL_DestroySurface,(SDL_Surface *a),(a),) SDL_DYNAPI_PROC(void,SDL_DestroySurface,(SDL_Surface *a),(a),)
SDL_DYNAPI_PROC(void,SDL_DestroyTexture,(SDL_Texture *a),(a),) SDL_DYNAPI_PROC(int,SDL_DestroyTexture,(SDL_Texture *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_DestroyWindow,(SDL_Window *a),(a),) SDL_DYNAPI_PROC(int,SDL_DestroyWindow,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_DetachThread,(SDL_Thread *a),(a),) SDL_DYNAPI_PROC(void,SDL_DetachThread,(SDL_Thread *a),(a),)
SDL_DYNAPI_PROC(int,SDL_DetachVirtualJoystick,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(int,SDL_DetachVirtualJoystick,(SDL_JoystickID a),(a),return)
SDL_DYNAPI_PROC(void,SDL_DisableScreenSaver,(void),(),) SDL_DYNAPI_PROC(void,SDL_DisableScreenSaver,(void),(),)
@@ -214,7 +214,7 @@ SDL_DYNAPI_PROC(void,SDL_DestroyCursor,(SDL_Cursor *a),(a),)
SDL_DYNAPI_PROC(void,SDL_DestroyRW,(SDL_RWops *a),(a),) SDL_DYNAPI_PROC(void,SDL_DestroyRW,(SDL_RWops *a),(a),)
SDL_DYNAPI_PROC(int,SDL_GL_BindTexture,(SDL_Texture *a, float *b, float *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GL_BindTexture,(SDL_Texture *a, float *b, float *c),(a,b,c),return)
SDL_DYNAPI_PROC(SDL_GLContext,SDL_GL_CreateContext,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_GLContext,SDL_GL_CreateContext,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_GL_DeleteContext,(SDL_GLContext a),(a),) SDL_DYNAPI_PROC(int,SDL_GL_DeleteContext,(SDL_GLContext a),(a),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_GL_ExtensionSupported,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GL_ExtensionSupported,(const char *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_GL_GetAttribute,(SDL_GLattr a, int *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GL_GetAttribute,(SDL_GLattr a, int *b),(a,b),return)
SDL_DYNAPI_PROC(SDL_GLContext,SDL_GL_GetCurrentContext,(void),(),return) SDL_DYNAPI_PROC(SDL_GLContext,SDL_GL_GetCurrentContext,(void),(),return)
@@ -384,8 +384,8 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectEnclosingPoints,(const SDL_Point *a, int b,
SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectEnclosingPointsFloat,(const SDL_FPoint *a, int b, const SDL_FRect *c, SDL_FRect *d),(a,b,c,d),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectEnclosingPointsFloat,(const SDL_FPoint *a, int b, const SDL_FRect *c, SDL_FRect *d),(a,b,c,d),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectIntersection,(const SDL_Rect *a, const SDL_Rect *b, SDL_Rect *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectIntersection,(const SDL_Rect *a, const SDL_Rect *b, SDL_Rect *c),(a,b,c),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectIntersectionFloat,(const SDL_FRect *a, const SDL_FRect *b, SDL_FRect *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectIntersectionFloat,(const SDL_FRect *a, const SDL_FRect *b, SDL_FRect *c),(a,b,c),return)
SDL_DYNAPI_PROC(void,SDL_GetRectUnion,(const SDL_Rect *a, const SDL_Rect *b, SDL_Rect *c),(a,b,c),) SDL_DYNAPI_PROC(int,SDL_GetRectUnion,(const SDL_Rect *a, const SDL_Rect *b, SDL_Rect *c),(a,b,c),return)
SDL_DYNAPI_PROC(void,SDL_GetRectUnionFloat,(const SDL_FRect *a, const SDL_FRect *b, SDL_FRect *c),(a,b,c),) SDL_DYNAPI_PROC(int,SDL_GetRectUnionFloat,(const SDL_FRect *a, const SDL_FRect *b, SDL_FRect *c),(a,b,c),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_GetRelativeMouseMode,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetRelativeMouseMode,(void),(),return)
SDL_DYNAPI_PROC(Uint32,SDL_GetRelativeMouseState,(float *a, float *b),(a,b),return) SDL_DYNAPI_PROC(Uint32,SDL_GetRelativeMouseState,(float *a, float *b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_GetRenderClipRect,(SDL_Renderer *a, SDL_Rect *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetRenderClipRect,(SDL_Renderer *a, SDL_Rect *b),(a,b),return)
@@ -447,15 +447,15 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowGrab,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(void*,SDL_GetWindowICCProfile,(SDL_Window *a, size_t *b),(a,b),return) SDL_DYNAPI_PROC(void*,SDL_GetWindowICCProfile,(SDL_Window *a, size_t *b),(a,b),return)
SDL_DYNAPI_PROC(Uint32,SDL_GetWindowID,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(Uint32,SDL_GetWindowID,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowKeyboardGrab,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowKeyboardGrab,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_GetWindowMaximumSize,(SDL_Window *a, int *b, int *c),(a,b,c),) SDL_DYNAPI_PROC(int,SDL_GetWindowMaximumSize,(SDL_Window *a, int *b, int *c),(a,b,c),return)
SDL_DYNAPI_PROC(void,SDL_GetWindowMinimumSize,(SDL_Window *a, int *b, int *c),(a,b,c),) SDL_DYNAPI_PROC(int,SDL_GetWindowMinimumSize,(SDL_Window *a, int *b, int *c),(a,b,c),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowMouseGrab,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowMouseGrab,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(const SDL_Rect*,SDL_GetWindowMouseRect,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(const SDL_Rect*,SDL_GetWindowMouseRect,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_GetWindowOpacity,(SDL_Window *a, float *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetWindowOpacity,(SDL_Window *a, float *b),(a,b),return)
SDL_DYNAPI_PROC(Uint32,SDL_GetWindowPixelFormat,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(Uint32,SDL_GetWindowPixelFormat,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_GetWindowPosition,(SDL_Window *a, int *b, int *c),(a,b,c),) SDL_DYNAPI_PROC(int,SDL_GetWindowPosition,(SDL_Window *a, int *b, int *c),(a,b,c),return)
SDL_DYNAPI_PROC(void,SDL_GetWindowSize,(SDL_Window *a, int *b, int *c),(a,b,c),) SDL_DYNAPI_PROC(int,SDL_GetWindowSize,(SDL_Window *a, int *b, int *c),(a,b,c),return)
SDL_DYNAPI_PROC(void,SDL_GetWindowSizeInPixels,(SDL_Window *a, int *b, int *c),(a,b,c),) SDL_DYNAPI_PROC(int,SDL_GetWindowSizeInPixels,(SDL_Window *a, int *b, int *c),(a,b,c),return)
SDL_DYNAPI_PROC(SDL_Surface*,SDL_GetWindowSurface,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_GetWindowSurface,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(const char*,SDL_GetWindowTitle,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetWindowTitle,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_GetWindowWMInfo,(SDL_Window *a, SDL_SysWMinfo *b, Uint32 c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetWindowWMInfo,(SDL_Window *a, SDL_SysWMinfo *b, Uint32 c),(a,b,c),return)
@@ -511,7 +511,7 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_HasSSE41,(void),(),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_HasSSE42,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_HasSSE42,(void),(),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_HasScreenKeyboardSupport,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_HasScreenKeyboardSupport,(void),(),return)
SDL_DYNAPI_PROC(int,SDL_HideCursor,(void),(),return) SDL_DYNAPI_PROC(int,SDL_HideCursor,(void),(),return)
SDL_DYNAPI_PROC(void,SDL_HideWindow,(SDL_Window *a),(a),) SDL_DYNAPI_PROC(int,SDL_HideWindow,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_Init,(Uint32 a),(a),return) SDL_DYNAPI_PROC(int,SDL_Init,(Uint32 a),(a),return)
SDL_DYNAPI_PROC(int,SDL_InitSubSystem,(Uint32 a),(a),return) SDL_DYNAPI_PROC(int,SDL_InitSubSystem,(Uint32 a),(a),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_IsGamepad,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_IsGamepad,(SDL_JoystickID a),(a),return)
@@ -545,14 +545,14 @@ SDL_DYNAPI_PROC(void,SDL_LogSetOutputFunction,(SDL_LogOutputFunction a, void *b)
SDL_DYNAPI_PROC(void,SDL_LogSetPriority,(int a, SDL_LogPriority b),(a,b),) SDL_DYNAPI_PROC(void,SDL_LogSetPriority,(int a, SDL_LogPriority b),(a,b),)
SDL_DYNAPI_PROC(Uint32,SDL_MapRGB,(const SDL_PixelFormat *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) SDL_DYNAPI_PROC(Uint32,SDL_MapRGB,(const SDL_PixelFormat *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return)
SDL_DYNAPI_PROC(Uint32,SDL_MapRGBA,(const SDL_PixelFormat *a, Uint8 b, Uint8 c, Uint8 d, Uint8 e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(Uint32,SDL_MapRGBA,(const SDL_PixelFormat *a, Uint8 b, Uint8 c, Uint8 d, Uint8 e),(a,b,c,d,e),return)
SDL_DYNAPI_PROC(void,SDL_MaximizeWindow,(SDL_Window *a),(a),) SDL_DYNAPI_PROC(int,SDL_MaximizeWindow,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_MemoryBarrierAcquireFunction,(void),(),) SDL_DYNAPI_PROC(void,SDL_MemoryBarrierAcquireFunction,(void),(),)
SDL_DYNAPI_PROC(void,SDL_MemoryBarrierReleaseFunction,(void),(),) SDL_DYNAPI_PROC(void,SDL_MemoryBarrierReleaseFunction,(void),(),)
SDL_DYNAPI_PROC(SDL_MetalView,SDL_Metal_CreateView,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_MetalView,SDL_Metal_CreateView,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_Metal_DestroyView,(SDL_MetalView a),(a),) SDL_DYNAPI_PROC(void,SDL_Metal_DestroyView,(SDL_MetalView a),(a),)
SDL_DYNAPI_PROC(void*,SDL_Metal_GetLayer,(SDL_MetalView a),(a),return) SDL_DYNAPI_PROC(void*,SDL_Metal_GetLayer,(SDL_MetalView a),(a),return)
SDL_DYNAPI_PROC(void,SDL_MinimizeWindow,(SDL_Window *a),(a),) SDL_DYNAPI_PROC(int,SDL_MinimizeWindow,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_MixAudioFormat,(Uint8 *a, const Uint8 *b, SDL_AudioFormat c, Uint32 d, int e),(a,b,c,d,e),) SDL_DYNAPI_PROC(int,SDL_MixAudioFormat,(Uint8 *a, const Uint8 *b, SDL_AudioFormat c, Uint32 d, int e),(a,b,c,d,e),return)
SDL_DYNAPI_PROC(int,SDL_MouseIsHaptic,(void),(),return) SDL_DYNAPI_PROC(int,SDL_MouseIsHaptic,(void),(),return)
SDL_DYNAPI_PROC(int,SDL_NumHaptics,(void),(),return) SDL_DYNAPI_PROC(int,SDL_NumHaptics,(void),(),return)
SDL_DYNAPI_PROC(void,SDL_OnApplicationDidBecomeActive,(void),(),) SDL_DYNAPI_PROC(void,SDL_OnApplicationDidBecomeActive,(void),(),)
@@ -586,7 +586,7 @@ SDL_DYNAPI_PROC(Sint64,SDL_RWseek,(SDL_RWops *a, Sint64 b, int c),(a,b,c),return
SDL_DYNAPI_PROC(Sint64,SDL_RWsize,(SDL_RWops *a),(a),return) SDL_DYNAPI_PROC(Sint64,SDL_RWsize,(SDL_RWops *a),(a),return)
SDL_DYNAPI_PROC(Sint64,SDL_RWtell,(SDL_RWops *a),(a),return) SDL_DYNAPI_PROC(Sint64,SDL_RWtell,(SDL_RWops *a),(a),return)
SDL_DYNAPI_PROC(Sint64,SDL_RWwrite,(SDL_RWops *a, const void *b, Sint64 c),(a,b,c),return) SDL_DYNAPI_PROC(Sint64,SDL_RWwrite,(SDL_RWops *a, const void *b, Sint64 c),(a,b,c),return)
SDL_DYNAPI_PROC(void,SDL_RaiseWindow,(SDL_Window *a),(a),) SDL_DYNAPI_PROC(int,SDL_RaiseWindow,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(Uint16,SDL_ReadBE16,(SDL_RWops *a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_ReadBE16,(SDL_RWops *a),(a),return)
SDL_DYNAPI_PROC(Uint32,SDL_ReadBE32,(SDL_RWops *a),(a),return) SDL_DYNAPI_PROC(Uint32,SDL_ReadBE32,(SDL_RWops *a),(a),return)
SDL_DYNAPI_PROC(Uint64,SDL_ReadBE64,(SDL_RWops *a),(a),return) SDL_DYNAPI_PROC(Uint64,SDL_ReadBE64,(SDL_RWops *a),(a),return)
@@ -608,7 +608,7 @@ SDL_DYNAPI_PROC(int,SDL_RenderLines,(SDL_Renderer *a, const SDL_FPoint *b, int c
SDL_DYNAPI_PROC(int,SDL_RenderCoordinatesToWindow,(SDL_Renderer *a, float b, float c, float *d, float *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_RenderCoordinatesToWindow,(SDL_Renderer *a, float b, float c, float *d, float *e),(a,b,c,d,e),return)
SDL_DYNAPI_PROC(int,SDL_RenderPoint,(SDL_Renderer *a, float b, float c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_RenderPoint,(SDL_Renderer *a, float b, float c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_RenderPoints,(SDL_Renderer *a, const SDL_FPoint *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_RenderPoints,(SDL_Renderer *a, const SDL_FPoint *b, int c),(a,b,c),return)
SDL_DYNAPI_PROC(void,SDL_RenderPresent,(SDL_Renderer *a),(a),) SDL_DYNAPI_PROC(int,SDL_RenderPresent,(SDL_Renderer *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_RenderReadPixels,(SDL_Renderer *a, const SDL_Rect *b, Uint32 c, void *d, int e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_RenderReadPixels,(SDL_Renderer *a, const SDL_Rect *b, Uint32 c, void *d, int e),(a,b,c,d,e),return)
SDL_DYNAPI_PROC(int,SDL_RenderRect,(SDL_Renderer *a, const SDL_FRect *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_RenderRect,(SDL_Renderer *a, const SDL_FRect *b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_RenderRects,(SDL_Renderer *a, const SDL_FRect *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_RenderRects,(SDL_Renderer *a, const SDL_FRect *b, int c),(a,b,c),return)
@@ -620,7 +620,7 @@ SDL_DYNAPI_PROC(void,SDL_ResetAssertionReport,(void),(),)
SDL_DYNAPI_PROC(SDL_bool,SDL_ResetHint,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_ResetHint,(const char *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_ResetHints,(void),(),) SDL_DYNAPI_PROC(void,SDL_ResetHints,(void),(),)
SDL_DYNAPI_PROC(void,SDL_ResetKeyboard,(void),(),) SDL_DYNAPI_PROC(void,SDL_ResetKeyboard,(void),(),)
SDL_DYNAPI_PROC(void,SDL_RestoreWindow,(SDL_Window *a),(a),) SDL_DYNAPI_PROC(int,SDL_RestoreWindow,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_RumbleGamepad,(SDL_Gamepad *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_RumbleGamepad,(SDL_Gamepad *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return)
SDL_DYNAPI_PROC(int,SDL_RumbleGamepadTriggers,(SDL_Gamepad *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_RumbleGamepadTriggers,(SDL_Gamepad *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return)
SDL_DYNAPI_PROC(int,SDL_RumbleJoystick,(SDL_Joystick *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_RumbleJoystick,(SDL_Joystick *a, Uint16 b, Uint16 c, Uint32 d),(a,b,c,d),return)
@@ -639,7 +639,7 @@ SDL_DYNAPI_PROC(int,SDL_SendGamepadEffect,(SDL_Gamepad *a, const void *b, int c)
SDL_DYNAPI_PROC(int,SDL_SendJoystickEffect,(SDL_Joystick *a, const void *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SendJoystickEffect,(SDL_Joystick *a, const void *b, int c),(a,b,c),return)
SDL_DYNAPI_PROC(void,SDL_SetAssertionHandler,(SDL_AssertionHandler a, void *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_SetAssertionHandler,(SDL_AssertionHandler a, void *b),(a,b),)
SDL_DYNAPI_PROC(int,SDL_SetClipboardText,(const char *a),(a),return) SDL_DYNAPI_PROC(int,SDL_SetClipboardText,(const char *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_SetCursor,(SDL_Cursor *a),(a),) SDL_DYNAPI_PROC(int,SDL_SetCursor,(SDL_Cursor *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_SetEventEnabled,(Uint32 a, SDL_bool b),(a,b),) SDL_DYNAPI_PROC(void,SDL_SetEventEnabled,(Uint32 a, SDL_bool b),(a,b),)
SDL_DYNAPI_PROC(void,SDL_SetEventFilter,(SDL_EventFilter a, void *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_SetEventFilter,(SDL_EventFilter a, void *b),(a,b),)
SDL_DYNAPI_PROC(void,SDL_SetGamepadEventsEnabled,(SDL_bool a),(a),) SDL_DYNAPI_PROC(void,SDL_SetGamepadEventsEnabled,(SDL_bool a),(a),)
@@ -650,7 +650,7 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_SetHint,(const char *a, const char *b),(a,b),return
SDL_DYNAPI_PROC(SDL_bool,SDL_SetHintWithPriority,(const char *a, const char *b, SDL_HintPriority c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_bool,SDL_SetHintWithPriority,(const char *a, const char *b, SDL_HintPriority c),(a,b,c),return)
SDL_DYNAPI_PROC(void,SDL_SetJoystickEventsEnabled,(SDL_bool a),(a),) SDL_DYNAPI_PROC(void,SDL_SetJoystickEventsEnabled,(SDL_bool a),(a),)
SDL_DYNAPI_PROC(int,SDL_SetJoystickLED,(SDL_Joystick *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_SetJoystickLED,(SDL_Joystick *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return)
SDL_DYNAPI_PROC(void,SDL_SetJoystickPlayerIndex,(SDL_Joystick *a, int b),(a,b),) SDL_DYNAPI_PROC(int,SDL_SetJoystickPlayerIndex,(SDL_Joystick *a, int b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetJoystickVirtualAxis,(SDL_Joystick *a, int b, Sint16 c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetJoystickVirtualAxis,(SDL_Joystick *a, int b, Sint16 c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SetJoystickVirtualButton,(SDL_Joystick *a, int b, Uint8 c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetJoystickVirtualButton,(SDL_Joystick *a, int b, Uint8 c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SetJoystickVirtualHat,(SDL_Joystick *a, int b, Uint8 c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetJoystickVirtualHat,(SDL_Joystick *a, int b, Uint8 c),(a,b,c),return)
@@ -675,31 +675,31 @@ SDL_DYNAPI_PROC(int,SDL_SetSurfaceColorKey,(SDL_Surface *a, int b, Uint32 c),(a,
SDL_DYNAPI_PROC(int,SDL_SetSurfaceColorMod,(SDL_Surface *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_SetSurfaceColorMod,(SDL_Surface *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return)
SDL_DYNAPI_PROC(int,SDL_SetSurfacePalette,(SDL_Surface *a, SDL_Palette *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetSurfacePalette,(SDL_Surface *a, SDL_Palette *b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetSurfaceRLE,(SDL_Surface *a, int b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetSurfaceRLE,(SDL_Surface *a, int b),(a,b),return)
SDL_DYNAPI_PROC(void,SDL_SetTextInputRect,(const SDL_Rect *a),(a),) SDL_DYNAPI_PROC(int,SDL_SetTextInputRect,(const SDL_Rect *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_SetTextureAlphaMod,(SDL_Texture *a, Uint8 b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetTextureAlphaMod,(SDL_Texture *a, Uint8 b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetTextureBlendMode,(SDL_Texture *a, SDL_BlendMode b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetTextureBlendMode,(SDL_Texture *a, SDL_BlendMode b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetTextureColorMod,(SDL_Texture *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_SetTextureColorMod,(SDL_Texture *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return)
SDL_DYNAPI_PROC(int,SDL_SetTextureScaleMode,(SDL_Texture *a, SDL_ScaleMode b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetTextureScaleMode,(SDL_Texture *a, SDL_ScaleMode b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetTextureUserData,(SDL_Texture *a, void *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetTextureUserData,(SDL_Texture *a, void *b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetThreadPriority,(SDL_ThreadPriority a),(a),return) SDL_DYNAPI_PROC(int,SDL_SetThreadPriority,(SDL_ThreadPriority a),(a),return)
SDL_DYNAPI_PROC(void,SDL_SetWindowAlwaysOnTop,(SDL_Window *a, SDL_bool b),(a,b),) SDL_DYNAPI_PROC(int,SDL_SetWindowAlwaysOnTop,(SDL_Window *a, SDL_bool b),(a,b),return)
SDL_DYNAPI_PROC(void,SDL_SetWindowBordered,(SDL_Window *a, SDL_bool b),(a,b),) SDL_DYNAPI_PROC(int,SDL_SetWindowBordered,(SDL_Window *a, SDL_bool b),(a,b),return)
SDL_DYNAPI_PROC(void*,SDL_SetWindowData,(SDL_Window *a, const char *b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(void*,SDL_SetWindowData,(SDL_Window *a, const char *b, void *c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SetWindowFullscreenMode,(SDL_Window *a, const SDL_DisplayMode *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetWindowFullscreenMode,(SDL_Window *a, const SDL_DisplayMode *b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetWindowFullscreen,(SDL_Window *a, SDL_bool b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetWindowFullscreen,(SDL_Window *a, SDL_bool b),(a,b),return)
SDL_DYNAPI_PROC(void,SDL_SetWindowGrab,(SDL_Window *a, SDL_bool b),(a,b),) SDL_DYNAPI_PROC(int,SDL_SetWindowGrab,(SDL_Window *a, SDL_bool b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetWindowHitTest,(SDL_Window *a, SDL_HitTest b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetWindowHitTest,(SDL_Window *a, SDL_HitTest b, void *c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SetWindowIcon,(SDL_Window *a, SDL_Surface *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetWindowIcon,(SDL_Window *a, SDL_Surface *b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetWindowInputFocus,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_SetWindowInputFocus,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_SetWindowKeyboardGrab,(SDL_Window *a, SDL_bool b),(a,b),) SDL_DYNAPI_PROC(int,SDL_SetWindowKeyboardGrab,(SDL_Window *a, SDL_bool b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetWindowMaximumSize,(SDL_Window *a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetWindowMaximumSize,(SDL_Window *a, int b, int c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SetWindowMinimumSize,(SDL_Window *a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetWindowMinimumSize,(SDL_Window *a, int b, int c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SetWindowModalFor,(SDL_Window *a, SDL_Window *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetWindowModalFor,(SDL_Window *a, SDL_Window *b),(a,b),return)
SDL_DYNAPI_PROC(void,SDL_SetWindowMouseGrab,(SDL_Window *a, SDL_bool b),(a,b),) SDL_DYNAPI_PROC(int,SDL_SetWindowMouseGrab,(SDL_Window *a, SDL_bool b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetWindowMouseRect,(SDL_Window *a, const SDL_Rect *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetWindowMouseRect,(SDL_Window *a, const SDL_Rect *b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetWindowOpacity,(SDL_Window *a, float b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetWindowOpacity,(SDL_Window *a, float b),(a,b),return)
SDL_DYNAPI_PROC(void,SDL_SetWindowPosition,(SDL_Window *a, int b, int c),(a,b,c),) SDL_DYNAPI_PROC(int,SDL_SetWindowPosition,(SDL_Window *a, int b, int c),(a,b,c),return)
SDL_DYNAPI_PROC(void,SDL_SetWindowResizable,(SDL_Window *a, SDL_bool b),(a,b),) SDL_DYNAPI_PROC(int,SDL_SetWindowResizable,(SDL_Window *a, SDL_bool b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetWindowShape,(SDL_Window *a, SDL_Surface *b, SDL_WindowShapeMode *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetWindowShape,(SDL_Window *a, SDL_Surface *b, SDL_WindowShapeMode *c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SetWindowSize,(SDL_Window *a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetWindowSize,(SDL_Window *a, int b, int c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SetWindowTitle,(SDL_Window *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetWindowTitle,(SDL_Window *a, const char *b),(a,b),return)
@@ -707,7 +707,7 @@ SDL_DYNAPI_PROC(void,SDL_SetYUVConversionMode,(SDL_YUV_CONVERSION_MODE a),(a),)
SDL_DYNAPI_PROC(int,SDL_ShowCursor,(void),(),return) SDL_DYNAPI_PROC(int,SDL_ShowCursor,(void),(),return)
SDL_DYNAPI_PROC(int,SDL_ShowMessageBox,(const SDL_MessageBoxData *a, int *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_ShowMessageBox,(const SDL_MessageBoxData *a, int *b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_ShowSimpleMessageBox,(Uint32 a, const char *b, const char *c, SDL_Window *d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_ShowSimpleMessageBox,(Uint32 a, const char *b, const char *c, SDL_Window *d),(a,b,c,d),return)
SDL_DYNAPI_PROC(void,SDL_ShowWindow,(SDL_Window *a),(a),) SDL_DYNAPI_PROC(int,SDL_ShowWindow,(SDL_Window *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_SoftStretch,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_SoftStretch,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return)
SDL_DYNAPI_PROC(int,SDL_SoftStretchLinear,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_SoftStretchLinear,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return)
SDL_DYNAPI_PROC(void,SDL_StartTextInput,(void),(),) SDL_DYNAPI_PROC(void,SDL_StartTextInput,(void),(),)
@@ -727,7 +727,7 @@ SDL_DYNAPI_PROC(void,SDL_UnlockAudioDevice,(SDL_AudioDeviceID a),(a),)
SDL_DYNAPI_PROC(void,SDL_UnlockJoysticks,(void),(),) SDL_DYNAPI_PROC(void,SDL_UnlockJoysticks,(void),(),)
SDL_DYNAPI_PROC(int,SDL_UnlockMutex,(SDL_mutex *a),(a),return) SDL_DYNAPI_PROC(int,SDL_UnlockMutex,(SDL_mutex *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_UnlockSurface,(SDL_Surface *a),(a),) SDL_DYNAPI_PROC(void,SDL_UnlockSurface,(SDL_Surface *a),(a),)
SDL_DYNAPI_PROC(void,SDL_UnlockTexture,(SDL_Texture *a),(a),) SDL_DYNAPI_PROC(int,SDL_UnlockTexture,(SDL_Texture *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_UpdateGamepads,(void),(),) SDL_DYNAPI_PROC(void,SDL_UpdateGamepads,(void),(),)
SDL_DYNAPI_PROC(void,SDL_UpdateJoysticks,(void),(),) SDL_DYNAPI_PROC(void,SDL_UpdateJoysticks,(void),(),)
SDL_DYNAPI_PROC(int,SDL_UpdateNVTexture,(SDL_Texture *a, const SDL_Rect *b, const Uint8 *c, int d, const Uint8 *e, int f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(int,SDL_UpdateNVTexture,(SDL_Texture *a, const SDL_Rect *b, const Uint8 *c, int d, const Uint8 *e, int f),(a,b,c,d,e,f),return)
@@ -786,7 +786,7 @@ SDL_DYNAPI_PROC(float,SDL_fmodf,(float a, float b),(a,b),return)
SDL_DYNAPI_PROC(void,SDL_free,(void *a),(a),) SDL_DYNAPI_PROC(void,SDL_free,(void *a),(a),)
SDL_DYNAPI_PROC(char*,SDL_getenv,(const char *a),(a),return) SDL_DYNAPI_PROC(char*,SDL_getenv,(const char *a),(a),return)
SDL_DYNAPI_PROC(void,SDL_hid_ble_scan,(SDL_bool a),(a),) SDL_DYNAPI_PROC(void,SDL_hid_ble_scan,(SDL_bool a),(a),)
SDL_DYNAPI_PROC(void,SDL_hid_close,(SDL_hid_device *a),(a),) SDL_DYNAPI_PROC(int,SDL_hid_close,(SDL_hid_device *a),(a),return)
SDL_DYNAPI_PROC(Uint32,SDL_hid_device_change_count,(void),(),return) SDL_DYNAPI_PROC(Uint32,SDL_hid_device_change_count,(void),(),return)
SDL_DYNAPI_PROC(SDL_hid_device_info*,SDL_hid_enumerate,(unsigned short a, unsigned short b),(a,b),return) SDL_DYNAPI_PROC(SDL_hid_device_info*,SDL_hid_enumerate,(unsigned short a, unsigned short b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_hid_exit,(void),(),return) SDL_DYNAPI_PROC(int,SDL_hid_exit,(void),(),return)
+4 -4
View File
@@ -1256,13 +1256,13 @@ SDL_CreateSystemCursor(SDL_SystemCursor id)
if this is desired for any reason. This is used when setting if this is desired for any reason. This is used when setting
the video mode and when the SDL window gains the mouse focus. the video mode and when the SDL window gains the mouse focus.
*/ */
void SDL_SetCursor(SDL_Cursor *cursor) int SDL_SetCursor(SDL_Cursor *cursor)
{ {
SDL_Mouse *mouse = SDL_GetMouse(); SDL_Mouse *mouse = SDL_GetMouse();
/* Return immediately if setting the cursor to the currently set one (fixes #7151) */ /* Return immediately if setting the cursor to the currently set one (fixes #7151) */
if (cursor == mouse->cur_cursor) { if (cursor == mouse->cur_cursor) {
return; return 0;
} }
/* Set the new cursor */ /* Set the new cursor */
@@ -1276,8 +1276,7 @@ void SDL_SetCursor(SDL_Cursor *cursor)
} }
} }
if (found == NULL) { if (found == NULL) {
SDL_SetError("Cursor not associated with the current mouse"); return SDL_SetError("Cursor not associated with the current mouse");
return;
} }
} }
mouse->cur_cursor = cursor; mouse->cur_cursor = cursor;
@@ -1298,6 +1297,7 @@ void SDL_SetCursor(SDL_Cursor *cursor)
mouse->ShowCursor(NULL); mouse->ShowCursor(NULL);
} }
} }
return 0;
} }
SDL_Cursor * SDL_Cursor *
+2 -2
View File
@@ -54,13 +54,13 @@ typedef struct
int (*ShowCursor)(SDL_Cursor *cursor); int (*ShowCursor)(SDL_Cursor *cursor);
/* This is called when a mouse motion event occurs */ /* This is called when a mouse motion event occurs */
void (*MoveCursor)(SDL_Cursor *cursor); int (*MoveCursor)(SDL_Cursor *cursor);
/* Free a window manager cursor */ /* Free a window manager cursor */
void (*FreeCursor)(SDL_Cursor *cursor); void (*FreeCursor)(SDL_Cursor *cursor);
/* Warp the mouse to (x,y) within a window */ /* Warp the mouse to (x,y) within a window */
void (*WarpMouse)(SDL_Window *window, float x, float y); int (*WarpMouse)(SDL_Window *window, float x, float y);
/* Warp the mouse to (x,y) in screen space */ /* Warp the mouse to (x,y) in screen space */
int (*WarpMouseGlobal)(float x, float y); int (*WarpMouseGlobal)(float x, float y);
+3 -2
View File
@@ -1522,12 +1522,13 @@ int SDL_hid_get_feature_report(SDL_hid_device *device, unsigned char *data, size
return result; return result;
} }
void SDL_hid_close(SDL_hid_device *device) int SDL_hid_close(SDL_hid_device *device)
{ {
CHECK_DEVICE_MAGIC(device, ); CHECK_DEVICE_MAGIC(device, -1);
device->backend->hid_close(device->device); device->backend->hid_close(device->device);
DeleteHIDDeviceWrapper(device); DeleteHIDDeviceWrapper(device);
return 0;
} }
int SDL_hid_get_manufacturer_string(SDL_hid_device *device, wchar_t *string, size_t maxlen) int SDL_hid_get_manufacturer_string(SDL_hid_device *device, wchar_t *string, size_t maxlen)
+9 -12
View File
@@ -936,7 +936,7 @@ const char *SDL_GetGamepadStringForButton(SDL_GamepadButton button)
/* /*
* given a gamepad button name and a joystick name update our mapping structure with it * given a gamepad button name and a joystick name update our mapping structure with it
*/ */
static void SDL_PrivateParseGamepadElement(SDL_Gamepad *gamepad, const char *szGameButton, const char *szJoystickButton) static int SDL_PrivateParseGamepadElement(SDL_Gamepad *gamepad, const char *szGameButton, const char *szJoystickButton)
{ {
SDL_ExtendedGamepadBind bind; SDL_ExtendedGamepadBind bind;
SDL_GamepadButton button; SDL_GamepadButton button;
@@ -975,8 +975,7 @@ static void SDL_PrivateParseGamepadElement(SDL_Gamepad *gamepad, const char *szG
bind.outputType = SDL_GAMEPAD_BINDTYPE_BUTTON; bind.outputType = SDL_GAMEPAD_BINDTYPE_BUTTON;
bind.output.button = button; bind.output.button = button;
} else { } else {
SDL_SetError("Unexpected gamepad element %s", szGameButton); return SDL_SetError("Unexpected gamepad element %s", szGameButton);
return;
} }
if (*szJoystickButton == '+' || *szJoystickButton == '-') { if (*szJoystickButton == '+' || *szJoystickButton == '-') {
@@ -1015,24 +1014,23 @@ static void SDL_PrivateParseGamepadElement(SDL_Gamepad *gamepad, const char *szG
bind.input.hat.hat = hat; bind.input.hat.hat = hat;
bind.input.hat.hat_mask = mask; bind.input.hat.hat_mask = mask;
} else { } else {
SDL_SetError("Unexpected joystick element: %s", szJoystickButton); return SDL_SetError("Unexpected joystick element: %s", szJoystickButton);
return;
} }
++gamepad->num_bindings; ++gamepad->num_bindings;
gamepad->bindings = (SDL_ExtendedGamepadBind *)SDL_realloc(gamepad->bindings, gamepad->num_bindings * sizeof(*gamepad->bindings)); gamepad->bindings = (SDL_ExtendedGamepadBind *)SDL_realloc(gamepad->bindings, gamepad->num_bindings * sizeof(*gamepad->bindings));
if (!gamepad->bindings) { if (!gamepad->bindings) {
gamepad->num_bindings = 0; gamepad->num_bindings = 0;
SDL_OutOfMemory(); return SDL_OutOfMemory();
return;
} }
gamepad->bindings[gamepad->num_bindings - 1] = bind; gamepad->bindings[gamepad->num_bindings - 1] = bind;
return 0;
} }
/* /*
* given a gamepad mapping string update our mapping object * given a gamepad mapping string update our mapping object
*/ */
static void SDL_PrivateParseGamepadConfigString(SDL_Gamepad *gamepad, const char *pchString) static int SDL_PrivateParseGamepadConfigString(SDL_Gamepad *gamepad, const char *pchString)
{ {
char szGameButton[20]; char szGameButton[20];
char szJoystickButton[20]; char szJoystickButton[20];
@@ -1058,15 +1056,13 @@ static void SDL_PrivateParseGamepadConfigString(SDL_Gamepad *gamepad, const char
} else if (bGameButton) { } else if (bGameButton) {
if (i >= sizeof(szGameButton)) { if (i >= sizeof(szGameButton)) {
SDL_SetError("Button name too large: %s", szGameButton); return SDL_SetError("Button name too large: %s", szGameButton);
return;
} }
szGameButton[i] = *pchPos; szGameButton[i] = *pchPos;
i++; i++;
} else { } else {
if (i >= sizeof(szJoystickButton)) { if (i >= sizeof(szJoystickButton)) {
SDL_SetError("Joystick button name too large: %s", szJoystickButton); return SDL_SetError("Joystick button name too large: %s", szJoystickButton);
return;
} }
szJoystickButton[i] = *pchPos; szJoystickButton[i] = *pchPos;
i++; i++;
@@ -1078,6 +1074,7 @@ static void SDL_PrivateParseGamepadConfigString(SDL_Gamepad *gamepad, const char
if (szGameButton[0] != '\0' || szJoystickButton[0] != '\0') { if (szGameButton[0] != '\0' || szJoystickButton[0] != '\0') {
SDL_PrivateParseGamepadElement(gamepad, szGameButton, szJoystickButton); SDL_PrivateParseGamepadElement(gamepad, szGameButton, szJoystickButton);
} }
return 0;
} }
/* /*
+7 -5
View File
@@ -1043,15 +1043,16 @@ int SDL_GetJoystickPlayerIndex(SDL_Joystick *joystick)
/** /**
* Set the player index of an opened joystick * Set the player index of an opened joystick
*/ */
void SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index) int SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index)
{ {
SDL_LockJoysticks(); SDL_LockJoysticks();
{ {
CHECK_JOYSTICK_MAGIC(joystick, ); CHECK_JOYSTICK_MAGIC(joystick, -1);
SDL_SetJoystickIDForPlayerIndex(player_index, joystick->instance_id); SDL_SetJoystickIDForPlayerIndex(player_index, joystick->instance_id);
} }
SDL_UnlockJoysticks(); SDL_UnlockJoysticks();
return 0;
} }
int SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) int SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)
@@ -1216,7 +1217,7 @@ int SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size)
/* /*
* Close a joystick previously opened with SDL_OpenJoystick() * Close a joystick previously opened with SDL_OpenJoystick()
*/ */
void SDL_CloseJoystick(SDL_Joystick *joystick) int SDL_CloseJoystick(SDL_Joystick *joystick)
{ {
SDL_Joystick *joysticklist; SDL_Joystick *joysticklist;
SDL_Joystick *joysticklistprev; SDL_Joystick *joysticklistprev;
@@ -1224,12 +1225,12 @@ void SDL_CloseJoystick(SDL_Joystick *joystick)
SDL_LockJoysticks(); SDL_LockJoysticks();
{ {
CHECK_JOYSTICK_MAGIC(joystick, ); CHECK_JOYSTICK_MAGIC(joystick, -1);
/* First decrement ref count */ /* First decrement ref count */
if (--joystick->ref_count > 0) { if (--joystick->ref_count > 0) {
SDL_UnlockJoysticks(); SDL_UnlockJoysticks();
return; return 0;
} }
if (joystick->rumble_expiration) { if (joystick->rumble_expiration) {
@@ -1276,6 +1277,7 @@ void SDL_CloseJoystick(SDL_Joystick *joystick)
SDL_free(joystick); SDL_free(joystick);
} }
SDL_UnlockJoysticks(); SDL_UnlockJoysticks();
return 0;
} }
void SDL_QuitJoysticks(void) void SDL_QuitJoysticks(void)
+9 -10
View File
@@ -458,15 +458,15 @@ static SDL_bool RAWINPUT_MissingWindowsGamingInputSlot()
return SDL_FALSE; return SDL_FALSE;
} }
static void RAWINPUT_UpdateWindowsGamingInput() static int RAWINPUT_UpdateWindowsGamingInput()
{ {
int ii; int ii;
if (!wgi_state.gamepad_statics) { if (!wgi_state.gamepad_statics) {
return; return 0;
} }
if (!wgi_state.dirty) { if (!wgi_state.dirty) {
return; return 0;
} }
wgi_state.dirty = SDL_FALSE; wgi_state.dirty = SDL_FALSE;
@@ -507,13 +507,11 @@ static void RAWINPUT_UpdateWindowsGamingInput()
wgi_state.per_gamepad_count++; wgi_state.per_gamepad_count++;
wgi_state.per_gamepad = SDL_realloc(wgi_state.per_gamepad, sizeof(wgi_state.per_gamepad[0]) * wgi_state.per_gamepad_count); wgi_state.per_gamepad = SDL_realloc(wgi_state.per_gamepad, sizeof(wgi_state.per_gamepad[0]) * wgi_state.per_gamepad_count);
if (!wgi_state.per_gamepad) { if (!wgi_state.per_gamepad) {
SDL_OutOfMemory(); return SDL_OutOfMemory();
return;
} }
gamepad_state = SDL_calloc(1, sizeof(*gamepad_state)); gamepad_state = SDL_calloc(1, sizeof(*gamepad_state));
if (gamepad_state == NULL) { if (gamepad_state == NULL) {
SDL_OutOfMemory(); return SDL_OutOfMemory();
return;
} }
wgi_state.per_gamepad[wgi_state.per_gamepad_count - 1] = gamepad_state; wgi_state.per_gamepad[wgi_state.per_gamepad_count - 1] = gamepad_state;
gamepad_state->gamepad = gamepad; gamepad_state->gamepad = gamepad;
@@ -549,6 +547,7 @@ static void RAWINPUT_UpdateWindowsGamingInput()
wgi_state.per_gamepad[ii]->connected = SDL_FALSE; /* Not used by anything, currently */ wgi_state.per_gamepad[ii]->connected = SDL_FALSE; /* Not used by anything, currently */
} }
} }
return 0;
} }
static void RAWINPUT_InitWindowsGamingInput(RAWINPUT_DeviceContext *ctx) static void RAWINPUT_InitWindowsGamingInput(RAWINPUT_DeviceContext *ctx)
{ {
@@ -1907,7 +1906,7 @@ RAWINPUT_RegisterNotifications(HWND hWnd)
return SDL_TRUE; return SDL_TRUE;
} }
void RAWINPUT_UnregisterNotifications() int RAWINPUT_UnregisterNotifications()
{ {
int i; int i;
RAWINPUTDEVICE rid[SDL_arraysize(subscribed_devices)]; RAWINPUTDEVICE rid[SDL_arraysize(subscribed_devices)];
@@ -1920,9 +1919,9 @@ void RAWINPUT_UnregisterNotifications()
} }
if (!RegisterRawInputDevices(rid, SDL_arraysize(rid), sizeof(RAWINPUTDEVICE))) { if (!RegisterRawInputDevices(rid, SDL_arraysize(rid), sizeof(RAWINPUTDEVICE))) {
SDL_SetError("Couldn't unregister for raw input events"); return SDL_SetError("Couldn't unregister for raw input events");
return;
} }
return 0;
} }
LRESULT CALLBACK LRESULT CALLBACK
@@ -29,7 +29,7 @@ extern SDL_bool RAWINPUT_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Ui
/* Registers for input events */ /* Registers for input events */
extern SDL_bool RAWINPUT_RegisterNotifications(HWND hWnd); extern SDL_bool RAWINPUT_RegisterNotifications(HWND hWnd);
extern void RAWINPUT_UnregisterNotifications(); extern int RAWINPUT_UnregisterNotifications();
/* Returns 0 if message was handled */ /* Returns 0 if message was handled */
extern LRESULT CALLBACK RAWINPUT_WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); extern LRESULT CALLBACK RAWINPUT_WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
+1 -1
View File
@@ -26,7 +26,7 @@
extern "C" { extern "C" {
#endif #endif
extern void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen); extern int SDL_SYS_GetPreferredLocales(char *buf, size_t buflen);
#ifdef __cplusplus #ifdef __cplusplus
} }
+2 -1
View File
@@ -23,7 +23,8 @@
#include "../SDL_syslocale.h" #include "../SDL_syslocale.h"
#include "../../core/android/SDL_android.h" #include "../../core/android/SDL_android.h"
void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) int SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
{ {
Android_JNI_GetLocale(buf, buflen); Android_JNI_GetLocale(buf, buflen);
return 0;
} }
+2 -2
View File
@@ -22,8 +22,8 @@
#include "SDL_internal.h" #include "SDL_internal.h"
#include "../SDL_syslocale.h" #include "../SDL_syslocale.h"
void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) int SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
{ {
/* dummy implementation. Caller already zero'd out buffer. */ /* dummy implementation. Caller already zero'd out buffer. */
SDL_Unsupported(); return SDL_Unsupported();
} }
+2 -1
View File
@@ -24,7 +24,7 @@
#include "SDL_internal.h" #include "SDL_internal.h"
#include "../SDL_syslocale.h" #include "../SDL_syslocale.h"
void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) int SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
{ {
/* *INDENT-OFF* */ /* clang-format off */ /* *INDENT-OFF* */ /* clang-format off */
EM_ASM({ EM_ASM({
@@ -67,4 +67,5 @@ void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
} }
}, buf, buflen); }, buf, buflen);
/* *INDENT-ON* */ /* clang-format on */ /* *INDENT-ON* */ /* clang-format on */
return 0;
} }
+4 -5
View File
@@ -26,7 +26,7 @@
#include "SDL_internal.h" #include "SDL_internal.h"
#include "../SDL_syslocale.h" #include "../SDL_syslocale.h"
void int
SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
{ {
BLocaleRoster *roster = BLocaleRoster::Default(); BLocaleRoster *roster = BLocaleRoster::Default();
@@ -34,16 +34,14 @@ SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
BMessage msg; BMessage msg;
if (roster->GetPreferredLanguages(&msg) != B_OK) { if (roster->GetPreferredLanguages(&msg) != B_OK) {
SDL_SetError("BLocaleRoster couldn't get preferred languages"); return SDL_SetError("BLocaleRoster couldn't get preferred languages");
return;
} }
const char *key = "language"; const char *key = "language";
type_code typ = B_ANY_TYPE; type_code typ = B_ANY_TYPE;
int32 numlangs = 0; int32 numlangs = 0;
if ((msg.GetInfo(key, &typ, &numlangs) != B_OK) || (typ != B_STRING_TYPE)) { if ((msg.GetInfo(key, &typ, &numlangs) != B_OK) || (typ != B_STRING_TYPE)) {
SDL_SetError("BLocaleRoster message was wrong"); return SDL_SetError("BLocaleRoster message was wrong");
return;
} }
for (int32 i = 0; i < numlangs; i++) { for (int32 i = 0; i < numlangs; i++) {
@@ -71,4 +69,5 @@ SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
buflen--; buflen--;
} }
} }
return 0;
} }
+2 -1
View File
@@ -24,7 +24,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) int SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
{ {
@autoreleasepool { @autoreleasepool {
NSArray *languages = NSLocale.preferredLanguages; NSArray *languages = NSLocale.preferredLanguages;
@@ -72,4 +72,5 @@ void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
} }
} }
} }
return 0;
} }
+2 -1
View File
@@ -29,7 +29,7 @@
SDL_FORCE_INLINE u8 GetLocaleIndex(void); SDL_FORCE_INLINE u8 GetLocaleIndex(void);
void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) int SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
{ {
/* The 3DS only supports these 12 languages, only one can be active at a time */ /* The 3DS only supports these 12 languages, only one can be active at a time */
static const char AVAILABLE_LOCALES[][6] = { "ja_JP", "en_US", "fr_FR", "de_DE", static const char AVAILABLE_LOCALES[][6] = { "ja_JP", "en_US", "fr_FR", "de_DE",
@@ -39,6 +39,7 @@ void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
if (current_locale != BAD_LOCALE) { if (current_locale != BAD_LOCALE) {
SDL_strlcpy(buf, AVAILABLE_LOCALES[current_locale], buflen); SDL_strlcpy(buf, AVAILABLE_LOCALES[current_locale], buflen);
} }
return 0;
} }
SDL_FORCE_INLINE u8 SDL_FORCE_INLINE u8
+3 -3
View File
@@ -62,7 +62,7 @@ static void normalize_locales(char *dst, char *src, size_t buflen)
normalize_locale_str(dst, src, buflen); normalize_locale_str(dst, src, buflen);
} }
void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) int SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
{ {
/* !!! FIXME: should we be using setlocale()? Or some D-Bus thing? */ /* !!! FIXME: should we be using setlocale()? Or some D-Bus thing? */
SDL_bool isstack; SDL_bool isstack;
@@ -72,8 +72,7 @@ void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
SDL_assert(buflen > 0); SDL_assert(buflen > 0);
tmp = SDL_small_alloc(char, buflen, &isstack); tmp = SDL_small_alloc(char, buflen, &isstack);
if (tmp == NULL) { if (tmp == NULL) {
SDL_OutOfMemory(); return SDL_OutOfMemory();
return;
} }
*tmp = '\0'; *tmp = '\0';
@@ -100,4 +99,5 @@ void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
} }
SDL_small_free(tmp, isstack); SDL_small_free(tmp, isstack);
return 0;
} }
+2 -1
View File
@@ -25,7 +25,7 @@
#include <psp2/apputil.h> #include <psp2/apputil.h>
#include <psp2/system_param.h> #include <psp2/system_param.h>
void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) int SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
{ {
const char *vita_locales[] = { const char *vita_locales[] = {
"ja_JP", "ja_JP",
@@ -65,4 +65,5 @@ void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
SDL_strlcpy(buf, vita_locales[language], buflen); SDL_strlcpy(buf, vita_locales[language], buflen);
sceAppUtilShutdown(); sceAppUtilShutdown();
return 0;
} }
+5 -4
View File
@@ -54,7 +54,7 @@ static void SDL_SYS_GetPreferredLocales_winxp(char *buf, size_t buflen)
} }
/* this works on Windows Vista and later. */ /* this works on Windows Vista and later. */
static void SDL_SYS_GetPreferredLocales_vista(char *buf, size_t buflen) static int SDL_SYS_GetPreferredLocales_vista(char *buf, size_t buflen)
{ {
ULONG numlangs = 0; ULONG numlangs = 0;
WCHAR *wbuf = NULL; WCHAR *wbuf = NULL;
@@ -66,8 +66,7 @@ static void SDL_SYS_GetPreferredLocales_vista(char *buf, size_t buflen)
wbuf = SDL_small_alloc(WCHAR, wbuflen, &isstack); wbuf = SDL_small_alloc(WCHAR, wbuflen, &isstack);
if (wbuf == NULL) { if (wbuf == NULL) {
SDL_OutOfMemory(); return SDL_OutOfMemory();
return;
} }
if (!pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &numlangs, wbuf, &wbuflen)) { if (!pGetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &numlangs, wbuf, &wbuflen)) {
@@ -91,9 +90,10 @@ static void SDL_SYS_GetPreferredLocales_vista(char *buf, size_t buflen)
} }
SDL_small_free(wbuf, isstack); SDL_small_free(wbuf, isstack);
return 0;
} }
void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) int SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
{ {
if (!kernel32) { if (!kernel32) {
kernel32 = GetModuleHandle(TEXT("kernel32.dll")); kernel32 = GetModuleHandle(TEXT("kernel32.dll"));
@@ -107,4 +107,5 @@ void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
} else { } else {
SDL_SYS_GetPreferredLocales_vista(buf, buflen); /* available on Vista and later. */ SDL_SYS_GetPreferredLocales_vista(buf, buflen); /* available on Vista and later. */
} }
return 0;
} }
+2 -1
View File
@@ -27,7 +27,7 @@
/*using namespace Windows::Graphics::Display;*/ /*using namespace Windows::Graphics::Display;*/
#include <wchar.h> #include <wchar.h>
void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) int SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
{ {
WCHAR wbuffer[128] = L""; WCHAR wbuffer[128] = L"";
int ret = 0; int ret = 0;
@@ -50,4 +50,5 @@ void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
buf[i] = (char)wbuffer[i]; /* assume this was ASCII anyhow. */ buf[i] = (char)wbuffer[i]; /* assume this was ASCII anyhow. */
} }
} }
return 0;
} }
+15 -11
View File
@@ -2013,12 +2013,12 @@ static void SDL_UnlockTextureNative(SDL_Texture *texture)
SDL_UnlockTexture(native); SDL_UnlockTexture(native);
} }
void SDL_UnlockTexture(SDL_Texture *texture) int SDL_UnlockTexture(SDL_Texture *texture)
{ {
CHECK_TEXTURE_MAGIC(texture, ); CHECK_TEXTURE_MAGIC(texture, -1);
if (texture->access != SDL_TEXTUREACCESS_STREAMING) { if (texture->access != SDL_TEXTUREACCESS_STREAMING) {
return; return 0;
} }
#if SDL_HAVE_YUV #if SDL_HAVE_YUV
if (texture->yuv) { if (texture->yuv) {
@@ -2034,6 +2034,7 @@ void SDL_UnlockTexture(SDL_Texture *texture)
SDL_DestroySurface(texture->locked_surface); SDL_DestroySurface(texture->locked_surface);
texture->locked_surface = NULL; texture->locked_surface = NULL;
return 0;
} }
static int SDL_SetRenderTargetInternal(SDL_Renderer *renderer, SDL_Texture *texture) static int SDL_SetRenderTargetInternal(SDL_Renderer *renderer, SDL_Texture *texture)
@@ -4002,11 +4003,11 @@ static void SDL_RenderLogicalBorders(SDL_Renderer *renderer)
} }
} }
void SDL_RenderPresent(SDL_Renderer *renderer) int SDL_RenderPresent(SDL_Renderer *renderer)
{ {
SDL_bool presented = SDL_TRUE; SDL_bool presented = SDL_TRUE;
CHECK_RENDERER_MAGIC(renderer, ); CHECK_RENDERER_MAGIC(renderer, -1);
if (renderer->logical_target) { if (renderer->logical_target) {
SDL_SetRenderTargetInternal(renderer, NULL); SDL_SetRenderTargetInternal(renderer, NULL);
@@ -4034,13 +4035,14 @@ void SDL_RenderPresent(SDL_Renderer *renderer)
(!presented && renderer->wanted_vsync)) { (!presented && renderer->wanted_vsync)) {
SDL_SimulateRenderVSync(renderer); SDL_SimulateRenderVSync(renderer);
} }
return 0;
} }
static void SDL_DestroyTextureInternal(SDL_Texture *texture, SDL_bool is_destroying) static int SDL_DestroyTextureInternal(SDL_Texture *texture, SDL_bool is_destroying)
{ {
SDL_Renderer *renderer; SDL_Renderer *renderer;
CHECK_TEXTURE_MAGIC(texture, ); CHECK_TEXTURE_MAGIC(texture, -1);
renderer = texture->renderer; renderer = texture->renderer;
if (is_destroying) { if (is_destroying) {
@@ -4084,11 +4086,12 @@ static void SDL_DestroyTextureInternal(SDL_Texture *texture, SDL_bool is_destroy
texture->locked_surface = NULL; texture->locked_surface = NULL;
SDL_free(texture); SDL_free(texture);
return 0;
} }
void SDL_DestroyTexture(SDL_Texture *texture) int SDL_DestroyTexture(SDL_Texture *texture)
{ {
SDL_DestroyTextureInternal(texture, SDL_FALSE /* is_destroying */); return SDL_DestroyTextureInternal(texture, SDL_FALSE /* is_destroying */);
} }
static void SDL_DiscardAllCommands(SDL_Renderer *renderer) static void SDL_DiscardAllCommands(SDL_Renderer *renderer)
@@ -4113,9 +4116,9 @@ static void SDL_DiscardAllCommands(SDL_Renderer *renderer)
} }
} }
void SDL_DestroyRenderer(SDL_Renderer *renderer) int SDL_DestroyRenderer(SDL_Renderer *renderer)
{ {
CHECK_RENDERER_MAGIC(renderer, ); CHECK_RENDERER_MAGIC(renderer, -1);
SDL_DelEventWatch(SDL_RendererEventWatch, renderer); SDL_DelEventWatch(SDL_RendererEventWatch, renderer);
@@ -4144,6 +4147,7 @@ void SDL_DestroyRenderer(SDL_Renderer *renderer)
/* Free the renderer instance */ /* Free the renderer instance */
renderer->DestroyRenderer(renderer); renderer->DestroyRenderer(renderer);
return 0;
} }
int SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh) int SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh)
+3 -2
View File
@@ -1202,18 +1202,19 @@ int SDL_EGL_SwapBuffers(_THIS, EGLSurface egl_surface)
return 0; return 0;
} }
void SDL_EGL_DeleteContext(_THIS, SDL_GLContext context) int SDL_EGL_DeleteContext(_THIS, SDL_GLContext context)
{ {
EGLContext egl_context = (EGLContext)context; EGLContext egl_context = (EGLContext)context;
/* Clean up GLES and EGL */ /* Clean up GLES and EGL */
if (!_this->egl_data) { if (!_this->egl_data) {
return; return 0;
} }
if (egl_context != NULL && egl_context != EGL_NO_CONTEXT) { if (egl_context != NULL && egl_context != EGL_NO_CONTEXT) {
_this->egl_data->eglDestroyContext(_this->egl_data->egl_display, egl_context); _this->egl_data->eglDestroyContext(_this->egl_data->egl_display, egl_context);
} }
return 0;
} }
EGLSurface * EGLSurface *
+1 -1
View File
@@ -128,7 +128,7 @@ extern void SDL_EGL_SetRequiredVisualId(_THIS, int visual_id);
extern int SDL_EGL_ChooseConfig(_THIS); extern int SDL_EGL_ChooseConfig(_THIS);
extern int SDL_EGL_SetSwapInterval(_THIS, int interval); extern int SDL_EGL_SetSwapInterval(_THIS, int interval);
extern int SDL_EGL_GetSwapInterval(_THIS, int *interval); extern int SDL_EGL_GetSwapInterval(_THIS, int *interval);
extern void SDL_EGL_DeleteContext(_THIS, SDL_GLContext context); extern int SDL_EGL_DeleteContext(_THIS, SDL_GLContext context);
extern EGLSurface *SDL_EGL_CreateSurface(_THIS, NativeWindowType nw); extern EGLSurface *SDL_EGL_CreateSurface(_THIS, NativeWindowType nw);
extern void SDL_EGL_DestroySurface(_THIS, EGLSurface egl_surface); extern void SDL_EGL_DestroySurface(_THIS, EGLSurface egl_surface);
+8 -8
View File
@@ -623,20 +623,19 @@ int SDL_InitFormat(SDL_PixelFormat *format, Uint32 pixel_format)
return 0; return 0;
} }
void SDL_DestroyPixelFormat(SDL_PixelFormat *format) int SDL_DestroyPixelFormat(SDL_PixelFormat *format)
{ {
SDL_PixelFormat *prev; SDL_PixelFormat *prev;
if (format == NULL) { if (format == NULL) {
SDL_InvalidParamError("format"); return SDL_InvalidParamError("format");
return;
} }
SDL_AtomicLock(&formats_lock); SDL_AtomicLock(&formats_lock);
if (--format->refcount > 0) { if (--format->refcount > 0) {
SDL_AtomicUnlock(&formats_lock); SDL_AtomicUnlock(&formats_lock);
return; return 0;
} }
/* Remove this format from our list */ /* Remove this format from our list */
@@ -657,6 +656,7 @@ void SDL_DestroyPixelFormat(SDL_PixelFormat *format)
SDL_DestroyPalette(format->palette); SDL_DestroyPalette(format->palette);
} }
SDL_free(format); SDL_free(format);
return 0;
} }
SDL_Palette * SDL_Palette *
@@ -744,17 +744,17 @@ int SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors,
return status; return status;
} }
void SDL_DestroyPalette(SDL_Palette *palette) int SDL_DestroyPalette(SDL_Palette *palette)
{ {
if (palette == NULL) { if (palette == NULL) {
SDL_InvalidParamError("palette"); return SDL_InvalidParamError("palette");
return;
} }
if (--palette->refcount > 0) { if (--palette->refcount > 0) {
return; return 0;
} }
SDL_free(palette->colors); SDL_free(palette->colors);
SDL_free(palette); SDL_free(palette);
return 0;
} }
/* /*
+7 -9
View File
@@ -118,29 +118,26 @@ SDL_INTERSECTRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result)
return !SDL_RECTEMPTY(result); return !SDL_RECTEMPTY(result);
} }
void SDL_UNIONRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result) int SDL_UNIONRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result)
{ {
SCALARTYPE Amin, Amax, Bmin, Bmax; SCALARTYPE Amin, Amax, Bmin, Bmax;
if (A == NULL) { if (A == NULL) {
SDL_InvalidParamError("A"); return SDL_InvalidParamError("A");
return;
} else if (B == NULL) { } else if (B == NULL) {
SDL_InvalidParamError("B"); return SDL_InvalidParamError("B");
return;
} else if (result == NULL) { } else if (result == NULL) {
SDL_InvalidParamError("result"); return SDL_InvalidParamError("result");
return;
} else if (SDL_RECTEMPTY(A)) { /* Special cases for empty Rects */ } else if (SDL_RECTEMPTY(A)) { /* Special cases for empty Rects */
if (SDL_RECTEMPTY(B)) { /* A and B empty */ if (SDL_RECTEMPTY(B)) { /* A and B empty */
SDL_zerop(result); SDL_zerop(result);
} else { /* A empty, B not empty */ } else { /* A empty, B not empty */
*result = *B; *result = *B;
} }
return; return 0;
} else if (SDL_RECTEMPTY(B)) { /* A not empty, B empty */ } else if (SDL_RECTEMPTY(B)) { /* A not empty, B empty */
*result = *A; *result = *A;
return; return 0;
} }
/* Horizontal union */ /* Horizontal union */
@@ -170,6 +167,7 @@ void SDL_UNIONRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result)
Amax = Bmax; Amax = Bmax;
} }
result->h = Amax - Amin; result->h = Amax - Amin;
return 0;
} }
SDL_bool SDL_ENCLOSEPOINTS(const POINTTYPE *points, int count, const RECTTYPE *clip, SDL_bool SDL_ENCLOSEPOINTS(const POINTTYPE *points, int count, const RECTTYPE *clip,
+3 -3
View File
@@ -232,7 +232,7 @@ struct SDL_VideoDevice
/* /*
* Get a list of the available display modes for a display. * Get a list of the available display modes for a display.
*/ */
void (*GetDisplayModes)(_THIS, SDL_VideoDisplay *display); int (*GetDisplayModes)(_THIS, SDL_VideoDisplay *display);
/* /*
* Setting the display mode is independent of creating windows, so * Setting the display mode is independent of creating windows, so
@@ -303,7 +303,7 @@ struct SDL_VideoDevice
int (*GL_SetSwapInterval)(_THIS, int interval); int (*GL_SetSwapInterval)(_THIS, int interval);
int (*GL_GetSwapInterval)(_THIS, int *interval); int (*GL_GetSwapInterval)(_THIS, int *interval);
int (*GL_SwapWindow)(_THIS, SDL_Window *window); int (*GL_SwapWindow)(_THIS, SDL_Window *window);
void (*GL_DeleteContext)(_THIS, SDL_GLContext context); int (*GL_DeleteContext)(_THIS, SDL_GLContext context);
void (*GL_DefaultProfileConfig)(_THIS, int *mask, int *major, int *minor); void (*GL_DefaultProfileConfig)(_THIS, int *mask, int *major, int *minor);
/* * * */ /* * * */
@@ -337,7 +337,7 @@ struct SDL_VideoDevice
/* Text input */ /* Text input */
void (*StartTextInput)(_THIS); void (*StartTextInput)(_THIS);
void (*StopTextInput)(_THIS); void (*StopTextInput)(_THIS);
void (*SetTextInputRect)(_THIS, const SDL_Rect *rect); int (*SetTextInputRect)(_THIS, const SDL_Rect *rect);
void (*ClearComposition)(_THIS); void (*ClearComposition)(_THIS);
SDL_bool (*IsTextInputShown)(_THIS); SDL_bool (*IsTextInputShown)(_THIS);
+81 -54
View File
@@ -2157,9 +2157,9 @@ void *SDL_GetWindowData(SDL_Window *window, const char *name)
return NULL; return NULL;
} }
void SDL_SetWindowPosition(SDL_Window *window, int x, int y) int SDL_SetWindowPosition(SDL_Window *window, int x, int y)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (SDL_WINDOWPOS_ISCENTERED(x) || SDL_WINDOWPOS_ISCENTERED(y)) { if (SDL_WINDOWPOS_ISCENTERED(x) || SDL_WINDOWPOS_ISCENTERED(y)) {
SDL_DisplayID displayID = 0; SDL_DisplayID displayID = 0;
@@ -2201,11 +2201,12 @@ void SDL_SetWindowPosition(SDL_Window *window, int x, int y)
_this->SetWindowPosition(_this, window); _this->SetWindowPosition(_this, window);
} }
} }
return 0;
} }
void SDL_GetWindowPosition(SDL_Window *window, int *x, int *y) int SDL_GetWindowPosition(SDL_Window *window, int *x, int *y)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
/* Fullscreen windows are always at their display's origin */ /* Fullscreen windows are always at their display's origin */
if (window->flags & SDL_WINDOW_FULLSCREEN) { if (window->flags & SDL_WINDOW_FULLSCREEN) {
@@ -2242,11 +2243,12 @@ void SDL_GetWindowPosition(SDL_Window *window, int *x, int *y)
*y = window->y; *y = window->y;
} }
} }
return 0;
} }
void SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered) int SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
const int want = (bordered != SDL_FALSE); /* normalize the flag. */ const int want = (bordered != SDL_FALSE); /* normalize the flag. */
const int have = !(window->flags & SDL_WINDOW_BORDERLESS); const int have = !(window->flags & SDL_WINDOW_BORDERLESS);
@@ -2259,11 +2261,12 @@ void SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered)
_this->SetWindowBordered(_this, window, (SDL_bool)want); _this->SetWindowBordered(_this, window, (SDL_bool)want);
} }
} }
return 0;
} }
void SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable) int SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
const int want = (resizable != SDL_FALSE); /* normalize the flag. */ const int want = (resizable != SDL_FALSE); /* normalize the flag. */
const int have = ((window->flags & SDL_WINDOW_RESIZABLE) != 0); const int have = ((window->flags & SDL_WINDOW_RESIZABLE) != 0);
@@ -2276,11 +2279,12 @@ void SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable)
_this->SetWindowResizable(_this, window, (SDL_bool)want); _this->SetWindowResizable(_this, window, (SDL_bool)want);
} }
} }
return 0;
} }
void SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL_bool on_top) int SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL_bool on_top)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { if (!(window->flags & SDL_WINDOW_FULLSCREEN)) {
const int want = (on_top != SDL_FALSE); /* normalize the flag. */ const int want = (on_top != SDL_FALSE); /* normalize the flag. */
const int have = ((window->flags & SDL_WINDOW_ALWAYS_ON_TOP) != 0); const int have = ((window->flags & SDL_WINDOW_ALWAYS_ON_TOP) != 0);
@@ -2293,6 +2297,7 @@ void SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL_bool on_top)
_this->SetWindowAlwaysOnTop(_this, window, (SDL_bool)want); _this->SetWindowAlwaysOnTop(_this, window, (SDL_bool)want);
} }
} }
return 0;
} }
int SDL_SetWindowSize(SDL_Window *window, int w, int h) int SDL_SetWindowSize(SDL_Window *window, int w, int h)
@@ -2330,15 +2335,16 @@ int SDL_SetWindowSize(SDL_Window *window, int w, int h)
return 0; return 0;
} }
void SDL_GetWindowSize(SDL_Window *window, int *w, int *h) int SDL_GetWindowSize(SDL_Window *window, int *w, int *h)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (w) { if (w) {
*w = window->w; *w = window->w;
} }
if (h) { if (h) {
*h = window->h; *h = window->h;
} }
return 0;
} }
int SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *bottom, int *right) int SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *bottom, int *right)
@@ -2370,11 +2376,11 @@ int SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *botto
return _this->GetWindowBordersSize(_this, window, top, left, bottom, right); return _this->GetWindowBordersSize(_this, window, top, left, bottom, right);
} }
void SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h) int SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h)
{ {
int filter; int filter;
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (w == NULL) { if (w == NULL) {
w = &filter; w = &filter;
@@ -2410,6 +2416,7 @@ void SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h)
} }
} }
} }
return 0;
} }
int SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h) int SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h)
@@ -2440,15 +2447,16 @@ int SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h)
return 0; return 0;
} }
void SDL_GetWindowMinimumSize(SDL_Window *window, int *min_w, int *min_h) int SDL_GetWindowMinimumSize(SDL_Window *window, int *min_w, int *min_h)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (min_w) { if (min_w) {
*min_w = window->min_w; *min_w = window->min_w;
} }
if (min_h) { if (min_h) {
*min_h = window->min_h; *min_h = window->min_h;
} }
return 0;
} }
int SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h) int SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h)
@@ -2478,37 +2486,39 @@ int SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h)
return 0; return 0;
} }
void SDL_GetWindowMaximumSize(SDL_Window *window, int *max_w, int *max_h) int SDL_GetWindowMaximumSize(SDL_Window *window, int *max_w, int *max_h)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (max_w) { if (max_w) {
*max_w = window->max_w; *max_w = window->max_w;
} }
if (max_h) { if (max_h) {
*max_h = window->max_h; *max_h = window->max_h;
} }
return 0;
} }
void SDL_ShowWindow(SDL_Window *window) int SDL_ShowWindow(SDL_Window *window)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (!(window->flags & SDL_WINDOW_HIDDEN)) { if (!(window->flags & SDL_WINDOW_HIDDEN)) {
return; return 0;
} }
if (_this->ShowWindow) { if (_this->ShowWindow) {
_this->ShowWindow(_this, window); _this->ShowWindow(_this, window);
} }
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_SHOWN, 0, 0); SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_SHOWN, 0, 0);
return 0;
} }
void SDL_HideWindow(SDL_Window *window) int SDL_HideWindow(SDL_Window *window)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (window->flags & SDL_WINDOW_HIDDEN) { if (window->flags & SDL_WINDOW_HIDDEN) {
return; return 0;
} }
window->is_hiding = SDL_TRUE; window->is_hiding = SDL_TRUE;
@@ -2519,26 +2529,28 @@ void SDL_HideWindow(SDL_Window *window)
} }
window->is_hiding = SDL_FALSE; window->is_hiding = SDL_FALSE;
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_HIDDEN, 0, 0); SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_HIDDEN, 0, 0);
return 0;
} }
void SDL_RaiseWindow(SDL_Window *window) int SDL_RaiseWindow(SDL_Window *window)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (window->flags & SDL_WINDOW_HIDDEN) { if (window->flags & SDL_WINDOW_HIDDEN) {
return; return 0;
} }
if (_this->RaiseWindow) { if (_this->RaiseWindow) {
_this->RaiseWindow(_this, window); _this->RaiseWindow(_this, window);
} }
return 0;
} }
void SDL_MaximizeWindow(SDL_Window *window) int SDL_MaximizeWindow(SDL_Window *window)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (window->flags & SDL_WINDOW_MAXIMIZED) { if (window->flags & SDL_WINDOW_MAXIMIZED) {
return; return 0;
} }
/* !!! FIXME: should this check if the window is resizable? */ /* !!! FIXME: should this check if the window is resizable? */
@@ -2546,6 +2558,7 @@ void SDL_MaximizeWindow(SDL_Window *window)
if (_this->MaximizeWindow) { if (_this->MaximizeWindow) {
_this->MaximizeWindow(_this, window); _this->MaximizeWindow(_this, window);
} }
return 0;
} }
static SDL_bool SDL_CanMinimizeWindow(SDL_Window *window) static SDL_bool SDL_CanMinimizeWindow(SDL_Window *window)
@@ -2556,16 +2569,16 @@ static SDL_bool SDL_CanMinimizeWindow(SDL_Window *window)
return SDL_TRUE; return SDL_TRUE;
} }
void SDL_MinimizeWindow(SDL_Window *window) int SDL_MinimizeWindow(SDL_Window *window)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (window->flags & SDL_WINDOW_MINIMIZED) { if (window->flags & SDL_WINDOW_MINIMIZED) {
return; return 0;
} }
if (!SDL_CanMinimizeWindow(window)) { if (!SDL_CanMinimizeWindow(window)) {
return; return 0;
} }
if (!DisableUnsetFullscreenOnMinimize(_this)) { if (!DisableUnsetFullscreenOnMinimize(_this)) {
@@ -2575,19 +2588,21 @@ void SDL_MinimizeWindow(SDL_Window *window)
if (_this->MinimizeWindow) { if (_this->MinimizeWindow) {
_this->MinimizeWindow(_this, window); _this->MinimizeWindow(_this, window);
} }
return 0;
} }
void SDL_RestoreWindow(SDL_Window *window) int SDL_RestoreWindow(SDL_Window *window)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (!(window->flags & (SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED))) { if (!(window->flags & (SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED))) {
return; return 0;
} }
if (_this->RestoreWindow) { if (_this->RestoreWindow) {
_this->RestoreWindow(_this, window); _this->RestoreWindow(_this, window);
} }
return 0;
} }
int SDL_SetWindowFullscreen(SDL_Window *window, SDL_bool fullscreen) int SDL_SetWindowFullscreen(SDL_Window *window, SDL_bool fullscreen)
@@ -2840,23 +2855,24 @@ void SDL_UpdateWindowGrab(SDL_Window *window)
} }
} }
void SDL_SetWindowGrab(SDL_Window *window, SDL_bool grabbed) int SDL_SetWindowGrab(SDL_Window *window, SDL_bool grabbed)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
SDL_SetWindowMouseGrab(window, grabbed); SDL_SetWindowMouseGrab(window, grabbed);
if (SDL_GetHintBoolean(SDL_HINT_GRAB_KEYBOARD, SDL_FALSE)) { if (SDL_GetHintBoolean(SDL_HINT_GRAB_KEYBOARD, SDL_FALSE)) {
SDL_SetWindowKeyboardGrab(window, grabbed); SDL_SetWindowKeyboardGrab(window, grabbed);
} }
return 0;
} }
void SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bool grabbed) int SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bool grabbed)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (!!grabbed == !!(window->flags & SDL_WINDOW_KEYBOARD_GRABBED)) { if (!!grabbed == !!(window->flags & SDL_WINDOW_KEYBOARD_GRABBED)) {
return; return 0;
} }
if (grabbed) { if (grabbed) {
window->flags |= SDL_WINDOW_KEYBOARD_GRABBED; window->flags |= SDL_WINDOW_KEYBOARD_GRABBED;
@@ -2864,14 +2880,15 @@ void SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bool grabbed)
window->flags &= ~SDL_WINDOW_KEYBOARD_GRABBED; window->flags &= ~SDL_WINDOW_KEYBOARD_GRABBED;
} }
SDL_UpdateWindowGrab(window); SDL_UpdateWindowGrab(window);
return 0;
} }
void SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed) int SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed)
{ {
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
if (!!grabbed == !!(window->flags & SDL_WINDOW_MOUSE_GRABBED)) { if (!!grabbed == !!(window->flags & SDL_WINDOW_MOUSE_GRABBED)) {
return; return 0;
} }
if (grabbed) { if (grabbed) {
window->flags |= SDL_WINDOW_MOUSE_GRABBED; window->flags |= SDL_WINDOW_MOUSE_GRABBED;
@@ -2879,6 +2896,7 @@ void SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed)
window->flags &= ~SDL_WINDOW_MOUSE_GRABBED; window->flags &= ~SDL_WINDOW_MOUSE_GRABBED;
} }
SDL_UpdateWindowGrab(window); SDL_UpdateWindowGrab(window);
return 0;
} }
SDL_bool SDL_GetWindowGrab(SDL_Window *window) SDL_bool SDL_GetWindowGrab(SDL_Window *window)
@@ -3127,11 +3145,11 @@ SDL_Window *SDL_GetFocusWindow(void)
return NULL; return NULL;
} }
void SDL_DestroyWindow(SDL_Window *window) int SDL_DestroyWindow(SDL_Window *window)
{ {
SDL_VideoDisplay *display; SDL_VideoDisplay *display;
CHECK_WINDOW_MAGIC(window, ); CHECK_WINDOW_MAGIC(window, -1);
window->is_destroying = SDL_TRUE; window->is_destroying = SDL_TRUE;
@@ -3208,6 +3226,7 @@ void SDL_DestroyWindow(SDL_Window *window)
} }
SDL_free(window); SDL_free(window);
return 0;
} }
SDL_bool SDL_ScreenSaverEnabled() SDL_bool SDL_ScreenSaverEnabled()
@@ -4129,17 +4148,20 @@ int SDL_GL_SwapWindow(SDL_Window *window)
return _this->GL_SwapWindow(_this, window); return _this->GL_SwapWindow(_this, window);
} }
void SDL_GL_DeleteContext(SDL_GLContext context) int SDL_GL_DeleteContext(SDL_GLContext context)
{ {
if (_this == NULL || !context) { if (_this == NULL) {
return; return SDL_UninitializedVideo(); \
}
if (!context) {
return SDL_InvalidParamError("context");
} }
if (SDL_GL_GetCurrentContext() == context) { if (SDL_GL_GetCurrentContext() == context) {
SDL_GL_MakeCurrent(NULL, NULL); SDL_GL_MakeCurrent(NULL, NULL);
} }
_this->GL_DeleteContext(_this, context); return _this->GL_DeleteContext(_this, context);
} }
#if 0 /* FIXME */ #if 0 /* FIXME */
@@ -4327,11 +4349,16 @@ void SDL_StopTextInput(void)
SDL_SetEventEnabled(SDL_EVENT_TEXT_EDITING, SDL_FALSE); SDL_SetEventEnabled(SDL_EVENT_TEXT_EDITING, SDL_FALSE);
} }
void SDL_SetTextInputRect(const SDL_Rect *rect) int SDL_SetTextInputRect(const SDL_Rect *rect)
{ {
if (_this && _this->SetTextInputRect) { if (rect == NULL) {
_this->SetTextInputRect(_this, rect); return SDL_InvalidParamError("rect");
} }
if (_this && _this->SetTextInputRect) {
return _this->SetTextInputRect(_this, rect);
}
return SDL_Unsupported();
} }
SDL_bool SDL_HasScreenKeyboardSupport(void) SDL_bool SDL_HasScreenKeyboardSupport(void)
+2 -7
View File
@@ -359,16 +359,11 @@ void Android_StopTextInput(_THIS)
Android_JNI_HideTextInput(); Android_JNI_HideTextInput();
} }
void Android_SetTextInputRect(_THIS, const SDL_Rect *rect) int Android_SetTextInputRect(_THIS, const SDL_Rect *rect)
{ {
SDL_VideoData *videodata = _this->driverdata; SDL_VideoData *videodata = _this->driverdata;
if (rect == NULL) {
SDL_InvalidParamError("rect");
return;
}
videodata->textRect = *rect; videodata->textRect = *rect;
return 0;
} }
#endif /* SDL_VIDEO_DRIVER_ANDROID */ #endif /* SDL_VIDEO_DRIVER_ANDROID */
+1 -1
View File
@@ -30,4 +30,4 @@ extern SDL_bool Android_IsScreenKeyboardShown(_THIS, SDL_Window *window);
extern void Android_StartTextInput(_THIS); extern void Android_StartTextInput(_THIS);
extern void Android_StopTextInput(_THIS); extern void Android_StopTextInput(_THIS);
extern void Android_SetTextInputRect(_THIS, const SDL_Rect *rect); extern int Android_SetTextInputRect(_THIS, const SDL_Rect *rect);
+1 -1
View File
@@ -29,7 +29,7 @@ extern void Cocoa_QuitKeyboard(_THIS);
extern void Cocoa_StartTextInput(_THIS); extern void Cocoa_StartTextInput(_THIS);
extern void Cocoa_StopTextInput(_THIS); extern void Cocoa_StopTextInput(_THIS);
extern void Cocoa_SetTextInputRect(_THIS, const SDL_Rect *rect); extern int Cocoa_SetTextInputRect(_THIS, const SDL_Rect *rect);
extern void Cocoa_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed); extern void Cocoa_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed);
+2 -7
View File
@@ -354,16 +354,11 @@ void Cocoa_StopTextInput(_THIS)
} }
} }
void Cocoa_SetTextInputRect(_THIS, const SDL_Rect *rect) int Cocoa_SetTextInputRect(_THIS, const SDL_Rect *rect)
{ {
SDL_VideoData *data = _this->driverdata; SDL_VideoData *data = _this->driverdata;
if (!rect) {
SDL_InvalidParamError("rect");
return;
}
[data.fieldEdit setInputRect:rect]; [data.fieldEdit setInputRect:rect];
return 0;
} }
void Cocoa_HandleKeyEvent(_THIS, NSEvent *event) void Cocoa_HandleKeyEvent(_THIS, NSEvent *event)
+1 -1
View File
@@ -36,7 +36,7 @@ struct SDL_DisplayModeData
extern void Cocoa_InitModes(_THIS); extern void Cocoa_InitModes(_THIS);
extern int Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); extern int Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect);
extern int Cocoa_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); extern int Cocoa_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect);
extern void Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay *display); extern int Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay *display);
extern int Cocoa_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi); extern int Cocoa_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi);
extern int Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); extern int Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
extern void Cocoa_QuitModes(_THIS); extern void Cocoa_QuitModes(_THIS);
+2 -1
View File
@@ -473,7 +473,7 @@ int Cocoa_GetDisplayPhysicalDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, f
} }
} }
void Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay *display) int Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay *display)
{ {
SDL_DisplayData *data = display->driverdata; SDL_DisplayData *data = display->driverdata;
CVDisplayLinkRef link = NULL; CVDisplayLinkRef link = NULL;
@@ -529,6 +529,7 @@ void Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay *display)
} }
CVDisplayLinkRelease(link); CVDisplayLinkRelease(link);
return 0;
} }
static CGError SetDisplayModeForDisplay(CGDirectDisplayID display, SDL_DisplayModeData *data) static CGError SetDisplayModeForDisplay(CGDirectDisplayID display, SDL_DisplayModeData *data)
+2 -2
View File
@@ -289,9 +289,9 @@ static int Cocoa_WarpMouseGlobal(float x, float y)
return 0; return 0;
} }
static void Cocoa_WarpMouse(SDL_Window *window, float x, float y) static int Cocoa_WarpMouse(SDL_Window *window, float x, float y)
{ {
Cocoa_WarpMouseGlobal(window->x + x, window->y + y); return Cocoa_WarpMouseGlobal(window->x + x, window->y + y);
} }
static int Cocoa_SetRelativeMouseMode(SDL_bool enabled) static int Cocoa_SetRelativeMouseMode(SDL_bool enabled)
+1 -1
View File
@@ -78,7 +78,7 @@ extern int Cocoa_GL_MakeCurrent(_THIS, SDL_Window *window,
extern int Cocoa_GL_SetSwapInterval(_THIS, int interval); extern int Cocoa_GL_SetSwapInterval(_THIS, int interval);
extern int Cocoa_GL_GetSwapInterval(_THIS, int *interval); extern int Cocoa_GL_GetSwapInterval(_THIS, int *interval);
extern int Cocoa_GL_SwapWindow(_THIS, SDL_Window *window); extern int Cocoa_GL_SwapWindow(_THIS, SDL_Window *window);
extern void Cocoa_GL_DeleteContext(_THIS, SDL_GLContext context); extern int Cocoa_GL_DeleteContext(_THIS, SDL_GLContext context);
#ifdef __clang__ #ifdef __clang__
#pragma clang diagnostic pop #pragma clang diagnostic pop
+2 -1
View File
@@ -515,12 +515,13 @@ int Cocoa_GL_SwapWindow(_THIS, SDL_Window *window)
} }
} }
void Cocoa_GL_DeleteContext(_THIS, SDL_GLContext context) int Cocoa_GL_DeleteContext(_THIS, SDL_GLContext context)
{ {
@autoreleasepool { @autoreleasepool {
SDLOpenGLContext *nscontext = (SDLOpenGLContext *)CFBridgingRelease(context); SDLOpenGLContext *nscontext = (SDLOpenGLContext *)CFBridgingRelease(context);
[nscontext setWindow:NULL]; [nscontext setWindow:NULL];
} }
return 0;
} }
/* We still support OpenGL as long as Apple offers it, deprecated or not, so disable deprecation warnings about it. */ /* We still support OpenGL as long as Apple offers it, deprecated or not, so disable deprecation warnings about it. */
+1 -1
View File
@@ -39,7 +39,7 @@ extern int Cocoa_GLES_LoadLibrary(_THIS, const char *path);
extern SDL_GLContext Cocoa_GLES_CreateContext(_THIS, SDL_Window *window); extern SDL_GLContext Cocoa_GLES_CreateContext(_THIS, SDL_Window *window);
extern int Cocoa_GLES_SwapWindow(_THIS, SDL_Window *window); extern int Cocoa_GLES_SwapWindow(_THIS, SDL_Window *window);
extern int Cocoa_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); extern int Cocoa_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context);
extern void Cocoa_GLES_DeleteContext(_THIS, SDL_GLContext context); extern int Cocoa_GLES_DeleteContext(_THIS, SDL_GLContext context);
extern int Cocoa_GLES_SetupWindow(_THIS, SDL_Window *window); extern int Cocoa_GLES_SetupWindow(_THIS, SDL_Window *window);
extern SDL_EGLSurface Cocoa_GLES_GetEGLSurface(_THIS, SDL_Window *window); extern SDL_EGLSurface Cocoa_GLES_GetEGLSurface(_THIS, SDL_Window *window);
+2 -1
View File
@@ -92,12 +92,13 @@ Cocoa_GLES_CreateContext(_THIS, SDL_Window *window)
} }
} }
void Cocoa_GLES_DeleteContext(_THIS, SDL_GLContext context) int Cocoa_GLES_DeleteContext(_THIS, SDL_GLContext context)
{ {
@autoreleasepool { @autoreleasepool {
SDL_EGL_DeleteContext(_this, context); SDL_EGL_DeleteContext(_this, context);
Cocoa_GLES_UnloadLibrary(_this); Cocoa_GLES_UnloadLibrary(_this);
} }
return 0;
} }
int Cocoa_GLES_SwapWindow(_THIS, SDL_Window *window) int Cocoa_GLES_SwapWindow(_THIS, SDL_Window *window)

Some files were not shown because too many files have changed in this diff Show More