OpenSceneGraph 3.6.5
ColorMaski
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSG_COLORMASKI
15#define OSG_COLORMASKI 1
16
17#include <osg/ColorMask>
18
19namespace osg {
20
24{
25 public :
26
28
29 ColorMaski(unsigned int buf, bool red, bool green, bool blue, bool alpha):
30 ColorMask(red, green,blue,alpha),
31 _index(buf) {}
32
35 ColorMask(cm,copyop),
36 _index(cm._index) {}
37
39
41 virtual int compare(const StateAttribute& sa) const
42 {
43 // Check for equal types, then create the rhs variable
44 // used by the COMPARE_StateAttribute_Parameter macros below.
46
48
49 return ColorMask::compare(sa);
50 }
51
53 virtual unsigned int getMember() const { return _index; }
54
56 void setIndex(unsigned int buf);
57
59 unsigned int getIndex() const { return _index; }
60
61 virtual void apply(State& state) const;
62
63 protected:
64
65 virtual ~ColorMaski();
66
67 unsigned int _index;
68
69};
70
71}
72
73#endif
#define COMPARE_StateAttribute_Parameter(parameter)
COMPARE_StateAttribute_Parameter macro is a helper for implementing the StatateAtribute::compare(....
Definition StateAttribute:69
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
COMPARE_StateAttribute_Types macro is a helper for implementing the StateAtribute::compare(....
Definition StateAttribute:57
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
virtual int compare(const StateAttribute &sa) const
Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Definition ColorMask:49
virtual ~ColorMaski()
META_StateAttribute(osg, ColorMaski, COLORMASK)
unsigned int getIndex() const
Get the renderbuffer index of the ColorMaski.
Definition ColorMaski:59
void setIndex(unsigned int buf)
Set the renderbuffer index of the ColorMaski.
virtual void apply(State &state) const
apply the OpenGL state attributes.
ColorMaski(unsigned int buf, bool red, bool green, bool blue, bool alpha)
Definition ColorMaski:29
ColorMaski(const ColorMaski &cm, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
Definition ColorMaski:34
unsigned int _index
Definition ColorMaski:67
virtual int compare(const StateAttribute &sa) const
Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Definition ColorMaski:41
virtual unsigned int getMember() const
Return the buffer index as the member identifier.
Definition ColorMaski:53
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Base class for state attributes.
Definition StateAttribute:77
@ COLORMASK
Definition StateAttribute:153
#define OSG_EXPORT
Definition Export:39

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.