From af0e588a94db0a6c112c90a465c386688770be92 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Fri, 20 Apr 2018 18:04:06 +0200 Subject: [PATCH] try to fix iOS black frames recording --- engine/app.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/app.cpp b/engine/app.cpp index a999e57..881f9c3 100644 --- a/engine/app.cpp +++ b/engine/app.cpp @@ -354,7 +354,11 @@ void App::update(float dt) rec_timer = 0.f; auto data = new uint8_t[width * height * 4]; - glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); + #if __IOS__ + [ios_view->glview bindDrawable]; + #else + glBindFramebuffer(GL_FRAMEBUFFER, 0); + #endif glReadBuffer(GL_BACK); glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data); {