CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::ShaderSource Class Referencefinal

A ShaderSource is an object responsible for wrapping the textual representation of a shader (i.e. More...

#include <CeresEngine/Material/ShaderSource.hpp>

Public Member Functions

 ShaderSource (ShaderType type, String source) noexcept
 Creates a new shader from a string.
 
 ShaderSource (ShaderType type, const char *source)
 Creates a new shader from a string.
 
 ShaderSource (const ShaderSource &other)
 Creates a new shader source by copying the contents of another.
 
ShaderSourceoperator= (const ShaderSource &other)
 Assigns the contents from another shader source object.
 
 ShaderSource (ShaderSource &&other) noexcept
 Creates a new shader source by moving the contents of another.
 
ShaderSourceoperator= (ShaderSource &&other) noexcept
 Assigns the contents from another shader source object.
 

Static Public Member Functions

template<typename Processor >
static constexpr void reflect (Processor &&RTTI)
 Executes the given processor for every field of the struct.
 

Public Attributes

ShaderType type = ShaderType::Undefined
 The shader stage type.
 
String source
 The shader source code.
 

Detailed Description

A ShaderSource is an object responsible for wrapping the textual representation of a shader (i.e.

its source code).

This shader source object can be copied, moved and passed by reference to a shader implementation. The shader implementations will use the contents of this object to compile a binary representation of the shader that can run on the GPU.

Constructor & Destructor Documentation

◆ ShaderSource() [1/4]

CeresEngine::ShaderSource::ShaderSource ( ShaderType  type,
String  source 
)
explicitnoexcept

Creates a new shader from a string.

Parameters
typeThe shader stage type
sourceThe shader source code string

◆ ShaderSource() [2/4]

CeresEngine::ShaderSource::ShaderSource ( ShaderType  type,
const char source 
)
explicit

Creates a new shader from a string.

Parameters
typeThe shader stage type
sourceThe shader source code string

◆ ShaderSource() [3/4]

CeresEngine::ShaderSource::ShaderSource ( const ShaderSource other)

Creates a new shader source by copying the contents of another.

Parameters
otherThe shader source to copy the contents from

◆ ShaderSource() [4/4]

CeresEngine::ShaderSource::ShaderSource ( ShaderSource &&  other)
noexcept

Creates a new shader source by moving the contents of another.

Parameters
otherThe shader source to copy the contents from

Member Function Documentation

◆ operator=() [1/2]

ShaderSource & CeresEngine::ShaderSource::operator= ( const ShaderSource other)

Assigns the contents from another shader source object.

Parameters
otherThe shader source to copy the contents from
Returns
This

◆ operator=() [2/2]

ShaderSource & CeresEngine::ShaderSource::operator= ( ShaderSource &&  other)
noexcept

Assigns the contents from another shader source object.

Parameters
otherThe shader source to move the contents from
Returns
This

◆ reflect()

template<typename Processor >
static constexpr void CeresEngine::ShaderSource::reflect ( Processor &&  RTTI)
inlinestaticconstexpr

Executes the given processor for every field of the struct.

Parameters
RTTIThe processor to be ran for every field.

Member Data Documentation

◆ source

String CeresEngine::ShaderSource::source

The shader source code.

◆ type

ShaderType CeresEngine::ShaderSource::type = ShaderType::Undefined

The shader stage type.


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