RenderState.hpp
1// Copyright 2019 Arthur Sonzogni. All rights reserved.
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4
5#ifndef SMK_RENDER_STATE_HPP
6#define SMK_RENDER_STATE_HPP
7
8#include <glm/glm.hpp>
9#include <smk/BlendMode.hpp>
10#include <smk/Shader.hpp>
11#include <smk/Texture.hpp>
12#include <smk/VertexArray.hpp>
13
14namespace smk {
15
16/// Contain all the data needed to draw
18 ShaderProgram shader_program; ///< The shader used.
19 Texture texture; ///< The texture 0 bound.
20 VertexArray vertex_array; ///< The shape to to be drawn
21 glm::mat4 view = glm::mat4(1.f); ///< The "view" transformation.
22 glm::vec4 color = glm::vec4(0.f); ///< The masking color.
23 BlendMode blend_mode = BlendMode::Alpha; ///< The OpenGL BlendMode
24};
25
26} // namespace smk
27
28#endif /* end of include guard: SMK_RENDER_STATE_HPP */
A shader program is a set of shader (for instance vertex shader + pixel shader) defining the renderin...
Definition: Shader.hpp:114
An array of smk::Vertex moved to the GPU memory. This represent a set of triangles to be drawn by the...
Definition: VertexArray.hpp:20
static const BlendMode Alpha
destination = source * source.a + destination * (1 - souce.a)
Definition: BlendMode.hpp:68
Contain all the data needed to draw.
Definition: RenderState.hpp:17
glm::mat4 view
The "view" transformation.
Definition: RenderState.hpp:21
glm::vec4 color
The masking color.
Definition: RenderState.hpp:22
Texture texture
The texture 0 bound.
Definition: RenderState.hpp:19
BlendMode blend_mode
The OpenGL BlendMode.
Definition: RenderState.hpp:23
VertexArray vertex_array
The shape to to be drawn.
Definition: RenderState.hpp:20
ShaderProgram shader_program
The shader used.
Definition: RenderState.hpp:18