[colobot] 104/390: Improved VBO support detection
Didier Raboud
odyx at moszumanska.debian.org
Fri Jun 12 14:21:34 UTC 2015
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch upstream/latest
in repository colobot.
commit d3a722a0c56119f13d5ff3e68e9f4560c7924788
Author: Tomasz Kapuściński <tomaszkax86 at gmail.com>
Date: Wed Oct 22 00:53:35 2014 +0200
Improved VBO support detection
---
src/graphics/opengl/gldevice.cpp | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp
index 69d295d..0ae6f88 100644
--- a/src/graphics/opengl/gldevice.cpp
+++ b/src/graphics/opengl/gldevice.cpp
@@ -217,12 +217,25 @@ bool CGLDevice::Create()
else
{
GetLogger()->Info("Auto-detecting VBO support\n");
- m_vboAvailable = glewIsSupported("GL_ARB_vertex_buffer_object");
+
+ // extracting OpenGL version
+ const char *version = reinterpret_cast<const char*>(glGetString(GL_VERSION));
+ int major = 0, minor = 0;
- if (m_vboAvailable)
- GetLogger()->Info("Detected ARB_vertex_buffer_object extension - using VBOs\n");
+ sscanf(version, "%d.%d", &major, &minor);
+
+ // VBO is core OpenGL feature since 1.5
+ // everything below 1.5 means no VBO support
+ if(major > 1 || minor > 4)
+ {
+ GetLogger()->Info("OpenGL %d.%d, VBO supported\n", major, minor);
+ m_vboAvailable = true;
+ }
else
- GetLogger()->Info("No ARB_vertex_buffer_object extension present - using display lists\n");
+ {
+ GetLogger()->Info("OpenGL %d.%d, VBO not supported\n", major, minor);
+ m_vboAvailable = false;
+ }
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git
More information about the Pkg-games-commits
mailing list