diff --git a/Makefile b/Makefile index b2f9ca4f78..a0c1956594 100644 --- a/Makefile +++ b/Makefile @@ -236,6 +236,7 @@ ifeq ($(HAVE_XML), 1) ifeq ($(HAVE_OPENGL), 1) OBJ += gfx/shader_glsl.o + DEFINES += -DHAVE_GLSL endif endif diff --git a/Makefile.win b/Makefile.win index 8d92c4da52..fd01396af5 100644 --- a/Makefile.win +++ b/Makefile.win @@ -135,7 +135,7 @@ endif ifeq ($(HAVE_XML), 1) OBJ += gfx/shader_glsl.o gfx/image.o gfx/state_tracker.o cheats.o - DEFINES += -Ilibxml2 -DHAVE_XML + DEFINES += -Ilibxml2 -DHAVE_XML -DHAVE_GLSL LIBS += -lxml2 -liconv endif diff --git a/gfx/gl.c b/gfx/gl.c index 248def01a0..305c330c16 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -38,7 +38,7 @@ #include "shader_cg.h" #endif -#if defined(HAVE_XML) || defined(HAVE_GLSL) +#ifdef HAVE_GLSL #include "shader_glsl.h" #endif @@ -225,7 +225,7 @@ void gl_shader_use(unsigned index) gl_cg_use(index); #endif -#if defined(HAVE_XML) || defined(HAVE_GLSL) +#ifdef HAVE_GLSL gl_glsl_use(index); #endif } @@ -236,7 +236,7 @@ static inline void gl_shader_deinit(void) gl_cg_deinit(); #endif -#if defined(HAVE_XML) || defined(HAVE_GLSL) +#ifdef HAVE_GLSL gl_glsl_deinit(); #endif } @@ -280,7 +280,7 @@ void gl_shader_set_coords(const struct gl_coords *coords, const math_matrix *mat (void)ret_coords; (void)ret_mvp; -#if defined(HAVE_XML) || defined(HAVE_GLSL) +#ifdef HAVE_GLSL if (!ret_coords) ret_coords |= gl_glsl_set_coords(coords); if (!ret_mvp) @@ -321,7 +321,7 @@ static inline void gl_shader_set_params(unsigned width, unsigned height, frame_count, info, prev_info, fbo_info, fbo_info_cnt); #endif -#if defined(HAVE_XML) || defined(HAVE_GLSL) +#ifdef HAVE_GLSL gl_glsl_set_params(width, height, tex_width, tex_height, out_width, out_height, @@ -337,7 +337,7 @@ static unsigned gl_shader_num(void) return cg_num; #endif -#if defined(HAVE_XML) || defined(HAVE_GLSL) +#ifdef HAVE_GLSL unsigned glsl_num = gl_glsl_num(); if (glsl_num) return glsl_num; @@ -355,7 +355,7 @@ static bool gl_shader_filter_type(unsigned index, bool *smooth) valid = gl_cg_filter_type(index, smooth); #endif -#if defined(HAVE_XML) || defined(HAVE_GLSL) +#ifdef HAVE_GLSL if (!valid) valid = gl_glsl_filter_type(index, smooth); #endif @@ -373,7 +373,7 @@ static void gl_shader_scale(unsigned index, struct gl_fbo_scale *scale) gl_cg_shader_scale(index, scale); #endif -#if defined(HAVE_XML) || defined(HAVE_GLSL) +#ifdef HAVE_GLSL if (!scale->valid) gl_glsl_shader_scale(index, scale); #endif @@ -1272,7 +1272,7 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo gl_cg_set_menu_shader(default_paths.menu_shader_file); #endif -#if defined(HAVE_XML) || defined(HAVE_GLSL) +#ifdef HAVE_GLSL gl_glsl_set_get_proc_address(gl->ctx_driver->get_proc_address); #endif diff --git a/gfx/gl_common.h b/gfx/gl_common.h index 73eafc87d5..d809a72689 100644 --- a/gfx/gl_common.h +++ b/gfx/gl_common.h @@ -155,7 +155,7 @@ struct gl_coords #define MAX_SHADERS 16 -#if defined(HAVE_XML) || defined(HAVE_CG) +#if defined(HAVE_GLSL) || defined(HAVE_CG) #define TEXTURES 8 #else #define TEXTURES 1