#include <iostream>
#include "graphics/batcher/generated/batcher.hpp"
#include "graphics/shader_standard/shader_standard.hpp"
#include "graphics/window/window.hpp"
Window window(700, 700,
"mwe_grid_font");
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
std::vector<ShaderType> rs = {ShaderType::ABSOLUTE_POSITION_WITH_COLORED_VERTEX};
Batcher batcher(shader_cache);
shader_cache.set_uniform(ShaderType::ABSOLUTE_POSITION_WITH_COLORED_VERTEX, ShaderUniformVariable::ASPECT_RATIO,
glm::vec2(1, 1));
std::vector<glm::vec3> cs(rect.
xyz_positions.size(), glm::vec3(0.5, 0.5, 0.5));
while (!glfwWindowShouldClose(window.glfw_window)) {
if (glfwGetKey(window.glfw_window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
glfwSetWindowShouldClose(window.glfw_window, true);
glClearColor(0.1f, 0.2f, 0.3f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
batcher.absolute_position_with_colored_vertex_shader_batcher.queue_draw(0, rect.
indices, rect.
xyz_positions,
cs);
batcher.absolute_position_with_colored_vertex_shader_batcher.draw_everything();
glfwSwapBuffers(window.glfw_window);
glfwPollEvents();
}
return 0;
}
facilitates simple and robust interaction with shaders
Definition shader_cache.hpp:23
Definition draw_info.hpp:61
std::vector< unsigned int > indices
Definition draw_info.hpp:71
std::vector< glm::vec3 > xyz_positions
Definition draw_info.hpp:72
draw_info::IndexedVertexPositions generate_rectangle(float center_x, float center_y, float width, float height)
Definition vertex_geometry.cpp:670