From f314a86b77885c6ae33e9673f28fcc1f5a98f5e5 Mon Sep 17 00:00:00 2001 From: josh Date: Sun, 18 Oct 2009 15:50:01 +0000 Subject: [PATCH] migrating to TextureLoader interface git-svn-id: svn://anubis/misc/TextureCache@183 bd8a9e45-a331-0410-811e-c64571078777 --- Makefile | 12 ++++++------ TextureCache.h | 25 +++++++++++++++++++++++++ TextureCache.hh | 20 -------------------- 3 files changed, 31 insertions(+), 26 deletions(-) create mode 100644 TextureCache.h delete mode 100644 TextureCache.hh diff --git a/Makefile b/Makefile index 19fec6d..bde2547 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,12 @@ -CXX := g++ -CXXFLAGS := -O2 -OBJS := TextureCache.o +TARGET := TextureCache.o +SOURCES := $(wildcard *.cc) +HEADERS := $(wildcard *.h) -all: $(OBJS) +all: $(TARGET) -%.o: %.cc %.hh - $(CXX) -c -o $@ $< $(CXXFLAGS) +$(TARGET): $(SOURCES) $(HEADERS) + $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCES) clean: -rm -f *~ *.o diff --git a/TextureCache.h b/TextureCache.h new file mode 100644 index 0000000..f2c18e5 --- /dev/null +++ b/TextureCache.h @@ -0,0 +1,25 @@ + +#ifndef TEXTURECACHE_H +#define TEXTURECACHE_H TEXTURECACHE_H + +#include +#include +#include + +class TextureCache +{ +public: + GLuint load(const std::string & filename); + +private: + /* methods */ + GLuint loadTexture(const char * filename, + bool mipmaps = false, + int mode = GL_DECAL, + int quality = 1); + + /* data */ + std::map< std::string, GLuint > m_cache; +}; + +#endif diff --git a/TextureCache.hh b/TextureCache.hh deleted file mode 100644 index 25a9d06..0000000 --- a/TextureCache.hh +++ /dev/null @@ -1,20 +0,0 @@ - -#include -#include -#include - -class TextureCache -{ -public: - GLuint load(const std::string & filename); - -private: - /* methods */ - GLuint loadTexture(const char * filename, - bool mipmaps = false, - int mode = GL_DECAL, - int quality = 1); - - /* data */ - std::map< std::string, GLuint > m_cache; -};