Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
oe::render::TextureManager Class Reference

handles the load and deletion of textures/cubemaps More...

#include <OxygenEngine/render/texture_manager.h>

Public Member Functions

 TextureManager (const TextureManagerCreateInfo &={})
 Constructor.
 
std::shared_ptr< TexturegetDefaultTexture () const
 Get dummy texture.
 
bool hasTexture (const std::string &name) const
 Check if a texture is registered.
 
std::shared_ptr< TexturegetTexture (const std::string &name) const
 Get a texture by name.
 
template<typename T = Texture, typename... Args>
std::shared_ptr< TextureregisterTexture (const std::string &name, Args &&... args)
 Generate and register a texture by calling texture constructor.
 
bool removeTexture (const std::string &name)
 Remove a registered texture.
 
bool hasCubemap (const std::string &name) const
 Check if a cubemap is registered.
 
std::shared_ptr< CubemapgetCubemap (const std::string &name) const
 Get a cubemap by name.
 
std::shared_ptr< CubemapgetDefaultCubemap () const
 Get dummy cubemap.
 
template<typename T = Cubemap, typename... Args>
std::shared_ptr< CubemapgenerateCubemap (const std::string &name, Args &&... args)
 Generate and register a cubemap by calling cubemap constructor.
 
bool removeCubemap (const std::string &name)
 Remove a registered cubemap.
 

Static Public Member Functions

static void setVerticalFlipOnLoad (const bool flip)
 Set if textures should be flipped upon image load.
 

Detailed Description

handles the load and deletion of textures/cubemaps

Constructor & Destructor Documentation

◆ TextureManager()

oe::render::TextureManager::TextureManager ( const TextureManagerCreateInfo = {})

Constructor.

Generates default texture and cubemap (magenta/black checkerboard pattern)

Member Function Documentation

◆ generateCubemap()

template<typename T = Cubemap, typename... Args>
std::shared_ptr< Cubemap > oe::render::TextureManager::generateCubemap ( const std::string &  name,
Args &&...  args 
)
inline

Generate and register a cubemap by calling cubemap constructor.

See also
Cubemap for available constructors

◆ getCubemap()

std::shared_ptr< Cubemap > oe::render::TextureManager::getCubemap ( const std::string &  name) const

Get a cubemap by name.

Note
Dummy cubemap returned if cubemap not found

◆ getDefaultCubemap()

std::shared_ptr< Cubemap > oe::render::TextureManager::getDefaultCubemap ( ) const
inline

Get dummy cubemap.

Returns
Dummy cubemap using a checkerboard pattern

◆ getDefaultTexture()

std::shared_ptr< Texture > oe::render::TextureManager::getDefaultTexture ( ) const
inline

Get dummy texture.

Returns
Dummy texture using a checkerboard pattern

◆ getTexture()

std::shared_ptr< Texture > oe::render::TextureManager::getTexture ( const std::string &  name) const

Get a texture by name.

Note
Dummy texture returned if the texture is not found

◆ registerTexture()

template<typename T = Texture, typename... Args>
std::shared_ptr< Texture > oe::render::TextureManager::registerTexture ( const std::string &  name,
Args &&...  args 
)
inline

Generate and register a texture by calling texture constructor.

See also
Texture for available constructors

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