Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray3D::cXTextureMgr Class Reference

#include <cXTextureMgr.h>

Inheritance diagram for Gray3D::cXTextureMgr:
Gray3D::cDXBase

Public Member Functions

 cXTextureMgr (cDXDevice *pDXDev)
 
virtual ~cXTextureMgr (void)
 
cStringF MakeModelPath (const FILECHAR_t *pszName)
 
cStringF get_LastModelName () const noexcept
 
cStringF get_LastModelDir () const noexcept
 
cXTextureFilePtr FindTextureFile (cStringF &sName, size_t &nTextureFileSize, TEXTURELOAD_t uLoadFlags) const
 
cXTextureFilePtr LoadTextureFile (const FILECHAR_t *pszName, TEXTURELOAD_t uLoadFlags)
 
 UNITTEST_FRIEND (cXTextureMgr)
 
- Public Member Functions inherited from Gray3D::cDXBase
 cDXBase (cDXDevice *pDXDev=nullptr) noexcept
 
virtual ~cDXBase ()
 
ID3DDeviceget_D3DDev () const noexcept
 
bool isInitDevice () const noexcept
 
bool isLostDevice () const noexcept
 
virtual HRESULT InitDeviceObjects (cDXDevice *pDXDev)
 
virtual HRESULT OnResetDeviceX ()
 
virtual HRESULT OnLostDeviceX ()
 
virtual HRESULT DeleteDeviceObjects ()
 
 UNITTEST_FRIEND (cDXBase)
 

Public Attributes

bool m_bPreLoadAllDefault
 don't wait until texture is needed. pre-load it now. IsClientModeLoading More...
 
- Public Attributes inherited from Gray3D::cDXBase
cDXDevicem_pDXDev
 What device is this attached to (or should be)? InitDeviceObjects() was called and DeleteDeviceObjects() was not. More...
 
cIUnkPtr< ID3DDevicem_pD3DDev
 

Detailed Description

Load textures and manage a named cache for textures. NOTE: Some textures might be loaded onto the cDXDevice. and unloaded/disposed if not needed. reloaded on demand. Manage caching of textures in system (or device?) memory as they may be needed for rendering multiple objects. search for textures that may be in relative paths.

Note
NOT a singleton as it must be specific to a cDXDevice.

Constructor & Destructor Documentation

◆ cXTextureMgr()

Gray3D::cXTextureMgr::cXTextureMgr ( cDXDevice pDXDev)

◆ ~cXTextureMgr()

Gray3D::cXTextureMgr::~cXTextureMgr ( void  )
virtual

Member Function Documentation

◆ FindTextureFile()

cXTextureFilePtr Gray3D::cXTextureMgr::FindTextureFile ( cStringF sName,
size_t &  nTextureFileSize,
TEXTURELOAD_t  uLoadFlags 
) const

Find the file (on disk) for the texture. Maybe load it (or not) depending on TEXTURELOAD_t uLoadFlags

◆ get_LastModelDir()

cStringF Gray3D::cXTextureMgr::get_LastModelDir ( ) const
inlinenoexcept

◆ get_LastModelName()

cStringF Gray3D::cXTextureMgr::get_LastModelName ( ) const
inlinenoexcept

◆ LoadTextureFile()

cXTextureFilePtr Gray3D::cXTextureMgr::LoadTextureFile ( const FILECHAR_t pszName,
TEXTURELOAD_t  uLoadFlags 
)

Load a texture from a file into the texture cache.

  • TexName = relative to data dir. or relative to model?

◆ MakeModelPath()

cStringF Gray3D::cXTextureMgr::MakeModelPath ( const FILECHAR_t pszName)

we are loading a model. save the relative path to its relative pathed child textures.

Note
All models have children, textures, etc for use with TEXTURELOAD_MODELCHILD

◆ UNITTEST_FRIEND()

Gray3D::cXTextureMgr::UNITTEST_FRIEND ( cXTextureMgr  )

Member Data Documentation

◆ m_bPreLoadAllDefault

bool Gray3D::cXTextureMgr::m_bPreLoadAllDefault

don't wait until texture is needed. pre-load it now. IsClientModeLoading


The documentation for this class was generated from the following files: