diff --git a/gfx/context/ioseagl_ctx.c b/gfx/context/ioseagl_ctx.c index a445113f24..8140835a5d 100644 --- a/gfx/context/ioseagl_ctx.c +++ b/gfx/context/ioseagl_ctx.c @@ -39,8 +39,8 @@ static void gfx_ctx_destroy(void) static void gfx_ctx_get_video_size(unsigned *width, unsigned *height) { - extern void get_game_view_size(unsigned *, unsigned *); - get_game_view_size(width, height); + extern void ios_get_game_view_size(unsigned *, unsigned *); + ios_get_game_view_size(width, height); } static bool gfx_ctx_init(void) @@ -50,8 +50,8 @@ static bool gfx_ctx_init(void) static void gfx_ctx_swap_buffers(void) { - extern void flip_game_view(); - flip_game_view(); + extern void ios_flip_game_view(); + ios_flip_game_view(); } static void gfx_ctx_check_window(bool *quit, diff --git a/gfx/gl.c b/gfx/gl.c index 263cdc8549..1890cc8c49 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -867,7 +867,13 @@ static void gl_frame_fbo(void *data, const struct gl_tex_info *tex_info) set_texture_coords(fbo_tex_coords, xamt, yamt); // Render our FBO texture to back buffer. +#ifdef IOS + // There is no default frame buffer on IOS. + extern void ios_bind_game_view_fbo(); + ios_bind_game_view_fbo(); +#else pglBindFramebuffer(GL_FRAMEBUFFER, 0); +#endif gl_shader_use_func(gl, gl->fbo_pass + 1); glBindTexture(GL_TEXTURE_2D, gl->fbo_texture[gl->fbo_pass - 1]); diff --git a/ios/RetroArch.xcodeproj/project.pbxproj b/ios/RetroArch.xcodeproj/project.pbxproj index 34b3f65c71..550cae4aa6 100644 --- a/ios/RetroArch.xcodeproj/project.pbxproj +++ b/ios/RetroArch.xcodeproj/project.pbxproj @@ -874,6 +874,7 @@ "-DRARCH_PERFORMANCE_MODE", "-DPACKAGE_VERSION=\\\"1.0\\\"", "-std=gnu99", + "-DHAVE_FBO", ); SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -916,6 +917,7 @@ "-DRARCH_PERFORMANCE_MODE", "-DPACKAGE_VERSION=\\\"1.0\\\"", "-std=gnu99", + "-DHAVE_FBO", ); SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/ios/RetroArch/gameview.m b/ios/RetroArch/gameview.m index 7ced4be91c..8e63ea82f8 100644 --- a/ios/RetroArch/gameview.m +++ b/ios/RetroArch/gameview.m @@ -106,7 +106,7 @@ void ios_close_game() @end -void flip_game_view() +void ios_flip_game_view() { if (gl_view) { @@ -115,7 +115,7 @@ void flip_game_view() } } -void get_game_view_size(unsigned *width, unsigned *height) +void ios_get_game_view_size(unsigned *width, unsigned *height) { if (gl_view) { @@ -123,3 +123,11 @@ void get_game_view_size(unsigned *width, unsigned *height) *height = gl_view.bounds.size.height * screen_scale; } } + +void ios_bind_game_view_fbo() +{ + if (gl_view) + { + [gl_view bindDrawable]; + } +}