Changeset 13041 for OpenSceneGraph/trunk/include/osg/AlphaFunc
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osg/AlphaFunc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/AlphaFunc
r11790 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 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 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 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 24 24 25 25 /** Encapsulates OpenGL glAlphaFunc. 26 */ 26 */ 27 27 class OSG_EXPORT AlphaFunc : public StateAttribute 28 28 { 29 29 public : 30 30 31 31 enum ComparisonFunction { 32 32 NEVER = GL_NEVER, … … 42 42 43 43 AlphaFunc(); 44 44 45 45 AlphaFunc(ComparisonFunction func,float ref): 46 46 _comparisonFunc(func), … … 52 52 _comparisonFunc(af._comparisonFunc), 53 53 _referenceValue(af._referenceValue) {} 54 54 55 55 META_StateAttribute(osg, AlphaFunc,ALPHAFUNC); 56 56 57 57 /** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */ 58 58 virtual int compare(const StateAttribute& sa) const … … 80 80 _referenceValue = ref; 81 81 } 82 82 83 83 inline void setFunction(ComparisonFunction func) { _comparisonFunc=func; } 84 84 inline ComparisonFunction getFunction() const { return _comparisonFunc; } 85 85 86 86 inline void setReferenceValue(float value) { _referenceValue=value; } 87 87 inline float getReferenceValue() const { return _referenceValue; } 88 88 89 89 virtual void apply(State& state) const; 90 90 91 91 protected: 92 92 93 93 virtual ~AlphaFunc(); 94 94
