5#include <glm/gtc/matrix_transform.hpp>
6#include <smk/RenderTarget.hpp>
7#include <smk/Texture.hpp>
8#include <smk/Transformable.hpp>
23 rotation_ += rotation;
110 glm::mat4 ret = glm::mat4(1.0);
111 ret = glm::translate(ret, {position_.x, position_.y, 0.0});
112 if (rotation_ != 0.F) {
115 glm::rotate(ret, -rotation_ * (2.F * 3.1415F / 360.F), {0.0, 0.0, 1.0});
118 glm::translate(ret, {-center_.x * scale_.x, -center_.y * scale_.y, 0.F});
119 ret = glm::scale(ret, {scale_.x, scale_.y, 1.0});
134 blend_mode_ = blend_mode;
139 texture_ = std::move(texture);
144 vertex_array_ = std::move(vertex_array);
148 state.
color *= color();
150 state.
view *= transformation();
161 transformation_ = mat;
164glm::mat4 Transformable3D::transformation()
const {
165 return transformation_;
virtual void Draw(const Drawable &drawable)
Draw on the surface.
An array of smk::Vertex moved to the GPU memory. This represent a set of triangles to be drawn by the...
Contain all the data needed to draw.
glm::mat4 view
The "view" transformation.
glm::vec4 color
The masking color.
Texture texture
The texture 0 bound.
BlendMode blend_mode
The OpenGL BlendMode.
VertexArray vertex_array
The shape to to be drawn.