YAGE  0.02
Yet Another Game Engine
sprite.hpp
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * sprite.hpp
3  *
4  * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
5  * See file LICENSE for more details
6  * ----------------------------------------------------------------------------
7  */
8 
9 #ifndef SPRITE_HPP
10 #define SPRITE_HPP
11 
12 #include "texture.hpp"
13 
14 #include <GL/glew.h>
15 
16 #include <string>
17 
18 namespace yage {
19 
20 class Sprite {
21 private:
22  float x_;
23  float y_;
24  float width_;
25  float height_;
26  GLuint vbo_id_ = 0;
28 
29 public:
30  Sprite();
31  Sprite(const Sprite&) = delete;
32  Sprite(Sprite&&) = delete;
33  ~Sprite();
34 
35  Sprite& operator=(const Sprite&) = delete;
36  Sprite& operator=(Sprite&&) = delete;
37 
38  void init(float x, float y, float width, float height,
39  const std::string& texture_path);
40  void draw();
41 };
42 
43 } // yage
44 
45 #endif
void draw()
Definition: sprite.cpp:64
Texture texture_
Definition: sprite.hpp:27
GLuint vbo_id_
Definition: sprite.hpp:26
float width_
Definition: sprite.hpp:24
void init(float x, float y, float width, float height, const std::string &texture_path)
Definition: sprite.cpp:23
Definition: texture.hpp:16
float x_
Definition: sprite.hpp:22
~Sprite()
Definition: sprite.cpp:19
float y_
Definition: sprite.hpp:23
Sprite & operator=(const Sprite &)=delete
Templated matrix class.
Definition: camera2d.hpp:17
float height_
Definition: sprite.hpp:25
Definition: sprite.hpp:20