[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49883] branches/soc-2012-swiss_cheese/ source: Fix for lights.

Alexander Kuznetsov kuzsasha at gmail.com
Tue Aug 14 02:09:32 CEST 2012


Revision: 49883
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49883
Author:   alexk
Date:     2012-08-14 00:09:29 +0000 (Tue, 14 Aug 2012)
Log Message:
-----------
Fix for lights. The graphic type was initilized after lights init.
(Didn't test GE, but should work)

Modified Paths:
--------------
    branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_extensions.h
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_extensions.c
    branches/soc-2012-swiss_cheese/source/blender/windowmanager/intern/wm_init_exit.c
    branches/soc-2012-swiss_cheese/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp

Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_extensions.h
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_extensions.h	2012-08-13 22:59:54 UTC (rev 49882)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_extensions.h	2012-08-14 00:09:29 UTC (rev 49883)
@@ -85,6 +85,7 @@
 /* GPU extensions support */
 
 void GPU_extensions_disable(void);
+void GPU_init_graphics_type(void);
 void GPU_extensions_init(void); /* call this before running any of the functions below */
 void GPU_extensions_exit(void);
 int GPU_print_error(const char *str);

Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_extensions.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_extensions.c	2012-08-13 22:59:54 UTC (rev 49882)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_extensions.c	2012-08-14 00:09:29 UTC (rev 49883)
@@ -113,6 +113,13 @@
 	GG.extdisabled = 1;
 }
 
+void GPU_init_graphics_type(void)
+{
+#ifndef GLES
+	GPU_gl_type |= GPU_GLTYPE_FIXED;
+#endif
+}
+
 void GPU_extensions_init(void)
 {
 	GLint r, g, b;
@@ -142,7 +149,6 @@
 	if (!GLEW_ARB_fragment_shader) GG.glslsupport = 0;
 	if (GLEW_VERSION_2_0) GG.glslsupport = 1;
 	if (GLEW_EXT_framebuffer_object || GLEW_VERSION_3_0) GPU_ext_config |= GPU_EXT_FRAMEBUFFERS;
-	GPU_gl_type |= GPU_GLTYPE_FIXED;
 #else 
 	GPU_ext_config |= GPU_EXT_FRAMEBUFFERS;
 #endif

Modified: branches/soc-2012-swiss_cheese/source/blender/windowmanager/intern/wm_init_exit.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/windowmanager/intern/wm_init_exit.c	2012-08-13 22:59:54 UTC (rev 49882)
+++ branches/soc-2012-swiss_cheese/source/blender/windowmanager/intern/wm_init_exit.c	2012-08-14 00:09:29 UTC (rev 49883)
@@ -135,6 +135,7 @@
 		wm_init_cursor_data();
 
 		/* begin - init opengl compatibility layer */
+		GPU_init_graphics_type();
 		GPU_ms_init();
 		GPU_init_object_func();
 
@@ -161,7 +162,7 @@
 	
 	ED_file_init();         /* for fsmenu */
 	ED_init_node_butfuncs();	
-	
+
 	BLF_init(11, U.dpi); /* Please update source/gamengine/GamePlayer/GPG_ghost.cpp if you change this */
 	BLF_lang_init();
 	/* get the default database, plus a wm */

Modified: branches/soc-2012-swiss_cheese/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
===================================================================
--- branches/soc-2012-swiss_cheese/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp	2012-08-13 22:59:54 UTC (rev 49882)
+++ branches/soc-2012-swiss_cheese/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp	2012-08-14 00:09:29 UTC (rev 49883)
@@ -88,6 +88,7 @@
 #endif // __cplusplus
 
 #include "GPU_compatibility.h"
+#include "GPU_extensions.h"
 #include "GPU_draw.h"
 
 /**********************************
@@ -760,6 +761,8 @@
 
 		GPU_set_anisotropic(U.anisotropic_filter);
 
+		GPU_init_graphics_type();
+
 		GPUimmediate *immediate = gpuNewImmediate();
 		gpuImmediateMakeCurrent(immediate);
 		gpuImmediateMaxVertexCount(500000); // XXX: temporary!




More information about the Bf-blender-cvs mailing list