3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace.Graphics::NullShader Class Referencefinal

Represents a mock shader implementation. More...

#include <NullShader.hpp>

Inheritance diagram for Engine3DRadSpace.Graphics::NullShader:
Collaboration diagram for Engine3DRadSpace.Graphics::NullShader:

Public Member Functions

 NullShader ()=default
void * GetHandle () const noexcept override
 Gets an opaque handle to the underlying GPU resource.
IGraphicsDevice * GetGraphicsDevice () const noexcept override
 Gets the GraphicsDevice that created this resource.
void SetData (unsigned index, const void *data, size_t dataSize) override
 Sets an entire uniform buffer to the shader.
void SetTexture (unsigned index, ITexture1D *texture) override
 Sets the specified texture to a given index.
void SetTextures (std::span< ITexture1D * > textures) override
 Sets multiple textures to the shader using a span of ITexture1D pointers.
void SetTexture (unsigned index, ITexture2D *texture) override
 Sets an 2D texture to the shader at the specified index.
void SetTextures (std::span< ITexture2D * > textures) override
 Sets multiple 2D textures to the shader using a span of ITexture2D pointers.
void SetTexture (unsigned index, ITextureCube *texture) override
 Sets an cube texture to the shader at the specified index.
void SetTextures (std::span< ITextureCube * > textures) override
 Sets multiple cube textures to the shader using a span of ITextureCube pointers.
void SetSampler (unsigned index, ISamplerState *samplerState) override
 Sets an texture sampler state at the specified index.
void SetShader () override
 Sets the constant buffers and the shader to the rendering pipeline.
std::vector< Reflection::IReflectedField * > GetVariables () const override
 Gets the exposed variables of the shader, which can be used to set values for the shader's uniform buffers.
void Set (const std::string &name, const void *data, size_t dataSize) override
 Sets a value for a shader variable by name. The data is copied into the shader's uniform buffer.
std::string_view GetEntryName () const noexcept override
 Gets the name of the entry point function for this shader.
const char * GetCompilationErrorsAndWarnings () const noexcept override
 Gets the compilation results for this shader.
 ~NullShader () override=default
Public Member Functions inherited from Engine3DRadSpace.Graphics.IShader
void SetData (uint index, IntPtr data, ulong dataSize)
void SetTexture (uint index, ITexture2D texture)
void SetTextures (Span< ITexture2D > textures)
void SetSampler (uint index, ISamplerState samplerState)
void SetShader ()
Reflection.IReflectedField[] GetVariables ()
template<typename T>
void Set (const std::string &name, const T &data)
 Sets a value for a shader variable by name. The data is copied into the shader's uniform buffer.
template<typename T>
void SetData (const T *data, unsigned index)
 Sets an entire uniform buffer to the shader.
 ~IShader () override=default
Public Member Functions inherited from Engine3DRadSpace.Graphics.IGPUResource
virtual ~IGPUResource ()=default

Additional Inherited Members

Protected Member Functions inherited from Engine3DRadSpace.Graphics.IShader
 IShader ()=default
 IShader (const IShader &)=delete
 IShader (IShader &&) noexcept=default
IShader & operator= (const IShader &)=delete
IShader & operator= (IShader &&) noexcept=default
Protected Member Functions inherited from Engine3DRadSpace.Graphics.IGPUResource
 IGPUResource ()=default
 IGPUResource (const IGPUResource &)=delete
IGPUResource & operator= (const IGPUResource &)=delete
 IGPUResource (IGPUResource &&) noexcept=default
IGPUResource & operator= (IGPUResource &&) noexcept=default
Properties inherited from Engine3DRadSpace.Graphics.IShader
string EntryName [get]
string CompilationErrorsAndWarnings [get]
Properties inherited from Engine3DRadSpace.IPtrWrapper
IntPtr Handle [get]
Properties inherited from Engine3DRadSpace.Graphics.IGPUResource
IGraphicsDevice GraphicsDevice [get]
IntPtr GPUHandle [get]

Detailed Description

Represents a mock shader implementation.

Constructor & Destructor Documentation

◆ NullShader()

Engine3DRadSpace.Graphics::NullShader::NullShader ( )
default

◆ ~NullShader()

Engine3DRadSpace.Graphics::NullShader::~NullShader ( )
overridedefault

Member Function Documentation

◆ GetCompilationErrorsAndWarnings()

const char * NullShader::GetCompilationErrorsAndWarnings ( ) const
overridevirtualnoexcept

Gets the compilation results for this shader.

Returns
A string containing any compilation errors or warnings, or an empty string if the shader compiled successfully.

Implements Engine3DRadSpace.Graphics.IShader.

◆ GetEntryName()

std::string_view NullShader::GetEntryName ( ) const
overridevirtualnoexcept

Gets the name of the entry point function for this shader.

Returns
The name of the entry point function

Implements Engine3DRadSpace.Graphics.IShader.

◆ GetGraphicsDevice()

IGraphicsDevice * NullShader::GetGraphicsDevice ( ) const
overridevirtualnoexcept

Gets the GraphicsDevice that created this resource.

Returns

Implements Engine3DRadSpace.Graphics.IGPUResource.

◆ GetHandle()

void * NullShader::GetHandle ( ) const
overridevirtualnoexcept

Gets an opaque handle to the underlying GPU resource.

Returns

Implements Engine3DRadSpace.Graphics.IGPUResource.

◆ GetVariables()

std::vector< Reflection::IReflectedField * > NullShader::GetVariables ( ) const
overridevirtual

Gets the exposed variables of the shader, which can be used to set values for the shader's uniform buffers.

Returns
Shader reflection data for variables in constant buffers.

Implements Engine3DRadSpace.Graphics.IShader.

◆ Set()

void NullShader::Set ( const std::string & name,
const void * data,
size_t dataSize )
overridevirtual

Sets a value for a shader variable by name. The data is copied into the shader's uniform buffer.

Prefer setting the data drectly using the SetData<T> method for better performance.

Parameters
nameThe name of the shader variable to set.
dataA pointer to the data to set.
dataSizeThe size of the data in bytes.

Implements Engine3DRadSpace.Graphics.IShader.

◆ SetData()

void NullShader::SetData ( unsigned index,
const void * data,
size_t dataSize )
overridevirtual

Sets an entire uniform buffer to the shader.

Implements Engine3DRadSpace.Graphics.IShader.

◆ SetSampler()

void NullShader::SetSampler ( unsigned index,
ISamplerState * samplerState )
overridevirtual

Sets an texture sampler state at the specified index.

Parameters
indexThe index at which to set the sampler state.
samplerStateThe sampler state to set.

Implements Engine3DRadSpace.Graphics.IShader.

◆ SetShader()

void NullShader::SetShader ( )
overridevirtual

Sets the constant buffers and the shader to the rendering pipeline.

Implements Engine3DRadSpace.Graphics.IShader.

◆ SetTexture() [1/3]

void NullShader::SetTexture ( unsigned index,
ITexture1D * texture )
overridevirtual

Sets the specified texture to a given index.

Parameters
indexThe index at which to set the texture.
textureThe texture to set.

Implements Engine3DRadSpace.Graphics.IShader.

◆ SetTexture() [2/3]

void NullShader::SetTexture ( unsigned index,
ITexture2D * texture )
overridevirtual

Sets an 2D texture to the shader at the specified index.

Parameters
indexThe index at which to set the texture.
textureThe texture to set.

Implements Engine3DRadSpace.Graphics.IShader.

◆ SetTexture() [3/3]

void NullShader::SetTexture ( unsigned index,
ITextureCube * texture )
overridevirtual

Sets an cube texture to the shader at the specified index.

Parameters
indexThe index at which to set the texture.
textureThe texture to set.

Implements Engine3DRadSpace.Graphics.IShader.

◆ SetTextures() [1/3]

void NullShader::SetTextures ( std::span< ITexture1D * > textures)
overridevirtual

Sets multiple textures to the shader using a span of ITexture1D pointers.

Parameters
texturesA span of ITexture1D pointers to set.

Implements Engine3DRadSpace.Graphics.IShader.

◆ SetTextures() [2/3]

void NullShader::SetTextures ( std::span< ITexture2D * > textures)
overridevirtual

Sets multiple 2D textures to the shader using a span of ITexture2D pointers.

Parameters
texturesA span of ITexture2D pointers to set.

Implements Engine3DRadSpace.Graphics.IShader.

◆ SetTextures() [3/3]

void NullShader::SetTextures ( std::span< ITextureCube * > textures)
overridevirtual

Sets multiple cube textures to the shader using a span of ITextureCube pointers.

Parameters
texturesA span of ITextureCube pointers to set.

Implements Engine3DRadSpace.Graphics.IShader.


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