ColorMaski
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSG_COLORMASKI
#define OSG_COLORMASKI 1
#include <osg/ColorMask>
namespace osg {
class OSG_EXPORT ColorMaski : public ColorMask
{
public :
ColorMaski();
ColorMaski(unsigned int buf, bool red, bool green, bool blue, bool alpha):
ColorMask(red, green,blue,alpha),
_index(buf) {}
ColorMaski(const ColorMaski& cm,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
ColorMask(cm,copyop),
_index(cm._index) {}
META_StateAttribute(osg, ColorMaski, COLORMASK);
virtual int compare(const StateAttribute& sa) const
{
// Check for equal types, then create the rhs variable
// used by the COMPARE_StateAttribute_Parameter macros below.
COMPARE_StateAttribute_Types(ColorMaski,sa)
COMPARE_StateAttribute_Parameter(_index);
return ColorMask::compare(sa);
}
virtual unsigned int getMember() const { return _index; }
void setIndex(unsigned int buf);
unsigned int getIndex() const { return _index; }
virtual void apply(State& state) const;
protected:
virtual ~ColorMaski();
unsigned int _index;
};
}
#endif
ColorMask
COMPARE_StateAttribute_Parameter
#define COMPARE_StateAttribute_Parameter(parameter)
Definition StateAttribute:69
COMPARE_StateAttribute_Types
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
Definition StateAttribute:57
osg::ColorMask::ColorMask
ColorMask()
osg::ColorMask::compare
virtual int compare(const StateAttribute &sa) const
Definition ColorMask:49
osg::ColorMaski::~ColorMaski
virtual ~ColorMaski()
osg::ColorMaski::META_StateAttribute
META_StateAttribute(osg, ColorMaski, COLORMASK)
osg::ColorMaski::getIndex
unsigned int getIndex() const
Definition ColorMaski:59
osg::ColorMaski::setIndex
void setIndex(unsigned int buf)
osg::ColorMaski::apply
virtual void apply(State &state) const
osg::ColorMaski::ColorMaski
ColorMaski()
osg::ColorMaski::ColorMaski
ColorMaski(unsigned int buf, bool red, bool green, bool blue, bool alpha)
Definition ColorMaski:29
osg::ColorMaski::ColorMaski
ColorMaski(const ColorMaski &cm, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition ColorMaski:34
osg::ColorMaski::_index
unsigned int _index
Definition ColorMaski:67
osg::ColorMaski::compare
virtual int compare(const StateAttribute &sa) const
Definition ColorMaski:41
osg::ColorMaski::getMember
virtual unsigned int getMember() const
Definition ColorMaski:53
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::StateAttribute
Definition StateAttribute:77
osg::StateAttribute::COLORMASK
@ COLORMASK
Definition StateAttribute:153
osg::State
Definition State:80
osg
Definition AlphaFunc:19
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39