class ShaderManager

A global manager that handles various shader specific operations.

Public

Constructors

ShaderManager

ShaderManager(const SPtr<IShaderIncludeHandler> &handler)

Methods

FindInclude

HShaderInclude FindInclude(const String &name) const

Attempts to find a shader include resource based on its name.

FindIncludeSource

TOptional<String> FindIncludeSource(const String &name) const

Attempts to find a shader include based on the include name and returns the include source code if found.

SetIncludeHandler

void SetIncludeHandler(const SPtr<IShaderIncludeHandler> &handler)

Changes the active include handler that determines how is a shader include name mapped to the actual resource.

AddSearchPath

void AddSearchPath(const Path &path)

Registers a path in which to look for shader include files, along the default places.

staticInstance

static T &Instance()

Returns a reference to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticInstancePtr

static T *InstancePtr()

Returns a pointer to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticShutDown

static void ShutDown()

Shuts down this module and frees any resources it is using.

staticIsStarted

static bool IsStarted()

Query if the module has been started.

Protected

Methods

~Module<T>

virtual ~Module<T>() = default

OnStartUp

virtual void OnStartUp()

Override if you want your module to be notified once it has been constructed and started.

OnShutDown

virtual void OnShutDown()

Override if you want your module to be notified just before it is deleted.

staticInstanceInternal

static T *&InstanceInternal()

Returns a singleton instance of this module.

staticIsDestroyed

static bool &IsDestroyed()

Checks has the Module been shut down.

staticIsStartedUp

static bool &IsStartedUp()

Checks has the Module been started up.

Private

Fields

mIncludeHandler

SPtr<IShaderIncludeHandler> mIncludeHandler