[Bf-blender-cvs] [23e51f4734] blender2.8: OpenGL immediate mode: sequencer_draw.c (finished)

Luca Rood noreply at git.blender.org
Fri Feb 17 03:09:14 CET 2017


Commit: 23e51f47342b24275c2bcbaf866de62f5ed087d5
Author: Luca Rood
Date:   Thu Feb 16 22:18:42 2017 -0200
Branches: blender2.8
https://developer.blender.org/rB23e51f47342b24275c2bcbaf866de62f5ed087d5

OpenGL immediate mode: sequencer_draw.c (finished)

Converted the remaining diagonal stripes thingies...

Part of T49043

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

M	source/blender/editors/space_sequencer/sequencer_draw.c

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

diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 130fe12f67..cd2bdbd289 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -773,32 +773,39 @@ static void draw_seq_strip(const bContext *C, SpaceSeq *sseq, Scene *scene, AReg
 
 	/* draw lock */
 	if (seq->flag & SEQ_LOCK) {
-		GPU_basic_shader_bind(GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR);
 		glEnable(GL_BLEND);
 
-		/* light stripes */
-		glColor4ub(255, 255, 255, 32);
-		GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_DIAG_STRIPES);
-		glRectf(x1, y1, x2, y2);
+		pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
+		immBindBuiltinProgram(GPU_SHADER_2D_DIAG_STRIPES);
 
-		/* dark stripes */
-		glColor4ub(0, 0, 0, 32);
-		GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_DIAG_STRIPES_SWAP);
-		glRectf(x1, y1, x2, y2);
+		immUniform4f("color1", 1.0f, 1.0f, 1.0f, 0.125f);
+		immUniform4f("color2", 0.0f, 0.0f, 0.0f, 0.125f);
+		immUniform1i("size1", 8);
+		immUniform1i("size2", 8);
+
+		immRectf(pos, x1, y1, x2, y2);
+
+		immUnbindProgram();
 
-		GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
 		glDisable(GL_BLEND);
 	}
 
 	if (!BKE_sequence_is_valid_check(seq)) {
-		GPU_basic_shader_bind(GPU_SHADER_STIPPLE | GPU_SHADER_USE_COLOR);
+		glEnable(GL_BLEND);
+
+		pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
+		immBindBuiltinProgram(GPU_SHADER_2D_DIAG_STRIPES);
 
-		/* panic! */
-		glColor4ub(255, 0, 0, 255);
-		GPU_basic_shader_stipple(GPU_SHADER_STIPPLE_DIAG_STRIPES);
-		glRectf(x1, y1, x2, y2);
+		immUniform4f("color1", 1.0f, 0.0f, 0.0f, 1.0f);
+		immUniform4f("color2", 0.0f, 0.0f, 0.0f, 0.0f);
+		immUniform1i("size1", 8);
+		immUniform1i("size2", 8);
 
-		GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
+		immRectf(pos, x1, y1, x2, y2);
+
+		immUnbindProgram();
+
+		glDisable(GL_BLEND);
 	}
 
 	color3ubv_from_seq(scene, seq, col);




More information about the Bf-blender-cvs mailing list