46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
#ifndef GEOMETRY_HPP
|
|
#define GEOMETRY_HPP
|
|
|
|
// Includes
|
|
#include <glm/glm.hpp>
|
|
#include <glm/gtc/matrix_transform.hpp>
|
|
#include <glm/gtc/type_ptr.hpp>
|
|
#include "graphics.hpp"
|
|
|
|
// Object class
|
|
class Object {
|
|
public:
|
|
Object(
|
|
float *vertices, unsigned int vertex_size,
|
|
unsigned int *indices, unsigned int index_size,
|
|
float *normals = nullptr, unsigned int normal_size = 0,
|
|
float *texcoords = nullptr, unsigned int texcoord_size = 0
|
|
);
|
|
~Object();
|
|
void draw();
|
|
|
|
private:
|
|
unsigned int VAO, VBO, EBO, NBO, TBO; // Vertex Array Object, Vertex Buffer Object, Element Buffer Object, Normal Buffer Object, Texture Buffer Object
|
|
unsigned int vertex_count;
|
|
unsigned int index_count;
|
|
};
|
|
|
|
class UntexturedObject {
|
|
public:
|
|
UntexturedObject(
|
|
float *vertices, unsigned int vertex_size,
|
|
unsigned int *indices, unsigned int index_size,
|
|
float *normals = nullptr, unsigned int normal_size = 0,
|
|
float *texcoords = nullptr, unsigned int texcoord_size = 0
|
|
);
|
|
~UntexturedObject();
|
|
void draw();
|
|
|
|
private:
|
|
unsigned int VAO, VBO, EBO, NBO, TBO; // Vertex Array Object, Vertex Buffer Object, Element Buffer Object, Normal Buffer Object, Texture Buffer Object
|
|
unsigned int vertex_count;
|
|
unsigned int index_count;
|
|
};
|
|
|
|
#endif
|