opensurgsim
Public Types | Public Member Functions | List of all members
SurgSim::Graphics::OsgRenderTarget< T > Class Template Reference

Specific implementation of the render target class. More...

#include <OsgRenderTarget.h>

Inheritance diagram for SurgSim::Graphics::OsgRenderTarget< T >:
SurgSim::Graphics::OsgAbstractRenderTarget SurgSim::Graphics::RenderTarget

Public Types

typedef T TextureType
 The internal type of the texture, not exposed in the public interface.
 

Public Member Functions

 OsgRenderTarget ()
 Default constructor.
 
 OsgRenderTarget (int width, int height, double scale=1.0, int colorCount=0, bool useDepth=false, bool useFloat=false)
 Constructor set all the parameters for the render target. More...
 
 ~OsgRenderTarget ()
 Destructor.
 
void getSize (int *width, int *height) const override
 Gets a size. More...
 
int getColorTargetCount () const override
 
std::shared_ptr< TexturegetColorTarget (int index) const override
 Generic accessor for a specific color target texture. More...
 
std::shared_ptr< OsgTexturegetColorTargetOsg (int index) const
 Accessor for the color target as an OsgTexture. More...
 
bool doesUseDepthTarget () const override
 Determines if RenderTarget does use a depth target. More...
 
std::shared_ptr< TexturegetDepthTarget () const override
 Generic accessor for the depth Target. More...
 
std::shared_ptr< OsgTexturegetDepthTargetOsg () const
 Accessor for the depth target as an OsgTexture. More...
 
- Public Member Functions inherited from SurgSim::Graphics::RenderTarget
 RenderTarget ()
 Constructor.
 

Detailed Description

template<class T>
class SurgSim::Graphics::OsgRenderTarget< T >

Specific implementation of the render target class.

It is templated so different texture formats can be chosen.

Template Parameters
TType of the texture that should be used as targets probably either OsgTexture2d or OsgTextureRectangle.

Constructor & Destructor Documentation

§ OsgRenderTarget()

template<class T >
SurgSim::Graphics::OsgRenderTarget< T >::OsgRenderTarget ( int  width,
int  height,
double  scale = 1.0,
int  colorCount = 0,
bool  useDepth = false,
bool  useFloat = false 
)

Constructor set all the parameters for the render target.

Parameters
width,heightThe width and height of the target textures.
scale(Optional) the scale, scales width and height by this factor.
colorCount(Optional) number of color textures to use.
useDepth(Optional) whether to use a depth texture.
useFloat(Optional) whether to use float color buffers

Member Function Documentation

§ doesUseDepthTarget()

template<class T >
bool SurgSim::Graphics::OsgRenderTarget< T >::doesUseDepthTarget ( ) const
overridevirtual

Determines if RenderTarget does use a depth target.

Returns
true if it does.

Implements SurgSim::Graphics::RenderTarget.

§ getColorTarget()

template<class T >
std::shared_ptr< Texture > SurgSim::Graphics::OsgRenderTarget< T >::getColorTarget ( int  index) const
overridevirtual

Generic accessor for a specific color target texture.

Parameters
indexZero-based index of the texture.
Returns
The actual Texture.

Implements SurgSim::Graphics::RenderTarget.

§ getColorTargetCount()

template<class T >
int SurgSim::Graphics::OsgRenderTarget< T >::getColorTargetCount ( ) const
overridevirtual
Returns
The number of color targets that are available.

Implements SurgSim::Graphics::RenderTarget.

§ getColorTargetOsg()

template<class T >
std::shared_ptr< OsgTexture > SurgSim::Graphics::OsgRenderTarget< T >::getColorTargetOsg ( int  index) const
virtual

Accessor for the color target as an OsgTexture.

Parameters
indexZero-based index of the color texture.
Returns
The color target as an osg specific class.

Implements SurgSim::Graphics::OsgAbstractRenderTarget.

§ getDepthTarget()

template<class T >
std::shared_ptr< Texture > SurgSim::Graphics::OsgRenderTarget< T >::getDepthTarget ( ) const
overridevirtual

Generic accessor for the depth Target.

Returns
The depth target.

Implements SurgSim::Graphics::RenderTarget.

§ getDepthTargetOsg()

template<class T >
std::shared_ptr< OsgTexture > SurgSim::Graphics::OsgRenderTarget< T >::getDepthTargetOsg ( ) const
virtual

Accessor for the depth target as an OsgTexture.

Returns
The depth target as an osg specific class.

Implements SurgSim::Graphics::OsgAbstractRenderTarget.

§ getSize()

template<class T >
void SurgSim::Graphics::OsgRenderTarget< T >::getSize ( int *  width,
int *  height 
) const
overridevirtual

Gets a size.

Parameters
[out]width,heightThe width and height of the RenderTarget textures.

Implements SurgSim::Graphics::RenderTarget.


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