fixed: stay with old cmake qt link setup (policy CMP0020)
[opensg.git] / Source / System / State / OpenGL / OSGTextureEnvChunk.h
blob32f4f3c234ee2ef3e4f8f7bfb58445370cb3547b
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 _OSGTEXTUREENVCHUNK_H_
40 #define _OSGTEXTUREENVCHUNK_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGConfig.h"
46 #include "OSGGLEXT.h"
47 #include "OSGWindow.h"
48 #include "OSGImage.h"
49 #include "OSGTextureEnvChunkBase.h"
51 OSG_BEGIN_NAMESPACE
53 /*! \brief State chunk for textures. See \ref PageSystemTextureEnvChunk
54 for a description.
55 \ingroup GrpStateOpenGLObj
56 \ingroup GrpLibOSGState
57 \includebasedoc
60 class OSG_STATE_DLLMAPPING TextureEnvChunk : public TextureEnvChunkBase
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 /*! \} */
86 /*---------------------------------------------------------------------*/
87 /*! \name Sync */
88 /*! \{ */
90 virtual void changed(ConstFieldMaskArg whichField,
91 UInt32 origin,
92 BitVector details);
94 /*! \} */
95 /*---------------------------------------------------------------------*/
96 /*! \name Output */
97 /*! \{ */
99 virtual void dump( UInt32 uiIndent = 0,
100 const BitVector bvFlags = 0) const;
102 /*! \} */
103 /*---------------------------------------------------------------------*/
104 /*! \name State */
105 /*! \{ */
107 virtual void activate (DrawEnv *pEnv,
108 UInt32 index = 0);
110 virtual void changeFrom (DrawEnv *pEnv,
111 StateChunk *pOld,
112 UInt32 index = 0);
114 virtual void deactivate (DrawEnv *pEnv,
115 UInt32 index = 0);
117 virtual bool isTransparent (void) const;
119 /*! \} */
120 /*---------------------------------------------------------------------*/
121 /*! \name query */
122 /*! \{ */
124 //GLenum determineTextureTarget(Window *pWindow) const;
126 /*! \} */
127 /*---------------------------------------------------------------------*/
128 /*! \name Comparison */
129 /*! \{ */
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;
138 /*! \} */
139 /*---------------------------------------------------------------------*/
140 /*! \name Texture specific */
141 /*! \{ */
143 void setShaderOffsetMatrix(Real32 m11,
144 Real32 m12,
145 Real32 m21,
146 Real32 m22);
148 /*! \} */
149 /*---------------------------------------------------------------------*/
150 /*! \name Multitexture handling */
151 /*! \{ */
153 /*! \} */
154 /*========================= PROTECTED ===============================*/
156 protected:
158 /*---------------------------------------------------------------------*/
159 /*! \name Init */
160 /*! \{ */
162 void onCreate (const TextureEnvChunk *source = NULL);
163 void onCreateAspect(const TextureEnvChunk *createAspect,
164 const TextureEnvChunk *source = NULL);
166 /*! \} */
167 /*---------------------------------------------------------------------*/
168 /*! \name Constructors */
169 /*! \{ */
171 TextureEnvChunk(void);
172 TextureEnvChunk(const TextureEnvChunk &source);
174 /*! \} */
175 /*---------------------------------------------------------------------*/
176 /*! \name Destructors */
177 /*! \{ */
179 virtual ~TextureEnvChunk(void);
181 /*! \} */
182 /*---------------------------------------------------------------------*/
183 /*! \name Init */
184 /*! \{ */
186 static void initMethod(InitPhase ePhase);
188 /*! \} */
189 /*---------------------------------------------------------------------*/
190 /*! \name GL */
191 /*! \{ */
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);
201 /*! \} */
203 // class. Used for indexing in State
204 // protected to give CubeTextureChunk access
205 static StateChunkClass _class;
207 /*========================== PRIVATE ================================*/
209 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;
222 OSG_END_NAMESPACE
224 #include "OSGTextureEnvChunkBase.inl"
225 #include "OSGTextureEnvChunk.inl"
227 #endif /* _OSGTEXTUREENVCHUNK_H_ */