mirror of
https://github.com/SFML/CSFML.git
synced 2026-10-27 05:26:13 +01:00
Implements sfTextureCoordinateType with sfTexture_bind
This commit is contained in:
1 parent
c27917ebf9
commit
30dbf80507
2 files changed
+12
-3
No files matched your search
@@ -36,6 +36,15 @@
|
|||||||
#include <SFML/System/Vector2.h>
|
#include <SFML/System/Vector2.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Types of texture coordinates that can be used for rendering.
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
sfTextureNormalized, ///< sfTexture coordinates in range [0 .. 1].
|
||||||
|
sfTexturePixels ///< sfTexture coordinates in range [0 .. size].
|
||||||
|
} sfTextureCoordinateType;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Create a new texture
|
/// \brief Create a new texture
|
||||||
@@ -351,7 +360,7 @@ CSFML_GRAPHICS_API unsigned int sfTexture_getNativeHandle(const sfTexture* textu
|
|||||||
/// \param texture Pointer to the texture to bind, can be null to use no texture
|
/// \param texture Pointer to the texture to bind, can be null to use no texture
|
||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
CSFML_GRAPHICS_API void sfTexture_bind(const sfTexture* texture);
|
CSFML_GRAPHICS_API void sfTexture_bind(const sfTexture* texture, sfTextureCoordinateType type);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief Get the maximum texture size allowed
|
/// \brief Get the maximum texture size allowed
|
||||||
|
|||||||
@@ -290,9 +290,9 @@ unsigned int sfTexture_getNativeHandle(const sfTexture* texture)
|
|||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void sfTexture_bind(const sfTexture* texture)
|
void sfTexture_bind(const sfTexture* texture, sfTextureCoordinateType type)
|
||||||
{
|
{
|
||||||
sf::Texture::bind(texture ? texture->This : NULL);
|
sf::Texture::bind(texture ? texture->This : NULL, static_cast<sf::Texture::CoordinateType>(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user