diff options
author | Tomasz Kapuściński <tomaszkax86@gmail.com> | 2014-10-24 00:29:26 +0200 |
---|---|---|
committer | Tomasz Kapuściński <tomaszkax86@gmail.com> | 2014-10-24 00:29:26 +0200 |
commit | 1aebe8af0314c4da7cd6bd01bae13cc34dde102c (patch) | |
tree | bfa855ab06123a47d3c7ba790d3fda67fad9a73f /src/graphics/opengl/gldevice.h | |
parent | 3c299f66f79dbe6c73116eb750757ee25b95dc5a (diff) | |
download | colobot-1aebe8af0314c4da7cd6bd01bae13cc34dde102c.tar.gz colobot-1aebe8af0314c4da7cd6bd01bae13cc34dde102c.tar.bz2 colobot-1aebe8af0314c4da7cd6bd01bae13cc34dde102c.zip |
Added support for VBO in OpenGL older than 1.5 if ARB extension is present
Diffstat (limited to 'src/graphics/opengl/gldevice.h')
-rw-r--r-- | src/graphics/opengl/gldevice.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/graphics/opengl/gldevice.h b/src/graphics/opengl/gldevice.h index 723b0f2..1174367 100644 --- a/src/graphics/opengl/gldevice.h +++ b/src/graphics/opengl/gldevice.h @@ -48,6 +48,17 @@ enum VBOMode }; /** + \enum VertexBufferType + \brief Specifies type of vertex buffer to use + */ +enum VertexBufferType +{ + VBT_DISPLAY_LIST, //! use display lists + VBT_VBO_CORE, //! use core OpenGL 1.5 VBOs + VBT_VBO_ARB //! use ARB extension VBOs +}; + +/** \struct GLDeviceConfig \brief Additional config with OpenGL-specific settings */ struct GLDeviceConfig : public DeviceConfig @@ -104,6 +115,7 @@ public: void ConfigChanged(const GLDeviceConfig &newConfig); void SetUseVbo(bool useVbo); + void SetVertexBufferType(VertexBufferType type); virtual void BeginScene() override; virtual void EndScene() override; @@ -235,6 +247,8 @@ private: bool m_multitextureAvailable; //! Whether to use VBOs or display lists bool m_vboAvailable; + //! Which vertex buffer type to use + VertexBufferType m_vertexBufferType; //! Map of saved VBO objects std::map<unsigned int, VboObjectInfo> m_vboObjects; //! Last ID of VBO object |