diff --git a/gfx/context/ioseagl_ctx.c b/gfx/context/ioseagl_ctx.c index 8140835a5d..106eb3d242 100644 --- a/gfx/context/ioseagl_ctx.c +++ b/gfx/context/ioseagl_ctx.c @@ -29,7 +29,8 @@ // C interface static void gfx_ctx_set_swap_interval(unsigned interval) { - RARCH_LOG("gfx_ctx_set_swap_interval not supported.\n"); + extern void ios_set_game_view_sync(bool on); + ios_set_game_view_sync(interval ? true : false); } static void gfx_ctx_destroy(void) diff --git a/ios/RetroArch/game_view.m b/ios/RetroArch/game_view.m index 95c3aa46f8..ef16a371ea 100644 --- a/ios/RetroArch/game_view.m +++ b/ios/RetroArch/game_view.m @@ -21,6 +21,8 @@ static GLKView *gl_view; static float screen_scale; static bool ra_initialized = false; static bool ra_done = false; +static int frame_skips = 4; +static bool is_syncing = true; void ios_load_game(const char* file_name) { @@ -112,11 +114,21 @@ void ios_flip_game_view() { if (gl_view) { - [gl_view setNeedsDisplay]; - [gl_view bindDrawable]; + if (--frame_skips < 0) + { + [gl_view setNeedsDisplay]; + [gl_view bindDrawable]; + frame_skips = is_syncing ? 0 : 3; + } } } +void ios_set_game_view_sync(bool on) +{ + is_syncing = on; + frame_skips = on ? 0 : 3; +} + void ios_get_game_view_size(unsigned *width, unsigned *height) { if (gl_view)