Skip to content

Commit

Permalink
_-_
Browse files Browse the repository at this point in the history
  • Loading branch information
TobyAdd committed Dec 5, 2024
1 parent 2273221 commit 1106022
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ void glViewportHook(GLint a, GLint b, GLsizei c, GLsizei d) {
#endif

void RenderTexture::begin() {
#ifdef GEODE_IS_WINDOWS
glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &oldFBO);

texture = new cocos2d::CCTexture2D;
Expand All @@ -64,10 +65,12 @@ void RenderTexture::begin() {
texture->autorelease();

glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, oldRBO);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, oldFBO);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, oldFBO);
#endif
}

void RenderTexture::capture_frame(std::mutex& lock, std::vector<uint8_t>& data, volatile bool& frame_has_data) {
#ifdef GEODE_IS_WINDOWS
auto& recorder = Recorder::get();
glViewport(0, 0, width, height);

Expand All @@ -89,6 +92,7 @@ void RenderTexture::capture_frame(std::mutex& lock, std::vector<uint8_t>& data,

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, oldFBO);
director->setViewport();
#endif
}

void RenderTexture::end() {
Expand Down

0 comments on commit 1106022

Please sign in to comment.