fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / State / Base / OSGTextureBaseChunk.h
blobe5fff9983c7f6c8c5a38bd0103308828440e4473
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zghdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGTEXTUREBASECHUNK_H_
40 #define _OSGTEXTUREBASECHUNK_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGConfig.h"
46 #include "OSGGLEXT.h"
47 #include "OSGWindow.h"
48 #include "OSGTextureBaseChunkBase.h"
49 #include "OSGGLFuncProtos.h"
51 OSG_BEGIN_NAMESPACE
53 /*! \brief State chunk for textures. See \ref PageSystemTextureBaseChunk
54 for a description.
55 \ingroup GrpSystemStateBaseChunks
56 \ingroup GrpLibOSGSystem
57 \includebasedoc
60 class OSG_SYSTEM_DLLMAPPING TextureBaseChunk : public TextureBaseChunkBase
62 /*========================== PUBLIC =================================*/
64 public:
66 /*---------------------------------------------------------------------*/
67 /*! \name Chunk Class Access */
68 /*! \{ */
70 virtual const StateChunkClass *getClass(void) const;
72 /*! \} */
73 /*---------------------------------------------------------------------*/
74 /*! \name Static Chunk Class Access */
75 /*! \{ */
77 static UInt32 getStaticClassId(void);
78 static const StateChunkClass *getStaticClass (void);
80 /*! \} */
81 /*---------------------------------------------------------------------*/
82 /*! \name Chunk Id */
83 /*! \{ */
85 virtual UInt16 getChunkId(void);
87 /*! \} */
88 /*---------------------------------------------------------------------*/
89 /*! \name Sync */
90 /*! \{ */
92 virtual void changed(ConstFieldMaskArg whichField,
93 UInt32 origin,
94 BitVector details);
96 /*! \} */
97 /*---------------------------------------------------------------------*/
98 /*! \name Output */
99 /*! \{ */
101 virtual void dump( UInt32 uiIndent = 0,
102 const BitVector bvFlags = 0) const;
104 /*! \} */
105 /*---------------------------------------------------------------------*/
106 /*! \name State */
107 /*! \{ */
109 virtual bool isCubeTexture(void);
111 /*! \} */
112 /*---------------------------------------------------------------------*/
113 /*! \name query */
114 /*! \{ */
116 virtual void validate (DrawEnv *pEnv) = 0;
117 virtual Int32 getOpenGLId (DrawEnv *pEnv) = 0;
118 virtual GLenum determineInternalFormat(void ) = 0;
120 /*! \} */
121 /*---------------------------------------------------------------------*/
122 /*! \name Comparison */
123 /*! \{ */
125 /*! \} */
126 /*---------------------------------------------------------------------*/
127 /*! \name Texture specific */
128 /*! \{ */
130 /*! \} */
131 /*---------------------------------------------------------------------*/
132 /*! \name Multitexture handling */
133 /*! \{ */
135 static bool hasMultiTexture(Window *win);
136 static void activeTexture (Window *win, UInt16 texture);
137 static bool activateTexture(Window *win, UInt16 texture);
139 /*! \} */
140 /*========================= PROTECTED ===============================*/
142 protected:
144 UInt16 _uiChunkId;
146 /*---------------------------------------------------------------------*/
147 /*! \name Init */
148 /*! \{ */
150 void onCreate (const TextureBaseChunk *source = NULL);
151 void onCreateAspect(const TextureBaseChunk *createAspect,
152 const TextureBaseChunk *source = NULL);
154 /*! \} */
155 /*---------------------------------------------------------------------*/
156 /*! \name Constructors */
157 /*! \{ */
159 TextureBaseChunk(void);
160 TextureBaseChunk(const TextureBaseChunk &source);
162 /*! \} */
163 /*---------------------------------------------------------------------*/
164 /*! \name Destructors */
165 /*! \{ */
167 virtual ~TextureBaseChunk(void);
169 /*! \} */
170 /*---------------------------------------------------------------------*/
171 /*! \name Init */
172 /*! \{ */
174 static void initMethod(InitPhase ePhase);
176 /*! \} */
177 /*---------------------------------------------------------------------*/
178 /*! \name GL */
179 /*! \{ */
181 static UInt32 _arbMultiTex;
183 static UInt32 _funcActiveTexture;
185 /*! \} */
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 ================================*/
196 private:
198 typedef TextureBaseChunkBase Inherited;
200 friend class FieldContainer;
201 friend class TextureBaseChunkBase;
203 /*---------------------------------------------------------------------*/
204 /*! \name GL */
205 /*! \{ */
207 /*! \} */
208 /*---------------------------------------------------------------------*/
210 // prohibit default functions (move to 'public' if you need one)
211 void operator =(const TextureBaseChunk &source);
214 typedef TextureBaseChunk *TextureBaseChunkP;
216 OSG_END_NAMESPACE
218 #include "OSGTextureBaseChunkBase.inl"
219 #include "OSGTextureBaseChunk.inl"
221 #endif /* _OSGTEXTUREBASECHUNK_H_ */