[Bf-blender-cvs] [2fd4fc1] temp_viewport_fx_merge: Hello non crashy world! Still not 100% correct but at least now it fires up.

Antony Riakiotakis noreply at git.blender.org
Tue Apr 14 20:03:52 CEST 2015


Commit: 2fd4fc1f2d8a3589f0fb80befaeaaa61992d4223
Author: Antony Riakiotakis
Date:   Tue Apr 14 20:03:23 2015 +0200
Branches: temp_viewport_fx_merge
https://developer.blender.org/rB2fd4fc1f2d8a3589f0fb80befaeaaa61992d4223

Hello non crashy world! Still not 100% correct but at least now it fires
up.

Issue was getting matrices from GL instead of own matrix stack

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

M	source/blender/blenfont/intern/blf.c
M	source/blender/editors/animation/anim_draw.c
M	source/blender/editors/animation/anim_markers.c
M	source/blender/editors/animation/keyframes_draw.c
M	source/blender/editors/armature/editarmature_sketch.c
M	source/blender/editors/gpencil/drawgpencil.c
M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/interface/interface.c
M	source/blender/editors/interface/interface_draw.c
M	source/blender/editors/interface/interface_widgets.c
M	source/blender/editors/interface/view2d.c
M	source/blender/editors/mask/mask_draw.c
M	source/blender/editors/mesh/editmesh_knife.c
M	source/blender/editors/mesh/editmesh_loopcut.c
M	source/blender/editors/physics/particle_edit.c
M	source/blender/editors/render/render_opengl.c
M	source/blender/editors/screen/area.c
M	source/blender/editors/screen/glutil.c
M	source/blender/editors/screen/screendump.c
M	source/blender/editors/sculpt_paint/paint_cursor.c
M	source/blender/editors/sculpt_paint/paint_utils.c
M	source/blender/editors/sculpt_paint/sculpt_uv.c
M	source/blender/editors/space_clip/clip_dopesheet_draw.c
M	source/blender/editors/space_clip/clip_draw.c
M	source/blender/editors/space_clip/clip_graph_draw.c
M	source/blender/editors/space_clip/clip_utils.c
M	source/blender/editors/space_clip/space_clip.c
M	source/blender/editors/space_graph/graph_draw.c
M	source/blender/editors/space_image/image_draw.c
M	source/blender/editors/space_node/drawnode.c
M	source/blender/editors/space_sequencer/sequencer_draw.c
M	source/blender/editors/space_time/space_time.c
M	source/blender/editors/space_view3d/drawanimviz.c
M	source/blender/editors/space_view3d/drawarmature.c
M	source/blender/editors/space_view3d/drawmesh.c
M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/editors/space_view3d/drawsimdebug.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/editors/space_view3d/view3d_select.c
M	source/blender/editors/space_view3d/view3d_view.c
M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform_constraints.c
M	source/blender/editors/transform/transform_generics.c
M	source/blender/editors/transform/transform_manipulator.c
M	source/blender/editors/uvedit/uvedit_draw.c
M	source/blender/gpu/GPU_matrix.h
M	source/blender/gpu/intern/gpu_draw.c
M	source/blender/gpu/intern/gpu_extensions.c
M	source/blender/gpu/intern/gpu_lighting.c
M	source/blender/gpu/intern/gpu_matrix.c
M	source/blender/windowmanager/intern/wm_gesture.c
M	source/blender/windowmanager/intern/wm_operators.c
M	source/blender/windowmanager/intern/wm_playanim.c
M	source/blender/windowmanager/intern/wm_subwindow.c
M	source/gameengine/Ketsji/BL_Texture.cpp
M	source/gameengine/Ketsji/KX_BlenderMaterial.cpp
M	source/gameengine/Ketsji/KX_Dome.cpp
M	source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
M	source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp

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

diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index 93995eb..f298076 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -504,21 +504,21 @@ static void blf_draw__start(FontBLF *font, GLint *param)
 	glEnable(GL_TEXTURE_2D);
 	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 
-	gpuPushMatrix(GPU_TEXTURE);
-	gpuLoadIdentity(GPU_TEXTURE);
+	gpuPushMatrix(GPU_TEXTURE_MATRIX);
+	gpuLoadIdentity(GPU_TEXTURE_MATRIX);
 
-	gpuPushMatrix(GPU_MODELVIEW);
+	gpuPushMatrix(GPU_MODELVIEW_MATRIX);
 
 	if (font->flags & BLF_MATRIX)
-		gpuMultMatrixd(GPU_MODELVIEW, font->m);
+		gpuMultMatrixd(GPU_MODELVIEW_MATRIX, font->m);
 
-	gpuTranslate(GPU_MODELVIEW, font->pos[0], font->pos[1], font->pos[2]);
+	gpuTranslate(GPU_MODELVIEW_MATRIX, font->pos[0], font->pos[1], font->pos[2]);
 
 	if (font->flags & BLF_ASPECT)
-		gpuScale(GPU_MODELVIEW, font->aspect[0], font->aspect[1], font->aspect[2]);
+		gpuScale(GPU_MODELVIEW_MATRIX, font->aspect[0], font->aspect[1], font->aspect[2]);
 
 	if (font->flags & BLF_ROTATION)  /* radians -> degrees */
-		gpuRotateAxis(GPU_MODELVIEW, font->angle * (float)(180.0 / M_PI), 'Z');
+		gpuRotateAxis(GPU_MODELVIEW_MATRIX, font->angle * (float)(180.0 / M_PI), 'Z');
 
 	if (font->shadow || font->blur)
 		glGetFloatv(GL_CURRENT_COLOR, font->orig_col);
@@ -540,8 +540,8 @@ static void blf_draw__end(GLint param)
 	if (param != GL_MODULATE)
 		glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, param);
 
-	gpuPopMatrix(GPU_TEXTURE);
-	gpuPopMatrix(GPU_MODELVIEW);
+	gpuPopMatrix(GPU_TEXTURE_MATRIX);
+	gpuPopMatrix(GPU_MODELVIEW_MATRIX);
 
 	glDisable(GL_BLEND);
 	glDisable(GL_TEXTURE_2D);
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index 5ae164a..4e629e6 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -70,7 +70,7 @@ static void draw_cfra_number(Scene *scene, View2D *v2d, const float cfra, const
 	
 	/* because the frame number text is subject to the same scaling as the contents of the view */
 	UI_view2d_scale_get(v2d, &xscale, &yscale);
-	gpuScale(GPU_MODELVIEW, 1.0f / xscale, 1.0f, 1.0f);
+	gpuScale(GPU_MODELVIEW_MATRIX, 1.0f / xscale, 1.0f, 1.0f);
 	
 	/* get timecode string 
 	 *	- padding on str-buf passed so that it doesn't sit on the frame indicator
@@ -99,7 +99,7 @@ static void draw_cfra_number(Scene *scene, View2D *v2d, const float cfra, const
 	UI_fontstyle_draw_simple(fstyle, x - 0.25f * U.widget_unit, y + 0.15f * U.widget_unit, numstr);
 	
 	/* restore view transform */
-	gpuScale(GPU_MODELVIEW, xscale, 1.0, 1.0);
+	gpuScale(GPU_MODELVIEW_MATRIX, xscale, 1.0, 1.0);
 }
 
 /* General call for drawing current frame indicator in animation editor */
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index caaa5d1..a7c28a5 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -456,7 +456,7 @@ void ED_markers_draw(const bContext *C, int flag)
 	/* no time correction for framelen! space is drawn with old values */
 	ypixels = BLI_rcti_size_y(&v2d->mask);
 	UI_view2d_scale_get(v2d, &xscale, &yscale);
-	gpuScale(GPU_MODELVIEW, 1.0f / xscale, 1.0f, 1.0f);
+	gpuScale(GPU_MODELVIEW_MATRIX, 1.0f / xscale, 1.0f, 1.0f);
 
 	/* x-bounds with offset for text (adjust for long string, avoid checking string width) */
 	font_width_max = (10 * UI_DPI_FAC) / xscale;
@@ -479,7 +479,7 @@ void ED_markers_draw(const bContext *C, int flag)
 		}
 	}
 
-	gpuScale(GPU_MODELVIEW, xscale, 1.0f, 1.0f);
+	gpuScale(GPU_MODELVIEW_MATRIX, xscale, 1.0f, 1.0f);
 }
 
 /* ************************ Marker Wrappers API ********************* */
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index 5180788..da1e671 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -492,8 +492,8 @@ void draw_keyframe_shape(float x, float y, float xscale, float hsize, short sel,
 	hsize -= 0.5f * key_type;
 	
 	/* adjust view transform before starting */
-	gpuTranslate(GPU_MODELVIEW, x, y, 0.0f);
-	gpuScale(GPU_MODELVIEW, 1.0f / xscale * hsize, hsize, 1.0f);
+	gpuTranslate(GPU_MODELVIEW_MATRIX, x, y, 0.0f);
+	gpuScale(GPU_MODELVIEW_MATRIX, 1.0f / xscale * hsize, hsize, 1.0f);
 	
 	/* anti-aliased lines for more consistent appearance */
 	glEnable(GL_LINE_SMOOTH);
@@ -557,8 +557,8 @@ void draw_keyframe_shape(float x, float y, float xscale, float hsize, short sel,
 	glDisable(GL_LINE_SMOOTH);
 	
 	/* restore view transform */
-	gpuScale(GPU_MODELVIEW, xscale / hsize, 1.0f / hsize, 1.0f);
-	gpuTranslate(GPU_MODELVIEW, -x, -y, 0.0f);
+	gpuScale(GPU_MODELVIEW_MATRIX, xscale / hsize, 1.0f / hsize, 1.0f);
+	gpuTranslate(GPU_MODELVIEW_MATRIX, -x, -y, 0.0f);
 }
 
 static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, float ypos, short channelLocked)
diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c
index 3634210..2701e57 100644
--- a/source/blender/editors/armature/editarmature_sketch.c
+++ b/source/blender/editors/armature/editarmature_sketch.c
@@ -438,7 +438,7 @@ static float sk_clampPointSize(SK_Point *pt, float size)
 
 static void sk_drawPoint(struct GPUprim3 *prim, SK_Point *pt, float size)
 {
-	gpuTranslate(GPU_MODELVIEW, pt->p[0], pt->p[1], pt->p[2]);
+	gpuTranslate(GPU_MODELVIEW_MATRIX, pt->p[0], pt->p[1], pt->p[2]);
 	gpuDrawSphere(prim, sk_clampPointSize(pt, size));
 	//GLU gluSphere(quad, sk_clampPointSize(pt, size), 8, 8);
 }
@@ -458,7 +458,7 @@ static void sk_drawEdge(struct GPUprim3 *prim, SK_Point *pt0, SK_Point *pt1, flo
 
 	angle = angle_normalized_v3v3(vec2, vec1);
 
-	gpuRotateVector(GPU_MODELVIEW, angle * (float)(180.0 / M_PI) + 180.0f, axis);
+	gpuRotateVector(GPU_MODELVIEW_MATRIX, angle * (float)(180.0 / M_PI) + 180.0f, axis);
 
 	gpuDrawCylinder(prim, sk_clampPointSize(pt1, size), sk_clampPointSize(pt0, size), length);
 	//GLU Cylinder(quad, sk_clampPointSize(pt1, size), sk_clampPointSize(pt0, size), length, 8, 8);
@@ -469,7 +469,7 @@ static void sk_drawNormal(struct GPUprim3 *prim, SK_Point *pt, float size, float
 	float vec2[3] = {0, 0, 1}, axis[3];
 	float angle;
 	
-	gpuPushMatrix(GPU_MODELVIEW);
+	gpuPushMatrix(GPU_MODELVIEW_MATRIX);
 
 	cross_v3_v3v3(axis, vec2, pt->no);
 
@@ -479,14 +479,14 @@ static void sk_drawNormal(struct GPUprim3 *prim, SK_Point *pt, float size, float
 
 	angle = angle_normalized_v3v3(vec2, pt->no);
 
-	gpuRotateVector(GPU_MODELVIEW, angle * (float)(180.0 / M_PI), axis);
+	gpuRotateVector(GPU_MODELVIEW_MATRIX, angle * (float)(180.0 / M_PI), axis);
 
 	glColor3f(0, 1, 1);
 
 	gpuDrawCylinder(prim, sk_clampPointSize(pt, size), 0, sk_clampPointSize(pt, height));
 	//GLU Cylinder(quad, sk_clampPointSize(pt, size), 0, sk_clampPointSize(pt, height), 10, 2);
 
-	gpuPopMatrix(GPU_MODELVIEW);
+	gpuPopMatrix(GPU_MODELVIEW_MATRIX);
 }
 
 static void sk_drawStroke(SK_Stroke *stk, int id, float color[3], int start, int end)
@@ -499,7 +499,7 @@ static void sk_drawStroke(SK_Stroke *stk, int id, float color[3], int start, int
 		GPU_select_load_id(id);
 
 		for (i = 0; i < stk->nb_points; i++) {
-			gpuPushMatrix(GPU_MODELVIEW);
+			gpuPushMatrix(GPU_MODELVIEW_MATRIX);
 
 			sk_drawPoint(&prim, stk->points + i, 0.1);
 
@@ -507,7 +507,7 @@ static void sk_drawStroke(SK_Stroke *stk, int id, float color[3], int start, int
 				sk_drawEdge(&prim, stk->points + i - 1, stk->points + i, 0.1);
 			}
 
-			gpuPopMatrix(GPU_MODELVIEW);
+			gpuPopMatrix(GPU_MODELVIEW_MATRIX);
 		}
 
 	}
@@ -521,7 +521,7 @@ static void sk_drawStroke(SK_Stroke *stk, int id, float color[3], int start, int
 		for (i = 0; i < stk->nb_points; i++) {
 			SK_Point *pt = stk->points + i;
 
-			gpuPushMatrix(GPU_MODELVIEW);
+			gpuPushMatrix(GPU_MODELVIEW_MATRIX);
 
 			if (pt->type == PT_EXACT) {
 				glColor3f(0, 0, 0);
@@ -545,7 +545,7 @@ static void sk_drawStroke(SK_Stroke *stk, int id, float color[3], int start, int
 				sk_drawEdge(&prim, pt - 1, pt, 0.1);
 			}
 
-			gpuPopMatrix(GPU_MODELVIEW);
+			gpuPopMatrix(GPU_MODELVIEW_MATRIX);
 
 			add_v3_v3(rgb, d_rgb);
 		}
@@ -569,14 +569,14 @@ static void drawSubdividedStrokeBy(ToolSettings *toolsettings, BArcIterator *ite
 	while (index != -1) {
 		SK_Point *pt = stk->points + index;
 
-		gpuPushMatrix(GPU_MODELVIEW);
+		gpuPushMatrix(GPU_MODELVIEW_MATRIX);
 
 		glColor3f(0, 1, 0);
 		sk_drawPoint(&prim, pt, 0.15);
 
 		sk_drawNormal(&prim, pt, 0.05, 0.9);
 
-		gpuPopMatrix(GPU_MODELVIEW);
+		gpuPopMatrix(GPU_MODELVIEW_MATRIX);
 
 		copy_v3_v3(head, tail);
 		bone_start = index; // start next bone from current index
@@ -2060,7 +2060,7 @@ static void sk_drawSketch(Scene *scene, View3D *UNUSED(v3d), SK_Sketch *sketch,
 			if (last != NULL) {
 				struct GPUprim3 prim = GPU_PRIM_LOFI_SOLID;
 
-				gpuPushMatrix(GPU_MODELVIEW);
+				gpuPushMatrix(GPU_MODELVIEW_MATRIX);
 
 				glEnable(GL_BLEND);
 				glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -2082,7 +2082,7 @@ static void sk_drawSketch(Scene *scene, View3D *UNUSED(v3d), SK_Sketch *sketch,
 
 				glDisable(GL_BLEND);
 
-				gpuPopMatrix(GPU_MODELVIEW);
+				gpuPopMatrix(GPU_MODELVIEW_MATRIX);
 			}
 		}
 	}
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 6d54f94..cf4b776 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -203,10 +203,10 @@ static void gp_draw_stroke_volumetric_buffer(tGPspoint *points, int totpoints, s
 		return;
 	
 	/* get basic matrix - should be camera space (i.e "identity") */
-	gpuGetMatrix(GPU_MODELVIEW, modelview[0]);
+	gpuGetMatrix(GPU_MODELVIEW_MATRIX, modelview[0]);
 	
 	/* draw points */
-	gpuPushMatrix(GPU_MODELVIEW);
+	gpuPushMatrix(GPU_MODELVIEW_MATRIX);
 	
 	for (i = 0, pt = points; i < totpoints; i++, pt++) {
 		/* set the transformed position */
@@ -214,7 +214,7 @@ static void gp_draw_stroke_volumetric_buffer(tGPspoint *points, int totpoints, s
 		modelview[3][0] = pt->x;
 		modelview[3][1

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list