Fix the last commit. Remove compile error and increased buffer size to

to account for the increased size of vertexData.
This commit is contained in:
Hifi Test Account 2013-08-07 12:30:45 -07:00
parent edf4579d0e
commit 5f90e1a4e9
2 changed files with 3 additions and 2 deletions

View file

@ -265,6 +265,7 @@ bool Face::render(float alpha) {
zScale = xScale * 0.3f;
glPushMatrix();
glColor4f(1.0f, 1.0f, 1.0f, alpha);
glScalef(xScale / 12, xScale / (aspect * 3), zScale / 2);
Application::getInstance()->getGeometryCache()->renderHalfCylinder(25, 20);
glPopMatrix();

View file

@ -192,7 +192,7 @@ void GeometryCache::renderHalfCylinder(int slices, int stacks) {
glGenBuffers(1, &vbo.first);
glBindBuffer(GL_ARRAY_BUFFER, vbo.first);
const int BYTES_PER_VERTEX = 3 * sizeof(GLfloat);
glBufferData(GL_ARRAY_BUFFER, vertices * BYTES_PER_VERTEX, vertexData, GL_STATIC_DRAW);
glBufferData(GL_ARRAY_BUFFER, 2 * vertices * BYTES_PER_VERTEX, vertexData, GL_STATIC_DRAW);
delete[] vertexData;
GLushort* indexData = new GLushort[indices];
@ -227,7 +227,7 @@ void GeometryCache::renderHalfCylinder(int slices, int stacks) {
glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(GL_FLOAT, 6 * sizeof(float), 0);
glVertexPointer(3, GL_FLOAT, 6 * sizeof(float), 3 * sizeof(float));
glVertexPointer(3, GL_FLOAT, (6 * sizeof(float)), (const void *)(3 * sizeof(float)));
glDrawRangeElementsEXT(GL_TRIANGLES, 0, vertices - 1, indices, GL_UNSIGNED_SHORT, 0);