aboutsummaryrefslogtreecommitdiffstats
path: root/yage/base/sprite.h
blob: 725d2160671b20b6c809b18fb6dd653f9bc00ebd (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
50
51
52
/* ----------------------------------------------------------------------------
 * sprite.h
 *
 * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
 * See file LICENSE for more details
 * ----------------------------------------------------------------------------
 */

/** @file
  */

#ifndef SPRITE_H
#define SPRITE_H

#include "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