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

@@ -128,7 +128,7 @@ public:
/** The OpenGL video driver for windows. */
class VideoDriver_Win32OpenGL : public VideoDriver_Win32Base {
public:
VideoDriver_Win32OpenGL() : dc(nullptr), gl_rc(nullptr) {}
VideoDriver_Win32OpenGL() : dc(nullptr), gl_rc(nullptr), anim_buffer(nullptr) {}
const char *Start(const StringList &param) override;
@@ -144,12 +144,16 @@ public:
void ClearSystemSprites() override;
bool HasAnimBuffer() override { return true; }
uint8 *GetAnimBuffer() override { return this->anim_buffer; }
const char *GetName() const override { return "win32-opengl"; }
protected:
HDC dc; ///< Window device context.
HGLRC gl_rc; ///< OpenGL context.
bool vsync; ///< Enable VSync?
HDC dc; ///< Window device context.
HGLRC gl_rc; ///< OpenGL context.
bool vsync; ///< Enable VSync?
uint8 *anim_buffer; ///< Animation buffer from OpenGL back-end.
uint8 GetFullscreenBpp() override { return 32; } // OpenGL is always 32 bpp.