Nameless Engine
Loading...
Searching...
No Matches
ne::TextureImporter Class Reference

#include <TextureImporter.h>

Static Public Member Functions

static constexpr const char * getImportedFileName ()
 
static std::optional< ErrorimportTexture (const std::filesystem::path &pathToTexture, TextureImportFormat textureImportFormat, const std::string &sPathToOutputDirRelativeRes, const std::string &sOutputDirectoryName)
 

Static Private Attributes

static constexpr auto pImportedFileName = "t"
 

Detailed Description

Provides static functions for importing files in special formats (such as PNG) as textures into engine formats.

Member Function Documentation

◆ getImportedFileName()

static constexpr const char * ne::TextureImporter::getImportedFileName ( )
inlinestaticconstexpr

Returns file name that importer adds before extension to the imported texture file.

Returns
File name.

◆ importTexture()

std::optional< Error > ne::TextureImporter::importTexture ( const std::filesystem::path &  pathToTexture,
TextureImportFormat  textureImportFormat,
const std::string &  sPathToOutputDirRelativeRes,
const std::string &  sOutputDirectoryName 
)
static

Blocks the current thread, converts the specified texture into engine-supported formats and creates new textures in the specified directory relative to res directory.

Parameters
pathToTexturePath to the texture image to convert.
textureImportFormatFormat of the imported texture.
sPathToOutputDirRelativeResPath to a directory relative to the res directory that will store results, for example: game/player/textures (located at res/game/player/textures).
sOutputDirectoryNameName of the new directory that does not exists yet but will be created in the specified directory (relative to the res) to store the results (allowed characters A-z and numbers 0-9, maximum length is 10 characters), for example: diffuse.
Returns
Error if something went wrong.

Member Data Documentation

◆ pImportedFileName

constexpr auto ne::TextureImporter::pImportedFileName = "t"
staticconstexprprivate

File name that we add before extension to the imported texture file.


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