VISH
0.2
|
A very simplistic implementation of a homogeneous background.
#include <ocean/plankton/VCreator.hpp> #include <ocean/GLvish/VGLRenderObject.hpp> using namespace Wizt; namespace { class DefaultBackground : public VGLRenderObject { TypedSlot<double> Red, Green, Blue; override void render(VGLRenderContext&Context) const { double red = .5, green = .5, blue = .5, alpha=1; Red << Context >> red; Green << Context >> green; Blue << Context >> blue; glClearColor( red, green, blue, alpha ); glClear(GL_COLOR_BUFFER_BIT); } public: DefaultBackground(const string&name, int, const RefPtr<VCreationPreferences>&VP) : VGLRenderObject(name, BACKGROUND_OBJECT, VP) , Red (this, "red" , .55) , Green(this, "green", .55) , Blue (this, "blue" , .5 ) { Red ->Localize(); Green->Localize(); Blue ->Localize(); } }; static Ref<VCreator<DefaultBackground> > myBackground("Backgrounds/Background", ObjectQuality::MATURE); }