aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/Bitmap.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Graphics/Bitmap.h')
-rw-r--r--src/libjin/Graphics/Bitmap.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/libjin/Graphics/Bitmap.h b/src/libjin/Graphics/Bitmap.h
new file mode 100644
index 0000000..d050c43
--- /dev/null
+++ b/src/libjin/Graphics/Bitmap.h
@@ -0,0 +1,43 @@
+#ifndef __JIN_BITMAP_H
+#define __JIN_BITMAP_H
+#include "../modules.h"
+#if JIN_MODULES_RENDER
+
+#include "../Math/Vector2.h"
+#include "../3rdparty/GLee/GLee.h"
+#include "Color.h"
+namespace jin
+{
+namespace graphics
+{
+
+ class Bitmap
+ {
+ public:
+ static Bitmap* createBitmap(const void* imgData, size_t size);
+ static Bitmap* createBitmap(int w, int h);
+
+ ~Bitmap();
+
+ void bindPixels(Color* pixels, int w, int h);
+ void setPixels(Color* pixels, int w, int h);
+ void setPixel(const Color& pixel, int x, int y);
+ Color getPixel(int x, int y);
+ const Color* getPixels();
+ inline int getWidth() { return width; }
+ inline int getHeight() { return height; }
+
+ private:
+ Bitmap();
+ Bitmap(int w, int h);
+
+ Color * pixels;
+ int width, height;
+
+ };
+
+}
+}
+
+#endif
+#endif \ No newline at end of file