Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/new_class_id/src/lib/graphics/importer/resource_texture.cc @ 9785

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
Line 
1
2
3#include "resource_texture.h"
4
5
6
7ResourceTexture::ResourceTexture(const std::string& imageName, GLenum target)
8    : Resource(&ResourceTexture::type)
9{
10  Resource::Pointer* ptr = this->acquireResource(imageName + ',' + "TEST");
11
12  if (ptr)
13    this->acquireData(static_cast<ResourceTexture::TextureResourcePointer*>(ptr)->ptr());
14  else
15  {
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()));
19  }
20}
21
22
23Resource::Type ResourceTexture::type(Texture::staticClassID());
24
25
26
27
28
29ResourceTexture::TextureResourcePointer::TextureResourcePointer(const std::string& loadString, const Resource::KeepLevel& keepLevel, const TextureData::Pointer& data)
30    : Resource::Pointer(loadString, keepLevel) , pointer(data)
31{}
32
33
Note: See TracBrowser for help on using the repository browser.