Rev | Line | |
---|
[2855] | 1 | #ifndef _FrameBufferObject_H__
|
---|
| 2 | #define _FrameBufferObject_H__
|
---|
| 3 |
|
---|
| 4 | #include <vector>
|
---|
| 5 | #include "common.h"
|
---|
| 6 |
|
---|
| 7 |
|
---|
| 8 | namespace CHCDemoEngine
|
---|
| 9 | {
|
---|
| 10 |
|
---|
| 11 |
|
---|
| 12 | /** This class implements a wrapper for a color buffer object
|
---|
| 13 | */
|
---|
| 14 | class ColorBufferObject
|
---|
| 15 | {
|
---|
| 16 | public:
|
---|
| 17 |
|
---|
| 18 | enum COLOR_FORMAT { BUFFER_UBYTE, BUFFER_FLOAT_16, BUFFER_FLOAT_32 };
|
---|
| 19 |
|
---|
| 20 | ColorBufferObject(int w, int h,
|
---|
| 21 | COLOR_FORMAT c,
|
---|
| 22 | int wrapType,
|
---|
| 23 | int filterType,
|
---|
| 24 | bool useMipMap,
|
---|
| 25 | bool useMultiSampling);
|
---|
| 26 | };
|
---|
| 27 |
|
---|
| 28 |
|
---|
| 29 | /** This class implements a wrapper for a frame buffer object
|
---|
| 30 | */
|
---|
| 31 | class FrameBufferObject
|
---|
| 32 | {
|
---|
| 33 | public:
|
---|
| 34 |
|
---|
| 35 | enum DEPTH_FORMAT { DEPTH_16, DEPTH_24, DEPTH_32 };
|
---|
| 36 | /** constructor requesting an opengl occlusion query.
|
---|
| 37 | */
|
---|
| 38 | FrameBufferObject(int w, int h, bool useDepth, DEPTH_FORMAT d);
|
---|
| 39 | /** Creates and adds a color buffer to the current frame buffer object.
|
---|
| 40 | Returns a pointer to the buffer object
|
---|
| 41 | */
|
---|
| 42 | ColorBufferObject *AddColorBuffer(ColorBufferObject::COLOR_FORMAT col,
|
---|
| 43 | int wrapType,
|
---|
| 44 | int filterType,
|
---|
| 45 | bool useMipMap,
|
---|
| 46 | bool useMultiSampling);
|
---|
| 47 |
|
---|
| 48 | protected:
|
---|
| 49 |
|
---|
| 50 | std::vector<ColorBufferObject *> mColorBuffers;
|
---|
| 51 |
|
---|
| 52 | unsigned int mId;
|
---|
| 53 | unsigned int mDepthId;
|
---|
| 54 |
|
---|
| 55 | int mHeight;
|
---|
| 56 | int mWidth;
|
---|
| 57 | };
|
---|
| 58 |
|
---|
| 59 | } // namespace
|
---|
| 60 | #endif // _FrameBufferObject_H__ |
---|
Note: See
TracBrowser
for help on using the repository browser.