Replace QVector, QList with std::vector, std::list

An exception is made of TexPool, which will need a
bit more testing before transitioning to std containers.

Also replace 'int' with 'size_t' where it is used only
as an array index.
This commit is contained in:
Jonas Kulla 2013-12-26 20:18:33 +01:00
parent 8215bc7e7d
commit 231e38ae8e
16 changed files with 188 additions and 165 deletions

View file

@ -27,6 +27,8 @@
#include "global-ibo.h"
#include "shader.h"
#include <vector>
#include <stdint.h>
typedef uint32_t index_t;
@ -34,7 +36,7 @@ typedef uint32_t index_t;
struct ColorQuadArray
{
QVector<Vertex> vertices;
std::vector<Vertex> vertices;
VBO::ID vbo;
VAO::ID vao;
@ -81,7 +83,7 @@ struct ColorQuadArray
void commit()
{
VBO::bind(vbo);
VBO::uploadData(vertices.size() * sizeof(Vertex), vertices.constData(), GL_DYNAMIC_DRAW);
VBO::uploadData(vertices.size() * sizeof(Vertex), &vertices[0], GL_DYNAMIC_DRAW);
VBO::unbind();
shState->ensureQuadIBO(quadCount);
@ -110,7 +112,7 @@ struct ColorQuadArray
struct PointArray
{
QVector<Vertex> vertices;
std::vector<Vertex> vertices;
VBO::ID vbo;
VAO::ID vao;
@ -143,13 +145,13 @@ struct PointArray
Vertex vert;
vert.pos = pos;
vert.color = color;
vertices.append(vert);
vertices.push_back(vert);
}
void commit()
{
VBO::bind(vbo);
VBO::uploadData(vertices.size() * sizeof(Vertex), vertices.constData());
VBO::uploadData(vertices.size() * sizeof(Vertex), &vertices[0]);
VBO::unbind();
}
@ -167,7 +169,7 @@ struct PointArray
int count()
{
return vertices.count();
return vertices.size();
}
};