1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zghdv.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 _OSGTEXTUREENVCHUNK_H_
40 #define _OSGTEXTUREENVCHUNK_H_
45 #include "OSGConfig.h"
47 #include "OSGWindow.h"
49 #include "OSGTextureEnvChunkBase.h"
53 /*! \brief State chunk for textures. See \ref PageSystemTextureEnvChunk
55 \ingroup GrpStateOpenGLObj
56 \ingroup GrpLibOSGState
60 class OSG_STATE_DLLMAPPING TextureEnvChunk
: public TextureEnvChunkBase
62 /*========================== PUBLIC =================================*/
66 /*---------------------------------------------------------------------*/
67 /*! \name Chunk Class Access */
70 virtual const StateChunkClass
*getClass(void) const;
73 /*---------------------------------------------------------------------*/
74 /*! \name Static Chunk Class Access */
77 static UInt32
getStaticClassId(void);
78 static const StateChunkClass
*getStaticClass (void);
81 /*---------------------------------------------------------------------*/
86 /*---------------------------------------------------------------------*/
90 virtual void changed(ConstFieldMaskArg whichField
,
95 /*---------------------------------------------------------------------*/
99 virtual void dump( UInt32 uiIndent
= 0,
100 const BitVector bvFlags
= 0) const;
103 /*---------------------------------------------------------------------*/
107 virtual void activate (DrawEnv
*pEnv
,
110 virtual void changeFrom (DrawEnv
*pEnv
,
114 virtual void deactivate (DrawEnv
*pEnv
,
117 virtual bool isTransparent (void) const;
120 /*---------------------------------------------------------------------*/
124 //GLenum determineTextureTarget(Window *pWindow) const;
127 /*---------------------------------------------------------------------*/
128 /*! \name Comparison */
131 virtual Real32
switchCost(StateChunk
* chunk
);
133 virtual bool operator < (const StateChunk
&other
) const;
135 virtual bool operator == (const StateChunk
&other
) const;
136 virtual bool operator != (const StateChunk
&other
) const;
139 /*---------------------------------------------------------------------*/
140 /*! \name Texture specific */
143 void setShaderOffsetMatrix(Real32 m11
,
149 /*---------------------------------------------------------------------*/
150 /*! \name Multitexture handling */
154 /*========================= PROTECTED ===============================*/
158 /*---------------------------------------------------------------------*/
162 void onCreate (const TextureEnvChunk
*source
= NULL
);
163 void onCreateAspect(const TextureEnvChunk
*createAspect
,
164 const TextureEnvChunk
*source
= NULL
);
167 /*---------------------------------------------------------------------*/
168 /*! \name Constructors */
171 TextureEnvChunk(void);
172 TextureEnvChunk(const TextureEnvChunk
&source
);
175 /*---------------------------------------------------------------------*/
176 /*! \name Destructors */
179 virtual ~TextureEnvChunk(void);
182 /*---------------------------------------------------------------------*/
186 static void initMethod(InitPhase ePhase
);
189 /*---------------------------------------------------------------------*/
193 static UInt32 _extPointSprite
;
194 static UInt32 _extTextureShader
;
195 static UInt32 _extTextureShader2
;
196 static UInt32 _extTextureShader3
;
197 static UInt32 _extTextureLodBias
;
199 void handleTextureShader(Window
*win
, GLenum bindtarget
);
203 // class. Used for indexing in State
204 // protected to give CubeTextureChunk access
205 static StateChunkClass _class
;
207 /*========================== PRIVATE ================================*/
211 typedef TextureEnvChunkBase Inherited
;
213 friend class FieldContainer
;
214 friend class TextureEnvChunkBase
;
216 // prohibit default functions (move to 'public' if you need one)
217 void operator =(const TextureEnvChunk
&source
);
220 typedef TextureEnvChunk
*TextureEnvChunkP
;
224 #include "OSGTextureEnvChunkBase.inl"
225 #include "OSGTextureEnvChunk.inl"
227 #endif /* _OSGTEXTUREENVCHUNK_H_ */