Add custom GLEW - interfaces with libretro get_proc_address -

we need this for compatibility with DRM/KMS and Wayland contexts -
otherwise we're limited to GLX context
This commit is contained in:
twinaphex 2020-07-12 23:51:57 +02:00
parent 406c06ccaf
commit f958ed5817
5 changed files with 22990 additions and 4 deletions

@ -1 +1 @@
Subproject commit 1c64b8fbd3cb6bd87935eb53f302f7de6f86e209
Subproject commit 942934a3d55f600622fb3f3ad60ecc1f3da23b6b

View File

@ -315,7 +315,7 @@ void CheckGLExtensions() {
ParseExtensionsString(g_all_gl_extensions, g_set_gl_extensions);
}
#ifdef WIN32
#if defined(WIN32) && !defined(__LIBRETRO__)
const char *wglString = 0;
if (wglGetExtensionsStringEXT)
wglString = wglGetExtensionsStringEXT();

View File

@ -14,13 +14,20 @@
retro_video_refresh_t LibretroGraphicsContext::video_cb;
extern "C" {
retro_hw_get_proc_address_t libretro_get_proc_address;
};
void retro_set_video_refresh(retro_video_refresh_t cb) { LibretroGraphicsContext::video_cb = cb; }
static void context_reset() { ((LibretroHWRenderContext *)Libretro::ctx)->ContextReset(); }
static void context_destroy() { ((LibretroHWRenderContext *)Libretro::ctx)->ContextDestroy(); }
bool LibretroHWRenderContext::Init(bool cache_context) {
hw_render_.cache_context = cache_context;
return Libretro::environ_cb(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render_);
if (!Libretro::environ_cb(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render_))
return false;
libretro_get_proc_address = hw_render_.get_proc_address;
return true;
}
LibretroHWRenderContext::LibretroHWRenderContext(retro_hw_context_type context_type, unsigned version_major, unsigned version_minor) {

View File

@ -95,7 +95,7 @@ ifeq ($(PLATFORM_EXT), android)
$(NATIVEDIR)/math/fast/fast_matrix.c
endif
SOURCES_C += $(EXTDIR)/glew/glew.c
SOURCES_C += $(LIBRETRODIR)/ext/glew/glew.c
SOURCES_C += \
$(EXTDIR)/libkirk/AES.c \

22979
libretro/ext/glew/glew.c Normal file

File diff suppressed because it is too large Load Diff