diff options
author | chai <chaifix@163.com> | 2018-10-16 20:18:42 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-10-16 20:18:42 +0800 |
commit | 0fc4b3ad5f2ac8d5c0588f61c0cbed4349ee1430 (patch) | |
tree | 535b2dc55a3f12d36d55cb3cf071d40da7e5576f /src/libjin/Graphics/Drawable.h | |
parent | be59ac06cbcd60895e25f2e7d76846ee3e6a0d92 (diff) |
*misc
Diffstat (limited to 'src/libjin/Graphics/Drawable.h')
-rw-r--r-- | src/libjin/Graphics/Drawable.h | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/libjin/Graphics/Drawable.h b/src/libjin/Graphics/Drawable.h index 0c4c3ef..29f1946 100644 --- a/src/libjin/Graphics/Drawable.h +++ b/src/libjin/Graphics/Drawable.h @@ -10,39 +10,39 @@ namespace jin { -namespace graphics -{ - - class Drawable + namespace graphics { - public: - Drawable(int w = 0, int h = 0); - Drawable(const Bitmap* bitmap); - virtual ~Drawable(); - void setAnchor(int x, int y); - void draw(int x, int y, float sx = 1, float sy = 1, float r = 0); - void draw(const math::Quad& slice, int x, int y, float sx = 1, float sy = 1, float r = 0, float ax = 0, float ay = 0); - inline int getWidth() const { return size.w; } - inline int getHeight() const { return size.h; } - inline GLuint getTexture() const { return texture; } + class Drawable + { + public: + Drawable(int w = 0, int h = 0); + Drawable(const Bitmap* bitmap); + virtual ~Drawable(); + + void setAnchor(int x, int y); + void draw(int x, int y, float sx = 1, float sy = 1, float r = 0); + void draw(const math::Quad& slice, int x, int y, float sx = 1, float sy = 1, float r = 0, float ax = 0, float ay = 0); + inline int getWidth() const { return size.w; } + inline int getHeight() const { return size.h; } + inline GLuint getTexture() const { return texture; } - protected: - static const int DRAWABLE_V_SIZE = 8; + protected: + static const int DRAWABLE_V_SIZE = 8; - GLuint texture; - GLuint vbo; - /* TODO: vertex buffer object */ - /* GLuint vbo; */ - jin::math::Vector2<unsigned int> size; - jin::math::Vector2<int> anchor; - float vertex_coords[DRAWABLE_V_SIZE]; - float texture_coords[DRAWABLE_V_SIZE]; + GLuint texture; + GLuint vbo; + /* TODO: vertex buffer object */ + /* GLuint vbo; */ + jin::math::Vector2<unsigned int> size; + jin::math::Vector2<int> anchor; + float vertex_coords[DRAWABLE_V_SIZE]; + float texture_coords[DRAWABLE_V_SIZE]; - }; + }; -} // render -} // jin + } // namespace render +} // namespace jin #endif // LIBJIN_MODULES_RENDER #endif // __LIBJIN_DRAWABLE
\ No newline at end of file |