Lightweight OpenGL 3D Renderer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Euclid/headers/renderer.hpp

49 lines
1.0 KiB

#pragma once
#include <glm/fwd.hpp>
2 years ago
#include <vector>
#include "shaders.hpp"
#include "textures.hpp"
2 years ago
#include "GLFW/glfw3.h"
#define VERTEX_ATTRIB_PTR_SIZE 8 * sizeof(float)
#define VERT_SHADER_SRC_FILE "shaders/vertex.glsl"
#define FRAG_SHADER_SRC_FILE "shaders/fragment.glsl"
#define RUSTY_METAL_TEXTURE "assets/textures/rusty_metal.jpg"
namespace Renderer {
2 years ago
class RenderObject {};
class Renderer3D {
public:
Renderer3D();
Renderer3D(std::vector<RenderObject> ROs);
void setCamera(glm::vec3 pos);
void setFOV(float deg);
void render(GLFWwindow* win);
private:
std::vector<RenderObject> RenderObjects;
};
class Obj2D {
public:
Shaders::Shader shader;
Textures::Texture2D texture;
2 years ago
Obj2D(unsigned int indices[], unsigned int icount, float verts[], unsigned int vcount);
void setTexture(const char* t_src);
void transform(glm::mat4 T);
2 years ago
void render(GLFWwindow* win);
private:
2 years ago
void bind_texture(Textures::Texture2D texture);
unsigned int EBO;
unsigned int VBO;
unsigned int VAO;
};
}