[FEATURE] working gui buttons
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "../gui/gui_texture.h"
|
||||
#include "../gui/gui_element.h"
|
||||
#include "../entities/entity.h"
|
||||
#include "../shaders/entity_shader.h"
|
||||
#include "../shaders/gui_shader.h"
|
||||
@@ -38,6 +38,6 @@ namespace render_engine
|
||||
@param guis: A list with all the GUI textures you want to render
|
||||
@param shade: The shader the GUI textures need to be rendered with
|
||||
*/
|
||||
void Render(std::vector<gui::GuiTexture>& guis, shaders::GuiShader& shader);
|
||||
void Render(std::vector<gui::GuiTexture*>& guis, shaders::GuiShader& shader);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user