Capability
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_ENABLEI
#define OSG_ENABLEI 1
#include <osg/GL>
#include <osg/StateAttribute>
namespace osg {
class OSG_EXPORT Capability : public osg::StateAttribute
{
public :
Capability();
Capability(GLenum capability):
_capability(capability) {}
Capability(const Capability& cap,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
StateAttribute(cap, copyop),
_capability(cap._capability) {}
META_Object(osg, Capability);
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(Capability,sa)
COMPARE_StateAttribute_Parameter(_capability);
return 0;
}
virtual Type getType() const { return static_cast<Type>(CAPABILITY+_capability); }
void setCapability(GLenum capability) { _capability = capability; }
GLenum getCapability() const { return _capability; }
protected:
virtual ~Capability();
GLenum _capability;
};
class OSG_EXPORT Capabilityi : public osg::Capability
{
public :
Capabilityi();
Capabilityi(GLenum capability, unsigned int buf):
Capability(capability),
_index(buf) {}
Capabilityi(const Capabilityi& cap,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Capability(cap,copyop),
_index(cap._index) {}
META_Object(osg, Capabilityi);
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(Capabilityi,sa)
COMPARE_StateAttribute_Parameter(_index);
COMPARE_StateAttribute_Parameter(_capability);
return 0;
}
virtual unsigned int getMember() const { return _index; }
void setIndex(unsigned int buf) { _index = buf; }
unsigned int getIndex() const { return _index; }
protected:
virtual ~Capabilityi();
unsigned int _index;
};
class OSG_EXPORT Enablei : public Capabilityi
{
public :
Enablei() {}
Enablei(unsigned int buf, GLenum capability):
Capabilityi(buf, capability) {}
Enablei(const Enablei& ei,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Capabilityi(ei,copyop) {}
META_Object(osg, Enablei);
virtual void apply(State&) const;
protected:
virtual ~Enablei() {}
};
class OSG_EXPORT Disablei : public Capabilityi
{
public :
Disablei() {}
Disablei(unsigned int buf, GLenum capability):
Capabilityi(buf, capability) {}
Disablei(const Disablei& ei,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Capabilityi(ei,copyop) {}
META_Object(osg, Disablei);
virtual void apply(State&) const;
protected:
virtual ~Disablei() {}
};
}
#endif
StateAttribute
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::Capability
Definition Capability:23
osg::Capability::META_Object
META_Object(osg, Capability)
osg::Capability::Capability
Capability()
osg::Capability::compare
virtual int compare(const StateAttribute &sa) const
Definition Capability:39
osg::Capability::Capability
Capability(GLenum capability)
Definition Capability:28
osg::Capability::Capability
Capability(const Capability &cap, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition Capability:32
osg::Capability::getCapability
GLenum getCapability() const
Definition Capability:55
osg::Capability::_capability
GLenum _capability
Definition Capability:61
osg::Capability::getType
virtual Type getType() const
Definition Capability:51
osg::Capability::~Capability
virtual ~Capability()
osg::Capability::setCapability
void setCapability(GLenum capability)
Definition Capability:53
osg::Capabilityi::META_Object
META_Object(osg, Capabilityi)
osg::Capabilityi::~Capabilityi
virtual ~Capabilityi()
osg::Capabilityi::Capabilityi
Capabilityi()
osg::Capabilityi::_index
unsigned int _index
Definition Capability:110
osg::Capabilityi::getMember
virtual unsigned int getMember() const
Definition Capability:98
osg::Capabilityi::compare
virtual int compare(const StateAttribute &sa) const
Definition Capability:85
osg::Capabilityi::getIndex
unsigned int getIndex() const
Definition Capability:104
osg::Capabilityi::Capabilityi
Capabilityi(const Capabilityi &cap, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition Capability:78
osg::Capabilityi::Capabilityi
Capabilityi(GLenum capability, unsigned int buf)
Definition Capability:73
osg::Capabilityi::setIndex
void setIndex(unsigned int buf)
Definition Capability:101
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::Disablei::Disablei
Disablei(unsigned int buf, GLenum capability)
Definition Capability:143
osg::Disablei::~Disablei
virtual ~Disablei()
Definition Capability:156
osg::Disablei::META_Object
META_Object(osg, Disablei)
osg::Disablei::apply
virtual void apply(State &) const
osg::Disablei::Disablei
Disablei()
Definition Capability:141
osg::Disablei::Disablei
Disablei(const Disablei &ei, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition Capability:147
osg::Enablei::~Enablei
virtual ~Enablei()
Definition Capability:133
osg::Enablei::Enablei
Enablei()
Definition Capability:118
osg::Enablei::Enablei
Enablei(const Enablei &ei, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition Capability:124
osg::Enablei::Enablei
Enablei(unsigned int buf, GLenum capability)
Definition Capability:120
osg::Enablei::apply
virtual void apply(State &) const
osg::Enablei::META_Object
META_Object(osg, Enablei)
osg::StateAttribute
Definition StateAttribute:77
osg::StateAttribute::StateAttribute
StateAttribute()
osg::StateAttribute::Type
Type
Definition StateAttribute:124
osg::StateAttribute::CAPABILITY
@ CAPABILITY
Definition StateAttribute:214
osg::State
Definition State:80
osg
Definition AlphaFunc:19
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39