MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mbgl::gfx::Shader Class Referenceabstract

A shader is used as the base class for all programs across any supported backend API. Shaders are registered with a gfx::ShaderRegistry instance. More...

#include <shader.hpp>

Public Member Functions

virtual ~Shader ()=default
 
virtual const std::string_view typeName () const noexcept=0
 Get the type name of this shader. More...
 
template<typename T , typename std::enable_if_t< is_shader_v< T >, bool > * = nullptr>
T * to () noexcept
 Downcast to a type. More...
 

Detailed Description

A shader is used as the base class for all programs across any supported backend API. Shaders are registered with a gfx::ShaderRegistry instance.

Definition at line 27 of file shader.hpp.

Constructor & Destructor Documentation

◆ ~Shader()

virtual mbgl::gfx::Shader::~Shader ( )
virtualdefault

Member Function Documentation

◆ to()

template<typename T , typename std::enable_if_t< is_shader_v< T >, bool > * = nullptr>
T* mbgl::gfx::Shader::to ( )
inlinenoexcept

Downcast to a type.

Template Parameters
TDerived type
Returns
Type or nullptr if type info was not a match

Definition at line 40 of file shader.hpp.

◆ typeName()

virtual const std::string_view mbgl::gfx::Shader::typeName ( ) const
pure virtualnoexcept

Get the type name of this shader.

Returns
Shader type name

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