mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-03 08:28:29 +00:00
Updated SDL_syswm.h for SDL 3.0
* The header is no longer dependent on SDL build configuration * The structures are versioned separately from the rest of SDL * SDL_GetWindowWMInfo() now returns a standard result code and is passed the version expected by the application * Updated WhatsNew.txt and docs/README-migration.md with the first API changes in SDL 3.0
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
|
||||
#if SDL_VIDEO_DRIVER_ANDROID
|
||||
|
||||
#include "SDL_syswm.h"
|
||||
#include "../SDL_sysvideo.h"
|
||||
#include "../../events/SDL_keyboard_c.h"
|
||||
#include "../../events/SDL_mouse_c.h"
|
||||
@@ -33,6 +32,9 @@
|
||||
#include "SDL_androidwindow.h"
|
||||
#include "SDL_hints.h"
|
||||
|
||||
#define SDL_ENABLE_SYSWM_ANDROID
|
||||
#include "SDL_syswm.h"
|
||||
|
||||
/* Currently only one window */
|
||||
SDL_Window *Android_Window = NULL;
|
||||
|
||||
@@ -202,25 +204,19 @@ Android_DestroyWindow(_THIS, SDL_Window *window)
|
||||
SDL_UnlockMutex(Android_ActivityMutex);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
int
|
||||
Android_GetWindowWMInfo(_THIS, SDL_Window *window, SDL_SysWMinfo *info)
|
||||
{
|
||||
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
|
||||
|
||||
if (info->version.major == SDL_MAJOR_VERSION) {
|
||||
info->subsystem = SDL_SYSWM_ANDROID;
|
||||
info->info.android.window = data->native_window;
|
||||
info->subsystem = SDL_SYSWM_ANDROID;
|
||||
info->info.android.window = data->native_window;
|
||||
|
||||
#if SDL_VIDEO_OPENGL_EGL
|
||||
info->info.android.surface = data->egl_surface;
|
||||
info->info.android.surface = data->egl_surface;
|
||||
#endif
|
||||
|
||||
return SDL_TRUE;
|
||||
} else {
|
||||
SDL_SetError("Application not compiled with SDL %d",
|
||||
SDL_MAJOR_VERSION);
|
||||
return SDL_FALSE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_ANDROID */
|
||||
|
Reference in New Issue
Block a user