The Vish Visualization Shell 0.3
Vish
DynamicBackground.cpp

A not very useful implementation of a time-dependent homogeneous background.

A not very useful implementation of a time-dependent homogeneous background.

#include <ocean/GLvish/VGLRenderObject.hpp>
#include <ocean/shrimp/VTime.hpp>
#include <ocean/plankton/VPipeline.hpp>
using namespace Wizt;
namespace
{
class DynamicBackground : public VGLRenderObject
{
RefPtr<VSlot> Red, Green, Blue;
bool renderGL(VGLRenderContext&Context) const override
{
VTime t;
getParameterValue(t, "time", Context);
GLclampf red=1, green=1, blue=1, alpha=1;
int r=100, g=100, b=100;
Red << Context >> r;
Green << Context >> g;
Blue << Context >> b;
red = r/100. - t();
green = g/100. + t();
blue = b/100.;
glClearColor( red,
green,
blue,
alpha );
glClear(GL_COLOR_BUFFER_BIT);
return true;
}
public:
DynamicBackground (const string&name, int p, const RefPtr<VCreationPreferences>&VP)
{
addParam("time", VTime(0) );//->LocalizeVariable();
Blue = addParam("blue" , 53, new VCreationPreferences("local") );
Green = addParam("green", 65, new VCreationPreferences("local") );
Red = addParam("red" , 65, new VCreationPreferences("local") );
}
};
}
namespace
{
using namespace Panthalassa;
MyCreator( Category( "Backgrounds" ) + VIdentifier( "DynamicBackground" ) + Application( "General" ) +
Description( "Display a background dependent on mouse interaction." ) +
Help( "todo" ),
}
A set of variable names, with indices associated to each type.
Definition Context.hpp:18
A certain object (especcially input types) might have multiple implementations by the GUI or alternat...
Definition VCreationPreferences.hpp:24
Base class for objects that implement a drawing routine using OpenGL.
Definition VGLRenderObject.hpp:20
An input type for steering time-dependent objects.
Definition shrimp/VTime.hpp:32
StrongPtr< Object, ObjectBase > RefPtr
Convenience template typedef to use RefPtr instead of StrongPtr.
Definition RefPtr.hpp:776
The Panthalassa namespace allows to conveniently specify the properties of a VCreator object during c...
Definition VCreatorProperties.hpp:385
Wizt::VCreatorProperty< Wizt::VCreatorProperties::APPLICATION > Application
application domain(s), separated by ApplicationsSeparator
Definition VCreatorProperties.hpp:408
Wizt::VCreatorProperty< Wizt::VCreatorProperties::DESCRIPTION > Description
Possibly complex description via UTF8 codes.
Definition VCreatorProperties.hpp:396
Wizt::VCreatorProperty< Wizt::VCreatorProperties::SHORTHELP > Help
Short help text, to be used for GUI tooltips, for instance.
Definition VCreatorProperties.hpp:393
Wizt::VCreatorProperty< Wizt::VCreatorProperties::CATEGORY > Category
Classification, such as Display or Computer or Demo.
Definition VCreatorProperties.hpp:390
The Vish namespace.
Definition Anemone.cpp:17
@ BACKGROUND_OBJECT
Background objects are fixed with respect to the viewer.
Definition RenderCategory.hpp:25
@ DEMO
This object is only for demonstration purposes, but not necessarily providing enduser functionality.
Definition ObjectQuality.hpp:34
A special vish context that is passed to VGLRenderObjects when rendering.
Definition VGLRenderContext.hpp:35
Implements a data sink.
Definition VPipeline.hpp:73