aboutsummaryrefslogtreecommitdiffstats
path: root/include/YAGE/sprite.hpp
blob: 969d0a67b8752d9ea55ecda0bf8145f488271282 (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
/* ----------------------------------------------------------------------------
 * sprite.hpp
 *
 * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
 * See file LICENSE for more details
 * ----------------------------------------------------------------------------
 */

#ifndef SPRITE_HPP
#define SPRITE_HPP

#include "texture.hpp"

#include <GL/glew.h>

#include <string>

namespace yage {

class Sprite {
private:
    float x_;
    float y_;
    float width_;
    float height_;
    GLuint vbo_id_ = 0;
    Texture texture_;

public:
    Sprite();
    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();
};

}  // yage

#endif