gramods
|
The ViewTexture is a View implements the TextureInterface to provide a texture of what is drawn by another view. More...
#include <ViewTexture.hh>
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... | |
![]() | |
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... | |
![]() | |
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 gramods::gmCore::OFactory::OFactoryInformation | _gm_ofi |
![]() | |
static gramods::gmCore::OFactory::OFactoryInformation | _gm_ofi |
Additional Inherited Members | |
![]() | |
void | populateViewSettings (ViewSettings &settings) |
Adds the dispatcher's local renderers and viewpoint, if set. More... | |
![]() | |
Node::list | nodes |
std::vector< std::shared_ptr< Viewpoint > > | viewpoints |
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.
void gramods::gmGraphics::ViewTexture::addView | ( | std::shared_ptr< View > | view | ) |
Adds a view to render to this texture.
XML-attribute: view
|
inlineoverridevirtual |
Returns the default key, in Configuration, for the Object.
Reimplemented from gramods::gmGraphics::View.
bool gramods::gmGraphics::ViewTexture::getUseAlpha | ( | ) |
Returns true iff the texture should have an alpha channel.
bool gramods::gmGraphics::ViewTexture::getUseFloat | ( | ) |
Returns true iff the texture is in floating point format, false otherwise.
|
overridevirtual |
Forwards rendering to the sub view and saves the result.
Reimplemented from gramods::gmGraphics::ViewBase.
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
void gramods::gmGraphics::ViewTexture::setUseAlpha | ( | bool | on | ) |
Set to true if the texture should have an alpha channel.
Default is true.
void gramods::gmGraphics::ViewTexture::setUseFloat | ( | bool | on | ) |
Set to true if the texture should be floating point format.
Default is off.
|
overridevirtual |
Propagates the specified visitor.
Reimplemented from gramods::gmGraphics::ViewBase.
|
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.
frame_number | The current frame being rendered. This number should increment by one for each frame, however it may wrap around and start over at zero. |
eye | Eye for which the texture is requested. An implementation may use different textures for different eyes or may reuse the same texture for all eyes. |
Implements gramods::gmGraphics::TextureInterface.