utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
utility::graphic::Shader Class Reference

The Shader class represents a shader program consisting of vertex and fragment shaders. More...

#include <headers/utility/graphic/shader.hpp>

Public Member Functions

 Shader (const std::string &vertString, const std::string &fragString)
 Constructs a Shader object by loading vertex and fragment shader bytecode from strings.
 
 ~Shader ()=default
 Destructor for the Shader class.
 
const std::vector< uint32_t > & getVertexCode () const
 Retrieves the SPIR-V bytecode for the vertex shader.
 
const std::vector< uint32_t > & getFragmentCode () const
 Retrieves the SPIR-V bytecode for the fragment shader.
 

Protected Attributes

std::vector< uint32_t > _vertSPIRV
 SPIR-V bytecode for the vertex shader.
 
std::vector< uint32_t > _fragSPIRV
 SPIR-V bytecode for the fragment shader.
 

Detailed Description

The Shader class represents a shader program consisting of vertex and fragment shaders.

The Shader class manages the SPIR-V bytecode for both vertex and fragment shaders.

Definition at line 24 of file shader.hpp.

Constructor & Destructor Documentation

◆ Shader()

utility::graphic::Shader::Shader ( const std::string &  vertString,
const std::string &  fragString 
)

Constructs a Shader object by loading vertex and fragment shader bytecode from strings.

Parameters
vertStringThe string containing the SPIR-V bytecode for the vertex shader.
fragStringThe string containing the SPIR-V bytecode for the fragment shader

Definition at line 28 of file shader.cpp.

Member Function Documentation

◆ getFragmentCode()

const std::vector< uint32_t > & utility::graphic::Shader::getFragmentCode ( ) const

Retrieves the SPIR-V bytecode for the fragment shader.

Returns
A reference to a vector containing the SPIR-V bytecode for the fragment shader.

Definition at line 51 of file shader.cpp.

◆ getVertexCode()

const std::vector< uint32_t > & utility::graphic::Shader::getVertexCode ( ) const

Retrieves the SPIR-V bytecode for the vertex shader.

Returns
A reference to a vector containing the SPIR-V bytecode for the vertex shader.

Definition at line 46 of file shader.cpp.

Member Data Documentation

◆ _fragSPIRV

std::vector<uint32_t> utility::graphic::Shader::_fragSPIRV
protected

SPIR-V bytecode for the fragment shader.

Definition at line 68 of file shader.hpp.

◆ _vertSPIRV

std::vector<uint32_t> utility::graphic::Shader::_vertSPIRV
protected

SPIR-V bytecode for the vertex shader.

Definition at line 63 of file shader.hpp.


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