diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-01-16 16:43:09 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-02-22 22:16:07 +0100 |
commit | 73ed748deb65f14f280b8cefebb0a6beff16a4a5 (patch) | |
tree | 0705eac7965d4dd07ac523fe2e2be8e1b453d07f /src/video/win32_v.h | |
parent | 5ad545dcc16a27cdabd8636f4970ee12b9cec54b (diff) | |
download | openttd-73ed748deb65f14f280b8cefebb0a6beff16a4a5.tar.xz |
Codechange: [Win32] Move the global video buffer pointer into the driver class.
Diffstat (limited to 'src/video/win32_v.h')
-rw-r--r-- | src/video/win32_v.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/video/win32_v.h b/src/video/win32_v.h index dd68f968f..6b62ea0ee 100644 --- a/src/video/win32_v.h +++ b/src/video/win32_v.h @@ -55,6 +55,8 @@ protected: virtual uint8 GetFullscreenBpp(); /** (Re-)create the backing store. */ virtual bool AllocateBackingStore(int w, int h, bool force = false) = 0; + /** Get a pointer to the video buffer. */ + virtual void *GetVideoPointer() = 0; /** Palette of the window has changed. */ virtual void PaletteChanged(HWND hWnd) = 0; @@ -68,7 +70,7 @@ private: /** The GDI video driver for windows. */ class VideoDriver_Win32GDI : public VideoDriver_Win32Base { public: - VideoDriver_Win32GDI() : dib_sect(nullptr), gdi_palette(nullptr) {} + VideoDriver_Win32GDI() : dib_sect(nullptr), gdi_palette(nullptr), buffer_bits(nullptr) {} const char *Start(const StringList ¶m) override; @@ -81,8 +83,10 @@ public: protected: HBITMAP dib_sect; ///< System bitmap object referencing our rendering buffer. HPALETTE gdi_palette; ///< Palette object for 8bpp blitter. + void *buffer_bits; ///< Internal rendering buffer. void Paint() override; + void *GetVideoPointer() override { return this->buffer_bits; } void PaintThread() override; bool AllocateBackingStore(int w, int h, bool force = false) override; @@ -130,6 +134,7 @@ protected: void PaintThread() override {} bool AllocateBackingStore(int w, int h, bool force = false) override; + void *GetVideoPointer() override; void PaletteChanged(HWND hWnd) override {} const char *AllocateContext(); |