Renderable2D: Adding Z order variable.
This commit is contained in:
parent
84ffd0189e
commit
8ce53c41cb
2 changed files with 20 additions and 1 deletions
|
|
@ -25,6 +25,9 @@ public :
|
||||||
Renderable2D(const Vector2f& position);
|
Renderable2D(const Vector2f& position);
|
||||||
virtual ~Renderable2D();
|
virtual ~Renderable2D();
|
||||||
|
|
||||||
|
unsigned char getZOrder() const;
|
||||||
|
void setZOrder(unsigned char value);
|
||||||
|
|
||||||
virtual const std::vector<Vertex2D>& getVertices() const = 0;
|
virtual const std::vector<Vertex2D>& getVertices() const = 0;
|
||||||
|
|
||||||
virtual const std::vector<unsigned short>& getIndices() const = 0;
|
virtual const std::vector<unsigned short>& getIndices() const = 0;
|
||||||
|
|
@ -34,6 +37,10 @@ public :
|
||||||
virtual const RenderType getRenderType() const = 0;
|
virtual const RenderType getRenderType() const = 0;
|
||||||
|
|
||||||
virtual void render(Renderer2D& renderer) const = 0;
|
virtual void render(Renderer2D& renderer) const = 0;
|
||||||
|
|
||||||
|
protected :
|
||||||
|
|
||||||
|
unsigned char m_zorder;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SPECTRE_GRAPHCIS_RENDERABLE_H */
|
#endif /* SPECTRE_GRAPHCIS_RENDERABLE_H */
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
|
|
||||||
#include <Spectre/Graphics/Renderable.h>
|
#include <Spectre/Graphics/Renderable.h>
|
||||||
|
|
||||||
Renderable2D::Renderable2D()
|
Renderable2D::Renderable2D() :
|
||||||
|
m_zorder (0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Renderable2D::Renderable2D(const Vector2f& position) :
|
Renderable2D::Renderable2D(const Vector2f& position) :
|
||||||
|
m_zorder (0),
|
||||||
Transformable (position)
|
Transformable (position)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -13,3 +15,13 @@ Transformable (position)
|
||||||
Renderable2D::~Renderable2D()
|
Renderable2D::~Renderable2D()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned char Renderable2D::getZOrder() const
|
||||||
|
{
|
||||||
|
return m_zorder;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Renderable2D::setZOrder(unsigned char value)
|
||||||
|
{
|
||||||
|
m_zorder = value;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue