An update will be applied December 9th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit f1535309 authored by Ken Martin's avatar Ken Martin
Browse files

More cleanups

vtkgl::CellBO renamed vtkOpenGLHelper
vtkgl::substitute moved to vtkShaderProgram::Substitute
Creation of vtkOpenGLIndexBufferObject
Creation of vtkOpenGLVertexBufferObject
Move methods that were in vtkglVBOHelper into new classes
Move IndexCount from CellBO to vtkOpenGLIndexBufferObject
etc
parent 37f39403
......@@ -13,14 +13,15 @@
=========================================================================*/
#include "vtkOpenGLSphereMapper.h"
#include "vtkglVBOHelper.h"
#include "vtkOpenGLHelper.h"
#include "vtkMath.h"
#include "vtkMatrix4x4.h"
#include "vtkOpenGLActor.h"
#include "vtkOpenGLCamera.h"
#include "vtkOpenGLBufferObject.h"
#include "vtkOpenGLIndexBufferObject.h"
#include "vtkOpenGLVertexArrayObject.h"
#include "vtkOpenGLVertexBufferObject.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
#include "vtkPolyData.h"
......@@ -32,7 +33,7 @@
#include "vtk_glew.h"
using vtkgl::substitute;
//-----------------------------------------------------------------------------
vtkStandardNewMacro(vtkOpenGLSphereMapper)
......@@ -63,12 +64,12 @@ void vtkOpenGLSphereMapper::ReplaceShaderValues(std::string &VSSource,
vtkRenderer* ren,
vtkActor *actor)
{
substitute(VSSource,
vtkShaderProgram::Substitute(VSSource,
"//VTK::Camera::Dec",
"uniform mat4 VCDCMatrix;\n"
"uniform mat4 MCVCMatrix;");
substitute(FSSource,
vtkShaderProgram::Substitute(FSSource,
"//VTK::PositionVC::Dec",
"varying vec4 vertexVCClose;");
......@@ -80,9 +81,9 @@ void vtkOpenGLSphereMapper::ReplaceShaderValues(std::string &VSSource,
"varying float radiusVC;\n"
"varying vec3 centerVC;\n"
"uniform mat4 VCDCMatrix;\n";
substitute(FSSource,"//VTK::Normal::Dec",replacement);
vtkShaderProgram::Substitute(FSSource,"//VTK::Normal::Dec",replacement);
substitute(FSSource,"//VTK::Normal::Impl",
vtkShaderProgram::Substitute(FSSource,"//VTK::Normal::Impl",
// compute the eye position and unit direction
"vec4 vertexVC = vertexVCClose;\n"
" vec3 EyePos;\n"
......@@ -128,7 +129,7 @@ void vtkOpenGLSphereMapper::ReplaceShaderValues(std::string &VSSource,
if (ren->GetLastRenderingUsedDepthPeeling())
{
substitute(FSSource,
vtkShaderProgram::Substitute(FSSource,
"//VTK::DepthPeeling::Impl",
"float odepth = texture2D(opaqueZTexture, gl_FragCoord.xy/screenSize).r;\n"
" if (gl_FragDepth >= odepth) { discard; }\n"
......@@ -150,7 +151,7 @@ vtkOpenGLSphereMapper::~vtkOpenGLSphereMapper()
//-----------------------------------------------------------------------------
void vtkOpenGLSphereMapper::SetCameraShaderParameters(
vtkgl::CellBO &cellBO,
vtkOpenGLHelper &cellBO,
vtkRenderer* ren, vtkActor *actor)
{
vtkShaderProgram *program = cellBO.Program;
......@@ -182,17 +183,16 @@ void vtkOpenGLSphereMapper::SetCameraShaderParameters(
//-----------------------------------------------------------------------------
void vtkOpenGLSphereMapper::SetMapperShaderParameters(
vtkgl::CellBO &cellBO,
vtkOpenGLHelper &cellBO,
vtkRenderer *ren, vtkActor *actor)
{
if (cellBO.IndexCount && (this->VBOBuildTime > cellBO.AttributeUpdateTime ||
if (cellBO.IBO->IndexCount && (this->VBOBuildTime > cellBO.AttributeUpdateTime ||
cellBO.ShaderSourceTime > cellBO.AttributeUpdateTime))
{
vtkgl::VBOLayout &layout = this->Layout;
cellBO.VAO->Bind();
if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
"offsetMC", layout.ColorOffset+sizeof(float),
layout.Stride, VTK_FLOAT, 2, false))
"offsetMC", this->VBO->ColorOffset+sizeof(float),
this->VBO->Stride, VTK_FLOAT, 2, false))
{
vtkErrorMacro(<< "Error setting 'offsetMC' in shader VAO.");
}
......@@ -212,30 +212,28 @@ void vtkOpenGLSphereMapper::PrintSelf(ostream& os, vtkIndent indent)
namespace
{
// internal function called by CreateVBO
vtkgl::VBOLayout vtkOpenGLSphereMapperCreateVBO(float * points, vtkIdType numPts,
void vtkOpenGLSphereMapperCreateVBO(float * points, vtkIdType numPts,
unsigned char *colors, int colorComponents,
float *sizes,
vtkOpenGLBufferObject *vertexBuffer)
vtkOpenGLVertexBufferObject *VBO)
{
vtkgl::VBOLayout layout;
// Figure out how big each block will be, currently 6 or 7 floats.
int blockSize = 3;
layout.VertexOffset = 0;
layout.NormalOffset = 0;
layout.TCoordOffset = 0;
layout.TCoordComponents = 0;
layout.ColorComponents = colorComponents;
layout.ColorOffset = sizeof(float) * blockSize;
VBO->VertexOffset = 0;
VBO->NormalOffset = 0;
VBO->TCoordOffset = 0;
VBO->TCoordComponents = 0;
VBO->ColorComponents = colorComponents;
VBO->ColorOffset = sizeof(float) * blockSize;
++blockSize;
// two more floats
blockSize += 2;
layout.Stride = sizeof(float) * blockSize;
VBO->Stride = sizeof(float) * blockSize;
// Create a buffer, and copy the data over.
std::vector<float> packedVBO;
packedVBO.resize(blockSize * numPts*3);
std::vector<float>::iterator it = packedVBO.begin();
VBO->PackedVBO.resize(blockSize * numPts*3);
std::vector<float>::iterator it = VBO->PackedVBO.begin();
float *pointPtr;
unsigned char *colorPtr;
......@@ -270,9 +268,9 @@ vtkgl::VBOLayout vtkOpenGLSphereMapperCreateVBO(float * points, vtkIdType numPts
*(it++) = 0.0f;
*(it++) = 2.0f*radius;
}
vertexBuffer->Upload(packedVBO, vtkOpenGLBufferObject::ArrayBuffer);
layout.VertexCount = numPts*3;
return layout;
VBO->Upload(VBO->PackedVBO, vtkOpenGLBufferObject::ArrayBuffer);
VBO->VertexCount = numPts*3;
return;
}
}
......@@ -313,19 +311,19 @@ void vtkOpenGLSphereMapper::BuildBufferObjects(
// Iterate through all of the different types in the polydata, building OpenGLs
// and IBOs as appropriate for each type.
this->Layout =
vtkOpenGLSphereMapperCreateVBO(static_cast<float *>(poly->GetPoints()->GetVoidPointer(0)),
poly->GetPoints()->GetNumberOfPoints(),
this->Colors ? (unsigned char *)this->Colors->GetVoidPointer(0) : NULL,
this->Colors ? this->Colors->GetNumberOfComponents() : 0,
static_cast<float *>(poly->GetPointData()->GetArray(this->ScaleArray)->GetVoidPointer(0)),
this->VBO);
vtkOpenGLSphereMapperCreateVBO(
static_cast<float *>(poly->GetPoints()->GetVoidPointer(0)),
poly->GetPoints()->GetNumberOfPoints(),
this->Colors ? (unsigned char *)this->Colors->GetVoidPointer(0) : NULL,
this->Colors ? this->Colors->GetNumberOfComponents() : 0,
static_cast<float *>(poly->GetPointData()->GetArray(this->ScaleArray)->GetVoidPointer(0)),
this->VBO);
// create the IBO
this->Points.IndexCount = 0;
this->Lines.IndexCount = 0;
this->TriStrips.IndexCount = 0;
this->Tris.IndexCount = this->Layout.VertexCount;
this->Points.IBO->IndexCount = 0;
this->Lines.IBO->IndexCount = 0;
this->TriStrips.IBO->IndexCount = 0;
this->Tris.IBO->IndexCount = this->VBO->VertexCount;
}
......@@ -348,14 +346,12 @@ void vtkOpenGLSphereMapper::Render(vtkRenderer *ren, vtkActor *act)
//-----------------------------------------------------------------------------
void vtkOpenGLSphereMapper::RenderPieceDraw(vtkRenderer* ren, vtkActor *actor)
{
vtkgl::VBOLayout &layout = this->Layout;
// draw polygons
if (this->Tris.IndexCount)
if (this->Tris.IBO->IndexCount)
{
// First we do the triangles, update the shader, set uniforms, etc.
this->UpdateShader(this->Tris, ren, actor);
glDrawArrays(GL_TRIANGLES, 0,
static_cast<GLuint>(layout.VertexCount));
static_cast<GLuint>(this->VBO->VertexCount));
}
}
......@@ -59,11 +59,11 @@ protected:
// Description:
// Set the shader parameters related to the Camera
virtual void SetCameraShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
virtual void SetCameraShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
// Description:
// Set the shader parameters related to the actor/mapper
virtual void SetMapperShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
const char *ScaleArray;
......
......@@ -13,14 +13,15 @@
=========================================================================*/
#include "vtkOpenGLStickMapper.h"
#include "vtkglVBOHelper.h"
#include "vtkOpenGLHelper.h"
#include "vtkMatrix3x3.h"
#include "vtkMatrix4x4.h"
#include "vtkOpenGLActor.h"
#include "vtkOpenGLCamera.h"
#include "vtkOpenGLBufferObject.h"
#include "vtkOpenGLIndexBufferObject.h"
#include "vtkOpenGLVertexArrayObject.h"
#include "vtkOpenGLVertexBufferObject.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
#include "vtkPolyData.h"
......@@ -33,7 +34,7 @@
#include "vtk_glew.h"
using vtkgl::substitute;
//-----------------------------------------------------------------------------
vtkStandardNewMacro(vtkOpenGLStickMapper)
......@@ -64,12 +65,12 @@ void vtkOpenGLStickMapper::ReplaceShaderValues(std::string &VSSource,
vtkRenderer* ren,
vtkActor *actor)
{
substitute(VSSource,
vtkShaderProgram::Substitute(VSSource,
"//VTK::Camera::Dec",
"uniform mat4 VCDCMatrix;\n"
"uniform mat4 MCVCMatrix;");
substitute(FSSource,
vtkShaderProgram::Substitute(FSSource,
"//VTK::PositionVC::Dec",
"varying vec4 vertexVCClose;");
......@@ -82,11 +83,11 @@ void vtkOpenGLStickMapper::ReplaceShaderValues(std::string &VSSource,
"varying float lengthVC;\n"
"varying vec3 centerVC;\n"
"uniform mat4 VCDCMatrix;\n";
substitute(FSSource,"//VTK::Normal::Dec",replacement);
vtkShaderProgram::Substitute(FSSource,"//VTK::Normal::Dec",replacement);
// see https://www.cl.cam.ac.uk/teaching/1999/AGraphHCI/SMAG/node2.html
substitute(FSSource,"//VTK::Normal::Impl",
vtkShaderProgram::Substitute(FSSource,"//VTK::Normal::Impl",
// compute the eye position and unit direction
" vec4 vertexVC = vertexVCClose;\n"
" vec3 EyePos;\n"
......@@ -163,18 +164,18 @@ void vtkOpenGLStickMapper::ReplaceShaderValues(std::string &VSSource,
bool picking = (ren->GetRenderWindow()->GetIsPicking() || selector != NULL);
if (picking)
{
substitute(VSSource,
vtkShaderProgram::Substitute(VSSource,
"//VTK::Picking::Dec",
"attribute vec4 selectionId;\n"
"varying vec4 selectionIdFrag;");
substitute(VSSource,
vtkShaderProgram::Substitute(VSSource,
"//VTK::Picking::Impl",
"selectionIdFrag = selectionId;");
substitute(FSSource,
vtkShaderProgram::Substitute(FSSource,
"//VTK::Picking::Dec",
"uniform vec3 mapperIndex;\n"
"varying vec4 selectionIdFrag;");
substitute(FSSource,
vtkShaderProgram::Substitute(FSSource,
"//VTK::Picking::Impl",
"if (mapperIndex == vec3(0.0,0.0,0.0))\n"
" {\n"
......@@ -189,7 +190,7 @@ void vtkOpenGLStickMapper::ReplaceShaderValues(std::string &VSSource,
if (ren->GetLastRenderingUsedDepthPeeling())
{
substitute(FSSource,
vtkShaderProgram::Substitute(FSSource,
"//VTK::DepthPeeling::Impl",
"float odepth = texture2D(opaqueZTexture, gl_FragCoord.xy/screenSize).r;\n"
" if (gl_FragDepth >= odepth) { discard; }\n"
......@@ -213,7 +214,7 @@ vtkOpenGLStickMapper::~vtkOpenGLStickMapper()
//-----------------------------------------------------------------------------
void vtkOpenGLStickMapper::SetCameraShaderParameters(vtkgl::CellBO &cellBO,
void vtkOpenGLStickMapper::SetCameraShaderParameters(vtkOpenGLHelper &cellBO,
vtkRenderer* ren, vtkActor *actor)
{
vtkShaderProgram *program = cellBO.Program;
......@@ -248,41 +249,40 @@ void vtkOpenGLStickMapper::SetCameraShaderParameters(vtkgl::CellBO &cellBO,
//-----------------------------------------------------------------------------
void vtkOpenGLStickMapper::SetMapperShaderParameters(
vtkgl::CellBO &cellBO,
vtkOpenGLHelper &cellBO,
vtkRenderer *ren,
vtkActor *actor)
{
if (cellBO.IndexCount && (this->VBOBuildTime > cellBO.AttributeUpdateTime ||
if (cellBO.IBO->IndexCount && (this->VBOBuildTime > cellBO.AttributeUpdateTime ||
cellBO.ShaderSourceTime > cellBO.AttributeUpdateTime))
{
vtkHardwareSelector* selector = ren->GetSelector();
bool picking = (ren->GetRenderWindow()->GetIsPicking() || selector != NULL);
vtkgl::VBOLayout &layout = this->Layout;
cellBO.VAO->Bind();
if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
"orientMC", layout.ColorOffset+sizeof(float),
layout.Stride, VTK_FLOAT, 3, false))
"orientMC", this->VBO->ColorOffset+sizeof(float),
this->VBO->Stride, VTK_FLOAT, 3, false))
{
vtkErrorMacro(<< "Error setting 'orientMC' in shader VAO.");
}
if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
"offsetMC", layout.ColorOffset+4*sizeof(float),
layout.Stride, VTK_UNSIGNED_CHAR, 3, false))
"offsetMC", this->VBO->ColorOffset+4*sizeof(float),
this->VBO->Stride, VTK_UNSIGNED_CHAR, 3, false))
{
vtkErrorMacro(<< "Error setting 'offsetMC' in shader VAO.");
}
if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
"radiusMC", layout.ColorOffset+5*sizeof(float),
layout.Stride, VTK_FLOAT, 1, false))
"radiusMC", this->VBO->ColorOffset+5*sizeof(float),
this->VBO->Stride, VTK_FLOAT, 1, false))
{
vtkErrorMacro(<< "Error setting 'radiusMC' in shader VAO.");
}
if (picking)
{
if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
"selectionId", layout.ColorOffset+6*sizeof(float),
layout.Stride, VTK_UNSIGNED_CHAR, 4, true))
"selectionId", this->VBO->ColorOffset+6*sizeof(float),
this->VBO->Stride, VTK_UNSIGNED_CHAR, 4, true))
{
vtkErrorMacro(<< "Error setting 'selectionId' in shader VAO.");
}
......@@ -306,22 +306,21 @@ void vtkOpenGLStickMapper::PrintSelf(ostream& os, vtkIndent indent)
namespace
{
// internal function called by CreateVBO
vtkgl::VBOLayout vtkOpenGLStickMapperCreateVBO(float * points, vtkIdType numPts,
void vtkOpenGLStickMapperCreateVBO(float * points, vtkIdType numPts,
unsigned char *colors, int colorComponents,
float *orients,
float *sizes,
vtkIdType *selectionIds,
vtkOpenGLBufferObject *vertexBuffer)
vtkOpenGLVertexBufferObject *VBO)
{
vtkgl::VBOLayout layout;
// Figure out how big each block will be, currently 6 or 7 floats.
int blockSize = 3;
layout.VertexOffset = 0;
layout.NormalOffset = 0;
layout.TCoordOffset = 0;
layout.TCoordComponents = 0;
layout.ColorComponents = colorComponents;
layout.ColorOffset = sizeof(float) * blockSize;
VBO->VertexOffset = 0;
VBO->NormalOffset = 0;
VBO->TCoordOffset = 0;
VBO->TCoordComponents = 0;
VBO->ColorComponents = colorComponents;
VBO->ColorOffset = sizeof(float) * blockSize;
++blockSize;
// three more floats for orient + 2 for offset + 1 for radius
......@@ -330,12 +329,11 @@ vtkgl::VBOLayout vtkOpenGLStickMapperCreateVBO(float * points, vtkIdType numPts,
{
blockSize++;
}
layout.Stride = sizeof(float) * blockSize;
VBO->Stride = sizeof(float) * blockSize;
// Create a buffer, and copy the data over.
std::vector<float> packedVBO;
packedVBO.resize(blockSize * numPts * 6);
std::vector<float>::iterator it = packedVBO.begin();
VBO->PackedVBO.resize(blockSize * numPts * 6);
std::vector<float>::iterator it = VBO->PackedVBO.begin();
float *pointPtr;
float *orientPtr;
......@@ -468,9 +466,9 @@ vtkgl::VBOLayout vtkOpenGLStickMapperCreateVBO(float * points, vtkIdType numPts,
*(it++) = selId.f;
}
}
vertexBuffer->Upload(packedVBO, vtkOpenGLBufferObject::ArrayBuffer);
layout.VertexCount = numPts*6;
return layout;
VBO->Upload(VBO->PackedVBO, vtkOpenGLBufferObject::ArrayBuffer);
VBO->VertexCount = numPts*6;
return;
}
}
......@@ -543,23 +541,23 @@ void vtkOpenGLStickMapper::BuildBufferObjects(vtkRenderer *ren,
// Iterate through all of the different types in the polydata, building OpenGLs
// and IBOs as appropriate for each type.
this->Layout =
vtkOpenGLStickMapperCreateVBO(static_cast<float *>(poly->GetPoints()->GetVoidPointer(0)),
poly->GetPoints()->GetNumberOfPoints(),
this->Colors ? (unsigned char *)this->Colors->GetVoidPointer(0) : NULL,
this->Colors ? this->Colors->GetNumberOfComponents() : 0,
static_cast<float *>(poly->GetPointData()->GetArray(this->OrientationArray)->GetVoidPointer(0)),
static_cast<float *>(poly->GetPointData()->GetArray(this->ScaleArray)->GetVoidPointer(0)),
picking ?
static_cast<vtkIdType *>(poly->GetPointData()->GetArray(this->SelectionIdArray)->GetVoidPointer(0))
: NULL,
this->VBO);
vtkOpenGLStickMapperCreateVBO(
static_cast<float *>(poly->GetPoints()->GetVoidPointer(0)),
poly->GetPoints()->GetNumberOfPoints(),
this->Colors ? (unsigned char *)this->Colors->GetVoidPointer(0) : NULL,
this->Colors ? this->Colors->GetNumberOfComponents() : 0,
static_cast<float *>(poly->GetPointData()->GetArray(this->OrientationArray)->GetVoidPointer(0)),
static_cast<float *>(poly->GetPointData()->GetArray(this->ScaleArray)->GetVoidPointer(0)),
picking ?
static_cast<vtkIdType *>(poly->GetPointData()->GetArray(this->SelectionIdArray)->GetVoidPointer(0))
: NULL,
this->VBO);
// create the IBO
this->Points.IndexCount = 0;
this->Lines.IndexCount = 0;
this->TriStrips.IndexCount = 0;
this->Tris.IndexCount =
this->Points.IBO->IndexCount = 0;
this->Lines.IBO->IndexCount = 0;
this->TriStrips.IBO->IndexCount = 0;
this->Tris.IBO->IndexCount =
vtkOpenGLStickMapperCreateTriangleIndexBuffer(this->Tris.IBO,
poly->GetPoints()->GetNumberOfPoints());
}
......@@ -567,17 +565,15 @@ void vtkOpenGLStickMapper::BuildBufferObjects(vtkRenderer *ren,
//-----------------------------------------------------------------------------
void vtkOpenGLStickMapper::RenderPieceDraw(vtkRenderer* ren, vtkActor *actor)
{
vtkgl::VBOLayout &layout = this->Layout;
// draw polygons
if (this->Tris.IndexCount)
if (this->Tris.IBO->IndexCount)
{
// First we do the triangles, update the shader, set uniforms, etc.
this->UpdateShader(this->Tris, ren, actor);
this->Tris.IBO->Bind();
glDrawRangeElements(GL_TRIANGLES, 0,
static_cast<GLuint>(layout.VertexCount - 1),
static_cast<GLsizei>(this->Tris.IndexCount),
static_cast<GLuint>(this->VBO->VertexCount - 1),
static_cast<GLsizei>(this->Tris.IBO->IndexCount),
GL_UNSIGNED_INT,
reinterpret_cast<const GLvoid *>(NULL));
this->Tris.IBO->Release();
......
......@@ -63,11 +63,11 @@ protected:
// Description:
// Set the shader parameters related to the Camera
virtual void SetCameraShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
virtual void SetCameraShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
// Description:
// Set the shader parameters related to the actor/mapper
virtual void SetMapperShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
const char *ScaleArray;
const char *OrientationArray;
......
......@@ -23,8 +23,8 @@
#include "vtkMathTextUtilities.h"
#include "vtkMatrix3x3.h"
#include "vtkObjectFactory.h"
#include "vtkOpenGLBufferObject.h"
#include "vtkOpenGLError.h"
#include "vtkOpenGLIndexBufferObject.h"
#include "vtkOpenGLRenderWindow.h"
#include "vtkOpenGLRenderer.h"
#include "vtkOpenGLShaderCache.h"
......@@ -43,7 +43,7 @@
#include "vtkVector.h"
#include "vtkViewport.h"
#include "vtkWindow.h"
#include "vtkglVBOHelper.h"
#include "vtkOpenGLHelper.h"
#include "vtkObjectFactory.h"
......@@ -68,11 +68,11 @@ vtkOpenGLContextDevice2D::vtkOpenGLContextDevice2D()
this->MaximumMarkerCacheSize = 20;
this->ProjectionMatrix = vtkTransform::New();
this->ModelMatrix = vtkTransform::New();
this->VBO = new vtkgl::CellBO;
this->VCBO = new vtkgl::CellBO;
this->VTBO = new vtkgl::CellBO;
this->SBO = new vtkgl::CellBO;
this->SCBO = new vtkgl::CellBO;
this->VBO = new vtkOpenGLHelper;
this->VCBO = new vtkOpenGLHelper;
this->VTBO = new vtkOpenGLHelper;
this->SBO = new vtkOpenGLHelper;
this->SCBO = new vtkOpenGLHelper;
}
//-----------------------------------------------------------------------------
......@@ -293,7 +293,7 @@ void vtkOpenGLContextDevice2D::SetMatrices(vtkShaderProgram *prog)
}
void vtkOpenGLContextDevice2D::BuildVBO(
vtkgl::CellBO *cellBO,
vtkOpenGLHelper *cellBO,
float *f, int nv,
unsigned char *colors, int nc,
float *tcoords)
......@@ -557,7 +557,7 @@ void vtkOpenGLContextDevice2D::DrawPoly(float *f, int n, unsigned char *colors,
vtkOpenGLClearErrorMacro();
this->SetLineType(this->Pen->GetLineType());
vtkgl::CellBO *cbo = 0;
vtkOpenGLHelper *cbo = 0;
if (colors)
{
this->ReadyVCBOProgram();
......@@ -651,7 +651,7 @@ void vtkOpenGLContextDevice2D::DrawLines(float *f, int n, unsigned char *colors,
this->SetLineType(this->Pen->GetLineType());
vtkgl::CellBO *cbo = 0;
vtkOpenGLHelper *cbo = 0;
if (colors)
{
this->ReadyVCBOProgram();
......@@ -735,7 +735,7 @@ void vtkOpenGLContextDevice2D::DrawPoints(float *f, int n, unsigned char *c,
{
vtkOpenGLClearErrorMacro();
vtkgl::CellBO *cbo = 0;
vtkOpenGLHelper *cbo = 0;
if (c)
{
this->ReadyVCBOProgram();
......@@ -773,7 +773,7 @@ void vtkOpenGLContextDevice2D::DrawPointSprites(vtkImageData *sprite,
{
this->SetPointSize(this->Pen->GetWidth());
vtkgl::CellBO *cbo = 0;
vtkOpenGLHelper *cbo = 0;
if (colors)
{
this->ReadySCBOProgram();
......@@ -878,7 +878,7 @@ void vtkOpenGLContextDevice2D::CoreDrawTriangles(
vtkOpenGLClearErrorMacro();
float* texCoord = 0;
vtkgl::CellBO *cbo = 0;
vtkOpenGLHelper *cbo = 0;
if (this->Brush->GetTexture())
{
this->ReadyVTBOProgram();
......@@ -1290,7 +1290,7 @@ void vtkOpenGLContextDevice2D::DrawString(float *point,
vtkOpenGLClearErrorMacro();
vtkgl::CellBO *cbo = 0;
vtkOpenGLHelper *cbo = 0;
this->ReadyVTBOProgram();
cbo = this->VTBO;
int tunit = vtkOpenGLTexture::SafeDownCast(texture)->GetTextureUnit();
......@@ -1402,7 +1402,7 @@ void vtkOpenGLContextDevice2D::DrawMathTextString(float point[2],
vtkOpenGLClearErrorMacro();
vtkgl::CellBO *cbo = 0;
vtkOpenGLHelper *cbo = 0;
this->ReadyVTBOProgram();
cbo = this->VTBO;