C3D Toolkit
Kernel - 117982, Vision - 2.9.2.2
|
OpenGLFramebufferObject class encapsulates framebuffer OpenGL object. More...
#include <vsn_openglfbo.h>
Public Member Functions | |
OpenGLFramebufferObject (int width, int height, int multisample=0, bool depth=false, bool stencil=false) | |
Constructor. More... | |
OpenGLFramebufferObject (const SizeI &size, int multisample=0, bool depth=false, bool stencil=false) | |
Constructor. More... | |
virtual | ~OpenGLFramebufferObject () |
Destructor. | |
void | Bind () |
Binds Framebuffer. | |
void | Release () |
Releases Framebuffer. | |
void | Update (int width, int height) |
Changes sizes. | |
int | GetWidth () const |
Returns Framebuffer width. | |
int | GetHeight () const |
Returns Framebuffer height. | |
bool | IsValid () const |
Checks buffer state. | |
Image | MakeImage () |
Saves in image. | |
Image | MakeImage (int x1, int y1, int x2, int y2) |
Saves in image. | |
GLuint | MakeTexture () const |
Makes texture from buffer content. Texture doesn't need to be deleted. | |
GLuint | MakeDepthTexture () const |
Makes depth texture from buffer content. Texture doesn't need to be deleted. | |
void | RenderImage (float left, float bottom, float width, float height) |
Displays buffer content in given rectangle. | |
OpenGLFramebufferObject class encapsulates framebuffer OpenGL object.
OpenGLFramebufferObject class presents some surface of rendering on which you can also render with calling OpenGL functions. This surface can be linked and used as ordinary texture in your own code for rendering OpenGL. OpenGLFramebufferObject class generates by default OpenGL 2D texture and uses GL_TEXTURE_2D used inside rendering. When creating OpenGLFramebufferObject it's necessary to operate with depth and stencil flags to have a correct display. To display primitives antialised, it's necessary to set SetSamples when setting OpenGL format.
VSN::OpenGLFramebufferObject::OpenGLFramebufferObject | ( | int | width, |
int | height, | ||
int | multisample = 0 , |
||
bool | depth = false , |
||
bool | stencil = false |
||
) |
Constructor.
[in] | width | - Width. |
[in] | height | - Height. |
[in] | multisample | - Level of antialiasing. |
[in] | depth | - Creates depth buffer or not. |
[in] | stencil | - Creates stencil buffer or not. |
VSN::OpenGLFramebufferObject::OpenGLFramebufferObject | ( | const SizeI & | size, |
int | multisample = 0 , |
||
bool | depth = false , |
||
bool | stencil = false |
||
) |
Constructor.
[in] | size | - Buffer size. |
[in] | multisample | - Level of antialiasing. |
[in] | depth | - Creates depth buffer or not. |
[in] | stencil | - Creates stencil buffer or not. |