mirror of
https://github.com/encounter/SDL.git
synced 2025-12-14 07:36:09 +00:00
SDL_WarpMouseGlobal() should return non-void.
There are platforms it isn't implemented on (and currently can't be implemented on!), and there's currently no way for an app to know this. This shouldn't break ABI on apps that moved to a revision between 2.0.3 and 2.0.4.
This commit is contained in:
@@ -216,18 +216,18 @@ RPI_WarpMouse(SDL_Window * window, int x, int y)
|
||||
}
|
||||
|
||||
/* Warp the mouse to (x,y) */
|
||||
static void
|
||||
static int
|
||||
RPI_WarpMouseGlobal(int x, int y)
|
||||
{
|
||||
RPI_CursorData *curdata;
|
||||
DISPMANX_UPDATE_HANDLE_T update;
|
||||
int ret;
|
||||
VC_RECT_T dst_rect;
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
if (mouse != NULL && mouse->cur_cursor != NULL && mouse->cur_cursor->driverdata != NULL) {
|
||||
curdata = (RPI_CursorData *) mouse->cur_cursor->driverdata;
|
||||
if (curdata->element != DISPMANX_NO_HANDLE) {
|
||||
int ret;
|
||||
update = vc_dispmanx_update_start( 10 );
|
||||
SDL_assert( update );
|
||||
vc_dispmanx_rect_set( &dst_rect, x, y, curdata->w, curdata->h);
|
||||
@@ -245,8 +245,11 @@ RPI_WarpMouseGlobal(int x, int y)
|
||||
/* Submit asynchronously, otherwise the peformance suffers a lot */
|
||||
ret = vc_dispmanx_update_submit( update, 0, NULL );
|
||||
SDL_assert( ret == DISPMANX_SUCCESS );
|
||||
return (ret == DISPMANX_SUCCESS) ? 0 : -1;
|
||||
}
|
||||
}
|
||||
|
||||
return -1; /* !!! FIXME: this should SDL_SetError() somewhere. */
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user