diff options
author | chai <chaifix@163.com> | 2018-09-02 10:08:58 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-09-02 10:08:58 +0800 |
commit | 3bb587f0d7c471a70683fa7d26939d21968dea98 (patch) | |
tree | 6ef9e75b5159dda0a8d1dc4ef8640be4eacc6343 /src/libjin/Graphics/Drawable.h | |
parent | 862763a88f6b4a6cb6c034287c509a91776adf8b (diff) |
*update
Diffstat (limited to 'src/libjin/Graphics/Drawable.h')
-rw-r--r-- | src/libjin/Graphics/Drawable.h | 43 |
1 files changed, 12 insertions, 31 deletions
diff --git a/src/libjin/Graphics/Drawable.h b/src/libjin/Graphics/Drawable.h index 4e91adb..86cc919 100644 --- a/src/libjin/Graphics/Drawable.h +++ b/src/libjin/Graphics/Drawable.h @@ -3,7 +3,9 @@ #include "../modules.h" #if JIN_MODULES_RENDER +#include "../math/Vector.h" #include "../3rdparty/GLee/GLee.h" + namespace jin { namespace graphics @@ -16,44 +18,23 @@ namespace graphics 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 width; - } - - inline int getHeight() const - { - return height; - } - - inline GLuint getTexture() const - { - return texture; - }; + 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; - const int DRAWABLE_V_SIZE = 8; - - void setVertices(float* v, float* t); - - GLuint texture; + GLuint texture; GLuint vbo; + jin::math::Vector2 size; + jin::math::Vector2 anchor; + float vertCoord[DRAWABLE_V_SIZE]; + float textCoord[DRAWABLE_V_SIZE]; - int width, height; - - /* anchor point */ - int ancx, ancy; - - // render coords - float* textCoord; - float* vertCoord; - }; - + } // render } // jin |