25 #ifndef SFML_TEXTURE_HPP
26 #define SFML_TEXTURE_HPP
31 #include <SFML/Graphics/Export.hpp>
32 #include <SFML/Graphics/Image.hpp>
33 #include <SFML/Window/GlResource.hpp>
97 bool create(
unsigned int width,
unsigned int height);
278 void update(
const Uint8* pixels,
unsigned int width,
unsigned int height,
unsigned int x,
unsigned int y);
605 static unsigned int getValidSize(
unsigned int size);
614 void invalidateMipmap();
621 unsigned int m_texture;
625 mutable bool m_pixelsFlipped;
626 bool m_fboAttachment;
634 #endif // SFML_TEXTURE_HPP
void update(const Image &image, unsigned int x, unsigned int y)
Update a part of the texture from an image.
bool loadFromImage(const Image &image, const IntRect &area=IntRect())
Load the texture from an image.
void update(const Texture &texture)
Update a part of this texture from another texture.
void update(const Window &window)
Update the texture from the contents of a window.
void swap(Texture &right)
Swap the contents of this texture with those of another.
bool loadFromMemory(const void *data, std::size_t size, const IntRect &area=IntRect())
Load the texture from a file in memory.
bool loadFromFile(const std::string &filename, const IntRect &area=IntRect())
Load the texture from a file on disk.
bool isSrgb() const
Tell whether the texture source is converted from sRGB or not.
void setRepeated(bool repeated)
Enable or disable repeating.
Window that serves as a target for OpenGL rendering.
Image living on the graphics card that can be used for drawing.
Graphical text that can be drawn to a render target.
Base class for classes that require an OpenGL context.
bool isSmooth() const
Tell whether the smooth filter is enabled or not.
static void bind(const Texture *texture, CoordinateType coordinateType=Normalized)
Bind a texture for rendering.
static unsigned int getMaximumSize()
Get the maximum texture size allowed.
void setSmooth(bool smooth)
Enable or disable the smooth filter.
Image copyToImage() const
Copy the texture pixels to an image.
Vector2u getSize() const
Return the size of the texture.
unsigned int getNativeHandle() const
Get the underlying OpenGL handle of the texture.
void update(const Uint8 *pixels)
Update the whole texture from an array of pixels.
@ Normalized
Texture coordinates in range [0 .. 1].
void update(const Uint8 *pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y)
Update a part of the texture from an array of pixels.
Target for off-screen 2D rendering into a texture.
Class for loading, manipulating and saving images.
CoordinateType
Types of texture coordinates that can be used for rendering.
bool create(unsigned int width, unsigned int height)
Create the texture.
void setSrgb(bool sRgb)
Enable or disable conversion from sRGB.
Base class for all render targets (window, texture, ...)
bool generateMipmap()
Generate a mipmap using the current texture data.
Texture()
Default constructor.
bool loadFromStream(InputStream &stream, const IntRect &area=IntRect())
Load the texture from a custom stream.
Texture(const Texture ©)
Copy constructor.
void update(const Texture &texture, unsigned int x, unsigned int y)
Update a part of this texture from another texture.
void update(const Window &window, unsigned int x, unsigned int y)
Update a part of the texture from the contents of a window.
bool isRepeated() const
Tell whether the texture is repeated or not.
void update(const Image &image)
Update the texture from an image.