Skip to content

Commit

Permalink
WinRT: got the SDL-official OpenGL ES 2 changes working, in an experi…
Browse files Browse the repository at this point in the history
…mental state
  • Loading branch information
DavidLudwig committed Nov 29, 2013
1 parent 7b5887b commit ecfbb3f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 175 deletions.
2 changes: 1 addition & 1 deletion VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj
Expand Up @@ -217,6 +217,7 @@
<ClInclude Include="..\..\include\SDL_config_winrt.h" />
<ClInclude Include="..\..\include\SDL_copying.h" />
<ClInclude Include="..\..\include\SDL_cpuinfo.h" />
<ClInclude Include="..\..\include\SDL_egl.h" />
<ClInclude Include="..\..\include\SDL_endian.h" />
<ClInclude Include="..\..\include\SDL_error.h" />
<ClInclude Include="..\..\include\SDL_events.h" />
Expand Down Expand Up @@ -315,7 +316,6 @@
<ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
<ClInclude Include="..\..\src\video\SDL_shape_internals.h" />
<ClInclude Include="..\..\src\video\SDL_sysvideo.h" />
<ClInclude Include="..\..\src\video\winrt\SDL_winrtegl.h" />
<ClInclude Include="..\..\src\video\winrt\SDL_winrtevents_c.h" />
<ClInclude Include="..\..\src\video\winrt\SDL_winrtmouse_c.h" />
<ClInclude Include="..\..\src\video\winrt\SDL_winrtopengles.h" />
Expand Down
6 changes: 3 additions & 3 deletions VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters
Expand Up @@ -629,12 +629,12 @@
<ClInclude Include="..\..\src\video\SDL_egl.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\src\video\winrt\SDL_winrtegl.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_opengles2.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\include\SDL_egl.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Header Files">
Expand Down
7 changes: 7 additions & 0 deletions include/SDL_egl.h
Expand Up @@ -391,9 +391,16 @@ typedef enum {
#endif
#include <windows.h>

#if __WINRT__
#include <Unknwn.h>
typedef IUnknown * EGLNativeWindowType;
typedef int EGLNativeDisplayType;
typedef HBITMAP EGLNativePixmapType;
#else
typedef HDC EGLNativeDisplayType;
typedef HBITMAP EGLNativePixmapType;
typedef HWND EGLNativeWindowType;
#endif

#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */

Expand Down
6 changes: 3 additions & 3 deletions src/video/SDL_egl.c
Expand Up @@ -41,7 +41,7 @@
#define DEFAULT_OGL_ES_PVR "libGLES_CM.so"
#define DEFAULT_OGL_ES "libGLESv1_CM.so"

#elif SDL_VIDEO_DRIVER_WINDOWS
#elif SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
/* EGL AND OpenGL ES support via ANGLE */
#define DEFAULT_EGL "libEGL.dll"
#define DEFAULT_OGL_ES2 "libGLESv2.dll"
Expand Down Expand Up @@ -118,7 +118,7 @@ SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_displa
{
void *dll_handle = NULL, *egl_dll_handle = NULL; /* The naming is counter intuitive, but hey, I just work here -- Gabriel */
char *path = NULL;
#if SDL_VIDEO_DRIVER_WINDOWS
#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
const char *d3dcompiler;
#endif

Expand All @@ -131,7 +131,7 @@ SDL_EGL_LoadLibrary(_THIS, const char *egl_path, NativeDisplayType native_displa
return SDL_OutOfMemory();
}

#if SDL_VIDEO_DRIVER_WINDOWS
#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_WINRT
d3dcompiler = SDL_GetHint(SDL_HINT_VIDEO_WIN_D3DCOMPILER);
if (!d3dcompiler) {
/* By default we load the Vista+ compatible compiler */
Expand Down
166 changes: 0 additions & 166 deletions src/video/winrt/SDL_winrtegl.h

This file was deleted.

2 changes: 1 addition & 1 deletion src/video/winrt/SDL_winrtopengles.h
Expand Up @@ -26,7 +26,7 @@
#if SDL_VIDEO_DRIVER_WINRT && SDL_VIDEO_OPENGL_EGL

#include "../SDL_sysvideo.h"
#include "../SDL_egl.h"
#include "../SDL_egl_c.h"

/* OpenGLES functions */
#define WINRT_GLES_GetAttribute SDL_EGL_GetAttribute
Expand Down
2 changes: 1 addition & 1 deletion src/video/winrt/SDL_winrtvideo_cpp.h
Expand Up @@ -31,7 +31,7 @@

extern "C" {
#include "../SDL_sysvideo.h"
#include "SDL_winrtegl.h"
#include "../SDL_egl_c.h"
}


Expand Down

0 comments on commit ecfbb3f

Please sign in to comment.