1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield
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.
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.
14#ifndef OSG_BLENDEQUATIONI
15#define OSG_BLENDEQUATIONI 1
17#include <osg/BlendEquation>
21/** Encapsulates glBlendEquationi function : the index version of glBlendEquation for multiple render target.
23class OSG_EXPORT BlendEquationi : public BlendEquation
29 BlendEquationi(unsigned int buf, Equation equation):
30 BlendEquation(equation),
33 BlendEquationi(unsigned int buf, Equation equationRGB, Equation equationAlpha):
34 BlendEquation(equationRGB, equationAlpha),
38 /** Copy constructor using CopyOp to manage deep vs shallow copy. */
39 BlendEquationi(const BlendEquationi& cm,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
40 BlendEquation(cm,copyop),
43 META_StateAttribute(osg, BlendEquationi, BLENDEQUATION);
45 /** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
46 virtual int compare(const StateAttribute& sa) const
48 // Check for equal types, then create the rhs variable
49 // used by the COMPARE_StateAttribute_Parameter macros below.
50 COMPARE_StateAttribute_Types(BlendEquationi,sa)
52 COMPARE_StateAttribute_Parameter(_index);
54 return BlendEquation::compare(sa);
57 /** Return the buffer index as the member identifier.*/
58 virtual unsigned int getMember() const { return _index; }
60 /** Set the renderbuffer index of the BlendEquationi. */
61 void setIndex(unsigned int buf);
63 /** Get the renderbuffer index of the BlendEquationi. */
64 unsigned int getIndex() const { return _index; }
66 virtual void apply(State& state) const;
70 virtual ~BlendEquationi();