[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11842] branches/soc-2007-maike/source/ blender/src: Changed glsl init to screenmain()

Miguel Torres Lima torreslima at gmail.com
Mon Aug 27 18:16:08 CEST 2007


Revision: 11842
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11842
Author:   maike
Date:     2007-08-27 18:16:08 +0200 (Mon, 27 Aug 2007)

Log Message:
-----------
Changed glsl init to screenmain()

Modified Paths:
--------------
    branches/soc-2007-maike/source/blender/src/editscreen.c
    branches/soc-2007-maike/source/blender/src/glutil.c
    branches/soc-2007-maike/source/blender/src/usiblender.c

Modified: branches/soc-2007-maike/source/blender/src/editscreen.c
===================================================================
--- branches/soc-2007-maike/source/blender/src/editscreen.c	2007-08-27 16:09:02 UTC (rev 11841)
+++ branches/soc-2007-maike/source/blender/src/editscreen.c	2007-08-27 16:16:08 UTC (rev 11842)
@@ -1274,7 +1274,7 @@
 	int onload_script = 0;
 
 	window_make_active(mainwin);
-	
+
 	while (1) {
 		unsigned short event;
 		short val, towin;
@@ -1509,6 +1509,7 @@
 		}
 		/* Bizar hack. The event queue has mutated... */
 		if ( (firsttime) && (event == 0) ) {
+		        init_glsl();
 
 			if (onload_script) {
 				/* OnLoad scriptlink */

Modified: branches/soc-2007-maike/source/blender/src/glutil.c
===================================================================
--- branches/soc-2007-maike/source/blender/src/glutil.c	2007-08-27 16:09:02 UTC (rev 11841)
+++ branches/soc-2007-maike/source/blender/src/glutil.c	2007-08-27 16:16:08 UTC (rev 11842)
@@ -59,6 +59,7 @@
 #include "BIF_glsl_light.h"
 #include "BIF_glsl_material.h"
 #include "BIF_glsl_materialtree.h"
+#include "BIF_glsl_colorband.h"
 
 
 	/* Invert line handling */
@@ -757,6 +758,10 @@
 	   "   temp registers:         %d\n"
 	   "   attributes:             %d\n",         
 	   iparams2[0], iparams2[1], iparams2[2], iparams2[3], iparams2[4], iparams2[5], iparams2[6]);
+
+    glsl_init_cb_globals();
+    glsl_change_state();
+    allqueue(REDRAWVIEW3D, 1);
   }
   else{
     printf("\nGLSL Not Supported\n");
@@ -785,7 +790,7 @@
 
 int glsl_active(void)
 {
-  if(glsl_state & GLSL_ACTIVE && glsl_state & GLSL_FIRSTDRAW){
+  if(glsl_state & GLSL_ACTIVE){
     return 1;
   }
 
@@ -817,9 +822,6 @@
       glsl_state |= GLSL_ACTIVE;
       drawtype = G.vd->drawtype;
 
-      if(!(glsl_state & GLSL_FIRSTDRAW))
-	glsl_state |= GLSL_FIRSTDRAW;
-
       glsl_create_all();
 
       printf("\nGLSL activated.\n");
@@ -831,6 +833,9 @@
       glsl_free_all();
       printf("\nGLSL deactivated.\n");
     }
+    else if(drawtype == -1){
+      drawtype = G.vd->drawtype;
+    }
   }
   else{
     if(G.vd && G.vd->drawtype == OB_GLSL){

Modified: branches/soc-2007-maike/source/blender/src/usiblender.c
===================================================================
--- branches/soc-2007-maike/source/blender/src/usiblender.c	2007-08-27 16:09:02 UTC (rev 11841)
+++ branches/soc-2007-maike/source/blender/src/usiblender.c	2007-08-27 16:16:08 UTC (rev 11842)
@@ -888,9 +888,6 @@
 	  fprintf(stderr, "\n Glew init error: %s\n", glewGetErrorString(err));
 	  exit(0);
 	}
- 
-	/* GLSL INIT */
-	init_glsl();
 
 	initbuttons();
 	InitCursorData();





More information about the Bf-blender-cvs mailing list