mirror of https://github.com/axmolengine/axmol.git
fix primitive draw error
This commit is contained in:
parent
528f4b5c0c
commit
8e51377f2d
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue