StevEngine
StevEngine is a customizable C++ game engine.
Loading...
Searching...
No Matches
Shader.hpp
1#pragma once
2#ifdef StevEngine_RENDERER_GL
3#include <cstdint>
4
5namespace StevEngine::Renderer {
6 class ShaderProgram;
7
8 enum ShaderType {
9 VERTEX,
10 FRAGMENT,
11 GEOMETRY,
12 COMPUTE,
13 TESS_CONTROL,
14 TESS_EVALUATION
15 };
16
23 class Shader {
24 friend class ShaderProgram;
25 public:
32 Shader(const char* source, ShaderType shaderType, bool useDefaultDefinitions = true);
33
35 const ShaderType shaderType;
36
41 uint32_t GetLocation() const { return location; };
42
43 private:
44 uint32_t location;
45 const char* source;
46 };
47}
48#endif
Compiled and linked shader program.
Definition ShaderProgram.hpp:22
const ShaderType shaderType
Type of this shader.
Definition Shader.hpp:35
uint32_t GetLocation() const
Get OpenGL shader ID.
Definition Shader.hpp:41
Shader(const char *source, ShaderType shaderType, bool useDefaultDefinitions=true)
Create new shader.
Definition Shader.cpp:45
Core rendering system.
Definition Object.cpp:19