From be1abb6f3893abb7a8d9587571dbbe9fb96573e6 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 16 Oct 2012 15:38:25 +0200 Subject: [PATCH] (Android) Runs now - note - we might want to refactor HAVE_XML ifdefs to HAVE_GLSL since I currently don't have HAVE_XML defined for Android NDK --- android/native/jni/Android.mk | 2 +- gfx/gl.c | 16 ++++++++-------- gfx/shader_glsl.c | 6 ++++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/android/native/jni/Android.mk b/android/native/jni/Android.mk index 201b453230..5d5b5f1edf 100644 --- a/android/native/jni/Android.mk +++ b/android/native/jni/Android.mk @@ -44,7 +44,7 @@ LOCAL_SRC_FILES = $(RARCH_PATH)/retroarch.c \ $(RARCH_PATH)/thread.c \ main.c -LOCAL_CFLAGS = -marm -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_GLSL -DHAVE_ZLIB -DINLINE=inline -DLSB_FIRST -D__LIBRETRO__ -DHAVE_CONFIGFILE=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -std=gnu99 +LOCAL_CFLAGS = -marm -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_GLSL -DHAVE_ZLIB -DINLINE=inline -DLSB_FIRST -D__LIBRETRO__ -DHAVE_CONFIGFILE=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -std=gnu99 LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -landroid -lEGL -lGLESv2 -llog -ldl -lz LOCAL_STATIC_LIBRARIES := android_native_app_glue diff --git a/gfx/gl.c b/gfx/gl.c index 8041e37b07..248def01a0 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -225,7 +225,7 @@ void gl_shader_use(unsigned index) gl_cg_use(index); #endif -#ifdef HAVE_XML +#if defined(HAVE_XML) || defined(HAVE_GLSL) gl_glsl_use(index); #endif } @@ -236,7 +236,7 @@ static inline void gl_shader_deinit(void) gl_cg_deinit(); #endif -#ifdef HAVE_XML +#if defined(HAVE_XML) || defined(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; -#ifdef HAVE_XML +#if defined(HAVE_XML) || defined(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 -#ifdef HAVE_XML +#if defined(HAVE_XML) || defined(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 -#ifdef HAVE_XML +#if defined(HAVE_XML) || defined(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 -#ifdef HAVE_XML +#if defined(HAVE_XML) || defined(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 -#ifdef HAVE_XML +#if defined(HAVE_XML) || defined(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 -#ifdef HAVE_XML +#if defined(HAVE_XML) || defined(HAVE_GLSL) gl_glsl_set_get_proc_address(gl->ctx_driver->get_proc_address); #endif diff --git a/gfx/shader_glsl.c b/gfx/shader_glsl.c index 7a65c119d5..0212419c58 100644 --- a/gfx/shader_glsl.c +++ b/gfx/shader_glsl.c @@ -1056,8 +1056,10 @@ bool gl_glsl_init(const char *path) } #endif - //if (!gl_check_error()) - // RARCH_WARN("Detected GL error.\n"); +#ifdef GLSL_DEBUG + if (!gl_check_error()) + RARCH_WARN("Detected GL error.\n"); +#endif #ifdef HAVE_XML if (gl_tracker_info_cnt > 0)