mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 08:45:16 +02:00
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:
parent
edf4579d0e
commit
5f90e1a4e9
2 changed files with 3 additions and 2 deletions
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue