migrating to TextureLoader interface

git-svn-id: svn://anubis/misc/TextureCache@183 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
josh 2009-10-18 15:50:01 +00:00
parent 9dcbb5222c
commit f314a86b77
3 changed files with 31 additions and 26 deletions

View File

@ -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

25
TextureCache.h Normal file
View File

@ -0,0 +1,25 @@
#ifndef TEXTURECACHE_H
#define TEXTURECACHE_H TEXTURECACHE_H
#include <GL/gl.h>
#include <map>
#include <string>
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

View File

@ -1,20 +0,0 @@
#include <GL/gl.h>
#include <map>
#include <string>
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;
};