Add: [OpenGL] Support for a separate animation buffer that stores the palette values of the screen in addition to the colour buffer.

This commit is contained in:
Michael Lutz
2021-01-16 16:43:42 +01:00
parent 01ef44fa4f
commit 200be7d20c
6 changed files with 122 additions and 6 deletions

View File

@@ -1545,14 +1545,19 @@ bool VideoDriver_Win32OpenGL::AllocateBackingStore(int w, int h, bool force)
void *VideoDriver_Win32OpenGL::GetVideoPointer()
{
if (BlitterFactory::GetCurrentBlitter()->NeedsAnimationBuffer()) {
this->anim_buffer = OpenGLBackend::Get()->GetAnimBuffer();
}
return OpenGLBackend::Get()->GetVideoBuffer();
}
void VideoDriver_Win32OpenGL::ReleaseVideoPointer()
{
if (this->anim_buffer != nullptr) OpenGLBackend::Get()->ReleaseAnimBuffer(this->dirty_rect);
OpenGLBackend::Get()->ReleaseVideoBuffer(this->dirty_rect);
this->dirty_rect = {};
_screen.dst_ptr = nullptr;
this->anim_buffer = nullptr;
}
void VideoDriver_Win32OpenGL::Paint()