#ifndef _BOOTCOOKIE_FRAMEBUFFER_ #define _BOOTCOOKIE_FRAMEBUFFER_ #include "gfx.hpp" #include #include #include #include #include #include #include #include #include #include #define BK_EXCEPTION_OPEN 1 #define BK_EXCEPTION_INFO 2 #define BK_EXCEPTION_COLOR_DEPTH 3 #define BK_EXCEPTION_MMAP 4 #define BK_EXCEPTION_GET_PALETTE 5 #define BK_EXCEPTION_SET_PALETTE 6 namespace net { namespace lliurex { namespace bootcookie { class Exception { public: std::string message; int type; Exception(int type,const char * msg); }; class FrameBuffer { private: static FrameBuffer * factory; FrameBuffer(); void SetSystemPalette(); int fbfd; uint8_t * buffer; long int screensize; struct fb_var_screeninfo vinfo; struct fb_fix_screeninfo finfo; public: Palette palette; int width; int height; static FrameBuffer * GetDefault(); void Blit(Surface * surface,int x,int y); void Destroy(); }; } } } #endif