Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 9789 was 9789, checked in by bensch, 18 years ago

nicer definition of the StorePointer

File size: 1.0 KB
Line 
1
2
3#include "resource_texture.h"
4
5
6
7ResourceTexture::ResourceTexture(const std::string& imageName, GLenum target)
8    : NewResource(&ResourceTexture::type)
9{
10  NewResource::StorePointer* ptr = this->acquireResource(imageName + ',' + "TEST");
11
12  if (ptr)
13  {
14    printf("FOUNT TEXTURE: %s\n", imageName.c_str());
15    this->acquireData(static_cast<ResourceTexture::TextureResourcePointer*>(ptr)->ptr());
16  }
17  else
18  {
19    printf("NOT FOUNT TEXTURE: %s\n", imageName.c_str());
20    std::string fileName = this->NewResource::locateFile(imageName);
21    this->Texture::loadImage(fileName, target);
22    this->NewResource::addResource(new ResourceTexture::TextureResourcePointer(imageName + ',' + "TEST", KeepLevel(0), this->Texture::dataPointer()));
23  }
24}
25
26
27NewResource::Type ResourceTexture::type(Texture::staticClassID());
28
29
30
31
32
33ResourceTexture::TextureResourcePointer::TextureResourcePointer(const std::string& loadString, const NewResource::KeepLevel& keepLevel, const TextureData::Pointer& data)
34    : NewResource::StorePointer(loadString, keepLevel) , pointer(data)
35{}
36
37
Note: See TracBrowser for help on using the repository browser.