18 #ifndef INCLUDED_TEXTUREMANAGER
19 #define INCLUDED_TEXTUREMANAGER
27 #include <boost/weak_ptr.hpp>
236 void Bind(
size_t unit = 0);
291 #endif // INCLUDED_TEXTUREMANAGER
friend struct TextureCacheCmp
bool GenerateCachedTexture(const VfsPath &path, VfsPath &outputPath)
Synchronously converts and compresses and saves the texture, and returns the output path (minus a "ca...
CTexturePtr CreateTexture(const CTextureProperties &props)
Create a texture with the given GL properties.
void Prefetch()
Activate the prefetching optimisation for this texture.
CTexture(Handle handle, const CTextureProperties &props, CTextureManagerImpl *textureManager)
Represents the filename and GL parameters of a texture, for passing to CTextureManager::CreateTexture...
const CTextureProperties m_Properties
NONCOPYABLE(CTextureManager)
bool IsLoaded()
Returns whether the texture data is currently loaded.
CTextureManagerImpl * m_TextureManager
boost::weak_ptr< CTexture > m_Self
size_t GetWidth() const
Returns the width (in pixels) of the current texture.
Texture manager with asynchronous loading and automatic DDS conversion/compression.
void SetWrap(GLint wrap_s, GLint wrap_t)
Set wrapping mode (typically GL_REPEAT, GL_CLAMP_TO_EDGE, etc), separately for S and T...
bool MakeProgress()
Work on asynchronous texture loading operations, if any.
CTextureManager(PIVFS vfs, bool highQuality, bool disableGL)
Construct texture manager.
u32 GetBaseColour() const
Returns the ARGB value of the lowest mipmap level (i.e.
void SetFilter(GLint filter)
Set min/mag filter mode (typically GL_LINEAR_MIPMAP_LINEAR, GL_NEAREST, etc).
bool HasAlpha() const
Returns whether the current texture has an alpha channel.
Represents a texture object.
size_t GetHeight() const
Returns the height (in pixels) of the current texture.
CTextureProperties(const VfsPath &path)
Use the given texture name, and default GL parameters.
Handle GetHandle()
Returns a ogl_tex handle, for later binding.
i64 Handle
`handle' representing a reference to a resource (sound, texture, etc.)
void SetMaxAnisotropy(float aniso)
Set maximum anisotropy value.
CTexturePtr GetErrorTexture()
Returns a magenta texture.
void SetHandle(Handle handle, bool takeOwnership=false)
Replace the Handle stored by this object.
bool TryLoad()
Attempt to load the texture data quickly, as with Bind().
enum CTexture::@17 m_State
void Bind(size_t unit=0)
Bind the texture to the given GL texture unit.
static Handle handle(size_t idx, u64 tag)
void SetWrap(GLint wrap)
Set wrapping mode (typically GL_REPEAT, GL_CLAMP_TO_EDGE, etc).
friend struct TextureCacheCmp
shared_ptr< CTexture > CTexturePtr