render entities
This commit is contained in:
@@ -159,9 +159,9 @@ GL::VertexArray LoadTileSelectModel() {
|
||||
colorVBO.AddVertexAttribPointer(1, 1, 0);
|
||||
|
||||
std::vector<unsigned int> indexes(positions.size() / 3, 0);
|
||||
for (size_t i = 0; i < indexes.size(); i++) {
|
||||
indexes[i] = i + 1;
|
||||
}
|
||||
// for (size_t i = 0; i < indexes.size(); i++) {
|
||||
// indexes[i] = i + 1;
|
||||
// }
|
||||
GL::ElementBuffer indexVBO(indexes);
|
||||
|
||||
GL::VertexArray tileSelectVao(std::move(indexVBO));
|
||||
@@ -211,6 +211,36 @@ RenderData LoadTowerModel(game::TowerPtr tower) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
GL::VertexArray LoadMobModel() {
|
||||
std::vector<float> positions = {
|
||||
-0.5, 0, -0.5,
|
||||
-0.5, 0, 0.5,
|
||||
0.5, 0, -0.5,
|
||||
|
||||
0.5, 0, -0.5,
|
||||
-0.5, 0, 0.5,
|
||||
0.5, 0, 0.5
|
||||
};
|
||||
|
||||
std::vector<unsigned int> indexes(positions.size() / 3, 0);
|
||||
// for (size_t i = 0; i < indexes.size(); i++) {
|
||||
// indexes[i] = i + 1;
|
||||
// }
|
||||
GL::ElementBuffer indexVBO(indexes);
|
||||
|
||||
GL::VertexBuffer positionVBO(positions, POSITION_VERTEX_SIZE);
|
||||
positionVBO.AddVertexAttribPointer(0, POSITION_VERTEX_SIZE, 0);
|
||||
|
||||
GL::VertexArray mobVao(std::move(indexVBO)); // each pos = 1 color
|
||||
mobVao.Bind();
|
||||
mobVao.BindVertexBuffer(std::move(positionVBO));
|
||||
mobVao.Unbind();
|
||||
return mobVao;
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace WorldLoader
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user