Initial commit
This commit is contained in:
commit
edfc5298e1
252 changed files with 93965 additions and 0 deletions
47
include/Spectre/Graphics/Sprite.h
Normal file
47
include/Spectre/Graphics/Sprite.h
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
|
||||
#ifndef SPECTRE_GRAPHICS_SPRITE_H
|
||||
#define SPECTRE_GRAPHICS_SPRITE_H
|
||||
|
||||
#include <Spectre/Math/Color.h>
|
||||
#include "Vertex2D.h"
|
||||
#include "Renderable.h"
|
||||
|
||||
class Texture;
|
||||
|
||||
class Sprite : public Renderable2D
|
||||
{
|
||||
public :
|
||||
Sprite();
|
||||
|
||||
Sprite(const vec2f& pos, const vec2f& size);
|
||||
|
||||
void init();
|
||||
|
||||
void setSize(vec2f size);
|
||||
|
||||
void setColor(const Color& color);
|
||||
|
||||
void setTexture(const Texture& texture);
|
||||
|
||||
void setTextureCoords(const vec2u& pos, const vec2u& size);
|
||||
|
||||
virtual const Texture* getTexture() const;
|
||||
|
||||
virtual const std::vector<Vertex2D>& getVertices() const;
|
||||
|
||||
virtual const std::vector<unsigned short>& getIndices() const;
|
||||
|
||||
virtual const RenderType getRenderType() const { return RenderType_Scene; };
|
||||
|
||||
protected :
|
||||
|
||||
void updateGeometry();
|
||||
|
||||
std::vector<unsigned short> m_indicies;
|
||||
|
||||
std::vector<Vertex2D> m_vertices;
|
||||
|
||||
const Texture* m_texture;
|
||||
};
|
||||
|
||||
#endif /* SPECTRE_GRAPHICS_SPRITE_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue