Loading...
Searching...
No Matches
Texture.hpp
Go to the documentation of this file.
7// In no event will the authors be held liable for any damages arising from the use of this software.
304 [[nodiscard]] bool loadFromFile(const std::filesystem::path& filename, bool sRgb = false, const IntRect& area = {});
330 [[nodiscard]] bool loadFromMemory(const void* data, std::size_t size, bool sRgb = false, const IntRect& area = {});
355 [[nodiscard]] bool loadFromStream(InputStream& stream, bool sRgb = false, const IntRect& area = {});
380 [[nodiscard]] bool loadFromImage(const Image& image, bool sRgb = false, const IntRect& area = {});
700 static void bind(const Texture* texture, CoordinateType coordinateType = CoordinateType::Normalized);
Base class for all render targets (window, texture, ...)
Definition RenderTarget.hpp:63
static unsigned int getMaximumSize()
Get the maximum texture size allowed.
static void bind(const Texture *texture, CoordinateType coordinateType=CoordinateType::Normalized)
Bind a texture for rendering.
void update(const std::uint8_t *pixels, Vector2u size, Vector2u dest)
Update a part of the texture from an array of pixels.
void update(const Texture &texture, Vector2u dest)
Update a part of this texture from another texture.
unsigned int getNativeHandle() const
Get the underlying OpenGL handle of the texture.
bool loadFromStream(InputStream &stream, bool sRgb=false, const IntRect &area={})
Load the texture from a custom stream.
bool isSrgb() const
Tell whether the texture source is converted from sRGB or not.
void swap(Texture &right) noexcept
Swap the contents of this texture with those of another.
bool loadFromMemory(const void *data, std::size_t size, bool sRgb=false, const IntRect &area={})
Load the texture from a file in memory.
void update(const Window &window, Vector2u dest)
Update a part of the texture from the contents of a window.
void update(const Image &image, Vector2u dest)
Update a part of the texture from an image.
void update(const Window &window)
Update the texture from the contents of a window.
void update(const std::uint8_t *pixels)
Update the whole texture from an array of pixels.
bool loadFromImage(const Image &image, bool sRgb=false, const IntRect &area={})
Load the texture from an image.
void update(const Texture &texture)
Update a part of this texture from another texture.
CoordinateType
Types of texture coordinates that can be used for rendering.
Definition CoordinateType.hpp:38
Definition AudioResource.hpp:36
void swap(Texture &left, Texture &right) noexcept
Swap the contents of one texture with those of another.