blob: bdec5b41292f47eca4d8c16883fdad9d2f43e3e7 (
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
|
#ifndef __JIN_DRAWABLE
#define __JIN_DRAWABLE
#include "../modules.h"
#if JIN_MODULES_RENDER
#include "../math/Vector2.h"
#include "../3rdparty/GLee/GLee.h"
namespace jin
{
namespace graphics
{
class Drawable
{
public:
Drawable(int w = 0, int h = 0);
virtual ~Drawable();
void setAnchor(int x, int y);
void draw(int x, int y, float sx, float sy, float r);
inline int getWidth() const { return size.x; }
inline int getHeight() const { return size.y; }
inline GLuint getTexture() const { return texture; }
protected:
static const int DRAWABLE_V_SIZE = 8;
GLuint texture;
/* TODO: vertex buffer object */
/* GLuint vbo; */
jin::math::Vector2<unsigned int> size;
jin::math::Vector2<int> anchor;
float vertCoord[DRAWABLE_V_SIZE];
float textCoord[DRAWABLE_V_SIZE];
};
} // render
} // jin
#endif // JIN_MODULES_RENDER
#endif // __JIN_DRAWABLE
|