![]() |
Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
|
A texture with a single alpha channel. More...
#include <gf/Texture.h>
Public Member Functions | |
AlphaTexture () | |
Constructor. More... | |
AlphaTexture (Vector2i size) | |
Create the texture. More... | |
![]() | |
BareTexture (Format format) | |
Constructor. More... | |
BareTexture (Format format, Vector2i size, const uint8_t *data) | |
Create the texture. More... | |
Format | getFormat () const |
Get the format of the texture. More... | |
unsigned | getName () const |
Get the internal representation of the texture. More... | |
Vector2i | getSize () const |
Return the size of the texture. More... | |
void | setSmooth (bool smooth=true) |
Enable or disable the smooth filter. More... | |
bool | isSmooth () const noexcept |
Check if the smooth filter is enabled or not. More... | |
void | setRepeated (bool repeated=true) |
Enable or disable repeating. More... | |
bool | isRepeated () const noexcept |
Check if the texture is repeated or not. More... | |
void | update (const uint8_t *data) |
Update the whole texture from an array of pixels. More... | |
void | update (const uint8_t *data, const RectI &rect) |
Update a part of the texture from an array of pixels. More... | |
void | resize (Vector2i size, const uint8_t *data=nullptr) |
Resize a texture. More... | |
RectF | computeTextureCoords (const RectI &rect) const |
Compute normalized texture coordinates. More... | |
bool | generateMipmap () |
Generate a mipmap using the current texture data. More... | |
Additional Inherited Members | |
![]() | |
enum class | Format { Color , Alpha } |
Format of the texture. More... | |
![]() | |
static void | bind (const BareTexture *texture) |
Bind a texture for rendering. More... | |
A texture with a single alpha channel.
This texture is used internally by gf::Font
gf::AlphaTexture::AlphaTexture | ( | ) |
Constructor.
No texture is created
gf::AlphaTexture::AlphaTexture | ( | Vector2i | size | ) |
Create the texture.
size | Size of the texture |