Expose the EGL display and window for Vivante SDL windows
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
diff --git a/CMakeLists.txt b/CMakeLists.txt
old mode 100755
new mode 100644
diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h
index 1056e52..71ba5f1 100644
--- a/include/SDL_syswm.h
+++ b/include/SDL_syswm.h
@@ -106,6 +106,10 @@ typedef struct ANativeWindow ANativeWindow;
typedef void *EGLSurface;
#endif
+#if defined(SDL_VIDEO_DRIVER_VIVANTE)
+#include "SDL_egl.h"
+#endif
+
/**
* These are the various supported windowing subsystems
*/
@@ -120,7 +124,8 @@ typedef enum
SDL_SYSWM_WAYLAND,
SDL_SYSWM_MIR,
SDL_SYSWM_WINRT,
- SDL_SYSWM_ANDROID
+ SDL_SYSWM_ANDROID,
+ SDL_SYSWM_VIVANTE
} SDL_SYSWM_TYPE;
/**
@@ -167,6 +172,13 @@ struct SDL_SysWMmsg
/* No UIKit window events yet */
} uikit;
#endif
+#if defined(SDL_VIDEO_DRIVER_VIVANTE)
+ struct
+ {
+ int dummy;
+ /* No Vivante window events yet */
+ } vivante;
+#endif
/* Can't have an empty union */
int dummy;
} msg;
@@ -259,6 +271,14 @@ struct SDL_SysWMinfo
} android;
#endif
+#if defined(SDL_VIDEO_DRIVER_VIVANTE)
+ struct
+ {
+ EGLNativeDisplayType display;
+ EGLNativeWindowType window;
+ } vivante;
+#endif
+
/* Can't have an empty union */
int dummy;
} info;
diff --git a/src/video/vivante/SDL_vivantevideo.c b/src/video/vivante/SDL_vivantevideo.c
index fe4ea08..cb1a264 100644
--- a/src/video/vivante/SDL_vivantevideo.c
+++ b/src/video/vivante/SDL_vivantevideo.c
@@ -366,12 +366,13 @@ VIVANTE_HideWindow(_THIS, SDL_Window * window)
SDL_bool
VIVANTE_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info)
{
-/*
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
+ SDL_DisplayData *displaydata = SDL_GetDisplayDriverData(0);
if (info->version.major == SDL_MAJOR_VERSION &&
info->version.minor == SDL_MINOR_VERSION) {
info->subsystem = SDL_SYSWM_VIVANTE;
+ info->info.vivante.display = displaydata->native_display;
info->info.vivante.window = data->native_window;
return SDL_TRUE;
} else {
@@ -379,9 +380,6 @@ VIVANTE_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info)
SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
return SDL_FALSE;
}
-*/
- SDL_Unsupported();
- return SDL_FALSE;
}
/*****************************************************************************/