00001
00002 #ifndef __H_TEXTURE_H_
00003 #define __H_TEXTURE_H_
00004
00005 namespace std {}
00006 using namespace std;
00007
00008 #include <SDL_opengl.h>
00009
00010 #include "H_Geometry.h"
00011
00012 #include <map>
00013 #include <string>
00014
00015
00016
00017 class Texture
00018 {
00019 public:
00020 class Reference
00021 {
00022 public:
00023 static Reference* GetReference(const char *FileName);
00024 static void SetRenderMode(unsigned int NewRenderMode);
00025 void Use();
00026 void UnReference();
00027 ~Reference();
00028
00029 Reference();
00030 void LoadImage(const char *FileName);
00031 void ApplyMode(unsigned int NewTextureMode);
00032 private:
00033 static map<string,Reference> &LoadedTextures();
00034 string Name;
00035 int ReferenceCount;
00036 GLuint TexIndex;
00037
00038 friend class Texture;
00039 };
00040 public:
00041 Texture(const char *name);
00042 string Title();
00043 void Use();
00044 static void SetRenderMode(unsigned int NewRenderMode);
00045 ~Texture();
00046 private:
00047 Reference *MyReference;
00048 };
00049
00050 #endif //__H_PICTURE_H_