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 _OSGTEXTUREBASECHUNK_H_
40 #define _OSGTEXTUREBASECHUNK_H_
45 #include "OSGConfig.h"
47 #include "OSGWindow.h"
48 #include "OSGTextureBaseChunkBase.h"
49 #include "OSGGLFuncProtos.h"
53 /*! \brief State chunk for textures. See \ref PageSystemTextureBaseChunk
55 \ingroup GrpSystemStateBaseChunks
56 \ingroup GrpLibOSGSystem
60 class OSG_SYSTEM_DLLMAPPING TextureBaseChunk
: public TextureBaseChunkBase
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 /*---------------------------------------------------------------------*/
85 virtual UInt16
getChunkId(void);
88 /*---------------------------------------------------------------------*/
92 virtual void changed(ConstFieldMaskArg whichField
,
97 /*---------------------------------------------------------------------*/
101 virtual void dump( UInt32 uiIndent
= 0,
102 const BitVector bvFlags
= 0) const;
105 /*---------------------------------------------------------------------*/
109 virtual bool isCubeTexture(void);
112 /*---------------------------------------------------------------------*/
116 virtual void validate (DrawEnv
*pEnv
) = 0;
117 virtual Int32
getOpenGLId (DrawEnv
*pEnv
) = 0;
118 virtual GLenum
determineInternalFormat(void ) = 0;
121 /*---------------------------------------------------------------------*/
122 /*! \name Comparison */
126 /*---------------------------------------------------------------------*/
127 /*! \name Texture specific */
131 /*---------------------------------------------------------------------*/
132 /*! \name Multitexture handling */
135 static bool hasMultiTexture(Window
*win
);
136 static void activeTexture (Window
*win
, UInt16 texture
);
137 static bool activateTexture(Window
*win
, UInt16 texture
);
140 /*========================= PROTECTED ===============================*/
146 /*---------------------------------------------------------------------*/
150 void onCreate (const TextureBaseChunk
*source
= NULL
);
151 void onCreateAspect(const TextureBaseChunk
*createAspect
,
152 const TextureBaseChunk
*source
= NULL
);
155 /*---------------------------------------------------------------------*/
156 /*! \name Constructors */
159 TextureBaseChunk(void);
160 TextureBaseChunk(const TextureBaseChunk
&source
);
163 /*---------------------------------------------------------------------*/
164 /*! \name Destructors */
167 virtual ~TextureBaseChunk(void);
170 /*---------------------------------------------------------------------*/
174 static void initMethod(InitPhase ePhase
);
177 /*---------------------------------------------------------------------*/
181 static UInt32 _arbMultiTex
;
183 static UInt32 _funcActiveTexture
;
186 /*---------------------------------------------------------------------*/
188 // class. Used for indexing in State
189 // protected to give CubeTextureChunk access
190 static StateChunkClass _class
;
192 static volatile UInt16 _uiChunkCounter
;
194 /*========================== PRIVATE ================================*/
198 typedef TextureBaseChunkBase Inherited
;
200 friend class FieldContainer
;
201 friend class TextureBaseChunkBase
;
203 /*---------------------------------------------------------------------*/
208 /*---------------------------------------------------------------------*/
210 // prohibit default functions (move to 'public' if you need one)
211 void operator =(const TextureBaseChunk
&source
);
214 typedef TextureBaseChunk
*TextureBaseChunkP
;
218 #include "OSGTextureBaseChunkBase.inl"
219 #include "OSGTextureBaseChunk.inl"
221 #endif /* _OSGTEXTUREBASECHUNK_H_ */