2021-11-27 19:16:41 +00:00
|
|
|
#pragma once
|
2021-11-25 21:15:24 +00:00
|
|
|
|
2021-12-09 04:14:45 +00:00
|
|
|
#include <functional>
|
2021-12-02 21:58:15 +00:00
|
|
|
#ifdef __linux__
|
|
|
|
#include <GL/glew.h>
|
|
|
|
#include <GL/gl.h>
|
2021-12-13 03:17:59 +00:00
|
|
|
#else
|
2021-11-25 21:15:24 +00:00
|
|
|
#include <gl/glew.h>
|
|
|
|
#include <gl/gl.h>
|
2021-12-02 21:58:15 +00:00
|
|
|
#endif
|
2021-11-25 21:15:24 +00:00
|
|
|
|
|
|
|
#include <glm/glm.hpp>
|
|
|
|
|
2021-11-28 18:21:25 +00:00
|
|
|
#include "vector.h"
|
|
|
|
|
2021-11-25 21:15:24 +00:00
|
|
|
namespace simpleengine {
|
|
|
|
class Vertex {
|
|
|
|
public:
|
2021-11-28 18:21:25 +00:00
|
|
|
simpleengine::Vectorf position;
|
2021-11-25 21:15:24 +00:00
|
|
|
glm::vec3 color;
|
|
|
|
glm::vec2 tex_coord;
|
2022-08-18 15:34:05 +00:00
|
|
|
float texture_id = 0.f;
|
2021-12-07 05:17:04 +00:00
|
|
|
|
2021-12-09 04:14:45 +00:00
|
|
|
Vertex() = default;
|
|
|
|
|
2022-08-18 15:34:05 +00:00
|
|
|
Vertex(simpleengine::Vectorf position, glm::vec3 color, glm::vec2 tex_coord, int texture_id = 0) :
|
|
|
|
position(position), color(color), tex_coord(tex_coord), texture_id((float) texture_id) {
|
2021-12-07 05:17:04 +00:00
|
|
|
|
|
|
|
}
|
2021-11-25 21:15:24 +00:00
|
|
|
};
|
2021-12-09 04:14:45 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief A `Vertex` that can be lit up.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class LitVertex {
|
|
|
|
public:
|
|
|
|
simpleengine::Vectorf position;
|
|
|
|
glm::vec3 color;
|
|
|
|
glm::vec2 tex_coord;
|
|
|
|
glm::vec3 normal;
|
2022-08-18 15:34:05 +00:00
|
|
|
float texture_id = 0.f;
|
2021-12-09 04:14:45 +00:00
|
|
|
|
|
|
|
LitVertex() = default;
|
|
|
|
|
2022-08-18 15:34:05 +00:00
|
|
|
LitVertex(simpleengine::Vectorf position, glm::vec3 color, glm::vec2 tex_coord, glm::vec3 normal, int texture_id = 0) :
|
|
|
|
position(position), color(color), tex_coord(tex_coord), normal(normal), texture_id((float) texture_id) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
LitVertex(simpleengine::Vectorf position, glm::vec2 tex_coord, glm::vec3 normal, int texture_id = 0) :
|
|
|
|
position(position), color(glm::vec3(1.f)), tex_coord(tex_coord), normal(normal), texture_id((float) texture_id) {
|
2021-12-09 04:14:45 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
};
|
2021-11-27 19:16:41 +00:00
|
|
|
}
|