UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
primitivesetup.h
Go to the documentation of this file.
1 #ifndef UGDK_GRAPHIC_PRIMITIVESETUP_H_
2 #define UGDK_GRAPHIC_PRIMITIVESETUP_H_
3 
4 #include <ugdk/graphic.h>
5 
6 #include <ugdk/action.h>
7 
10 #include <ugdk/graphic/primitive.h>
15 
16 #include <string>
17 #include <utility>
18 #include <glm/glm.hpp>
19 
20 namespace ugdk {
21 namespace graphic {
22 
23 namespace VertexDataManipulation {
24 
25 void ApplyPositionOffset(VertexData& data, const math::Vector2D& offset);
26 void SetToRectangleAtOrigin(VertexData& data, const math::Vector2D& size);
27 void SetToAbsoluteRectangleWithAtlasPiece(VertexData& data, const glm::vec4& top_left, const glm::vec4& bottom_right, const TextureAtlas::BoundPiece& piece);
29 
30 } // namespace VertexDataManipulation
31 
32 namespace PrimitiveSetup {
33 
34 struct Sprite {
36 
37  static void Prepare(Primitive&, const TextureAtlas* spritesheet);
38  static void Render(const Primitive&, Canvas& canvas);
39 
40  static std::shared_ptr<action::SpriteAnimationPlayer> CreateSpriteAnimationPlayer(Primitive&, const action::SpriteAnimationTable* table);
41 };
42 
43 struct Rectangle {
45 
46  static void Prepare(Primitive&, const graphic::GLTexture*, const math::Vector2D& size);
47  static void Prepare(Primitive&, const graphic::GLTexture*);
48  static void Render(const Primitive&, Canvas& canvas);
49 };
50 
51 } // namespace PrimitiveSetup
52 
53 } // namespace graphic
54 } // namespace ugdk
55 
56 #endif // UGDK_GRAPHIC_PRIMITIVESETUP_H_
Definition: canvas.h:28
Definition: textureatlas.h:31
Definition: indexabletable.h:15
Definition: vector2D.h:18
static void Prepare(Primitive &, const graphic::GLTexture *, const math::Vector2D &size)
Definition: primitivesetup.h:34
static const VertexDataSpecification vertexdata_specification
Definition: primitivesetup.h:35
static std::shared_ptr< action::SpriteAnimationPlayer > CreateSpriteAnimationPlayer(Primitive &, const action::SpriteAnimationTable *table)
Definition: animation.h:11
Definition: vertexdata.h:20
void SetToAbsoluteRectangleWithAtlasPiece(VertexData &data, const glm::vec4 &top_left, const glm::vec4 &bottom_right, const TextureAtlas::BoundPiece &piece)
static void Render(const Primitive &, Canvas &canvas)
Definition: vertexdata.h:57
static void Render(const Primitive &, Canvas &canvas)
void SetToRectangleAtOrigin(VertexData &data, const math::Vector2D &size)
static const VertexDataSpecification vertexdata_specification
Definition: primitivesetup.h:44
Definition: textureatlas.h:20
Definition: primitivesetup.h:43
void ApplyPositionOffset(VertexData &data, const math::Vector2D &offset)
Definition: spriteanimationframe.h:17
void SetUsingSpriteFrameInformation(VertexData &data, const math::Vector2D &position, const action::SpriteAnimationFrame &, const TextureAtlas::BoundPiece &)
static void Prepare(Primitive &, const TextureAtlas *spritesheet)
Definition: primitive.h:14