OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BlendFunci.h
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_BLENDFUNCI
15 #define OSG_BLENDFUNCI 1
16 
17 #include <osg/BlendFunc>
18 
19 namespace osg {
20 
24 {
25  public :
26 
27  BlendFunci();
28 
29  BlendFunci(unsigned int buf, GLenum source, GLenum destination):
30  BlendFunc(source, destination),
31  _index(buf) {}
32 
33  BlendFunci(unsigned int buf, GLenum source, GLenum destination, GLenum source_alpha, GLenum destination_alpha):
34  BlendFunc(source, destination, source_alpha, destination_alpha),
35  _index(buf) {}
36 
39  BlendFunc(cm,copyop),
40  _index(cm._index) {}
41 
42  META_StateAttribute(osg, BlendFunci, BLENDFUNC);
43 
45  virtual int compare(const StateAttribute& sa) const
46  {
47  // Check for equal types, then create the rhs variable
48  // used by the COMPARE_StateAttribute_Parameter macros below.
50 
52 
53  return BlendFunc::compare(sa);
54  }
55 
57  virtual unsigned int getMember() const { return _index; }
58 
60  void setIndex(unsigned int buf) { _index = buf; }
61 
63  unsigned int getIndex() const { return _index; }
64 
65  virtual void apply(State& state) const;
66 
67  protected:
68 
69  virtual ~BlendFunci();
70 
71  unsigned int _index;
72 
73 };
74 
75 }
76 
77 #endif
#define OSG_EXPORT
Definition: Export.h:43
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
BlendFunci(unsigned int buf, GLenum source, GLenum destination, GLenum source_alpha, GLenum destination_alpha)
Definition: BlendFunci.h:33
unsigned int _index
Definition: BlendFunci.h:71
BlendFunci(unsigned int buf, GLenum source, GLenum destination)
Definition: BlendFunci.h:29
virtual int compare(const StateAttribute &sa) const
Definition: BlendFunci.h:45
BlendFunci(const BlendFunci &cm, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition: BlendFunci.h:38
virtual int compare(const StateAttribute &sa) const
Definition: BlendFunc.h:85
#define META_StateAttribute(library, name, type)
Definition: AlphaFunc.h:19
#define COMPARE_StateAttribute_Parameter(parameter)
unsigned int getIndex() const
Definition: BlendFunci.h:63
void setIndex(unsigned int buf)
Definition: BlendFunci.h:60
virtual unsigned int getMember() const
Definition: BlendFunci.h:57