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.
 
const TexturegetDefaultTexture () const
 Get dummy texture.
 
TexturegetDefaultTexture ()
 Get dummy texture.
 
bool hasTexture (const std::string &name) const
 Check if a texture is registered.
 
const TexturegetTexture (const std::string &name) const
 Get a texture by name.
 
TexturegetTexture (const std::string &name)
 Get a texture by name.
 
template<typename T = Texture, typename... Args>
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.
 
const CubemapgetCubemap (const std::string &name) const
 Get a cubemap by name.
 
CubemapgetCubemap (const std::string &name)
 Get a cubemap by name.
 
const CubemapgetDefaultCubemap () const
 Get dummy cubemap.
 
CubemapgetDefaultCubemap ()
 Get dummy cubemap.
 
template<typename T = Cubemap, typename... Args>
CubemapregisterCubemap (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

◆ getCubemap() [1/2]

Cubemap * oe::render::TextureManager::getCubemap ( const std::string &  name)

Get a cubemap by name.

Note
This version allow you to modify the cubemap and will throw if no cubemap found

◆ getCubemap() [2/2]

const Cubemap * oe::render::TextureManager::getCubemap ( const std::string &  name) const

Get a cubemap by name.

Note
Dummy cubemap returned if cubemap not found

◆ getDefaultCubemap() [1/2]

Cubemap * oe::render::TextureManager::getDefaultCubemap ( )
inline

Get dummy cubemap.

Returns
Dummy cubemap using a checkerboard pattern

Todo: resolve texture const problems in cubic skybox

◆ getDefaultCubemap() [2/2]

const Cubemap * oe::render::TextureManager::getDefaultCubemap ( ) const
inline

Get dummy cubemap.

Returns
Dummy cubemap using a checkerboard pattern

◆ getDefaultTexture() [1/2]

Texture * oe::render::TextureManager::getDefaultTexture ( )
inline

Get dummy texture.

Returns
Dummy texture using a checkerboard pattern

Todo: resolve texture const problems in materials

◆ getDefaultTexture() [2/2]

const Texture * oe::render::TextureManager::getDefaultTexture ( ) const
inline

Get dummy texture.

Returns
Dummy texture using a checkerboard pattern

◆ getTexture() [1/2]

Texture * oe::render::TextureManager::getTexture ( const std::string &  name)

Get a texture by name.

Note
This version allow you to modify the texture and will throw if no texture found

◆ getTexture() [2/2]

const 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

◆ registerCubemap()

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

Generate and register a cubemap by calling cubemap constructor.

See also
Cubemap for available constructors

◆ registerTexture()

template<typename T = Texture, typename... Args>
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: