Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
shader.h
1#ifndef OE_RENDER_SHADER_H
2#define OE_RENDER_SHADER_H
3
4#include <memory>
5#include <string>
6
7#include <glm/mat4x4.hpp>
8
9#include "shader_base.h"
10
11namespace oe::render
12{
22 class Shader : public ShaderBase
23 {
24 public:
30 Shader(const std::string& name = "");
31
39 static const std::shared_ptr<Shader> generatePostProcessingShader(const std::string& fragment_code, const bool compile = true);
40
45 void compile();
46
50 void bind();
51
57 void setVertexShader(const std::string& contents);
58
64 void setFragmentShader(const std::string& contents);
65 };
66}
67
68#endif
ShaderBase(const std::string &name="")
Create a new shader instance.
void setVertexShader(const std::string &contents)
Set source code for the vertex stage.
Shader(const std::string &name="")
Create a new shader instance.
void compile()
Compile / link the shader using the graphic API.
void setFragmentShader(const std::string &contents)
Set source code for the fragment stage.
void bind()
Tell the graphic API to use this shader for the next renderings.
static const std::shared_ptr< Shader > generatePostProcessingShader(const std::string &fragment_code, const bool compile=true)
Generate a shader ready for post-processing effects.
Render related abstractions (Shader, Framebuffer, Cubemaps, Textures).
Definition opengl.h:12