From b0e5031f1fb417ea087f08649afe9a9fdf072932 Mon Sep 17 00:00:00 2001 From: steve Date: Thu, 10 Sep 2015 15:01:02 -0700 Subject: ios now displays splash screen between launch image and main scene, instead of a black screen --- drivers/gles2/rasterizer_gles2.cpp | 6 ++++++ drivers/gles2/rasterizer_gles2.h | 2 ++ platform/iphone/gl_view.mm | 2 ++ servers/visual/rasterizer.h | 1 + servers/visual/visual_server_raster.cpp | 2 ++ 5 files changed, 13 insertions(+) diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index d3a5f3b5bc..ebe0c61967 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -11188,6 +11188,12 @@ RasterizerGLES2::RasterizerGLES2(bool p_compress_arrays,bool p_keep_ram_copy,boo tc0_idx=0; }; +void RasterizerGLES2::restore_framebuffer() { + + glBindFramebuffer(GL_FRAMEBUFFER, base_framebuffer); + +} + RasterizerGLES2::~RasterizerGLES2() { memdelete_arr(skinned_buffer); diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h index d337ecfb64..f759e84b53 100644 --- a/drivers/gles2/rasterizer_gles2.h +++ b/drivers/gles2/rasterizer_gles2.h @@ -1695,6 +1695,8 @@ public: void reload_vram(); virtual bool has_feature(VS::Features p_feature) const; + + virtual void restore_framebuffer(); static RasterizerGLES2* get_singleton(); diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index 3309fd0820..4d5d1b81e3 100755 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -345,6 +345,8 @@ static void clear_touches() { [self destroyFramebuffer]; [self createFramebuffer]; [self drawView]; + [self drawView]; + } - (BOOL)createFramebuffer diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 0b115a4d1d..15c757665b 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -1022,6 +1022,7 @@ public: virtual bool has_feature(VS::Features p_feature) const=0; + virtual void restore_framebuffer()=0; virtual int get_render_info(VS::RenderInfo p_info)=0; diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 8b47596d7e..155d10d85a 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -7427,6 +7427,8 @@ void VisualServerRaster::set_boot_image(const Image& p_image, const Color& p_col if (p_image.empty()) return; + rasterizer->restore_framebuffer(); + rasterizer->begin_frame(); int window_w = OS::get_singleton()->get_video_mode(0).width; -- cgit v1.2.3