[iortcw] 86/89: All: Rend2: Force VAO usage on OpenGL 3.0+

Simon McVittie smcv at debian.org
Fri Sep 8 10:44:35 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to tag 1.51b
in repository iortcw.

commit 24872e3476f91751c4400ecf03cce83fee236725
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Wed Aug 9 12:40:29 2017 -0400

    All: Rend2: Force VAO usage on OpenGL 3.0+
---
 MP/code/rend2/tr_extensions.c | 12 ++++++++++--
 SP/code/rend2/tr_extensions.c | 12 ++++++++++--
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/MP/code/rend2/tr_extensions.c b/MP/code/rend2/tr_extensions.c
index 8447608..e90f518 100644
--- a/MP/code/rend2/tr_extensions.c
+++ b/MP/code/rend2/tr_extensions.c
@@ -112,9 +112,17 @@ void GLimp_InitExtraExtensions()
 	// OpenGL 3.0 - GL_ARB_vertex_array_object
 	extension = "GL_ARB_vertex_array_object";
 	glRefConfig.vertexArrayObject = qfalse;
-	if (SDL_GL_ExtensionSupported(extension))
+	if (q_gl_version_at_least_3_0 || SDL_GL_ExtensionSupported(extension))
 	{
-		glRefConfig.vertexArrayObject = !!r_arb_vertex_array_object->integer;
+		if (q_gl_version_at_least_3_0)
+		{
+			// force VAO, core context requires it
+			glRefConfig.vertexArrayObject = qtrue;
+		}
+		else
+		{
+			glRefConfig.vertexArrayObject = !!r_arb_vertex_array_object->integer;
+		}
 
 		QGL_ARB_vertex_array_object_PROCS;
 
diff --git a/SP/code/rend2/tr_extensions.c b/SP/code/rend2/tr_extensions.c
index 8447608..e90f518 100644
--- a/SP/code/rend2/tr_extensions.c
+++ b/SP/code/rend2/tr_extensions.c
@@ -112,9 +112,17 @@ void GLimp_InitExtraExtensions()
 	// OpenGL 3.0 - GL_ARB_vertex_array_object
 	extension = "GL_ARB_vertex_array_object";
 	glRefConfig.vertexArrayObject = qfalse;
-	if (SDL_GL_ExtensionSupported(extension))
+	if (q_gl_version_at_least_3_0 || SDL_GL_ExtensionSupported(extension))
 	{
-		glRefConfig.vertexArrayObject = !!r_arb_vertex_array_object->integer;
+		if (q_gl_version_at_least_3_0)
+		{
+			// force VAO, core context requires it
+			glRefConfig.vertexArrayObject = qtrue;
+		}
+		else
+		{
+			glRefConfig.vertexArrayObject = !!r_arb_vertex_array_object->integer;
+		}
 
 		QGL_ARB_vertex_array_object_PROCS;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list