cangine
Loading...
Searching...
No Matches
quadrenderer_component.hpp
Go to the documentation of this file.
1#pragma once
2#include "component.hpp"
3#include "../../render/renderer/render_system.hpp"
4#include "../../render/renderer/quad_renderer.hpp"
5
6#include "../../shapes/shapes.hpp"
7#include "../../render/texture.hpp"
8
9#include "../../util/color.hpp"
10
11#include "../gameobjects/game_object.hpp"
12
14
15namespace cangine {
23 protected:
28 public:
29 void firstFrame() override;
30 void frame(double deltaTime) override;
35 virtual void setTexture(Texture &t);
40 virtual void setRectWidth(int widthIn);
45 virtual void setRectHeight(int heightIn);
50 virtual void setRectColor(Color colorIn);
66 };
67}
Base interface for all components attached to a GameObject.
Definition component.hpp:17
Component that draws its game object as a textured rectangle.
Definition quadrenderer_component.hpp:22
virtual void setTexture(Texture &t)
Sets the texture applied to the quad.
Definition quadrenderer_component.cpp:22
Vector2 getRectSize()
Returns the rectangle's size.
Definition quadrenderer_component.cpp:44
void firstFrame() override
Called once before the first frame update.
Definition quadrenderer_component.cpp:6
QuadRenderer * qr
Renderer used to draw the quad.
Definition quadrenderer_component.hpp:24
Texture * texture
Texture applied to the quad, if any.
Definition quadrenderer_component.hpp:25
Rectangle * getRect()
Returns the underlying rectangle.
Definition quadrenderer_component.cpp:36
Rectangle rect
Rectangle geometry to draw.
Definition quadrenderer_component.hpp:27
Vector3 getRectPos()
Returns the rectangle's position.
Definition quadrenderer_component.cpp:40
virtual void setRectHeight(int heightIn)
Sets the rectangle height.
Definition quadrenderer_component.cpp:29
virtual void setRectColor(Color colorIn)
Sets the rectangle fill color.
Definition quadrenderer_component.cpp:32
Transform * transform
Cached transform of the owning object.
Definition quadrenderer_component.hpp:26
virtual void setRectWidth(int widthIn)
Sets the rectangle width.
Definition quadrenderer_component.cpp:26
void frame(double deltaTime) override
Called every frame to update the component.
Definition quadrenderer_component.cpp:16
Batched renderer for textured quads (rectangles).
Definition quad_renderer.hpp:33
Wraps an OpenGL texture object.
Definition texture.hpp:12
Component holding an object's position, rotation and scale.
Definition transform_component.hpp:17
Definition audiomanager.cpp:4
RGBA color stored as normalized floating-point components.
Definition color.hpp:12
An axis-aligned rectangle with a position, size and color.
Definition rectangle.hpp:21
Two-component floating-point vector.
Definition vector2.hpp:13
Three-component floating-point vector.
Definition vector3.hpp:13