Sirikata
libogre/src/ManualMaterialLoader.hpp
Go to the documentation of this file.
00001 // Copyright (c) 2011 Sirikata Authors. All rights reserved.
00002 // Use of this source code is governed by a BSD-style license that can
00003 // be found in the LICENSE file.
00004 
00005 #ifndef _SIRIKATA_OGRE_MANUAL_MATERIAL_LOADER_HPP_
00006 #define _SIRIKATA_OGRE_MANUAL_MATERIAL_LOADER_HPP_
00007 
00008 #include <sirikata/ogre/Platform.hpp>
00009 #include <sirikata/ogre/Util.hpp>
00010 #include <OgreResource.h>
00011 #include <sirikata/mesh/Visual.hpp>
00012 #include <sirikata/mesh/Meshdata.hpp>
00013 #include <sirikata/core/transfer/URI.hpp>
00014 
00015 namespace Sirikata {
00016 namespace Graphics {
00017 
00018 typedef std::map<String, String> TextureBindingsMap;
00019 typedef std::tr1::shared_ptr<TextureBindingsMap> TextureBindingsMapPtr;
00020 
00021 class ManualMaterialLoader : public Ogre::ManualResourceLoader {
00022 public:
00023     ManualMaterialLoader(
00024         Mesh::VisualPtr visptr,
00025         const String name,
00026         const Mesh::MaterialEffectInfo&mat,
00027         const Transfer::URI& uri,
00028         TextureBindingsMapPtr textureFingerprints);
00029 
00030     void prepareResource(Ogre::Resource*r){}
00031     void loadResource(Ogre::Resource *r);
00032 
00033 private:
00034     Mesh::VisualPtr mVisualPtr;
00035     const Mesh::MaterialEffectInfo* mMat;
00036     String mName;
00037     Transfer::URI mURI;
00038     TextureBindingsMapPtr mTextureFingerprints;
00039 };
00040 
00041 
00042 } // namespace Graphics
00043 } // namespace Sirikata
00044 
00045 #endif //_SIRIKATA_OGRE_MANUAL_MATERIAL_LOADER_HPP_