|
Woopsi 1.3
Nintendo DS Gui Framework
|
00001 #ifndef _FRAME_BUFFER_H_ 00002 #define _FRAME_BUFFER_H_ 00003 00004 #include <nds.h> 00005 #include "mutablebitmapbase.h" 00006 00007 namespace WoopsiUI { 00008 00009 class Graphics; 00010 00021 class FrameBuffer : public MutableBitmapBase { 00022 public: 00023 00036 void copy(s16 x, s16 y, u32 size, u16* dest) const; 00037 00038 #ifdef USING_SDL 00039 // SDL version 00040 00047 FrameBuffer(SDL_Surface* surface, u16 width, u16 height, u16 yOffset); 00048 00052 virtual inline ~FrameBuffer() { 00053 delete[] _dataBuffer; 00054 }; 00055 00060 const u16* getData() const; 00061 #else 00062 // DS version 00063 00070 FrameBuffer(u16* data, u16 width, u16 height); 00071 00075 virtual inline ~FrameBuffer() { }; 00076 00081 inline const u16* getData() const { return _bitmap; }; 00082 #endif 00083 00090 const u16 getPixel(s16 x, s16 y) const; 00091 00098 virtual void setPixel(const s16 x, const s16 y, const u16 colour); 00099 00107 inline const u16* getData(s16 x, s16 y) const; 00108 00114 Graphics* newGraphics(); 00115 00123 void blit(const s16 x, const s16 y, const u16* data, const u32 size); 00124 00132 void blitFill(const s16 x, const s16 y, const u16 colour, const u32 size); 00133 00138 inline const u16 getWidth() const { return _width; }; 00139 00144 inline const u16 getHeight() const { return _height; }; 00145 00146 protected: 00147 00148 #ifdef USING_SDL 00149 // SDL version 00150 SDL_Surface* _surface; 00151 u16 _yOffset; 00152 u16* _dataBuffer; 00160 void putSDLPixel(int x, int y, Uint32 pixel); 00161 00168 Uint32 getSDLPixel(int x, int y); 00169 #else 00170 // DS version 00171 u16* _bitmap __attribute__ ((aligned (4))); 00172 #endif 00173 00177 inline FrameBuffer(const FrameBuffer& bitmap) { }; 00178 00179 u16 _width; 00180 u16 _height; 00181 }; 00182 } 00183 00184 #endif
1.7.4