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 _OSGTEXTUREIMAGECHUNK_H_
40 #define _OSGTEXTUREIMAGECHUNK_H_
45 #include "OSGTextureImageChunkBase.h"
49 /*! \brief State chunk for textures. See \ref PageSystemTextureImageChunk
51 \ingroup GrpStateAuxiliaryObj
52 \ingroup GrpLibOSGState
56 class OSG_STATE_DLLMAPPING TextureImageChunk
: public TextureImageChunkBase
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 /*---------------------------------------------------------------------*/
82 /*---------------------------------------------------------------------*/
86 virtual void changed(ConstFieldMaskArg whichField
,
91 /*---------------------------------------------------------------------*/
95 virtual void dump( UInt32 uiIndent
= 0,
96 const BitVector bvFlags
= 0) const;
99 /*---------------------------------------------------------------------*/
103 virtual void activate (DrawEnv
*pEnv
,
106 virtual void changeFrom (DrawEnv
*pEnv
,
110 virtual void deactivate (DrawEnv
*pEnv
,
113 virtual bool isTransparent (void) const;
116 /*---------------------------------------------------------------------*/
120 //GLenum determineTextureTarget(Window *pWindow) const;
123 /*---------------------------------------------------------------------*/
124 /*! \name Comparison */
127 virtual Real32
switchCost(StateChunk
* chunk
);
129 virtual bool operator < (const StateChunk
&other
) const;
131 virtual bool operator == (const StateChunk
&other
) const;
132 virtual bool operator != (const StateChunk
&other
) const;
135 /*---------------------------------------------------------------------*/
136 /*! \name Texture specific */
140 virtual void validate(DrawEnv
*pEnv
);
144 /*---------------------------------------------------------------------*/
145 /*! \name Multitexture handling */
149 /*========================= PROTECTED ===============================*/
153 static UInt32 _arbShaderImageLS
;
154 static UInt32 FuncIdBindImageTexture
;
156 // class. Used for indexing in State
157 // protected to give CubeTextureChunk access
158 static StateChunkClass _class
;
160 /*---------------------------------------------------------------------*/
164 void onCreate (const TextureImageChunk
*source
= NULL
);
165 void onCreateAspect(const TextureImageChunk
*createAspect
,
166 const TextureImageChunk
*source
= NULL
);
169 /*---------------------------------------------------------------------*/
170 /*! \name Constructors */
173 TextureImageChunk(void);
174 TextureImageChunk(const TextureImageChunk
&source
);
177 /*---------------------------------------------------------------------*/
178 /*! \name Destructors */
181 virtual ~TextureImageChunk(void);
184 /*---------------------------------------------------------------------*/
188 static void initMethod(InitPhase ePhase
);
191 /*---------------------------------------------------------------------*/
196 /*---------------------------------------------------------------------*/
198 /*========================== PRIVATE ================================*/
202 typedef TextureImageChunkBase Inherited
;
204 friend class FieldContainer
;
205 friend class TextureImageChunkBase
;
207 // prohibit default functions (move to 'public' if you need one)
208 void operator =(const TextureImageChunk
&source
);
211 typedef TextureImageChunk
*TextureImageChunkP
;
215 #include "OSGTextureImageChunkBase.inl"
216 #include "OSGTextureImageChunk.inl"
218 #endif /* _OSGTEXTUREIMAGECHUNK_H_ */