![]() |
MAGE
v0.171.0
Matthias Advanced Game Engine
|
Namespaces | |
anonymous_namespace{texture_loader.cpp} | |
Classes | |
class | MDLReader |
class | MDLWriter |
class | MSHReader |
class | MSHWriter |
class | MTLReader |
class | OBJReader |
class | SpriteFontReader |
Functions | |
void | ImportFontFromFile (const std::filesystem::path &path, ID3D11Device &device, SpriteFontOutput &output, const SpriteFontDescriptor &desc) |
void | ImportMaterialFromFile (const std::filesystem::path &path, ResourceManager &resource_manaer, std::vector< Material > &materials) |
template<typename VertexT , typename IndexT > | |
void | ImportMDLModelFromFile (const std::filesystem::path &path, const ResourceManager &resource_manager, ModelOutput< VertexT, IndexT > &model_output) |
template<typename VertexT , typename IndexT > | |
void | ExportMDLModelToFile (const std::filesystem::path &path, const ModelOutput< VertexT, IndexT > &model_output) |
template<typename VertexT , typename IndexT > | |
void | ImportModelFromFile (const std::filesystem::path &path, ResourceManager &resource_manager, ModelOutput< VertexT, IndexT > &model_output, const MeshDescriptor< VertexT, IndexT > &mesh_desc=MeshDescriptor< VertexT, IndexT >()) |
template<typename VertexT , typename IndexT > | |
void | ExportModelToFile (const std::filesystem::path &path, const ModelOutput< VertexT, IndexT > &model_output) |
template<typename VertexT , typename IndexT > | |
void | ImportMSHMeshFromFile (const std::filesystem::path &path, std::vector< VertexT > &vertices, std::vector< IndexT > &indices) |
template<typename VertexT , typename IndexT > | |
void | ExportMSHMeshToFile (const std::filesystem::path &path, const std::vector< VertexT > &vertices, const std::vector< IndexT > &indices) |
void | ImportMTLMaterialFromFile (const std::filesystem::path &path, ResourceManager &resource_manager, std::vector< Material > &materials) |
template<typename VertexT , typename IndexT > | |
void | ImportOBJMeshFromFile (const std::filesystem::path &path, ResourceManager &resource_manager, ModelOutput< VertexT, IndexT > &model_output, const MeshDescriptor< VertexT, IndexT > &mesh_desc=MeshDescriptor< VertexT, IndexT >()) |
void | ImportSpriteFontFromFile (const std::filesystem::path &path, ID3D11Device &device, SpriteFontOutput &output, const SpriteFontDescriptor &desc) |
void | ImportTextureFromFile (const std::filesystem::path &path, ID3D11Device &device, NotNull< ID3D11ShaderResourceView ** > texture_srv) |
void | ExportTextureToFile (const std::filesystem::path &path, ID3D11DeviceContext &device_context, ID3D11Resource &texture) |
void mage::rendering::loader::ExportMDLModelToFile | ( | const std::filesystem::path & | path, |
const ModelOutput< VertexT, IndexT > & | model_output | ||
) |
Exports the given model to the MDL file associated with the given path.
VertexT | The vertex type. |
IndexT | The index type. |
[in] | path | A reference to the path. |
[in] | model_output | A reference to the model output. |
Exception | Failed to export the model to file. |
void mage::rendering::loader::ExportModelToFile | ( | const std::filesystem::path & | path, |
const ModelOutput< VertexT, IndexT > & | model_output | ||
) |
Exports the model to the file associated with the given path.
VertexT | The vertex type. |
IndexT | The index type. |
[in] | path | A reference to the path. |
[in] | model_output | A reference to the model output. |
Exception | Failed to export the model to file. |
void mage::rendering::loader::ExportMSHMeshToFile | ( | const std::filesystem::path & | path, |
const std::vector< VertexT > & | vertices, | ||
const std::vector< IndexT > & | indices | ||
) |
Exports the given mesh to the MSH file associated with the given path.
VertexT | The vertex type. |
IndexT | The index type. |
[in] | path | A reference to the path. |
[in] | vertices | A reference to a vector containing the vertices of the mesh. |
[in] | indices | A reference to a vector containing the indices of the mesh. |
Exception | Failed to export the mesh to file. |
void mage::rendering::loader::ExportTextureToFile | ( | const std::filesystem::path & | path, |
ID3D11DeviceContext & | device_context, | ||
ID3D11Resource & | texture | ||
) |
Exports the texture to the file associated with the given path.
[in] | path | A reference to the path. |
[in,out] | device_context | A reference to the device context. |
[in,out] | texture | A reference to the texture. |
Exception | Failed to export the texture to file. |
void mage::rendering::loader::ImportFontFromFile | ( | const std::filesystem::path & | path, |
ID3D11Device & | device, | ||
SpriteFontOutput & | output, | ||
const SpriteFontDescriptor & | desc = SpriteFontDescriptor() |
||
) |
Imports the font from the FONT file associated with the given path.
[in] | path | A reference to the path. |
[in,out] | device | A reference to the device. |
[in,out] | output | A reference to the sprite font output. |
[in] | desc | A reference to the sprite font descriptor. |
Exception | Failed to import the sprite font from file. |
void mage::rendering::loader::ImportMaterialFromFile | ( | const std::filesystem::path & | path, |
ResourceManager & | resource_manaer, | ||
std::vector< Material > & | materials | ||
) |
Imports the materials from the file associated with the given path.
[in] | path | A reference to the path. |
[in,out] | resource_manaer | A reference to the resource manager. |
[in,out] | materials | A reference to a vector containing the materials. |
Exception | Failed to import the materials from file. |
void mage::rendering::loader::ImportMDLModelFromFile | ( | const std::filesystem::path & | path, |
const ResourceManager & | resource_manager, | ||
ModelOutput< VertexT, IndexT > & | model_output | ||
) |
Imports the model from the MDL file associated with the given path.
VertexT | The vertex type. |
IndexT | The index type. |
[in] | resource_manager | A reference to the resource manager. |
[in] | path | A reference to the path. |
[in,out] | model_output | A reference to the model output. |
Exception | Failed to import the model from file. |
void mage::rendering::loader::ImportModelFromFile | ( | const std::filesystem::path & | path, |
ResourceManager & | resource_manager, | ||
ModelOutput< VertexT, IndexT > & | model_output, | ||
const MeshDescriptor< VertexT, IndexT > & | mesh_desc = MeshDescriptor< VertexT, IndexT >() |
||
) |
Imports the model from the file associated with the given path.
VertexT | The vertex type. |
IndexT | The index type. |
[in] | path | A reference to the path. |
[in,out] | resource_manager | A reference to the resource manager. |
[in,out] | model_output | A reference to the model output. |
[in] | mesh_desc | A reference to the mesh descriptor. |
Exception | Failed to import the model from file. |
void mage::rendering::loader::ImportMSHMeshFromFile | ( | const std::filesystem::path & | path, |
std::vector< VertexT > & | vertices, | ||
std::vector< IndexT > & | indices | ||
) |
Imports the mesh from the MSH file associated with the given path.
VertexT | The vertex type. |
IndexT | The index type. |
[in] | path | A reference to the path. |
[in,out] | vertices | A reference to a vector containing the vertices of the mesh. |
[in,out] | indices | A reference to a vector containing the indices of the mesh. |
Exception | Failed to import the mesh from file. |
void mage::rendering::loader::ImportMTLMaterialFromFile | ( | const std::filesystem::path & | path, |
ResourceManager & | resource_manager, | ||
std::vector< Material > & | materials | ||
) |
Imports the materials from the MTL file associated with the given path.
[in] | path | A reference to the path. |
[in,out] | resource_manager | A reference to the resource manager. |
[in,out] | materials | A reference to a vector containing the materials. |
Exception | Failed to import the mesh from file. |
void mage::rendering::loader::ImportOBJMeshFromFile | ( | const std::filesystem::path & | path, |
ResourceManager & | resource_manager, | ||
ModelOutput< VertexT, IndexT > & | model_output, | ||
const MeshDescriptor< VertexT, IndexT > & | mesh_desc = MeshDescriptor< VertexT, IndexT >() |
||
) |
Imports a mesh from the OBJ file associated with the given path.
VertexT | The vertex type. |
IndexT | The index type. |
[in] | path | A reference to the path. |
[in,out] | resource_manager | A reference to the resource manager. |
[in,out] | model_output | A reference to the model output. |
[in] | mesh_desc | A reference to the mesh descriptor. |
Exception | Failed to import the mesh from file. |
void mage::rendering::loader::ImportSpriteFontFromFile | ( | const std::filesystem::path & | path, |
ID3D11Device & | device, | ||
SpriteFontOutput & | output, | ||
const SpriteFontDescriptor & | desc = SpriteFontDescriptor() |
||
) |
Imports the sprite font from the file associated with the given path.
[in] | path | A reference to the path. |
[in,out] | device | A reference to the device. |
[in,out] | output | A reference to the sprite font output. |
[in] | desc | A reference to the sprite font descriptor. |
Exception | Failed to import the sprite font from file. |
void mage::rendering::loader::ImportTextureFromFile | ( | const std::filesystem::path & | path, |
ID3D11Device & | device, | ||
NotNull< ID3D11ShaderResourceView **> | texture_srv | ||
) |
Imports the texture from the file associated with the given path.
[in] | path | A reference to the path. |
[in,out] | device | A reference to the device. |
[out] | texture_srv | A pointer to a pointer to a shader resource view. |
Exception | Failed to import the texture from file. |
constexpr const_zstring mage::rendering::loader::g_font_token_magic = "MAGEfont" |
constexpr const char mage::rendering::loader::g_mdl_token_comment = '#' |
constexpr const_zstring mage::rendering::loader::g_mdl_token_material_library = "mtllib" |
constexpr const_zstring mage::rendering::loader::g_mdl_token_submodel = "s" |
constexpr const_zstring mage::rendering::loader::g_msh_token_magic = "MAGEmesh" |
constexpr const_zstring mage::rendering::loader::g_mtl_token_base_color = "base_color" |
constexpr const_zstring mage::rendering::loader::g_mtl_token_base_color_texture = "texture_base_color" |
constexpr const char mage::rendering::loader::g_mtl_token_comment = '#' |
constexpr const_zstring mage::rendering::loader::g_mtl_token_material_declaration = "newmtl" |
constexpr const_zstring mage::rendering::loader::g_mtl_token_material_texture = "texture_material" |
constexpr const_zstring mage::rendering::loader::g_mtl_token_metalness = "metalness" |
constexpr const_zstring mage::rendering::loader::g_mtl_token_normal_texture = "texture_normal" |
constexpr const_zstring mage::rendering::loader::g_mtl_token_opaque = "opaque" |
constexpr const_zstring mage::rendering::loader::g_mtl_token_radiance = "radiance" |
constexpr const_zstring mage::rendering::loader::g_mtl_token_roughness = "roughness" |
constexpr const_zstring mage::rendering::loader::g_mtl_token_transparent = "transparent" |
constexpr const char mage::rendering::loader::g_obj_token_comment = '#' |
constexpr const_zstring mage::rendering::loader::g_obj_token_face = "f" |
constexpr const_zstring mage::rendering::loader::g_obj_token_group = "g" |
constexpr const_zstring mage::rendering::loader::g_obj_token_material_library = "mtllib" |
constexpr const_zstring mage::rendering::loader::g_obj_token_material_use = "usemtl" |
constexpr const_zstring mage::rendering::loader::g_obj_token_normal = "vn" |
constexpr const_zstring mage::rendering::loader::g_obj_token_object = "o" |
constexpr const_zstring mage::rendering::loader::g_obj_token_smoothing_group = "s" |
constexpr const_zstring mage::rendering::loader::g_obj_token_texture = "vt" |
constexpr const_zstring mage::rendering::loader::g_obj_token_vertex = "v" |