- Main Page
- Classes
- Files

- File List

# framebuffer.h

    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
    00024 #ifdef USING_SDL
    00025                 // SDL version
    00026
    00033                 FrameBuffer(SDL_Surface* surface, u16 width, u16 height, u16 yOffset);
    00034
    00039                 const u16* getData() const;
    00040 #else
    00041                 // DS version
    00042
    00049                 FrameBuffer(u16* data, u16 width, u16 height);
    00050
    00055                 inline const u16* getData() const { return _bitmap; };
    00056 #endif
    00057
    00061                 virtual inline ~FrameBuffer() { };
    00062
    00069                 const u16 getPixel(s16 x, s16 y) const;
    00070
    00077                 virtual void setPixel(const s16 x, const s16 y, const u16 colour);
    00078
    00086                 inline const u16* getData(s16 x, s16 y) const;
    00087
    00093                 Graphics* newGraphics();
    00094
    00102                 void blit(const s16 x, const s16 y, const u16* data, const u32 size);
    00103
    00111                 void blitFill(const s16 x, const s16 y, const u16 colour, const u32 size);
    00112
    00113         protected:
    00114
    00115 #ifdef USING_SDL
    00116                 // SDL version
    00117                 SDL_Surface* _surface;
    00118                 u16 _yOffset;
    00119                 u16* _dataBuffer;
    00120 #else
    00121                 // DS version
    00122                 u16* _bitmap __attribute__ ((aligned (4)));
    00123 #endif
    00124
    00128                 inline FrameBuffer(const FrameBuffer& bitmap) { };
    00129         };
    00130 }
    00131
    00132 #endif