|
3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
|
Represents references to shaders, specifically vertex, pixel, and geometry shaders. This class is used to set the shaders to the graphics device. More...
#include <Effect.hpp>


Public Member Functions | |
| Effect (IGraphicsDevice device, IShader[] shaders, int numShaders) | |
| Effect (IntPtr handle) | |
| void | SetAll () |
| void | Set (int shaderID) |
| void | SetData (IntPtr data, ulong size, int cBufferID, int shaderID) |
| void | SetData (IntPtr data, ulong size, int cBufferID) |
| void | SetTexture (ITexture2D texture, int textureID) |
| void | SetTexture (ITexture2D texture, int textureID, int shaderID) |
| void | SetSampler (ISamplerState samplerState, int idx) |
| void | SetSampler (ISamplerState samplerState, int idx, int shaderID) |
| IShader | GetShader (int shaderID) |
| Effect (IGraphicsDevice *device, std::span< IShader * > shaders) | |
| Constructs an Effect object with the specified graphics device and shaders. | |
| Effect (const Effect &p)=delete | |
| Effect (Effect &&p) noexcept=default | |
| Move constructor for the Effect class. Transfers ownership of resources from another Effect object to this one. | |
| Effect & | operator= (const Effect &p)=delete |
| Effect & | operator= (Effect &&p) noexcept=default |
| Move assignment operator for the Effect class. Transfers ownership of resources from another Effect object to this one. | |
| int | SetAll () const noexcept |
| Sets all the effects. | |
| bool | Set (int index) const noexcept |
| Sets the index-th shader. | |
| template<typename T> | |
| void | Set (const std::string &name, const T &value) noexcept |
| Sets the value of variable named "name" in all shaders that are owned by this instance. | |
| template<typename T> | |
| void | Set (const std::string &name, const T &value, int shaderIndex) noexcept |
| Sets the value of variable named "name" in the specified shader. | |
| void | SetData (void *data, size_t size, int cbufferID, int shaderID) |
| Directly sets the data of a constant buffer in an specified shader. | |
| void | SetData (void *data, size_t size, int cbufferID) |
| Directly sets the data of a constant buffer in all shaders owned by this instance. | |
| template<typename T> | |
| void | SetData (T *data, int cbufferID, int shaderID) |
| Directly sets the data of a constant buffer in an specified shader, using a templated type to determine the size of the data. | |
| template<typename T> | |
| void | SetData (T *data, int cbufferID) |
| Directly sets the data of a constant buffer in all shaders owned by this instance, using a templated type to determine the size of the data. | |
| void | SetTexture (ITexture2D *texture, int idx) noexcept |
| Sets a texture to all shaders owned by this instance at the specified index. | |
| void | SetTexture (ITexture2D *texture, int textureID, int shaderID) noexcept |
| Sets a texture to a specific shader owned by this instance at the specified index. | |
| void | SetSampler (ISamplerState *sampler, int idx) noexcept |
| Sets a sampler state to all shaders owned by this instance at the specified index. | |
| void | SetSampler (ISamplerState *sampler, int samplerID, int shaderID) noexcept |
| Sets a sampler state to a specific shader owned by this instance at the specified index. | |
| IShader * | operator[] (size_t idx) const |
| Gets the shader at the specified index. | |
| ~Effect ()=default | |
| Public Member Functions inherited from Engine3DRadSpace.NatPtrWrapper | |
| virtual void | Dispose () |
Protected Attributes | |
| IGraphicsDevice * | _device |
| std::vector< IShader * > | _shaders |
| Protected Attributes inherited from Engine3DRadSpace.NatPtrWrapper | |
| IntPtr | _handle |
| bool | _disposed |
Additional Inherited Members | |
| Protected Member Functions inherited from Engine3DRadSpace.NatPtrWrapper | |
| NatPtrWrapper (IntPtr handle, Action< IntPtr > fnDestroy) | |
| NatPtrWrapper (Action< IntPtr > fnDestroy) | |
| void | Reset (IntPtr newObj) |
| void | Dispose (bool disposing) |
| Properties inherited from Engine3DRadSpace.NatPtrWrapper | |
| IntPtr | Handle [get] |
Represents references to shaders, specifically vertex, pixel, and geometry shaders. This class is used to set the shaders to the graphics device.
|
inline |
|
inline |
| Effect::Effect | ( | IGraphicsDevice * | device, |
| std::span< IShader * > | shaders ) |
Constructs an Effect object with the specified graphics device and shaders.
| device | The graphics device to be used by the effect. |
| shaders | A span of shader pointers to be used by the effect. |
|
delete |
|
defaultnoexcept |
|
default |
| IShader * Effect::operator[] | ( | size_t | idx | ) | const |
Gets the shader at the specified index.
| idx | The index of the shader to retrieve. |
|
inline |
|
inlinenoexcept |
Sets the value of variable named "name" in all shaders that are owned by this instance.
| T | The type of the value to set. |
| name | The name of the variable to set. |
| value | The value to set. |
|
inlinenoexcept |
Sets the value of variable named "name" in the specified shader.
| T | The type of the value to set. |
| name | The name of the variable to set. |
| value | The value to set. |
| shaderIndex | The index of the shader in which to set the variable. |
|
noexcept |
Sets the index-th shader.
| index | The index of the shader to set. |
|
inline |
|
noexcept |
Sets all the effects.
|
inline |
|
inline |
|
inline |
Directly sets the data of a constant buffer in all shaders owned by this instance, using a templated type to determine the size of the data.
T must have an alignment of 16 bytes (alignas(16)) to ensure proper alignment for GPU constant buffers.
| T | The type of the data to set. |
| data | Pointer to the new constant buffer data. |
| cbufferID | The ID of the constant buffer to set. |
|
inline |
Directly sets the data of a constant buffer in an specified shader, using a templated type to determine the size of the data.
T must have an alignment of 16 bytes (alignas(16)) to ensure proper alignment for GPU constant buffers.
| T | The type of the data to set. |
| data | Pointer to the new constant buffer data. |
| cbufferID | The ID of the constant buffer to set. |
| shaderID | The ID of the shader in which to set the constant buffer. |
| void Effect::SetData | ( | void * | data, |
| size_t | size, | ||
| int | cbufferID ) |
Directly sets the data of a constant buffer in all shaders owned by this instance.
| data | Pointer to the new constant buffer data. |
| size | The size of the data in bytes. |
| cbufferID | The ID of the constant buffer to set. |
| void Effect::SetData | ( | void * | data, |
| size_t | size, | ||
| int | cbufferID, | ||
| int | shaderID ) |
Directly sets the data of a constant buffer in an specified shader.
| data | Pointer to the new constant buffer data. |
| size | The size of the data in bytes. |
| cbufferID | The ID of the constant buffer to set. |
| shaderID | The ID of the shader in which to set the constant buffer. |
|
inline |
|
inline |
|
noexcept |
Sets a sampler state to all shaders owned by this instance at the specified index.
| sampler | The sampler state to set. |
| idx | The index at which to set the sampler state. |
|
noexcept |
Sets a sampler state to a specific shader owned by this instance at the specified index.
| sampler | The sampler state to set. |
| samplerID | The index at which to set the sampler state. |
| shaderID | The ID of the shader in which to set the sampler state. |
|
inline |
|
inline |
|
noexcept |
Sets a texture to all shaders owned by this instance at the specified index.
| texture | Texture to set. |
| idx | The index at which to set the texture. |
|
noexcept |
Sets a texture to a specific shader owned by this instance at the specified index.
| texture | Texture to set. |
| textureID | The index at which to set the texture. |
| shaderID | The ID of the shader in which to set the texture. |
|
protected |
|
protected |