|
@@ -98,8 +98,11 @@ namespace oxygine
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- void VideoDriverGLES20::draw(PRIMITIVE_TYPE pt, const VertexDeclaration* decl_, const void* vdata, unsigned int size)
|
|
|
|
|
|
|
+ void VideoDriverGLES20::draw(PRIMITIVE_TYPE pt, const VertexDeclaration* decl_, const void* vdata, unsigned int verticesDataSize)
|
|
|
{
|
|
{
|
|
|
|
|
+ OX_ASSERT(verticesDataSize > 0);
|
|
|
|
|
+ OX_ASSERT((verticesDataSize % decl_->size) == 0);
|
|
|
|
|
+
|
|
|
const VertexDeclarationGL* decl = static_cast<const VertexDeclarationGL*>(decl_);
|
|
const VertexDeclarationGL* decl = static_cast<const VertexDeclarationGL*>(decl_);
|
|
|
|
|
|
|
|
const unsigned char* verticesData = (const unsigned char*)vdata;
|
|
const unsigned char* verticesData = (const unsigned char*)vdata;
|
|
@@ -112,7 +115,7 @@ namespace oxygine
|
|
|
el++;
|
|
el++;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- size_t primitives = size / decl->size;
|
|
|
|
|
|
|
+ size_t primitives = verticesDataSize / decl->size;
|
|
|
glDrawArrays(getPT(pt), 0, (GLsizei)primitives);
|
|
glDrawArrays(getPT(pt), 0, (GLsizei)primitives);
|
|
|
|
|
|
|
|
el = decl->elements;
|
|
el = decl->elements;
|
|
@@ -130,6 +133,8 @@ namespace oxygine
|
|
|
|
|
|
|
|
void VideoDriverGLES20::draw(PRIMITIVE_TYPE pt, const VertexDeclaration* decl_, const void* vdata, unsigned int verticesDataSize, const unsigned short* indicesData, unsigned int numIndices)
|
|
void VideoDriverGLES20::draw(PRIMITIVE_TYPE pt, const VertexDeclaration* decl_, const void* vdata, unsigned int verticesDataSize, const unsigned short* indicesData, unsigned int numIndices)
|
|
|
{
|
|
{
|
|
|
|
|
+ OX_ASSERT(verticesDataSize > 0);
|
|
|
|
|
+ OX_ASSERT((verticesDataSize % decl_->size) == 0);
|
|
|
const VertexDeclarationGL* decl = static_cast<const VertexDeclarationGL*>(decl_);
|
|
const VertexDeclarationGL* decl = static_cast<const VertexDeclarationGL*>(decl_);
|
|
|
|
|
|
|
|
const unsigned char* verticesData = (const unsigned char*)vdata;
|
|
const unsigned char* verticesData = (const unsigned char*)vdata;
|