# Khaotic Engine Reborn: TextureContainer Struct Reference

Loading...
Searching...
No Matches
TextureContainer Struct Reference

## Public Member Functions

std::vector< ID3D11ShaderResourceView * > & | Get (TextureType type) const
std::vector< std::wstring > | GetPaths (TextureType type) const
ID3D11ShaderResourceView * | GetTexture (TextureType type, int index) const
std::wstring | GetTexturePath (TextureType type, int index) const
void | ReleaseAll ()
void | AssignTexture (TextureContainer &textContainer, ID3D11ShaderResourceView *texture, const std::wstring paths, int index)

## Public Attributes

std::vector< ID3D11ShaderResourceView * > | diffuse
std::vector< ID3D11ShaderResourceView * > | normal
std::vector< ID3D11ShaderResourceView * > | specular
std::vector< ID3D11ShaderResourceView * > | alpha
std::vector< std::wstring > | diffusePaths
std::vector< std::wstring > | normalPaths
std::vector< std::wstring > | specularPaths
std::vector< std::wstring > | alphaPaths

## Detailed Description

Definition at line 33 of file model_class.h.

## Member Function Documentation

## AssignTexture()

void TextureContainer::AssignTexture | ( | TextureContainer & | textContainer,
|  | ID3D11ShaderResourceView * | texture,
|  | const std::wstring | paths,
|  | int | index )

inline

Definition at line 105 of file model_class.h.

{
switch (index)
{
case 0:
textContainer.diffuse.push_back(texture);
textContainer.diffusePaths.push_back(paths);
break;
case 1:
textContainer.normal.push_back(texture);
textContainer.normalPaths.push_back(paths);
break;
case 2:
textContainer.specular.push_back(texture);
textContainer.specularPaths.push_back(paths);
break;
case 3:
textContainer.alpha.push_back(texture);
textContainer.alphaPaths.push_back(paths);
break;
default:
textContainer.diffuse.push_back(texture);
textContainer.diffusePaths.push_back(paths);
break;
}
}

## Get()

std::vector< ID3D11ShaderResourceView * > & TextureContainer::Get | ( | TextureType | type | ) | const

inline

Definition at line 50 of file model_class.h.

{
switch (type) {
case TextureType::Diffuse: return const_cast<std::vector<ID3D11ShaderResourceView*>&>(diffuse);
case TextureType::Normal: return const_cast<std::vector<ID3D11ShaderResourceView*>&>(normal);
case TextureType::Specular: return const_cast<std::vector<ID3D11ShaderResourceView*>&>(specular);
case TextureType::Alpha: return const_cast<std::vector<ID3D11ShaderResourceView*>&>(alpha);
default: return const_cast<std::vector<ID3D11ShaderResourceView*>&>(diffuse);
}
}

## GetPaths()

std::vector< std::wstring > TextureContainer::GetPaths | ( | TextureType | type | ) | const

inline

Definition at line 61 of file model_class.h.

{
switch (type)
{
case TextureType::Diffuse: return std::vector<std::wstring>(diffusePaths);
case TextureType::Normal: return std::vector<std::wstring>(normalPaths);
case TextureType::Specular: return std::vector<std::wstring>(specularPaths);
case TextureType::Alpha: return std::vector<std::wstring>(alphaPaths);
default: return std::vector<std::wstring>(diffusePaths);
}
}

## GetTexture()

ID3D11ShaderResourceView * TextureContainer::GetTexture | ( | TextureType | type,
|  | int | index ) const

inline

Definition at line 74 of file model_class.h.

{
auto& vec = Get(type);
if (index >= 0 && index < vec.size())
return vec[index];
return nullptr;
}

## GetTexturePath()

std::wstring TextureContainer::GetTexturePath | ( | TextureType | type,
|  | int | index ) const

inline

Definition at line 82 of file model_class.h.

{
std::vector<std::wstring> path = GetPaths(type);
if (index >= 0 && index < path.size())
return path[index];
return L"";
}

## ReleaseAll()

void TextureContainer::ReleaseAll | ( |  | ) |

inline

Definition at line 92 of file model_class.h.

{
ReleaseVector(diffuse);
ReleaseVector(normal);
ReleaseVector(specular);
ReleaseVector(alpha);
ReleaseVector(diffusePaths);
ReleaseVector(normalPaths);
ReleaseVector(specularPaths);
ReleaseVector(alphaPaths);
}

## Member Data Documentation

## alpha

std::vector<ID3D11ShaderResourceView*> TextureContainer::alpha

Definition at line 40 of file model_class.h.

## alphaPaths

std::vector<std::wstring> TextureContainer::alphaPaths

Definition at line 46 of file model_class.h.

## diffuse

std::vector<ID3D11ShaderResourceView*> TextureContainer::diffuse

Definition at line 37 of file model_class.h.

## diffusePaths

std::vector<std::wstring> TextureContainer::diffusePaths

Definition at line 43 of file model_class.h.

## normal

std::vector<ID3D11ShaderResourceView*> TextureContainer::normal

Definition at line 38 of file model_class.h.

## normalPaths

std::vector<std::wstring> TextureContainer::normalPaths

Definition at line 44 of file model_class.h.

## specular

std::vector<ID3D11ShaderResourceView*> TextureContainer::specular

Definition at line 39 of file model_class.h.

## specularPaths

std::vector<std::wstring> TextureContainer::specularPaths

Definition at line 45 of file model_class.h.

The documentation for this struct was generated from the following file:

- enginecustom/src/inc/system/model_class.h