blob: 9e5aca8b6290cc2be2432b0834b9dcbfdc5b0301 (
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
|
/* ----------------------------------------------------------------------------
* 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();
void init(float x, float y, float width, float height, const std::string &texture_path);
void draw();
};
} // yage
#endif
|