From b1bbc998960fff2169dc5a992c47d08723472f9b Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 14 Oct 2018 22:52:40 +0800 Subject: =?UTF-8?q?*=E7=9B=B4=E6=8E=A5=E6=B8=B2=E6=9F=93=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Graphics/Bitmap.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/libjin/Graphics/Bitmap.h') diff --git a/src/libjin/Graphics/Bitmap.h b/src/libjin/Graphics/Bitmap.h index 5510569..553d999 100644 --- a/src/libjin/Graphics/Bitmap.h +++ b/src/libjin/Graphics/Bitmap.h @@ -6,6 +6,7 @@ #include "../Math/Vector2.hpp" #include "../3rdparty/GLee/GLee.h" #include "Color.h" + namespace jin { namespace graphics @@ -18,7 +19,7 @@ namespace graphics static Bitmap* createBitmap(int w, int h, Color color = Color::BLACK); static Bitmap* clone(const Bitmap* bitmap); - ~Bitmap(); + virtual ~Bitmap(); /* init pixels */ void bind(Color* pixels, int w, int h); void resetPixels(const Color* pixels, int w, int h); @@ -32,8 +33,9 @@ namespace graphics /* get width and height */ inline int getWidth() const { return width; } inline int getHeight() const { return height; } + inline math::Vector2 getSize() const { return math::Vector2(width, height); } - private: + protected: Bitmap(); Bitmap(int w, int h); -- cgit v1.1-26-g67d0