FBO.hh
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef ACG_FBO_HH
00014 #define ACG_FBO_HH
00015
00016
00017
00018
00019 #include <iostream>
00020 #include <stdlib.h>
00021
00022 #include <ACG/GL/gl.hh>
00023
00024
00025
00026
00027
00028 namespace ACG {
00029
00030
00031
00032
00039 class FBO
00040 {
00041 public:
00042
00044 FBO() {}
00045
00047 ~FBO();
00048
00050 void init();
00051
00053 void attachTexture2D( GLenum _attachment, GLuint _texture );
00054
00056 void addDepthBuffer( GLuint _width, GLuint _height );
00057
00059 void addStencilBuffer( GLuint _width, GLuint _height );
00060
00062 bool bind();
00063
00065 void unbind();
00066
00068 bool checkFramebufferStatus();
00069
00070 private:
00071
00073 GLuint fbo_;
00074
00076 GLuint depthbuffer_;
00077
00079 GLuint stencilbuffer_;
00080
00081
00082 };
00083
00084
00085
00086 }
00087
00088 #endif // ACG_FBO_HH defined
00089
00090