This class implements an OpenGL framebuffer.
More...
#include <CFrameBuffer.h>
|
| | cFrameBuffer () |
| | Constructor of cFrameBuffer.
|
| |
| virtual | ~cFrameBuffer () |
| | Destructor of cFrameBuffer.
|
| |
| void | setup (cCamera *a_camera=NULL, const unsigned int a_width=0, const unsigned int a_height=0, const bool a_enableImageBuffer=true, const bool a_enableDepthBuffer=true) |
| | This method initializes the framebuffer.
|
| |
| void | renderView (const cEyeMode a_eyeMode=C_STEREO_LEFT_EYE) |
| | This method renders the framebuffer view.
|
| |
| void | copyImageBuffer (cImagePtr a_image) |
| | This method copies the framebuffer content to an image.
|
| |
| void | copyDepthBuffer (cImagePtr a_image) |
| | This method copies the depth buffer content to an image.
|
| |
| void | setCamera (cCamera *a_camera) |
| | This method attaches a camera to the framebuffer.
|
| |
| cCamera * | getCamera () |
| | This method returns a pointer to the camera attached to the framebuffer.
|
| |
| unsigned int | getWidth () const |
| | This method returns the width in pixels of the framebuffer.
|
| |
| unsigned int | getHeight () const |
| | This method returns the height in pixels of the framebuffer.
|
| |
| void | setSize (const unsigned int a_width, const unsigned int a_height) |
| | This method sets the resolution of the framebuffer by defining its width and height in pixels.
|
| |
| bool | renderInitialize () |
| | This method initializes rendering to the framebuffer.
|
| |
| bool | renderFinalize () |
| | This method finalizes the rendering to the framebuffer.
|
| |
|
| bool | m_useImageBuffer |
| | If true then image buffer is enabled, false otherwise.
|
| |
| bool | m_useDepthBuffer |
| | If true then image buffer is enabled, false otherwise.
|
| |
| unsigned int | m_width |
| | Width in pixels of the frame buffer.
|
| |
| unsigned int | m_height |
| | Height in pixels of the frame buffer.
|
| |
| unsigned int | m_prevWidth |
| | Last width value that was used when allocating texture size.
|
| |
| unsigned int | m_prevHeight |
| | Last height value that was used when allocating texture size.
|
| |
| cCamera * | m_camera |
| | Camera associated with this framebuffer.
|
| |
| GLuint | m_fbo |
| | OpenGL frame buffer object.
|
| |
This class implements an OpenGL framebuffer.
◆ cFrameBuffer()
| chai3d::cFrameBuffer::cFrameBuffer |
( |
| ) |
|
◆ ~cFrameBuffer()
| chai3d::cFrameBuffer::~cFrameBuffer |
( |
| ) |
|
|
virtual |
◆ create()
◆ setup()
| void chai3d::cFrameBuffer::setup |
( |
cCamera * |
a_camera = NULL, |
|
|
const unsigned int |
a_width = 0, |
|
|
const unsigned int |
a_height = 0, |
|
|
const bool |
a_useImageBuffer = true, |
|
|
const bool |
a_useDepthBuffer = true |
|
) |
| |
This method initializes the cFrameBuffer.
- Parameters
-
| a_camera | Camera to be attached to framebuffer. |
| a_width | Width in pixels of framebuffer. |
| a_height | Height in pixels of framebuffer. |
| a_useImageBuffer | If true then framebuffer shall store color information. |
| a_useDepthBuffer | If true then framebuffer shall store depth information. |
◆ renderView()
This method render the scene to the framebuffer.
- Parameters
-
| a_eyeMode | When using stereo mode C_STEREO_PASSIVE_DUAL_DISPLAY, this argument specifies which eye view to render. |
◆ copyImageBuffer()
| void chai3d::cFrameBuffer::copyImageBuffer |
( |
cImagePtr |
a_image | ) |
|
This method copies the OpenGL image buffer content to an image.
- Parameters
-
| a_image | Destination image. |
◆ copyDepthBuffer()
| void chai3d::cFrameBuffer::copyDepthBuffer |
( |
cImagePtr |
a_image | ) |
|
This method copies the OpenGL depth buffer content to an image.
- Parameters
-
| a_image | Destination image. |
◆ setCamera()
| void chai3d::cFrameBuffer::setCamera |
( |
cCamera * |
a_camera | ) |
|
|
inline |
◆ getCamera()
| cCamera * chai3d::cFrameBuffer::getCamera |
( |
| ) |
|
|
inline |
◆ getWidth()
| unsigned int chai3d::cFrameBuffer::getWidth |
( |
| ) |
const |
|
inline |
◆ getHeight()
| unsigned int chai3d::cFrameBuffer::getHeight |
( |
| ) |
const |
|
inline |
◆ setSize()
| void chai3d::cFrameBuffer::setSize |
( |
const unsigned int |
a_width, |
|
|
const unsigned int |
a_height |
|
) |
| |
This method sets the size of the framebuffer by defining the width and height in pixel.
- Parameters
-
| a_width | Width of frame buffer in pixels. |
| a_height | Height of frame buffer in pixels. |
◆ renderInitialize()
| bool chai3d::cFrameBuffer::renderInitialize |
( |
| ) |
|
This method initializes the framebuffer so that rendering of the scene can occur. This method is for advanced users only; in practice you should simply call method renderView() to render the framebuffer.
- Returns
- true if the operation succeeds, false otherwise.
◆ renderFinalize()
| bool chai3d::cFrameBuffer::renderFinalize |
( |
| ) |
|
This method finalizes the rendering of the framebuffer. This method is for advanced users only; in practice you should simply call method renderView() to render the framebuffer.
- Returns
- true if the operation succeeds, false otherwise.
◆ m_imageBuffer
◆ m_depthBuffer
◆ m_useImageBuffer
| bool chai3d::cFrameBuffer::m_useImageBuffer |
|
protected |
◆ m_useDepthBuffer
| bool chai3d::cFrameBuffer::m_useDepthBuffer |
|
protected |
◆ m_width
| unsigned int chai3d::cFrameBuffer::m_width |
|
protected |
◆ m_height
| unsigned int chai3d::cFrameBuffer::m_height |
|
protected |
◆ m_prevWidth
| unsigned int chai3d::cFrameBuffer::m_prevWidth |
|
protected |
◆ m_prevHeight
| unsigned int chai3d::cFrameBuffer::m_prevHeight |
|
protected |
◆ m_camera
| cCamera* chai3d::cFrameBuffer::m_camera |
|
protected |
◆ m_fbo
| GLuint chai3d::cFrameBuffer::m_fbo |
|
protected |
The documentation for this class was generated from the following files: