/usr/include/osg/Capability is in libopenscenegraph-3.4-dev 3.4.1+dfsg1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | /* -*-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) {}
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Capability(const Capability& cap,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
StateAttribute(cap, copyop),
_capability(cap._capability) {}
META_Object(osg, Capability);
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
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;
}
/** Return the Type identifier of the attribute's class type.*/
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;
};
/** Encapsulates glEnablei/glDisablei
*/
class OSG_EXPORT Capabilityi : public osg::Capability
{
public :
Capabilityi();
Capabilityi(GLenum capability, unsigned int buf):
Capability(capability),
_index(buf) {}
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Capabilityi(const Capabilityi& cap,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Capability(cap,copyop),
_index(cap._index) {}
META_Object(osg, Capabilityi);
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
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;
}
/** Return the member identifier within the attribute's class type. Used for light number/clip plane number etc.*/
virtual unsigned int getMember() const { return _index; }
/** Set the renderbuffer index of the Enablei. */
void setIndex(unsigned int buf) { _index = buf; }
/** Get the renderbuffer index of the Enablei. */
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) {}
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Enablei(const Enablei& ei,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Capabilityi(ei,copyop) {}
META_Object(osg, Capabilityi);
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) {}
/** Copy constructor using CopyOp to manage deep vs shallow copy. */
Disablei(const Disablei& ei,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Capabilityi(ei,copyop) {}
META_Object(osg, Capabilityi);
virtual void apply(State&) const;
protected:
virtual ~Disablei() {}
};
}
#endif
|