Gamedev Framework (gf)  0.12.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...
 
bool create (Vector2u size)
 Create the texture. More...
 
- Public Member Functions inherited from gf::BareTexture
 BareTexture (Format format)
 Constructor. More...
 
 ~BareTexture ()
 Destructor. More...
 
 BareTexture (const BareTexture &)=delete
 Deleted copy constructor. More...
 
BareTextureoperator= (const BareTexture &)=delete
 Deleted copy assignment. More...
 
 BareTexture (BareTexture &&other) noexcept
 Move constructor. More...
 
BareTextureoperator= (BareTexture &&other) noexcept
 Move assignment. More...
 
Format getFormat () const
 Get the format of the texture. More...
 
unsigned getName () const
 Get the internal representation of the texture. More...
 
Vector2u 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 RectU &rect)
 Update a part of the texture from an array of pixels. More...
 
RectF computeTextureCoords (const RectU &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...
 
- Protected Member Functions inherited from gf::BareTexture
bool create (Vector2u size, const uint8_t *data)
 Create the texture. More...
 

Detailed Description

A texture with a single alpha channel.

This texture is used internally by gf::Font

Constructor & Destructor Documentation

◆ AlphaTexture()

gf::AlphaTexture::AlphaTexture ( )

Constructor.

No texture is created

Member Function Documentation

◆ create()

bool gf::AlphaTexture::create ( Vector2u  size)

Create the texture.

If this function fails, the texture is left unchanged.

Parameters
sizeSize of the texture
Returns
True if creation was successful