Remove _THIS in src/video and in src/events (also VideoDevice)

This commit is contained in:
Sylvain 2023-05-09 12:55:11 +02:00 committed by Ryan C. Gordon
parent df314ba93e
commit 81ff49f4b5
237 changed files with 1670 additions and 1671 deletions

View file

@ -900,7 +900,7 @@ static SDL_bool SDL_events_need_periodic_poll(void)
return need_periodic_poll; return need_periodic_poll;
} }
static int SDL_WaitEventTimeout_Device(_THIS, SDL_Window *wakeup_window, SDL_Event *event, Uint64 start, Sint64 timeoutNS) static int SDL_WaitEventTimeout_Device(SDL_VideoDevice *_this, SDL_Window *wakeup_window, SDL_Event *event, Uint64 start, Sint64 timeoutNS)
{ {
Sint64 loop_timeoutNS = timeoutNS; Sint64 loop_timeoutNS = timeoutNS;
SDL_bool need_periodic_poll = SDL_events_need_periodic_poll(); SDL_bool need_periodic_poll = SDL_events_need_periodic_poll();

View file

@ -176,7 +176,7 @@ int SDL_EGL_SetErrorEx(const char *message, const char *eglFunctionName, EGLint
/* EGL implementation of SDL OpenGL ES support */ /* EGL implementation of SDL OpenGL ES support */
SDL_bool SDL_EGL_HasExtension(_THIS, SDL_EGL_ExtensionType type, const char *ext) SDL_bool SDL_EGL_HasExtension(SDL_VideoDevice *_this, SDL_EGL_ExtensionType type, const char *ext)
{ {
size_t ext_len; size_t ext_len;
const char *ext_override; const char *ext_override;
@ -248,7 +248,7 @@ SDL_bool SDL_EGL_HasExtension(_THIS, SDL_EGL_ExtensionType type, const char *ext
return SDL_FALSE; return SDL_FALSE;
} }
SDL_FunctionPointer SDL_EGL_GetProcAddressInternal(_THIS, const char *proc) SDL_FunctionPointer SDL_EGL_GetProcAddressInternal(SDL_VideoDevice *_this, const char *proc)
{ {
SDL_FunctionPointer retval = NULL; SDL_FunctionPointer retval = NULL;
if (_this->egl_data != NULL) { if (_this->egl_data != NULL) {
@ -275,7 +275,7 @@ SDL_FunctionPointer SDL_EGL_GetProcAddressInternal(_THIS, const char *proc)
return retval; return retval;
} }
void SDL_EGL_UnloadLibrary(_THIS) void SDL_EGL_UnloadLibrary(SDL_VideoDevice *_this)
{ {
if (_this->egl_data) { if (_this->egl_data) {
if (_this->egl_data->egl_display) { if (_this->egl_data->egl_display) {
@ -297,7 +297,7 @@ void SDL_EGL_UnloadLibrary(_THIS)
} }
} }
static int SDL_EGL_LoadLibraryInternal(_THIS, const char *egl_path) static int SDL_EGL_LoadLibraryInternal(SDL_VideoDevice *_this, const char *egl_path)
{ {
void *egl_dll_handle = NULL, *opengl_dll_handle = NULL; void *egl_dll_handle = NULL, *opengl_dll_handle = NULL;
const char *path = NULL; const char *path = NULL;
@ -468,7 +468,7 @@ static int SDL_EGL_LoadLibraryInternal(_THIS, const char *egl_path)
return 0; return 0;
} }
int SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path) int SDL_EGL_LoadLibraryOnly(SDL_VideoDevice *_this, const char *egl_path)
{ {
if (_this->egl_data) { if (_this->egl_data) {
return SDL_SetError("EGL context already created"); return SDL_SetError("EGL context already created");
@ -487,7 +487,7 @@ int SDL_EGL_LoadLibraryOnly(_THIS, const char *egl_path)
return 0; return 0;
} }
static void SDL_EGL_GetVersion(_THIS) static void SDL_EGL_GetVersion(SDL_VideoDevice *_this)
{ {
if (_this->egl_data->eglQueryString) { if (_this->egl_data->eglQueryString) {
const char *egl_version = _this->egl_data->eglQueryString(_this->egl_data->egl_display, EGL_VERSION); const char *egl_version = _this->egl_data->eglQueryString(_this->egl_data->egl_display, EGL_VERSION);
@ -503,7 +503,7 @@ static void SDL_EGL_GetVersion(_THIS)
} }
} }
int SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_display, EGLenum platform) int SDL_EGL_LoadLibrary(SDL_VideoDevice *_this, const char *egl_path, NativeDisplayType native_display, EGLenum platform)
{ {
int library_load_retcode = SDL_EGL_LoadLibraryOnly(_this, egl_path); int library_load_retcode = SDL_EGL_LoadLibraryOnly(_this, egl_path);
if (library_load_retcode != 0) { if (library_load_retcode != 0) {
@ -583,7 +583,7 @@ int SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_di
valid available GPU for EGL to use. valid available GPU for EGL to use.
*/ */
int SDL_EGL_InitializeOffscreen(_THIS, int device) int SDL_EGL_InitializeOffscreen(SDL_VideoDevice *_this, int device)
{ {
void *egl_devices[SDL_EGL_MAX_DEVICES]; void *egl_devices[SDL_EGL_MAX_DEVICES];
EGLint num_egl_devices = 0; EGLint num_egl_devices = 0;
@ -661,7 +661,7 @@ int SDL_EGL_InitializeOffscreen(_THIS, int device)
return 0; return 0;
} }
void SDL_EGL_SetRequiredVisualId(_THIS, int visual_id) void SDL_EGL_SetRequiredVisualId(SDL_VideoDevice *_this, int visual_id)
{ {
_this->egl_data->egl_required_visual_id = visual_id; _this->egl_data->egl_required_visual_id = visual_id;
} }
@ -715,7 +715,7 @@ static Attribute all_attributes[] = {
ATTRIBUTE(EGL_CONFORMANT), ATTRIBUTE(EGL_CONFORMANT),
}; };
static void dumpconfig(_THIS, EGLConfig config) static void dumpconfig(SDL_VideoDevice *_this, EGLConfig config)
{ {
int attr; int attr;
for (attr = 0; attr < sizeof(all_attributes) / sizeof(Attribute); attr++) { for (attr = 0; attr < sizeof(all_attributes) / sizeof(Attribute); attr++) {
@ -727,7 +727,7 @@ static void dumpconfig(_THIS, EGLConfig config)
#endif /* DUMP_EGL_CONFIG */ #endif /* DUMP_EGL_CONFIG */
static int SDL_EGL_PrivateChooseConfig(_THIS, SDL_bool set_config_caveat_none) static int SDL_EGL_PrivateChooseConfig(SDL_VideoDevice *_this, SDL_bool set_config_caveat_none)
{ {
/* 64 seems nice. */ /* 64 seems nice. */
EGLint attribs[64]; EGLint attribs[64];
@ -925,7 +925,7 @@ static int SDL_EGL_PrivateChooseConfig(_THIS, SDL_bool set_config_caveat_none)
return 0; return 0;
} }
int SDL_EGL_ChooseConfig(_THIS) int SDL_EGL_ChooseConfig(SDL_VideoDevice *_this)
{ {
int ret; int ret;
@ -950,7 +950,7 @@ int SDL_EGL_ChooseConfig(_THIS)
} }
SDL_GLContext SDL_GLContext
SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface) SDL_EGL_CreateContext(SDL_VideoDevice *_this, EGLSurface egl_surface)
{ {
/* max 16 key+value pairs plus terminator. */ /* max 16 key+value pairs plus terminator. */
EGLint attribs[33]; EGLint attribs[33];
@ -1123,7 +1123,7 @@ SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface)
return (SDL_GLContext)egl_context; return (SDL_GLContext)egl_context;
} }
int SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context) int SDL_EGL_MakeCurrent(SDL_VideoDevice *_this, EGLSurface egl_surface, SDL_GLContext context)
{ {
EGLContext egl_context = (EGLContext)context; EGLContext egl_context = (EGLContext)context;
@ -1160,7 +1160,7 @@ int SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context)
return 0; return 0;
} }
int SDL_EGL_SetSwapInterval(_THIS, int interval) int SDL_EGL_SetSwapInterval(SDL_VideoDevice *_this, int interval)
{ {
EGLBoolean status; EGLBoolean status;
@ -1184,7 +1184,7 @@ int SDL_EGL_SetSwapInterval(_THIS, int interval)
return SDL_EGL_SetError("Unable to set the EGL swap interval", "eglSwapInterval"); return SDL_EGL_SetError("Unable to set the EGL swap interval", "eglSwapInterval");
} }
int SDL_EGL_GetSwapInterval(_THIS, int *interval) int SDL_EGL_GetSwapInterval(SDL_VideoDevice *_this, int *interval)
{ {
if (!_this->egl_data) { if (!_this->egl_data) {
return SDL_SetError("EGL not initialized"); return SDL_SetError("EGL not initialized");
@ -1194,7 +1194,7 @@ int SDL_EGL_GetSwapInterval(_THIS, int *interval)
return 0; return 0;
} }
int SDL_EGL_SwapBuffers(_THIS, EGLSurface egl_surface) int SDL_EGL_SwapBuffers(SDL_VideoDevice *_this, EGLSurface egl_surface)
{ {
if (!_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, egl_surface)) { if (!_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, egl_surface)) {
return SDL_EGL_SetError("unable to show color buffer in an OS-native window", "eglSwapBuffers"); return SDL_EGL_SetError("unable to show color buffer in an OS-native window", "eglSwapBuffers");
@ -1202,7 +1202,7 @@ int SDL_EGL_SwapBuffers(_THIS, EGLSurface egl_surface)
return 0; return 0;
} }
int SDL_EGL_DeleteContext(_THIS, SDL_GLContext context) int SDL_EGL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context)
{ {
EGLContext egl_context = (EGLContext)context; EGLContext egl_context = (EGLContext)context;
@ -1218,7 +1218,7 @@ int SDL_EGL_DeleteContext(_THIS, SDL_GLContext context)
} }
EGLSurface * EGLSurface *
SDL_EGL_CreateSurface(_THIS, SDL_Window *window, NativeWindowType nw) SDL_EGL_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, NativeWindowType nw)
{ {
#ifdef SDL_VIDEO_DRIVER_ANDROID #ifdef SDL_VIDEO_DRIVER_ANDROID
EGLint format_wanted; EGLint format_wanted;
@ -1311,7 +1311,7 @@ SDL_EGL_CreateSurface(_THIS, SDL_Window *window, NativeWindowType nw)
} }
EGLSurface EGLSurface
SDL_EGL_CreateOffscreenSurface(_THIS, int width, int height) SDL_EGL_CreateOffscreenSurface(SDL_VideoDevice *_this, int width, int height)
{ {
EGLint attributes[] = { EGLint attributes[] = {
EGL_WIDTH, 0, EGL_WIDTH, 0,
@ -1331,7 +1331,7 @@ SDL_EGL_CreateOffscreenSurface(_THIS, int width, int height)
attributes); attributes);
} }
void SDL_EGL_DestroySurface(_THIS, EGLSurface egl_surface) void SDL_EGL_DestroySurface(SDL_VideoDevice *_this, EGLSurface egl_surface)
{ {
if (!_this->egl_data) { if (!_this->egl_data) {
return; return;

View file

@ -114,32 +114,32 @@ typedef enum SDL_EGL_ExtensionType
SDL_EGL_CLIENT_EXTENSION SDL_EGL_CLIENT_EXTENSION
} SDL_EGL_ExtensionType; } SDL_EGL_ExtensionType;
extern SDL_bool SDL_EGL_HasExtension(_THIS, SDL_EGL_ExtensionType type, const char *ext); extern SDL_bool SDL_EGL_HasExtension(SDL_VideoDevice *_this, SDL_EGL_ExtensionType type, const char *ext);
extern int SDL_EGL_GetAttribute(_THIS, SDL_GLattr attrib, int *value); extern int SDL_EGL_GetAttribute(SDL_VideoDevice *_this, SDL_GLattr attrib, int *value);
/* SDL_EGL_LoadLibrary can get a display for a specific platform (EGL_PLATFORM_*) /* SDL_EGL_LoadLibrary can get a display for a specific platform (EGL_PLATFORM_*)
* or, if 0 is passed, let the implementation decide. * or, if 0 is passed, let the implementation decide.
*/ */
extern int SDL_EGL_LoadLibraryOnly(_THIS, const char *path); extern int SDL_EGL_LoadLibraryOnly(SDL_VideoDevice *_this, const char *path);
extern int SDL_EGL_LoadLibrary(_THIS, const char *path, NativeDisplayType native_display, EGLenum platform); extern int SDL_EGL_LoadLibrary(SDL_VideoDevice *_this, const char *path, NativeDisplayType native_display, EGLenum platform);
extern SDL_FunctionPointer SDL_EGL_GetProcAddressInternal(_THIS, const char *proc); extern SDL_FunctionPointer SDL_EGL_GetProcAddressInternal(SDL_VideoDevice *_this, const char *proc);
extern void SDL_EGL_UnloadLibrary(_THIS); extern void SDL_EGL_UnloadLibrary(SDL_VideoDevice *_this);
extern void SDL_EGL_SetRequiredVisualId(_THIS, int visual_id); extern void SDL_EGL_SetRequiredVisualId(SDL_VideoDevice *_this, int visual_id);
extern int SDL_EGL_ChooseConfig(_THIS); extern int SDL_EGL_ChooseConfig(SDL_VideoDevice *_this);
extern int SDL_EGL_SetSwapInterval(_THIS, int interval); extern int SDL_EGL_SetSwapInterval(SDL_VideoDevice *_this, int interval);
extern int SDL_EGL_GetSwapInterval(_THIS, int *interval); extern int SDL_EGL_GetSwapInterval(SDL_VideoDevice *_this, int *interval);
extern int SDL_EGL_DeleteContext(_THIS, SDL_GLContext context); extern int SDL_EGL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context);
extern EGLSurface *SDL_EGL_CreateSurface(_THIS, SDL_Window *window, NativeWindowType nw); extern EGLSurface *SDL_EGL_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, NativeWindowType nw);
extern void SDL_EGL_DestroySurface(_THIS, EGLSurface egl_surface); extern void SDL_EGL_DestroySurface(SDL_VideoDevice *_this, EGLSurface egl_surface);
extern EGLSurface SDL_EGL_CreateOffscreenSurface(_THIS, int width, int height); extern EGLSurface SDL_EGL_CreateOffscreenSurface(SDL_VideoDevice *_this, int width, int height);
/* Assumes that LoadLibraryOnly() has succeeded */ /* Assumes that LoadLibraryOnly() has succeeded */
extern int SDL_EGL_InitializeOffscreen(_THIS, int device); extern int SDL_EGL_InitializeOffscreen(SDL_VideoDevice *_this, int device);
/* These need to be wrapped to get the surface for the window by the platform GLES implementation */ /* These need to be wrapped to get the surface for the window by the platform GLES implementation */
extern SDL_GLContext SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface); extern SDL_GLContext SDL_EGL_CreateContext(SDL_VideoDevice *_this, EGLSurface egl_surface);
extern int SDL_EGL_MakeCurrent(_THIS, EGLSurface egl_surface, SDL_GLContext context); extern int SDL_EGL_MakeCurrent(SDL_VideoDevice *_this, EGLSurface egl_surface, SDL_GLContext context);
extern int SDL_EGL_SwapBuffers(_THIS, EGLSurface egl_surface); extern int SDL_EGL_SwapBuffers(SDL_VideoDevice *_this, EGLSurface egl_surface);
/* SDL Error-reporting */ /* SDL Error-reporting */
extern int SDL_EGL_SetErrorEx(const char *message, const char *eglFunctionName, EGLint eglErrorCode); extern int SDL_EGL_SetErrorEx(const char *message, const char *eglFunctionName, EGLint eglErrorCode);
@ -148,19 +148,19 @@ extern int SDL_EGL_SetErrorEx(const char *message, const char *eglFunctionName,
/* A few of useful macros */ /* A few of useful macros */
#define SDL_EGL_SwapWindow_impl(BACKEND) \ #define SDL_EGL_SwapWindow_impl(BACKEND) \
int BACKEND##_GLES_SwapWindow(_THIS, SDL_Window *window) \ int BACKEND##_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) \
{ \ { \
return SDL_EGL_SwapBuffers(_this, window->driverdata->egl_surface); \ return SDL_EGL_SwapBuffers(_this, window->driverdata->egl_surface); \
} }
#define SDL_EGL_MakeCurrent_impl(BACKEND) \ #define SDL_EGL_MakeCurrent_impl(BACKEND) \
int BACKEND##_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) \ int BACKEND##_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) \
{ \ { \
return SDL_EGL_MakeCurrent(_this, window ? window->driverdata->egl_surface : EGL_NO_SURFACE, context); \ return SDL_EGL_MakeCurrent(_this, window ? window->driverdata->egl_surface : EGL_NO_SURFACE, context); \
} }
#define SDL_EGL_CreateContext_impl(BACKEND) \ #define SDL_EGL_CreateContext_impl(BACKEND) \
SDL_GLContext BACKEND##_GLES_CreateContext(_THIS, SDL_Window *window) \ SDL_GLContext BACKEND##_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) \
{ \ { \
return SDL_EGL_CreateContext(_this, window->driverdata->egl_surface); \ return SDL_EGL_CreateContext(_this, window->driverdata->egl_surface); \
} }

View file

@ -155,9 +155,6 @@ struct SDL_VideoDisplay
/* Forward declaration */ /* Forward declaration */
struct SDL_SysWMinfo; struct SDL_SysWMinfo;
/* Define the SDL video driver structure */
#define _THIS SDL_VideoDevice *_this
/* Video device flags */ /* Video device flags */
typedef enum typedef enum
{ {
@ -179,18 +176,18 @@ struct SDL_VideoDevice
* Initialize the native video subsystem, filling in the list of * Initialize the native video subsystem, filling in the list of
* displays for this driver, returning 0 or -1 if there's an error. * displays for this driver, returning 0 or -1 if there's an error.
*/ */
int (*VideoInit)(_THIS); int (*VideoInit)(SDL_VideoDevice *_this);
/* /*
* Reverse the effects VideoInit() -- called if VideoInit() fails or * Reverse the effects VideoInit() -- called if VideoInit() fails or
* if the application is shutting down the video subsystem. * if the application is shutting down the video subsystem.
*/ */
void (*VideoQuit)(_THIS); void (*VideoQuit)(SDL_VideoDevice *_this);
/* /*
* Reinitialize the touch devices -- called if an unknown touch ID occurs. * Reinitialize the touch devices -- called if an unknown touch ID occurs.
*/ */
void (*ResetTouch)(_THIS); void (*ResetTouch)(SDL_VideoDevice *_this);
/* * * */ /* * * */
/* /*
@ -200,22 +197,22 @@ struct SDL_VideoDevice
/* /*
* Refresh the display list * Refresh the display list
*/ */
void (*RefreshDisplays)(_THIS); void (*RefreshDisplays)(SDL_VideoDevice *_this);
/* /*
* Get the bounds of a display * Get the bounds of a display
*/ */
int (*GetDisplayBounds)(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); int (*GetDisplayBounds)(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect);
/* /*
* Get the usable bounds of a display (bounds minus menubar or whatever) * Get the usable bounds of a display (bounds minus menubar or whatever)
*/ */
int (*GetDisplayUsableBounds)(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); int (*GetDisplayUsableBounds)(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect);
/* /*
* Get a list of the available display modes for a display. * Get a list of the available display modes for a display.
*/ */
int (*GetDisplayModes)(_THIS, SDL_VideoDisplay *display); int (*GetDisplayModes)(SDL_VideoDevice *_this, SDL_VideoDisplay *display);
/* /*
* Setting the display mode is independent of creating windows, so * Setting the display mode is independent of creating windows, so
@ -223,46 +220,46 @@ struct SDL_VideoDevice
* their data updated accordingly, including the display surfaces * their data updated accordingly, including the display surfaces
* associated with them. * associated with them.
*/ */
int (*SetDisplayMode)(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); int (*SetDisplayMode)(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
/* * * */ /* * * */
/* /*
* Window functions * Window functions
*/ */
int (*CreateSDLWindow)(_THIS, SDL_Window *window); int (*CreateSDLWindow)(SDL_VideoDevice *_this, SDL_Window *window);
int (*CreateSDLWindowFrom)(_THIS, SDL_Window *window, const void *data); int (*CreateSDLWindowFrom)(SDL_VideoDevice *_this, SDL_Window *window, const void *data);
void (*SetWindowTitle)(_THIS, SDL_Window *window); void (*SetWindowTitle)(SDL_VideoDevice *_this, SDL_Window *window);
int (*SetWindowIcon)(_THIS, SDL_Window *window, SDL_Surface *icon); int (*SetWindowIcon)(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon);
int (*SetWindowPosition)(_THIS, SDL_Window *window); int (*SetWindowPosition)(SDL_VideoDevice *_this, SDL_Window *window);
void (*SetWindowSize)(_THIS, SDL_Window *window); void (*SetWindowSize)(SDL_VideoDevice *_this, SDL_Window *window);
void (*SetWindowMinimumSize)(_THIS, SDL_Window *window); void (*SetWindowMinimumSize)(SDL_VideoDevice *_this, SDL_Window *window);
void (*SetWindowMaximumSize)(_THIS, SDL_Window *window); void (*SetWindowMaximumSize)(SDL_VideoDevice *_this, SDL_Window *window);
int (*GetWindowBordersSize)(_THIS, SDL_Window *window, int *top, int *left, int *bottom, int *right); int (*GetWindowBordersSize)(SDL_VideoDevice *_this, SDL_Window *window, int *top, int *left, int *bottom, int *right);
void (*GetWindowSizeInPixels)(_THIS, SDL_Window *window, int *w, int *h); void (*GetWindowSizeInPixels)(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h);
int (*SetWindowOpacity)(_THIS, SDL_Window *window, float opacity); int (*SetWindowOpacity)(SDL_VideoDevice *_this, SDL_Window *window, float opacity);
int (*SetWindowModalFor)(_THIS, SDL_Window *modal_window, SDL_Window *parent_window); int (*SetWindowModalFor)(SDL_VideoDevice *_this, SDL_Window *modal_window, SDL_Window *parent_window);
int (*SetWindowInputFocus)(_THIS, SDL_Window *window); int (*SetWindowInputFocus)(SDL_VideoDevice *_this, SDL_Window *window);
void (*ShowWindow)(_THIS, SDL_Window *window); void (*ShowWindow)(SDL_VideoDevice *_this, SDL_Window *window);
void (*HideWindow)(_THIS, SDL_Window *window); void (*HideWindow)(SDL_VideoDevice *_this, SDL_Window *window);
void (*RaiseWindow)(_THIS, SDL_Window *window); void (*RaiseWindow)(SDL_VideoDevice *_this, SDL_Window *window);
void (*MaximizeWindow)(_THIS, SDL_Window *window); void (*MaximizeWindow)(SDL_VideoDevice *_this, SDL_Window *window);
void (*MinimizeWindow)(_THIS, SDL_Window *window); void (*MinimizeWindow)(SDL_VideoDevice *_this, SDL_Window *window);
void (*RestoreWindow)(_THIS, SDL_Window *window); void (*RestoreWindow)(SDL_VideoDevice *_this, SDL_Window *window);
void (*SetWindowBordered)(_THIS, SDL_Window *window, SDL_bool bordered); void (*SetWindowBordered)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered);
void (*SetWindowResizable)(_THIS, SDL_Window *window, SDL_bool resizable); void (*SetWindowResizable)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable);
void (*SetWindowAlwaysOnTop)(_THIS, SDL_Window *window, SDL_bool on_top); void (*SetWindowAlwaysOnTop)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool on_top);
void (*SetWindowFullscreen)(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); void (*SetWindowFullscreen)(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen);
void *(*GetWindowICCProfile)(_THIS, SDL_Window *window, size_t *size); void *(*GetWindowICCProfile)(SDL_VideoDevice *_this, SDL_Window *window, size_t *size);
SDL_DisplayID (*GetDisplayForWindow)(_THIS, SDL_Window *window); SDL_DisplayID (*GetDisplayForWindow)(SDL_VideoDevice *_this, SDL_Window *window);
void (*SetWindowMouseRect)(_THIS, SDL_Window *window); void (*SetWindowMouseRect)(SDL_VideoDevice *_this, SDL_Window *window);
void (*SetWindowMouseGrab)(_THIS, SDL_Window *window, SDL_bool grabbed); void (*SetWindowMouseGrab)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed);
void (*SetWindowKeyboardGrab)(_THIS, SDL_Window *window, SDL_bool grabbed); void (*SetWindowKeyboardGrab)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed);
void (*DestroyWindow)(_THIS, SDL_Window *window); void (*DestroyWindow)(SDL_VideoDevice *_this, SDL_Window *window);
int (*CreateWindowFramebuffer)(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); int (*CreateWindowFramebuffer)(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch);
int (*UpdateWindowFramebuffer)(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); int (*UpdateWindowFramebuffer)(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects);
void (*DestroyWindowFramebuffer)(_THIS, SDL_Window *window); void (*DestroyWindowFramebuffer)(SDL_VideoDevice *_this, SDL_Window *window);
void (*OnWindowEnter)(_THIS, SDL_Window *window); void (*OnWindowEnter)(SDL_VideoDevice *_this, SDL_Window *window);
int (*FlashWindow)(_THIS, SDL_Window *window, SDL_FlashOperation operation); int (*FlashWindow)(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation);
/* * * */ /* * * */
/* /*
@ -271,75 +268,75 @@ struct SDL_VideoDevice
SDL_ShapeDriver shape_driver; SDL_ShapeDriver shape_driver;
/* Get some platform dependent window information */ /* Get some platform dependent window information */
int (*GetWindowWMInfo)(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info); int (*GetWindowWMInfo)(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info);
/* * * */ /* * * */
/* /*
* OpenGL support * OpenGL support
*/ */
int (*GL_LoadLibrary)(_THIS, const char *path); int (*GL_LoadLibrary)(SDL_VideoDevice *_this, const char *path);
SDL_FunctionPointer (*GL_GetProcAddress)(_THIS, const char *proc); SDL_FunctionPointer (*GL_GetProcAddress)(SDL_VideoDevice *_this, const char *proc);
void (*GL_UnloadLibrary)(_THIS); void (*GL_UnloadLibrary)(SDL_VideoDevice *_this);
SDL_GLContext (*GL_CreateContext)(_THIS, SDL_Window *window); SDL_GLContext (*GL_CreateContext)(SDL_VideoDevice *_this, SDL_Window *window);
int (*GL_MakeCurrent)(_THIS, SDL_Window *window, SDL_GLContext context); int (*GL_MakeCurrent)(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context);
SDL_EGLSurface (*GL_GetEGLSurface)(_THIS, SDL_Window *window); SDL_EGLSurface (*GL_GetEGLSurface)(SDL_VideoDevice *_this, SDL_Window *window);
int (*GL_SetSwapInterval)(_THIS, int interval); int (*GL_SetSwapInterval)(SDL_VideoDevice *_this, int interval);
int (*GL_GetSwapInterval)(_THIS, int *interval); int (*GL_GetSwapInterval)(SDL_VideoDevice *_this, int *interval);
int (*GL_SwapWindow)(_THIS, SDL_Window *window); int (*GL_SwapWindow)(SDL_VideoDevice *_this, SDL_Window *window);
int (*GL_DeleteContext)(_THIS, SDL_GLContext context); int (*GL_DeleteContext)(SDL_VideoDevice *_this, SDL_GLContext context);
void (*GL_DefaultProfileConfig)(_THIS, int *mask, int *major, int *minor); void (*GL_DefaultProfileConfig)(SDL_VideoDevice *_this, int *mask, int *major, int *minor);
/* * * */ /* * * */
/* /*
* Vulkan support * Vulkan support
*/ */
int (*Vulkan_LoadLibrary)(_THIS, const char *path); int (*Vulkan_LoadLibrary)(SDL_VideoDevice *_this, const char *path);
void (*Vulkan_UnloadLibrary)(_THIS); void (*Vulkan_UnloadLibrary)(SDL_VideoDevice *_this);
SDL_bool (*Vulkan_GetInstanceExtensions)(_THIS, unsigned *count, const char **names); SDL_bool (*Vulkan_GetInstanceExtensions)(SDL_VideoDevice *_this, unsigned *count, const char **names);
SDL_bool (*Vulkan_CreateSurface)(_THIS, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface); SDL_bool (*Vulkan_CreateSurface)(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface);
/* * * */ /* * * */
/* /*
* Metal support * Metal support
*/ */
SDL_MetalView (*Metal_CreateView)(_THIS, SDL_Window *window); SDL_MetalView (*Metal_CreateView)(SDL_VideoDevice *_this, SDL_Window *window);
void (*Metal_DestroyView)(_THIS, SDL_MetalView view); void (*Metal_DestroyView)(SDL_VideoDevice *_this, SDL_MetalView view);
void *(*Metal_GetLayer)(_THIS, SDL_MetalView view); void *(*Metal_GetLayer)(SDL_VideoDevice *_this, SDL_MetalView view);
/* * * */ /* * * */
/* /*
* Event manager functions * Event manager functions
*/ */
int (*WaitEventTimeout)(_THIS, Sint64 timeoutNS); int (*WaitEventTimeout)(SDL_VideoDevice *_this, Sint64 timeoutNS);
void (*SendWakeupEvent)(_THIS, SDL_Window *window); void (*SendWakeupEvent)(SDL_VideoDevice *_this, SDL_Window *window);
void (*PumpEvents)(_THIS); void (*PumpEvents)(SDL_VideoDevice *_this);
/* Suspend the screensaver */ /* Suspend the screensaver */
int (*SuspendScreenSaver)(_THIS); int (*SuspendScreenSaver)(SDL_VideoDevice *_this);
/* Text input */ /* Text input */
void (*StartTextInput)(_THIS); void (*StartTextInput)(SDL_VideoDevice *_this);
void (*StopTextInput)(_THIS); void (*StopTextInput)(SDL_VideoDevice *_this);
int (*SetTextInputRect)(_THIS, const SDL_Rect *rect); int (*SetTextInputRect)(SDL_VideoDevice *_this, const SDL_Rect *rect);
void (*ClearComposition)(_THIS); void (*ClearComposition)(SDL_VideoDevice *_this);
SDL_bool (*IsTextInputShown)(_THIS); SDL_bool (*IsTextInputShown)(SDL_VideoDevice *_this);
/* Screen keyboard */ /* Screen keyboard */
SDL_bool (*HasScreenKeyboardSupport)(_THIS); SDL_bool (*HasScreenKeyboardSupport)(SDL_VideoDevice *_this);
void (*ShowScreenKeyboard)(_THIS, SDL_Window *window); void (*ShowScreenKeyboard)(SDL_VideoDevice *_this, SDL_Window *window);
void (*HideScreenKeyboard)(_THIS, SDL_Window *window); void (*HideScreenKeyboard)(SDL_VideoDevice *_this, SDL_Window *window);
SDL_bool (*IsScreenKeyboardShown)(_THIS, SDL_Window *window); SDL_bool (*IsScreenKeyboardShown)(SDL_VideoDevice *_this, SDL_Window *window);
/* Clipboard */ /* Clipboard */
int (*SetClipboardText)(_THIS, const char *text); int (*SetClipboardText)(SDL_VideoDevice *_this, const char *text);
char *(*GetClipboardText)(_THIS); char *(*GetClipboardText)(SDL_VideoDevice *_this);
SDL_bool (*HasClipboardText)(_THIS); SDL_bool (*HasClipboardText)(SDL_VideoDevice *_this);
int (*SetPrimarySelectionText)(_THIS, const char *text); int (*SetPrimarySelectionText)(SDL_VideoDevice *_this, const char *text);
char *(*GetPrimarySelectionText)(_THIS); char *(*GetPrimarySelectionText)(SDL_VideoDevice *_this);
SDL_bool (*HasPrimarySelectionText)(_THIS); SDL_bool (*HasPrimarySelectionText)(SDL_VideoDevice *_this);
/* MessageBox */ /* MessageBox */
int (*ShowMessageBox)(_THIS, const SDL_MessageBoxData *messageboxdata, int *buttonid); int (*ShowMessageBox)(SDL_VideoDevice *_this, const SDL_MessageBoxData *messageboxdata, int *buttonid);
/* Hit-testing */ /* Hit-testing */
int (*SetWindowHitTest)(SDL_Window *window, SDL_bool enabled); int (*SetWindowHitTest)(SDL_Window *window, SDL_bool enabled);
@ -449,7 +446,7 @@ struct SDL_VideoDevice
/* * * */ /* * * */
/* The function used to dispose of this structure */ /* The function used to dispose of this structure */
void (*free)(_THIS); void (*free)(SDL_VideoDevice *_this);
}; };
typedef struct VideoBootStrap typedef struct VideoBootStrap

View file

@ -161,7 +161,7 @@ extern SDL_bool Cocoa_SetWindowFullscreenSpace(SDL_Window *window, SDL_bool stat
#endif #endif
/* Convenience functions for reading driver flags */ /* Convenience functions for reading driver flags */
static SDL_bool ModeSwitchingEmulated(_THIS) static SDL_bool ModeSwitchingEmulated(SDL_VideoDevice *_this)
{ {
if (_this->quirk_flags & VIDEO_DEVICE_QUIRK_MODE_SWITCHING_EMULATED) { if (_this->quirk_flags & VIDEO_DEVICE_QUIRK_MODE_SWITCHING_EMULATED) {
return SDL_TRUE; return SDL_TRUE;
@ -169,7 +169,7 @@ static SDL_bool ModeSwitchingEmulated(_THIS)
return SDL_FALSE; return SDL_FALSE;
} }
static SDL_bool DisableUnsetFullscreenOnMinimize(_THIS) static SDL_bool DisableUnsetFullscreenOnMinimize(SDL_VideoDevice *_this)
{ {
if (_this->quirk_flags & VIDEO_DEVICE_QUIRK_DISABLE_UNSET_FULLSCREEN_ON_MINIMIZE) { if (_this->quirk_flags & VIDEO_DEVICE_QUIRK_DISABLE_UNSET_FULLSCREEN_ON_MINIMIZE) {
return SDL_TRUE; return SDL_TRUE;

View file

@ -26,18 +26,18 @@
#include "SDL_androidclipboard.h" #include "SDL_androidclipboard.h"
#include "../../core/android/SDL_android.h" #include "../../core/android/SDL_android.h"
int Android_SetClipboardText(_THIS, const char *text) int Android_SetClipboardText(SDL_VideoDevice *_this, const char *text)
{ {
return Android_JNI_SetClipboardText(text); return Android_JNI_SetClipboardText(text);
} }
char * char *
Android_GetClipboardText(_THIS) Android_GetClipboardText(SDL_VideoDevice *_this)
{ {
return Android_JNI_GetClipboardText(); return Android_JNI_GetClipboardText();
} }
SDL_bool Android_HasClipboardText(_THIS) SDL_bool Android_HasClipboardText(SDL_VideoDevice *_this)
{ {
return Android_JNI_HasClipboardText(); return Android_JNI_HasClipboardText();
} }

View file

@ -23,8 +23,8 @@
#ifndef SDL_androidclipboard_h_ #ifndef SDL_androidclipboard_h_
#define SDL_androidclipboard_h_ #define SDL_androidclipboard_h_
extern int Android_SetClipboardText(_THIS, const char *text); extern int Android_SetClipboardText(SDL_VideoDevice *_this, const char *text);
extern char *Android_GetClipboardText(_THIS); extern char *Android_GetClipboardText(SDL_VideoDevice *_this);
extern SDL_bool Android_HasClipboardText(_THIS); extern SDL_bool Android_HasClipboardText(SDL_VideoDevice *_this);
#endif /* SDL_androidclipboard_h_ */ #endif /* SDL_androidclipboard_h_ */

View file

@ -118,7 +118,7 @@ static void android_egl_context_backup(SDL_Window *window)
* No polling necessary * No polling necessary
*/ */
void Android_PumpEvents_Blocking(_THIS) void Android_PumpEvents_Blocking(SDL_VideoDevice *_this)
{ {
SDL_VideoData *videodata = _this->driverdata; SDL_VideoData *videodata = _this->driverdata;
@ -193,7 +193,7 @@ void Android_PumpEvents_Blocking(_THIS)
} }
} }
void Android_PumpEvents_NonBlocking(_THIS) void Android_PumpEvents_NonBlocking(SDL_VideoDevice *_this)
{ {
SDL_VideoData *videodata = _this->driverdata; SDL_VideoData *videodata = _this->driverdata;
static int backup_context = 0; static int backup_context = 0;

View file

@ -22,5 +22,5 @@
#include "SDL_androidvideo.h" #include "SDL_androidvideo.h"
extern void Android_PumpEvents_Blocking(_THIS); extern void Android_PumpEvents_Blocking(SDL_VideoDevice *_this);
extern void Android_PumpEvents_NonBlocking(_THIS); extern void Android_PumpEvents_NonBlocking(SDL_VideoDevice *_this);

View file

@ -35,7 +35,7 @@
#include <dlfcn.h> #include <dlfcn.h>
int Android_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) int Android_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context)
{ {
if (window && context) { if (window && context) {
return SDL_EGL_MakeCurrent(_this, window->driverdata->egl_surface, context); return SDL_EGL_MakeCurrent(_this, window->driverdata->egl_surface, context);
@ -45,7 +45,7 @@ int Android_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context)
} }
SDL_GLContext SDL_GLContext
Android_GLES_CreateContext(_THIS, SDL_Window *window) Android_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_GLContext ret; SDL_GLContext ret;
@ -58,7 +58,7 @@ Android_GLES_CreateContext(_THIS, SDL_Window *window)
return ret; return ret;
} }
int Android_GLES_SwapWindow(_THIS, SDL_Window *window) int Android_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
int retval; int retval;
@ -78,7 +78,7 @@ int Android_GLES_SwapWindow(_THIS, SDL_Window *window)
return retval; return retval;
} }
int Android_GLES_LoadLibrary(_THIS, const char *path) int Android_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path)
{ {
return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType)0, 0); return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType)0, 0);
} }

View file

@ -23,9 +23,9 @@
#ifndef SDL_androidgl_h_ #ifndef SDL_androidgl_h_
#define SDL_androidgl_h_ #define SDL_androidgl_h_
SDL_GLContext Android_GLES_CreateContext(_THIS, SDL_Window *window); SDL_GLContext Android_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window);
int Android_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); int Android_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context);
int Android_GLES_SwapWindow(_THIS, SDL_Window *window); int Android_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window);
int Android_GLES_LoadLibrary(_THIS, const char *path); int Android_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path);
#endif /* SDL_androidgl_h_ */ #endif /* SDL_androidgl_h_ */

View file

@ -337,29 +337,29 @@ int Android_OnKeyUp(int keycode)
} }
SDL_bool SDL_bool
Android_HasScreenKeyboardSupport(_THIS) Android_HasScreenKeyboardSupport(SDL_VideoDevice *_this)
{ {
return SDL_TRUE; return SDL_TRUE;
} }
SDL_bool SDL_bool
Android_IsScreenKeyboardShown(_THIS, SDL_Window *window) Android_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window)
{ {
return Android_JNI_IsScreenKeyboardShown(); return Android_JNI_IsScreenKeyboardShown();
} }
void Android_StartTextInput(_THIS) void Android_StartTextInput(SDL_VideoDevice *_this)
{ {
SDL_VideoData *videodata = _this->driverdata; SDL_VideoData *videodata = _this->driverdata;
Android_JNI_ShowTextInput(&videodata->textRect); Android_JNI_ShowTextInput(&videodata->textRect);
} }
void Android_StopTextInput(_THIS) void Android_StopTextInput(SDL_VideoDevice *_this)
{ {
Android_JNI_HideTextInput(); Android_JNI_HideTextInput();
} }
int Android_SetTextInputRect(_THIS, const SDL_Rect *rect) int Android_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect)
{ {
SDL_VideoData *videodata = _this->driverdata; SDL_VideoData *videodata = _this->driverdata;
videodata->textRect = *rect; videodata->textRect = *rect;

View file

@ -25,9 +25,9 @@
extern int Android_OnKeyDown(int keycode); extern int Android_OnKeyDown(int keycode);
extern int Android_OnKeyUp(int keycode); extern int Android_OnKeyUp(int keycode);
extern SDL_bool Android_HasScreenKeyboardSupport(_THIS); extern SDL_bool Android_HasScreenKeyboardSupport(SDL_VideoDevice *_this);
extern SDL_bool Android_IsScreenKeyboardShown(_THIS, SDL_Window *window); extern SDL_bool Android_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window);
extern void Android_StartTextInput(_THIS); extern void Android_StartTextInput(SDL_VideoDevice *_this);
extern void Android_StopTextInput(_THIS); extern void Android_StopTextInput(SDL_VideoDevice *_this);
extern int Android_SetTextInputRect(_THIS, const SDL_Rect *rect); extern int Android_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect);

View file

@ -42,8 +42,8 @@
#define ANDROID_VID_DRIVER_NAME "Android" #define ANDROID_VID_DRIVER_NAME "Android"
/* Initialization/Query functions */ /* Initialization/Query functions */
static int Android_VideoInit(_THIS); static int Android_VideoInit(SDL_VideoDevice *_this);
static void Android_VideoQuit(_THIS); static void Android_VideoQuit(SDL_VideoDevice *_this);
#include "../SDL_egl_c.h" #include "../SDL_egl_c.h"
#define Android_GLES_GetProcAddress SDL_EGL_GetProcAddressInternal #define Android_GLES_GetProcAddress SDL_EGL_GetProcAddressInternal
@ -67,7 +67,7 @@ SDL_Semaphore *Android_ResumeSem = NULL;
SDL_Mutex *Android_ActivityMutex = NULL; SDL_Mutex *Android_ActivityMutex = NULL;
static SDL_SystemTheme Android_SystemTheme; static SDL_SystemTheme Android_SystemTheme;
static int Android_SuspendScreenSaver(_THIS) static int Android_SuspendScreenSaver(SDL_VideoDevice *_this)
{ {
return Android_JNI_SuspendScreenSaver(_this->suspend_screensaver); return Android_JNI_SuspendScreenSaver(_this->suspend_screensaver);
} }
@ -166,7 +166,7 @@ VideoBootStrap Android_bootstrap = {
Android_CreateDevice Android_CreateDevice
}; };
int Android_VideoInit(_THIS) int Android_VideoInit(SDL_VideoDevice *_this)
{ {
SDL_VideoData *videodata = _this->driverdata; SDL_VideoData *videodata = _this->driverdata;
SDL_DisplayID displayID; SDL_DisplayID displayID;
@ -200,7 +200,7 @@ int Android_VideoInit(_THIS)
return 0; return 0;
} }
void Android_VideoQuit(_THIS) void Android_VideoQuit(SDL_VideoDevice *_this)
{ {
Android_QuitMouse(); Android_QuitMouse();
Android_QuitTouch(); Android_QuitTouch();

View file

@ -35,7 +35,7 @@
#include <SDL3/SDL_syswm.h> #include <SDL3/SDL_syswm.h>
int Android_Vulkan_LoadLibrary(_THIS, const char *path) int Android_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path)
{ {
VkExtensionProperties *extensions = NULL; VkExtensionProperties *extensions = NULL;
Uint32 i, extensionCount = 0; Uint32 i, extensionCount = 0;
@ -101,7 +101,7 @@ fail:
return -1; return -1;
} }
void Android_Vulkan_UnloadLibrary(_THIS) void Android_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
{ {
if (_this->vulkan_config.loader_handle) { if (_this->vulkan_config.loader_handle) {
SDL_UnloadObject(_this->vulkan_config.loader_handle); SDL_UnloadObject(_this->vulkan_config.loader_handle);
@ -109,7 +109,7 @@ void Android_Vulkan_UnloadLibrary(_THIS)
} }
} }
SDL_bool Android_Vulkan_GetInstanceExtensions(_THIS, SDL_bool Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
unsigned *count, unsigned *count,
const char **names) const char **names)
{ {
@ -125,7 +125,7 @@ SDL_bool Android_Vulkan_GetInstanceExtensions(_THIS,
extensionsForAndroid); extensionsForAndroid);
} }
SDL_bool Android_Vulkan_CreateSurface(_THIS, SDL_bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window, SDL_Window *window,
VkInstance instance, VkInstance instance,
VkSurfaceKHR *surface) VkSurfaceKHR *surface)

View file

@ -34,12 +34,12 @@
#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_ANDROID) #if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_ANDROID)
int Android_Vulkan_LoadLibrary(_THIS, const char *path); int Android_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
void Android_Vulkan_UnloadLibrary(_THIS); void Android_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
SDL_bool Android_Vulkan_GetInstanceExtensions(_THIS, SDL_bool Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
unsigned *count, unsigned *count,
const char **names); const char **names);
SDL_bool Android_Vulkan_CreateSurface(_THIS, SDL_bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window, SDL_Window *window,
VkInstance instance, VkInstance instance,
VkSurfaceKHR *surface); VkSurfaceKHR *surface);

View file

@ -36,7 +36,7 @@
/* Currently only one window */ /* Currently only one window */
SDL_Window *Android_Window = NULL; SDL_Window *Android_Window = NULL;
int Android_CreateWindow(_THIS, SDL_Window *window) int Android_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_WindowData *data; SDL_WindowData *data;
int retval = 0; int retval = 0;
@ -100,12 +100,12 @@ endfunction:
return retval; return retval;
} }
void Android_SetWindowTitle(_THIS, SDL_Window *window) void Android_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window)
{ {
Android_JNI_SetActivityTitle(window->title); Android_JNI_SetActivityTitle(window->title);
} }
void Android_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) void Android_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
{ {
SDL_LockMutex(Android_ActivityMutex); SDL_LockMutex(Android_ActivityMutex);
@ -156,18 +156,18 @@ endfunction:
SDL_UnlockMutex(Android_ActivityMutex); SDL_UnlockMutex(Android_ActivityMutex);
} }
void Android_MinimizeWindow(_THIS, SDL_Window *window) void Android_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
Android_JNI_MinizeWindow(); Android_JNI_MinizeWindow();
} }
void Android_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable) void Android_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable)
{ {
/* Set orientation */ /* Set orientation */
Android_JNI_SetOrientation(window->w, window->h, window->flags & SDL_WINDOW_RESIZABLE, SDL_GetHint(SDL_HINT_ORIENTATIONS)); Android_JNI_SetOrientation(window->w, window->h, window->flags & SDL_WINDOW_RESIZABLE, SDL_GetHint(SDL_HINT_ORIENTATIONS));
} }
void Android_DestroyWindow(_THIS, SDL_Window *window) void Android_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_LockMutex(Android_ActivityMutex); SDL_LockMutex(Android_ActivityMutex);
@ -194,7 +194,7 @@ void Android_DestroyWindow(_THIS, SDL_Window *window)
SDL_UnlockMutex(Android_ActivityMutex); SDL_UnlockMutex(Android_ActivityMutex);
} }
int Android_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info) int Android_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, SDL_SysWMinfo *info)
{ {
SDL_WindowData *data = window->driverdata; SDL_WindowData *data = window->driverdata;

View file

@ -26,14 +26,14 @@
#include "../../core/android/SDL_android.h" #include "../../core/android/SDL_android.h"
#include "../SDL_egl_c.h" #include "../SDL_egl_c.h"
extern int Android_CreateWindow(_THIS, SDL_Window *window); extern int Android_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void Android_SetWindowTitle(_THIS, SDL_Window *window); extern void Android_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window);
extern void Android_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); extern void Android_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen);
extern void Android_MinimizeWindow(_THIS, SDL_Window *window); extern void Android_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void Android_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable); extern void Android_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable);
extern void Android_DestroyWindow(_THIS, SDL_Window *window); extern void Android_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern int Android_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info); extern int Android_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info);
extern SDL_Window *Android_Window; extern SDL_Window *Android_Window;
struct SDL_WindowData struct SDL_WindowData

View file

@ -26,9 +26,9 @@
/* Forward declaration */ /* Forward declaration */
@class SDL_CocoaVideoData; @class SDL_CocoaVideoData;
extern int Cocoa_SetClipboardText(_THIS, const char *text); extern int Cocoa_SetClipboardText(SDL_VideoDevice *_this, const char *text);
extern char *Cocoa_GetClipboardText(_THIS); extern char *Cocoa_GetClipboardText(SDL_VideoDevice *_this);
extern SDL_bool Cocoa_HasClipboardText(_THIS); extern SDL_bool Cocoa_HasClipboardText(SDL_VideoDevice *_this);
extern void Cocoa_CheckClipboardUpdate(SDL_CocoaVideoData *data); extern void Cocoa_CheckClipboardUpdate(SDL_CocoaVideoData *data);
#endif /* SDL_cocoaclipboard_h_ */ #endif /* SDL_cocoaclipboard_h_ */

View file

@ -25,7 +25,7 @@
#include "SDL_cocoavideo.h" #include "SDL_cocoavideo.h"
#include "../../events/SDL_clipboardevents_c.h" #include "../../events/SDL_clipboardevents_c.h"
int Cocoa_SetClipboardText(_THIS, const char *text) int Cocoa_SetClipboardText(SDL_VideoDevice *_this, const char *text)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata;
@ -45,7 +45,7 @@ int Cocoa_SetClipboardText(_THIS, const char *text)
} }
char * char *
Cocoa_GetClipboardText(_THIS) Cocoa_GetClipboardText(SDL_VideoDevice *_this)
{ {
@autoreleasepool { @autoreleasepool {
NSPasteboard *pasteboard; NSPasteboard *pasteboard;
@ -75,7 +75,7 @@ Cocoa_GetClipboardText(_THIS)
} }
SDL_bool SDL_bool
Cocoa_HasClipboardText(_THIS) Cocoa_HasClipboardText(SDL_VideoDevice *_this)
{ {
SDL_bool result = SDL_FALSE; SDL_bool result = SDL_FALSE;
char *text = Cocoa_GetClipboardText(_this); char *text = Cocoa_GetClipboardText(_this);

View file

@ -25,9 +25,9 @@
extern void Cocoa_RegisterApp(void); extern void Cocoa_RegisterApp(void);
extern Uint64 Cocoa_GetEventTimestamp(NSTimeInterval nsTimestamp); extern Uint64 Cocoa_GetEventTimestamp(NSTimeInterval nsTimestamp);
extern void Cocoa_PumpEvents(_THIS); extern void Cocoa_PumpEvents(SDL_VideoDevice *_this);
extern int Cocoa_WaitEventTimeout(_THIS, Sint64 timeoutNS); extern int Cocoa_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS);
extern void Cocoa_SendWakeupEvent(_THIS, SDL_Window *window); extern void Cocoa_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window);
extern int Cocoa_SuspendScreenSaver(_THIS); extern int Cocoa_SuspendScreenSaver(SDL_VideoDevice *_this);
#endif /* SDL_cocoaevents_h_ */ #endif /* SDL_cocoaevents_h_ */

View file

@ -524,7 +524,7 @@ Uint64 Cocoa_GetEventTimestamp(NSTimeInterval nsTimestamp)
return timestamp; return timestamp;
} }
int Cocoa_PumpEventsUntilDate(_THIS, NSDate *expiration, bool accumulate) int Cocoa_PumpEventsUntilDate(SDL_VideoDevice *_this, NSDate *expiration, bool accumulate)
{ {
for (;;) { for (;;) {
NSEvent *event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:expiration inMode:NSDefaultRunLoopMode dequeue:YES]; NSEvent *event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:expiration inMode:NSDefaultRunLoopMode dequeue:YES];
@ -545,7 +545,7 @@ int Cocoa_PumpEventsUntilDate(_THIS, NSDate *expiration, bool accumulate)
return 1; return 1;
} }
int Cocoa_WaitEventTimeout(_THIS, Sint64 timeoutNS) int Cocoa_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS)
{ {
@autoreleasepool { @autoreleasepool {
if (timeoutNS > 0) { if (timeoutNS > 0) {
@ -561,14 +561,14 @@ int Cocoa_WaitEventTimeout(_THIS, Sint64 timeoutNS)
} }
} }
void Cocoa_PumpEvents(_THIS) void Cocoa_PumpEvents(SDL_VideoDevice *_this)
{ {
@autoreleasepool { @autoreleasepool {
Cocoa_PumpEventsUntilDate(_this, [NSDate distantPast], true); Cocoa_PumpEventsUntilDate(_this, [NSDate distantPast], true);
} }
} }
void Cocoa_SendWakeupEvent(_THIS, SDL_Window *window) void Cocoa_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
NSEvent *event = [NSEvent otherEventWithType:NSEventTypeApplicationDefined NSEvent *event = [NSEvent otherEventWithType:NSEventTypeApplicationDefined
@ -585,7 +585,7 @@ void Cocoa_SendWakeupEvent(_THIS, SDL_Window *window)
} }
} }
int Cocoa_SuspendScreenSaver(_THIS) int Cocoa_SuspendScreenSaver(SDL_VideoDevice *_this)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata;

View file

@ -23,14 +23,14 @@
#ifndef SDL_cocoakeyboard_h_ #ifndef SDL_cocoakeyboard_h_
#define SDL_cocoakeyboard_h_ #define SDL_cocoakeyboard_h_
extern void Cocoa_InitKeyboard(_THIS); extern void Cocoa_InitKeyboard(SDL_VideoDevice *_this);
extern void Cocoa_HandleKeyEvent(_THIS, NSEvent *event); extern void Cocoa_HandleKeyEvent(SDL_VideoDevice *_this, NSEvent *event);
extern void Cocoa_QuitKeyboard(_THIS); extern void Cocoa_QuitKeyboard(SDL_VideoDevice *_this);
extern void Cocoa_StartTextInput(_THIS); extern void Cocoa_StartTextInput(SDL_VideoDevice *_this);
extern void Cocoa_StopTextInput(_THIS); extern void Cocoa_StopTextInput(SDL_VideoDevice *_this);
extern int Cocoa_SetTextInputRect(_THIS, const SDL_Rect *rect); extern int Cocoa_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect);
extern void Cocoa_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed); extern void Cocoa_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed);
#endif /* SDL_cocoakeyboard_h_ */ #endif /* SDL_cocoakeyboard_h_ */

View file

@ -198,7 +198,7 @@ static bool IsModifierKeyPressed(unsigned int flags,
return target_pressed; return target_pressed;
} }
static void HandleModifiers(_THIS, SDL_Scancode code, unsigned int modifierFlags) static void HandleModifiers(SDL_VideoDevice *_this, SDL_Scancode code, unsigned int modifierFlags)
{ {
bool pressed = false; bool pressed = false;
@ -312,7 +312,7 @@ cleanup:
CFRelease(key_layout); CFRelease(key_layout);
} }
void Cocoa_InitKeyboard(_THIS) void Cocoa_InitKeyboard(SDL_VideoDevice *_this)
{ {
SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata;
@ -330,7 +330,7 @@ void Cocoa_InitKeyboard(_THIS)
SDL_ToggleModState(SDL_KMOD_CAPS, (data.modifierFlags & NSEventModifierFlagCapsLock) ? SDL_TRUE : SDL_FALSE); SDL_ToggleModState(SDL_KMOD_CAPS, (data.modifierFlags & NSEventModifierFlagCapsLock) ? SDL_TRUE : SDL_FALSE);
} }
void Cocoa_StartTextInput(_THIS) void Cocoa_StartTextInput(SDL_VideoDevice *_this)
{ {
@autoreleasepool { @autoreleasepool {
NSView *parentView; NSView *parentView;
@ -362,7 +362,7 @@ void Cocoa_StartTextInput(_THIS)
} }
} }
void Cocoa_StopTextInput(_THIS) void Cocoa_StopTextInput(SDL_VideoDevice *_this)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata;
@ -374,14 +374,14 @@ void Cocoa_StopTextInput(_THIS)
} }
} }
int Cocoa_SetTextInputRect(_THIS, const SDL_Rect *rect) int Cocoa_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect)
{ {
SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata;
[data.fieldEdit setInputRect:rect]; [data.fieldEdit setInputRect:rect];
return 0; return 0;
} }
void Cocoa_HandleKeyEvent(_THIS, NSEvent *event) void Cocoa_HandleKeyEvent(SDL_VideoDevice *_this, NSEvent *event)
{ {
unsigned short scancode; unsigned short scancode;
SDL_Scancode code; SDL_Scancode code;
@ -443,7 +443,7 @@ void Cocoa_HandleKeyEvent(_THIS, NSEvent *event)
} }
} }
void Cocoa_QuitKeyboard(_THIS) void Cocoa_QuitKeyboard(SDL_VideoDevice *_this)
{ {
} }
@ -457,7 +457,7 @@ typedef enum
extern CGSConnection _CGSDefaultConnection(void); extern CGSConnection _CGSDefaultConnection(void);
extern CGError CGSSetGlobalHotKeyOperatingMode(CGSConnection connection, CGSGlobalHotKeyOperatingMode mode); extern CGError CGSSetGlobalHotKeyOperatingMode(CGSConnection connection, CGSGlobalHotKeyOperatingMode mode);
void Cocoa_SetWindowKeyboardGrab(_THIS, SDL_Window *window, SDL_bool grabbed) void Cocoa_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed)
{ {
#ifdef SDL_MAC_NO_SANDBOX #ifdef SDL_MAC_NO_SANDBOX
CGSSetGlobalHotKeyOperatingMode(_CGSDefaultConnection(), grabbed ? CGSGlobalHotKeyDisable : CGSGlobalHotKeyEnable); CGSSetGlobalHotKeyOperatingMode(_CGSDefaultConnection(), grabbed ? CGSGlobalHotKeyDisable : CGSGlobalHotKeyEnable);

View file

@ -57,9 +57,9 @@
@end @end
SDL_MetalView Cocoa_Metal_CreateView(_THIS, SDL_Window *window); SDL_MetalView Cocoa_Metal_CreateView(SDL_VideoDevice *_this, SDL_Window *window);
void Cocoa_Metal_DestroyView(_THIS, SDL_MetalView view); void Cocoa_Metal_DestroyView(SDL_VideoDevice *_this, SDL_MetalView view);
void *Cocoa_Metal_GetLayer(_THIS, SDL_MetalView view); void *Cocoa_Metal_GetLayer(SDL_VideoDevice *_this, SDL_MetalView view);
#endif /* SDL_VIDEO_DRIVER_COCOA && (SDL_VIDEO_VULKAN || SDL_VIDEO_METAL) */ #endif /* SDL_VIDEO_DRIVER_COCOA && (SDL_VIDEO_VULKAN || SDL_VIDEO_METAL) */

View file

@ -133,7 +133,7 @@ static int SDLCALL SDL_MetalViewEventWatch(void *userdata, SDL_Event *event)
@end @end
SDL_MetalView SDL_MetalView
Cocoa_Metal_CreateView(_THIS, SDL_Window *window) Cocoa_Metal_CreateView(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata;
@ -164,7 +164,7 @@ Cocoa_Metal_CreateView(_THIS, SDL_Window *window)
} }
} }
void Cocoa_Metal_DestroyView(_THIS, SDL_MetalView view) void Cocoa_Metal_DestroyView(SDL_VideoDevice *_this, SDL_MetalView view)
{ {
@autoreleasepool { @autoreleasepool {
SDL_cocoametalview *metalview = CFBridgingRelease(view); SDL_cocoametalview *metalview = CFBridgingRelease(view);
@ -173,7 +173,7 @@ void Cocoa_Metal_DestroyView(_THIS, SDL_MetalView view)
} }
void * void *
Cocoa_Metal_GetLayer(_THIS, SDL_MetalView view) Cocoa_Metal_GetLayer(SDL_VideoDevice *_this, SDL_MetalView view)
{ {
@autoreleasepool { @autoreleasepool {
SDL_cocoametalview *cocoaview = (__bridge SDL_cocoametalview *)view; SDL_cocoametalview *cocoaview = (__bridge SDL_cocoametalview *)view;

View file

@ -33,11 +33,11 @@ struct SDL_DisplayModeData
CFMutableArrayRef modes; CFMutableArrayRef modes;
}; };
extern void Cocoa_InitModes(_THIS); extern void Cocoa_InitModes(SDL_VideoDevice *_this);
extern int Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); extern int Cocoa_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect);
extern int Cocoa_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); extern int Cocoa_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect);
extern int Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay *display); extern int Cocoa_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display);
extern int Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); extern int Cocoa_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
extern void Cocoa_QuitModes(_THIS); extern void Cocoa_QuitModes(SDL_VideoDevice *_this);
#endif /* SDL_cocoamodes_h_ */ #endif /* SDL_cocoamodes_h_ */

View file

@ -139,7 +139,7 @@ static Uint32 GetDisplayModePixelFormat(CGDisplayModeRef vidmode)
return pixelformat; return pixelformat;
} }
static SDL_bool GetDisplayMode(_THIS, CGDisplayModeRef vidmode, SDL_bool vidmodeCurrent, CFArrayRef modelist, CVDisplayLinkRef link, SDL_DisplayMode *mode) static SDL_bool GetDisplayMode(SDL_VideoDevice *_this, CGDisplayModeRef vidmode, SDL_bool vidmodeCurrent, CFArrayRef modelist, CVDisplayLinkRef link, SDL_DisplayMode *mode)
{ {
SDL_DisplayModeData *data; SDL_DisplayModeData *data;
bool usableForGUI = CGDisplayModeIsUsableForDesktopGUI(vidmode); bool usableForGUI = CGDisplayModeIsUsableForDesktopGUI(vidmode);
@ -277,7 +277,7 @@ static const char *Cocoa_GetDisplayName(CGDirectDisplayID displayID)
return displayName; return displayName;
} }
void Cocoa_InitModes(_THIS) void Cocoa_InitModes(SDL_VideoDevice *_this)
{ {
@autoreleasepool { @autoreleasepool {
CGDisplayErr result; CGDisplayErr result;
@ -361,7 +361,7 @@ void Cocoa_InitModes(_THIS)
} }
} }
int Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) int Cocoa_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect)
{ {
SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata;
CGRect cgrect; CGRect cgrect;
@ -374,7 +374,7 @@ int Cocoa_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect)
return 0; return 0;
} }
int Cocoa_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) int Cocoa_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect)
{ {
SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata;
const CGDirectDisplayID cgdisplay = displaydata->display; const CGDirectDisplayID cgdisplay = displaydata->display;
@ -406,7 +406,7 @@ int Cocoa_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rec
return 0; return 0;
} }
int Cocoa_GetDisplayModes(_THIS, SDL_VideoDisplay *display) int Cocoa_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display)
{ {
SDL_DisplayData *data = (SDL_DisplayData *)display->driverdata; SDL_DisplayData *data = (SDL_DisplayData *)display->driverdata;
CVDisplayLinkRef link = NULL; CVDisplayLinkRef link = NULL;
@ -483,7 +483,7 @@ static CGError SetDisplayModeForDisplay(CGDirectDisplayID display, SDL_DisplayMo
return result; return result;
} }
int Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) int Cocoa_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
{ {
SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata;
SDL_DisplayModeData *data = (SDL_DisplayModeData *)mode->driverdata; SDL_DisplayModeData *data = (SDL_DisplayModeData *)mode->driverdata;
@ -548,7 +548,7 @@ ERR_NO_CAPTURE:
return -1; return -1;
} }
void Cocoa_QuitModes(_THIS) void Cocoa_QuitModes(SDL_VideoDevice *_this)
{ {
int i, j; int i, j;

View file

@ -25,11 +25,11 @@
#include "SDL_cocoavideo.h" #include "SDL_cocoavideo.h"
extern int Cocoa_InitMouse(_THIS); extern int Cocoa_InitMouse(SDL_VideoDevice *_this);
extern void Cocoa_HandleMouseEvent(_THIS, NSEvent *event); extern void Cocoa_HandleMouseEvent(SDL_VideoDevice *_this, NSEvent *event);
extern void Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event); extern void Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event);
extern void Cocoa_HandleMouseWarp(CGFloat x, CGFloat y); extern void Cocoa_HandleMouseWarp(CGFloat x, CGFloat y);
extern void Cocoa_QuitMouse(_THIS); extern void Cocoa_QuitMouse(SDL_VideoDevice *_this);
typedef struct typedef struct
{ {

View file

@ -362,7 +362,7 @@ static Uint32 Cocoa_GetGlobalMouseState(float *x, float *y)
return retval; return retval;
} }
int Cocoa_InitMouse(_THIS) int Cocoa_InitMouse(SDL_VideoDevice *_this)
{ {
NSPoint location; NSPoint location;
SDL_Mouse *mouse = SDL_GetMouse(); SDL_Mouse *mouse = SDL_GetMouse();
@ -390,7 +390,7 @@ int Cocoa_InitMouse(_THIS)
return 0; return 0;
} }
static void Cocoa_HandleTitleButtonEvent(_THIS, NSEvent *event) static void Cocoa_HandleTitleButtonEvent(SDL_VideoDevice *_this, NSEvent *event)
{ {
SDL_Window *window; SDL_Window *window;
NSWindow *nswindow = [event window]; NSWindow *nswindow = [event window];
@ -423,7 +423,7 @@ static void Cocoa_HandleTitleButtonEvent(_THIS, NSEvent *event)
} }
} }
void Cocoa_HandleMouseEvent(_THIS, NSEvent *event) void Cocoa_HandleMouseEvent(SDL_VideoDevice *_this, NSEvent *event)
{ {
SDL_Mouse *mouse; SDL_Mouse *mouse;
SDL_MouseData *driverdata; SDL_MouseData *driverdata;
@ -552,7 +552,7 @@ void Cocoa_HandleMouseWarp(CGFloat x, CGFloat y)
DLog("(%g, %g)", x, y); DLog("(%g, %g)", x, y);
} }
void Cocoa_QuitMouse(_THIS) void Cocoa_QuitMouse(SDL_VideoDevice *_this)
{ {
SDL_Mouse *mouse = SDL_GetMouse(); SDL_Mouse *mouse = SDL_GetMouse();
if (mouse) { if (mouse) {

View file

@ -69,16 +69,16 @@ struct SDL_GLDriverData
@end @end
/* OpenGL functions */ /* OpenGL functions */
extern int Cocoa_GL_LoadLibrary(_THIS, const char *path); extern int Cocoa_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path);
extern SDL_FunctionPointer Cocoa_GL_GetProcAddress(_THIS, const char *proc); extern SDL_FunctionPointer Cocoa_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc);
extern void Cocoa_GL_UnloadLibrary(_THIS); extern void Cocoa_GL_UnloadLibrary(SDL_VideoDevice *_this);
extern SDL_GLContext Cocoa_GL_CreateContext(_THIS, SDL_Window *window); extern SDL_GLContext Cocoa_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window);
extern int Cocoa_GL_MakeCurrent(_THIS, SDL_Window *window, extern int Cocoa_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window,
SDL_GLContext context); SDL_GLContext context);
extern int Cocoa_GL_SetSwapInterval(_THIS, int interval); extern int Cocoa_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval);
extern int Cocoa_GL_GetSwapInterval(_THIS, int *interval); extern int Cocoa_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval);
extern int Cocoa_GL_SwapWindow(_THIS, SDL_Window *window); extern int Cocoa_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern int Cocoa_GL_DeleteContext(_THIS, SDL_GLContext context); extern int Cocoa_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context);
#ifdef __clang__ #ifdef __clang__
#pragma clang diagnostic pop #pragma clang diagnostic pop

View file

@ -225,7 +225,7 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
@end @end
int Cocoa_GL_LoadLibrary(_THIS, const char *path) int Cocoa_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path)
{ {
/* Load the OpenGL library */ /* Load the OpenGL library */
if (path == NULL) { if (path == NULL) {
@ -243,18 +243,18 @@ int Cocoa_GL_LoadLibrary(_THIS, const char *path)
return 0; return 0;
} }
SDL_FunctionPointer Cocoa_GL_GetProcAddress(_THIS, const char *proc) SDL_FunctionPointer Cocoa_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc)
{ {
return SDL_LoadFunction(_this->gl_config.dll_handle, proc); return SDL_LoadFunction(_this->gl_config.dll_handle, proc);
} }
void Cocoa_GL_UnloadLibrary(_THIS) void Cocoa_GL_UnloadLibrary(SDL_VideoDevice *_this)
{ {
SDL_UnloadObject(_this->gl_config.dll_handle); SDL_UnloadObject(_this->gl_config.dll_handle);
_this->gl_config.dll_handle = NULL; _this->gl_config.dll_handle = NULL;
} }
SDL_GLContext Cocoa_GL_CreateContext(_THIS, SDL_Window *window) SDL_GLContext Cocoa_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window); SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window);
@ -435,7 +435,7 @@ SDL_GLContext Cocoa_GL_CreateContext(_THIS, SDL_Window *window)
} }
} }
int Cocoa_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) int Cocoa_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context)
{ {
@autoreleasepool { @autoreleasepool {
if (context) { if (context) {
@ -453,7 +453,7 @@ int Cocoa_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context)
} }
} }
int Cocoa_GL_SetSwapInterval(_THIS, int interval) int Cocoa_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval)
{ {
@autoreleasepool { @autoreleasepool {
SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *)SDL_GL_GetCurrentContext(); SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *)SDL_GL_GetCurrentContext();
@ -473,7 +473,7 @@ int Cocoa_GL_SetSwapInterval(_THIS, int interval)
} }
} }
int Cocoa_GL_GetSwapInterval(_THIS, int *interval) int Cocoa_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval)
{ {
@autoreleasepool { @autoreleasepool {
SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *)SDL_GL_GetCurrentContext(); SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *)SDL_GL_GetCurrentContext();
@ -486,7 +486,7 @@ int Cocoa_GL_GetSwapInterval(_THIS, int *interval)
} }
} }
int Cocoa_GL_SwapWindow(_THIS, SDL_Window *window) int Cocoa_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *)SDL_GL_GetCurrentContext(); SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *)SDL_GL_GetCurrentContext();
@ -523,7 +523,7 @@ int Cocoa_GL_SwapWindow(_THIS, SDL_Window *window)
} }
} }
int Cocoa_GL_DeleteContext(_THIS, SDL_GLContext context) int Cocoa_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context)
{ {
@autoreleasepool { @autoreleasepool {
SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *)context; SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *)context;

View file

@ -35,13 +35,13 @@
#define Cocoa_GLES_GetSwapInterval SDL_EGL_GetSwapInterval #define Cocoa_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
#define Cocoa_GLES_SetSwapInterval SDL_EGL_SetSwapInterval #define Cocoa_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
extern int Cocoa_GLES_LoadLibrary(_THIS, const char *path); extern int Cocoa_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path);
extern SDL_GLContext Cocoa_GLES_CreateContext(_THIS, SDL_Window *window); extern SDL_GLContext Cocoa_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window);
extern int Cocoa_GLES_SwapWindow(_THIS, SDL_Window *window); extern int Cocoa_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern int Cocoa_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); extern int Cocoa_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context);
extern int Cocoa_GLES_DeleteContext(_THIS, SDL_GLContext context); extern int Cocoa_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context);
extern int Cocoa_GLES_SetupWindow(_THIS, SDL_Window *window); extern int Cocoa_GLES_SetupWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern SDL_EGLSurface Cocoa_GLES_GetEGLSurface(_THIS, SDL_Window *window); extern SDL_EGLSurface Cocoa_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window);
#endif /* SDL_VIDEO_OPENGL_EGL */ #endif /* SDL_VIDEO_OPENGL_EGL */

View file

@ -28,7 +28,7 @@
/* EGL implementation of SDL OpenGL support */ /* EGL implementation of SDL OpenGL support */
int Cocoa_GLES_LoadLibrary(_THIS, const char *path) int Cocoa_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path)
{ {
/* If the profile requested is not GL ES, switch over to WIN_GL functions */ /* If the profile requested is not GL ES, switch over to WIN_GL functions */
if (_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) { if (_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) {
@ -58,7 +58,7 @@ int Cocoa_GLES_LoadLibrary(_THIS, const char *path)
} }
SDL_GLContext SDL_GLContext
Cocoa_GLES_CreateContext(_THIS, SDL_Window *window) Cocoa_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDL_GLContext context; SDL_GLContext context;
@ -92,7 +92,7 @@ Cocoa_GLES_CreateContext(_THIS, SDL_Window *window)
} }
} }
int Cocoa_GLES_DeleteContext(_THIS, SDL_GLContext context) int Cocoa_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context)
{ {
@autoreleasepool { @autoreleasepool {
SDL_EGL_DeleteContext(_this, context); SDL_EGL_DeleteContext(_this, context);
@ -100,21 +100,21 @@ int Cocoa_GLES_DeleteContext(_THIS, SDL_GLContext context)
return 0; return 0;
} }
int Cocoa_GLES_SwapWindow(_THIS, SDL_Window *window) int Cocoa_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
return SDL_EGL_SwapBuffers(_this, ((__bridge SDL_CocoaWindowData *)window->driverdata).egl_surface); return SDL_EGL_SwapBuffers(_this, ((__bridge SDL_CocoaWindowData *)window->driverdata).egl_surface);
} }
} }
int Cocoa_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) int Cocoa_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context)
{ {
@autoreleasepool { @autoreleasepool {
return SDL_EGL_MakeCurrent(_this, window ? ((__bridge SDL_CocoaWindowData *)window->driverdata).egl_surface : EGL_NO_SURFACE, context); return SDL_EGL_MakeCurrent(_this, window ? ((__bridge SDL_CocoaWindowData *)window->driverdata).egl_surface : EGL_NO_SURFACE, context);
} }
} }
int Cocoa_GLES_SetupWindow(_THIS, SDL_Window *window) int Cocoa_GLES_SetupWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
NSView *v; NSView *v;
@ -148,7 +148,7 @@ int Cocoa_GLES_SetupWindow(_THIS, SDL_Window *window)
} }
SDL_EGLSurface SDL_EGLSurface
Cocoa_GLES_GetEGLSurface(_THIS, SDL_Window *window) Cocoa_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
return ((__bridge SDL_CocoaWindowData *)window->driverdata).egl_surface; return ((__bridge SDL_CocoaWindowData *)window->driverdata).egl_surface;

View file

@ -37,8 +37,8 @@
@end @end
/* Initialization/Query functions */ /* Initialization/Query functions */
static int Cocoa_VideoInit(_THIS); static int Cocoa_VideoInit(SDL_VideoDevice *_this);
static void Cocoa_VideoQuit(_THIS); static void Cocoa_VideoQuit(SDL_VideoDevice *_this);
/* Cocoa driver bootstrap functions */ /* Cocoa driver bootstrap functions */
@ -188,7 +188,7 @@ VideoBootStrap COCOA_bootstrap = {
Cocoa_CreateDevice Cocoa_CreateDevice
}; };
int Cocoa_VideoInit(_THIS) int Cocoa_VideoInit(SDL_VideoDevice *_this)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata;
@ -211,7 +211,7 @@ int Cocoa_VideoInit(_THIS)
} }
} }
void Cocoa_VideoQuit(_THIS) void Cocoa_VideoQuit(SDL_VideoDevice *_this)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata;

View file

@ -34,12 +34,12 @@
#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_COCOA) #if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_COCOA)
int Cocoa_Vulkan_LoadLibrary(_THIS, const char *path); int Cocoa_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
void Cocoa_Vulkan_UnloadLibrary(_THIS); void Cocoa_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
SDL_bool Cocoa_Vulkan_GetInstanceExtensions(_THIS, SDL_bool Cocoa_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
unsigned *count, unsigned *count,
const char **names); const char **names);
SDL_bool Cocoa_Vulkan_CreateSurface(_THIS, SDL_bool Cocoa_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window, SDL_Window *window,
VkInstance instance, VkInstance instance,
VkSurfaceKHR *surface); VkSurfaceKHR *surface);

View file

@ -48,7 +48,7 @@ const char *defaultPaths[] = {
/* Since libSDL is most likely a .dylib, need RTLD_DEFAULT not RTLD_SELF. */ /* Since libSDL is most likely a .dylib, need RTLD_DEFAULT not RTLD_SELF. */
#define DEFAULT_HANDLE RTLD_DEFAULT #define DEFAULT_HANDLE RTLD_DEFAULT
int Cocoa_Vulkan_LoadLibrary(_THIS, const char *path) int Cocoa_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path)
{ {
VkExtensionProperties *extensions = NULL; VkExtensionProperties *extensions = NULL;
Uint32 extensionCount = 0; Uint32 extensionCount = 0;
@ -153,7 +153,7 @@ fail:
return -1; return -1;
} }
void Cocoa_Vulkan_UnloadLibrary(_THIS) void Cocoa_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
{ {
if (_this->vulkan_config.loader_handle) { if (_this->vulkan_config.loader_handle) {
if (_this->vulkan_config.loader_handle != DEFAULT_HANDLE) { if (_this->vulkan_config.loader_handle != DEFAULT_HANDLE) {
@ -163,7 +163,7 @@ void Cocoa_Vulkan_UnloadLibrary(_THIS)
} }
} }
SDL_bool Cocoa_Vulkan_GetInstanceExtensions(_THIS, SDL_bool Cocoa_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
unsigned *count, unsigned *count,
const char **names) const char **names)
{ {
@ -179,7 +179,7 @@ SDL_bool Cocoa_Vulkan_GetInstanceExtensions(_THIS,
extensionsForCocoa); extensionsForCocoa);
} }
static SDL_bool Cocoa_Vulkan_CreateSurfaceViaMetalView(_THIS, static SDL_bool Cocoa_Vulkan_CreateSurfaceViaMetalView(SDL_VideoDevice *_this,
SDL_Window *window, SDL_Window *window,
VkInstance instance, VkInstance instance,
VkSurfaceKHR *surface, VkSurfaceKHR *surface,
@ -232,7 +232,7 @@ static SDL_bool Cocoa_Vulkan_CreateSurfaceViaMetalView(_THIS,
return SDL_TRUE; return SDL_TRUE;
} }
SDL_bool Cocoa_Vulkan_CreateSurface(_THIS, SDL_bool Cocoa_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window, SDL_Window *window,
VkInstance instance, VkInstance instance,
VkSurfaceKHR *surface) VkSurfaceKHR *surface)

View file

@ -139,35 +139,35 @@ typedef enum
#endif #endif
@end @end
extern int Cocoa_CreateWindow(_THIS, SDL_Window *window); extern int Cocoa_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern int Cocoa_CreateWindowFrom(_THIS, SDL_Window *window, extern int Cocoa_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window,
const void *data); const void *data);
extern void Cocoa_SetWindowTitle(_THIS, SDL_Window *window); extern void Cocoa_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window);
extern int Cocoa_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon); extern int Cocoa_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon);
extern int Cocoa_SetWindowPosition(_THIS, SDL_Window *window); extern int Cocoa_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window);
extern void Cocoa_SetWindowSize(_THIS, SDL_Window *window); extern void Cocoa_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window);
extern void Cocoa_SetWindowMinimumSize(_THIS, SDL_Window *window); extern void Cocoa_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window *window);
extern void Cocoa_SetWindowMaximumSize(_THIS, SDL_Window *window); extern void Cocoa_SetWindowMaximumSize(SDL_VideoDevice *_this, SDL_Window *window);
extern void Cocoa_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h); extern void Cocoa_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h);
extern int Cocoa_SetWindowOpacity(_THIS, SDL_Window *window, float opacity); extern int Cocoa_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opacity);
extern void Cocoa_ShowWindow(_THIS, SDL_Window *window); extern void Cocoa_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void Cocoa_HideWindow(_THIS, SDL_Window *window); extern void Cocoa_HideWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void Cocoa_RaiseWindow(_THIS, SDL_Window *window); extern void Cocoa_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void Cocoa_MaximizeWindow(_THIS, SDL_Window *window); extern void Cocoa_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void Cocoa_MinimizeWindow(_THIS, SDL_Window *window); extern void Cocoa_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void Cocoa_RestoreWindow(_THIS, SDL_Window *window); extern void Cocoa_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void Cocoa_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered); extern void Cocoa_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered);
extern void Cocoa_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable); extern void Cocoa_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable);
extern void Cocoa_SetWindowAlwaysOnTop(_THIS, SDL_Window *window, SDL_bool on_top); extern void Cocoa_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool on_top);
extern void Cocoa_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); extern void Cocoa_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen);
extern void *Cocoa_GetWindowICCProfile(_THIS, SDL_Window *window, size_t *size); extern void *Cocoa_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size);
extern SDL_DisplayID Cocoa_GetDisplayForWindow(_THIS, SDL_Window *window); extern SDL_DisplayID Cocoa_GetDisplayForWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void Cocoa_SetWindowMouseRect(_THIS, SDL_Window *window); extern void Cocoa_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window);
extern void Cocoa_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed); extern void Cocoa_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed);
extern void Cocoa_DestroyWindow(_THIS, SDL_Window *window); extern void Cocoa_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern int Cocoa_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info); extern int Cocoa_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info);
extern int Cocoa_SetWindowHitTest(SDL_Window *window, SDL_bool enabled); extern int Cocoa_SetWindowHitTest(SDL_Window *window, SDL_bool enabled);
extern void Cocoa_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept); extern void Cocoa_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept);
extern int Cocoa_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation); extern int Cocoa_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation);
#endif /* SDL_cocoawindow_h_ */ #endif /* SDL_cocoawindow_h_ */

View file

@ -1655,7 +1655,7 @@ static int Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL_
@end @end
static int SetupWindowData(_THIS, SDL_Window *window, NSWindow *nswindow, NSView *nsview, SDL_bool created) static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, NSWindow *nswindow, NSView *nsview, SDL_bool created)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaVideoData *videodata = (__bridge SDL_CocoaVideoData *)_this->driverdata; SDL_CocoaVideoData *videodata = (__bridge SDL_CocoaVideoData *)_this->driverdata;
@ -1772,7 +1772,7 @@ static int SetupWindowData(_THIS, SDL_Window *window, NSWindow *nswindow, NSView
} }
} }
int Cocoa_CreateWindow(_THIS, SDL_Window *window) int Cocoa_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaVideoData *videodata = (__bridge SDL_CocoaVideoData *)_this->driverdata; SDL_CocoaVideoData *videodata = (__bridge SDL_CocoaVideoData *)_this->driverdata;
@ -1919,7 +1919,7 @@ int Cocoa_CreateWindow(_THIS, SDL_Window *window)
} }
} }
int Cocoa_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) int Cocoa_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data)
{ {
@autoreleasepool { @autoreleasepool {
NSView *nsview = nil; NSView *nsview = nil;
@ -1960,7 +1960,7 @@ int Cocoa_CreateWindowFrom(_THIS, SDL_Window *window, const void *data)
} }
} }
void Cocoa_SetWindowTitle(_THIS, SDL_Window *window) void Cocoa_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
const char *title = window->title ? window->title : ""; const char *title = window->title ? window->title : "";
@ -1970,7 +1970,7 @@ void Cocoa_SetWindowTitle(_THIS, SDL_Window *window)
} }
} }
int Cocoa_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon) int Cocoa_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon)
{ {
@autoreleasepool { @autoreleasepool {
NSImage *nsimage = Cocoa_CreateImage(icon); NSImage *nsimage = Cocoa_CreateImage(icon);
@ -1985,7 +1985,7 @@ int Cocoa_SetWindowIcon(_THIS, SDL_Window *window, SDL_Surface *icon)
} }
} }
int Cocoa_SetWindowPosition(_THIS, SDL_Window *window) int Cocoa_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata;
@ -2029,7 +2029,7 @@ int Cocoa_SetWindowPosition(_THIS, SDL_Window *window)
return 0; return 0;
} }
void Cocoa_SetWindowSize(_THIS, SDL_Window *window) void Cocoa_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata;
@ -2058,7 +2058,7 @@ void Cocoa_SetWindowSize(_THIS, SDL_Window *window)
} }
} }
void Cocoa_SetWindowMinimumSize(_THIS, SDL_Window *window) void Cocoa_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata;
@ -2071,7 +2071,7 @@ void Cocoa_SetWindowMinimumSize(_THIS, SDL_Window *window)
} }
} }
void Cocoa_SetWindowMaximumSize(_THIS, SDL_Window *window) void Cocoa_SetWindowMaximumSize(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata;
@ -2084,7 +2084,7 @@ void Cocoa_SetWindowMaximumSize(_THIS, SDL_Window *window)
} }
} }
void Cocoa_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h) void Cocoa_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata;
@ -2101,7 +2101,7 @@ void Cocoa_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h)
} }
} }
void Cocoa_ShowWindow(_THIS, SDL_Window *window) void Cocoa_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *windowData = ((__bridge SDL_CocoaWindowData *)window->driverdata); SDL_CocoaWindowData *windowData = ((__bridge SDL_CocoaWindowData *)window->driverdata);
@ -2115,7 +2115,7 @@ void Cocoa_ShowWindow(_THIS, SDL_Window *window)
} }
} }
void Cocoa_HideWindow(_THIS, SDL_Window *window) void Cocoa_HideWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow;
@ -2138,7 +2138,7 @@ void Cocoa_HideWindow(_THIS, SDL_Window *window)
} }
} }
void Cocoa_RaiseWindow(_THIS, SDL_Window *window) void Cocoa_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *windowData = ((__bridge SDL_CocoaWindowData *)window->driverdata); SDL_CocoaWindowData *windowData = ((__bridge SDL_CocoaWindowData *)window->driverdata);
@ -2156,7 +2156,7 @@ void Cocoa_RaiseWindow(_THIS, SDL_Window *window)
} }
} }
void Cocoa_MaximizeWindow(_THIS, SDL_Window *window) void Cocoa_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata;
@ -2168,7 +2168,7 @@ void Cocoa_MaximizeWindow(_THIS, SDL_Window *window)
} }
} }
void Cocoa_MinimizeWindow(_THIS, SDL_Window *window) void Cocoa_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata;
@ -2181,7 +2181,7 @@ void Cocoa_MinimizeWindow(_THIS, SDL_Window *window)
} }
} }
void Cocoa_RestoreWindow(_THIS, SDL_Window *window) void Cocoa_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow;
@ -2194,7 +2194,7 @@ void Cocoa_RestoreWindow(_THIS, SDL_Window *window)
} }
} }
void Cocoa_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered) void Cocoa_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered)
{ {
@autoreleasepool { @autoreleasepool {
if (SetWindowStyle(window, GetWindowStyle(window))) { if (SetWindowStyle(window, GetWindowStyle(window))) {
@ -2205,7 +2205,7 @@ void Cocoa_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered)
} }
} }
void Cocoa_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable) void Cocoa_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable)
{ {
@autoreleasepool { @autoreleasepool {
/* Don't set this if we're in a space! /* Don't set this if we're in a space!
@ -2230,7 +2230,7 @@ void Cocoa_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable)
} }
} }
void Cocoa_SetWindowAlwaysOnTop(_THIS, SDL_Window *window, SDL_bool on_top) void Cocoa_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool on_top)
{ {
@autoreleasepool { @autoreleasepool {
NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow;
@ -2242,7 +2242,7 @@ void Cocoa_SetWindowAlwaysOnTop(_THIS, SDL_Window *window, SDL_bool on_top)
} }
} }
void Cocoa_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) void Cocoa_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata;
@ -2332,7 +2332,7 @@ void Cocoa_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *disp
} }
void * void *
Cocoa_GetWindowICCProfile(_THIS, SDL_Window *window, size_t *size) Cocoa_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata;
@ -2369,7 +2369,7 @@ Cocoa_GetWindowICCProfile(_THIS, SDL_Window *window, size_t *size)
} }
} }
SDL_DisplayID Cocoa_GetDisplayForWindow(_THIS, SDL_Window *window) SDL_DisplayID Cocoa_GetDisplayForWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
NSScreen *screen; NSScreen *screen;
@ -2405,12 +2405,12 @@ SDL_DisplayID Cocoa_GetDisplayForWindow(_THIS, SDL_Window *window)
} }
} }
void Cocoa_SetWindowMouseRect(_THIS, SDL_Window *window) void Cocoa_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window)
{ {
Cocoa_UpdateClipCursor(window); Cocoa_UpdateClipCursor(window);
} }
void Cocoa_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed) void Cocoa_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata;
@ -2431,7 +2431,7 @@ void Cocoa_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed)
} }
} }
void Cocoa_DestroyWindow(_THIS, SDL_Window *window) void Cocoa_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *data = (SDL_CocoaWindowData *)CFBridgingRelease(window->driverdata); SDL_CocoaWindowData *data = (SDL_CocoaWindowData *)CFBridgingRelease(window->driverdata);
@ -2474,7 +2474,7 @@ void Cocoa_DestroyWindow(_THIS, SDL_Window *window)
} }
} }
int Cocoa_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info) int Cocoa_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, SDL_SysWMinfo *info)
{ {
@autoreleasepool { @autoreleasepool {
NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow;
@ -2562,7 +2562,7 @@ void Cocoa_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept)
} }
} }
int Cocoa_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation) int Cocoa_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation)
{ {
@autoreleasepool { @autoreleasepool {
/* Note that this is app-wide and not window-specific! */ /* Note that this is app-wide and not window-specific! */
@ -2590,7 +2590,7 @@ int Cocoa_FlashWindow(_THIS, SDL_Window *window, SDL_FlashOperation operation)
} }
} }
int Cocoa_SetWindowOpacity(_THIS, SDL_Window *window, float opacity) int Cocoa_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opacity)
{ {
@autoreleasepool { @autoreleasepool {
SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata;

View file

@ -30,7 +30,7 @@
#include "SDL_nullvideo.h" #include "SDL_nullvideo.h"
#include "SDL_nullevents_c.h" #include "SDL_nullevents_c.h"
void DUMMY_PumpEvents(_THIS) void DUMMY_PumpEvents(SDL_VideoDevice *_this)
{ {
/* do nothing. */ /* do nothing. */
} }

View file

@ -26,6 +26,6 @@
#include "SDL_nullvideo.h" #include "SDL_nullvideo.h"
extern void DUMMY_PumpEvents(_THIS); extern void DUMMY_PumpEvents(SDL_VideoDevice *_this);
#endif /* SDL_nullevents_c_h_ */ #endif /* SDL_nullevents_c_h_ */

View file

@ -27,7 +27,7 @@
#define DUMMY_SURFACE "_SDL_DummySurface" #define DUMMY_SURFACE "_SDL_DummySurface"
int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) int SDL_DUMMY_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
{ {
SDL_Surface *surface; SDL_Surface *surface;
const Uint32 surface_format = SDL_PIXELFORMAT_RGB888; const Uint32 surface_format = SDL_PIXELFORMAT_RGB888;
@ -51,7 +51,7 @@ int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format,
return 0; return 0;
} }
int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) int SDL_DUMMY_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects)
{ {
static int frame_number; static int frame_number;
SDL_Surface *surface; SDL_Surface *surface;
@ -71,7 +71,7 @@ int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect
return 0; return 0;
} }
void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window *window) void SDL_DUMMY_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_Surface *surface; SDL_Surface *surface;

View file

@ -24,8 +24,8 @@
#include "SDL_internal.h" #include "SDL_internal.h"
extern int SDL_DUMMY_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); extern int SDL_DUMMY_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch);
extern int SDL_DUMMY_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); extern int SDL_DUMMY_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects);
extern void SDL_DUMMY_DestroyWindowFramebuffer(_THIS, SDL_Window *window); extern void SDL_DUMMY_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window);
#endif /* SDL_nullframebuffer_c_h_ */ #endif /* SDL_nullframebuffer_c_h_ */

View file

@ -49,13 +49,13 @@
#define DUMMYVID_DRIVER_EVDEV_NAME "evdev" #define DUMMYVID_DRIVER_EVDEV_NAME "evdev"
/* Initialization/Query functions */ /* Initialization/Query functions */
static int DUMMY_VideoInit(_THIS); static int DUMMY_VideoInit(SDL_VideoDevice *_this);
static int DUMMY_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); static int DUMMY_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
static void DUMMY_VideoQuit(_THIS); static void DUMMY_VideoQuit(SDL_VideoDevice *_this);
#ifdef SDL_INPUT_LINUXEV #ifdef SDL_INPUT_LINUXEV
static int evdev = 0; static int evdev = 0;
static void DUMMY_EVDEV_Poll(_THIS); static void DUMMY_EVDEV_Poll(SDL_VideoDevice *_this);
#endif #endif
/* DUMMY driver bootstrap functions */ /* DUMMY driver bootstrap functions */
@ -130,14 +130,14 @@ VideoBootStrap DUMMY_evdev_bootstrap = {
void SDL_EVDEV_Init(void); void SDL_EVDEV_Init(void);
void SDL_EVDEV_Poll(void); void SDL_EVDEV_Poll(void);
void SDL_EVDEV_Quit(void); void SDL_EVDEV_Quit(void);
static void DUMMY_EVDEV_Poll(_THIS) static void DUMMY_EVDEV_Poll(SDL_VideoDevice *_this)
{ {
(void)_this; (void)_this;
SDL_EVDEV_Poll(); SDL_EVDEV_Poll();
} }
#endif #endif
int DUMMY_VideoInit(_THIS) int DUMMY_VideoInit(SDL_VideoDevice *_this)
{ {
SDL_DisplayMode mode; SDL_DisplayMode mode;
@ -158,12 +158,12 @@ int DUMMY_VideoInit(_THIS)
return 0; return 0;
} }
static int DUMMY_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) static int DUMMY_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
{ {
return 0; return 0;
} }
void DUMMY_VideoQuit(_THIS) void DUMMY_VideoQuit(SDL_VideoDevice *_this)
{ {
#ifdef SDL_INPUT_LINUXEV #ifdef SDL_INPUT_LINUXEV
SDL_EVDEV_Quit(); SDL_EVDEV_Quit();

View file

@ -27,7 +27,7 @@
#include <emscripten/threading.h> #include <emscripten/threading.h>
int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) int Emscripten_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
{ {
SDL_Surface *surface; SDL_Surface *surface;
const Uint32 surface_format = SDL_PIXELFORMAT_BGR888; const Uint32 surface_format = SDL_PIXELFORMAT_BGR888;
@ -54,7 +54,7 @@ int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format
return 0; return 0;
} }
int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) int Emscripten_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects)
{ {
SDL_Surface *surface; SDL_Surface *surface;
@ -150,7 +150,7 @@ int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect
return 0; return 0;
} }
void Emscripten_DestroyWindowFramebuffer(_THIS, SDL_Window *window) void Emscripten_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_WindowData *data = window->driverdata; SDL_WindowData *data = window->driverdata;

View file

@ -23,8 +23,8 @@
#ifndef SDL_emscriptenframebuffer_h_ #ifndef SDL_emscriptenframebuffer_h_
#define SDL_emscriptenframebuffer_h_ #define SDL_emscriptenframebuffer_h_
extern int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); extern int Emscripten_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch);
extern int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); extern int Emscripten_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects);
extern void Emscripten_DestroyWindowFramebuffer(_THIS, SDL_Window *window); extern void Emscripten_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window);
#endif /* SDL_emscriptenframebuffer_h_ */ #endif /* SDL_emscriptenframebuffer_h_ */

View file

@ -29,21 +29,21 @@
#include "SDL_emscriptenvideo.h" #include "SDL_emscriptenvideo.h"
#include "SDL_emscriptenopengles.h" #include "SDL_emscriptenopengles.h"
int Emscripten_GLES_LoadLibrary(_THIS, const char *path) int Emscripten_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path)
{ {
return 0; return 0;
} }
void Emscripten_GLES_UnloadLibrary(_THIS) void Emscripten_GLES_UnloadLibrary(SDL_VideoDevice *_this)
{ {
} }
SDL_FunctionPointer Emscripten_GLES_GetProcAddress(_THIS, const char *proc) SDL_FunctionPointer Emscripten_GLES_GetProcAddress(SDL_VideoDevice *_this, const char *proc)
{ {
return emscripten_webgl_get_proc_address(proc); return emscripten_webgl_get_proc_address(proc);
} }
int Emscripten_GLES_SetSwapInterval(_THIS, int interval) int Emscripten_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval)
{ {
if (interval < 0) { if (interval < 0) {
return SDL_SetError("Late swap tearing currently unsupported"); return SDL_SetError("Late swap tearing currently unsupported");
@ -56,7 +56,7 @@ int Emscripten_GLES_SetSwapInterval(_THIS, int interval)
return 0; return 0;
} }
int Emscripten_GLES_GetSwapInterval(_THIS, int *interval) int Emscripten_GLES_GetSwapInterval(SDL_VideoDevice *_this, int *interval)
{ {
int mode, value; int mode, value;
@ -71,7 +71,7 @@ int Emscripten_GLES_GetSwapInterval(_THIS, int *interval)
} }
} }
SDL_GLContext Emscripten_GLES_CreateContext(_THIS, SDL_Window *window) SDL_GLContext Emscripten_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_WindowData *window_data; SDL_WindowData *window_data;
@ -112,7 +112,7 @@ SDL_GLContext Emscripten_GLES_CreateContext(_THIS, SDL_Window *window)
return (SDL_GLContext)context; return (SDL_GLContext)context;
} }
int Emscripten_GLES_DeleteContext(_THIS, SDL_GLContext context) int Emscripten_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context)
{ {
SDL_Window *window; SDL_Window *window;
@ -129,7 +129,7 @@ int Emscripten_GLES_DeleteContext(_THIS, SDL_GLContext context)
return 0; return 0;
} }
int Emscripten_GLES_SwapWindow(_THIS, SDL_Window *window) int Emscripten_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
if (emscripten_has_asyncify() && SDL_GetHintBoolean(SDL_HINT_EMSCRIPTEN_ASYNCIFY, SDL_TRUE)) { if (emscripten_has_asyncify() && SDL_GetHintBoolean(SDL_HINT_EMSCRIPTEN_ASYNCIFY, SDL_TRUE)) {
/* give back control to browser for screen refresh */ /* give back control to browser for screen refresh */
@ -138,7 +138,7 @@ int Emscripten_GLES_SwapWindow(_THIS, SDL_Window *window)
return 0; return 0;
} }
int Emscripten_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) int Emscripten_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context)
{ {
/* it isn't possible to reuse contexts across canvases */ /* it isn't possible to reuse contexts across canvases */
if (window && context) { if (window && context) {

View file

@ -28,15 +28,15 @@
#include "../SDL_sysvideo.h" #include "../SDL_sysvideo.h"
/* OpenGLES functions */ /* OpenGLES functions */
extern int Emscripten_GLES_LoadLibrary(_THIS, const char *path); extern int Emscripten_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path);
extern void Emscripten_GLES_UnloadLibrary(_THIS); extern void Emscripten_GLES_UnloadLibrary(SDL_VideoDevice *_this);
extern SDL_FunctionPointer Emscripten_GLES_GetProcAddress(_THIS, const char *proc); extern SDL_FunctionPointer Emscripten_GLES_GetProcAddress(SDL_VideoDevice *_this, const char *proc);
extern int Emscripten_GLES_SetSwapInterval(_THIS, int interval); extern int Emscripten_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval);
extern int Emscripten_GLES_GetSwapInterval(_THIS, int *interval); extern int Emscripten_GLES_GetSwapInterval(SDL_VideoDevice *_this, int *interval);
extern SDL_GLContext Emscripten_GLES_CreateContext(_THIS, SDL_Window *window); extern SDL_GLContext Emscripten_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window);
extern int Emscripten_GLES_DeleteContext(_THIS, SDL_GLContext context); extern int Emscripten_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context);
extern int Emscripten_GLES_SwapWindow(_THIS, SDL_Window *window); extern int Emscripten_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern int Emscripten_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); extern int Emscripten_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context);
#endif /* SDL_VIDEO_DRIVER_EMSCRIPTEN */ #endif /* SDL_VIDEO_DRIVER_EMSCRIPTEN */

View file

@ -35,18 +35,18 @@
#define EMSCRIPTENVID_DRIVER_NAME "emscripten" #define EMSCRIPTENVID_DRIVER_NAME "emscripten"
/* Initialization/Query functions */ /* Initialization/Query functions */
static int Emscripten_VideoInit(_THIS); static int Emscripten_VideoInit(SDL_VideoDevice *_this);
static int Emscripten_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); static int Emscripten_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
static void Emscripten_VideoQuit(_THIS); static void Emscripten_VideoQuit(SDL_VideoDevice *_this);
static int Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); static int Emscripten_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect);
static int Emscripten_CreateWindow(_THIS, SDL_Window *window); static int Emscripten_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window);
static void Emscripten_SetWindowSize(_THIS, SDL_Window *window); static void Emscripten_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window);
static void Emscripten_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h); static void Emscripten_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h);
static void Emscripten_DestroyWindow(_THIS, SDL_Window *window); static void Emscripten_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window);
static void Emscripten_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); static void Emscripten_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen);
static void Emscripten_PumpEvents(_THIS); static void Emscripten_PumpEvents(SDL_VideoDevice *_this);
static void Emscripten_SetWindowTitle(_THIS, SDL_Window *window); static void Emscripten_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window);
/* Emscripten driver bootstrap functions */ /* Emscripten driver bootstrap functions */
@ -120,7 +120,7 @@ VideoBootStrap Emscripten_bootstrap = {
Emscripten_CreateDevice Emscripten_CreateDevice
}; };
int Emscripten_VideoInit(_THIS) int Emscripten_VideoInit(SDL_VideoDevice *_this)
{ {
SDL_DisplayMode mode; SDL_DisplayMode mode;
@ -140,18 +140,18 @@ int Emscripten_VideoInit(_THIS)
return 0; return 0;
} }
static int Emscripten_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) static int Emscripten_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
{ {
/* can't do this */ /* can't do this */
return 0; return 0;
} }
static void Emscripten_VideoQuit(_THIS) static void Emscripten_VideoQuit(SDL_VideoDevice *_this)
{ {
Emscripten_FiniMouse(); Emscripten_FiniMouse();
} }
static int Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) static int Emscripten_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect)
{ {
if (rect) { if (rect) {
rect->x = 0; rect->x = 0;
@ -166,12 +166,12 @@ static int Emscripten_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, S
return 0; return 0;
} }
static void Emscripten_PumpEvents(_THIS) static void Emscripten_PumpEvents(SDL_VideoDevice *_this)
{ {
/* do nothing. */ /* do nothing. */
} }
static int Emscripten_CreateWindow(_THIS, SDL_Window *window) static int Emscripten_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_WindowData *wdata; SDL_WindowData *wdata;
double scaled_w, scaled_h; double scaled_w, scaled_h;
@ -238,7 +238,7 @@ static int Emscripten_CreateWindow(_THIS, SDL_Window *window)
return 0; return 0;
} }
static void Emscripten_SetWindowSize(_THIS, SDL_Window *window) static void Emscripten_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_WindowData *data; SDL_WindowData *data;
@ -257,7 +257,7 @@ static void Emscripten_SetWindowSize(_THIS, SDL_Window *window)
} }
} }
static void Emscripten_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w, int *h) static void Emscripten_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h)
{ {
SDL_WindowData *data; SDL_WindowData *data;
if (window->driverdata) { if (window->driverdata) {
@ -267,7 +267,7 @@ static void Emscripten_GetWindowSizeInPixels(_THIS, SDL_Window *window, int *w,
} }
} }
static void Emscripten_DestroyWindow(_THIS, SDL_Window *window) static void Emscripten_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_WindowData *data; SDL_WindowData *data;
@ -285,7 +285,7 @@ static void Emscripten_DestroyWindow(_THIS, SDL_Window *window)
} }
} }
static void Emscripten_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) static void Emscripten_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
{ {
SDL_WindowData *data; SDL_WindowData *data;
if (window->driverdata) { if (window->driverdata) {
@ -324,7 +324,7 @@ static void Emscripten_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoD
} }
} }
static void Emscripten_SetWindowTitle(_THIS, SDL_Window *window) static void Emscripten_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window)
{ {
emscripten_set_window_title(window->title); emscripten_set_window_title(window->title);
} }

View file

@ -34,7 +34,7 @@
extern "C" { extern "C" {
#endif #endif
int HAIKU_SetClipboardText(_THIS, const char *text) { int HAIKU_SetClipboardText(SDL_VideoDevice *_this, const char *text) {
BMessage *clip = NULL; BMessage *clip = NULL;
if (be_clipboard->Lock()) { if (be_clipboard->Lock()) {
be_clipboard->Clear(); be_clipboard->Clear();
@ -50,7 +50,7 @@ int HAIKU_SetClipboardText(_THIS, const char *text) {
return 0; return 0;
} }
char *HAIKU_GetClipboardText(_THIS) { char *HAIKU_GetClipboardText(SDL_VideoDevice *_this) {
BMessage *clip = NULL; BMessage *clip = NULL;
const char *text = NULL; const char *text = NULL;
ssize_t length; ssize_t length;
@ -75,7 +75,7 @@ char *HAIKU_GetClipboardText(_THIS) {
return result; return result;
} }
SDL_bool HAIKU_HasClipboardText(_THIS) { SDL_bool HAIKU_HasClipboardText(SDL_VideoDevice *_this) {
SDL_bool result = SDL_FALSE; SDL_bool result = SDL_FALSE;
char *text = HAIKU_GetClipboardText(_this); char *text = HAIKU_GetClipboardText(_this);
if (text) { if (text) {

View file

@ -24,8 +24,8 @@
#ifndef SDL_BCLIPBOARD_H #ifndef SDL_BCLIPBOARD_H
#define SDL_BCLIPBOARD_H #define SDL_BCLIPBOARD_H
extern int HAIKU_SetClipboardText(_THIS, const char *text); extern int HAIKU_SetClipboardText(SDL_VideoDevice *_this, const char *text);
extern char *HAIKU_GetClipboardText(_THIS); extern char *HAIKU_GetClipboardText(SDL_VideoDevice *_this);
extern SDL_bool HAIKU_HasClipboardText(_THIS); extern SDL_bool HAIKU_HasClipboardText(SDL_VideoDevice *_this);
#endif #endif

View file

@ -28,7 +28,7 @@
extern "C" { extern "C" {
#endif #endif
void HAIKU_PumpEvents(_THIS) { void HAIKU_PumpEvents(SDL_VideoDevice *_this) {
/* Since the event thread is its own thread, this isn't really necessary */ /* Since the event thread is its own thread, this isn't really necessary */
} }

View file

@ -28,7 +28,7 @@
extern "C" { extern "C" {
#endif #endif
extern void HAIKU_PumpEvents(_THIS); extern void HAIKU_PumpEvents(SDL_VideoDevice *_this);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -43,7 +43,7 @@ static SDL_INLINE SDL_BLooper *_GetBeLooper() {
return SDL_Looper; return SDL_Looper;
} }
int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window * window, int HAIKU_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window,
Uint32 * format, Uint32 * format,
void ** pixels, int *pitch) { void ** pixels, int *pitch) {
SDL_BWin *bwin = _ToBeWin(window); SDL_BWin *bwin = _ToBeWin(window);
@ -92,7 +92,7 @@ int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window * window,
int HAIKU_UpdateWindowFramebuffer(_THIS, SDL_Window * window, int HAIKU_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window,
const SDL_Rect * rects, int numrects) { const SDL_Rect * rects, int numrects) {
if (window == NULL) { if (window == NULL) {
return 0; return 0;
@ -105,7 +105,7 @@ int HAIKU_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
return 0; return 0;
} }
void HAIKU_DestroyWindowFramebuffer(_THIS, SDL_Window * window) { void HAIKU_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window) {
SDL_BWin *bwin = _ToBeWin(window); SDL_BWin *bwin = _ToBeWin(window);
bwin->LockBuffer(); bwin->LockBuffer();

View file

@ -30,12 +30,12 @@ extern "C" {
#include "../SDL_sysvideo.h" #include "../SDL_sysvideo.h"
extern int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window *window, extern int HAIKU_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window,
Uint32 *format, Uint32 *format,
void **pixels, int *pitch); void **pixels, int *pitch);
extern int HAIKU_UpdateWindowFramebuffer(_THIS, SDL_Window *window, extern int HAIKU_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window,
const SDL_Rect *rects, int numrects); const SDL_Rect *rects, int numrects);
extern void HAIKU_DestroyWindowFramebuffer(_THIS, SDL_Window *window); extern void HAIKU_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window);
extern int32 HAIKU_DrawThread(void *data); extern int32 HAIKU_DrawThread(void *data);
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -201,7 +201,7 @@ static void _AddDisplay(BScreen *screen) {
* Functions called by SDL * Functions called by SDL
*/ */
int HAIKU_InitModes(_THIS) { int HAIKU_InitModes(SDL_VideoDevice *_this) {
BScreen screen; BScreen screen;
/* TODO: When Haiku supports multiple display screens, call /* TODO: When Haiku supports multiple display screens, call
@ -210,13 +210,13 @@ int HAIKU_InitModes(_THIS) {
return 0; return 0;
} }
int HAIKU_QuitModes(_THIS) { int HAIKU_QuitModes(SDL_VideoDevice *_this) {
/* FIXME: Nothing really needs to be done here at the moment? */ /* FIXME: Nothing really needs to be done here at the moment? */
return 0; return 0;
} }
int HAIKU_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) { int HAIKU_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) {
BScreen bscreen; BScreen bscreen;
BRect rc = bscreen.Frame(); BRect rc = bscreen.Frame();
rect->x = (int)rc.left; rect->x = (int)rc.left;
@ -226,7 +226,7 @@ int HAIKU_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) {
return 0; return 0;
} }
int HAIKU_GetDisplayModes(_THIS, SDL_VideoDisplay *display) { int HAIKU_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) {
/* Get the current screen */ /* Get the current screen */
BScreen bscreen; BScreen bscreen;
@ -252,7 +252,7 @@ int HAIKU_GetDisplayModes(_THIS, SDL_VideoDisplay *display) {
} }
int HAIKU_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { int HAIKU_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) {
/* Get the current screen */ /* Get the current screen */
BScreen bscreen; BScreen bscreen;
if (!bscreen.IsValid()) { if (!bscreen.IsValid()) {

View file

@ -30,12 +30,12 @@ extern "C" {
extern int32 HAIKU_ColorSpaceToSDLPxFormat(uint32 colorspace); extern int32 HAIKU_ColorSpaceToSDLPxFormat(uint32 colorspace);
extern int HAIKU_InitModes(_THIS); extern int HAIKU_InitModes(SDL_VideoDevice *_this);
extern int HAIKU_QuitModes(_THIS); extern int HAIKU_QuitModes(SDL_VideoDevice *_this);
extern int HAIKU_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, extern int HAIKU_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display,
SDL_Rect *rect); SDL_Rect *rect);
extern int HAIKU_GetDisplayModes(_THIS, SDL_VideoDisplay *display); extern int HAIKU_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display);
extern int HAIKU_SetDisplayMode(_THIS, SDL_VideoDisplay *display, extern int HAIKU_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display,
SDL_DisplayMode *mode); SDL_DisplayMode *mode);
#ifdef __cplusplus #ifdef __cplusplus

View file

@ -44,7 +44,7 @@ static SDL_INLINE SDL_BLooper *_GetBeLooper() {
} }
/* Passing a NULL path means load pointers from the application */ /* Passing a NULL path means load pointers from the application */
int HAIKU_GL_LoadLibrary(_THIS, const char *path) int HAIKU_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path)
{ {
/* FIXME: Is this working correctly? */ /* FIXME: Is this working correctly? */
image_info info; image_info info;
@ -63,7 +63,7 @@ int HAIKU_GL_LoadLibrary(_THIS, const char *path)
return 0; return 0;
} }
SDL_FunctionPointer HAIKU_GL_GetProcAddress(_THIS, const char *proc) SDL_FunctionPointer HAIKU_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc)
{ {
if (_this->gl_config.dll_handle != NULL) { if (_this->gl_config.dll_handle != NULL) {
void *location = NULL; void *location = NULL;
@ -84,12 +84,12 @@ SDL_FunctionPointer HAIKU_GL_GetProcAddress(_THIS, const char *proc)
} }
int HAIKU_GL_SwapWindow(_THIS, SDL_Window * window) { int HAIKU_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window * window) {
_ToBeWin(window)->SwapBuffers(); _ToBeWin(window)->SwapBuffers();
return 0; return 0;
} }
int HAIKU_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) { int HAIKU_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window * window, SDL_GLContext context) {
BGLView* glView = (BGLView*)context; BGLView* glView = (BGLView*)context;
// printf("HAIKU_GL_MakeCurrent(%llx), win = %llx, thread = %d\n", (uint64)context, (uint64)window, find_thread(NULL)); // printf("HAIKU_GL_MakeCurrent(%llx), win = %llx, thread = %d\n", (uint64)context, (uint64)window, find_thread(NULL));
if (glView != NULL) { if (glView != NULL) {
@ -102,7 +102,7 @@ int HAIKU_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) {
} }
SDL_GLContext HAIKU_GL_CreateContext(_THIS, SDL_Window * window) { SDL_GLContext HAIKU_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window * window) {
/* FIXME: Not sure what flags should be included here; may want to have /* FIXME: Not sure what flags should be included here; may want to have
most of them */ most of them */
SDL_BWin *bwin = _ToBeWin(window); SDL_BWin *bwin = _ToBeWin(window);
@ -142,7 +142,7 @@ SDL_GLContext HAIKU_GL_CreateContext(_THIS, SDL_Window * window) {
return (SDL_GLContext)(bwin->GetGLView()); return (SDL_GLContext)(bwin->GetGLView());
} }
int HAIKU_GL_DeleteContext(_THIS, SDL_GLContext context) { int HAIKU_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) {
// printf("HAIKU_GL_DeleteContext(%llx), thread = %d\n", (uint64)context, find_thread(NULL)); // printf("HAIKU_GL_DeleteContext(%llx), thread = %d\n", (uint64)context, find_thread(NULL));
BGLView* glView = (BGLView*)context; BGLView* glView = (BGLView*)context;
SDL_BWin *bwin = (SDL_BWin*)glView->Window(); SDL_BWin *bwin = (SDL_BWin*)glView->Window();
@ -155,17 +155,17 @@ int HAIKU_GL_DeleteContext(_THIS, SDL_GLContext context) {
} }
int HAIKU_GL_SetSwapInterval(_THIS, int interval) { int HAIKU_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval) {
/* TODO: Implement this, if necessary? */ /* TODO: Implement this, if necessary? */
return SDL_Unsupported(); return SDL_Unsupported();
} }
int HAIKU_GL_GetSwapInterval(_THIS, int *interval) { int HAIKU_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval) {
return SDL_Unsupported(); return SDL_Unsupported();
} }
void HAIKU_GL_UnloadLibrary(_THIS) { void HAIKU_GL_UnloadLibrary(SDL_VideoDevice *_this) {
/* TODO: Implement this, if necessary? */ /* TODO: Implement this, if necessary? */
} }
@ -173,7 +173,7 @@ void HAIKU_GL_UnloadLibrary(_THIS) {
/* FIXME: This function is meant to clear the OpenGL context when the video /* FIXME: This function is meant to clear the OpenGL context when the video
mode changes (see SDL_bmodes.cc), but it doesn't seem to help, and is not mode changes (see SDL_bmodes.cc), but it doesn't seem to help, and is not
currently in use. */ currently in use. */
void HAIKU_GL_RebootContexts(_THIS) { void HAIKU_GL_RebootContexts(SDL_VideoDevice *_this) {
SDL_Window *window = _this->windows; SDL_Window *window = _this->windows;
while (window) { while (window) {
SDL_BWin *bwin = _ToBeWin(window); SDL_BWin *bwin = _ToBeWin(window);

View file

@ -30,18 +30,18 @@ extern "C" {
#include "../SDL_sysvideo.h" #include "../SDL_sysvideo.h"
extern int HAIKU_GL_LoadLibrary(_THIS, const char *path); /* FIXME */ extern int HAIKU_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path); /* FIXME */
extern SDL_FunctionPointer HAIKU_GL_GetProcAddress(_THIS, const char *proc); /* FIXME */ extern SDL_FunctionPointer HAIKU_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc); /* FIXME */
extern void HAIKU_GL_UnloadLibrary(_THIS); /* TODO */ extern void HAIKU_GL_UnloadLibrary(SDL_VideoDevice *_this); /* TODO */
extern int HAIKU_GL_MakeCurrent(_THIS, SDL_Window *window, extern int HAIKU_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window,
SDL_GLContext context); SDL_GLContext context);
extern int HAIKU_GL_SetSwapInterval(_THIS, int interval); /* TODO */ extern int HAIKU_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval); /* TODO */
extern int HAIKU_GL_GetSwapInterval(_THIS, int *interval); /* TODO */ extern int HAIKU_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval); /* TODO */
extern int HAIKU_GL_SwapWindow(_THIS, SDL_Window *window); extern int HAIKU_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern SDL_GLContext HAIKU_GL_CreateContext(_THIS, SDL_Window *window); extern SDL_GLContext HAIKU_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window);
extern int HAIKU_GL_DeleteContext(_THIS, SDL_GLContext context); extern int HAIKU_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context);
extern void HAIKU_GL_RebootContexts(_THIS); extern void HAIKU_GL_RebootContexts(SDL_VideoDevice *_this);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -243,7 +243,7 @@ static int HAIKU_SetRelativeMouseMode(SDL_bool enabled)
return 0; return 0;
} }
static void HAIKU_MouseInit(_THIS) static void HAIKU_MouseInit(SDL_VideoDevice *_this)
{ {
SDL_Mouse *mouse = SDL_GetMouse(); SDL_Mouse *mouse = SDL_GetMouse();
if (mouse == NULL) { if (mouse == NULL) {
@ -258,7 +258,7 @@ static void HAIKU_MouseInit(_THIS)
SDL_SetDefaultCursor(HAIKU_CreateDefaultCursor()); SDL_SetDefaultCursor(HAIKU_CreateDefaultCursor());
} }
int HAIKU_VideoInit(_THIS) int HAIKU_VideoInit(SDL_VideoDevice *_this)
{ {
/* Initialize the Be Application for appserver interaction */ /* Initialize the Be Application for appserver interaction */
if (SDL_InitBeApp() < 0) { if (SDL_InitBeApp() < 0) {
@ -283,7 +283,7 @@ int HAIKU_VideoInit(_THIS)
return 0; return 0;
} }
void HAIKU_VideoQuit(_THIS) void HAIKU_VideoQuit(SDL_VideoDevice *_this)
{ {
HAIKU_QuitModes(_this); HAIKU_QuitModes(_this);

View file

@ -29,9 +29,9 @@ extern "C" {
#include "../../core/haiku/SDL_BeApp.h" #include "../../core/haiku/SDL_BeApp.h"
#include "../SDL_sysvideo.h" #include "../SDL_sysvideo.h"
extern void HAIKU_VideoQuit(_THIS); extern void HAIKU_VideoQuit(SDL_VideoDevice *_this);
extern int HAIKU_VideoInit(_THIS); extern int HAIKU_VideoInit(SDL_VideoDevice *_this);
extern void HAIKU_DeleteDevice(_THIS); extern void HAIKU_DeleteDevice(SDL_VideoDevice *_this);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -41,7 +41,7 @@ static SDL_INLINE SDL_BLooper *_GetBeLooper() {
return SDL_Looper; return SDL_Looper;
} }
static int _InitWindow(_THIS, SDL_Window *window) { static int _InitWindow(SDL_VideoDevice *_this, SDL_Window *window) {
uint32 flags = 0; uint32 flags = 0;
window_look look = B_TITLED_WINDOW_LOOK; window_look look = B_TITLED_WINDOW_LOOK;
@ -78,7 +78,7 @@ static int _InitWindow(_THIS, SDL_Window *window) {
return 0; return 0;
} }
int HAIKU_CreateWindow(_THIS, SDL_Window *window) { int HAIKU_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window) {
if (_InitWindow(_this, window) < 0) { if (_InitWindow(_this, window) < 0) {
return -1; return -1;
} }
@ -88,7 +88,7 @@ int HAIKU_CreateWindow(_THIS, SDL_Window *window) {
return 0; return 0;
} }
int HAIKU_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) { int HAIKU_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window * window, const void *data) {
SDL_BWin *otherBWin = (SDL_BWin*)data; SDL_BWin *otherBWin = (SDL_BWin*)data;
if (!otherBWin->LockLooper()) { if (!otherBWin->LockLooper()) {
@ -121,69 +121,69 @@ int HAIKU_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) {
return 0; return 0;
} }
void HAIKU_SetWindowTitle(_THIS, SDL_Window * window) { void HAIKU_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window * window) {
BMessage msg(BWIN_SET_TITLE); BMessage msg(BWIN_SET_TITLE);
msg.AddString("window-title", window->title); msg.AddString("window-title", window->title);
_ToBeWin(window)->PostMessage(&msg); _ToBeWin(window)->PostMessage(&msg);
} }
void HAIKU_SetWindowPosition(_THIS, SDL_Window * window) { void HAIKU_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window * window) {
BMessage msg(BWIN_MOVE_WINDOW); BMessage msg(BWIN_MOVE_WINDOW);
msg.AddInt32("window-x", window->x); msg.AddInt32("window-x", window->x);
msg.AddInt32("window-y", window->y); msg.AddInt32("window-y", window->y);
_ToBeWin(window)->PostMessage(&msg); _ToBeWin(window)->PostMessage(&msg);
} }
void HAIKU_SetWindowSize(_THIS, SDL_Window * window) { void HAIKU_SetWindowSize(SDL_VideoDevice *_this, SDL_Window * window) {
BMessage msg(BWIN_RESIZE_WINDOW); BMessage msg(BWIN_RESIZE_WINDOW);
msg.AddInt32("window-w", window->w - 1); msg.AddInt32("window-w", window->w - 1);
msg.AddInt32("window-h", window->h - 1); msg.AddInt32("window-h", window->h - 1);
_ToBeWin(window)->PostMessage(&msg); _ToBeWin(window)->PostMessage(&msg);
} }
void HAIKU_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) { void HAIKU_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window * window, SDL_bool bordered) {
BMessage msg(BWIN_SET_BORDERED); BMessage msg(BWIN_SET_BORDERED);
msg.AddBool("window-border", bordered != SDL_FALSE); msg.AddBool("window-border", bordered != SDL_FALSE);
_ToBeWin(window)->PostMessage(&msg); _ToBeWin(window)->PostMessage(&msg);
} }
void HAIKU_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable) { void HAIKU_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window * window, SDL_bool resizable) {
BMessage msg(BWIN_SET_RESIZABLE); BMessage msg(BWIN_SET_RESIZABLE);
msg.AddBool("window-resizable", resizable != SDL_FALSE); msg.AddBool("window-resizable", resizable != SDL_FALSE);
_ToBeWin(window)->PostMessage(&msg); _ToBeWin(window)->PostMessage(&msg);
} }
void HAIKU_ShowWindow(_THIS, SDL_Window * window) { void HAIKU_ShowWindow(SDL_VideoDevice *_this, SDL_Window * window) {
BMessage msg(BWIN_SHOW_WINDOW); BMessage msg(BWIN_SHOW_WINDOW);
_ToBeWin(window)->PostMessage(&msg); _ToBeWin(window)->PostMessage(&msg);
} }
void HAIKU_HideWindow(_THIS, SDL_Window * window) { void HAIKU_HideWindow(SDL_VideoDevice *_this, SDL_Window * window) {
BMessage msg(BWIN_HIDE_WINDOW); BMessage msg(BWIN_HIDE_WINDOW);
_ToBeWin(window)->PostMessage(&msg); _ToBeWin(window)->PostMessage(&msg);
} }
void HAIKU_RaiseWindow(_THIS, SDL_Window * window) { void HAIKU_RaiseWindow(SDL_VideoDevice *_this, SDL_Window * window) {
BMessage msg(BWIN_SHOW_WINDOW); /* Activate this window and move to front */ BMessage msg(BWIN_SHOW_WINDOW); /* Activate this window and move to front */
_ToBeWin(window)->PostMessage(&msg); _ToBeWin(window)->PostMessage(&msg);
} }
void HAIKU_MaximizeWindow(_THIS, SDL_Window * window) { void HAIKU_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window * window) {
BMessage msg(BWIN_MAXIMIZE_WINDOW); BMessage msg(BWIN_MAXIMIZE_WINDOW);
_ToBeWin(window)->PostMessage(&msg); _ToBeWin(window)->PostMessage(&msg);
} }
void HAIKU_MinimizeWindow(_THIS, SDL_Window * window) { void HAIKU_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window * window) {
BMessage msg(BWIN_MINIMIZE_WINDOW); BMessage msg(BWIN_MINIMIZE_WINDOW);
_ToBeWin(window)->PostMessage(&msg); _ToBeWin(window)->PostMessage(&msg);
} }
void HAIKU_RestoreWindow(_THIS, SDL_Window * window) { void HAIKU_RestoreWindow(SDL_VideoDevice *_this, SDL_Window * window) {
BMessage msg(BWIN_RESTORE_WINDOW); BMessage msg(BWIN_RESTORE_WINDOW);
_ToBeWin(window)->PostMessage(&msg); _ToBeWin(window)->PostMessage(&msg);
} }
void HAIKU_SetWindowFullscreen(_THIS, SDL_Window * window, void HAIKU_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window * window,
SDL_VideoDisplay * display, SDL_bool fullscreen) { SDL_VideoDisplay * display, SDL_bool fullscreen) {
/* Haiku tracks all video display information */ /* Haiku tracks all video display information */
BMessage msg(BWIN_FULLSCREEN); BMessage msg(BWIN_FULLSCREEN);
@ -193,25 +193,25 @@ void HAIKU_SetWindowFullscreen(_THIS, SDL_Window * window,
} }
void HAIKU_SetWindowMinimumSize(_THIS, SDL_Window * window) { void HAIKU_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window * window) {
BMessage msg(BWIN_MINIMUM_SIZE_WINDOW); BMessage msg(BWIN_MINIMUM_SIZE_WINDOW);
msg.AddInt32("window-w", window->w -1); msg.AddInt32("window-w", window->w -1);
msg.AddInt32("window-h", window->h -1); msg.AddInt32("window-h", window->h -1);
_ToBeWin(window)->PostMessage(&msg); _ToBeWin(window)->PostMessage(&msg);
} }
void HAIKU_SetWindowMouseGrab(_THIS, SDL_Window * window, SDL_bool grabbed) { void HAIKU_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window * window, SDL_bool grabbed) {
/* TODO: Implement this! */ /* TODO: Implement this! */
} }
void HAIKU_DestroyWindow(_THIS, SDL_Window * window) { void HAIKU_DestroyWindow(SDL_VideoDevice *_this, SDL_Window * window) {
_ToBeWin(window)->LockLooper(); /* This MUST be locked */ _ToBeWin(window)->LockLooper(); /* This MUST be locked */
_GetBeLooper()->ClearID(_ToBeWin(window)); _GetBeLooper()->ClearID(_ToBeWin(window));
_ToBeWin(window)->Quit(); _ToBeWin(window)->Quit();
window->driverdata = NULL; window->driverdata = NULL;
} }
int HAIKU_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info) int HAIKU_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info)
{ {
info->subsystem = SDL_SYSWM_HAIKU; info->subsystem = SDL_SYSWM_HAIKU;
return 0; return 0;

View file

@ -24,23 +24,23 @@
#include "../SDL_sysvideo.h" #include "../SDL_sysvideo.h"
extern int HAIKU_CreateWindow(_THIS, SDL_Window *window); extern int HAIKU_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern int HAIKU_CreateWindowFrom(_THIS, SDL_Window *window, const void *data); extern int HAIKU_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data);
extern void HAIKU_SetWindowTitle(_THIS, SDL_Window *window); extern void HAIKU_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window);
extern int HAIKU_SetWindowPosition(_THIS, SDL_Window *window); extern int HAIKU_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window);
extern void HAIKU_SetWindowSize(_THIS, SDL_Window *window); extern void HAIKU_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window);
extern void HAIKU_SetWindowMinimumSize(_THIS, SDL_Window *window); extern void HAIKU_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window *window);
extern void HAIKU_ShowWindow(_THIS, SDL_Window *window); extern void HAIKU_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void HAIKU_HideWindow(_THIS, SDL_Window *window); extern void HAIKU_HideWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void HAIKU_RaiseWindow(_THIS, SDL_Window *window); extern void HAIKU_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void HAIKU_MaximizeWindow(_THIS, SDL_Window *window); extern void HAIKU_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void HAIKU_MinimizeWindow(_THIS, SDL_Window *window); extern void HAIKU_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void HAIKU_RestoreWindow(_THIS, SDL_Window *window); extern void HAIKU_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void HAIKU_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered); extern void HAIKU_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered);
extern void HAIKU_SetWindowResizable(_THIS, SDL_Window *window, SDL_bool resizable); extern void HAIKU_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable);
extern void HAIKU_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen); extern void HAIKU_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen);
extern void HAIKU_SetWindowMouseGrab(_THIS, SDL_Window *window, SDL_bool grabbed); extern void HAIKU_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed);
extern void HAIKU_DestroyWindow(_THIS, SDL_Window *window); extern void HAIKU_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern int HAIKU_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info); extern int HAIKU_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info);
#endif #endif

View file

@ -32,7 +32,7 @@
#include "../../core/openbsd/SDL_wscons.h" #include "../../core/openbsd/SDL_wscons.h"
#endif #endif
void KMSDRM_PumpEvents(_THIS) void KMSDRM_PumpEvents(SDL_VideoDevice *_this)
{ {
#ifdef SDL_INPUT_LINUXEV #ifdef SDL_INPUT_LINUXEV
SDL_EVDEV_Poll(); SDL_EVDEV_Poll();

View file

@ -24,8 +24,8 @@
#ifndef SDL_kmsdrmevents_h_ #ifndef SDL_kmsdrmevents_h_
#define SDL_kmsdrmevents_h_ #define SDL_kmsdrmevents_h_
extern void KMSDRM_PumpEvents(_THIS); extern void KMSDRM_PumpEvents(SDL_VideoDevice *_this);
extern void KMSDRM_EventInit(_THIS); extern void KMSDRM_EventInit(SDL_VideoDevice *_this);
extern void KMSDRM_EventQuit(_THIS); extern void KMSDRM_EventQuit(SDL_VideoDevice *_this);
#endif /* SDL_kmsdrmevents_h_ */ #endif /* SDL_kmsdrmevents_h_ */

View file

@ -61,7 +61,7 @@ static SDL_Cursor *KMSDRM_CreateDefaultCursor(void)
/* Given a display's driverdata, destroy the cursor BO for it. /* Given a display's driverdata, destroy the cursor BO for it.
To be called from KMSDRM_DestroyWindow(), as that's where we To be called from KMSDRM_DestroyWindow(), as that's where we
destroy the driverdata for the window's display. */ destroy the driverdata for the window's display. */
void KMSDRM_DestroyCursorBO(_THIS, SDL_VideoDisplay *display) void KMSDRM_DestroyCursorBO(SDL_VideoDevice *_this, SDL_VideoDisplay *display)
{ {
SDL_DisplayData *dispdata = display->driverdata; SDL_DisplayData *dispdata = display->driverdata;
@ -383,7 +383,7 @@ static int KMSDRM_WarpMouse(SDL_Window *window, float x, float y)
return KMSDRM_WarpMouseGlobal(x, y); return KMSDRM_WarpMouseGlobal(x, y);
} }
void KMSDRM_InitMouse(_THIS, SDL_VideoDisplay *display) void KMSDRM_InitMouse(SDL_VideoDevice *_this, SDL_VideoDisplay *display)
{ {
SDL_Mouse *mouse = SDL_GetMouse(); SDL_Mouse *mouse = SDL_GetMouse();
SDL_DisplayData *dispdata = display->driverdata; SDL_DisplayData *dispdata = display->driverdata;
@ -403,7 +403,7 @@ void KMSDRM_InitMouse(_THIS, SDL_VideoDisplay *display)
} }
} }
void KMSDRM_QuitMouse(_THIS) void KMSDRM_QuitMouse(SDL_VideoDevice *_this)
{ {
/* TODO: ? */ /* TODO: ? */
} }

View file

@ -43,11 +43,11 @@ typedef struct KMSDRM_CursorData
} KMSDRM_CursorData; } KMSDRM_CursorData;
extern void KMSDRM_InitMouse(_THIS, SDL_VideoDisplay *display); extern void KMSDRM_InitMouse(SDL_VideoDevice *_this, SDL_VideoDisplay *display);
extern void KMSDRM_QuitMouse(_THIS); extern void KMSDRM_QuitMouse(SDL_VideoDevice *_this);
extern int KMSDRM_CreateCursorBO(SDL_VideoDisplay *display); extern int KMSDRM_CreateCursorBO(SDL_VideoDisplay *display);
extern void KMSDRM_DestroyCursorBO(_THIS, SDL_VideoDisplay *display); extern void KMSDRM_DestroyCursorBO(SDL_VideoDevice *_this, SDL_VideoDisplay *display);
extern void KMSDRM_InitCursor(void); extern void KMSDRM_InitCursor(void);
#endif /* SDL_KMSDRM_mouse_h_ */ #endif /* SDL_KMSDRM_mouse_h_ */

View file

@ -34,7 +34,7 @@
/* EGL implementation of SDL OpenGL support */ /* EGL implementation of SDL OpenGL support */
void KMSDRM_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor) void KMSDRM_GLES_DefaultProfileConfig(SDL_VideoDevice *_this, int *mask, int *major, int *minor)
{ {
/* if SDL was _also_ built with the Raspberry Pi driver (so we're /* if SDL was _also_ built with the Raspberry Pi driver (so we're
definitely a Pi device) or with the ROCKCHIP video driver definitely a Pi device) or with the ROCKCHIP video driver
@ -46,7 +46,7 @@ void KMSDRM_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor)
#endif #endif
} }
int KMSDRM_GLES_LoadLibrary(_THIS, const char *path) int KMSDRM_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path)
{ {
/* Just pretend you do this here, but don't do it until KMSDRM_CreateWindow(), /* Just pretend you do this here, but don't do it until KMSDRM_CreateWindow(),
where we do the same library load we would normally do here. where we do the same library load we would normally do here.
@ -60,7 +60,7 @@ int KMSDRM_GLES_LoadLibrary(_THIS, const char *path)
return 0; return 0;
} }
void KMSDRM_GLES_UnloadLibrary(_THIS) void KMSDRM_GLES_UnloadLibrary(SDL_VideoDevice *_this)
{ {
/* As with KMSDRM_GLES_LoadLibrary(), we define our own "dummy" unloading function /* As with KMSDRM_GLES_LoadLibrary(), we define our own "dummy" unloading function
so we manually unload the library whenever we want. */ so we manually unload the library whenever we want. */
@ -68,7 +68,7 @@ void KMSDRM_GLES_UnloadLibrary(_THIS)
SDL_EGL_CreateContext_impl(KMSDRM) SDL_EGL_CreateContext_impl(KMSDRM)
int KMSDRM_GLES_SetSwapInterval(_THIS, int interval) int KMSDRM_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval)
{ {
if (!_this->egl_data) { if (!_this->egl_data) {
@ -84,7 +84,7 @@ SDL_EGL_CreateContext_impl(KMSDRM)
return 0; return 0;
} }
int KMSDRM_GLES_SwapWindow(_THIS, SDL_Window *window) int KMSDRM_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_WindowData *windata = window->driverdata; SDL_WindowData *windata = window->driverdata;
SDL_DisplayData *dispdata = SDL_GetDisplayDriverDataForWindow(window); SDL_DisplayData *dispdata = SDL_GetDisplayDriverDataForWindow(window);

View file

@ -34,12 +34,12 @@
#define KMSDRM_GLES_DeleteContext SDL_EGL_DeleteContext #define KMSDRM_GLES_DeleteContext SDL_EGL_DeleteContext
#define KMSDRM_GLES_GetSwapInterval SDL_EGL_GetSwapInterval #define KMSDRM_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
extern void KMSDRM_GLES_DefaultProfileConfig(_THIS, int *mask, int *major, int *minor); extern void KMSDRM_GLES_DefaultProfileConfig(SDL_VideoDevice *_this, int *mask, int *major, int *minor);
extern int KMSDRM_GLES_SetSwapInterval(_THIS, int interval); extern int KMSDRM_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval);
extern int KMSDRM_GLES_LoadLibrary(_THIS, const char *path); extern int KMSDRM_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path);
extern SDL_GLContext KMSDRM_GLES_CreateContext(_THIS, SDL_Window *window); extern SDL_GLContext KMSDRM_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window);
extern int KMSDRM_GLES_SwapWindow(_THIS, SDL_Window *window); extern int KMSDRM_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern int KMSDRM_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); extern int KMSDRM_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context);
#endif /* SDL_VIDEO_DRIVER_KMSDRM */ #endif /* SDL_VIDEO_DRIVER_KMSDRM */

View file

@ -350,7 +350,7 @@ static void KMSDRM_FBDestroyCallback(struct gbm_bo *bo, void *data)
} }
KMSDRM_FBInfo * KMSDRM_FBInfo *
KMSDRM_FBFromBO(_THIS, struct gbm_bo *bo) KMSDRM_FBFromBO(SDL_VideoDevice *_this, struct gbm_bo *bo)
{ {
SDL_VideoData *viddata = _this->driverdata; SDL_VideoData *viddata = _this->driverdata;
unsigned w, h; unsigned w, h;
@ -402,7 +402,7 @@ static void KMSDRM_FlipHandler(int fd, unsigned int frame, unsigned int sec, uns
} }
SDL_bool SDL_bool
KMSDRM_WaitPageflip(_THIS, SDL_WindowData *windata) KMSDRM_WaitPageflip(SDL_VideoDevice *_this, SDL_WindowData *windata)
{ {
SDL_VideoData *viddata = _this->driverdata; SDL_VideoData *viddata = _this->driverdata;
@ -514,7 +514,7 @@ static drmModeModeInfo *KMSDRM_GetClosestDisplayMode(SDL_VideoDisplay *display,
/*****************************************************************************/ /*****************************************************************************/
/* Deinitializes the driverdata of the SDL Displays in the SDL display list. */ /* Deinitializes the driverdata of the SDL Displays in the SDL display list. */
static void KMSDRM_DeinitDisplays(_THIS) static void KMSDRM_DeinitDisplays(SDL_VideoDevice *_this)
{ {
SDL_DisplayID *displays; SDL_DisplayID *displays;
SDL_DisplayData *dispdata; SDL_DisplayData *dispdata;
@ -680,7 +680,7 @@ static SDL_bool KMSDRM_CrtcGetVrr(uint32_t drm_fd, uint32_t crtc_id)
/* Gets a DRM connector, builds an SDL_Display with it, and adds it to the /* Gets a DRM connector, builds an SDL_Display with it, and adds it to the
list of SDL Displays in _this->displays[] */ list of SDL Displays in _this->displays[] */
static void KMSDRM_AddDisplay(_THIS, drmModeConnector *connector, drmModeRes *resources) static void KMSDRM_AddDisplay(SDL_VideoDevice *_this, drmModeConnector *connector, drmModeRes *resources)
{ {
SDL_VideoData *viddata = _this->driverdata; SDL_VideoData *viddata = _this->driverdata;
SDL_DisplayData *dispdata = NULL; SDL_DisplayData *dispdata = NULL;
@ -903,7 +903,7 @@ cleanup:
closed when we get to the end of this function. closed when we get to the end of this function.
This is to be called early, in VideoInit(), because it gets us This is to be called early, in VideoInit(), because it gets us
the videomode information, which SDL needs immediately after VideoInit(). */ the videomode information, which SDL needs immediately after VideoInit(). */
static int KMSDRM_InitDisplays(_THIS) static int KMSDRM_InitDisplays(SDL_VideoDevice *_this)
{ {
SDL_VideoData *viddata = _this->driverdata; SDL_VideoData *viddata = _this->driverdata;
@ -999,7 +999,7 @@ cleanup:
These things are incompatible with Vulkan, which accesses the same resources These things are incompatible with Vulkan, which accesses the same resources
internally so they must be free when trying to build a Vulkan surface. internally so they must be free when trying to build a Vulkan surface.
*/ */
static int KMSDRM_GBMInit(_THIS, SDL_DisplayData *dispdata) static int KMSDRM_GBMInit(SDL_VideoDevice *_this, SDL_DisplayData *dispdata)
{ {
SDL_VideoData *viddata = _this->driverdata; SDL_VideoData *viddata = _this->driverdata;
int ret = 0; int ret = 0;
@ -1022,7 +1022,7 @@ static int KMSDRM_GBMInit(_THIS, SDL_DisplayData *dispdata)
} }
/* Deinit the Vulkan-incompatible KMSDRM stuff. */ /* Deinit the Vulkan-incompatible KMSDRM stuff. */
static void KMSDRM_GBMDeinit(_THIS, SDL_DisplayData *dispdata) static void KMSDRM_GBMDeinit(SDL_VideoDevice *_this, SDL_DisplayData *dispdata)
{ {
SDL_VideoData *viddata = _this->driverdata; SDL_VideoData *viddata = _this->driverdata;
@ -1042,7 +1042,7 @@ static void KMSDRM_GBMDeinit(_THIS, SDL_DisplayData *dispdata)
viddata->gbm_init = SDL_FALSE; viddata->gbm_init = SDL_FALSE;
} }
static void KMSDRM_DestroySurfaces(_THIS, SDL_Window *window) static void KMSDRM_DestroySurfaces(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_VideoData *viddata = _this->driverdata; SDL_VideoData *viddata = _this->driverdata;
SDL_WindowData *windata = window->driverdata; SDL_WindowData *windata = window->driverdata;
@ -1144,7 +1144,7 @@ static void KMSDRM_DirtySurfaces(SDL_Window *window)
/* This determines the size of the fb, which comes from the GBM surface /* This determines the size of the fb, which comes from the GBM surface
that we create here. */ that we create here. */
int KMSDRM_CreateSurfaces(_THIS, SDL_Window *window) int KMSDRM_CreateSurfaces(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_VideoData *viddata = _this->driverdata; SDL_VideoData *viddata = _this->driverdata;
SDL_WindowData *windata = window->driverdata; SDL_WindowData *windata = window->driverdata;
@ -1228,7 +1228,7 @@ cleanup:
return ret; return ret;
} }
int KMSDRM_VideoInit(_THIS) int KMSDRM_VideoInit(SDL_VideoDevice *_this)
{ {
int ret = 0; int ret = 0;
@ -1259,7 +1259,7 @@ int KMSDRM_VideoInit(_THIS)
/* The driverdata pointers, like dispdata, viddata, windata, etc... /* The driverdata pointers, like dispdata, viddata, windata, etc...
are freed by SDL internals, so not our job. */ are freed by SDL internals, so not our job. */
void KMSDRM_VideoQuit(_THIS) void KMSDRM_VideoQuit(SDL_VideoDevice *_this)
{ {
SDL_VideoData *viddata = _this->driverdata; SDL_VideoData *viddata = _this->driverdata;
@ -1280,7 +1280,7 @@ void KMSDRM_VideoQuit(_THIS)
} }
/* Read modes from the connector modes, and store them in display->display_modes. */ /* Read modes from the connector modes, and store them in display->display_modes. */
int KMSDRM_GetDisplayModes(_THIS, SDL_VideoDisplay *display) int KMSDRM_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display)
{ {
SDL_DisplayData *dispdata = display->driverdata; SDL_DisplayData *dispdata = display->driverdata;
drmModeConnector *conn = dispdata->connector; drmModeConnector *conn = dispdata->connector;
@ -1308,7 +1308,7 @@ int KMSDRM_GetDisplayModes(_THIS, SDL_VideoDisplay *display)
return 0; return 0;
} }
int KMSDRM_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) int KMSDRM_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
{ {
/* Set the dispdata->mode to the new mode and leave actual modesetting /* Set the dispdata->mode to the new mode and leave actual modesetting
pending to be done on SwapWindow() via drmModeSetCrtc() */ pending to be done on SwapWindow() via drmModeSetCrtc() */
@ -1339,7 +1339,7 @@ int KMSDRM_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mod
return 0; return 0;
} }
void KMSDRM_DestroyWindow(_THIS, SDL_Window *window) void KMSDRM_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_WindowData *windata = window->driverdata; SDL_WindowData *windata = window->driverdata;
SDL_DisplayData *dispdata = SDL_GetDisplayDriverDataForWindow(window); SDL_DisplayData *dispdata = SDL_GetDisplayDriverDataForWindow(window);
@ -1417,7 +1417,7 @@ void KMSDRM_DestroyWindow(_THIS, SDL_Window *window)
/* reflect it: if it's fullscreen, KMSDRM_SetWindwoFullscreen() will */ /* reflect it: if it's fullscreen, KMSDRM_SetWindwoFullscreen() will */
/* be called by SDL later, and we can manage it there. */ /* be called by SDL later, and we can manage it there. */
/**********************************************************************/ /**********************************************************************/
int KMSDRM_CreateWindow(_THIS, SDL_Window *window) int KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_WindowData *windata = NULL; SDL_WindowData *windata = NULL;
SDL_VideoData *viddata = _this->driverdata; SDL_VideoData *viddata = _this->driverdata;
@ -1551,26 +1551,26 @@ int KMSDRM_CreateWindow(_THIS, SDL_Window *window)
return ret; return ret;
} }
int KMSDRM_CreateWindowFrom(_THIS, SDL_Window *window, const void *data) int KMSDRM_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data)
{ {
return -1; return -1;
} }
void KMSDRM_SetWindowTitle(_THIS, SDL_Window *window) void KMSDRM_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window)
{ {
} }
int KMSDRM_SetWindowPosition(_THIS, SDL_Window *window) int KMSDRM_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window)
{ {
return SDL_Unsupported(); return SDL_Unsupported();
} }
void KMSDRM_SetWindowSize(_THIS, SDL_Window *window) void KMSDRM_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_VideoData *viddata = _this->driverdata; SDL_VideoData *viddata = _this->driverdata;
if (!viddata->vulkan_mode) { if (!viddata->vulkan_mode) {
KMSDRM_DirtySurfaces(window); KMSDRM_DirtySurfaces(window);
} }
} }
void KMSDRM_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen) void KMSDRM_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
{ {
SDL_VideoData *viddata = _this->driverdata; SDL_VideoData *viddata = _this->driverdata;
@ -1578,29 +1578,29 @@ void KMSDRM_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *dis
KMSDRM_DirtySurfaces(window); KMSDRM_DirtySurfaces(window);
} }
} }
void KMSDRM_ShowWindow(_THIS, SDL_Window *window) void KMSDRM_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
} }
void KMSDRM_HideWindow(_THIS, SDL_Window *window) void KMSDRM_HideWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
} }
void KMSDRM_RaiseWindow(_THIS, SDL_Window *window) void KMSDRM_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
} }
void KMSDRM_MaximizeWindow(_THIS, SDL_Window *window) void KMSDRM_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
} }
void KMSDRM_MinimizeWindow(_THIS, SDL_Window *window) void KMSDRM_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
} }
void KMSDRM_RestoreWindow(_THIS, SDL_Window *window) void KMSDRM_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
} }
/*****************************************************************************/ /*****************************************************************************/
/* SDL Window Manager function */ /* SDL Window Manager function */
/*****************************************************************************/ /*****************************************************************************/
int KMSDRM_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info) int KMSDRM_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info)
{ {
SDL_VideoData *viddata = _this->driverdata; SDL_VideoData *viddata = _this->driverdata;

View file

@ -107,46 +107,46 @@ typedef struct KMSDRM_FBInfo
} KMSDRM_FBInfo; } KMSDRM_FBInfo;
/* Helper functions */ /* Helper functions */
int KMSDRM_CreateSurfaces(_THIS, SDL_Window *window); int KMSDRM_CreateSurfaces(SDL_VideoDevice *_this, SDL_Window *window);
KMSDRM_FBInfo *KMSDRM_FBFromBO(_THIS, struct gbm_bo *bo); KMSDRM_FBInfo *KMSDRM_FBFromBO(SDL_VideoDevice *_this, struct gbm_bo *bo);
KMSDRM_FBInfo *KMSDRM_FBFromBO2(_THIS, struct gbm_bo *bo, int w, int h); KMSDRM_FBInfo *KMSDRM_FBFromBO2(SDL_VideoDevice *_this, struct gbm_bo *bo, int w, int h);
SDL_bool KMSDRM_WaitPageflip(_THIS, SDL_WindowData *windata); SDL_bool KMSDRM_WaitPageflip(SDL_VideoDevice *_this, SDL_WindowData *windata);
/****************************************************************************/ /****************************************************************************/
/* SDL_VideoDevice functions declaration */ /* SDL_VideoDevice functions declaration */
/****************************************************************************/ /****************************************************************************/
/* Display and window functions */ /* Display and window functions */
int KMSDRM_VideoInit(_THIS); int KMSDRM_VideoInit(SDL_VideoDevice *_this);
void KMSDRM_VideoQuit(_THIS); void KMSDRM_VideoQuit(SDL_VideoDevice *_this);
int KMSDRM_GetDisplayModes(_THIS, SDL_VideoDisplay *display); int KMSDRM_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display);
int KMSDRM_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); int KMSDRM_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
int KMSDRM_CreateWindow(_THIS, SDL_Window *window); int KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window);
int KMSDRM_CreateWindowFrom(_THIS, SDL_Window *window, const void *data); int KMSDRM_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void *data);
void KMSDRM_SetWindowTitle(_THIS, SDL_Window *window); void KMSDRM_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window);
int KMSDRM_SetWindowPosition(_THIS, SDL_Window *window); int KMSDRM_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window);
void KMSDRM_SetWindowSize(_THIS, SDL_Window *window); void KMSDRM_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window);
void KMSDRM_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *_display, SDL_bool fullscreen); void KMSDRM_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *_display, SDL_bool fullscreen);
void KMSDRM_ShowWindow(_THIS, SDL_Window *window); void KMSDRM_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window);
void KMSDRM_HideWindow(_THIS, SDL_Window *window); void KMSDRM_HideWindow(SDL_VideoDevice *_this, SDL_Window *window);
void KMSDRM_RaiseWindow(_THIS, SDL_Window *window); void KMSDRM_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window);
void KMSDRM_MaximizeWindow(_THIS, SDL_Window *window); void KMSDRM_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window);
void KMSDRM_MinimizeWindow(_THIS, SDL_Window *window); void KMSDRM_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window);
void KMSDRM_RestoreWindow(_THIS, SDL_Window *window); void KMSDRM_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window);
void KMSDRM_DestroyWindow(_THIS, SDL_Window *window); void KMSDRM_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window);
/* Window manager function */ /* Window manager function */
int KMSDRM_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info); int KMSDRM_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, struct SDL_SysWMinfo *info);
/* OpenGL/OpenGL ES functions */ /* OpenGL/OpenGL ES functions */
int KMSDRM_GLES_LoadLibrary(_THIS, const char *path); int KMSDRM_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path);
SDL_FunctionPointer KMSDRM_GLES_GetProcAddress(_THIS, const char *proc); SDL_FunctionPointer KMSDRM_GLES_GetProcAddress(SDL_VideoDevice *_this, const char *proc);
void KMSDRM_GLES_UnloadLibrary(_THIS); void KMSDRM_GLES_UnloadLibrary(SDL_VideoDevice *_this);
SDL_GLContext KMSDRM_GLES_CreateContext(_THIS, SDL_Window *window); SDL_GLContext KMSDRM_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window);
int KMSDRM_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); int KMSDRM_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context);
int KMSDRM_GLES_SetSwapInterval(_THIS, int interval); int KMSDRM_GLES_SetSwapInterval(SDL_VideoDevice *_this, int interval);
int KMSDRM_GLES_GetSwapInterval(_THIS); int KMSDRM_GLES_GetSwapInterval(SDL_VideoDevice *_this);
int KMSDRM_GLES_SwapWindow(_THIS, SDL_Window *window); int KMSDRM_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window);
int KMSDRM_GLES_DeleteContext(_THIS, SDL_GLContext context); int KMSDRM_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context);
#endif /* SDL_kmsdrmvideo_h */ #endif /* SDL_kmsdrmvideo_h */

View file

@ -42,7 +42,7 @@
#define DEFAULT_VULKAN "libvulkan.so.1" #define DEFAULT_VULKAN "libvulkan.so.1"
#endif #endif
int KMSDRM_Vulkan_LoadLibrary(_THIS, const char *path) int KMSDRM_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path)
{ {
VkExtensionProperties *extensions = NULL; VkExtensionProperties *extensions = NULL;
Uint32 i, extensionCount = 0; Uint32 i, extensionCount = 0;
@ -122,7 +122,7 @@ fail:
return -1; return -1;
} }
void KMSDRM_Vulkan_UnloadLibrary(_THIS) void KMSDRM_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
{ {
if (_this->vulkan_config.loader_handle) { if (_this->vulkan_config.loader_handle) {
SDL_UnloadObject(_this->vulkan_config.loader_handle); SDL_UnloadObject(_this->vulkan_config.loader_handle);
@ -140,7 +140,7 @@ void KMSDRM_Vulkan_UnloadLibrary(_THIS)
/* members of the VkInstanceCreateInfo struct passed to */ /* members of the VkInstanceCreateInfo struct passed to */
/* vkCreateInstance(). */ /* vkCreateInstance(). */
/*********************************************************************/ /*********************************************************************/
SDL_bool KMSDRM_Vulkan_GetInstanceExtensions(_THIS, SDL_bool KMSDRM_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
unsigned *count, unsigned *count,
const char **names) const char **names)
{ {
@ -164,7 +164,7 @@ SDL_bool KMSDRM_Vulkan_GetInstanceExtensions(_THIS,
/* KMSDRM_Vulkan_GetInstanceExtensions(), like we do with */ /* KMSDRM_Vulkan_GetInstanceExtensions(), like we do with */
/* VK_KHR_DISPLAY_EXTENSION_NAME, which is what we need for x-less VK. */ /* VK_KHR_DISPLAY_EXTENSION_NAME, which is what we need for x-less VK. */
/***********************************************************************/ /***********************************************************************/
SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, SDL_bool KMSDRM_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window, SDL_Window *window,
VkInstance instance, VkInstance instance,
VkSurfaceKHR *surface) VkSurfaceKHR *surface)

View file

@ -34,12 +34,12 @@
#if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_KMSDRM) #if defined(SDL_VIDEO_VULKAN) && defined(SDL_VIDEO_DRIVER_KMSDRM)
int KMSDRM_Vulkan_LoadLibrary(_THIS, const char *path); int KMSDRM_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
void KMSDRM_Vulkan_UnloadLibrary(_THIS); void KMSDRM_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
SDL_bool KMSDRM_Vulkan_GetInstanceExtensions(_THIS, SDL_bool KMSDRM_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
unsigned *count, unsigned *count,
const char **names); const char **names);
SDL_bool KMSDRM_Vulkan_CreateSurface(_THIS, SDL_bool KMSDRM_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window, SDL_Window *window,
VkInstance instance, VkInstance instance,
VkSurfaceKHR *surface); VkSurfaceKHR *surface);

View file

@ -28,7 +28,7 @@
#include "SDL_n3dsevents_c.h" #include "SDL_n3dsevents_c.h"
#include "SDL_n3dstouch.h" #include "SDL_n3dstouch.h"
void N3DS_PumpEvents(_THIS) void N3DS_PumpEvents(SDL_VideoDevice *_this)
{ {
hidScanInput(); hidScanInput();
N3DS_PollTouch(); N3DS_PollTouch();

View file

@ -24,6 +24,6 @@
#include "SDL_internal.h" #include "SDL_internal.h"
extern void N3DS_PumpEvents(_THIS); extern void N3DS_PumpEvents(SDL_VideoDevice *_this);
#endif /* SDL_n3dsevents_c_h_ */ #endif /* SDL_n3dsevents_c_h_ */

View file

@ -40,7 +40,7 @@ SDL_FORCE_INLINE int GetDestOffset(int x, int y, int dest_width);
SDL_FORCE_INLINE int GetSourceOffset(int x, int y, int source_width); SDL_FORCE_INLINE int GetSourceOffset(int x, int y, int source_width);
SDL_FORCE_INLINE void FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen); SDL_FORCE_INLINE void FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen);
int SDL_N3DS_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) int SDL_N3DS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
{ {
SDL_Surface *framebuffer; SDL_Surface *framebuffer;
@ -73,7 +73,7 @@ CreateNewWindowFramebuffer(SDL_Window *window)
return SDL_CreateSurface(w, h, FRAMEBUFFER_FORMAT); return SDL_CreateSurface(w, h, FRAMEBUFFER_FORMAT);
} }
int SDL_N3DS_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) int SDL_N3DS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects)
{ {
SDL_WindowData *drv_data = window->driverdata; SDL_WindowData *drv_data = window->driverdata;
SDL_Surface *surface; SDL_Surface *surface;
@ -131,7 +131,7 @@ FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen)
gfxScreenSwapBuffers(screen, false); gfxScreenSwapBuffers(screen, false);
} }
void SDL_N3DS_DestroyWindowFramebuffer(_THIS, SDL_Window *window) void SDL_N3DS_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_Surface *surface; SDL_Surface *surface;
surface = (SDL_Surface *)SDL_SetWindowData(window, N3DS_SURFACE, NULL); surface = (SDL_Surface *)SDL_SetWindowData(window, N3DS_SURFACE, NULL);

View file

@ -24,8 +24,8 @@
#include "SDL_internal.h" #include "SDL_internal.h"
int SDL_N3DS_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); int SDL_N3DS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch);
int SDL_N3DS_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); int SDL_N3DS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects);
void SDL_N3DS_DestroyWindowFramebuffer(_THIS, SDL_Window *window); void SDL_N3DS_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window);
#endif /* SDL_n3dsframebuffer_c_h_ */ #endif /* SDL_n3dsframebuffer_c_h_ */

View file

@ -46,12 +46,12 @@ void N3DS_SwkbQuit()
} }
SDL_bool SDL_bool
N3DS_HasScreenKeyboardSupport(_THIS) N3DS_HasScreenKeyboardSupport(SDL_VideoDevice *_this)
{ {
return SDL_TRUE; return SDL_TRUE;
} }
void N3DS_StartTextInput(_THIS) void N3DS_StartTextInput(SDL_VideoDevice *_this)
{ {
char buffer[BUFFER_SIZE]; char buffer[BUFFER_SIZE];
SwkbdButton button_pressed; SwkbdButton button_pressed;
@ -61,7 +61,7 @@ void N3DS_StartTextInput(_THIS)
} }
} }
void N3DS_StopTextInput(_THIS) void N3DS_StopTextInput(SDL_VideoDevice *_this)
{ {
return; return;
} }

View file

@ -28,9 +28,9 @@ void N3DS_SwkbInit();
void N3DS_SwkbPoll(); void N3DS_SwkbPoll();
void N3DS_SwkbQuit(); void N3DS_SwkbQuit();
SDL_bool N3DS_HasScreenKeyboardSupport(_THIS); SDL_bool N3DS_HasScreenKeyboardSupport(SDL_VideoDevice *_this);
void N3DS_StartTextInput(_THIS); void N3DS_StartTextInput(SDL_VideoDevice *_this);
void N3DS_StopTextInput(_THIS); void N3DS_StopTextInput(SDL_VideoDevice *_this);
#endif /* SDL_n3dskeyboard_h_ */ #endif /* SDL_n3dskeyboard_h_ */

View file

@ -33,11 +33,11 @@
SDL_FORCE_INLINE int AddN3DSDisplay(gfxScreen_t screen); SDL_FORCE_INLINE int AddN3DSDisplay(gfxScreen_t screen);
static int N3DS_VideoInit(_THIS); static int N3DS_VideoInit(SDL_VideoDevice *_this);
static void N3DS_VideoQuit(_THIS); static void N3DS_VideoQuit(SDL_VideoDevice *_this);
static int N3DS_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect); static int N3DS_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect);
static int N3DS_CreateWindow(_THIS, SDL_Window *window); static int N3DS_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window);
static void N3DS_DestroyWindow(_THIS, SDL_Window *window); static void N3DS_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window);
struct SDL_DisplayData struct SDL_DisplayData
{ {
@ -86,7 +86,7 @@ static SDL_VideoDevice *N3DS_CreateDevice(void)
VideoBootStrap N3DS_bootstrap = { N3DSVID_DRIVER_NAME, "N3DS Video Driver", N3DS_CreateDevice }; VideoBootStrap N3DS_bootstrap = { N3DSVID_DRIVER_NAME, "N3DS Video Driver", N3DS_CreateDevice };
static int N3DS_VideoInit(_THIS) static int N3DS_VideoInit(SDL_VideoDevice *_this)
{ {
gfxInit(GSP_RGBA8_OES, GSP_RGBA8_OES, false); gfxInit(GSP_RGBA8_OES, GSP_RGBA8_OES, false);
hidInit(); hidInit();
@ -127,7 +127,7 @@ static int AddN3DSDisplay(gfxScreen_t screen)
return 0; return 0;
} }
static void N3DS_VideoQuit(_THIS) static void N3DS_VideoQuit(SDL_VideoDevice *_this)
{ {
N3DS_SwkbQuit(); N3DS_SwkbQuit();
N3DS_QuitTouch(); N3DS_QuitTouch();
@ -136,7 +136,7 @@ static void N3DS_VideoQuit(_THIS)
gfxExit(); gfxExit();
} }
static int N3DS_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) static int N3DS_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect)
{ {
SDL_DisplayData *driver_data = display->driverdata; SDL_DisplayData *driver_data = display->driverdata;
@ -151,7 +151,7 @@ static int N3DS_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rec
return 0; return 0;
} }
static int N3DS_CreateWindow(_THIS, SDL_Window *window) static int N3DS_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_DisplayData *display_data; SDL_DisplayData *display_data;
SDL_WindowData *window_data = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData)); SDL_WindowData *window_data = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData));
@ -165,7 +165,7 @@ static int N3DS_CreateWindow(_THIS, SDL_Window *window)
return 0; return 0;
} }
static void N3DS_DestroyWindow(_THIS, SDL_Window *window) static void N3DS_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
if (window == NULL) { if (window == NULL) {
return; return;

View file

@ -40,9 +40,9 @@ extern "C" {
#include "SDL_ngagevideo.h" #include "SDL_ngagevideo.h"
#include "SDL_ngageevents_c.h" #include "SDL_ngageevents_c.h"
int HandleWsEvent(_THIS, const TWsEvent &aWsEvent); int HandleWsEvent(SDL_VideoDevice *_this, const TWsEvent &aWsEvent);
void NGAGE_PumpEvents(_THIS) void NGAGE_PumpEvents(SDL_VideoDevice *_this)
{ {
SDL_VideoData *phdata = _this->driverdata; SDL_VideoData *phdata = _this->driverdata;
@ -63,12 +63,12 @@ void NGAGE_PumpEvents(_THIS)
#include <bautils.h> #include <bautils.h>
#include <hal.h> #include <hal.h>
extern void DisableKeyBlocking(_THIS); extern void DisableKeyBlocking(SDL_VideoDevice *_this);
extern void RedrawWindowL(_THIS); extern void RedrawWindowL(SDL_VideoDevice *_this);
TBool isCursorVisible = EFalse; TBool isCursorVisible = EFalse;
static SDL_Scancode ConvertScancode(_THIS, int key) static SDL_Scancode ConvertScancode(SDL_VideoDevice *_this, int key)
{ {
SDL_Keycode keycode; SDL_Keycode keycode;
@ -147,7 +147,7 @@ static SDL_Scancode ConvertScancode(_THIS, int key)
return SDL_GetScancodeFromKey(keycode); return SDL_GetScancodeFromKey(keycode);
} }
int HandleWsEvent(_THIS, const TWsEvent &aWsEvent) int HandleWsEvent(SDL_VideoDevice *_this, const TWsEvent &aWsEvent)
{ {
SDL_VideoData *phdata = _this->driverdata; SDL_VideoData *phdata = _this->driverdata;
int posted = 0; int posted = 0;

View file

@ -23,4 +23,4 @@
#include "SDL_ngagevideo.h" #include "SDL_ngagevideo.h"
extern void NGAGE_PumpEvents(_THIS); extern void NGAGE_PumpEvents(SDL_VideoDevice *_this);

View file

@ -39,12 +39,12 @@
static TUint32 NGAGE_HWPalette_256_to_Screen[256]; static TUint32 NGAGE_HWPalette_256_to_Screen[256];
int GetBpp(TDisplayMode displaymode); int GetBpp(TDisplayMode displaymode);
void DirectUpdate(_THIS, int numrects, SDL_Rect *rects); void DirectUpdate(SDL_VideoDevice *_this, int numrects, SDL_Rect *rects);
void DrawBackground(_THIS); void DrawBackground(SDL_VideoDevice *_this);
void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16 *screenBuffer); void DirectDraw(SDL_VideoDevice *_this, int numrects, SDL_Rect *rects, TUint16 *screenBuffer);
void RedrawWindowL(_THIS); void RedrawWindowL(SDL_VideoDevice *_this);
int SDL_NGAGE_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) int SDL_NGAGE_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
{ {
SDL_VideoData *phdata = _this->driverdata; SDL_VideoData *phdata = _this->driverdata;
SDL_Surface *surface; SDL_Surface *surface;
@ -143,7 +143,7 @@ int SDL_NGAGE_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format,
return 0; return 0;
} }
int SDL_NGAGE_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) int SDL_NGAGE_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects)
{ {
static int frame_number; static int frame_number;
SDL_Surface *surface; SDL_Surface *surface;
@ -166,7 +166,7 @@ int SDL_NGAGE_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect
return 0; return 0;
} }
void SDL_NGAGE_DestroyWindowFramebuffer(_THIS, SDL_Window *window) void SDL_NGAGE_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_Surface *surface; SDL_Surface *surface;
@ -197,7 +197,7 @@ int GetBpp(TDisplayMode displaymode)
return TDisplayModeUtils::NumDisplayModeBitsPerPixel(displaymode); return TDisplayModeUtils::NumDisplayModeBitsPerPixel(displaymode);
} }
void DrawBackground(_THIS) void DrawBackground(SDL_VideoDevice *_this)
{ {
SDL_VideoData *phdata = _this->driverdata; SDL_VideoData *phdata = _this->driverdata;
/* Draw background */ /* Draw background */
@ -206,7 +206,7 @@ void DrawBackground(_THIS)
Mem::FillZ(screenBuffer, phdata->NGAGE_BytesPerScreen); Mem::FillZ(screenBuffer, phdata->NGAGE_BytesPerScreen);
} }
void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16 *screenBuffer) void DirectDraw(SDL_VideoDevice *_this, int numrects, SDL_Rect *rects, TUint16 *screenBuffer)
{ {
SDL_VideoData *phdata = _this->driverdata; SDL_VideoData *phdata = _this->driverdata;
SDL_Surface *screen = (SDL_Surface *)SDL_GetWindowData(_this->windows, NGAGE_SURFACE); SDL_Surface *screen = (SDL_Surface *)SDL_GetWindowData(_this->windows, NGAGE_SURFACE);
@ -331,7 +331,7 @@ void DirectDraw(_THIS, int numrects, SDL_Rect *rects, TUint16 *screenBuffer)
} }
} }
void DirectUpdate(_THIS, int numrects, SDL_Rect *rects) void DirectUpdate(SDL_VideoDevice *_this, int numrects, SDL_Rect *rects)
{ {
SDL_VideoData *phdata = _this->driverdata; SDL_VideoData *phdata = _this->driverdata;
@ -366,7 +366,7 @@ void DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
} }
} }
void RedrawWindowL(_THIS) void RedrawWindowL(SDL_VideoDevice *_this)
{ {
SDL_VideoData *phdata = _this->driverdata; SDL_VideoData *phdata = _this->driverdata;
SDL_Surface *screen = (SDL_Surface *)SDL_GetWindowData(_this->windows, NGAGE_SURFACE); SDL_Surface *screen = (SDL_Surface *)SDL_GetWindowData(_this->windows, NGAGE_SURFACE);

View file

@ -21,9 +21,9 @@
#include "SDL_internal.h" #include "SDL_internal.h"
extern int SDL_NGAGE_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); extern int SDL_NGAGE_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch);
extern int SDL_NGAGE_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); extern int SDL_NGAGE_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects);
extern void SDL_NGAGE_DestroyWindowFramebuffer(_THIS, SDL_Window *window); extern void SDL_NGAGE_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window);
/****************************************************************************/ /****************************************************************************/
/* Runtime */ /* Runtime */

View file

@ -47,8 +47,8 @@ extern "C" {
#define NGAGEVID_DRIVER_NAME "ngage" #define NGAGEVID_DRIVER_NAME "ngage"
/* Initialization/Query functions */ /* Initialization/Query functions */
static int NGAGE_VideoInit(_THIS); static int NGAGE_VideoInit(SDL_VideoDevice *_this);
static void NGAGE_VideoQuit(_THIS); static void NGAGE_VideoQuit(SDL_VideoDevice *_this);
/* NGAGE driver bootstrap functions */ /* NGAGE driver bootstrap functions */
@ -141,7 +141,7 @@ VideoBootStrap NGAGE_bootstrap = {
NGAGE_CreateDevice NGAGE_CreateDevice
}; };
int NGAGE_VideoInit(_THIS) int NGAGE_VideoInit(SDL_VideoDevice *_this)
{ {
SDL_DisplayMode mode; SDL_DisplayMode mode;
@ -158,7 +158,7 @@ int NGAGE_VideoInit(_THIS)
return 0; return 0;
} }
void NGAGE_VideoQuit(_THIS) void NGAGE_VideoQuit(SDL_VideoDevice *_this)
{ {
} }

View file

@ -32,7 +32,7 @@
#include <w32std.h> #include <w32std.h>
#include "bitdraw.h" // CFbsDrawDevice #include "bitdraw.h" // CFbsDrawDevice
#define _THIS SDL_VideoDevice *_this #define SDL_VideoDevice *_this SDL_VideoDevice *_this
struct SDL_VideoData struct SDL_VideoData
{ {

View file

@ -29,10 +29,10 @@
const TUint32 WindowClientHandle = 9210; const TUint32 WindowClientHandle = 9210;
void DisableKeyBlocking(_THIS); void DisableKeyBlocking(SDL_VideoDevice *_this);
void ConstructWindowL(_THIS); void ConstructWindowL(SDL_VideoDevice *_this);
int NGAGE_CreateWindow(_THIS, SDL_Window *window) int NGAGE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
NGAGE_Window *ngage_window = (NGAGE_Window *)SDL_calloc(1, sizeof(NGAGE_Window)); NGAGE_Window *ngage_window = (NGAGE_Window *)SDL_calloc(1, sizeof(NGAGE_Window));
@ -57,7 +57,7 @@ int NGAGE_CreateWindow(_THIS, SDL_Window *window)
return 0; return 0;
} }
void NGAGE_DestroyWindow(_THIS, SDL_Window *window) void NGAGE_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
NGAGE_Window *ngage_window = (NGAGE_Window *)window->driverdata; NGAGE_Window *ngage_window = (NGAGE_Window *)window->driverdata;
@ -72,7 +72,7 @@ void NGAGE_DestroyWindow(_THIS, SDL_Window *window)
/* Internal */ /* Internal */
/*****************************************************************************/ /*****************************************************************************/
void DisableKeyBlocking(_THIS) void DisableKeyBlocking(SDL_VideoDevice *_this)
{ {
SDL_VideoData *phdata = _this->driverdata; SDL_VideoData *phdata = _this->driverdata;
TRawEvent event; TRawEvent event;
@ -81,7 +81,7 @@ void DisableKeyBlocking(_THIS)
phdata->NGAGE_WsSession.SimulateRawEvent(event); phdata->NGAGE_WsSession.SimulateRawEvent(event);
} }
void ConstructWindowL(_THIS) void ConstructWindowL(SDL_VideoDevice *_this)
{ {
SDL_VideoData *phdata = _this->driverdata; SDL_VideoData *phdata = _this->driverdata;
TInt error; TInt error;

View file

@ -35,9 +35,9 @@ typedef struct
} NGAGE_Window; } NGAGE_Window;
extern int extern int
NGAGE_CreateWindow(_THIS, SDL_Window *window); NGAGE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void extern void
NGAGE_DestroyWindow(_THIS, SDL_Window *window); NGAGE_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window);
#endif /* SDL_ngagewindow */ #endif /* SDL_ngagewindow */

View file

@ -30,7 +30,7 @@
#include "SDL_offscreenvideo.h" #include "SDL_offscreenvideo.h"
#include "SDL_offscreenevents_c.h" #include "SDL_offscreenevents_c.h"
void OFFSCREEN_PumpEvents(_THIS) void OFFSCREEN_PumpEvents(SDL_VideoDevice *_this)
{ {
/* do nothing. */ /* do nothing. */
} }

View file

@ -20,4 +20,4 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
extern void OFFSCREEN_PumpEvents(_THIS); extern void OFFSCREEN_PumpEvents(SDL_VideoDevice *_this);

View file

@ -27,7 +27,7 @@
#define OFFSCREEN_SURFACE "_SDL_DummySurface" #define OFFSCREEN_SURFACE "_SDL_DummySurface"
int SDL_OFFSCREEN_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch) int SDL_OFFSCREEN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
{ {
SDL_Surface *surface; SDL_Surface *surface;
const Uint32 surface_format = SDL_PIXELFORMAT_RGB888; const Uint32 surface_format = SDL_PIXELFORMAT_RGB888;
@ -52,7 +52,7 @@ int SDL_OFFSCREEN_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *for
return 0; return 0;
} }
int SDL_OFFSCREEN_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects) int SDL_OFFSCREEN_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects)
{ {
static int frame_number; static int frame_number;
SDL_Surface *surface; SDL_Surface *surface;
@ -72,7 +72,7 @@ int SDL_OFFSCREEN_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_R
return 0; return 0;
} }
void SDL_OFFSCREEN_DestroyWindowFramebuffer(_THIS, SDL_Window *window) void SDL_OFFSCREEN_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_Surface *surface; SDL_Surface *surface;

View file

@ -20,6 +20,6 @@
*/ */
#include "SDL_internal.h" #include "SDL_internal.h"
extern int SDL_OFFSCREEN_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch); extern int SDL_OFFSCREEN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch);
extern int SDL_OFFSCREEN_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects); extern int SDL_OFFSCREEN_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects);
extern void SDL_OFFSCREEN_DestroyWindowFramebuffer(_THIS, SDL_Window *window); extern void SDL_OFFSCREEN_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window);

View file

@ -28,7 +28,7 @@
/* EGL implementation of SDL OpenGL support */ /* EGL implementation of SDL OpenGL support */
int OFFSCREEN_GLES_LoadLibrary(_THIS, const char *path) int OFFSCREEN_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path)
{ {
int ret = SDL_EGL_LoadLibraryOnly(_this, path); int ret = SDL_EGL_LoadLibraryOnly(_this, path);
if (ret != 0) { if (ret != 0) {
@ -55,7 +55,7 @@ int OFFSCREEN_GLES_LoadLibrary(_THIS, const char *path)
} }
SDL_GLContext SDL_GLContext
OFFSCREEN_GLES_CreateContext(_THIS, SDL_Window *window) OFFSCREEN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_WindowData *offscreen_window = window->driverdata; SDL_WindowData *offscreen_window = window->driverdata;
@ -65,7 +65,7 @@ OFFSCREEN_GLES_CreateContext(_THIS, SDL_Window *window)
return context; return context;
} }
int OFFSCREEN_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context) int OFFSCREEN_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context)
{ {
if (window) { if (window) {
EGLSurface egl_surface = window->driverdata->egl_surface; EGLSurface egl_surface = window->driverdata->egl_surface;
@ -75,7 +75,7 @@ int OFFSCREEN_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context)
} }
} }
int OFFSCREEN_GLES_SwapWindow(_THIS, SDL_Window *window) int OFFSCREEN_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_WindowData *offscreen_wind = window->driverdata; SDL_WindowData *offscreen_wind = window->driverdata;

View file

@ -34,10 +34,10 @@
#define OFFSCREEN_GLES_SetSwapInterval SDL_EGL_SetSwapInterval #define OFFSCREEN_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
#define OFFSCREEN_GLES_DeleteContext SDL_EGL_DeleteContext #define OFFSCREEN_GLES_DeleteContext SDL_EGL_DeleteContext
extern int OFFSCREEN_GLES_LoadLibrary(_THIS, const char *path); extern int OFFSCREEN_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path);
extern SDL_GLContext OFFSCREEN_GLES_CreateContext(_THIS, SDL_Window *window); extern SDL_GLContext OFFSCREEN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window);
extern int OFFSCREEN_GLES_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context); extern int OFFSCREEN_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context);
extern int OFFSCREEN_GLES_SwapWindow(_THIS, SDL_Window *window); extern int OFFSCREEN_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window);
#endif /* SDL_VIDEO_DRIVER_OFFSCREEN && SDL_VIDEO_OPENGL_EGL */ #endif /* SDL_VIDEO_DRIVER_OFFSCREEN && SDL_VIDEO_OPENGL_EGL */

View file

@ -39,9 +39,9 @@
#define OFFSCREENVID_DRIVER_NAME "offscreen" #define OFFSCREENVID_DRIVER_NAME "offscreen"
/* Initialization/Query functions */ /* Initialization/Query functions */
static int OFFSCREEN_VideoInit(_THIS); static int OFFSCREEN_VideoInit(SDL_VideoDevice *_this);
static int OFFSCREEN_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode); static int OFFSCREEN_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode);
static void OFFSCREEN_VideoQuit(_THIS); static void OFFSCREEN_VideoQuit(SDL_VideoDevice *_this);
/* OFFSCREEN driver bootstrap functions */ /* OFFSCREEN driver bootstrap functions */
@ -96,7 +96,7 @@ VideoBootStrap OFFSCREEN_bootstrap = {
OFFSCREEN_CreateDevice OFFSCREEN_CreateDevice
}; };
int OFFSCREEN_VideoInit(_THIS) int OFFSCREEN_VideoInit(SDL_VideoDevice *_this)
{ {
SDL_DisplayMode mode; SDL_DisplayMode mode;
@ -113,12 +113,12 @@ int OFFSCREEN_VideoInit(_THIS)
return 0; return 0;
} }
static int OFFSCREEN_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) static int OFFSCREEN_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
{ {
return 0; return 0;
} }
void OFFSCREEN_VideoQuit(_THIS) void OFFSCREEN_VideoQuit(SDL_VideoDevice *_this)
{ {
} }

View file

@ -27,7 +27,7 @@
#include "SDL_offscreenwindow.h" #include "SDL_offscreenwindow.h"
int OFFSCREEN_CreateWindow(_THIS, SDL_Window *window) int OFFSCREEN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_WindowData *offscreen_window = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData)); SDL_WindowData *offscreen_window = (SDL_WindowData *)SDL_calloc(1, sizeof(SDL_WindowData));
@ -68,7 +68,7 @@ int OFFSCREEN_CreateWindow(_THIS, SDL_Window *window)
return 0; return 0;
} }
void OFFSCREEN_DestroyWindow(_THIS, SDL_Window *window) void OFFSCREEN_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_WindowData *offscreen_window = window->driverdata; SDL_WindowData *offscreen_window = window->driverdata;

View file

@ -33,7 +33,7 @@ struct SDL_WindowData
#endif #endif
}; };
extern int OFFSCREEN_CreateWindow(_THIS, SDL_Window *window); extern int OFFSCREEN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window);
extern void OFFSCREEN_DestroyWindow(_THIS, SDL_Window *window); extern void OFFSCREEN_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window);
#endif /* SDL_offscreenwindow_h */ #endif /* SDL_offscreenwindow_h */

View file

@ -45,7 +45,7 @@
/* PS2 driver bootstrap functions */ /* PS2 driver bootstrap functions */
static int PS2_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode) static int PS2_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
{ {
return 0; return 0;
} }
@ -55,7 +55,7 @@ static void PS2_DeleteDevice(SDL_VideoDevice *device)
SDL_free(device); SDL_free(device);
} }
static int PS2_CreateWindow(_THIS, SDL_Window *window) static int PS2_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window)
{ {
SDL_SetKeyboardFocus(window); SDL_SetKeyboardFocus(window);
@ -63,7 +63,7 @@ static int PS2_CreateWindow(_THIS, SDL_Window *window)
return 0; return 0;
} }
static int PS2_VideoInit(_THIS) static int PS2_VideoInit(SDL_VideoDevice *_this)
{ {
SDL_DisplayMode mode; SDL_DisplayMode mode;
@ -80,11 +80,11 @@ static int PS2_VideoInit(_THIS)
return 1; return 1;
} }
static void PS2_VideoQuit(_THIS) static void PS2_VideoQuit(SDL_VideoDevice *_this)
{ {
} }
static void PS2_PumpEvents(_THIS) static void PS2_PumpEvents(SDL_VideoDevice *_this)
{ {
/* do nothing. */ /* do nothing. */
} }

View file

@ -73,7 +73,7 @@ int EventUpdate(void *data)
return 0; return 0;
} }
void PSP_PumpEvents(_THIS) void PSP_PumpEvents(SDL_VideoDevice *_this)
{ {
int i; int i;
enum PspHprmKeys keys; enum PspHprmKeys keys;
@ -124,7 +124,7 @@ void PSP_PumpEvents(_THIS)
return; return;
} }
void PSP_InitOSKeymap(_THIS) void PSP_InitOSKeymap(SDL_VideoDevice *_this)
{ {
#ifdef PSPIRKEYB #ifdef PSPIRKEYB
int i; int i;
@ -235,7 +235,7 @@ void PSP_InitOSKeymap(_THIS)
#endif #endif
} }
int PSP_EventInit(_THIS) int PSP_EventInit(SDL_VideoDevice *_this)
{ {
#ifdef PSPIRKEYB #ifdef PSPIRKEYB
int outputmode = PSP_IRKBD_OUTPUT_MODE_SCANCODE; int outputmode = PSP_IRKBD_OUTPUT_MODE_SCANCODE;
@ -258,7 +258,7 @@ int PSP_EventInit(_THIS)
return 0; return 0;
} }
void PSP_EventQuit(_THIS) void PSP_EventQuit(SDL_VideoDevice *_this)
{ {
running = 0; running = 0;
SDL_WaitThread(thread, NULL); SDL_WaitThread(thread, NULL);

View file

@ -21,7 +21,7 @@
#include "SDL_pspvideo.h" #include "SDL_pspvideo.h"
extern void PSP_InitOSKeymap(_THIS); extern void PSP_InitOSKeymap(SDL_VideoDevice *_this);
extern void PSP_PumpEvents(_THIS); extern void PSP_PumpEvents(SDL_VideoDevice *_this);
/* end of SDL_pspevents_c.h ... */ /* end of SDL_pspevents_c.h ... */

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