WinRT: made OpenGL window-init work with latest round of ANGLE/WinRT updates
authorDavid Ludwig <dludwig@pobox.com>
Tue, 17 Mar 2015 19:45:47 -0400
changeset 9386 65e802af5d0e
parent 9385 1bc5372ee27f
child 9387 63c918e10bd7
WinRT: made OpenGL window-init work with latest round of ANGLE/WinRT updates Various constants in ANGLE/WinRT, both in MSOpenTech's ms-master branch, and in Google's branch, were changed again. This change makes SDL/WinRT work with them. To note, the ms-master branch (of ANGLE) was updated via this merge: https://github.com/MSOpenTech/angle/commit/bbd2eb0a9c453a941f2c7abacf616d5a66b6be92#diff-d1377fbe747de154e1bfcf7221d3de67
src/video/winrt/SDL_winrtopengles.cpp
--- a/src/video/winrt/SDL_winrtopengles.cpp	Tue Mar 17 10:25:21 2015 -0400
+++ b/src/video/winrt/SDL_winrtopengles.cpp	Tue Mar 17 19:45:47 2015 -0400
@@ -36,13 +36,15 @@
 
 /* ANGLE/WinRT constants */
 static const int ANGLE_D3D_FEATURE_LEVEL_ANY = 0;
-#define EGL_PLATFORM_ANGLE_ANGLE                        0x3201
-#define EGL_PLATFORM_ANGLE_TYPE_ANGLE                   0x3202
-#define EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE      0x3203
-#define EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE      0x3204
-#define EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE           0x3205
-#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE             0x3207
-#define EGL_PLATFORM_ANGLE_USE_WARP_ANGLE               0x3208
+#define EGL_PLATFORM_ANGLE_ANGLE                        0x3202
+#define EGL_PLATFORM_ANGLE_TYPE_ANGLE                   0x3203
+#define EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE      0x3204
+#define EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE      0x3205
+#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE             0x3208
+#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE            0x3209
+#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE       0x320B
+#define EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE  0x320F
+
 #define EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER   0x320B
 
 
@@ -98,7 +100,8 @@
         const EGLint defaultDisplayAttributes[] =
         {
             EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
-            EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, 
+            EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
+            EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE,
             EGL_NONE,
         };
 
@@ -107,15 +110,17 @@
             EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
             EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, 9,
             EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, 3,
-            EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, 
+            EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
+            EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE,
             EGL_NONE,
         };
 
         const EGLint warpDisplayAttributes[] =
         {
             EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
-            EGL_PLATFORM_ANGLE_USE_WARP_ANGLE, EGL_TRUE,
-            EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE, 
+            EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE,
+            EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, EGL_TRUE,
+            EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, EGL_TRUE,
             EGL_NONE,
         };