From 831e814ce9bdb84e86c06c4a52008f6bdaaa00d6 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 16 Nov 2018 00:24:51 +0800 Subject: =?UTF-8?q?*=E5=90=88=E5=B9=B6master=E5=88=B0minimal=E5=88=86?= =?UTF-8?q?=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Graphics/je_bitmap.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/libjin/Graphics/je_bitmap.h') 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 + +#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 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. -- cgit v1.1-26-g67d0