Nameless Engine
Loading...
Searching...
No Matches
ne::ShaderTextureResource Class Referenceabstract

#include <ShaderResource.h>

Inheritance diagram for ne::ShaderTextureResource:
ne::ShaderResourceBase ne::GlslShaderTextureResource ne::HlslShaderTextureResource

Public Member Functions

virtual std::optional< ErroruseNewTexture (std::unique_ptr< TextureHandle > pTextureToUse)=0
 
- Public Member Functions inherited from ne::ShaderResourceBase
virtual std::optional< ErrorchangeUsedPipelines (const std::unordered_set< Pipeline * > &pipelinesToUse)=0
 
std::string getResourceName () const
 

Protected Member Functions

 ShaderTextureResource (const std::string &sResourceName)
 
- Protected Member Functions inherited from ne::ShaderResourceBase
 ShaderResourceBase (const std::string &sResourceName)
 
virtual std::optional< ErroronAfterAllPipelinesRefreshedResources ()=0
 

Detailed Description

References some texture (maybe array/table) from shader code.

Constructor & Destructor Documentation

◆ ShaderTextureResource()

ne::ShaderTextureResource::ShaderTextureResource ( const std::string &  sResourceName)
protected

Initializes the resource.

Parameters
sResourceNameName of the resource we are referencing (should be exactly the same as the resource name written in the shader file we are referencing).

Member Function Documentation

◆ useNewTexture()

virtual std::optional< Error > ne::ShaderTextureResource::useNewTexture ( std::unique_ptr< TextureHandle pTextureToUse)
pure virtual

Makes the shader resource to reference the new (specified) texture.

Warning
Expects that the caller is using some mutex to protect this shader resource from being used in the draw function while this function is not finished (i.e. make sure the CPU will not queue a new frame while this function is not finished).
Parameters
pTextureToUseTexture to reference.
Returns
Error if something went wrong.

Implemented in ne::GlslShaderTextureResource, and ne::HlslShaderTextureResource.


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