source: trunk/src/resource_manager.cc @ 187

Last change on this file since 187 was 45, checked in by epyon, 12 years ago
  • temporary draw for context (and implementation)
  • cleaned up warnings
  • general cleanups
File size: 827 bytes
Line 
1// Copyright (C) 2012-2013 ChaosForge / Kornel Kisielewicz
2// http://chaosforge.org/
3//
4// This file is part of NV Libraries.
5// For conditions of distribution and use, see copyright notice in nv.hh
6
7#include <nv/resource_manager.hh>
8
9using namespace nv;
10
11resource_manager::resource_manager()
12{
13
14}
15
16resource::ptr resource_manager::get_raw_resource(uint32 id) const
17{
18        return m_data[ id ];
19}
20
21resource::ptr resource_manager::get_raw_resource(const std::string& id) const
22{
23        auto i = m_id_map.find( id );
24        if ( i != m_id_map.end() )
25        {
26                return m_data[ (unsigned int)i->second ];
27        }
28        return resource::ptr();
29}
30
31void resource_manager::register_resource_type( const std::string& name, resource_constructor_func c )
32{
33        m_constructors[ name ] = c;
34}
35
36resource_manager::~resource_manager()
37{
38
39}
Note: See TracBrowser for help on using the repository browser.