diff options
author | chai <chaifix@163.com> | 2018-07-27 00:01:34 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-07-27 00:01:34 +0800 |
commit | b855ebb91ad8d97617ec1aa418b4add84670a07d (patch) | |
tree | b11847a1879a2582c9cfd380074ad4c70f17a1a8 /src/libjin/Render/Drawable.h | |
parent | 1a882936e91826e4d69584745e16a79650272015 (diff) |
*change name
Diffstat (limited to 'src/libjin/Render/Drawable.h')
-rw-r--r-- | src/libjin/Render/Drawable.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/libjin/Render/Drawable.h b/src/libjin/Render/Drawable.h new file mode 100644 index 0000000..f8e25a2 --- /dev/null +++ b/src/libjin/Render/Drawable.h @@ -0,0 +1,56 @@ +#ifndef __JIN_DRAWABLE +#define __JIN_DRAWABLE +#include "../modules.h" +#if JIN_MODULES_RENDER + +#include "3rdparty/GLee/GLee.h" +namespace jin +{ +namespace render +{ + 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 Drawable::getWidth() const + { + return width; + } + + inline int Drawable::getHeight() const + { + return height; + } + + inline GLuint getTexture() const + { + return texture; + }; + + protected: +#define DRAWABLE_V_SIZE 8 + void setVertices(float* v, float* t); + + GLuint texture; + + int width, height; + + /* anchor point */ + int ancx, ancy; + + // render coords + float* textCoord; + float* vertCoord; + + }; +} +}// jin + +#endif // JIN_MODULES_RENDER +#endif |