18#ifndef INCLUDED_TEXTUREMANAGER
19#define INCLUDED_TEXTUREMANAGER
96 std::unique_ptr<Renderer::Backend::ITexture> backendTexture);
344 std::unique_ptr<Renderer::Backend::ITexture> texture,
349 std::unique_ptr<Renderer::Backend::ITexture> backendTexture,
Definition: TextureManager.cpp:117
Definition: TextureManager.cpp:360
Texture manager with asynchronous loading and automatic DDS conversion/compression.
Definition: TextureManager.h:73
const CTexturePtr & GetErrorTexture()
Returns a magenta texture.
Definition: TextureManager.cpp:1072
const CTexturePtr & GetWhiteTexture()
Returns a single color RGBA texture with CColor(1.0f, 1.0f, 1.0f, 1.0f).
Definition: TextureManager.cpp:1077
CTextureManagerImpl * m
Definition: TextureManager.h:168
const CTexturePtr & GetTransparentTexture()
Returns a single color RGBA texture with CColor(0.0f, 0.0f, 0.0f, 0.0f).
Definition: TextureManager.cpp:1082
NONCOPYABLE(CTextureManager)
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:1108
CTexturePtr CreateTexture(const CTextureProperties &props)
Create a texture with the given properties.
Definition: TextureManager.cpp:1056
CTexturePtr WrapBackendTexture(std::unique_ptr< Renderer::Backend::ITexture > backendTexture)
Wraps a backend texture.
Definition: TextureManager.cpp:1061
bool TextureExists(const VfsPath &path) const
Returns true if the given texture exists.
Definition: TextureManager.cpp:1067
void OnQualityChanged()
Should be called on any quality or anisotropic change.
Definition: TextureManager.cpp:1123
CTextureManager(PIVFS vfs, bool highQuality, Renderer::Backend::IDevice *device)
Construct texture manager.
Definition: TextureManager.cpp:1046
bool MakeProgress()
Work on asynchronous texture loading operations, if any.
Definition: TextureManager.cpp:1097
const CTexturePtr & GetBlackTextureCube()
Returns a single color RGBA texture cube with CColor(0.0f, 0.0f, 0.0f, 1.0f).
Definition: TextureManager.cpp:1092
size_t GetBytesUploaded() const
Returns total number of bytes uploaded for all current texture.
Definition: TextureManager.cpp:1118
bool MakeUploadProgress(Renderer::Backend::IDeviceCommandContext *deviceCommandContext)
Work on asynchronous texture uploading operations, if any.
Definition: TextureManager.cpp:1102
~CTextureManager()
Definition: TextureManager.cpp:1051
const CTexturePtr & GetAlphaGradientTexture()
Returns a white RGBA texture with alpha gradient.
Definition: TextureManager.cpp:1087
VfsPath GetCachedPath(const VfsPath &path) const
Definition: TextureManager.cpp:1113
Represents the filename and GL parameters of a texture, for passing to CTextureManager::CreateTexture...
Definition: TextureManager.h:176
friend struct TextureCacheCmp
Definition: TextureManager.h:178
Renderer::Backend::Format m_FormatOverride
Definition: TextureManager.h:250
bool m_AnisotropicFilterEnabled
Definition: TextureManager.h:249
VfsPath m_Path
Definition: TextureManager.h:243
CTextureProperties(const VfsPath &path)
Use the given texture name, and default GL parameters.
Definition: TextureManager.h:186
CTextureProperties(const VfsPath &path, const Renderer::Backend::Format formatOverride)
Definition: TextureManager.h:191
Renderer::Backend::Sampler::AddressMode m_AddressModeU
Definition: TextureManager.h:245
void SetIgnoreQuality(bool ignore)
Definition: TextureManager.h:239
void SetAddressMode(const Renderer::Backend::Sampler::AddressMode addressMode)
Set sampler address mode.
Definition: TextureManager.h:200
Renderer::Backend::Sampler::AddressMode m_AddressModeV
Definition: TextureManager.h:247
bool m_IgnoreQuality
Definition: TextureManager.h:252
void SetAnisotropicFilter(const bool enabled)
The value of max anisotropy is set by options.
Definition: TextureManager.h:220
void SetAddressMode(const Renderer::Backend::Sampler::AddressMode addressModeU, const Renderer::Backend::Sampler::AddressMode addressModeV)
Set sampler address mode separately for different coordinates.
Definition: TextureManager.h:208
Represents a texture object.
Definition: TextureManager.h:262
friend struct TextureCacheCmp
Definition: TextureManager.h:338
Renderer::Backend::ITexture * m_FallbackBackendTexture
Definition: TextureManager.h:356
bool IsUploaded() const
Returns whether the texture data is currently uploaded.
Definition: TextureManager.h:325
u32 GetBaseColor() const
Returns the ARGB value of the lowest mipmap level (i.e.
Definition: TextureManager.cpp:1034
size_t GetHeight() const
Returns the height (in pixels) of the current texture.
Definition: TextureManager.cpp:1018
Renderer::Backend::ITexture * GetBackendTexture()
Returns a backend texture if successfully uploaded, else fallback.
Definition: TextureManager.cpp:966
CTexture(std::unique_ptr< Renderer::Backend::ITexture > texture, Renderer::Backend::ITexture *fallback, const CTextureProperties &props, CTextureManagerImpl *textureManager)
Definition: TextureManager.cpp:923
CTextureManagerImpl * m_TextureManager
Definition: TextureManager.h:374
bool HasAlpha() const
Returns whether the current texture has an alpha channel.
Definition: TextureManager.cpp:1023
const CTextureProperties m_Properties
Definition: TextureManager.h:352
uint32_t m_BaseLevelOffset
Definition: TextureManager.h:360
void ResetBackendTexture(std::unique_ptr< Renderer::Backend::ITexture > backendTexture, Renderer::Backend::ITexture *fallbackBackendTexture)
Definition: TextureManager.cpp:1005
std::unique_ptr< Tex > m_TextureData
Definition: TextureManager.h:358
void UploadBackendTextureIfNeeded(Renderer::Backend::IDeviceCommandContext *deviceCommandContext)
Uploads a texture data to a backend texture if successfully loaded.
Definition: TextureManager.cpp:935
std::unique_ptr< Renderer::Backend::ITexture > m_BackendTexture
Definition: TextureManager.h:354
size_t GetWidth() const
Returns the width (in pixels) of the current texture.
Definition: TextureManager.cpp:1013
size_t GetUploadedSize() const
Returns total number of bytes uploaded for this texture.
Definition: TextureManager.cpp:1039
bool TryLoad()
Attempt to load the texture data quickly, as with GetUploadedBackendTextureIfNeeded().
Definition: TextureManager.cpp:976
std::weak_ptr< CTexture > m_Self
Definition: TextureManager.h:378
enum CTexture::@12 m_State
bool IsLoaded() const
Returns whether the texture data is currently loaded.
Definition: TextureManager.h:320
@ HIGH_NEEDS_CONVERTING
Definition: TextureManager.h:368
@ UNLOADED
Definition: TextureManager.h:364
@ PREFETCH_IS_CONVERTING
Definition: TextureManager.h:367
@ PREFETCH_NEEDS_LOADING
Definition: TextureManager.h:365
@ PREFETCH_NEEDS_CONVERTING
Definition: TextureManager.h:366
@ HIGH_IS_CONVERTING
Definition: TextureManager.h:369
@ LOADED
Definition: TextureManager.h:370
@ UPLOADED
Definition: TextureManager.h:371
size_t m_UploadedSize
Definition: TextureManager.h:359
void Prefetch()
Activate the prefetching optimisation for this texture.
Definition: TextureManager.cpp:994
u32 m_BaseColor
Definition: TextureManager.h:357
Definition: IDeviceCommandContext.h:42
Definition: ITexture.h:34
std::shared_ptr< CTexture > CTexturePtr
Definition: Texture.h:23
AddressMode
Definition: Sampler.h:42
Format
Definition: Format.h:28
Definition: vfs_util.cpp:39
Definition: TextureManager.cpp:341
Definition: TextureManager.cpp:318
uint32_t u32
Definition: types.h:39
std::shared_ptr< IVFS > PIVFS
Definition: vfs.h:220
unsigned int uint32_t
Definition: wposix_types.h:53