Use safe way to get at a vector's data pointer
&std::vector<C>[0] is not guaranteed to not throw if the vector is empty. Better safe than sorry.
This commit is contained in:
parent
1b7ed5ed78
commit
520162f36a
8 changed files with 26 additions and 13 deletions
|
|
@ -86,7 +86,7 @@ struct QuadArray
|
|||
{
|
||||
/* New data exceeds already allocated size.
|
||||
* Reallocate VBO. */
|
||||
VBO::uploadData(size, &vertices[0], GL_DYNAMIC_DRAW);
|
||||
VBO::uploadData(size, dataPtr(vertices), GL_DYNAMIC_DRAW);
|
||||
vboSize = size;
|
||||
|
||||
shState->ensureQuadIBO(quadCount);
|
||||
|
|
@ -94,7 +94,7 @@ struct QuadArray
|
|||
else
|
||||
{
|
||||
/* New data fits in allocated size */
|
||||
VBO::uploadSubData(0, size, &vertices[0]);
|
||||
VBO::uploadSubData(0, size, dataPtr(vertices));
|
||||
}
|
||||
|
||||
VBO::unbind();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue