Revision: 23210
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23210
Author:   imbusy
Date:     2009-09-14 12:53:39 +0200 (Mon, 14 Sep 2009)

Log Message:
-----------
Added a checkbox in the user preferences for turning off VBO support

Modified Paths:
--------------
    branches/soc-2009-imbusy/release/ui/space_userpref.py
    branches/soc-2009-imbusy/source/blender/gpu/gpu_buffers.h
    branches/soc-2009-imbusy/source/blender/gpu/intern/gpu_buffers.c
    branches/soc-2009-imbusy/source/blender/makesdna/DNA_userdef_types.h
    branches/soc-2009-imbusy/source/blender/makesrna/intern/rna_userdef.c

Modified: branches/soc-2009-imbusy/release/ui/space_userpref.py
===================================================================
--- branches/soc-2009-imbusy/release/ui/space_userpref.py       2009-09-14 
10:37:13 UTC (rev 23209)
+++ branches/soc-2009-imbusy/release/ui/space_userpref.py       2009-09-14 
10:53:39 UTC (rev 23210)
@@ -306,6 +306,7 @@
                sub1.itemL(text="OpenGL:")
                sub1.itemR(system, "clip_alpha", slider=True)
                sub1.itemR(system, "use_mipmaps")
+               sub1.itemR(system, "use_vbos")
                sub1.itemL(text="Window Draw Method:")
                sub1.row().itemR(system, "window_draw_method", expand=True)
                sub1.itemL(text="Textures:")

Modified: branches/soc-2009-imbusy/source/blender/gpu/gpu_buffers.h
===================================================================
--- branches/soc-2009-imbusy/source/blender/gpu/gpu_buffers.h   2009-09-14 
10:37:13 UTC (rev 23209)
+++ branches/soc-2009-imbusy/source/blender/gpu/gpu_buffers.h   2009-09-14 
10:53:39 UTC (rev 23210)
@@ -36,7 +36,8 @@
 #define MAX_FREE_GPU_BUFFERS 8
 
 #ifdef _DEBUG
-#define DEBUG_VBO(X) printf(X)
+/*#define DEBUG_VBO(X) printf(X)*/
+#define DEBUG_VBO(X)
 #else
 #define DEBUG_VBO(X)
 #endif

Modified: branches/soc-2009-imbusy/source/blender/gpu/intern/gpu_buffers.c
===================================================================
--- branches/soc-2009-imbusy/source/blender/gpu/intern/gpu_buffers.c    
2009-09-14 10:37:13 UTC (rev 23209)
+++ branches/soc-2009-imbusy/source/blender/gpu/intern/gpu_buffers.c    
2009-09-14 10:53:39 UTC (rev 23210)
@@ -34,6 +34,8 @@
 
 #include "GL/glew.h"
 
+#include "DNA_userdef_types.h"
+
 #include "gpu_buffers.h"
 #include "MEM_guardedalloc.h"
 #include "BKE_DerivedMesh.h"
@@ -1166,6 +1168,10 @@
 
 int GPU_buffer_legacy( DerivedMesh *dm )
 {
+       int test= (U.gameflags & USER_DISABLE_VBO);
+       if( test )
+               return 1;
+
        if( dm->drawObject == 0 )
                dm->drawObject = GPU_drawobject_new(dm);
        return dm->drawObject->legacy;

Modified: branches/soc-2009-imbusy/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- branches/soc-2009-imbusy/source/blender/makesdna/DNA_userdef_types.h        
2009-09-14 10:37:13 UTC (rev 23209)
+++ branches/soc-2009-imbusy/source/blender/makesdna/DNA_userdef_types.h        
2009-09-14 10:53:39 UTC (rev 23210)
@@ -446,6 +446,7 @@
 #define USER_DEPRECATED_FLAG   1
 #define USER_DISABLE_SOUND             2
 #define USER_DISABLE_MIPMAP            4
+#define USER_DISABLE_VBO               8
 
 /* wm draw method */
 #define USER_DRAW_TRIPLE               0

Modified: branches/soc-2009-imbusy/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- branches/soc-2009-imbusy/source/blender/makesrna/intern/rna_userdef.c       
2009-09-14 10:37:13 UTC (rev 23209)
+++ branches/soc-2009-imbusy/source/blender/makesrna/intern/rna_userdef.c       
2009-09-14 10:53:39 UTC (rev 23210)
@@ -2143,6 +2143,10 @@
        RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", 
USER_DISABLE_MIPMAP);
        RNA_def_property_ui_text(prop, "Mipmaps", "Scale textures for the 3d 
View (looks nicer but uses more memory and slows image reloading.)");
 
+       prop= RNA_def_property(srna, "use_vbos", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", 
USER_DISABLE_VBO);
+       RNA_def_property_ui_text(prop, "VBOs", "Use Vertex Buffer Objects (or 
Vertex Arrays, if unsupported) for viewport rendering.");
+
        prop= RNA_def_property(srna, "gl_texture_limit", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "glreslimit");
        RNA_def_property_enum_items(prop, gl_texture_clamp_items);


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to