blob: 51821be5a6d1f1c56e02fc187cb0dcbc559b71e3 (
plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
/** ---------------------------------------------------------------------------
* @file: sprite.h
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
* ----------------------------------------------------------------------------
*/
#ifndef SPRITE_H
#define SPRITE_H
#include "../data/texture.h"
#include <glad/glad.h>
#include <string>
namespace yage
{
/** @deprecated Use SpriteBatch instead
*/
class Sprite
{
private:
float x_;
float y_;
float width_;
float height_;
GLuint vbo_id_ = 0;
Texture texture_;
public:
Sprite() = default;
Sprite(const Sprite &) = delete;
Sprite(Sprite &&) = delete;
~Sprite();
Sprite &operator=(const Sprite &) = delete;
Sprite &operator=(Sprite &&) = delete;
void init(float x, float y, float width, float height,
const std::string &texture_path);
void draw();
};
} // namespace yage
#endif
|