resources.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2007-2008 Martin Pieuchot 
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
00017  * USA
00018  */
00019 
00020 #ifndef _WX_OGRE_RESOURCES_H_ 
00021 #define _WX_OGRE_RESOURCES_H_ 
00022 
00023 #include <Ogre.h>
00024 
00025 #include "wx/ogre/utils.h"
00026 
00031 class wxOgreResources : public Ogre::Singleton<wxOgreResources> 
00032 {
00033 // Is it possible to have longer names? :p
00034 #define DEFAULT_GROUP Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
00035 
00036 public:
00037 
00038     wxOgreResources();
00039 
00041     void InitialiseAllResources();
00042 
00044     void AddResource(const Ogre::String& path,
00045                      const Ogre::String& type = "FileSystem",
00046                      const Ogre::String& group = DEFAULT_GROUP);
00047 
00052     bool LoadResourceFile(const Ogre::String& file);
00053 
00055     Ogre::StringVectorPtr GetResourcesList(const Ogre::String& group,
00056                                            const Ogre::String& pattern);
00057 
00059     Ogre::StringVectorPtr GetResourcesList(const Ogre::String& group);
00060 
00062     Ogre::StringVector GetResourcesGroups();
00063 
00064 private:
00065 
00066     Ogre::ResourceGroupManager* m_rmgr;
00067 
00068     DECLARE_OGRE_SINGLETON(wxOgreResources)
00069 };
00070 
00071 #endif