18 #ifndef INCLUDED_TEXTUREMANAGER 19 #define INCLUDED_TEXTUREMANAGER 130 friend struct TextureCacheCmp;
139 m_Path(path), m_Filter(GL_LINEAR_MIPMAP_LINEAR),
140 m_WrapS(GL_REPEAT), m_WrapT(GL_REPEAT), m_Aniso(1.0f), m_Format(0)
152 void SetWrap(GLint wrap) { m_WrapS = wrap; m_WrapT = wrap; }
158 void SetWrap(GLint wrap_s, GLint wrap_t) { m_WrapS = wrap_s; m_WrapT = wrap_t; }
207 friend struct TextureCacheCmp;
223 size_t GetWidth()
const;
228 size_t GetHeight()
const;
233 bool HasAlpha()
const;
240 u32 GetBaseColor()
const;
245 size_t GetUploadedSize()
const;
254 void Bind(
size_t unit = 0);
285 void SetHandle(
Handle handle,
bool takeOwnership =
false);
312 #endif // INCLUDED_TEXTUREMANAGER bool GenerateCachedTexture(const VfsPath &path, VfsPath &outputPath)
Synchronously converts and compresses and saves the texture, and returns the output path (minus a "ca...
Definition: TextureManager.cpp:666
CTexturePtr CreateTexture(const CTextureProperties &props)
Create a texture with the given GL properties.
Definition: TextureManager.cpp:651
Definition: TextureManager.h:295
Definition: TextureManager.cpp:87
Definition: TextureManager.h:296
Handle m_Handle
Definition: TextureManager.h:289
shared_ptr< IVFS > PIVFS
Definition: vfs.h:226
Represents the filename and GL parameters of a texture, for passing to CTextureManager::CreateTexture...
Definition: TextureManager.h:127
GLint m_WrapS
Definition: TextureManager.h:192
const CTextureProperties m_Properties
Definition: TextureManager.h:287
NONCOPYABLE(CTextureManager)
std::weak_ptr< CTexture > m_Self
Definition: TextureManager.h:306
Definition: TextureManager.cpp:39
CTextureManagerImpl * m_TextureManager
Definition: TextureManager.h:302
float m_Aniso
Definition: TextureManager.h:194
Definition: TextureManager.cpp:60
~CTextureManager()
Definition: TextureManager.cpp:646
Texture manager with asynchronous loading and automatic DDS conversion/compression.
Definition: TextureManager.h:71
GLint m_WrapT
Definition: TextureManager.h:193
void SetWrap(GLint wrap_s, GLint wrap_t)
Set wrapping mode (typically GL_REPEAT, GL_CLAMP_TO_EDGE, etc), separately for S and T...
Definition: TextureManager.h:158
void format(BasicFormatter< Char > &f, const Char *format_str, const T &value)
Definition: format.h:1705
VfsPath m_Path
Definition: TextureManager.h:190
Definition: TextureManager.h:293
bool MakeProgress()
Work on asynchronous texture loading operations, if any.
Definition: TextureManager.cpp:661
uint32_t u32
Definition: types.h:39
CTextureManager(PIVFS vfs, bool highQuality, bool disableGL)
Construct texture manager.
Definition: TextureManager.cpp:641
void SetFilter(GLint filter)
Set min/mag filter mode (typically GL_LINEAR_MIPMAP_LINEAR, GL_NEAREST, etc).
Definition: TextureManager.h:147
GLenum m_Format
Definition: TextureManager.h:195
void SetFormatOverride(GLenum format)
Set GL texture upload format, to override the default.
Definition: TextureManager.h:169
u32 m_BaseColor
Definition: TextureManager.h:290
Definition: TextureManager.h:294
Represents a texture object.
Definition: TextureManager.h:204
CTextureProperties(const VfsPath &path)
Use the given texture name, and default GL parameters.
Definition: TextureManager.h:138
CTextureManagerImpl * m
Definition: TextureManager.h:120
i64 Handle
`handle' representing a reference to a resource (sound, texture, etc.)
Definition: handle.h:41
std::shared_ptr< CTexture > CTexturePtr
Definition: Texture.h:22
void SetMaxAnisotropy(float aniso)
Set maximum anisotropy value.
Definition: TextureManager.h:163
CTexturePtr GetErrorTexture()
Returns a magenta texture.
Definition: TextureManager.cpp:656
GLint m_Filter
Definition: TextureManager.h:191
Definition: TextureManager.h:298
Definition: TextureManager.h:297
size_t GetBytesUploaded() const
Returns total number of bytes uploaded for all current texture.
Definition: TextureManager.cpp:671
static Handle handle(size_t idx, u64 tag)
Definition: h_mgr.cpp:121
Definition: vfs_util.cpp:39
void SetWrap(GLint wrap)
Set wrapping mode (typically GL_REPEAT, GL_CLAMP_TO_EDGE, etc).
Definition: TextureManager.h:152
std::size_t hash_value(const CTexturePtr &v)
Definition: TextureManager.cpp:76