Expose the EGL display and window for Vivante SDL windows
authorSam Lantinga <slouken@libsdl.org>
Sat, 16 Jan 2016 21:58:49 -0800
changeset 10055 b2fd76446eee
parent 10054 fb06163059bf
child 10056 4f139e059592
Expose the EGL display and window for Vivante SDL windows
CMakeLists.txt
include/SDL_syswm.h
src/video/vivante/SDL_vivantevideo.c
--- a/include/SDL_syswm.h	Sat Jan 16 21:25:10 2016 +0100
+++ b/include/SDL_syswm.h	Sat Jan 16 21:58:49 2016 -0800
@@ -106,6 +106,10 @@
 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 @@
     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 @@
             /* 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 @@
         } android;
 #endif
 
+#if defined(SDL_VIDEO_DRIVER_VIVANTE)
+        struct
+        {
+            EGLNativeDisplayType display;
+            EGLNativeWindowType window;
+        } vivante;
+#endif
+
         /* Can't have an empty union */
         int dummy;
     } info;
--- a/src/video/vivante/SDL_vivantevideo.c	Sat Jan 16 21:25:10 2016 +0100
+++ b/src/video/vivante/SDL_vivantevideo.c	Sat Jan 16 21:58:49 2016 -0800
@@ -366,12 +366,13 @@
 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 @@
                      SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
         return SDL_FALSE;
     }
-*/
-    SDL_Unsupported();
-    return SDL_FALSE;
 }
 
 /*****************************************************************************/