From 090919490a7e537cdd99079d33bf12e98227e108 Mon Sep 17 00:00:00 2001 From: GH Cao Date: Fri, 3 Jan 2020 06:07:05 +0800 Subject: [PATCH] UWP: Remove uwp_egl_create_surface Because of 0e2265, this is not doing anything special anymore. Remove it entirely and use common EGL surface creation instead. --- gfx/drivers_context/uwp_egl_ctx.c | 2 +- uwp/uwp_func.h | 11 ---------- uwp/uwp_main.cpp | 34 ------------------------------- 3 files changed, 1 insertion(+), 46 deletions(-) diff --git a/gfx/drivers_context/uwp_egl_ctx.c b/gfx/drivers_context/uwp_egl_ctx.c index be7031aece..75e8da088f 100644 --- a/gfx/drivers_context/uwp_egl_ctx.c +++ b/gfx/drivers_context/uwp_egl_ctx.c @@ -108,7 +108,7 @@ bool create_gles_context(void* corewindow) goto error; } - if (!uwp_egl_create_surface(&uwp_egl)) + if (!egl_create_surface(&uwp_egl, uwp_get_corewindow())) goto error; return true; diff --git a/uwp/uwp_func.h b/uwp/uwp_func.h index 5138084509..bd8588b083 100644 --- a/uwp/uwp_func.h +++ b/uwp/uwp_func.h @@ -22,17 +22,6 @@ extern "C" { #endif -#if defined(HAVE_OPENGL) && defined(HAVE_ANGLE) -#ifndef HAVE_EGL -#define HAVE_EGL 1 -#endif -#endif - -#ifdef HAVE_EGL -#include "../gfx/common/egl_common.h" -bool uwp_egl_create_surface(egl_ctx_data_t* egl); -#endif - extern char uwp_dir_install[PATH_MAX_LENGTH]; extern char uwp_dir_data[PATH_MAX_LENGTH]; extern char uwp_device_family[128]; diff --git a/uwp/uwp_main.cpp b/uwp/uwp_main.cpp index 7d5f139d2d..7b46bdffcd 100644 --- a/uwp/uwp_main.cpp +++ b/uwp/uwp_main.cpp @@ -30,12 +30,6 @@ #include "uwp_func.h" #include "uwp_async.h" -#if defined(HAVE_OPENGL) && defined(HAVE_ANGLE) -#ifndef HAVE_EGL -#define HAVE_EGL 1 -#endif -#endif - using namespace RetroArchUWP; using namespace concurrency; @@ -643,34 +637,6 @@ extern "C" { return (void*)CoreWindow::GetForCurrentThread(); } -#ifdef HAVE_EGL - /* A special version of egl_create_surface to properly handle DPI scaling. */ - bool uwp_egl_create_surface(egl_ctx_data_t* egl) - { - EGLint window_attribs[] = { - EGL_RENDER_BUFFER, EGL_BACK_BUFFER, - EGL_NONE, - }; - - /* Why Microsoft uses a WinRT class for sending parameters to EGL?! */ - PropertySet^ prop = ref new PropertySet(); - prop->Insert(L"EGLNativeWindowTypeProperty", CoreWindow::GetForCurrentThread()); - - egl->surf = eglCreateWindowSurface(egl->dpy, egl->config, (EGLNativeWindowType)(prop), window_attribs); - - if (egl->surf == EGL_NO_SURFACE) - return false; - - /* Connect the context to the surface. */ - if (!eglMakeCurrent(egl->dpy, egl->surf, egl->surf, egl->ctx)) - return false; - - RARCH_LOG("[EGL]: Current context: %p.\n", (void*)eglGetCurrentContext()); - - return true; - } -#endif - void uwp_fill_installed_core_packages(struct string_list *list) { for (auto package : Windows::ApplicationModel::Package::Current->Dependencies)