1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGBLENDCHUNK_H_
40 #define _OSGBLENDCHUNK_H_
45 #include "OSGBlendChunkBase.h"
49 /*! \brief State chunk to wrap pixel combination functions. See \ref
50 PageSystemBlendChunk for a description.
51 \ingroup GrpSystemStateBaseChunks
52 \ingroup GrpLibOSGSystem
56 class OSG_SYSTEM_DLLMAPPING BlendChunk
: public BlendChunkBase
58 /*========================== PUBLIC =================================*/
62 /*---------------------------------------------------------------------*/
63 /*! \name Chunk Class Access */
66 virtual const StateChunkClass
*getClass(void) const;
69 /*---------------------------------------------------------------------*/
70 /*! \name Static Chunk Class Access */
73 static UInt32
getStaticClassId(void);
74 static const StateChunkClass
*getStaticClass (void);
77 /*---------------------------------------------------------------------*/
81 virtual void changed(ConstFieldMaskArg whichField
,
86 /*---------------------------------------------------------------------*/
90 virtual void dump( UInt32 uiIndent
= 0,
91 const BitVector bvFlags
= 0) const;
94 /*---------------------------------------------------------------------*/
95 /*! \name State Commands */
98 virtual void activate (DrawEnv
*pEnv
,
101 virtual void changeFrom (DrawEnv
*pEnv
,
105 virtual void deactivate (DrawEnv
*pEnv
,
108 virtual bool isTransparent(void ) const;
111 /*---------------------------------------------------------------------*/
112 /*! \name Comparison */
115 virtual Real32
switchCost ( StateChunk
* chunk
);
117 virtual bool operator < (const StateChunk
&other
) const;
119 virtual bool operator == (const StateChunk
&other
) const;
120 virtual bool operator != (const StateChunk
&other
) const;
124 /*========================= PROTECTED ===============================*/
128 /*---------------------------------------------------------------------*/
129 /*! \name Constructors */
133 BlendChunk(const BlendChunk
&source
);
136 /*---------------------------------------------------------------------*/
137 /*! \name Destructors */
140 virtual ~BlendChunk(void);
143 /*---------------------------------------------------------------------*/
147 static void initMethod(InitPhase ePhase
);
150 /*========================== PRIVATE ================================*/
154 typedef BlendChunkBase Inherited
;
156 friend class FieldContainer
;
157 friend class BlendChunkBase
;
159 static StateChunkClass _class
;
161 /*---------------------------------------------------------------------*/
162 /*! \name OpenGL Extension Handling */
165 static UInt32 _extBlend
;
166 static UInt32 _extImaging
;
167 static UInt32 _extBlendSubtract
;
168 static UInt32 _extBlendMinMax
;
169 static UInt32 _extBlendLogicOp
;
170 static UInt32 _extBlendFuncSeparate
;
172 static UInt32 _funcBlendColor
;
173 static UInt32 _funcBlendEquation
;
174 static UInt32 _funcBlendEquationExt
;
175 static UInt32 _funcBlendFuncSeparateExt
;
178 /*---------------------------------------------------------------------*/
180 // prohibit default functions (move to 'public' if you need one)
181 void operator =(const BlendChunk
&source
);
184 typedef BlendChunk
*BlendChunkP
;
188 #include "OSGBlendChunkBase.inl"
189 #include "OSGBlendChunk.inl"
191 #endif /* _OSGBLENDCHUNK_H_ */