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, sf::Shader::Type shaderType, const std::string &tag="")
 Load sf::Shader from file name.
static ShaderKey FromFile (const std::string &vertexShaderFilename, const std::string &fragmentShaderFilename, const std::string &tag="")
 Load sf::Shader from two file names.
static ShaderKey FromMemory (const std::string &shaderCode, sf::Shader::Type shaderType, const std::string &tag="")
 Load sf::Shader from source code in memory.
static ShaderKey FromMemory (const std::string &vertexShaderCode, const std::string &fragmentShaderCode, const std::string &tag="")
 Load sf::Shader from two source codes in memory.
static ShaderKey FromStream (sf::InputStream &stream, sf::Shader::Type shaderType, const std::string &tag="")
 Load sf::Shader from input stream.
static ShaderKey FromStream (sf::InputStream &vertexShaderStream, sf::InputStream &fragmentShaderStream, const std::string &tag="")
 Load sf::Shader from two input streams.

Public Member Functions

MovedPtr< sf::Shader, NoCopyLoad () 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,
sf::Shader::Type  shaderType,
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.
shaderTypeType of shader (vertex or fragment)
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::FromFile ( const std::string &  vertexShaderFilename,
const std::string &  fragmentShaderFilename,
const std::string &  tag = "" 
) [static]

Load sf::Shader from two file names.

Parameters:
vertexShaderFilenameThe name of the file from which you want to load the vertex shader.
fragmentShaderFilenameThe name of the file from which you want to load the fragment 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,
sf::Shader::Type  shaderType,
const std::string &  tag = "" 
) [static]

Load sf::Shader from source code in memory.

Parameters:
shaderCodeString containing the source code of the shader.
shaderTypeType of shader (vertex or fragment)
tagIf an existing key has the same loading parameters, you can use this ID to create a distinct key.
See also:
sf::Shader::LoadFromMemory()
static ShaderKey thor::Resources::ShaderKey::FromMemory ( const std::string &  vertexShaderCode,
const std::string &  fragmentShaderCode,
const std::string &  tag = "" 
) [static]

Load sf::Shader from two source codes in memory.

Parameters:
vertexShaderCodeString containing the source code of the vertex shader.
fragmentShaderCodeString containing the source code of the fragment 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()
static ShaderKey thor::Resources::ShaderKey::FromStream ( sf::InputStream &  stream,
sf::Shader::Type  shaderType,
const std::string &  tag = "" 
) [static]

Load sf::Shader from input stream.

Parameters:
streamSource stream to read from.
shaderTypeType of shader (vertex or fragment)
tagIf an existing key has the same loading parameters, you can use this ID to create a distinct key.
See also:
sf::Shader::LoadFromStream()
static ShaderKey thor::Resources::ShaderKey::FromStream ( sf::InputStream &  vertexShaderStream,
sf::InputStream &  fragmentShaderStream,
const std::string &  tag = "" 
) [static]

Load sf::Shader from two input streams.

Parameters:
vertexShaderStreamSource stream to read the vertex shader from.
fragmentShaderStreamSource stream to read the fragment shader from.
tagIf an existing key has the same loading parameters, you can use this ID to create a distinct key.
See also:
sf::Shader::LoadFromStream()

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: