Shkyera Engine
Easy to use, game engine for Python
Loading...
Searching...
No Matches
Shader.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <glad/glad.h>
4#include <filesystem>
5
6namespace shkyera {
7
8class Shader {
9 public:
10 enum class Type {
11 Vertex,
14 };
15
16 Shader(const std::filesystem::path& filepath, Type type);
17 Shader(const Shader& other) = delete;
18 Shader& operator=(const Shader& other) = delete;
19 Shader(Shader&& other) noexcept;
20 Shader& operator=(Shader&& other) noexcept;
21
22 ~Shader();
23
24 GLuint getID() const { return _id; }
25
26 private:
27 GLuint _id;
29
30 std::string loadFromFile(const std::string& filepath);
31
32 void compile(const std::string& source);
33
34 GLenum shaderTypeToGLenum(Type type);
35};
36
37} // namespace shkyera
Definition Shader.hpp:8
std::string loadFromFile(const std::string &filepath)
Definition Shader.cpp:36
Shader & operator=(const Shader &other)=delete
void compile(const std::string &source)
Definition Shader.cpp:48
~Shader()
Definition Shader.cpp:15
GLuint getID() const
Definition Shader.hpp:24
Type
Definition Shader.hpp:10
Type _type
Definition Shader.hpp:28
Shader(const Shader &other)=delete
GLuint _id
Definition Shader.hpp:27
GLenum shaderTypeToGLenum(Type type)
Definition Shader.cpp:65
Definition Asset.hpp:6