Bromeon
Static Public Member Functions | Public Member Functions | Related Functions
thor::Resources::ShaderKey Class Reference

Predefined key class for sf::Shader resources. More...

List of all members.

Static Public Member Functions

static ShaderKey FromFile (const std::string &fileName, const std::string &tag="")
 Load sf::Shader from file name.
static ShaderKey FromMemory (const std::string &shaderCode, const std::string &tag="")
 Load sf::Shader from source code in memory.

Public Member Functions

MovedPtr< sf::Shader > Load () const
 Loads the shader as specified by the static functions.
void Swap (ShaderKey &other)
 Exchanges the contents of *this with other.

Related Functions

bool thor::Resources::operator< (const ShaderKey &lhs, const ShaderKey &rhs)
 Comparison operator for strict weak ordering.
void thor::Resources::swap (ShaderKey &lhs, ShaderKey &rhs)
 Swaps two sf::Shader resource keys.

Detailed Description

Predefined key class for sf::Shader resources.

You can use this class to specifiy the access and loading of sf::Shader resources in a ResourceManager.


Member Function Documentation

static ShaderKey thor::Resources::ShaderKey::FromFile ( const std::string &  fileName,
const std::string &  tag = "" 
) [static]

Load sf::Shader from file name.

Parameters:
fileNameThe name of the file from which you want to load the sf::Shader.
tagIf an existing key has the same loading parameters, you can use this ID to create a distinct key.
See also:
sf::Shader::LoadFromFile()
static ShaderKey thor::Resources::ShaderKey::FromMemory ( const std::string &  shaderCode,
const std::string &  tag = "" 
) [static]

Load sf::Shader from source code in memory.

Parameters:
shaderCodeString containing the source code of the shader.
tagIf an existing key has the same loading parameters, you can use this ID to create a distinct key.
See also:
sf::Shader::LoadFromMemory()

Loads the shader as specified by the static functions.

Returns:
Movable smart pointer to the allocated sf::Shader, or null pointer at loading failure.

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