summaryrefslogtreecommitdiff
path: root/platform/winrt/gl_context_egl.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-12-20 15:30:06 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-12-20 15:30:06 -0300
commita36a774897ae191ebb90ba803bac7f919e92bd6c (patch)
tree38a60d8a92d9add2f9641f1c4047d29821aa278a /platform/winrt/gl_context_egl.cpp
parent7dbc19f32db7b63062e715381923c873bf18683e (diff)
Fixes
-=-=-= -Added missing quaternion constructor -code completion fixes -winrt fixes
Diffstat (limited to 'platform/winrt/gl_context_egl.cpp')
-rw-r--r--platform/winrt/gl_context_egl.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/platform/winrt/gl_context_egl.cpp b/platform/winrt/gl_context_egl.cpp
index ca592c5d19..fd9fbe406f 100644
--- a/platform/winrt/gl_context_egl.cpp
+++ b/platform/winrt/gl_context_egl.cpp
@@ -1,5 +1,7 @@
#include "gl_context_egl.h"
+#include "EGL/eglext.h"
+
using namespace Platform;
void ContextEGL::release_current() {
@@ -22,6 +24,14 @@ int ContextEGL::get_window_height() {
return height;
};
+void ContextEGL::reset() {
+
+ cleanup();
+
+ window = CoreWindow::GetForCurrentThread();
+ initialize();
+};
+
void ContextEGL::swap_buffers() {
if (eglSwapBuffers(mEglDisplay, mEglSurface) != EGL_TRUE)
@@ -63,7 +73,23 @@ Error ContextEGL::initialize() {
try {
- display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+ const EGLint displayAttributes[] =
+ {
+ 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_NONE,
+ };
+
+ PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT"));
+
+ if (!eglGetPlatformDisplayEXT)
+ {
+ throw Exception::CreateException(E_FAIL, L"Failed to get function eglGetPlatformDisplayEXT");
+ }
+
+ display = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, displayAttributes);
+
if (display == EGL_NO_DISPLAY)
{
throw Exception::CreateException(E_FAIL, L"Failed to get default EGL display");