Last change
on this file since 9785 was
9785,
checked in by bensch, 18 years ago
|
some implementations of the new self sustained Resources. It works, but does not yet load the correct stuff
|
File size:
916 bytes
|
Rev | Line | |
---|
[9781] | 1 | |
---|
| 2 | |
---|
| 3 | #include "resource_texture.h" |
---|
| 4 | |
---|
| 5 | |
---|
| 6 | |
---|
[9784] | 7 | ResourceTexture::ResourceTexture(const std::string& imageName, GLenum target) |
---|
[9785] | 8 | : Resource(&ResourceTexture::type) |
---|
[9784] | 9 | { |
---|
[9785] | 10 | Resource::Pointer* ptr = this->acquireResource(imageName + ',' + "TEST"); |
---|
[9781] | 11 | |
---|
[9784] | 12 | if (ptr) |
---|
| 13 | this->acquireData(static_cast<ResourceTexture::TextureResourcePointer*>(ptr)->ptr()); |
---|
| 14 | else |
---|
| 15 | { |
---|
[9785] | 16 | std::string fileName = this->Resource::locateFile(imageName); |
---|
| 17 | this->Texture::loadImage(fileName, target); |
---|
| 18 | this->Resource::addResource(new ResourceTexture::TextureResourcePointer(imageName + ',' + "TEST", KeepLevel(), this->Texture::dataPointer())); |
---|
[9784] | 19 | } |
---|
| 20 | } |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | Resource::Type ResourceTexture::type(Texture::staticClassID()); |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | |
---|
[9785] | 29 | ResourceTexture::TextureResourcePointer::TextureResourcePointer(const std::string& loadString, const Resource::KeepLevel& keepLevel, const TextureData::Pointer& data) |
---|
[9784] | 30 | : Resource::Pointer(loadString, keepLevel) , pointer(data) |
---|
[9785] | 31 | {} |
---|
[9781] | 32 | |
---|
| 33 | |
---|
Note: See
TracBrowser
for help on using the repository browser.