diff options
Diffstat (limited to 'src/libjin/Graphics/je_bitmap.h')
-rw-r--r-- | src/libjin/Graphics/je_bitmap.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/libjin/Graphics/je_bitmap.h b/src/libjin/Graphics/je_bitmap.h index ae97d0d..5ab11ca 100644 --- a/src/libjin/Graphics/je_bitmap.h +++ b/src/libjin/Graphics/je_bitmap.h @@ -1,9 +1,12 @@ -#ifndef __JE_BITMAP_H -#define __JE_BITMAP_H +#ifndef __JE_BITMAP_H__ +#define __JE_BITMAP_H__ #include "../core/je_configuration.h" #if defined(jin_graphics) -#include "../3rdparty/GLee/GLee.h" +#include <functional> + +#include "GLee/GLee.h" + #include "../common/je_types.h" #include "../math/je_vector2.hpp" @@ -17,7 +20,9 @@ namespace JinEngine /// /// A RGBA32 bitmap. /// - /// A bitmap keeps pixels and can't draw directly onto screen. To render bitmap, a texture is required. + /// A bitmap keeps pixels and can't draw directly onto screen. To render bitmap, a texture is required. A + /// texture is a renderable hard ware side structure which could be handled with GPU. For instance, opengl + /// create texture and store it in GPU memory for rendering them onto hdc. /// class Bitmap { @@ -59,6 +64,11 @@ namespace JinEngine /// static Bitmap* createBitmap(int width, int height, Color color = Color::BLACK); + /// + /// Create bitmap and set bitmap pixels with given drawer. + /// + static Bitmap* createBitmap(int width, int height, std::function<Color(int, int, int, int)> drawer); + /// /// Create bitmap with another one. /// @@ -119,8 +129,9 @@ namespace JinEngine /// Set pixels with given color data. /// /// @param colors New pixels' colors. + /// @param count Number of pixels. /// - void setPixels(Color* colors); + void setPixels(Color* colors, int count); /// /// Get pixel in given position. |