00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KEROSIN_TEXTURESERVER_H
00023 #define KEROSIN_TEXTURESERVER_H
00024
00025 #ifdef HAVE_CONFIG_H
00026 #ifdef PACKAGE_BUGREPORT
00027 #undef PACKAGE_BUGREPORT
00028 #endif
00029 #ifdef PACKAGE_NAME
00030 #undef PACKAGE_NAME
00031 #endif
00032 #ifdef PACKAGE_STRING
00033 #undef PACKAGE_STRING
00034 #endif
00035 #ifdef PACKAGE_TARNAME
00036 #undef PACKAGE_TARNAME
00037 #endif
00038 #ifdef PACKAGE_VERSION
00039 #undef PACKAGE_VERSION
00040 #endif
00041 #include <config.h>
00042 #endif
00043
00044 #include <zeitgeist/class.h>
00045 #include <zeitgeist/leaf.h>
00046
00047 #if HAVE_HASH_MAP
00048 #include <hash_map>
00049 #else
00050 #include <map>
00051 #endif
00052
00053 namespace kerosin
00054 {
00055 #if 0
00056 }
00057 #endif
00058
00059 class OpenGLServer;
00060 class ImageServer;
00061 class Texture;
00062
00063 class TextureServer : public zeitgeist::Leaf
00064 {
00065
00066
00067
00068 private:
00069 #if HAVE_HASH_MAP
00070 typedef std::hash_map<std::string, boost::shared_ptr<Texture> > TTextureCache;
00071 #else
00072 typedef std::map<std::string, boost::shared_ptr<Texture> > TTextureCache;
00073 #endif
00074
00075
00076
00077 public:
00078 TextureServer();
00079 virtual ~TextureServer();
00080
00084 boost::shared_ptr<OpenGLServer> GetOpenGLServer() const;
00085
00087 boost::shared_ptr<Texture> GetTexture(const std::string &name);
00088
00089 protected:
00091 virtual void OnLink();
00092
00094 virtual void OnUnlink();
00095
00096
00097
00098
00099 private:
00101 boost::shared_ptr<OpenGLServer> mOpenGLServer;
00102
00104 boost::shared_ptr<ImageServer> mImageServer;
00105
00107 TTextureCache mTextureCache;
00108 };
00109
00110 DECLARE_CLASS(TextureServer);
00111
00112 }
00113
00114 #endif //KEROSIN_TEXTURESERVER_H