fix primitive draw error

This commit is contained in:
Huabing.Xu 2014-08-29 16:00:04 +08:00
parent 528f4b5c0c
commit 8e51377f2d
1 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ bool Primitive::init(VertexData* verts, IndexBuffer* indices, int type)
void Primitive::draw() void Primitive::draw()
{ {
if(_verts && _indices) if(_verts)
{ {
_verts->use(); _verts->use();
if(_indices!= nullptr) if(_indices!= nullptr)
@ -98,7 +98,7 @@ void Primitive::draw()
} }
else else
{ {
glDrawArrays((GLenum)_type, _count, _start); glDrawArrays((GLenum)_type, _start, _count);
} }
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);