summaryrefslogtreecommitdiff
path: root/src/video/opengl.h
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-01-16 16:43:16 +0100
committerMichael Lutz <michi@icosahedron.de>2021-02-22 22:16:07 +0100
commita990c497b5dfbb51f8196a874eb4cb29b4933328 (patch)
treebd30a881f5ac0315c5bcfebd0c935bbbd338d24f /src/video/opengl.h
parent5af0cfd902e71d1d3ed5d20649b44f5c0125b4cd (diff)
downloadopenttd-a990c497b5dfbb51f8196a874eb4cb29b4933328.tar.xz
Codechange: [OpenGL] Use a pixel buffer object to store the video buffer.
Diffstat (limited to 'src/video/opengl.h')
-rw-r--r--src/video/opengl.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/video/opengl.h b/src/video/opengl.h
index dfc71b5f7..16d72ff87 100644
--- a/src/video/opengl.h
+++ b/src/video/opengl.h
@@ -25,7 +25,7 @@ class OpenGLBackend : public ZeroedMemoryAllocator {
private:
static OpenGLBackend *instance; ///< Singleton instance pointer.
- void *vid_buffer; ///< Pointer to the memory used for the video driver to draw to.
+ GLuint vid_pbo; ///< Pixel buffer object storing the memory used for the video driver to draw to.
GLuint vid_texture; ///< Texture handle for the video buffer texture.
GLuint vao_quad; ///< Vertex array object storing the rendering state for the fullscreen quad.
GLuint vbo_quad; ///< Vertex buffer with a fullscreen quad.
@@ -45,13 +45,10 @@ public:
static void Destroy();
bool Resize(int w, int h, bool force = false);
- void Paint(Rect update_rect);
+ void Paint();
- /**
- * Get a pointer to the memory for the video driver to draw to.
- * @return Pointer to draw on.
- */
- void *GetVideoBuffer() { return this->vid_buffer; }
+ void *GetVideoBuffer();
+ void ReleaseVideoBuffer(const Rect &update_rect);
};
#endif /* VIDEO_OPENGL_H */