]> OCCT Git - occt.git/commitdiff
0023883: Bound color in the primitive array do not work when displayed using VBO
authorkgv <kgv@opencascade.com>
Fri, 12 Apr 2013 12:36:20 +0000 (16:36 +0400)
committerkgv <kgv@opencascade.com>
Fri, 12 Apr 2013 12:36:20 +0000 (16:36 +0400)
Added test case bugs vis bug23883

src/OpenGl/OpenGl_PrimitiveArray.cxx
tests/bugs/vis/bug23883 [new file with mode: 0644]

index e1c2162efba86bcc59ba3f280e77b65d3630f81c..8e71c6a3a9efea5cd3f3003ad6b206c015560fef 100755 (executable)
@@ -271,6 +271,7 @@ void OpenGl_PrimitiveArray::DrawArray (Tint theLightingModel,
           Tint* anOffset = NULL;
           for (i = 0; i < myPArray->num_bounds; ++i)
           {
+            if (pfc != NULL) glColor3fv (pfc[i].rgb);
             glDrawElements (myDrawMode, myPArray->bounds[i], myVbos[VBOEdges]->GetDataType(), anOffset);
             anOffset += myPArray->bounds[i];
           }
@@ -286,6 +287,7 @@ void OpenGl_PrimitiveArray::DrawArray (Tint theLightingModel,
       {
         for (i = n = 0; i < myPArray->num_bounds; ++i)
         {
+          if (pfc != NULL) glColor3fv (pfc[i].rgb);
           glDrawArrays (myDrawMode, n, myPArray->bounds[i]);
           n += myPArray->bounds[i];
         }
@@ -329,10 +331,7 @@ void OpenGl_PrimitiveArray::DrawArray (Tint theLightingModel,
         {
           for (i = n = 0; i < myPArray->num_bounds; ++i)
           {
-            if (pfc != NULL)
-            {
-              glColor3fv (pfc[i].rgb);
-            }
+            if (pfc != NULL) glColor3fv (pfc[i].rgb);
             glDrawArrays (myDrawMode, n, myPArray->bounds[i]);
             n += myPArray->bounds[i];
           }
diff --git a/tests/bugs/vis/bug23883 b/tests/bugs/vis/bug23883
new file mode 100644 (file)
index 0000000..443edd4
--- /dev/null
@@ -0,0 +1,23 @@
+puts "=========="
+puts "OCC23883"
+#################################################################################
+puts "Bound color in the primitive array do not work when displayed using VBO"
+#################################################################################
+
+set x_coord 321
+set y_coord 200
+
+vinit
+vvbo 0
+vdrawparray pl01 polylines 0 v 0 0 0 v 0 10 0 v 0 10 10 v 0 0 0 b 4 c 1 0 0
+vfit
+checkcolor $x_coord $y_coord 1 0 0
+
+vclear
+vvbo 1
+vdrawparray pl01 polylines 0 v 0 0 0 v 0 10 0 v 0 10 10 v 0 0 0 b 4 c 1 0 0
+checkcolor $x_coord $y_coord 1 0 0
+
+set only_screen 1
+
+