VISH  0.2
MonochromeBackground.cpp

A very simplistic implementation of a homogeneous background.

#include <ocean/plankton/VCreator.hpp>
#include <ocean/shrimp/ColorTypes.hpp>
#include <ocean/GLvish/VGLRenderObject.hpp>


using namespace Wizt;

namespace
{

class   MonochromeBackground : public VGLRenderObject
{
        TypedSlot<Color>        theColor;

        override void render(VGLRenderContext&Context) const
        {
        Color   rgb(.3, .3, .4);

                theColor << Context >> rgb;

                glClearColor( rgb[0], rgb[1],  rgb[2], 1.0 );

                glClear(GL_COLOR_BUFFER_BIT);
        }

public:
        MonochromeBackground(const string&name, int, const RefPtr<VCreationPreferences>&VP)
        : VGLRenderObject(name, BACKGROUND_OBJECT, VP)
        , theColor(this, "color", Color(.3, .3, .4, 1.0) )
        {
                theColor  ->Localize();
        }
};

static  Ref<VCreator<MonochromeBackground> > myBackground("Backgrounds/Monochrome", ObjectQuality::MATURE);

}