-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSpriteBatch.hpp
More file actions
35 lines (26 loc) · 778 Bytes
/
SpriteBatch.hpp
File metadata and controls
35 lines (26 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef SPRITEBATCH_HPP
#define SPRITEBATCH_HPP
#include <SFML/Graphics/Texture.hpp>
#include <SFML/Graphics/VertexArray.hpp>
#include <SFML/Graphics/Drawable.hpp>
#include <SFML/Graphics/RenderTarget.hpp>
#include <SFML/Graphics/RenderStates.hpp>
#include <array>
#include <vector>
namespace swift
{
class SpriteBatch : public sf::Drawable
{
public:
SpriteBatch(const sf::Texture& tex, unsigned int s);
const std::vector<sf::Vertex>& getVertices() const;
std::array<sf::Vertex*, 6> addSprite();
sf::Vector2u getTextureSize() const;
private:
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const;
std::vector<sf::Vertex> vertices;
const sf::Texture& texture;
unsigned int spriteNum;
};
}
#endif // SPRITEBATCH_HPP