[FEATURE] working gui buttons

This commit is contained in:
Menno
2021-05-25 14:38:35 +02:00
parent 21a7f4f4b2
commit 977d377fe5
9 changed files with 197 additions and 35 deletions

View File

@@ -82,7 +82,7 @@ namespace render_engine
glBindVertexArray(0);
}
void Render(std::vector<gui::GuiTexture>& guis, shaders::GuiShader& shader)
void Render(std::vector<gui::GuiTexture*>& guis, shaders::GuiShader& shader)
{
shader.Start();
@@ -98,13 +98,13 @@ namespace render_engine
glDisable(GL_DEPTH_TEST);
// Render each gui to the screen
for (gui::GuiTexture& gui : guis)
{
for (gui::GuiTexture* gui : guis)
{
// Bind the texture of the gui to the shader
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, gui.texture);
glBindTexture(GL_TEXTURE_2D, gui->texture);
glm::mat4 matrix = toolbox::CreateModelMatrix(gui.position, gui.scale);
glm::mat4 matrix = toolbox::CreateModelMatrix(gui->position, gui->scale);
shader.LoadModelMatrix(matrix);
glDrawArrays(GL_TRIANGLE_STRIP, 0, quad.vertex_count);