ios: Apply a small patch to gfx/gl.c to allow HAVE_FBO to work.

This commit is contained in:
meancoot 2013-02-08 15:50:55 -05:00
parent 7b3ebc3078
commit 23a3fe63bf
4 changed files with 22 additions and 6 deletions

View File

@ -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,

View File

@ -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]);

View File

@ -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";

View File

@ -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];
}
}