Updated CSFML

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1813 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
laurentgom 2011-03-21 17:34:26 +00:00
parent f632253adc
commit 10a782b871
2 changed files with 21 additions and 2 deletions

View File

@ -115,11 +115,20 @@ CSFML_API void sfShader_SetParameter4(sfShader* shader, const char* name, float
/// ///
/// \param shader : Shader to modify /// \param shader : Shader to modify
/// \param name : Texture name in the effect /// \param name : Texture name in the effect
/// \param texture : Image to set (pass NULL to use the texture of the object being drawn) /// \param texture : Image to set
/// ///
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
CSFML_API void sfShader_SetTexture(sfShader* shader, const char* name, const sfImage* texture); CSFML_API void sfShader_SetTexture(sfShader* shader, const char* name, const sfImage* texture);
////////////////////////////////////////////////////////////
/// Set the current texture parameter in a shader
///
/// \param shader : Shader to modify
/// \param name : Texture name in the effect
///
////////////////////////////////////////////////////////////
CSFML_API void sfShader_SetCurrentTexture(sfShader* shader, const char* name);
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// Bind a shader for rendering /// Bind a shader for rendering
/// ///

View File

@ -126,7 +126,17 @@ void sfShader_SetParameter4(sfShader* shader, const char* name, float x, float y
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void sfShader_SetTexture(sfShader* shader, const char* name, const sfImage* texture) void sfShader_SetTexture(sfShader* shader, const char* name, const sfImage* texture)
{ {
CSFML_CALL(shader, SetTexture(name, texture && texture->This ? *texture->This : sf::Shader::CurrentTexture)) CSFML_CHECK(texture);
CSFML_CALL(shader, SetTexture(name, *texture->This))
}
////////////////////////////////////////////////////////////
/// Set the current texture parameter in a shader
////////////////////////////////////////////////////////////
void sfShader_SetCurrentTexture(sfShader* shader, const char* name)
{
CSFML_CALL(shader, SetCurrentTexture(name))
} }