-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShader.hpp
More file actions
76 lines (63 loc) · 2.18 KB
/
Shader.hpp
File metadata and controls
76 lines (63 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef EUROTRAM_SHADER
#define EUROTRAM_SHADER
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/ext/matrix_transform.hpp>
#include <glm/geometric.hpp>
#include <glm/gtx/matrix_decompose.hpp>
#include <glm/gtx/vector_angle.hpp>
#include <stbi/stb_image.h>
#include <imgui.h>
#include <imgui_impl_glfw.h>
#include <imgui_impl_opengl3.h>
#include <imgui_stdlib.h>
#include <fastgltf/core.hpp>
#include <fastgltf/tools.hpp>
#include <fastgltf/base64.hpp>
#include <fastgltf/glm_element_traits.hpp>
#include <iostream>
#include <fstream>
#include <array>
#include <vector>
#include <chrono>
#include <csignal> //can be helpful to raise interrupts when debugging
#include <clocale>
#include <thread>
#include <list>
#include <filesystem>
#include <numeric>
#include <random>
#include <functional>
#include <string>
#include <iomanip>
#include <unordered_map>
using namespace std::chrono_literals;
#define FILE_READ_BLOCK_SIZE 8192
std::string readFile(std::fstream& aStream, const std::string_view aFilepath) noexcept;
std::ostream& operator<<(std::ostream& aStream, const glm::vec2& aVector) noexcept;
std::ostream& operator<<(std::ostream& aStream, const glm::vec3& aVector) noexcept;
std::ostream& operator<<(std::ostream& aStream, const glm::vec4& aVector) noexcept;
std::ostream& operator<<(std::ostream& aStream, const glm::mat4& aMatrix) noexcept;
glm::mat4 convertToGLM(const fastgltf::math::fmat4x4& aFrom) noexcept;
glm::quat convertToGLM(const fastgltf::math::quat<float>& aFrom) noexcept;
glm::vec3 convertToGLM(const fastgltf::math::vec<float, 3> aFrom) noexcept;
glm::vec4 convertToGLM(const fastgltf::math::vec<float, 4> aFrom) noexcept;
class Shader {
public:
Shader(const std::string_view aVertexSource, const std::string_view aFragmentSource) noexcept;
Shader(Shader&& aOther) noexcept;
Shader& operator=(Shader&& aOther) noexcept;
Shader(Shader& aOther) noexcept = delete;
Shader& operator=(Shader& aOther) noexcept = delete;
void bind() noexcept;
void unbind() noexcept;
GLuint getHandle() const noexcept;
~Shader();
private:
GLuint mHandle;
};
#endif