Implements sfTextureCoordinateType with sfTexture_bind

This commit is contained in:
Luhrel authored and Lukas Dürrenberger committed 2022-10-27 22:11:25 +02:00
1 parent c27917ebf9
commit 30dbf80507
2 files changed
+12 -3

No files matched your search

+10 -1
View File
@@ -36,6 +36,15 @@
#include <SFML/System/Vector2.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
@@ -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
///
////////////////////////////////////////////////////////////
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
+2 -2
View File
@@ -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));
}