mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-27 17:54:18 +00:00
Displays are now referenced by instance ID instead of index
This commit is contained in:
@@ -107,7 +107,6 @@ static int RPI_ShowCursor(SDL_Cursor *cursor)
|
||||
RPI_CursorData *curdata;
|
||||
VC_RECT_T src_rect, dst_rect;
|
||||
SDL_Mouse *mouse;
|
||||
SDL_VideoDisplay *display;
|
||||
SDL_DisplayData *data;
|
||||
VC_DISPMANX_ALPHA_T alpha = { DISPMANX_FLAGS_ALPHA_FROM_SOURCE /* flags */, 255 /*opacity 0->255*/, 0 /* mask */ };
|
||||
uint32_t layer = SDL_RPI_MOUSELAYER;
|
||||
@@ -147,12 +146,7 @@ static int RPI_ShowCursor(SDL_Cursor *cursor)
|
||||
return -1;
|
||||
}
|
||||
|
||||
display = SDL_GetDisplayForWindow(mouse->focus);
|
||||
if (display == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
data = (SDL_DisplayData *)display->driverdata;
|
||||
data = SDL_GetDisplayDriverDataForWindow(mouse->focus);
|
||||
if (data == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ int RPI_GLES_LoadLibrary(_THIS, const char *path)
|
||||
|
||||
int RPI_GLES_SwapWindow(_THIS, SDL_Window *window)
|
||||
{
|
||||
SDL_WindowData *wdata = ((SDL_WindowData *)window->driverdata);
|
||||
SDL_WindowData *wdata = window->driverdata;
|
||||
|
||||
if (!(_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, wdata->egl_surface))) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "eglSwapBuffers failed.");
|
||||
|
||||
@@ -227,7 +227,7 @@ int RPI_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
|
||||
|
||||
static void RPI_vsync_callback(DISPMANX_UPDATE_HANDLE_T u, void *data)
|
||||
{
|
||||
SDL_WindowData *wdata = ((SDL_WindowData *)data);
|
||||
SDL_WindowData *wdata = (SDL_WindowData *)data;
|
||||
|
||||
SDL_LockMutex(wdata->vsync_cond_mutex);
|
||||
SDL_CondSignal(wdata->vsync_cond);
|
||||
@@ -256,8 +256,8 @@ int RPI_CreateWindow(_THIS, SDL_Window *window)
|
||||
if (wdata == NULL) {
|
||||
return SDL_OutOfMemory();
|
||||
}
|
||||
display = SDL_GetDisplayForWindow(window);
|
||||
displaydata = (SDL_DisplayData *)display->driverdata;
|
||||
display = SDL_GetVideoDisplayForWindow(window);
|
||||
displaydata = display->driverdata;
|
||||
|
||||
/* Windows have one size for now */
|
||||
window->w = display->desktop_mode.w;
|
||||
@@ -330,9 +330,8 @@ int RPI_CreateWindow(_THIS, SDL_Window *window)
|
||||
|
||||
void RPI_DestroyWindow(_THIS, SDL_Window *window)
|
||||
{
|
||||
SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
|
||||
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
|
||||
SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata;
|
||||
SDL_WindowData *data = window->driverdata;
|
||||
SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window);
|
||||
|
||||
if (data) {
|
||||
if (data->double_buffer) {
|
||||
|
||||
@@ -28,17 +28,17 @@
|
||||
#include <bcm_host.h>
|
||||
#include <SDL3/SDL_egl.h>
|
||||
|
||||
typedef struct SDL_VideoData
|
||||
struct SDL_VideoData
|
||||
{
|
||||
uint32_t egl_refcount; /* OpenGL ES reference count */
|
||||
} SDL_VideoData;
|
||||
};
|
||||
|
||||
typedef struct SDL_DisplayData
|
||||
struct SDL_DisplayData
|
||||
{
|
||||
DISPMANX_DISPLAY_HANDLE_T dispman_display;
|
||||
} SDL_DisplayData;
|
||||
};
|
||||
|
||||
typedef struct SDL_WindowData
|
||||
struct SDL_WindowData
|
||||
{
|
||||
EGL_DISPMANX_WINDOW_T dispman_window;
|
||||
#if SDL_VIDEO_OPENGL_EGL
|
||||
@@ -49,8 +49,7 @@ typedef struct SDL_WindowData
|
||||
SDL_cond *vsync_cond;
|
||||
SDL_mutex *vsync_cond_mutex;
|
||||
SDL_bool double_buffer;
|
||||
|
||||
} SDL_WindowData;
|
||||
};
|
||||
|
||||
#define SDL_RPI_VIDEOLAYER 10000 /* High enough so to occlude everything */
|
||||
#define SDL_RPI_MOUSELAYER SDL_RPI_VIDEOLAYER + 1
|
||||
|
||||
Reference in New Issue
Block a user