]> git.tdb.fi Git - libs/gl.git/blob - source/resources/resource.cpp
Use correct sampler for the ambient occlusion rotate lookup
[libs/gl.git] / source / resources / resource.cpp
1 #include "resource.h"
2 #include "resourcemanager.h"
3
4 namespace Msp {
5 namespace GL {
6
7 Resource::Resource():
8         manager(0)
9 { }
10
11 Resource::~Resource()
12 {
13         if(manager)
14                 manager->remove_resource(*this);
15 }
16
17 void Resource::set_manager(ResourceManager *m)
18 {
19         if(manager)
20                 manager->remove_resource(*this);
21         manager = m;
22         if(manager)
23         {
24                 manager->add_resource(*this);
25                 manager_data = manager->get_data_for_resource(*this);
26         }
27         else
28                 manager_data = 0;
29 }
30
31 bool Resource::is_loaded() const
32 {
33         return manager ? manager->is_resource_loaded(*this) : true;
34 }
35
36 } // namespace GL
37 } // namespace Msp