41
41
class TextureResource : public Resource {
42
int colourFormat(SDL_Surface* surface);
43
void loadTexture(std::string file, bool mipmaps, bool clamp, bool trilinear, bool external_file);
48
GLenum colourFormat(SDL_Surface* surface);
47
TextureResource(std::string name, bool mipmaps, bool clamp, bool trilinear, bool external_file);
57
TextureResource(int width, int height, bool mipmaps, GLint wrap, GLenum format, GLubyte* data = 0);
58
TextureResource(const std::string& filename, bool mipmaps, GLint wrap, bool external);
60
void setWrapStyle(GLint wrap);
62
void setFiltering(GLint min_filter, GLint mag_filter);
63
void setDefaultFiltering();
71
void load(bool reload = false);
48
75
~TextureResource();
51
78
class TextureManager : public ResourceManager {
81
void addResource(TextureResource* r);
54
TextureResource* grabFile(std::string name, bool mipmaps=true, bool clamp=true, bool trilinear=false);
55
TextureResource* grab(std::string file, bool mipmaps=true, bool clamp=true, bool trilinear=false, bool external_file = false);
87
TextureResource* grabFile(const std::string& filename, bool mipmaps = true, GLint wrap = GL_CLAMP_TO_EDGE);
88
TextureResource* grab(const std::string& filename, bool mipmaps = true, GLint wrap = GL_CLAMP_TO_EDGE, bool external_file = false);
90
TextureResource* create(int width, int height, bool mipmaps, GLint wrap, GLenum format, GLubyte* data = 0);
91
TextureResource* create(GLenum target = GL_TEXTURE_2D);
58
97
extern TextureManager texturemanager;