00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _SO_GL_EXT_TEXTURE_IMAGE_ELEMENT
00025 #define _SO_GL_EXT_TEXTURE_IMAGE_ELEMENT
00026
00027 #include <Inventor/elements/SoReplacedElement.h>
00028 #include <Inventor/nodes/SoExtTexture2.h>
00029 #include <SoDeprecationRules.h>
00030
00050 SoEXTENDER_Documented class SoDEPRECATED SoGLExtTextureImageElement : public SoReplacedElement
00051 {
00052 SO_ELEMENT_HEADER(SoGLExtTextureImageElement);
00053
00054 public:
00055
00065 static SoGLDisplayList* set(SoState *state, SoNode *node,
00066 const SbVec2i32 &s, int nc,
00067 unsigned char*& bytes,
00068 GLint GLInternalFormat,
00069 GLenum compressedFormat,
00070 unsigned char*& palette,
00071 float texQuality,
00072 int wrapS, int wrapT, int model,
00073 const SbColor &blendColor,
00074 float maxAnisotropy, SbBool enableBorder,
00075 const SbVec4f &borderColor,
00076 SbBool enableCompressedTexture,
00077 SbBool isCompressed, int numCompressedMipmaps,
00078 SoGLDisplayList *list);
00079
00080 static void setFilter(SoState *state, SoNode *node, int _minFilter, int _magFilter);
00081
00085 virtual void pop(SoState *state, const SoElement *prevTopElement);
00086
00087 #if 1 SoDEPRECATED
00099 static SoGLDisplayList* set(SoState *state, SoNode *node,
00100 const SbVec2s &s, int nc,
00101 unsigned char*& bytes,
00102 GLint GLInternalFormat,
00103 GLenum compressedFormat,
00104 unsigned char*& palette,
00105 float texQuality,
00106 int wrapS, int wrapT, int model,
00107 const SbColor &blendColor,
00108 float maxAnisotropy, SbBool enableBorder,
00109 const SbVec4f &borderColor,
00110 SbBool enableCompressedTexture,
00111 SbBool isCompressed, int numCompressedMipmaps,
00112 SoGLDisplayList *list);
00113
00114 #endif
00116 private:
00117
00119 virtual void commonInit();
00120
00122 virtual void init(SoState *state);
00123
00124 private:
00125
00126 static void initClass();
00127 static void exitClass();
00128
00129 private:
00130
00131 virtual void setElt(const SbVec2i32 &s, int nc, unsigned char *& , GLint GLInternalFormat,
00132 int wrapS, int wrapT, int model,
00133 const SbColor &blendColor, float _maxAnisotropy,
00134 SbBool _enableBorder, const SbVec4f &_borderColor,
00135 SbBool _enableCompressedTexture, float _quality,
00136 unsigned char** _palette, SoNode* _node,
00137 SoGLDisplayList* _list, GLenum _compressedFormat,
00138 SbBool isCompressed, int _numCompressedMipmaps);
00139
00140 virtual ~SoGLExtTextureImageElement();
00141
00142 private:
00143
00144 void sendTexEnv(SoState *state);
00145
00146
00147
00148
00149 void sendTex(SoState *state, SoNode* node);
00150
00151
00152
00153
00154
00155 void scaleImage(GLenum format, GLint xsize, GLint ysize, int numComponents, GLenum typein, void *,
00156 GLint newSizex, GLint newSizey, GLenum typeout, GLubyte *dataout);
00157
00158
00159 int genTextureIdx();
00160
00161
00162 void checkOpenGLextensions(SoState* state);
00163
00164 GLenum getGLFormat(int nc);
00165
00166
00167 float quality;
00168 unsigned char** palette;
00169 GLuint texName;
00170 SoNode* texNode;
00171 SbVec2i32 size;
00172 int numComponents;
00173 int wrapS;
00174 int wrapT;
00175 int model;
00176 SbColor blendColor;
00177 float maxAnisotropy;
00178 SbBool enableBorder;
00179 SbVec4f borderColor;
00180 int minFilter;
00181 int magFilter;
00182 unsigned char** bytes;
00183 GLint GLInternalFormat;
00184 SoGLTexCacheList *m_cacheList;
00185 GLenum compressedFormat;
00186 SbBool isCompressed;
00187 int numCompressedMipmaps;
00188
00189 static GLenum texPalIntFormat;
00190
00191 SbBool m_enableCompressedTexture;
00192
00193 void *_GlColorTable;
00194
00195 void unrefDisplayList();
00196 void freeDisplayList();
00197 SoGLDisplayList* getDisplayListCache( );
00198 void setDisplayList( SoState* state, SoGLDisplayList* displayList );
00199
00200 };
00201
00202 #endif
00203
00204
00205