|
CUGL 1.3
Cornell University Game Library
|
46 #ifndef __CU_TEXTURE_LOADER_H__
47 #define __CU_TEXTURE_LOADER_H__
48 #include <cugl/assets/CULoader.h>
49 #include <cugl/renderer/CUTexture.h>
90 #pragma mark Asset Loading
102 void parseAtlas(
const std::shared_ptr<JsonValue>& json,
const std::shared_ptr<Texture>& texture);
116 SDL_Surface*
preload(
const std::string& source);
135 void materialize(
const std::string& key, SDL_Surface* surface, LoaderCallback callback);
165 void materialize(
const std::shared_ptr<JsonValue>& json, SDL_Surface* surface, LoaderCallback callback);
186 virtual bool read(
const std::string& key,
const std::string& source,
187 LoaderCallback callback,
bool async)
override;
218 virtual bool read(
const std::shared_ptr<JsonValue>& json,
219 LoaderCallback callback,
bool async)
override;
237 virtual bool purge(
const std::shared_ptr<JsonValue>& json)
override;
241 #pragma mark Constructors
278 static std::shared_ptr<TextureLoader>
alloc() {
279 std::shared_ptr<TextureLoader> result = std::make_shared<TextureLoader>();
280 return (result->init() ? result :
nullptr);
294 static std::shared_ptr<TextureLoader>
alloc(
const std::shared_ptr<ThreadPool>& threads) {
295 std::shared_ptr<TextureLoader> result = std::make_shared<TextureLoader>();
296 return (result->init(threads) ? result :
nullptr);
300 #pragma mark Properties
static std::shared_ptr< TextureLoader > alloc()
Definition: CUTextureLoader.h:278
void setWrapT(GLuint wrap)
Definition: CUTextureLoader.h:384
Definition: CULoader.h:749
void parseAtlas(const std::shared_ptr< JsonValue > &json, const std::shared_ptr< Texture > &texture)
void dispose() override
Definition: CUTextureLoader.h:261
GLuint _magfilter
Definition: CUTextureLoader.h:82
GLuint getMinFilter() const
Definition: CUTextureLoader.h:311
GLuint _minfilter
Definition: CUTextureLoader.h:80
std::shared_ptr< ThreadPool > _loader
Definition: CULoader.h:105
virtual bool purge(const std::shared_ptr< JsonValue > &json) override
void setMagFilter(GLuint magFilter)
Definition: CUTextureLoader.h:344
static std::shared_ptr< TextureLoader > alloc(const std::shared_ptr< ThreadPool > &threads)
Definition: CUTextureLoader.h:294
bool hasMipMaps() const
Definition: CUTextureLoader.h:395
GLuint _wrapt
Definition: CUTextureLoader.h:86
Definition: CUTextureLoader.h:73
GLuint getWrapT() const
Definition: CUTextureLoader.h:374
std::unordered_map< std::string, std::shared_ptr< Texture > > _assets
Definition: CULoader.h:752
bool _mipmaps
Definition: CUTextureLoader.h:88
virtual bool read(const std::string &key, const std::string &source, LoaderCallback callback, bool async) override
GLuint getMagFilter() const
Definition: CUTextureLoader.h:333
void materialize(const std::string &key, SDL_Surface *surface, LoaderCallback callback)
SDL_Surface * preload(const std::string &source)
void setWrapS(GLuint wrap)
Definition: CUTextureLoader.h:364
void setMinFilter(GLuint minFilter)
Definition: CUTextureLoader.h:322
GLuint _wraps
Definition: CUTextureLoader.h:84
void setMipMaps(bool flag)
Definition: CUTextureLoader.h:406
GLuint getWrapS() const
Definition: CUTextureLoader.h:354