00001
00012 #pragma once
00013
00014
00015 #include "standard.h"
00016 #include "MatrixTypes.h"
00017 #include <assert.h>
00018 #include <windows.h>
00019
00024 class GLBitmapBuffer
00025 {
00026 public:
00027
00029 GLBitmapBuffer();
00030
00032 ~GLBitmapBuffer();
00033
00036 void create(unsigned int w, unsigned int h);
00037
00039 unsigned int getWidth() const { return width; }
00040
00042 unsigned int getHeight() const { return height; }
00043
00045 void select();
00046
00049 void unselect();
00050
00052 RgbByte *operator[] (int index);
00053
00055 unsigned char* getData() { return data; }
00056
00057 HDC getHDC() { return hdc; }
00058
00061 void saveAs (char *filename);
00062
00063 private:
00064 unsigned int width, height;
00065 unsigned char* data ;
00066 HBITMAP hBitmap, hBitmapOld;
00067 HDC hdc;
00068 HGLRC m_hrc , m_hrcOld;
00069 HDC hdcOld;
00070 };