Skip to content

Commit

Permalink
fix: vr works again
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoquesada committed Jun 15, 2016
1 parent 5615e27 commit e73aa89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cocos/vr/CCVRDistortionMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ DistortionMesh::DistortionMesh(Distortion *distortion,
_indices = (rows-1)*cols*2+rows-2;
// GLshort indexData[_indices];
std::vector<GLshort> indexData(_indices);
const int indexDataSize = _indices * sizeof(GLshort);

int indexOffset = 0;
vertexOffset = 0;
Expand Down Expand Up @@ -141,7 +142,7 @@ DistortionMesh::DistortionMesh(Distortion *distortion,
glBufferData(GL_ARRAY_BUFFER, sizeof(vertexData), vertexData, GL_STATIC_DRAW);

glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _elementBufferID);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indexData), &indexData[0], GL_STATIC_DRAW);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, indexDataSize, &indexData[0], GL_STATIC_DRAW);

glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
Expand Down

0 comments on commit e73aa89

Please sign in to comment.