25#ifndef SFML_TEXTURE_HPP
26#define SFML_TEXTURE_HPP
96 bool create(
unsigned int width,
unsigned int height);
277 void update(
const Uint8* pixels,
unsigned int width,
unsigned int height,
unsigned int x,
unsigned int y);
501 static unsigned int getValidSize(
unsigned int size);
508 unsigned int m_texture;
511 mutable bool m_pixelsFlipped;
#define SFML_GRAPHICS_API
GlResource()
Default constructor.
Class for loading, manipulating and saving images.
Base class for all render targets (window, texture, ...).
Target for off-screen 2D rendering into a texture.
void update(const Image &image)
Update the texture from an image.
static unsigned int getMaximumSize()
Get the maximum texture size allowed.
void setSmooth(bool smooth)
Enable or disable the smooth filter.
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.
void update(const Window &window, unsigned int x, unsigned int y)
Update a part of the texture from the contents of a window.
friend class RenderTexture
bool loadFromMemory(const void *data, std::size_t size, const IntRect &area=IntRect())
Load the texture from a file in memory.
Texture()
Default constructor.
bool isSmooth() const
Tell whether the smooth filter is enabled or not.
Texture(const Texture ©)
Copy constructor.
unsigned int getNativeHandle() const
Get the underlying OpenGL handle of the texture.
Image copyToImage() const
Copy the texture pixels to an image.
bool loadFromStream(InputStream &stream, const IntRect &area=IntRect())
Load the texture from a custom stream.
void update(const Image &image, unsigned int x, unsigned int y)
Update a part of the texture from an image.
bool create(unsigned int width, unsigned int height)
Create the texture.
bool loadFromFile(const std::string &filename, const IntRect &area=IntRect())
Load the texture from a file on disk.
Vector2u getSize() const
Return the size of the texture.
friend class RenderTarget
CoordinateType
Types of texture coordinates that can be used for rendering.
@ Pixels
Texture coordinates in range [0 .. size].
@ Normalized
Texture coordinates in range [0 .. 1].
void setRepeated(bool repeated)
Enable or disable repeating.
bool loadFromImage(const Image &image, const IntRect &area=IntRect())
Load the texture from an image.
void update(const Window &window)
Update the texture from the contents of a window.
void update(const Uint8 *pixels)
Update the whole texture from an array of pixels.
static void bind(const Texture *texture, CoordinateType coordinateType=Normalized)
Bind a texture for rendering.
bool isRepeated() const
Tell whether the texture is repeated or not.
Window that serves as a target for OpenGL rendering.
Vector2< unsigned int > Vector2u
unsigned long long Uint64