Expose the EGL display and window for Vivante SDL windows
authorSam Lantinga <slouken@libsdl.org>
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
     1.1 --- a/include/SDL_syswm.h	Sat Jan 16 21:25:10 2016 +0100
     1.2 +++ b/include/SDL_syswm.h	Sat Jan 16 21:58:49 2016 -0800
     1.3 @@ -106,6 +106,10 @@
     1.4  typedef void *EGLSurface;
     1.5  #endif
     1.6  
     1.7 +#if defined(SDL_VIDEO_DRIVER_VIVANTE)
     1.8 +#include "SDL_egl.h"
     1.9 +#endif
    1.10 +
    1.11  /**
    1.12   *  These are the various supported windowing subsystems
    1.13   */
    1.14 @@ -120,7 +124,8 @@
    1.15      SDL_SYSWM_WAYLAND,
    1.16      SDL_SYSWM_MIR,
    1.17      SDL_SYSWM_WINRT,
    1.18 -    SDL_SYSWM_ANDROID
    1.19 +    SDL_SYSWM_ANDROID,
    1.20 +    SDL_SYSWM_VIVANTE
    1.21  } SDL_SYSWM_TYPE;
    1.22  
    1.23  /**
    1.24 @@ -167,6 +172,13 @@
    1.25              /* No UIKit window events yet */
    1.26          } uikit;
    1.27  #endif
    1.28 +#if defined(SDL_VIDEO_DRIVER_VIVANTE)
    1.29 +        struct
    1.30 +        {
    1.31 +            int dummy;
    1.32 +            /* No Vivante window events yet */
    1.33 +        } vivante;
    1.34 +#endif
    1.35          /* Can't have an empty union */
    1.36          int dummy;
    1.37      } msg;
    1.38 @@ -259,6 +271,14 @@
    1.39          } android;
    1.40  #endif
    1.41  
    1.42 +#if defined(SDL_VIDEO_DRIVER_VIVANTE)
    1.43 +        struct
    1.44 +        {
    1.45 +            EGLNativeDisplayType display;
    1.46 +            EGLNativeWindowType window;
    1.47 +        } vivante;
    1.48 +#endif
    1.49 +
    1.50          /* Can't have an empty union */
    1.51          int dummy;
    1.52      } info;
     2.1 --- a/src/video/vivante/SDL_vivantevideo.c	Sat Jan 16 21:25:10 2016 +0100
     2.2 +++ b/src/video/vivante/SDL_vivantevideo.c	Sat Jan 16 21:58:49 2016 -0800
     2.3 @@ -366,12 +366,13 @@
     2.4  SDL_bool
     2.5  VIVANTE_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info)
     2.6  {
     2.7 -/*
     2.8      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
     2.9 +    SDL_DisplayData *displaydata = SDL_GetDisplayDriverData(0);
    2.10  
    2.11      if (info->version.major == SDL_MAJOR_VERSION &&
    2.12          info->version.minor == SDL_MINOR_VERSION) {
    2.13          info->subsystem = SDL_SYSWM_VIVANTE;
    2.14 +        info->info.vivante.display = displaydata->native_display;
    2.15          info->info.vivante.window = data->native_window;
    2.16          return SDL_TRUE;
    2.17      } else {
    2.18 @@ -379,9 +380,6 @@
    2.19                       SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
    2.20          return SDL_FALSE;
    2.21      }
    2.22 -*/
    2.23 -    SDL_Unsupported();
    2.24 -    return SDL_FALSE;
    2.25  }
    2.26  
    2.27  /*****************************************************************************/