FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
Loading...
Searching...
No Matches
fge::Texture Class Reference

This class is a wrapper for the texture manager to allow easy manipulation. More...

#include <C_texture.hpp>

Inheritance diagram for fge::Texture:
fge::manager::BaseDataAccessor< manager::GlobalDataAccessorManagerInfo< texture::TextureManager, &texture::gManager >, manager::DataAccessorOptions::ALLOW_VARIANT_OF_DATAPOINTER_AND_BLOCKPOINTER >

Public Types

using SharedDataType
 
using SharedType
 

Public Member Functions

fge::Vector2u getTextureSize () const
 Get the texture size.
 
SharedType::element_type * retrieveGroup (std::size_t index)
 Retrieve a sub-texture inside this texture group.
 
SharedType::element_type const * retrieveGroup (std::size_t index) const
 
std::size_t groupSize () const
 
virtual void clear ()
 Clear the resource.
 
void reload ()
 Reload the cached resource from the same name.
 
bool valid () const
 Check if the font is valid (not unloaded)
 
SharedDataType const & getSharedBlock () const
 Get the resource block data.
 
SharedType const & getSharedData () const
 Get the shared resource data.
 
std::string const & getName () const
 Get the name of the resource.
 
manager::GlobalDataAccessorManagerInfo< texture::TextureManager, &texture::gManager >::Manager::DataType * retrieve ()
 Retrieve the raw shared pointer from the current resource.
 
manager::GlobalDataAccessorManagerInfo< texture::TextureManager, &texture::gManager >::Manager::DataType const * retrieve () const
 

Detailed Description

This class is a wrapper for the texture manager to allow easy manipulation.

Member Function Documentation

◆ clear()

Clear the resource.

This method clear the resource by setting it to the default/bad "valid" resource.

◆ getName()

std::string const & fge::manager::BaseDataAccessor< manager::GlobalDataAccessorManagerInfo< texture::TextureManager, &texture::gManager >, TOption >::getName ( ) const
nodiscardinherited

Get the name of the resource.

Returns
The name of the resource, or an empty string if the resource is not valid

◆ getSharedBlock()

BaseDataAccessor< manager::GlobalDataAccessorManagerInfo< texture::TextureManager, &texture::gManager >, TOption >::SharedDataType const & fge::manager::BaseDataAccessor< manager::GlobalDataAccessorManagerInfo< texture::TextureManager, &texture::gManager >, TOption >::getSharedBlock ( ) const
nodiscardinherited

Get the resource block data.

Warning
If ALLOW_VARIANT_OF_DATAPOINTER_AND_BLOCKPOINTER is set, this method can a "bad" element.
Returns
The resource block data

◆ getSharedData()

Get the shared resource data.

Returns
The shared resource data

◆ getTextureSize()

fge::Vector2u fge::Texture::getTextureSize ( ) const
nodiscard

Get the texture size.

Returns
The texture size

◆ reload()

Reload the cached resource from the same name.

◆ retrieve()

Retrieve the raw shared pointer from the current resource.

Warning
Will never be nullptr if the manager was correctly initialized.
Returns
The raw resource pointer

◆ retrieveGroup()

SharedType::element_type * fge::Texture::retrieveGroup ( std::size_t index)
nodiscard

Retrieve a sub-texture inside this texture group.

Parameters
indexThe index of the sub-texture
Returns
The sub-texture type pointer or nullptr if the index is out of range

◆ valid()

Check if the font is valid (not unloaded)

Returns
True if the font is valid, false otherwise

The documentation for this class was generated from the following file: