|
Graphite Version 3
An experimental 3D geometry processing program
|
An OpenGL frame buffer object. More...
#include <geogram_gfx/basic/frame_buffer_object.h>
Public Member Functions | |
| FrameBufferObject () | |
| FrameBufferObject constructor. | |
| ~FrameBufferObject () | |
| FrameBufferObject destructor. | |
| bool | initialize (index_t width_in, index_t height_in, bool with_depth_buffer, GLint internal_storage, bool mipmaps=false) |
| Initializes the FrameBufferObject. | |
| void | destroy () |
| Destroys this FrameBufferObject. | |
| void | resize (index_t new_width, index_t new_height) |
| Resizes the FrameBuferObject. | |
| void | bind_as_texture () |
| Binds this frame buffer as the input 2D texture. | |
| void | bind_depth_buffer_as_texture () |
| Binds the depth buffer of this frame buffer as the input 2D texture. | |
| void | bind_as_framebuffer () |
| Binds this framebuffer as the output of OpenGL rendering. | |
| bool | is_bound_as_framebuffer () const |
| Tests whether this framebuffer is bound as a framebuffer. | |
| void | unbind () |
| Unbind this framebuffer. | |
| bool | initialized () |
| Tests whether this FrameBufferObject is initialized. | |
Static Public Member Functions | |
| static GLuint | bound_framebuffer_id () |
| Gets the currently bound FrameBufferObject. | |
Public Attributes | |
| GLuint | frame_buffer_id |
| The id of the frame buffer. | |
| GLuint | depth_buffer_id |
| The id of the texture used for the depth buffer. | |
| GLuint | offscreen_id |
| The id of the texture used for the color buffer. | |
| index_t | width |
| The width of this frame buffer, in pixels. | |
| index_t | height |
| The height of this frame buffer, in pixels. | |
| GLint | internal_storage |
| The OpenGL internal storage for the color buffer. | |
An OpenGL frame buffer object.
Definition at line 55 of file frame_buffer_object.h.
| GEO::FrameBufferObject::FrameBufferObject | ( | ) |
FrameBufferObject constructor.
Creates an uninitialized FrameBufferObject.
| GEO::FrameBufferObject::~FrameBufferObject | ( | ) |
FrameBufferObject destructor.
Releases all the allocated OpenGL resources.
| void GEO::FrameBufferObject::bind_as_framebuffer | ( | ) |
Binds this framebuffer as the output of OpenGL rendering.
This memorizes the currently bound framebuffer.
| void GEO::FrameBufferObject::bind_depth_buffer_as_texture | ( | ) |
Binds the depth buffer of this frame buffer as the input 2D texture.
|
inlinestatic |
Gets the currently bound FrameBufferObject.
Definition at line 148 of file frame_buffer_object.h.
| void GEO::FrameBufferObject::destroy | ( | ) |
Destroys this FrameBufferObject.
deletes the OpenGL textures and OpenGL frame buffer object.
| bool GEO::FrameBufferObject::initialize | ( | index_t | width_in, |
| index_t | height_in, | ||
| bool | with_depth_buffer, | ||
| GLint | internal_storage, | ||
| bool | mipmaps = false ) |
Initializes the FrameBufferObject.
| [in] | width_in | the width (in pixels) |
| [in] | height_in | the height (in picels) |
| [in] | with_depth_buffer | if true, a depth buffer is also created |
| [in] | internal_storage | the OpenGL internal storage |
| [in] | mipmaps | if true, the created textures have mipmaps |
|
inline |
Tests whether this FrameBufferObject is initialized.
| true | if this FrameBufferObject is initialized. |
| false | otherwise. |
Definition at line 140 of file frame_buffer_object.h.
| bool GEO::FrameBufferObject::is_bound_as_framebuffer | ( | ) | const |
Tests whether this framebuffer is bound as a framebuffer.
| true | if this framebuffer is bound, i.e. used for OpenGL output. |
| false | otherwise |
Resizes the FrameBuferObject.
| [in] | new_width | the new width, in pixels |
| [in] | new_height | the new height, in pixels |
| void GEO::FrameBufferObject::unbind | ( | ) |
Unbind this framebuffer.
This removes all the bindings (both as texture and as target of OpenGL rendering). If the framebuffer was bound as target of OpenGL rendering, then target of OpenGL rendering is reset to zero.
| GLuint GEO::FrameBufferObject::depth_buffer_id |
The id of the texture used for the depth buffer.
Definition at line 162 of file frame_buffer_object.h.
| GLuint GEO::FrameBufferObject::frame_buffer_id |
The id of the frame buffer.
Definition at line 157 of file frame_buffer_object.h.
| index_t GEO::FrameBufferObject::height |
The height of this frame buffer, in pixels.
Definition at line 177 of file frame_buffer_object.h.
| GLint GEO::FrameBufferObject::internal_storage |
The OpenGL internal storage for the color buffer.
Definition at line 182 of file frame_buffer_object.h.
| GLuint GEO::FrameBufferObject::offscreen_id |
The id of the texture used for the color buffer.
Definition at line 167 of file frame_buffer_object.h.
| index_t GEO::FrameBufferObject::width |
The width of this frame buffer, in pixels.
Definition at line 172 of file frame_buffer_object.h.