Open CASCADE Technology
6.8.0
|
Class implements FrameBuffer Object (FBO) resource intended for off-screen rendering. More...
#include <OpenGl_FrameBuffer.hxx>
Public Member Functions | |
OpenGl_FrameBuffer (GLint theTextureFormat=GL_RGBA8) | |
Empty constructor. More... | |
virtual | ~OpenGl_FrameBuffer () |
Destructor. More... | |
virtual void | Release (OpenGl_Context *theGlCtx) |
Destroy object - will release GPU memory if any. More... | |
GLsizei | GetSizeX () const |
Textures width. More... | |
GLsizei | GetSizeY () const |
Textures height. More... | |
GLsizei | GetVPSizeX () const |
Viewport width. More... | |
GLsizei | GetVPSizeY () const |
Viewport height. More... | |
Standard_Boolean | IsValid () const |
Returns true if current object was initialized. More... | |
Standard_Boolean | Init (const Handle< OpenGl_Context > &theGlCtx, const GLsizei theViewportSizeX, const GLsizei theViewportSizeY) |
Notice! Obsolete hardware (GeForce FX etc) doesn't support rectangular textures! There are 3 possible results if you are trying to create non power-of-two FBO on these cards: 1) FBO creation will fail, current implementation will try to generate compatible FBO; 2) FBO rendering will be done in software mode (ForceWare 'hack'); 3) FBO rendering will be incorrect (some obsolete Catalyst drivers). More... | |
void | SetupViewport (const Handle< OpenGl_Context > &theGlCtx) |
Setup viewport to render into FBO. More... | |
void | ChangeViewport (const GLsizei theVPSizeX, const GLsizei theVPSizeY) |
Override viewport settings. More... | |
virtual void | BindBuffer (const Handle< OpenGl_Context > &theGlCtx) |
Bind frame buffer (to render into the texture). More... | |
virtual void | UnbindBuffer (const Handle< OpenGl_Context > &theGlCtx) |
Unbind frame buffer. More... | |
const Handle< OpenGl_Texture > & | ColorTexture () const |
Returns the color texture. More... | |
const Handle< OpenGl_Texture > & | DepthStencilTexture () const |
Returns the depth-stencil texture. More... | |
![]() | |
OpenGl_Resource () | |
Empty constructor. More... | |
virtual | ~OpenGl_Resource () |
Destructor. Inheritors should call Clean (NULL) within it. More... | |
![]() | |
Standard_Transient () | |
Empty constructor. More... | |
Standard_Transient (const Standard_Transient &) | |
Copy constructor – does nothing. More... | |
Standard_Transient & | operator= (const Standard_Transient &) |
Assignment operator, needed to avoid copying reference counter. More... | |
virtual | ~Standard_Transient () |
Destructor must be virtual. More... | |
virtual void | Delete () const |
Memory deallocator for transient classes. More... | |
virtual const Handle_Standard_Type & | DynamicType () const |
Returns a type information object about this object. More... | |
Standard_Boolean | IsInstance (const Handle_Standard_Type &theType) const |
Returns a true value if this is an instance of Type. More... | |
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
Returns a true value if this is an instance of TypeName. More... | |
Standard_Boolean | IsKind (const Handle_Standard_Type &theType) const |
Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
Standard_Boolean | IsKind (const Standard_CString theTypeName) const |
Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More... | |
virtual Handle_Standard_Transient | This () const |
Returns a Handle which references this object. Must never be called to objects created in stack. More... | |
Standard_Integer | GetRefCount () const |
Get the reference counter of this object. More... | |
Static Public Attributes | |
static const GLuint | NO_FRAMEBUFFER = 0 |
Helpful constants. More... | |
Protected Member Functions | |
Standard_Boolean | initTrashTextures (const Handle< OpenGl_Context > &theGlContext) |
Generate textures with undefined data. More... | |
Standard_Boolean | isValidFrameBuffer () const |
Protected Attributes | |
GLsizei | myVPSizeX |
viewport width (should be <= texture width) More... | |
GLsizei | myVPSizeY |
viewport height (should be <= texture height) More... | |
GLint | myTextFormat |
GL_RGB, GL_RGBA,... More... | |
GLuint | myGlFBufferId |
FBO object ID. More... | |
Handle< OpenGl_Texture > | myColorTexture |
color texture object More... | |
Handle< OpenGl_Texture > | myDepthStencilTexture |
depth-stencil texture object More... | |
Class implements FrameBuffer Object (FBO) resource intended for off-screen rendering.
OpenGl_FrameBuffer::OpenGl_FrameBuffer | ( | GLint | theTextureFormat = GL_RGBA8 | ) |
Empty constructor.
|
virtual |
Destructor.
|
virtual |
Bind frame buffer (to render into the texture).
void OpenGl_FrameBuffer::ChangeViewport | ( | const GLsizei | theVPSizeX, |
const GLsizei | theVPSizeY | ||
) |
Override viewport settings.
|
inline |
Returns the color texture.
|
inline |
Returns the depth-stencil texture.
|
inline |
Textures width.
|
inline |
Textures height.
|
inline |
Viewport width.
|
inline |
Viewport height.
Standard_Boolean OpenGl_FrameBuffer::Init | ( | const Handle< OpenGl_Context > & | theGlCtx, |
const GLsizei | theViewportSizeX, | ||
const GLsizei | theViewportSizeY | ||
) |
Notice! Obsolete hardware (GeForce FX etc) doesn't support rectangular textures! There are 3 possible results if you are trying to create non power-of-two FBO on these cards: 1) FBO creation will fail, current implementation will try to generate compatible FBO; 2) FBO rendering will be done in software mode (ForceWare 'hack'); 3) FBO rendering will be incorrect (some obsolete Catalyst drivers).
|
protected |
Generate textures with undefined data.
|
inline |
Returns true if current object was initialized.
|
inlineprotected |
|
virtual |
Destroy object - will release GPU memory if any.
Implements OpenGl_Resource.
void OpenGl_FrameBuffer::SetupViewport | ( | const Handle< OpenGl_Context > & | theGlCtx | ) |
Setup viewport to render into FBO.
|
virtual |
Unbind frame buffer.
|
protected |
color texture object
|
protected |
depth-stencil texture object
|
protected |
FBO object ID.
|
protected |
GL_RGB, GL_RGBA,...
|
protected |
viewport width (should be <= texture width)
|
protected |
viewport height (should be <= texture height)
|
static |
Helpful constants.