From 158a442036f15941d7d2dae5db8c27606ca1cc3c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 17 Feb 2019 10:41:48 +0100 Subject: [PATCH] Add further HAVE_OPENGL1 support --- Makefile.common | 33 ++++++++++++++----- gfx/drivers_context/wgl_ctx.c | 1 - gfx/drivers_context/x_ctx.c | 1 - gfx/video_driver.c | 2 +- libretro-common/include/gfx/gl_capabilities.h | 8 ++--- menu/menu_driver.c | 2 +- 6 files changed, 31 insertions(+), 16 deletions(-) diff --git a/Makefile.common b/Makefile.common index daf601d5ad..142cfebe3d 100644 --- a/Makefile.common +++ b/Makefile.common @@ -9,17 +9,25 @@ endif ifeq ($(HAVE_GL_CONTEXT),) HAVE_GL_CONTEXT=0 + HAVE_GL_MODERN=0 ifeq ($(HAVE_OPENGL), 1) + HAVE_GL_CONTEXT=1 + HAVE_GL_MODERN=1 + endif + + ifeq ($(HAVE_OPENGL1), 1) HAVE_GL_CONTEXT=1 endif ifeq ($(HAVE_OPENGLES), 1) HAVE_GL_CONTEXT=1 + HAVE_GL_MODERN=1 endif ifeq ($(HAVE_OPENGLES3), 1) HAVE_GL_CONTEXT=1 + HAVE_GL_MODERN=1 endif endif @@ -1057,19 +1065,25 @@ ifeq ($(HAVE_PLAIN_DRM), 1) endif ifeq ($(HAVE_GL_CONTEXT), 1) - DEFINES += -DHAVE_OPENGL -DHAVE_GLSL - OBJ += gfx/drivers/gl.o \ - $(LIBRETRO_COMM_DIR)/gfx/gl_capabilities.o \ - gfx/drivers_font/gl_raster_font.o \ - $(LIBRETRO_COMM_DIR)/glsym/rglgen.o + ifeq ($(HAVE_GL_MODERN), 1) + DEFINES += -DHAVE_OPENGL + OBJ += gfx/drivers/gl.o \ + $(LIBRETRO_COMM_DIR)/gfx/gl_capabilities.o \ + gfx/drivers_font/gl_raster_font.o + endif + + OBJ += $(LIBRETRO_COMM_DIR)/glsym/rglgen.o ifeq ($(HAVE_OPENGL1), 1) + DEFINES += -DHAVE_OPENGL1 OBJ += gfx/drivers/gl1.o \ gfx/drivers_font/gl1_raster_font.o endif ifeq ($(HAVE_MENU_COMMON), 1) - OBJ += menu/drivers_display/menu_display_gl.o + ifeq ($(HAVE_GL_MODERN), 1) + OBJ += menu/drivers_display/menu_display_gl.o + endif ifeq ($(HAVE_OPENGL1), 1) OBJ += menu/drivers_display/menu_display_gl1.o @@ -1107,7 +1121,7 @@ ifeq ($(HAVE_GL_CONTEXT), 1) endif ifeq ($(HAVE_OSMESA), 1) - OBJ += gfx/drivers_context/osmesa_ctx.o + OBJ += gfx/drivers_context/osmesa_ctx.o LIBS += -lOSMesa endif @@ -1164,7 +1178,10 @@ ifeq ($(HAVE_GL_CONTEXT), 1) LIBS += $(GL_LIBS) endif - OBJ += gfx/drivers_shader/shader_glsl.o + ifeq ($(HAVE_GL_MODERN), 1) + DEFINES += -DHAVE_GLSL + OBJ += gfx/drivers_shader/shader_glsl.o + endif endif ifeq ($(HAVE_EGL), 1) diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index f00696aa79..815ef7de3e 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -49,7 +49,6 @@ #ifdef HAVE_OPENGL #include "../common/gl_common.h" -#include #endif #ifdef HAVE_VULKAN diff --git a/gfx/drivers_context/x_ctx.c b/gfx/drivers_context/x_ctx.c index 0196ae4f50..f29751a025 100644 --- a/gfx/drivers_context/x_ctx.c +++ b/gfx/drivers_context/x_ctx.c @@ -25,7 +25,6 @@ #ifdef HAVE_OPENGL #include -#include #ifndef GLX_SAMPLE_BUFFERS #define GLX_SAMPLE_BUFFERS 100000 diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 9ad45bd950..2ebbabc2a5 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -261,10 +261,10 @@ struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END] = { static const video_driver_t *video_drivers[] = { #ifdef HAVE_OPENGL &video_gl2, +#endif #ifdef HAVE_OPENGL1 &video_gl1, #endif -#endif #ifdef HAVE_VULKAN &video_vulkan, #endif diff --git a/libretro-common/include/gfx/gl_capabilities.h b/libretro-common/include/gfx/gl_capabilities.h index c71352efaa..0d015941ce 100644 --- a/libretro-common/include/gfx/gl_capabilities.h +++ b/libretro-common/include/gfx/gl_capabilities.h @@ -51,18 +51,18 @@ enum gl_capability_enum GL_CAPS_TEX_STORAGE_EXT }; -bool gl_check_error(char **error_string); - bool gl_query_core_context_in_use(void); void gl_query_core_context_set(bool set); void gl_query_core_context_unset(void); -bool gl_check_capability(enum gl_capability_enum enum_idx); - bool gl_query_extension(const char *ext); +bool gl_check_error(char **error_string); + +bool gl_check_capability(enum gl_capability_enum enum_idx); + RETRO_END_DECLS #endif diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 2f05acbbcb..f181a767a3 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -126,10 +126,10 @@ static menu_display_ctx_driver_t *menu_display_ctx_drivers[] = { #endif #ifdef HAVE_OPENGL &menu_display_ctx_gl, +#endif #ifdef HAVE_OPENGL1 &menu_display_ctx_gl1, #endif -#endif #ifdef HAVE_VULKAN &menu_display_ctx_vulkan, #endif