Skip to content

Commit

Permalink
Expose the EGL display and window for Vivante SDL windows
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 17, 2016
1 parent 0a1999d commit e5d575b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
Empty file modified CMakeLists.txt 100755 → 100644
Empty file.
22 changes: 21 additions & 1 deletion include/SDL_syswm.h
Expand Up @@ -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
*/
Expand All @@ -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;

/**
Expand Down Expand Up @@ -166,6 +171,13 @@ struct SDL_SysWMmsg
int dummy;
/* 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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions src/video/vivante/SDL_vivantevideo.c
Expand Up @@ -366,22 +366,20 @@ 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 {
SDL_SetError("Application not compiled with SDL %d.%d\n",
SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
return SDL_FALSE;
}
*/
SDL_Unsupported();
return SDL_FALSE;
}

/*****************************************************************************/
Expand Down

0 comments on commit e5d575b

Please sign in to comment.