Index: /trunk/nv/common.hh
===================================================================
--- /trunk/nv/common.hh	(revision 6)
+++ /trunk/nv/common.hh	(revision 7)
@@ -141,4 +141,6 @@
   typedef double f64;
 
+  typedef uint64 uid;
+
 } // namespace nv
 
Index: /trunk/nv/resource.hh
===================================================================
--- /trunk/nv/resource.hh	(revision 7)
+++ /trunk/nv/resource.hh	(revision 7)
@@ -0,0 +1,40 @@
+// Copyright (C) 2012-2013 ChaosForge / Kornel Kisielewicz
+// http://chaosforge.org/
+//
+// This file is part of NV Libraries.
+// For conditions of distribution and use, see copyright notice in nv.hh
+
+/**
+ * @file resource.hh
+ * @author Kornel Kisielewicz epyon@chaosforge.org
+ * @brief resource implementation
+ */
+
+#ifndef NV_RESOURCE_HH
+#define NV_RESOURCE_HH
+
+#include <nv/common.hh>
+#include <memory>
+
+namespace nv
+{
+
+	class resource
+	{
+	public:
+		typedef std::shared_ptr< resource > ptr;
+	public:
+		virtual bool load() = 0;
+		virtual bool unload() = 0;
+		bool is_loaded() const { return m_loaded; }
+		uid get_rid() const { return m_rid; }
+		uid get_size() const { return m_size; }
+	private:
+		uint32 m_size;
+		uint32 m_rid;
+		bool   m_loaded;
+	};
+
+}
+
+#endif // NV_RESOURCE_HH
Index: /trunk/nv/resource_manager.hh
===================================================================
--- /trunk/nv/resource_manager.hh	(revision 7)
+++ /trunk/nv/resource_manager.hh	(revision 7)
@@ -0,0 +1,72 @@
+// Copyright (C) 2012-2013 ChaosForge / Kornel Kisielewicz
+// http://chaosforge.org/
+//
+// This file is part of NV Libraries.
+// For conditions of distribution and use, see copyright notice in nv.hh
+
+/**
+ * @file resource_manager.hh
+ * @author Kornel Kisielewicz epyon@chaosforge.org
+ */
+
+#ifndef NV_RESOURCE_MANAGER_HH
+#define NV_RESOURCE_MANAGER_HH
+
+#include <nv/resource.hh>
+#include <nv/singleton.hh>
+#include <unordered_map>
+
+namespace nv
+{
+    typedef std::shared_ptr<resource> (*resource_constructor_func)();
+
+	template <typename TYPE> 
+	std::shared_ptr<resource> resource_constructor()
+	{
+		return std::shared_ptr<TYPE>();
+	}
+
+
+	class resource_manager : public auto_singleton< resource_manager >
+	{
+	public:
+		resource_manager();
+		~resource_manager();
+
+		template<typename T>
+		void register_resource_type( const std::string& name )
+		{
+			register_resource_type( name, resource_constructor<T> );
+		}
+		void register_resource_type( const std::string& name, resource_constructor_func c );
+
+		template<typename T>
+		std::shared_ptr<T> get_resource(uint32 id) const
+		{
+			auto result = std::dynamic_pointer_cast<T,resource>( get_raw_resource( id ) );
+			return result;
+		}
+		template<typename T>
+		std::shared_ptr<T> get_resource( const std::string& id ) const
+		{
+			auto result = std::dynamic_pointer_cast<T,resource>( get_raw_resource( id ) );
+			return result;
+		}
+
+		resource::ptr get_raw_resource(uint32 id) const;
+		resource::ptr get_raw_resource(const std::string& id) const;
+		
+	private:
+		typedef std::vector< resource::ptr > resources; 
+		typedef std::unordered_map< std::string, uid > id_map;
+		typedef std::unordered_map< std::string, resource_constructor_func > constructor_map;
+
+	private:
+		resources       m_data;
+		id_map          m_id_map;
+		constructor_map m_constructors;
+	};
+
+}
+
+#endif // NV_RESOURCE_MANAGER_HH
Index: /trunk/src/resource_manager.cc
===================================================================
--- /trunk/src/resource_manager.cc	(revision 7)
+++ /trunk/src/resource_manager.cc	(revision 7)
@@ -0,0 +1,39 @@
+// Copyright (C) 2012-2013 ChaosForge / Kornel Kisielewicz
+// http://chaosforge.org/
+//
+// This file is part of NV Libraries.
+// For conditions of distribution and use, see copyright notice in nv.hh
+
+#include <nv/resource_manager.hh>
+
+using namespace nv;
+
+resource_manager::resource_manager()
+{
+
+}
+
+resource::ptr resource_manager::get_raw_resource(uint32 id) const
+{
+	return m_data[ id ];
+}
+
+resource::ptr resource_manager::get_raw_resource(const std::string& id) const
+{
+	auto i = m_id_map.find( id );
+	if ( i != m_id_map.end() )
+	{
+		return m_data[ i->second ];
+	}
+	return resource::ptr();
+}
+
+void resource_manager::register_resource_type( const std::string& name, resource_constructor_func c )
+{
+	m_constructors[ name ] = c;
+}
+
+resource_manager::~resource_manager()
+{
+
+}
