29#include "GraphicsApi.h"
30#include "GraphicsHandle.h"
37#ifndef DOXYGEN_SHOULD_SKIP_THIS
50 static void gen(
int n,
unsigned* resources);
51 static void del(
int n,
const unsigned* resources);
126 return m_handle.getName();
444#ifndef DOXYGEN_SHOULD_SKIP_THIS
A texture with a single alpha channel.
Definition: Texture.h:427
AlphaTexture()
Constructor.
AlphaTexture(Vector2i size)
Create the texture.
An image that lives in the graphic memory that can be used for drawing.
Definition: Texture.h:79
RectF computeTextureCoords(const RectI &rect) const
Compute normalized texture coordinates.
bool generateMipmap()
Generate a mipmap using the current texture data.
void setRepeated(bool repeated=true)
Enable or disable repeating.
unsigned getName() const
Get the internal representation of the texture.
Definition: Texture.h:125
Format getFormat() const
Get the format of the texture.
Definition: Texture.h:114
BareTexture(Format format, Vector2i size, const uint8_t *data)
Create the texture.
void setSmooth(bool smooth=true)
Enable or disable the smooth filter.
void update(const uint8_t *data, const RectI &rect)
Update a part of the texture from an array of pixels.
void update(const uint8_t *data)
Update the whole texture from an array of pixels.
Format
Format of the texture.
Definition: Texture.h:86
void resize(Vector2i size, const uint8_t *data=nullptr)
Resize a texture.
static void bind(const BareTexture *texture)
Bind a texture for rendering.
bool isSmooth() const noexcept
Check if the smooth filter is enabled or not.
Definition: Texture.h:161
bool isRepeated() const noexcept
Check if the texture is repeated or not.
Definition: Texture.h:193
BareTexture(Format format)
Constructor.
Vector2i getSize() const
Return the size of the texture.
Definition: Texture.h:134
Class for loading, manipulating and saving images.
Definition: Image.h:81
A texture for colored images.
Definition: Texture.h:313
Image copyToImage() const
Copy the texture pixels to an image.
Texture(Vector2i size)
Create the texture.
void update(const Image &image)
Update the texture from an image.
Texture(InputStream &stream)
Load the texture from a custom stream.
Texture(const Path &filename)
Load the texture from a file on disk.
Texture(InputStream &stream, const RectI &area)
Load the texture from a sub-area of a custom stream.
Texture(Span< const uint8_t > content)
Load the texture from a file in memory.
Texture(const Image &image)
Load the texture from an image.
Texture(const Image &image, const RectI &area)
Load the texture from a sub-area of an image.
Texture(const Path &filename, const RectI &area)
Load the texture from a sub-area of a file on disk.
Texture(Span< const uint8_t > content, const RectI &area)
Load the texture from a sub-area of a file in memory.
ColorF Color
Instantiation of ColorBase for float
Definition: Color.h:415
std::filesystem::path Path
A path in the filesystem.
Definition: Path.h:40
GraphicsTag
A tag to represent various GPU resources.
Definition: GraphicsHandle.h:37
The namespace for gf classes.
static void del(int n, const unsigned *resources)
static void gen(int n, unsigned *resources)
A trait to handle creation and deletion of GPU resources.
Definition: GraphicsHandle.h:48