GIGA REFACTOR

This commit is contained in:
2022-03-02 18:51:42 +01:00
parent 553b2f6aad
commit 6df59b1487
92 changed files with 1807 additions and 1785 deletions

View File

@@ -28,6 +28,7 @@ private:
std::vector<VertexAttribPointer> m_VertexAttribs;
public:
REMOVE_COPY(VertexBuffer);
VertexBuffer(VertexBuffer&& other) {
m_VertexAttribs = std::move(other.m_VertexAttribs);
m_ID = other.m_ID;
@@ -35,12 +36,14 @@ public:
other.m_ID = 0;
other.m_DataStride = 0;
}
VertexBuffer(const std::vector<float>& data, unsigned int stride);
~VertexBuffer();
void bind() const;
void unbind() const;
void addVertexAttribPointer(unsigned int index, unsigned int coordinateSize, unsigned int offset);
void bindVertexAttribs() const;
void Bind() const;
void Unbind() const;
void AddVertexAttribPointer(unsigned int index, unsigned int coordinateSize, unsigned int offset);
void BindVertexAttribs() const;
};
class VertexArray {
@@ -49,6 +52,7 @@ private:
std::vector<VertexBuffer> m_VertexBuffers; //use to destroy vbos when become unused
public:
REMOVE_COPY(VertexArray);
VertexArray(VertexArray&& other) {
m_ID = other.m_ID;
m_VertexCount = other.m_VertexCount;
@@ -56,12 +60,14 @@ public:
other.m_VertexCount = 0;
other.m_ID = 0;
}
VertexArray(unsigned int vertexCount);
~VertexArray();
unsigned int getVertexCount() const { return m_VertexCount; }
void bindVertexBuffer(VertexBuffer& vbo);
void bind() const;
void unbind() const;
unsigned int GetVertexCount() const { return m_VertexCount; }
void BindVertexBuffer(VertexBuffer& vbo);
void Bind() const;
void Unbind() const;
};
}

View File

@@ -10,7 +10,7 @@
namespace TextureLoader {
unsigned int loadGLTexture(const char* fileName);
unsigned int LoadGLTexture(const char* fileName);
}

View File

@@ -13,10 +13,10 @@ struct RenderData {
std::vector<float> colors;
};
GL::VertexArray loadMobModel();
GL::VertexArray loadWorldModel(const td::game::World* world);
GL::VertexArray loadTileSelectModel();
RenderData loadTowerModel(game::TowerPtr tower);
GL::VertexArray LoadMobModel();
GL::VertexArray LoadWorldModel(const td::game::World* world);
GL::VertexArray LoadTileSelectModel();
RenderData LoadTowerModel(game::TowerPtr tower);
} // namespace WorldLoader