13 #include <osg/Referenced>
14 #include <osg/Texture>
31 unsigned int compressed : 1;
33 unsigned int wrap_s : 4;
34 unsigned int wrap_t : 4;
43 TextureList::iterator i = myTextures.begin();
44 TextureList::iterator e = myTextures.end();
47 if (i->second->referenceCount() > 1)
49 replacementList.push_back(*i);
52 if (replacementList.size() != myTextures.size())
54 myTextures.swap(replacementList);
56 return myTextures.size() == 0;
61 TextureList::iterator i = myTextures.begin();
62 TextureList::iterator e = myTextures.end();
65 i->second->releaseGLObjects(state);
69 bool findTexture(
unsigned int minFilter,
unsigned int magFilter,
74 k.
min = ((minFilter ^ 0x2600) & 0x3) + ((minFilter ^ 0x2600) >> 7);
75 k.
max = ((magFilter ^ 0x2600) & 0x3) + ((magFilter ^ 0x2600) >> 7);
76 k.
wrap_s = (wrapS & 0x0F) | ((wrapS & 0x10) >> 3);
77 k.
wrap_t = (wrapT & 0x0F) | ((wrapT & 0x10) >> 3);
80 TextureList::iterator i = myTextures.begin();
81 TextureList::iterator e = myTextures.end();
84 if (i->first.key == k.
key)
97 pair.first.min = ((texture->getFilter(osg::Texture::MIN_FILTER) ^ 0x2600) & 0x3) +
98 ((texture->getFilter(osg::Texture::MIN_FILTER) ^ 0x2600) >> 7);
100 pair.first.max = ((texture->getFilter(osg::Texture::MAG_FILTER) ^ 0x2600) & 0x3) +
101 ((texture->getFilter(osg::Texture::MAG_FILTER) ^ 0x2600) >> 7);
103 pair.first.wrap_s = (texture->getWrap(osg::Texture::WRAP_S) & 0x0F) |
104 ((texture->getWrap(osg::Texture::WRAP_S) & 0x10) >> 3);
106 pair.first.wrap_t = (texture->getWrap(osg::Texture::WRAP_T) & 0x0F) |
107 ((texture->getWrap(osg::Texture::WRAP_T) & 0x10) >> 3);
109 pair.first.compressed = compressed;
111 pair.second = texture;
112 myTextures.push_back(pair);
Diagonal crossing liens.
Definition: DtTacticalGraphicUtilities.h:93
void releaseGLObjects(osg::State *state)
Definition: DtTextureCollection.h:59
unsigned int min
Definition: DtTextureCollection.h:30
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
unsigned int compressed
Definition: DtTextureCollection.h:31
unsigned int wrap_t
Definition: DtTextureCollection.h:34
bool findTexture(unsigned int minFilter, unsigned int magFilter, unsigned int wrapS, unsigned wrapT, bool compressed, osg::ref_ptr< osg::Texture > &texture)
Definition: DtTextureCollection.h:69
Definition: DtTextureCollection.h:25
Helper class to be used in conjunction with DtOsgReferencedCollection Was uncessarily in DtOsgFileCac...
Definition: DtTextureCollection.h:22
std::pair< KeyType, osg::ref_ptr< osg::Texture > > KeyTexturePair
Definition: DtTextureCollection.h:115
unsigned int wrap_s
Definition: DtTextureCollection.h:33
bool flush()
Definition: DtTextureCollection.h:39
unsigned int max
Definition: DtTextureCollection.h:32
void addTexture(osg::Texture *texture, bool compressed)
Definition: DtTextureCollection.h:93
TextureList myTextures
Definition: DtTextureCollection.h:117
Contains DLL export macros.
std::vector< KeyTexturePair > TextureList
Definition: DtTextureCollection.h:116
unsigned short key
Definition: DtTextureCollection.h:27