VMTK
vmtkFrameBufferObject.h
1 #ifndef FRAMEBUFFEROBJECT_H
2 #define FRAMEBUFFEROBJECT_H
3 
4 #ifndef GLEW_STATIC
5 #define GLEW_STATIC
6 #endif
7 #ifdef __WIN32__
8 #include <GL/glew.h>
9 #elif __linux__
10 #include <GL/glew.h>
11 #elif __APPLE__
12 #include <glew.h>
13 #endif
14 
15 #include <iostream>
16 #include <assert.h>
17 
19 {
20  public:
29  enum Attachment {
34  };
35 
38 
39  vmtkFrameBufferObject(int width, int height, GLenum target = GL_TEXTURE_2D, Attachment option = NoAttachment);
40 
41  GLenum target;
48  GLuint getFbo() const;
49 
54  GLuint getTexture() const;
55 
60  GLuint getDepthTexture() const;
61 
66  bool binding();
67 
72  bool releasing();
78  void resizing(int width,int height);
79 
80  private:
81  GLuint fbo;
82  GLuint texture;
83  GLuint depthTexture;
84 
85  GLuint vec_textures[2];
86 
87  void init(int width, int height,
88  Attachment attachment,
89  GLenum internal_format, GLenum target,
90  GLint samples = 0, bool mipmap = false);
91 };
92 
93 #endif
GLuint getTexture() const
gets the texture bound to the FBO.
GLuint getFbo() const
gets the Fbo name.
void resizing(int width, int height)
resizing FrameBufferObject dimensions ... It does not work!!!! (Ting)
Attachment
constructs a FrameBufferObject without arguments
GLuint getDepthTexture() const
gets the depth texture bound to the FBO.
bool binding()
binds the FBO to the framebuffer target.
bool releasing()
releases the FBO from the framebuffer target.