SDL_EventFilter functions now return SDL_bool

This commit is contained in:
Sam Lantinga
2024-08-06 07:36:42 -07:00
parent 57f9c6f7bb
commit 627cb8acd0
8 changed files with 20 additions and 18 deletions

View File

@@ -26,16 +26,16 @@
#include "SDL_mouse_c.h"
static int SDLCALL RemoveSupercededWindowEvents(void *userdata, SDL_Event *event)
static SDL_bool SDLCALL RemoveSupercededWindowEvents(void *userdata, SDL_Event *event)
{
SDL_Event *new_event = (SDL_Event *)userdata;
if (event->type == new_event->type &&
event->window.windowID == new_event->window.windowID) {
/* We're about to post a new move event, drop the old one */
return 0;
return SDL_FALSE;
}
return 1;
return SDL_TRUE;
}
int SDL_SendWindowEvent(SDL_Window *window, SDL_EventType windowevent,

View File

@@ -363,7 +363,7 @@ static void SDL_PrivateGamepadRemapped(SDL_JoystickID instance_id)
/*
* Event filter to fire gamepad events from joystick ones
*/
static int SDLCALL SDL_GamepadEventWatcher(void *userdata, SDL_Event *event)
static SDL_bool SDLCALL SDL_GamepadEventWatcher(void *userdata, SDL_Event *event)
{
SDL_Gamepad *gamepad;
@@ -422,7 +422,7 @@ static int SDLCALL SDL_GamepadEventWatcher(void *userdata, SDL_Event *event)
break;
}
return 1;
return SDL_TRUE;
}
/* SDL defines sensor orientation relative to the device natural

View File

@@ -69,7 +69,7 @@ static void SDL_DispatchMainCallbackEvents(void)
}
}
static int SDLCALL SDL_MainCallbackEventWatcher(void *userdata, SDL_Event *event)
static SDL_bool SDLCALL SDL_MainCallbackEventWatcher(void *userdata, SDL_Event *event)
{
if (ShouldDispatchImmediately(event)) {
// Make sure any currently queued events are processed then dispatch this before continuing
@@ -78,7 +78,7 @@ static int SDLCALL SDL_MainCallbackEventWatcher(void *userdata, SDL_Event *event
} else {
// We'll process this event later from the main event queue
}
return 0;
return SDL_TRUE;
}
SDL_bool SDL_HasMainCallbacks(void)

View File

@@ -818,7 +818,7 @@ const char *SDL_GetRenderDriver(int index)
#endif
}
static int SDLCALL SDL_RendererEventWatch(void *userdata, SDL_Event *event)
static SDL_bool SDLCALL SDL_RendererEventWatch(void *userdata, SDL_Event *event)
{
SDL_Renderer *renderer = (SDL_Renderer *)userdata;
@@ -855,7 +855,7 @@ static int SDLCALL SDL_RendererEventWatch(void *userdata, SDL_Event *event)
UpdateHDRProperties(renderer);
}
return 0;
return SDL_TRUE;
}
int SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer)