[Bf-blender-cvs] [964107f] master: BGE code cleanup: Removing RAS_GLExtensionManager.

Mitchell Stokes noreply at git.blender.org
Tue Dec 8 04:32:54 CET 2015


Commit: 964107fbce77fac3badf2de027e6096cc8efe7ca
Author: Mitchell Stokes
Date:   Sun Mar 30 18:35:02 2014 -0700
Branches: master
https://developer.blender.org/rB964107fbce77fac3badf2de027e6096cc8efe7ca

BGE code cleanup: Removing RAS_GLExtensionManager.

This class did nothing but print out extensions if they were found.
Instead, the code from bge.logic.PrintGLInfo() is now printed as the
Rasterizer is initialized. This gives better information, and it removes
some GL code from KX_PythonInit.cpp (the PrintGLInfo method now calls
the Rasterizer to print the information).

Differential Revision: https://developer.blender.org/D438

===================================================================

M	source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
M	source/gameengine/GamePlayer/ghost/GPG_Application.cpp
M	source/gameengine/Ketsji/BL_Shader.cpp
M	source/gameengine/Ketsji/BL_Texture.cpp
M	source/gameengine/Ketsji/KX_BlenderMaterial.cpp
M	source/gameengine/Ketsji/KX_PythonInit.cpp
M	source/gameengine/Rasterizer/RAS_IRasterizer.h
M	source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
D	source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp
D	source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.h
M	source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
M	source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
M	source/gameengine/VideoTexture/blendVideoTex.cpp

===================================================================

diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
index 0d04ab6..c5fc55a 100644
--- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
+++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
@@ -54,7 +54,6 @@
 #include "KX_PyConstraintBinding.h"
 #include "KX_PythonMain.h"
 
-#include "RAS_GLExtensionManager.h"
 #include "RAS_OpenGLRasterizer.h"
 #include "RAS_ListRasterizer.h"
 
@@ -250,8 +249,6 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
 	
 	PyObject *pyGlobalDict = PyDict_New(); /* python utility storage, spans blend file loading */
 #endif
-	
-	bgl::InitExtensions(true);
 
 	// Globals to be carried on over blender files
 	GlobalSettings gs;
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
index 2940e6d..f0a7bd4 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
@@ -78,7 +78,6 @@ extern "C"
 #include "RAS_MeshObject.h"
 #include "RAS_OpenGLRasterizer.h"
 #include "RAS_ListRasterizer.h"
-#include "RAS_GLExtensionManager.h"
 #include "KX_PythonInit.h"
 #include "KX_PyConstraintBinding.h"
 #include "BL_Material.h" // MAXTEX
@@ -563,7 +562,6 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode)
 	if (!m_engineInitialized)
 	{
 		GPU_init();
-		bgl::InitExtensions(true);
 
 		// get and set the preferences
 		SYS_SystemHandle syshandle = SYS_GetSystem();
diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp
index 4b229f5..6613780 100644
--- a/source/gameengine/Ketsji/BL_Shader.cpp
+++ b/source/gameengine/Ketsji/BL_Shader.cpp
@@ -34,7 +34,6 @@
 #include "KX_PyMath.h"
 #include "MEM_guardedalloc.h"
 
-#include "RAS_GLExtensionManager.h"
 #include "RAS_MeshObject.h"
 #include "RAS_IRasterizer.h"
 
diff --git a/source/gameengine/Ketsji/BL_Texture.cpp b/source/gameengine/Ketsji/BL_Texture.cpp
index 8f717c0..17bd8c3 100644
--- a/source/gameengine/Ketsji/BL_Texture.cpp
+++ b/source/gameengine/Ketsji/BL_Texture.cpp
@@ -38,7 +38,6 @@
 #include "BKE_image.h"
 #include "BLI_blenlib.h"
 
-#include "RAS_OpenGLRasterizer/RAS_GLExtensionManager.h"
 #include "RAS_ICanvas.h"
 #include "RAS_Rect.h"
 
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
index d85d33d..a10bdf4 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
@@ -39,7 +39,6 @@
 #include "RAS_BucketManager.h"
 #include "RAS_MeshObject.h"
 #include "RAS_IRasterizer.h"
-#include "RAS_OpenGLRasterizer/RAS_GLExtensionManager.h"
 
 #include "GPU_draw.h"
 
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 26c6fca..d35f09d 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -647,71 +647,10 @@ static PyObject *pyPrintStats(PyObject *,PyObject *,PyObject *)
 
 static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *)
 {
-#define pprint(x) std::cout << x << std::endl;
-	bool count=0;
-	bool support=0;
-	pprint("Supported Extensions...");
-	pprint(" GL_ARB_shader_objects supported?       "<< (GLEW_ARB_shader_objects?"yes.":"no."));
-	count = 1;
-
-	support= GLEW_ARB_vertex_shader;
-	pprint(" GL_ARB_vertex_shader supported?        "<< (support?"yes.":"no."));
-	count = 1;
-	if (support) {
-		pprint(" ----------Details----------");
-		int max=0;
-		glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, (GLint*)&max);
-		pprint("  Max uniform components." << max);
-
-		glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, (GLint*)&max);
-		pprint("  Max varying floats." << max);
-
-		glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, (GLint*)&max);
-		pprint("  Max vertex texture units." << max);
-	
-		glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB, (GLint*)&max);
-		pprint("  Max combined texture units." << max);
-		pprint("");
-	}
-
-	support=GLEW_ARB_fragment_shader;
-	pprint(" GL_ARB_fragment_shader supported?      "<< (support?"yes.":"no."));
-	count = 1;
-	if (support) {
-		pprint(" ----------Details----------");
-		int max=0;
-		glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB, (GLint*)&max);
-		pprint("  Max uniform components." << max);
-		pprint("");
-	}
-
-	support = GLEW_ARB_texture_cube_map;
-	pprint(" GL_ARB_texture_cube_map supported?     "<< (support?"yes.":"no."));
-	count = 1;
-	if (support) {
-		pprint(" ----------Details----------");
-		int size=0;
-		glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB, (GLint*)&size);
-		pprint("  Max cubemap size." << size);
-		pprint("");
-	}
-
-	support = GLEW_ARB_multitexture;
-	count = 1;
-	pprint(" GL_ARB_multitexture supported?         "<< (support?"yes.":"no."));
-	if (support) {
-		pprint(" ----------Details----------");
-		int units=0;
-		glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&units);
-		pprint("  Max texture units available.  " << units);
-		pprint("");
-	}
-
-	pprint(" GL_ARB_texture_env_combine supported?  "<< (GLEW_ARB_texture_env_combine?"yes.":"no."));
-	count = 1;
-
-	if (!count)
-		pprint("No extenstions are used in this build");
+	if (gp_Rasterizer)
+		gp_Rasterizer->PrintHardwareInfo();
+	else
+		printf("Warning: no rasterizer detected for PrintGLInfo!\n");
 
 	Py_RETURN_NONE;
 }
diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h
index 618bcbf..e960131 100644
--- a/source/gameengine/Rasterizer/RAS_IRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h
@@ -479,6 +479,11 @@ public:
 
 	virtual void SetAuxilaryClientInfo(void *inf) = 0;
 
+	/**
+	 * Prints information about what the hardware supports.
+	 */
+	virtual void PrintHardwareInfo() = 0;
+
 #ifdef WITH_CXX_GUARDEDALLOC
 	MEM_CXX_CLASS_ALLOC_FUNCS("GE:RAS_IRasterizer")
 #endif
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
index 168e3fa..9f95e2c 100644
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
+++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
@@ -49,14 +49,12 @@ set(INC_SYS
 )
 
 set(SRC
-	RAS_GLExtensionManager.cpp
 	RAS_ListRasterizer.cpp
 	RAS_OpenGLLight.cpp
 	RAS_OpenGLRasterizer.cpp
 	RAS_StorageVA.cpp
 	RAS_StorageVBO.cpp
 
-	RAS_GLExtensionManager.h
 	RAS_IStorage.h
 	RAS_ListRasterizer.h
 	RAS_OpenGLLight.h
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp
deleted file mode 100644
index bc22d68..0000000
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.cpp
- *  \ingroup bgerastogl
- */
-
-
-#include <iostream>
-
-#include "glew-mx.h"
-
-#include "RAS_GLExtensionManager.h"
-
-namespace bgl
-{
-	void InitExtensions(bool debug)
-	{
-		static bool firsttime = true;
-		
-		if (firsttime) {
-			firsttime = false;
-
-			if (debug) {
-				if (GLEW_ATI_pn_triangles)
-					std::cout << "Enabled GL_ATI_pn_triangles" << std::endl;
-				if (GLEW_ARB_texture_env_combine)
-					std::cout << "Detected GL_ARB_texture_env_combine" << std::endl;
-				if (GLEW_ARB_texture_cube_map)
-					std::cout << "Detected GL_ARB_texture_cube_map" << std::endl;
-				if (GLEW_ARB_multitexture)
-					std::cout << "Detected GL_ARB_multitexture" << std::endl;
-				if (GLEW_ARB_shader_objects)
-					std::cout << "Detected GL_ARB_shader_objects" << std::endl;
-				if (GLEW_ARB_vertex_shader)
-					std::cout << "Detected GL_ARB_vertex_shader" << std::endl;
-				if (GLEW_ARB_fragment_shader)
-					std::cout << "Detected GL_ARB_fragment_shader" << std::endl;
-				if (GLEW_ARB_vertex_program)
-					std::cout << "Detected GL_ARB_vertex_program" << std::endl;
-				if (GLEW_ARB_depth_texture)
-					std::cout << "Detected GL_ARB_depth_texture" << std::endl;
-				if (GLEW_EXT_separate_specular_color)
-					std::cout << "Detected GL_EXT_separate_specular_color" << std::endl;
-			}
-		}
-	}
-} // namespace bgl
-
diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.h
deleted file mode 100644
index 9f2039b..0000000
--- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_GLExtensionManager.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list