VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtGlRenderTexture Class Reference

A helper classes for creating a RTT target, optionally including depth buffer. More...

Public Member Functions

 DtGlRenderTexture (const std::string &name, int width, int height, int samples=0, int layers=1, bool useMultiView=false)
 create a RTT with a given name, with a given height and width if number of samples is greater than 0 then it will use a multisample render buffer More...
 
virtual ~DtGlRenderTexture ()
 DTOR. More...
 
virtual bool init (DtGlImageType colorFormat=RGB32F, GLenum minFilter=GL_LINEAR, GLenum wrapMode=GL_CLAMP_TO_EDGE)
 initialize the RTT with a texture format and sampling/wrapping hints More...
 
virtual bool init (unsigned int glColorTexId)
 Initialize the RTT color from an existing OpenGL Texture. More...
 
virtual bool initDepth (DtGlImageType depthFormat=D32)
 Optionally create a depth texture to go with the RTT that is bound when drawing into. More...
 
virtual bool initDepth (unsigned int glDepthTexId)
 Initialize depth texture from an existing OpenGL texture. More...
 
virtual void activateForDrawingInto (bool shouldClear=true, bool setViewport=true)
 activate this RTT for drawing into. Binds the internal FBO and color/depth targets More...
 
virtual void copyFromFramebuffer (unsigned int srcFbo, unsigned int bufferBits)
 copy the framebuffer specified by srcFbo into the textures in this object. More...
 
virtual void copyFromTexture (unsigned int srcTexture, bool isDepth, bool isArray=false, unsigned int srclayer=0, unsigned int layerCount=1)
 copy the srcTexture into our color texture or depth texture if isDepth is true. More...
 
virtual void deactivateForDrawingInto ()
 deactivates the RTT More...
 
virtual void bindColorTexture (int unit)
 bind the color texture to a given texture unit for use as a source texture for rendering More...
 
virtual void bindDepthTexture (int unit)
 bind the depth texture, if it exists, to a given texture unit for use as a source for rendering More...
 
virtual void unbindColorTexture (int unit)
 unbind the color texture (set the currently bound texture to 0 for the specified unit More...
 
virtual void unbindDepthTexture (int unit)
 unbind the depth texture (set the currently bound texture to 0 for the specified unit More...
 
virtual int width () const
 returns width of the RTT More...
 
virtual int height () const
 returns height of the RTT More...
 
virtual int layers () const
 returns layers of the RTT More...
 
virtual unsigned int colorId () const
 returns the OpenGL texture id of the color texture. Must be initialized first otherwise it will return 0. More...
 
virtual unsigned int depthId () const
 returns the OpenGL texture id of the depth texture. Must be initialized first otherwise it will return 0. More...
 
virtual int numSamples () const
 returns the number of multi samples to use with this render to texture More...
 
virtual bool useMultiView () const
 return weather or not multiview is being used More...
 
virtual bool usingStencil () const
 return true if there's a depth texture and it's using a packed stencil format More...
 
virtual void setDeleteFbosOnDestruction (bool val)
 
virtual bool deleteFbosOnDestruction (void) const
 
virtual unsigned int fbo (void) const
 
virtual unsigned int multiSampleFbo (void) const
 

Protected Member Functions

virtual void initFBO (const std::string &name)
 
virtual GLenum getGLInternalTypes (DtGlImageType colorType)
 

Protected Attributes

unsigned int myFboId
 
unsigned int myMultisampleFboId
 
unsigned int myMultisampleColorBuffer
 
unsigned int myMultisampleDepthBuffer
 
bool myDeleteFbosOnDestruction
 
int myWidth
 
int myHeight
 
int myLayers
 
bool myHasDepth
 
bool myIsFrameBufferValid
 
bool myUseMultiView
 
DtGlTexturemyColorTexture
 
DtGlTexturemyDepthTexture
 
std::string myName
 
int myNumSamples
 

Private Member Functions

 DtGlRenderTexture ()
 private default constructor More...
 
 DtGlRenderTexture (const DtGlRenderTexture &)
 prevent copy-construction More...
 
DtGlRenderTextureoperator= (const DtGlRenderTexture &)
 prevent assignment More...
 

Detailed Description

A helper classes for creating a RTT target, optionally including depth buffer.

Constructor & Destructor Documentation

makVrv::DtGlRenderTexture::DtGlRenderTexture ( )
private

private default constructor

makVrv::DtGlRenderTexture::DtGlRenderTexture ( const DtGlRenderTexture )
private

prevent copy-construction

makVrv::DtGlRenderTexture::DtGlRenderTexture ( const std::string &  name,
int  width,
int  height,
int  samples = 0,
int  layers = 1,
bool  useMultiView = false 
)

create a RTT with a given name, with a given height and width if number of samples is greater than 0 then it will use a multisample render buffer

virtual makVrv::DtGlRenderTexture::~DtGlRenderTexture ( )
virtual

DTOR.

Member Function Documentation

DtGlRenderTexture& makVrv::DtGlRenderTexture::operator= ( const DtGlRenderTexture )
private

prevent assignment

virtual bool makVrv::DtGlRenderTexture::init ( DtGlImageType  colorFormat = RGB32F,
GLenum  minFilter = GL_LINEAR,
GLenum  wrapMode = GL_CLAMP_TO_EDGE 
)
virtual

initialize the RTT with a texture format and sampling/wrapping hints

virtual bool makVrv::DtGlRenderTexture::init ( unsigned int  glColorTexId)
virtual

Initialize the RTT color from an existing OpenGL Texture.

Assumes the texture sampling and wrapping hints have already been setup. If DtGlRenderTexture was created with multiple samples, this texture needs to match.

virtual bool makVrv::DtGlRenderTexture::initDepth ( DtGlImageType  depthFormat = D32)
virtual

Optionally create a depth texture to go with the RTT that is bound when drawing into.

virtual bool makVrv::DtGlRenderTexture::initDepth ( unsigned int  glDepthTexId)
virtual

Initialize depth texture from an existing OpenGL texture.

Assumes the texture sampling and wrapping hints have already been setup.

virtual void makVrv::DtGlRenderTexture::activateForDrawingInto ( bool  shouldClear = true,
bool  setViewport = true 
)
virtual

activate this RTT for drawing into. Binds the internal FBO and color/depth targets

virtual void makVrv::DtGlRenderTexture::copyFromFramebuffer ( unsigned int  srcFbo,
unsigned int  bufferBits 
)
virtual

copy the framebuffer specified by srcFbo into the textures in this object.

buffer bits are the GL mask of which buffers to copy (GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT for example)

virtual void makVrv::DtGlRenderTexture::copyFromTexture ( unsigned int  srcTexture,
bool  isDepth,
bool  isArray = false,
unsigned int  srclayer = 0,
unsigned int  layerCount = 1 
)
virtual

copy the srcTexture into our color texture or depth texture if isDepth is true.

virtual void makVrv::DtGlRenderTexture::deactivateForDrawingInto ( )
virtual

deactivates the RTT

virtual void makVrv::DtGlRenderTexture::bindColorTexture ( int  unit)
virtual

bind the color texture to a given texture unit for use as a source texture for rendering

virtual void makVrv::DtGlRenderTexture::bindDepthTexture ( int  unit)
virtual

bind the depth texture, if it exists, to a given texture unit for use as a source for rendering

virtual void makVrv::DtGlRenderTexture::unbindColorTexture ( int  unit)
virtual

unbind the color texture (set the currently bound texture to 0 for the specified unit

virtual void makVrv::DtGlRenderTexture::unbindDepthTexture ( int  unit)
virtual

unbind the depth texture (set the currently bound texture to 0 for the specified unit

virtual int makVrv::DtGlRenderTexture::width ( ) const
virtual

returns width of the RTT

virtual int makVrv::DtGlRenderTexture::height ( ) const
virtual

returns height of the RTT

virtual int makVrv::DtGlRenderTexture::layers ( ) const
virtual

returns layers of the RTT

virtual unsigned int makVrv::DtGlRenderTexture::colorId ( ) const
virtual

returns the OpenGL texture id of the color texture. Must be initialized first otherwise it will return 0.

virtual unsigned int makVrv::DtGlRenderTexture::depthId ( ) const
virtual

returns the OpenGL texture id of the depth texture. Must be initialized first otherwise it will return 0.

virtual int makVrv::DtGlRenderTexture::numSamples ( ) const
virtual

returns the number of multi samples to use with this render to texture

virtual bool makVrv::DtGlRenderTexture::useMultiView ( ) const
virtual

return weather or not multiview is being used

virtual bool makVrv::DtGlRenderTexture::usingStencil ( ) const
virtual

return true if there's a depth texture and it's using a packed stencil format

virtual void makVrv::DtGlRenderTexture::setDeleteFbosOnDestruction ( bool  val)
virtual
virtual bool makVrv::DtGlRenderTexture::deleteFbosOnDestruction ( void  ) const
virtual
virtual unsigned int makVrv::DtGlRenderTexture::fbo ( void  ) const
virtual
virtual unsigned int makVrv::DtGlRenderTexture::multiSampleFbo ( void  ) const
virtual
virtual void makVrv::DtGlRenderTexture::initFBO ( const std::string &  name)
protectedvirtual
virtual GLenum makVrv::DtGlRenderTexture::getGLInternalTypes ( DtGlImageType  colorType)
protectedvirtual

Member Data Documentation

unsigned int makVrv::DtGlRenderTexture::myFboId
protected
unsigned int makVrv::DtGlRenderTexture::myMultisampleFboId
protected
unsigned int makVrv::DtGlRenderTexture::myMultisampleColorBuffer
protected
unsigned int makVrv::DtGlRenderTexture::myMultisampleDepthBuffer
protected
bool makVrv::DtGlRenderTexture::myDeleteFbosOnDestruction
protected
int makVrv::DtGlRenderTexture::myWidth
protected
int makVrv::DtGlRenderTexture::myHeight
protected
int makVrv::DtGlRenderTexture::myLayers
protected
bool makVrv::DtGlRenderTexture::myHasDepth
protected
bool makVrv::DtGlRenderTexture::myIsFrameBufferValid
protected
bool makVrv::DtGlRenderTexture::myUseMultiView
protected
DtGlTexture* makVrv::DtGlRenderTexture::myColorTexture
protected
DtGlTexture* makVrv::DtGlRenderTexture::myDepthTexture
protected
std::string makVrv::DtGlRenderTexture::myName
protected
int makVrv::DtGlRenderTexture::myNumSamples
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)