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);
558 static unsigned int getValidSize(
unsigned int size);
567 void invalidateMipmap();
574 unsigned int m_texture;
578 mutable bool m_pixelsFlipped;
579 bool m_fboAttachment;
#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.
bool generateMipmap()
Generate a mipmap using the current texture data.
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.
bool isSrgb() const
Tell whether the texture source is converted from sRGB or not.
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.
void setSrgb(bool sRgb)
Enable or disable conversion from sRGB.
Window that serves as a target for OpenGL rendering.
Vector2< unsigned int > Vector2u
unsigned long long Uint64