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
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #ifndef _SO_GL_TEXTURE_IMAGE_ELEMENT
00051 #define _SO_GL_TEXTURE_IMAGE_ELEMENT
00052
00053 #include <Inventor/elements/SoTextureImageElement.h>
00054 #include <SoDeprecationRules.h>
00055
00056 class SoGLDisplayList;
00057 class SoRenderToTextureProperty;
00058 class SoBufferObject;
00059
00060
00061 SO_PIMPL_PUBLIC_DECLARATION(SoGLTextureImageElement)
00062
00063
00082 SoEXTENDER_Documented class SoDEPRECATED SoGLTextureImageElement : public SoTextureImageElement
00083 {
00084 SO_PIMPL_PUBLIC_HEADER(SoGLTextureImageElement);
00085
00086 SO_ELEMENT_HEADER(SoGLTextureImageElement);
00087
00088 public:
00089
00099 static SoGLDisplayList *
00100 set(SoState *state, SoNode *node,
00101 const SbVec2i32 &s, int nc,
00102 const void* _buffer,
00103 SoBufferObject* _bufferObject,
00104 SoSFImage::DataType _dataType,
00105 GLint _GLInternalFormat,
00106 SoRenderToTextureProperty* renderToTexProp,
00107 float texQuality,
00108 int wrapS, int wrapT, int wrapR, int model,
00109 const SbColor &blendColor, float _maxAnisotropy,
00110 SbBool _enableBorder, const SbVec4f &_borderColor,
00111 SbBool isCompressed, int numCompressedMipmaps, SoGLDisplayList *list,
00112 int hasTransparency = -1,
00113 SbBool enableCompressedTexture = FALSE , int CurrentImg=-1);
00114
00119 static void set(SoState *state, SoNode *node,
00120 const SbVec2i32 &subSize, int xoffset, int yoffset,
00121 const void *buffer, SoSFImage::DataType dataType, int texname) ;
00122
00126 static void setFilter(SoState *state, SoNode *node, int _minFilter, int _magFilter);
00127
00131 static void setIsRenderingShadows( SoState *state, SoNode *node, SbBool isRenderingShadows );
00132
00136 virtual void push(SoState *state) ;
00137
00141 virtual void pop(SoState *state, const SoElement *prevTopElement);
00142
00143 #if 1 SoDEPRECATED
00155 static SoGLDisplayList *
00156 set(SoState *state, SoNode *node,
00157 const SbVec2s &s, int nc,
00158 const void* _buffer,
00159 SoBufferObject* _bufferObject,
00160 SoSFImage::DataType _dataType,
00161 GLint _GLInternalFormat,
00162 SoRenderToTextureProperty* renderToTexProp,
00163 float texQuality,
00164 int wrapS, int wrapT, int wrapR, int model,
00165 const SbColor &blendColor, float _maxAnisotropy,
00166 SbBool _enableBorder, const SbVec4f &_borderColor,
00167 SbBool isCompressed, int numCompressedMipmaps, SoGLDisplayList *list,
00168 int hasTransparency = -1,
00169 SbBool enableCompressedTexture = FALSE , int CurrentImg=-1);
00170 SoDEPRECATED
00176 static void set(SoState *state, SoNode *node,
00177 const SbVec2s &subSize, int xoffset, int yoffset,
00178 const void *buffer, SoSFImage::DataType dataType, int texname) ;
00179
00180 #endif
00182 private:
00183
00185 virtual void commonInit();
00186
00190 virtual SbBool matches(const SoElement* elt) const;
00191
00195 SoElement* copyMatchInfo() const;
00196
00197 private:
00198
00200 static SoGLTexture* getGLTexture(SoState* state, int unit);
00201
00203 static void subImage(SoState *state, const SbVec2i32& size,
00204 int xoffset, int yoffset, const void *data);
00205
00207 static void set(SoState *state, SoNode *node, const SoTexImageData& config);
00208
00209
00210 static void initClass();
00211 static void exitClass();
00212
00213
00214 virtual void init(SoState *state);
00215
00216 static int getMaxTextureSize();
00217
00223 SbBool m_isRenderingShadows;
00224
00225 private:
00226
00227 virtual ~SoGLTextureImageElement();
00228
00229 private:
00230
00231 unsigned long getTextureSizeInBytes(int textureWidth, int textureHeight, int unit) const;
00232
00233
00234 float m_textureQuality;
00235 SbBool m_enableCompressedTexture;
00236
00238 static bool s_useGLBufferObject;
00239
00241 SbVec2s m_rttTexImageSize;
00242 };
00243
00244 #endif
00245
00246
00247