[Bf-blender-cvs] [022d91b] GPU_data_request: Flag for new viewport

Antony Riakiotakis noreply at git.blender.org
Mon Feb 23 11:00:22 CET 2015


Commit: 022d91bcf6e39191fb9763f90caa1801ae64adf1
Author: Antony Riakiotakis
Date:   Mon Feb 23 10:29:37 2015 +0100
Branches: GPU_data_request
https://developer.blender.org/rB022d91bcf6e39191fb9763f90caa1801ae64adf1

Flag for new viewport

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

M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_userdef.c

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

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index d8f7c4f..d2ef175 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -448,6 +448,7 @@ class USERPREF_PT_system(Panel):
         col.label(text="Anisotropic Filtering")
         col.prop(system, "anisotropic_filter", text="")
         col.prop(system, "use_vertex_buffer_objects")
+        col.prop(system, "use_viewport_new")
 
         col.separator()
 
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 00a67dc..bab6947 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -3715,8 +3715,11 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
 
 	/* draw viewport using opengl */
 	if (v3d->drawtype != OB_RENDER || !view3d_main_area_do_render_draw(scene) || clip_border) {
-		view3d_main_area_draw_objects(C, scene, v3d, ar, &grid_unit);
-		
+		if (U.gameflags & USER_VIEWPORT_2)
+			;
+		else {
+			view3d_main_area_draw_objects(C, scene, v3d, ar, &grid_unit);
+		}
 #ifdef DEBUG_DRAW
 		bl_debug_draw();
 #endif
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 3ac923a..07b163f 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -735,6 +735,7 @@ typedef enum eOpenGL_RenderingOptions {
 	USER_DISABLE_MIPMAP		= (1 << 2),
 	USER_DISABLE_VBO		= (1 << 3),
 	/* USER_DISABLE_AA			= (1 << 4), */ /* DEPRECATED */
+	USER_VIEWPORT_2			= (1 << 5),
 } eOpenGL_RenderingOptions;
 
 /* selection method for opengl gpu_select_method */
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 15ecf70..79446d5 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -4016,6 +4016,13 @@ static void rna_def_userdef_system(BlenderRNA *brna)
 	/* this isn't essential but nice to check if VBO draws any differently */
 	RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_vbo_update");
 
+	prop = RNA_def_property(srna, "use_viewport_new", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "gameflags", USER_VIEWPORT_2);
+	RNA_def_property_ui_text(prop, "Viewport 2",
+	                         "Use new viewport code in viewport");
+	/* this isn't essential but nice to check if VBO draws any differently */
+	RNA_def_property_update(prop, NC_WINDOW, "rna_userdef_vbo_update");
+
 	prop = RNA_def_property(srna, "anisotropic_filter", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "anisotropic_filter");
 	RNA_def_property_enum_items(prop, anisotropic_items);




More information about the Bf-blender-cvs mailing list