libdonut  2.3.2
Application framework for cross-platform game development in C++20
Public Member Functions | List of all members
donut::graphics::ShaderParameter Class Reference

Identifier for a uniform shader variable inside a ShaderProgram. More...

#include <donut/graphics/ShaderParameter.hpp>

Public Member Functions

 ShaderParameter (const ShaderProgram &program, const char *name)
 Construct an identifier for a specific uniform shader variable. More...
 
std::int32_t getLocation () const noexcept
 Get the location of the variable in the shader program. More...
 

Detailed Description

Identifier for a uniform shader variable inside a ShaderProgram.

Examples
example_game.cpp.

Constructor & Destructor Documentation

◆ ShaderParameter()

donut::graphics::ShaderParameter::ShaderParameter ( const ShaderProgram program,
const char *  name 
)

Construct an identifier for a specific uniform shader variable.

Parameters
programshader program in which the variable resides.
namename of the variable.
Note
If the variable is not found, the resulting identifier will be invalid.

Member Function Documentation

◆ getLocation()

std::int32_t donut::graphics::ShaderParameter::getLocation ( ) const
inlinenoexcept

Get the location of the variable in the shader program.

Returns
The location of the variable, or -1 if the identifier is invalid.

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