Castor3D 0.12.0
Multiplatform 3D engine
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
castor3d::SceneBackground Class Referenceabstract

#include <Background.hpp>

Inheritance diagram for castor3d::SceneBackground:
Inheritance graph
[legend]
Collaboration diagram for castor3d::SceneBackground:
Collaboration graph
[legend]

Public Types

enum  DescriptorIdx : uint32_t {
  MtxUboIdx = 0u , MdlMtxUboIdx = 1u , HdrCfgUboIdx = 2u , SceneUboIdx = 3u ,
  SkyBoxImgIdx = 4u
}
 

Public Member Functions

C3D_API SceneBackground (Engine &engine, Scene &scene, castor::String const &name, BackgroundType type)
 Constructor. More...
 
virtual C3D_API ~SceneBackground ()
 Destructor. More...
 
C3D_API bool initialise (RenderDevice const &device)
 Initialisation function. More...
 
C3D_API void cleanup (RenderDevice const &device)
 Cleanup function. More...
 
C3D_API void update (CpuUpdater &updater) const
 Updates the background, CPU side. More...
 
C3D_API void update (GpuUpdater &updater) const
 Updates the background, GPU side. More...
 
C3D_API void notifyChanged ()
 Notifies a change to apply on GPU for the background. More...
 
virtual C3D_API void accept (BackgroundVisitor &visitor)=0
 Visitor acceptance function. More...
 
Scene const & getScene () const
 
ScenegetScene ()
 
BackgroundType getType () const
 
Texture const & getTextureId () const
 
TextureLayout const & getTexture () const
 
TextureLayoutgetTexture ()
 
ashes::Image const & getImage () const
 
ashes::ImageView const & getView () const
 
bool isHdr () const
 
bool isSRGB () const
 
bool hasIbl () const
 
bool isInitialised () const
 
IblTextures const & getIbl () const
 
Sampler const & getSampler () const
 

Public Attributes

OnBackgroundChanged onChanged
 

Protected Attributes

Scenem_scene
 
BackgroundType m_type
 
std::atomic_bool m_initialised { false }
 
bool m_hdr { true }
 
bool m_srgb { false }
 
Texture m_textureId
 
TextureLayoutSPtr m_texture
 
SamplerResPtr m_sampler
 
std::unique_ptr< IblTexturesm_ibl
 

Member Enumeration Documentation

◆ DescriptorIdx

Enumerator
MtxUboIdx 
MdlMtxUboIdx 
HdrCfgUboIdx 
SceneUboIdx 
SkyBoxImgIdx 

Constructor & Destructor Documentation

◆ SceneBackground()

C3D_API castor3d::SceneBackground::SceneBackground ( Engine engine,
Scene scene,
castor::String const &  name,
BackgroundType  type 
)
explicit

Constructor.

Parameters
engineThe engine.
sceneThe parent scene.
nameThe background name.
typeThe background type.

◆ ~SceneBackground()

virtual C3D_API castor3d::SceneBackground::~SceneBackground ( )
virtual

Destructor.

Member Function Documentation

◆ accept()

virtual C3D_API void castor3d::SceneBackground::accept ( BackgroundVisitor visitor)
pure virtual

Visitor acceptance function.

Parameters
visitorThe visitor.

Implemented in castor3d::ColourBackground, castor3d::ImageBackground, and castor3d::SkyboxBackground.

◆ cleanup()

C3D_API void castor3d::SceneBackground::cleanup ( RenderDevice const &  device)

Cleanup function.

Parameters
[in]deviceThe current device.

◆ getIbl()

IblTextures const & castor3d::SceneBackground::getIbl ( ) const
inline

References m_ibl.

◆ getImage()

ashes::Image const & castor3d::SceneBackground::getImage ( ) const
inline

References m_texture.

◆ getSampler()

Sampler const & castor3d::SceneBackground::getSampler ( ) const
inline

References m_sampler.

◆ getScene() [1/2]

Scene & castor3d::SceneBackground::getScene ( )
inline

References m_scene.

◆ getScene() [2/2]

Scene const & castor3d::SceneBackground::getScene ( ) const
inline

name Getters.

References m_scene.

◆ getTexture() [1/2]

TextureLayout & castor3d::SceneBackground::getTexture ( )
inline

References m_texture.

◆ getTexture() [2/2]

TextureLayout const & castor3d::SceneBackground::getTexture ( ) const
inline

References m_texture.

◆ getTextureId()

Texture const & castor3d::SceneBackground::getTextureId ( ) const
inline

References m_textureId.

◆ getType()

BackgroundType castor3d::SceneBackground::getType ( ) const
inline

References m_type.

◆ getView()

ashes::ImageView const & castor3d::SceneBackground::getView ( ) const
inline

References m_texture.

◆ hasIbl()

bool castor3d::SceneBackground::hasIbl ( ) const
inline

References m_ibl.

◆ initialise()

C3D_API bool castor3d::SceneBackground::initialise ( RenderDevice const &  device)

Initialisation function.

Parameters
[in]deviceThe current device.
Returns
true if ok.

◆ isHdr()

bool castor3d::SceneBackground::isHdr ( ) const
inline

References m_hdr.

◆ isInitialised()

bool castor3d::SceneBackground::isInitialised ( ) const
inline

References m_initialised.

◆ isSRGB()

bool castor3d::SceneBackground::isSRGB ( ) const
inline

References m_srgb.

◆ notifyChanged()

C3D_API void castor3d::SceneBackground::notifyChanged ( )

Notifies a change to apply on GPU for the background.

◆ update() [1/2]

C3D_API void castor3d::SceneBackground::update ( CpuUpdater updater) const

Updates the background, CPU side.

Parameters
[in]updaterThe update data.

◆ update() [2/2]

C3D_API void castor3d::SceneBackground::update ( GpuUpdater updater) const

Updates the background, GPU side.

Parameters
[in]updaterThe update data.

Member Data Documentation

◆ m_hdr

bool castor3d::SceneBackground::m_hdr { true }
protected

Referenced by isHdr().

◆ m_ibl

std::unique_ptr< IblTextures > castor3d::SceneBackground::m_ibl
protected

Referenced by getIbl(), and hasIbl().

◆ m_initialised

std::atomic_bool castor3d::SceneBackground::m_initialised { false }
protected

Referenced by isInitialised().

◆ m_sampler

SamplerResPtr castor3d::SceneBackground::m_sampler
protected

Referenced by getSampler().

◆ m_scene

Scene& castor3d::SceneBackground::m_scene
protected

Referenced by getScene().

◆ m_srgb

bool castor3d::SceneBackground::m_srgb { false }
protected

Referenced by isSRGB().

◆ m_texture

TextureLayoutSPtr castor3d::SceneBackground::m_texture
protected

◆ m_textureId

Texture castor3d::SceneBackground::m_textureId
protected

Referenced by getTextureId().

◆ m_type

BackgroundType castor3d::SceneBackground::m_type
protected

Referenced by getType().

◆ onChanged

OnBackgroundChanged castor3d::SceneBackground::onChanged

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