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 _OSGTEXTUREOBJREFCHUNK_H_
40 #define _OSGTEXTUREOBJREFCHUNK_H_
45 #include "OSGConfig.h"
47 #include "OSGWindow.h"
49 #include "OSGTextureObjRefChunkBase.h"
53 /*! \brief State chunk for textures. See \ref PageSystemTextureObjRefChunk
55 \ingroup GrpStateAuxiliaryObj
56 \ingroup GrpLibOSGState
60 class OSG_STATE_DLLMAPPING TextureObjRefChunk
: public TextureObjRefChunkBase
62 /*========================== PUBLIC =================================*/
66 /*---------------------------------------------------------------------*/
67 /*! \name Chunk Class Access */
71 /*---------------------------------------------------------------------*/
72 /*! \name Static Chunk Class Access */
76 /*---------------------------------------------------------------------*/
81 /*---------------------------------------------------------------------*/
85 virtual void changed(ConstFieldMaskArg whichField
,
90 /*---------------------------------------------------------------------*/
94 virtual void dump( UInt32 uiIndent
= 0,
95 const BitVector bvFlags
= 0) const;
98 /*---------------------------------------------------------------------*/
102 virtual void activate (DrawEnv
*pEnv
,
105 virtual void changeFrom (DrawEnv
*pEnv
,
109 virtual void deactivate (DrawEnv
*pEnv
,
112 virtual bool isTransparent (void) const;
115 /*---------------------------------------------------------------------*/
119 //GLenum determineTextureTarget(Window *pWindow) const;
122 /*---------------------------------------------------------------------*/
123 /*! \name Comparison */
126 virtual Real32
switchCost(StateChunk
* chunk
);
128 virtual bool operator < (const StateChunk
&other
) const;
130 virtual bool operator == (const StateChunk
&other
) const;
131 virtual bool operator != (const StateChunk
&other
) const;
134 /*---------------------------------------------------------------------*/
135 /*! \name Texture specific */
139 /*---------------------------------------------------------------------*/
140 /*! \name Multitexture handling */
143 virtual void validate (DrawEnv
*pEnv
);
144 virtual Int32
getOpenGLId (DrawEnv
*pEnv
);
145 virtual GLenum
determineInternalFormat(void );
148 /*========================= PROTECTED ===============================*/
152 /*---------------------------------------------------------------------*/
156 void onCreate (const TextureObjRefChunk
*source
= NULL
);
157 void onCreateAspect(const TextureObjRefChunk
*createAspect
,
158 const TextureObjRefChunk
*source
= NULL
);
161 /*---------------------------------------------------------------------*/
162 /*! \name Constructors */
165 TextureObjRefChunk(void);
166 TextureObjRefChunk(const TextureObjRefChunk
&source
);
169 /*---------------------------------------------------------------------*/
170 /*! \name Destructors */
173 virtual ~TextureObjRefChunk(void);
176 /*---------------------------------------------------------------------*/
180 static void initMethod(InitPhase ePhase
);
183 /*---------------------------------------------------------------------*/
188 /*---------------------------------------------------------------------*/
190 /*========================== PRIVATE ================================*/
194 typedef TextureObjRefChunkBase Inherited
;
196 friend class FieldContainer
;
197 friend class TextureObjRefChunkBase
;
199 // prohibit default functions (move to 'public' if you need one)
200 void operator =(const TextureObjRefChunk
&source
);
203 typedef TextureObjRefChunk
*TextureObjRefChunkP
;
207 #include "OSGTextureObjRefChunkBase.inl"
208 #include "OSGTextureObjRefChunk.inl"
210 #endif /* _OSGTEXTUREOBJREFCHUNK_H_ */