5#ifndef SMK_RENDER_TARGET_HPP
6#define SMK_RENDER_TARGET_HPP
10#include <smk/RenderState.hpp>
11#include <smk/Shader.hpp>
12#include <smk/VertexArray.hpp>
13#include <smk/View.hpp>
34 void Clear(
const glm::vec4& color);
38 void SetView(
const glm::mat4& mat);
60 void InitRenderTarget();
66 glm::mat4 projection_matrix_ = glm::mat4(1);
71 Shader fragment_shader_2d_;
75 Shader fragment_shader_3d_;
81 GLuint frame_buffer_ = 0;
Interface for class that can be draw to a smk::RenderTarget.
RenderTarget & operator=(RenderTarget &&other) noexcept
Move operator.
void SetView(const View &view)
Set the View to use.
void SetShaderProgram(ShaderProgram &shader_program)
Set the ShaderProgram to be used.
ShaderProgram & shader_program_2d()
Return the default predefined 2D shader program. It is bound by default.
const View & view() const
Return the View currently assigned to this RenderTarget.
int height() const
the height of the surface.
virtual void Draw(const Drawable &drawable)
Draw on the surface.
ShaderProgram & shader_program_3d()
Return the default predefined 3D shader program.
RenderTarget()
Build an invalid RenderTarget. It can be replaced later by using the move operator.
glm::vec2 dimensions() const
the dimension (width, height) of the drawing area.
void Clear(const glm::vec4 &color)
Clear the surface with a single color.
int width() const
the width of the surface.
A shader program is a set of shader (for instance vertex shader + pixel shader) defining the renderin...
A Shader is a little program that rest on the GPU. They are run on a specific section of the graphic ...
Contain all the data needed to draw.