migrating to TextureLoader interface
git-svn-id: svn://anubis/misc/TextureCache@183 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
parent
9dcbb5222c
commit
f314a86b77
12
Makefile
12
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
|
||||
|
25
TextureCache.h
Normal file
25
TextureCache.h
Normal 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
|
@ -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;
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user