libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
Ship::Shader Class Referencefinal

Resource type representing a shader program source. More...

#include <Shader.h>

Inheritance diagram for Ship::Shader:
[legend]
Collaboration diagram for Ship::Shader:
[legend]

Public Member Functions

 Shader ()
 Default-constructs an empty Shader resource.
 
void * GetPointer () override
 Returns a pointer to the internal shader source string object.
 
size_t GetPointerSize () override
 Returns the size in bytes of the shader source string.
 
- Public Member Functions inherited from Ship::Resource< void >
void * GetRawPointer () override
 Returns a type-erased raw pointer to the underlying resource data.
 
 IResource (std::shared_ptr< ResourceInitData > initData)
 Constructs an IResource with the given initialization data.
 
- Public Member Functions inherited from Ship::IResource
 IResource (std::shared_ptr< ResourceInitData > initData)
 Constructs an IResource with the given initialization data.
 
virtual ~IResource ()
 
bool IsDirty ()
 Returns true if the resource has been marked dirty.
 
void Dirty ()
 Marks the resource as dirty.
 
std::shared_ptr< ResourceInitDataGetInitData ()
 Returns the initialization data used to load this resource.
 

Public Attributes

std::string Data
 Shader source code.
 

Additional Inherited Members

- Static Public Attributes inherited from Ship::IResource
static const std::string gAltAssetPrefix = "alt/"
 Path prefix that identifies an "alt asset" override.
 

Detailed Description

Resource type representing a shader program source.

The shader source code is stored as a string and exposed through the typed Resource interface. Use ResourceType::Shader when registering a factory for this type.

Constructor & Destructor Documentation

◆ Shader()

Ship::Shader::Shader ( )

Default-constructs an empty Shader resource.

Member Function Documentation

◆ GetPointer()

void * Ship::Shader::GetPointer ( )
overridevirtual

Returns a pointer to the internal shader source string object.

Returns
A void* that is actually std::string* (i.e. &Data). Cast to std::string* to use the string, or call .data() on the dereferenced pointer to obtain the raw character buffer.

Implements Ship::Resource< void >.

◆ GetPointerSize()

size_t Ship::Shader::GetPointerSize ( )
overridevirtual

Returns the size in bytes of the shader source string.

Returns
Length of Data.

Implements Ship::IResource.

Member Data Documentation

◆ Data

std::string Ship::Shader::Data

Shader source code.


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