Skip to content

Commit

Permalink
Fix: [OpenGL] Main loop expects to start with the video buffer unmapp…
Browse files Browse the repository at this point in the history
…ed. (#9100)
  • Loading branch information
michicc committed Apr 24, 2021
1 parent fbc2325 commit f4d5c8d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/video/opengl.cpp
Expand Up @@ -1154,6 +1154,7 @@ void *OpenGLBackend::GetVideoBuffer()
#endif

if (!this->persistent_mapping_supported) {
assert(this->vid_buffer == nullptr);
_glBindBuffer(GL_PIXEL_UNPACK_BUFFER, this->vid_pbo);
this->vid_buffer = _glMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_READ_WRITE);
} else if (this->vid_buffer == nullptr) {
Expand Down
2 changes: 2 additions & 0 deletions src/video/sdl2_opengl_v.cpp
Expand Up @@ -74,6 +74,8 @@ const char *VideoDriver_SDL_OpenGL::Start(const StringList &param)
this->Stop();
return "Can't get pointer to screen buffer";
}
/* Main loop expects to start with the buffer unmapped. */
this->ReleaseVideoPointer();

return nullptr;
}
Expand Down
2 changes: 2 additions & 0 deletions src/video/win32_v.cpp
Expand Up @@ -1311,6 +1311,8 @@ const char *VideoDriver_Win32OpenGL::Start(const StringList &param)
_cur_resolution = old_res;
return "Can't get pointer to screen buffer";
}
/* Main loop expects to start with the buffer unmapped. */
this->ReleaseVideoPointer();

MarkWholeScreenDirty();

Expand Down

0 comments on commit f4d5c8d

Please sign in to comment.