gramods
Classes | Public Member Functions | Static Public Attributes | List of all members
gramods::gmGraphics::ViewTexture Class Reference

The ViewTexture is a View implements the TextureInterface to provide a texture of what is drawn by another view. More...

#include <ViewTexture.hh>

Inheritance diagram for gramods::gmGraphics::ViewTexture:
Inheritance graph
[legend]
Collaboration diagram for gramods::gmGraphics::ViewTexture:
Collaboration graph
[legend]

Classes

struct  Impl
 

Public Member Functions

void renderFullPipeline (ViewSettings settings) override
 Forwards rendering to the sub view and saves the result. More...
 
void traverse (Visitor *visitor) override
 Propagates the specified visitor. More...
 
void setResolution (gmCore::size2 res)
 Sets the resolution to render sub views at, regarless of resolution of the parent. More...
 
void setUseFloat (bool on)
 Set to true if the texture should be floating point format. More...
 
bool getUseFloat ()
 Returns true iff the texture is in floating point format, false otherwise. More...
 
void setUseAlpha (bool on)
 Set to true if the texture should have an alpha channel. More...
 
bool getUseAlpha ()
 Returns true iff the texture should have an alpha channel. More...
 
void addView (std::shared_ptr< View > view)
 Adds a view to render to this texture. More...
 
GLuint updateTexture (size_t frame_number, Eye eye) override
 Updates the texture and returns the ID of the associated GL texture object. More...
 
virtual std::string getDefaultKey () override
 Returns the default key, in Configuration, for the Object. More...
 
- Public Member Functions inherited from gramods::gmGraphics::ViewBase
void addNode (std::shared_ptr< Node > node)
 Adds a scenegraph to the view. More...
 
void setViewpoint (std::shared_ptr< Viewpoint > viewpoint)
 Sets the viewpoint to use in the views rendered by this ViewBase. More...
 
void addViewpoint (std::shared_ptr< Viewpoint > viewpoint)
 Adds a viewpoint to use in the views rendered by this ViewBase. More...
 
- Public Member Functions inherited from gramods::gmCore::Object
 Object ()
 Initializes internal data. More...
 
virtual ~Object ()
 Cleaning up internal data. More...
 
virtual void initialize ()
 Called to initialize the Object. More...
 
virtual void accept (Visitor *visitor)
 Calls the visitors apply method with this as argument. More...
 
bool isInitialized ()
 Returns true if the Object is initialized. More...
 

Static Public Attributes

static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 
- Static Public Attributes inherited from gramods::gmGraphics::View
static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 
- Static Public Attributes inherited from gramods::gmGraphics::ViewBase
static gramods::gmCore::OFactory::OFactoryInformation _gm_ofi
 

Additional Inherited Members

- Protected Member Functions inherited from gramods::gmGraphics::ViewBase
void populateViewSettings (ViewSettings &settings)
 Adds the dispatcher's local renderers and viewpoint, if set. More...
 
- Protected Attributes inherited from gramods::gmGraphics::ViewBase
Node::list nodes
 
std::vector< std::shared_ptr< Viewpoint > > viewpoints
 

Detailed Description

The ViewTexture is a View implements the TextureInterface to provide a texture of what is drawn by another view.

As with any other hierarchy of views or renderers, cyclic graph are not allowed, e.g. to let a ViewTexture create a texture of the view containing the renderer using this texture.

Member Function Documentation

◆ addView()

void gramods::gmGraphics::ViewTexture::addView ( std::shared_ptr< View view)

Adds a view to render to this texture.

XML-attribute: view

◆ getDefaultKey()

virtual std::string gramods::gmGraphics::ViewTexture::getDefaultKey ( )
inlineoverridevirtual

Returns the default key, in Configuration, for the Object.

Reimplemented from gramods::gmGraphics::View.

◆ getUseAlpha()

bool gramods::gmGraphics::ViewTexture::getUseAlpha ( )

Returns true iff the texture should have an alpha channel.

◆ getUseFloat()

bool gramods::gmGraphics::ViewTexture::getUseFloat ( )

Returns true iff the texture is in floating point format, false otherwise.

◆ renderFullPipeline()

void gramods::gmGraphics::ViewTexture::renderFullPipeline ( ViewSettings  settings)
overridevirtual

Forwards rendering to the sub view and saves the result.

Reimplemented from gramods::gmGraphics::ViewBase.

◆ setResolution()

void gramods::gmGraphics::ViewTexture::setResolution ( gmCore::size2  res)

Sets the resolution to render sub views at, regarless of resolution of the parent.

Default is 1024x1024.

XML-attribute: resolution

◆ setUseAlpha()

void gramods::gmGraphics::ViewTexture::setUseAlpha ( bool  on)

Set to true if the texture should have an alpha channel.

Default is true.

◆ setUseFloat()

void gramods::gmGraphics::ViewTexture::setUseFloat ( bool  on)

Set to true if the texture should be floating point format.

Default is off.

◆ traverse()

void gramods::gmGraphics::ViewTexture::traverse ( Visitor visitor)
overridevirtual

Propagates the specified visitor.

See also
Object::Visitor

Reimplemented from gramods::gmGraphics::ViewBase.

◆ updateTexture()

GLuint gramods::gmGraphics::ViewTexture::updateTexture ( size_t  frame_number,
Eye  eye 
)
overridevirtual

Updates the texture and returns the ID of the associated GL texture object.

Must be called with GL context. Observe also that this method may perform off-screen rendering.

Parameters
frame_numberThe current frame being rendered. This number should increment by one for each frame, however it may wrap around and start over at zero.
eyeEye for which the texture is requested. An implementation may use different textures for different eyes or may reuse the same texture for all eyes.
Returns
OpenGL texture ID of the updated texture

Implements gramods::gmGraphics::TextureInterface.


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