mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-28 13:46:13 +01:00
Updated sfShader_bind and sfTexture_bind
This commit is contained in:
1 parent
de75c6a122
commit
44288a186c
4 files changed
+44
-23
No files matched your search
@@ -352,16 +352,22 @@ CSFML_GRAPHICS_API void sfShader_setCurrentTextureParameter(sfShader* shader, co
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Bind a shader for rendering (activate it)
|
/// \brief Bind a shader for rendering (activate it)
|
||||||
///
|
///
|
||||||
/// This function is normally for internal use only, unless
|
/// This function is not part of the graphics API, it mustn't be
|
||||||
/// you want to use the shader with a custom OpenGL rendering
|
/// used when drawing SFML entities. It must be used only if you
|
||||||
/// instead of a SFML drawable.
|
/// mix sfShader with OpenGL code.
|
||||||
|
///
|
||||||
/// \code
|
/// \code
|
||||||
/// sfWindow_setActive(window, sfTrue);
|
/// sfShader *s1, *s2;
|
||||||
/// sfShader_bind(shader);
|
/// ...
|
||||||
/// ... render OpenGL geometry ...
|
/// sfShader_bind(s1);
|
||||||
|
/// // draw OpenGL stuff that use s1...
|
||||||
|
/// sfShader_bind(s2);
|
||||||
|
/// // draw OpenGL stuff that use s2...
|
||||||
|
/// sfShader_bind(0);
|
||||||
|
/// // draw OpenGL stuff that use no shader...
|
||||||
/// \endcode
|
/// \endcode
|
||||||
///
|
///
|
||||||
/// \param shader Shader to bind
|
/// \param shader Shader to bind, can be null to use no shader
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfShader_bind(const sfShader* shader);
|
CSFML_GRAPHICS_API void sfShader_bind(const sfShader* shader);
|
||||||
|
|||||||
@@ -177,14 +177,6 @@ CSFML_GRAPHICS_API void sfTexture_updateFromWindow(sfTexture* texture, const sfW
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfTexture_updateFromRenderWindow(sfTexture* texture, const sfRenderWindow* renderWindow, unsigned int x, unsigned int y);
|
CSFML_GRAPHICS_API void sfTexture_updateFromRenderWindow(sfTexture* texture, const sfRenderWindow* renderWindow, unsigned int x, unsigned int y);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
|
||||||
/// \brief Activate a texture for rendering
|
|
||||||
///
|
|
||||||
/// \param texture Texture to bind
|
|
||||||
///
|
|
||||||
////////////////////////////////////////////////////////////
|
|
||||||
CSFML_GRAPHICS_API void sfTexture_bind(const sfTexture* texture);
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Enable or disable the smooth filter on a texture
|
/// \brief Enable or disable the smooth filter on a texture
|
||||||
///
|
///
|
||||||
@@ -237,6 +229,29 @@ CSFML_GRAPHICS_API void sfTexture_setRepeated(sfTexture* texture, sfBool repeate
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API sfBool sfTexture_isRepeated(const sfTexture* texture);
|
CSFML_GRAPHICS_API sfBool sfTexture_isRepeated(const sfTexture* texture);
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Bind a texture for rendering
|
||||||
|
///
|
||||||
|
/// This function is not part of the graphics API, it mustn't be
|
||||||
|
/// used when drawing SFML entities. It must be used only if you
|
||||||
|
/// mix sfTexture with OpenGL code.
|
||||||
|
///
|
||||||
|
/// \code
|
||||||
|
/// sfTexture *t1, *t2;
|
||||||
|
/// ...
|
||||||
|
/// sfTexture_bind(t1);
|
||||||
|
/// // draw OpenGL stuff that use t1...
|
||||||
|
/// sfTexture_bind(t2);
|
||||||
|
/// // draw OpenGL stuff that use t2...
|
||||||
|
/// sfTexture_bind(NULL);
|
||||||
|
/// // draw OpenGL stuff that use no texture...
|
||||||
|
/// \endcode
|
||||||
|
///
|
||||||
|
/// \param texture Pointer to the texture to bind, can be null to use no texture
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
CSFML_GRAPHICS_API void sfTexture_bind(const sfTexture* texture);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the maximum texture size allowed
|
/// \brief Get the maximum texture size allowed
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ void sfShader_setCurrentTextureParameter(sfShader* shader, const char* name)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void sfShader_bind(const sfShader* shader)
|
void sfShader_bind(const sfShader* shader)
|
||||||
{
|
{
|
||||||
CSFML_CALL(shader, bind());
|
sf::Shader::bind(shader ? &shader->This : NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -208,13 +208,6 @@ void sfTexture_updateFromRenderWindow(sfTexture* texture, const sfRenderWindow*
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
|
||||||
void sfTexture_bind(const sfTexture* texture)
|
|
||||||
{
|
|
||||||
CSFML_CALL_PTR(texture, bind());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void sfTexture_setSmooth(sfTexture* texture, sfBool smooth)
|
void sfTexture_setSmooth(sfTexture* texture, sfBool smooth)
|
||||||
{
|
{
|
||||||
@@ -249,6 +242,13 @@ sfBool sfTexture_isRepeated(const sfTexture* texture)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
void sfTexture_bind(const sfTexture* texture)
|
||||||
|
{
|
||||||
|
sf::Texture::bind(texture ? texture->This : NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
unsigned int sfTexture_getMaximumSize()
|
unsigned int sfTexture_getMaximumSize()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user