Creates an OpenGL Pbuffer. More...
#include <Inventor/SoPBuffer.h>
Public Member Functions | |
SoPBuffer () | |
~SoPBuffer () | |
SbBool | create (SbVec2s size) |
SbBool | create (SbVec2i32 size) |
SbBool | makeCurrent () |
void | disable () |
void | shareCurrentContext () |
SbBool | resize (const SbVec2s &size) |
SbBool | resize (const SbVec2i32 &size) |
SbVec2s | getSize () const |
const SbVec2i32 & | getSize_i32 () const |
void | setPixelFormat (int format) |
int | getPixelFormat () |
void | setRenderToTexture (SbBool enable, TextureFormat format=TEXTURE_RGB, TextureTarget target=TEXTURE_2D, SbBool autoMipmap=FALSE, SbBool hasDepth=FALSE) |
virtual SbBool | bindToTexture (SbBool bindDepth=FALSE, GLuint texObj=-1) |
SbBool | releaseTexImage (SbBool bindDepth=FALSE) |
SbBool | selectCubeMapFace (CubeMapTextureFace face) |
SoGLGraphicConfigTemplate * | getGraphicConfigTemplate () |
void | setGraphicConfigTemplate (SoGLGraphicConfigTemplate *gTemplate) |
Static Public Member Functions | |
static SbBool | isAvailable (SbGlContextHelper::Display display=NULL) |
This class creates an OpenGL Pbuffer object which may be used for accelerated off-screen rendering. Unlike a pixmap or offscreen bitmap, a Pbuffer is allocated in frame buffer memory and can be rendered to directly by the graphics hardware.
NOTE: This class does not exist in Open Inventor 10.0 and later. Use SoRenderToTarget.For most applications, using the SoOffscreenRenderer class will be more convenient. SoOffscreenRenderer uses Pbuffers automatically.
Pbuffers are only available if the graphics hardware supports OpenGL 1.2 or the OpenGL Pbuffer extension. On UNIX this extension is named "GLX_pbuffer" or "GLX_SGIX_pbuffer". On Windows this extension is named "WGL_ARB_pbuffer" or "WGL_EXT_pbuffer".
SoPBuffer::SoPBuffer | ( | ) |
Constructor.
Creates an object of this class but does *not* create a Pbuffer. Use the create() method to attempt creation of a Pbuffer.
SoPBuffer::~SoPBuffer | ( | ) |
Destructor.
Binds the Pbuffer buffer to a texture object (The current one, texObj is not used) If bindDepth is set to TRUE, binds the depth buffer instead of the color buffer.
Implements SoGLRenderToBuffer.
Creates a Pbuffer with the specified size.
For sizes greater than 32767. Returns TRUE if successful
Implements SoGLRenderToBuffer.
Creates a Pbuffer with the specified size.
Limited to 32767. Returns TRUE if successful
Implements SoGLRenderToBuffer.
void SoPBuffer::disable | ( | ) | [virtual] |
Disable render to buffer Returns TRUE if successful.
Implements SoGLRenderToBuffer.
SoGLGraphicConfigTemplate* SoPBuffer::getGraphicConfigTemplate | ( | ) | [virtual] |
Gets the current graphics configuration template.
Reimplemented from SoGLRenderToBuffer.
int SoPBuffer::getPixelFormat | ( | ) | [virtual] |
Returns the current pixel format.
This method allow an application to query a pixel format that has extended attributes that can't be specified in a PFD struct.
Reimplemented from SoGLRenderToBuffer.
SbVec2s SoPBuffer::getSize | ( | ) | const [virtual] |
Gets current size as an SbVec2s.
Implements SoGLRenderToBuffer.
const SbVec2i32& SoPBuffer::getSize_i32 | ( | ) | const [virtual] |
Gets current size as an SbVec2i32.
Implements SoGLRenderToBuffer.
static SbBool SoPBuffer::isAvailable | ( | SbGlContextHelper::Display | display = NULL |
) | [static] |
Queries if Pbuffers are available on this system (on the specified display connection if this is a UNIX system).
There is no guarantee it is possible to create a Pbuffer (depends on requested size, available memory, etc).
Reimplemented from SoGLRenderToBuffer.
SbBool SoPBuffer::makeCurrent | ( | ) | [virtual] |
Makes Pbuffer current for OpenGL rendering.
Returns TRUE if successful
Implements SoGLRenderToBuffer.
Releases the Pbuffer from the current texture object.
Required before rendering again. If bindDepth is set to TRUE, releases the depth buffer instead of the color buffer
Implements SoGLRenderToBuffer.
Resizes Pbuffer.
For sizes greater than 32767. Returns TRUE if successful
Implements SoGLRenderToBuffer.
SbBool SoPBuffer::selectCubeMapFace | ( | CubeMapTextureFace | face | ) | [virtual] |
Selects the face to be used when the rendering target is a cube map.
Implements SoGLRenderToBuffer.
void SoPBuffer::setGraphicConfigTemplate | ( | SoGLGraphicConfigTemplate * | gTemplate | ) | [virtual] |
Sets a new graphics configuration template.
Reimplemented from SoGLRenderToBuffer.
void SoPBuffer::setPixelFormat | ( | int | format | ) | [virtual] |
Sets the current pixel format.
This method allows an application to set a pixel format that has extended attributes that can't be specified in a PFD struct. The specified format must support OpenGL and drawing to a pbuffer.
Reimplemented from SoGLRenderToBuffer.
void SoPBuffer::setRenderToTexture | ( | SbBool | enable, | |
TextureFormat | format = TEXTURE_RGB , |
|||
TextureTarget | target = TEXTURE_2D , |
|||
SbBool | autoMipmap = FALSE , |
|||
SbBool | hasDepth = FALSE | |||
) |
Specifies settings for the Pbuffer creation.
Indicates if it must be created to be compliant with rendering to texture and also sets texture attributes.
void SoPBuffer::shareCurrentContext | ( | ) |
Share OpenGL object with the current context.
Reimplemented from SoGLRenderToBuffer.