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.
This commit is contained in:
GH Cao 2020-01-03 06:07:05 +08:00
parent 2ba1f3547c
commit 090919490a
3 changed files with 1 additions and 46 deletions

View File

@ -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;

View File

@ -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];

View File

@ -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)