diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 5dc2bac9da..92375d8519 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -7,7 +7,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := retroarch LOCAL_SRC_FILES = ../../console/griffin/griffin.c ../../console/rzlib/rzlib.c ../bifrost.c -LOCAL_CFLAGS = -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_GLSL -DHAVE_VID_CONTEXT -DHAVE_ZLIB -DHAVE_RARCH_MAIN_WRAP -DINLINE=inline -DRARCH_CONSOLE -DLSB_FIRST -D__LIBRETRO__ -DHAVE_CONFIGFILE=1 -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -std=gnu99 +LOCAL_CFLAGS = -DANDROID -DHAVE_DYNAMIC -DHAVE_DYLIB -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_GLSL -DHAVE_VID_CONTEXT -DHAVE_ZLIB -DHAVE_RARCH_MAIN_WRAP -DINLINE=inline -DRARCH_CONSOLE -DLSB_FIRST -D__LIBRETRO__ -DHAVE_CONFIGFILE=1 -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -std=gnu99 LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -lGLESv2 -llog diff --git a/android/src/com/retroarch/rgl.java b/android/src/com/retroarch/rgl.java index ea09b06ce2..b4080ecfd5 100644 --- a/android/src/com/retroarch/rgl.java +++ b/android/src/com/retroarch/rgl.java @@ -84,28 +84,28 @@ public class rgl implements GLSurfaceView.Renderer public void onSurfaceCreated(GL10 unused, EGLConfig config) { - //background color - GLES20.glClearColor(0.5f, 0.5f, 0.5f, 1.0f); - - triangles_init(); - shader_init(); + //background color + GLES20.glClearColor(0.5f, 0.5f, 0.5f, 1.0f); + + triangles_init(); + shader_init(); } public void onDrawFrame(GL10 unused) { - GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); - - GLES20.glUseProgram(cprg); - - // Triangle - GLES20.glVertexAttribPointer(v_position_handle, 3, GLES20.GL_FLOAT, false, 12, triangle_vbo); - GLES20.glEnableVertexAttribArray(v_position_handle); - - GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 3); + GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); + + GLES20.glUseProgram(cprg); + + // Triangle + GLES20.glVertexAttribPointer(v_position_handle, 3, GLES20.GL_FLOAT, false, 12, triangle_vbo); + GLES20.glEnableVertexAttribArray(v_position_handle); + + GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 3); } public void onSurfaceChanged(GL10 unused, int width, int height) { - GLES20.glViewport(0, 0, width, height); + GLES20.glViewport(0, 0, width, height); } } diff --git a/console/griffin/griffin.c b/console/griffin/griffin.c index d59dc9d4b3..ab9447d0dd 100644 --- a/console/griffin/griffin.c +++ b/console/griffin/griffin.c @@ -140,6 +140,10 @@ VIDEO DRIVER #include "../../gx/gx_video.c" #endif +#ifdef HAVE_DYLIB +#include "../../gfx/ext_gfx.c" +#endif + #include "../../gfx/gfx_common.c" #ifdef _XBOX @@ -234,6 +238,10 @@ AUDIO #include "../../audio/dsound.c" #endif +#ifdef HAVE_DYLIB +#include "../../audio/ext_audio.c" +#endif + #include "../../audio/null.c" /*============================================================ diff --git a/gfx/ext_gfx.c b/gfx/ext_gfx.c index 451ae6e710..ded60e4ae8 100644 --- a/gfx/ext_gfx.c +++ b/gfx/ext_gfx.c @@ -139,12 +139,35 @@ static void input_ext_free(void *data) } } +#ifdef RARCH_CONSOLE +static void input_ext_set_default_keybind_lut(unsigned device, unsigned port) +{ + (void)device; + (void)port; +} + +static void input_ext_set_analog_dpad_mapping(unsigned device, unsigned map_dpad_enum, unsigned controller_id) +{ + (void)device; + (void)map_dpad_enum; + (void)controller_id; +} + +static void input_ext_input_post_init(void) {} +#endif + static const input_driver_t input_ext = { input_ext_init, input_ext_poll, input_ext_input_state, input_ext_key_pressed, input_ext_free, +#ifdef RARCH_CONSOLE + input_ext_set_default_keybind_lut, + input_ext_set_analog_dpad_mapping, + input_ext_input_post_init, + 2, +#endif "ext" }; @@ -375,6 +398,13 @@ static bool video_read_viewport(void *data, uint8_t *buffer) return ext->driver->read_viewport(ext->handle, buffer); } +#ifdef RARCH_CONSOLE +static void video_ext_gfx_start(void) {} +static void video_ext_gfx_restart(void) {} +static void video_ext_gfx_stop(void) {} +static void video_ext_gfx_apply_state_changes(void) {} +#endif + const video_driver_t video_ext = { video_ext_init, video_ext_frame, @@ -384,6 +414,12 @@ const video_driver_t video_ext = { NULL, video_ext_free, "ext", +#ifdef RARCH_CONSOLE + video_ext_gfx_start, + video_ext_gfx_stop, + video_ext_gfx_restart, + video_ext_gfx_apply_state_changes, +#endif video_set_rotation, video_viewport_size,