BlendFunci
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_BLENDFUNCI
#define OSG_BLENDFUNCI 1
#include <osg/BlendFunc>
namespace osg {
class OSG_EXPORT BlendFunci : public BlendFunc
{
public :
BlendFunci();
BlendFunci(unsigned int buf, GLenum source, GLenum destination):
BlendFunc(source, destination),
_index(buf) {}
BlendFunci(unsigned int buf, GLenum source, GLenum destination, GLenum source_alpha, GLenum destination_alpha):
BlendFunc(source, destination, source_alpha, destination_alpha),
_index(buf) {}
BlendFunci(const BlendFunci& cm,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
BlendFunc(cm,copyop),
_index(cm._index) {}
META_StateAttribute(osg, BlendFunci, BLENDFUNC);
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(BlendFunci,sa)
COMPARE_StateAttribute_Parameter(_index);
return BlendFunc::compare(sa);
}
virtual unsigned int getMember() const { return _index; }
void setIndex(unsigned int buf);
unsigned int getIndex() const { return _index; }
virtual void apply(State& state) const;
protected:
virtual ~BlendFunci();
unsigned int _index;
};
}
#endif
BlendFunc
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::BlendFunc::BlendFunc
BlendFunc()
osg::BlendFunc::compare
virtual int compare(const StateAttribute &sa) const
Definition BlendFunc:85
osg::BlendFunci::compare
virtual int compare(const StateAttribute &sa) const
Definition BlendFunci:45
osg::BlendFunci::BlendFunci
BlendFunci(const BlendFunci &cm, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition BlendFunci:38
osg::BlendFunci::_index
unsigned int _index
Definition BlendFunci:71
osg::BlendFunci::BlendFunci
BlendFunci(unsigned int buf, GLenum source, GLenum destination)
Definition BlendFunci:29
osg::BlendFunci::META_StateAttribute
META_StateAttribute(osg, BlendFunci, BLENDFUNC)
osg::BlendFunci::setIndex
void setIndex(unsigned int buf)
osg::BlendFunci::getIndex
unsigned int getIndex() const
Definition BlendFunci:63
osg::BlendFunci::BlendFunci
BlendFunci(unsigned int buf, GLenum source, GLenum destination, GLenum source_alpha, GLenum destination_alpha)
Definition BlendFunci:33
osg::BlendFunci::getMember
virtual unsigned int getMember() const
Definition BlendFunci:57
osg::BlendFunci::apply
virtual void apply(State &state) const
osg::BlendFunci::~BlendFunci
virtual ~BlendFunci()
osg::BlendFunci::BlendFunci
BlendFunci()
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::StateAttribute
Definition StateAttribute:77
osg::StateAttribute::BLENDFUNC
@ BLENDFUNC
Definition StateAttribute:149
osg::State
Definition State:80
osg
Definition AlphaFunc:19
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39