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 {
|
2022-08-18 20:03:51 +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;
|
|
|
|
|
|
|
|
LitVertex() = default;
|
|
|
|
|
2022-08-18 20:03:51 +00:00
|
|
|
LitVertex(simpleengine::Vectorf position, glm::vec3 color, glm::vec2 tex_coord, int texture_id = -1.f) :
|
2022-09-27 20:22:04 +00:00
|
|
|
position(position), color(color), tex_coord(tex_coord), normal(glm::vec3(0.f)) {
|
2022-08-18 20:03:51 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
LitVertex(simpleengine::Vectorf position, glm::vec3 color, glm::vec2 tex_coord, glm::vec3 normal, int texture_id = -1.f) :
|
2022-09-27 20:22:04 +00:00
|
|
|
position(position), color(color), tex_coord(tex_coord), normal(normal) {
|
2022-08-18 15:34:05 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-08-18 20:03:51 +00:00
|
|
|
LitVertex(simpleengine::Vectorf position, glm::vec2 tex_coord, glm::vec3 normal, int texture_id = -1.f) :
|
2022-09-27 20:22:04 +00:00
|
|
|
position(position), color(glm::vec3(1.f)), tex_coord(tex_coord), normal(normal) {
|
2021-12-09 04:14:45 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
};
|
2021-11-27 19:16:41 +00:00
|
|
|
}
|