update sdl to 2.32.6

This commit is contained in:
AzaezelX 2025-05-24 13:39:03 -05:00
parent e557f5962b
commit ddc1f8c1e2
1339 changed files with 53966 additions and 19207 deletions

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -21,7 +21,7 @@
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_RPI
#ifdef SDL_VIDEO_DRIVER_RPI
#include "../../events/SDL_events_c.h"
#include "../../events/SDL_keyboard_c.h"

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -25,7 +25,5 @@
#include "SDL_rpivideo.h"
void RPI_PumpEvents(_THIS);
void RPI_EventInit(_THIS);
void RPI_EventQuit(_THIS);
#endif /* SDL_rpievents_c_h_ */

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_RPI
#ifdef SDL_VIDEO_DRIVER_RPI
#include "SDL_surface.h"
#include "SDL_hints.h"
@ -70,12 +70,12 @@ static SDL_Cursor *RPI_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y)
SDL_assert(surface->pitch == surface->w * 4);
cursor = (SDL_Cursor *)SDL_calloc(1, sizeof(*cursor));
if (cursor == NULL) {
if (!cursor) {
SDL_OutOfMemory();
return NULL;
}
curdata = (RPI_CursorData *)SDL_calloc(1, sizeof(*curdata));
if (curdata == NULL) {
if (!curdata) {
SDL_OutOfMemory();
SDL_free(cursor);
return NULL;
@ -119,12 +119,12 @@ static int RPI_ShowCursor(SDL_Cursor *cursor)
const char *env;
mouse = SDL_GetMouse();
if (mouse == NULL) {
if (!mouse) {
return -1;
}
if (cursor != global_cursor) {
if (global_cursor != NULL) {
if (global_cursor) {
curdata = (RPI_CursorData *)global_cursor->driverdata;
if (curdata && curdata->element > DISPMANX_NO_HANDLE) {
update = vc_dispmanx_update_start(0);
@ -139,26 +139,26 @@ static int RPI_ShowCursor(SDL_Cursor *cursor)
global_cursor = cursor;
}
if (cursor == NULL) {
if (!cursor) {
return 0;
}
curdata = (RPI_CursorData *)cursor->driverdata;
if (curdata == NULL) {
if (!curdata) {
return -1;
}
if (mouse->focus == NULL) {
if (!mouse->focus) {
return -1;
}
display = SDL_GetDisplayForWindow(mouse->focus);
if (display == NULL) {
if (!display) {
return -1;
}
data = (SDL_DisplayData *)display->driverdata;
if (data == NULL) {
if (!data) {
return -1;
}
@ -199,10 +199,10 @@ static void RPI_FreeCursor(SDL_Cursor *cursor)
DISPMANX_UPDATE_HANDLE_T update;
RPI_CursorData *curdata;
if (cursor != NULL) {
if (cursor) {
curdata = (RPI_CursorData *)cursor->driverdata;
if (curdata != NULL) {
if (curdata) {
if (curdata->element != DISPMANX_NO_HANDLE) {
update = vc_dispmanx_update_start(0);
SDL_assert(update);
@ -242,7 +242,7 @@ static int RPI_WarpMouseGlobal(int x, int y)
VC_RECT_T src_rect;
SDL_Mouse *mouse = SDL_GetMouse();
if (mouse == NULL || mouse->cur_cursor == NULL || mouse->cur_cursor->driverdata == NULL) {
if (!mouse || !mouse->cur_cursor || !mouse->cur_cursor->driverdata) {
return 0;
}
@ -300,7 +300,7 @@ static int RPI_WarpMouseGlobalGraphicOnly(int x, int y)
VC_RECT_T src_rect;
SDL_Mouse *mouse = SDL_GetMouse();
if (mouse == NULL || mouse->cur_cursor == NULL || mouse->cur_cursor->driverdata == NULL) {
if (!mouse || !mouse->cur_cursor || !mouse->cur_cursor->driverdata) {
return 0;
}

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -22,7 +22,7 @@
#include "SDL_hints.h"
#if SDL_VIDEO_DRIVER_RPI && SDL_VIDEO_OPENGL_EGL
#if defined(SDL_VIDEO_DRIVER_RPI) && defined(SDL_VIDEO_OPENGL_EGL)
#include "SDL_rpivideo.h"
#include "SDL_rpiopengles.h"

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -23,7 +23,7 @@
#ifndef SDL_rpiopengles_h_
#define SDL_rpiopengles_h_
#if SDL_VIDEO_DRIVER_RPI && SDL_VIDEO_OPENGL_EGL
#if defined(SDL_VIDEO_DRIVER_RPI) && defined(SDL_VIDEO_OPENGL_EGL)
#include "../SDL_sysvideo.h"
#include "../SDL_egl_c.h"

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -21,7 +21,7 @@
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_RPI
#ifdef SDL_VIDEO_DRIVER_RPI
/* References
* http://elinux.org/RPi_VideoCore_APIs
@ -56,7 +56,7 @@ static void RPI_Destroy(SDL_VideoDevice *device)
SDL_free(device);
}
static int RPI_GetRefreshRate()
static int RPI_GetRefreshRate(void)
{
TV_DISPLAY_STATE_T tvstate;
if (vc_tv_get_display_state(&tvstate) == 0) {
@ -77,14 +77,14 @@ static SDL_VideoDevice *RPI_Create()
/* Initialize SDL_VideoDevice structure */
device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice));
if (device == NULL) {
if (!device) {
SDL_OutOfMemory();
return NULL;
}
/* Initialize internal data */
phdata = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData));
if (phdata == NULL) {
if (!phdata) {
SDL_OutOfMemory();
SDL_free(device);
return NULL;
@ -138,7 +138,8 @@ static SDL_VideoDevice *RPI_Create()
VideoBootStrap RPI_bootstrap = {
"RPI",
"RPI Video Driver",
RPI_Create
RPI_Create,
NULL /* no ShowMessageBox implementation */
};
/*****************************************************************************/
@ -179,7 +180,7 @@ static void AddDispManXDisplay(const int display_id)
/* Allocate display internal data */
data = (SDL_DisplayData *)SDL_calloc(1, sizeof(SDL_DisplayData));
if (data == NULL) {
if (!data) {
vc_dispmanx_display_close(handle);
return; /* oh well */
}
@ -256,7 +257,7 @@ int RPI_CreateWindow(_THIS, SDL_Window *window)
/* Allocate window internal data */
wdata = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData));
if (wdata == NULL) {
if (!wdata) {
return SDL_OutOfMemory();
}
display = SDL_GetDisplayForWindow(window);
@ -350,7 +351,7 @@ void RPI_DestroyWindow(_THIS, SDL_Window *window)
SDL_DestroyMutex(data->vsync_cond_mutex);
}
#if SDL_VIDEO_OPENGL_EGL
#ifdef SDL_VIDEO_OPENGL_EGL
if (data->egl_surface != EGL_NO_SURFACE) {
SDL_EGL_DestroySurface(_this, data->egl_surface);
}

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -30,6 +30,14 @@
#include "EGL/egl.h"
#include "EGL/eglext.h"
/* This must match the definition of EGL_DISPMANX_WINDOW_T in EGL/eglplatform.h,
and is defined here to allow compiling with standard headers. */
typedef struct {
DISPMANX_ELEMENT_HANDLE_T element;
int width;
int height;
} SDL_EGL_DISPMANX_WINDOW_T;
typedef struct SDL_VideoData
{
uint32_t egl_refcount; /* OpenGL ES reference count */
@ -42,8 +50,8 @@ typedef struct SDL_DisplayData
typedef struct SDL_WindowData
{
EGL_DISPMANX_WINDOW_T dispman_window;
#if SDL_VIDEO_OPENGL_EGL
SDL_EGL_DISPMANX_WINDOW_T dispman_window;
#ifdef SDL_VIDEO_OPENGL_EGL
EGLSurface egl_surface;
#endif