setup complete - visible character

This commit is contained in:
2021-07-07 23:20:04 +02:00
parent 9014681460
commit e4c6a45427
53 changed files with 180 additions and 422 deletions

View File

@@ -0,0 +1,25 @@
#pragma once
#include <glad/glad.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include "texture.h"
#include "shader.h"
class SpriteRenderer
{
public:
// Constructor (inits shaders/shapes)
SpriteRenderer(Shader& shader);
// Destructor
~SpriteRenderer();
// Renders a defined quad textured with given sprite
void DrawSprite(Texture& texture, glm::vec2 position, glm::vec4 UV, glm::vec2 size = glm::vec2(10, 10), GLfloat rotate = 0.0f);
private:
// Render state
Shader shader;
GLuint quadVAO, VBO, EBO;
// Initializes and configures the quad's buffer and vertex attributes
void initRenderData();
};