From 105fadd6681050655e340ab5e311fab33b476155 Mon Sep 17 00:00:00 2001 From: driver1998 Date: Fri, 6 Dec 2019 15:21:54 +0800 Subject: [PATCH] [ANGLE] Add HAVE_ANGLE --- gfx/drivers_context/uwp_egl_ctx.c | 10 +++++++++- gfx/drivers_context/wgl_ctx.c | 7 +++++++ griffin/griffin.c | 14 +++++++++++++- griffin/griffin_cpp.cpp | 12 ++++++++++++ uwp/uwp_func.h | 6 ++++++ uwp/uwp_main.cpp | 6 ++++++ 6 files changed, 53 insertions(+), 2 deletions(-) diff --git a/gfx/drivers_context/uwp_egl_ctx.c b/gfx/drivers_context/uwp_egl_ctx.c index 3314944c0e..be7031aece 100644 --- a/gfx/drivers_context/uwp_egl_ctx.c +++ b/gfx/drivers_context/uwp_egl_ctx.c @@ -46,9 +46,12 @@ #include "../../frontend/frontend_driver.h" #include "../common/egl_common.h" -#include "../common/angle_common.h" #include "../common/gl_common.h" +#ifdef HAVE_ANGLE +#include "../common/angle_common.h" +#endif + #ifdef HAVE_DYNAMIC static dylib_t dll_handle = NULL; /* Handle to libGLESv2.dll */ #endif @@ -84,8 +87,13 @@ bool create_gles_context(void* corewindow) EGL_NONE }; +#ifdef HAVE_ANGLE if (!angle_init_context(&uwp_egl, EGL_DEFAULT_DISPLAY, &major, &minor, &n, attribs, NULL)) +#else + if (!egl_init_context(&uwp_egl, EGL_NONE, EGL_DEFAULT_DISPLAY, + &major, &minor, &n, attribs, NULL)) +#endif { egl_report_error(); goto error; diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index ff4275ec6e..66063576ad 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -49,8 +49,10 @@ #ifdef HAVE_EGL #include "../common/egl_common.h" +#ifdef HAVE_ANGLE #include "../common/angle_common.h" #endif +#endif #if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) #include "../common/gl_common.h" @@ -387,8 +389,13 @@ static void create_gles_context(HWND hwnd, bool *quit) EGL_NONE }; +#ifdef HAVE_ANGLE if (!angle_init_context(&win32_egl, EGL_DEFAULT_DISPLAY, &major, &minor, &n, attribs, NULL)) +#else + if (!egl_init_context(&win32_egl, EGL_NONE, EGL_DEFAULT_DISPLAY, + &major, &minor, &n, attribs, NULL)) +#endif { egl_report_error(); goto error; diff --git a/griffin/griffin.c b/griffin/griffin.c index 4dfbceb62f..7ca5a0ec93 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -27,6 +27,18 @@ #define HAVE_COMPRESSION 1 #endif +#if defined(HAVE_OPENGL) && defined(HAVE_ANGLE) +#ifndef HAVE_OPENGLES +#define HAVE_OPENGLES 1 +#endif +#if !defined(HAVE_OPENGLES3) && !defined(HAVE_OPENGLES2) +#define HAVE_OPENGLES3 1 +#endif +#ifndef HAVE_EGL +#define HAVE_EGL 1 +#endif +#endif + #define JSON_STATIC 1 /* must come before runtime_file, netplay_room_parse and jsonsax_full */ #if _MSC_VER && !defined(__WINRT__) @@ -275,7 +287,7 @@ VIDEO CONTEXT #include "../gfx/drivers_context/vc_egl_ctx.c" #endif -#if defined(_WIN32) +#if defined(_WIN32) && defined(HAVE_ANGLE) #include "../gfx/common/angle_common.c" #endif diff --git a/griffin/griffin_cpp.cpp b/griffin/griffin_cpp.cpp index 1c1425374c..d6fca38210 100644 --- a/griffin/griffin_cpp.cpp +++ b/griffin/griffin_cpp.cpp @@ -23,6 +23,18 @@ #include #endif +#if defined(HAVE_OPENGL) && defined(HAVE_ANGLE) +#ifndef HAVE_OPENGLES +#define HAVE_OPENGLES 1 +#endif +#if !defined(HAVE_OPENGLES3) && !defined(HAVE_OPENGLES2) +#define HAVE_OPENGLES3 1 +#endif +#ifndef HAVE_EGL +#define HAVE_EGL 1 +#endif +#endif + /*============================================================ MENU ============================================================ */ diff --git a/uwp/uwp_func.h b/uwp/uwp_func.h index 3af1b975cd..04bde58d72 100644 --- a/uwp/uwp_func.h +++ b/uwp/uwp_func.h @@ -22,6 +22,12 @@ 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); diff --git a/uwp/uwp_main.cpp b/uwp/uwp_main.cpp index f9e3c09b94..b77833f807 100644 --- a/uwp/uwp_main.cpp +++ b/uwp/uwp_main.cpp @@ -29,6 +29,12 @@ #include #include +#if defined(HAVE_OPENGL) && defined(HAVE_ANGLE) +#ifndef HAVE_EGL +#define HAVE_EGL 1 +#endif +#endif + using namespace RetroArchUWP; using namespace concurrency;