25 #ifndef CPP3DS_TEXTURE_HPP
26 #define CPP3DS_TEXTURE_HPP
31 #include <cpp3ds/Config.hpp>
32 #include <cpp3ds/Graphics/Image.hpp>
33 #include <cpp3ds/Window/GlResource.hpp>
96 bool create(
unsigned int width,
unsigned int height);
255 void update(
const Uint8* pixels);
277 void update(
const Uint8* pixels,
unsigned int width,
unsigned int height,
unsigned int x,
unsigned int y);
314 void update(
const Image& image,
unsigned int x,
unsigned int y);
351 void update(
const Window& window,
unsigned int x,
unsigned int y);
486 static unsigned int getValidSize(
unsigned int size);
493 unsigned int m_texture;
496 mutable bool m_pixelsFlipped;
503 #endif // SFML_TEXTURE_HPP
Window that serves as a target for OpenGL rendering.
bool create(unsigned int width, unsigned int height)
Create the texture.
Texture()
Default constructor.
void update(const Uint8 *pixels)
Update the whole texture from an array of pixels.
void setRepeated(bool repeated)
Enable or disable repeating.
Vector2u getSize() const
Return the size of the texture.
Texture coordinates in range [0 .. size].
CoordinateType
Types of texture coordinates that can be used for rendering.
bool loadFromFile(const std::string &filename, const IntRect &area=IntRect())
Load the texture from a file on disk.
bool loadFromMemory(const void *data, std::size_t size, const IntRect &area=IntRect())
Load the texture from a file in memory.
Texture coordinates in range [0 .. 1].
static unsigned int getMaximumSize()
Get the maximum texture size allowed.
bool isSmooth() const
Tell whether the smooth filter is enabled or not.
void setSmooth(bool smooth)
Enable or disable the smooth filter.
Texture & operator=(const Texture &right)
Overload of assignment operator.
Class for loading, manipulating and saving images.
Base class for all render targets (window, texture, ...)
bool isRepeated() const
Tell whether the texture is repeated or not.
bool loadFromImage(const Image &image, const IntRect &area=IntRect())
Load the texture from an image.
bool loadFromStream(cpp3ds::InputStream &stream, const IntRect &area=IntRect())
Load the texture from a custom stream.
static void bind(const Texture *texture, CoordinateType coordinateType=Normalized)
Bind a texture for rendering.
Image copyToImage() const
Copy the texture pixels to an image.
Target for off-screen 2D rendering into a texture.
Base class for classes that require an OpenGL context.
some things could easily be broken///////