From 7cc2d520c226f288863dd385b21cc1842ab27040 Mon Sep 17 00:00:00 2001 From: kgv Date: Fri, 12 Apr 2013 16:36:20 +0400 Subject: [PATCH] 0023883: Bound color in the primitive array do not work when displayed using VBO Added test case bugs vis bug23883 --- src/OpenGl/OpenGl_PrimitiveArray.cxx | 7 +++---- tests/bugs/vis/bug23883 | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 tests/bugs/vis/bug23883 diff --git a/src/OpenGl/OpenGl_PrimitiveArray.cxx b/src/OpenGl/OpenGl_PrimitiveArray.cxx index e1c2162efb..8e71c6a3a9 100755 --- a/src/OpenGl/OpenGl_PrimitiveArray.cxx +++ b/src/OpenGl/OpenGl_PrimitiveArray.cxx @@ -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 index 0000000000..443edd4168 --- /dev/null +++ b/tests/bugs/vis/bug23883 @@ -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 + + -- 2.39.5