//=========================================================================== // pnggl2d.hpp : PNG framebuffer //=========================================================================== #ifndef _PNGGL2D_ #define _PNGGL2D_ #include #include #include #include using namespace std ; using namespace Colosseum ; class pngGL2d { public: BitmapImage FB; int NumPixels; // DIMENSIONS UBYTE1 fgR, fgG, fgB; // CURRENT FOREGROUND COLOR UBYTE1 bgR, bgG, bgB; // CURRENT BACKGROUND COLOR // THE CONSTRUCTOR: REQUIRES THE DESIRED DIMENSIONS OF THE FRAMEBUFFER pngGL2d(int width=0, int height=0) { NumPixels = width*height; // STORE NUMPIXELS IN FB if (NumPixels != 0) { FB.setSize(-1, 24, width, height); SetBackground(0,0,0); // DEFAULT BACKGROUND COLOR (BLACK) SetForeground(1,1,1); // DEFAULT FOREGROUND COLOR (WHITE) ClearColor(); } }; // THE DESTRUCTOR: FREE THE FRAMEBUFFER ~pngGL2d() { }; // CLEAR THE FRAMEBUFFER WITH THE CURRENT BACKGROUND COLOR void ClearColor() { for (int i=0; i