Gamedev Framework (gf)  0.17.0
A C++14 framework for 2D games
Public Member Functions | List of all members
gf::AlphaTexture Class Reference

A texture with a single alpha channel. More...

#include <gf/Texture.h>

Inheritance diagram for gf::AlphaTexture:
Inheritance graph
[legend]

Public Member Functions

 AlphaTexture ()
 Constructor. More...
 
 AlphaTexture (Vector2i size)
 Create the texture. More...
 
- Public Member Functions inherited from gf::BareTexture
 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

- Public Types inherited from gf::BareTexture
enum  Format {
  Format::Color,
  Format::Alpha
}
 Format of the texture. More...
 
- Static Public Member Functions inherited from gf::BareTexture
static void bind (const BareTexture *texture)
 Bind a texture for rendering. More...
 

Detailed Description

A texture with a single alpha channel.

This texture is used internally by gf::Font

Constructor & Destructor Documentation

◆ AlphaTexture() [1/2]

gf::AlphaTexture::AlphaTexture ( )

Constructor.

No texture is created

◆ AlphaTexture() [2/2]

gf::AlphaTexture::AlphaTexture ( Vector2i  size)

Create the texture.

Parameters
sizeSize of the texture