aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/Drawable.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Graphics/Drawable.h')
-rw-r--r--src/libjin/Graphics/Drawable.h43
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