frameBufferObject.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef EQ_FRAMEBUFFEROBJECT_H
00020 #define EQ_FRAMEBUFFEROBJECT_H
00021
00022 #include <eq/client/windowSystem.h>
00023 #include <eq/client/texture.h>
00024
00025 #include <vector>
00026
00027 namespace eq
00028 {
00030 class FrameBufferObject
00031 {
00032 public:
00034 FrameBufferObject( GLEWContext* const glewContext );
00035
00037 ~FrameBufferObject();
00038
00040 bool init( const int width, const int height,
00041 const int depthSize, const int stencilSize );
00042
00049 void setColorFormat( const GLuint format );
00050
00052 void exit();
00053
00055 void bind();
00056
00058 void unbind();
00059
00060
00061 bool resize( const int width, const int height );
00062
00063 GLEWContext* glewGetContext() { return _glewContext; }
00064 const GLEWContext* glewGetContext() const { return _glewContext; }
00065
00067 const TextureVector& getColorTextures() const { return _colors; }
00068
00070 const Texture& getDepthTexture() const { return _depth; }
00071
00073 const Texture& getStencilTexture() const { return _stencil; }
00074
00076 const std::string& getErrorMessage() { return _error; }
00077
00079 PixelViewport getPixelViewport() const;
00080
00088 bool addColorTexture( );
00089
00090 private:
00091 GLuint _fboID;
00092
00093 int _width;
00094 int _height;
00095
00096 TextureVector _colors;
00097
00098 Texture _depth;
00099 Texture _stencil;
00100
00101 GLEWContext* const _glewContext;
00102
00104 std::string _error;
00105
00106 bool _valid;
00107
00108 union
00109 {
00110 char dummy[64];
00111 };
00112
00113 CHECK_THREAD_DECLARE( _thread );
00114
00116 bool _checkFBOStatus();
00117 };
00118 }
00119
00120
00121 #endif //EQ_FRAMEBUFFEROBJECT_H