Expose the EGL display and window for Vivante SDL windows
authorSam Lantinga
Sat, 16 Jan 2016 21:58:49 -0800
changeset 10055b2fd76446eee
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
     2.1 --- a/include/SDL_syswm.h	Sat Jan 16 21:25:10 2016 +0100
     2.2 +++ b/include/SDL_syswm.h	Sat Jan 16 21:58:49 2016 -0800
     2.3 @@ -106,6 +106,10 @@
     2.4  typedef void *EGLSurface;
     2.5  #endif
     2.6  
     2.7 +#if defined(SDL_VIDEO_DRIVER_VIVANTE)
     2.8 +#include "SDL_egl.h"
     2.9 +#endif
    2.10 +
    2.11  /**
    2.12   *  These are the various supported windowing subsystems
    2.13   */
    2.14 @@ -120,7 +124,8 @@
    2.15      SDL_SYSWM_WAYLAND,
    2.16      SDL_SYSWM_MIR,
    2.17      SDL_SYSWM_WINRT,
    2.18 -    SDL_SYSWM_ANDROID
    2.19 +    SDL_SYSWM_ANDROID,
    2.20 +    SDL_SYSWM_VIVANTE
    2.21  } SDL_SYSWM_TYPE;
    2.22  
    2.23  /**
    2.24 @@ -167,6 +172,13 @@
    2.25              /* No UIKit window events yet */
    2.26          } uikit;
    2.27  #endif
    2.28 +#if defined(SDL_VIDEO_DRIVER_VIVANTE)
    2.29 +        struct
    2.30 +        {
    2.31 +            int dummy;
    2.32 +            /* No Vivante window events yet */
    2.33 +        } vivante;
    2.34 +#endif
    2.35          /* Can't have an empty union */
    2.36          int dummy;
    2.37      } msg;
    2.38 @@ -259,6 +271,14 @@
    2.39          } android;
    2.40  #endif
    2.41  
    2.42 +#if defined(SDL_VIDEO_DRIVER_VIVANTE)
    2.43 +        struct
    2.44 +        {
    2.45 +            EGLNativeDisplayType display;
    2.46 +            EGLNativeWindowType window;
    2.47 +        } vivante;
    2.48 +#endif
    2.49 +
    2.50          /* Can't have an empty union */
    2.51          int dummy;
    2.52      } info;
     3.1 --- a/src/video/vivante/SDL_vivantevideo.c	Sat Jan 16 21:25:10 2016 +0100
     3.2 +++ b/src/video/vivante/SDL_vivantevideo.c	Sat Jan 16 21:58:49 2016 -0800
     3.3 @@ -366,12 +366,13 @@
     3.4  SDL_bool
     3.5  VIVANTE_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info)
     3.6  {
     3.7 -/*
     3.8      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
     3.9 +    SDL_DisplayData *displaydata = SDL_GetDisplayDriverData(0);
    3.10  
    3.11      if (info->version.major == SDL_MAJOR_VERSION &&
    3.12          info->version.minor == SDL_MINOR_VERSION) {
    3.13          info->subsystem = SDL_SYSWM_VIVANTE;
    3.14 +        info->info.vivante.display = displaydata->native_display;
    3.15          info->info.vivante.window = data->native_window;
    3.16          return SDL_TRUE;
    3.17      } else {
    3.18 @@ -379,9 +380,6 @@
    3.19                       SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
    3.20          return SDL_FALSE;
    3.21      }
    3.22 -*/
    3.23 -    SDL_Unsupported();
    3.24 -    return SDL_FALSE;
    3.25  }
    3.26  
    3.27  /*****************************************************************************/