00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef _OSGTEXTURECHUNK_H_
00041 #define _OSGTEXTURECHUNK_H_
00042 #ifdef __sgi
00043 #pragma once
00044 #endif
00045
00046 #include <OSGConfig.h>
00047 #include <OSGGLEXT.h>
00048 #include <OSGWindow.h>
00049 #include <OSGTextureChunkBase.h>
00050
00051 OSG_BEGIN_NAMESPACE
00052
00053 #define osgMaxTexImages 16
00054 #define osgMaxTexCoords 8
00055
00060 class OSG_SYSTEMLIB_DLLMAPPING TextureChunk : public TextureChunkBase
00061 {
00062
00063 public:
00064
00065
00069 virtual const StateChunkClass * getClass (void) const;
00070
00072
00076 inline static UInt32 getStaticClassId (void);
00077 inline static const StateChunkClass * getStaticClass (void);
00078
00080
00084 virtual void changed(BitVector whichField,
00085 UInt32 origin );
00086
00088
00092 virtual void dump( UInt32 uiIndent = 0,
00093 const BitVector bvFlags = 0) const;
00094
00096
00100 virtual void activate (DrawActionBase * action, UInt32 index = 0);
00101
00102 virtual void changeFrom (DrawActionBase * action, StateChunk * old,
00103 UInt32 index = 0);
00104
00105 virtual void deactivate (DrawActionBase * action, UInt32 index = 0);
00106
00107 virtual bool isTransparent (void) const;
00108
00110
00114 virtual Real32 switchCost (StateChunk * chunk);
00115
00116 virtual bool operator < (const StateChunk &other) const;
00117
00118 virtual bool operator == (const StateChunk &other) const;
00119 virtual bool operator != (const StateChunk &other) const;
00120
00122
00126 void imageContentChanged(Int32 minx = -1, Int32 maxx = -1,
00127 Int32 miny = -1, Int32 maxy = -1,
00128 Int32 minz = -1, Int32 maxz = -1 );
00129
00130 void setImage (ImagePtr &pImage);
00131
00132 inline void setShaderOffsetMatrix(Real32 m11, Real32 m12,
00133 Real32 m21, Real32 m22);
00134
00136
00140 static bool hasMultiTexture(Window *win);
00141 static void activeTexture (Window *win, UInt16 texture);
00142 static bool activateTexture(Window *win, UInt16 texture);
00143
00146
00147 protected:
00148
00149
00153 void onCreate(const TextureChunk *source = NULL);
00154
00156
00160 TextureChunk(void);
00161 TextureChunk(const TextureChunk &source);
00162
00164
00168 virtual ~TextureChunk(void);
00169
00171
00175 void handleTexture(Window *win, UInt32 id, GLenum bindtarget,
00176 GLenum paramtarget,
00177 GLenum imgtarget,
00178 Window::GLObjectStatusE mode,
00179 ImagePtr img, int side = 0);
00180
00181 void handleTextureShader(Window *win, GLenum bindtarget);
00182
00185
00186 static UInt32 _extTex3D;
00187 static UInt32 _arbMultiTex;
00188 static UInt32 _nvPointSprite;
00189 static UInt32 _nvTextureShader;
00190 static UInt32 _nvTextureShader2;
00191 static UInt32 _nvTextureShader3;
00192 static UInt32 _sgisGenerateMipmap;
00193 static UInt32 _extTextureLodBias;
00194 static UInt32 _arbTextureCompression;
00195 static UInt32 _arbTextureRectangle;
00196
00197
00198 static UInt32 _funcTexImage3D;
00199 static UInt32 _funcTexSubImage3D;
00200 static UInt32 _funcActiveTexture;
00201 static UInt32 _arbCubeTex;
00202 static UInt32 _funcCompressedTexImage1D;
00203 static UInt32 _funcCompressedTexSubImage1D;
00204 static UInt32 _funcCompressedTexImage2D;
00205 static UInt32 _funcCompressedTexSubImage2D;
00206 static UInt32 _funcCompressedTexImage3D;
00207 static UInt32 _funcCompressedTexSubImage3D;
00208
00209
00210
00211 static StateChunkClass _class;
00212
00213
00214 static void initMethod(void);
00215
00216
00217 private:
00218
00219 typedef TextureChunkBase Inherited;
00220
00221 friend class FieldContainer;
00222 friend class TextureChunkBase;
00223
00224 static char cvsid[];
00225
00226
00230 void handleGL(Window *win, UInt32 id);
00231
00234
00235
00236 void operator =(const TextureChunk &source);
00237 };
00238
00239 typedef TextureChunk *TextureChunkP;
00240
00241 OSG_END_NAMESPACE
00242
00243 #include <OSGTextureChunkBase.inl>
00244 #include <OSGTextureChunk.inl>
00245
00246 #define OSGTEXTURECHUNK_HEADER_CVSID "@(#)$Id: FCTemplate_h.h,v 1.15 2002/06/01 10:37:25 vossg Exp $"
00247
00248 #endif