neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neogfx::shader< Base > Class Template Reference

#include <shader.hpp>

Inheritance diagram for neogfx::shader< Base >:
neolib::reference_counted< Base, DeallocateOnRelease > neogfx::fragment_shader< i_filter_shader > neogfx::fragment_shader< i_fragment_shader > neogfx::fragment_shader< i_glyph_shader > neogfx::fragment_shader< i_gradient_shader > neogfx::fragment_shader< i_shape_shader > neogfx::fragment_shader< i_stipple_shader > neogfx::fragment_shader< i_texture_shader > neogfx::vertex_shader< i_standard_vertex_shader > neogfx::fragment_shader< Base > neogfx::vertex_shader< Base >

Classes

class  cached_uniform
 

Public Types

typedef i_shader::value_type abstract_value_type
 
typedef shader_value_type value_type
 

Public Member Functions

 shader (shader_type aType, std::string const &aName, bool aEnabled=true)
 
 ~shader ()
 
shader_type type () const final
 
const i_stringname () const final
 
bool supports (vertex_buffer_type aBufferType) const override
 
void * handle (const i_shader_program &aProgram) const final
 
bool enabled () const final
 
bool disabled () const final
 
void enable () final
 
void disable () final
 
bool dirty () const final
 
void set_dirty () final
 
void set_clean () final
 
bool uniforms_changed () const final
 
const i_shader::uniform_list & uniforms () const final
 
bool has_shared_uniforms () const final
 
void clear_uniform (shader_uniform_id aUniform) final
 
shader_uniform_id create_uniform (const i_string &aName, bool aShared=false) final
 
shader_uniform_id find_uniform (const i_string &aName) const final
 
void set_uniform (shader_uniform_id aUniform, const abstract_value_type &aValue) final
 
void clear_uniform_storage (shader_uniform_id aUniform) final
 
void update_uniform_storage (shader_uniform_id aUniform, shader_uniform_storage aStorage) final
 
void clear_uniform_location (shader_uniform_id aUniform) final
 
void update_uniform_location (shader_uniform_id aUniform, shader_uniform_location aLocation) final
 
const variable_listin_variables () const final
 
const variable_listout_variables () const final
 
void clear_variable (const i_string &aName) final
 
i_shader_variable & add_variable (const i_shader_variable &aVariable) final
 
void prepare_uniforms (const i_rendering_context &, i_shader_program &) override
 
void generate_code (const i_shader_program &aProgram, shader_language aLanguage, i_string &aOutput) const override
 
void generate_invoke (const i_shader_program &aProgram, shader_language aLanguage, i_string &aInvokes) const final
 
- Public Member Functions inherited from neolib::reference_counted< Base, DeallocateOnRelease >
 reference_counted () noexcept
 
 reference_counted (const reference_counted &aOther) noexcept
 
 ~reference_counted ()
 
reference_countedoperator= (const reference_counted &)
 
void add_ref () const noexcept override
 
void release () const override
 
int32_t use_count () const noexcept override
 
const base_type * release_and_take_ownership () const override
 
base_type * release_and_take_ownership () override
 
void pin () const noexcept override
 
void unpin () const override
 
i_ref_control_blockcontrol_block () override
 

Protected Types

typedef neolib::jar< shader_uniform > uniform_list
 
typedef neolib::set< shader_variable > variable_list
 

Protected Member Functions

uniform_listuniforms ()
 
variable_listin_variables ()
 
variable_listout_variables ()
 

Detailed Description

template<typename Base>
class neogfx::shader< Base >

Definition at line 36 of file shader.hpp.

Member Typedef Documentation

◆ abstract_value_type

template<typename Base >
typedef i_shader::value_type neogfx::shader< Base >::abstract_value_type

Definition at line 42 of file shader.hpp.

◆ uniform_list

template<typename Base >
typedef neolib::jar<shader_uniform> neogfx::shader< Base >::uniform_list
protected

Definition at line 45 of file shader.hpp.

◆ value_type

template<typename Base >
typedef shader_value_type neogfx::shader< Base >::value_type

Definition at line 43 of file shader.hpp.

◆ variable_list

template<typename Base >
typedef neolib::set<shader_variable> neogfx::shader< Base >::variable_list
protected

Definition at line 46 of file shader.hpp.

Constructor & Destructor Documentation

◆ shader()

template<typename Base >
neogfx::shader< Base >::shader ( shader_type  aType,
std::string const &  aName,
bool  aEnabled = true 
)
inline

Definition at line 84 of file shader.hpp.

◆ ~shader()

template<typename Base >
neogfx::shader< Base >::~shader ( )
inline

Definition at line 92 of file shader.hpp.

Member Function Documentation

◆ add_variable()

template<typename Base >
i_shader_variable & neogfx::shader< Base >::add_variable ( const i_shader_variable &  aVariable)
inlinefinal

Definition at line 247 of file shader.hpp.

◆ clear_uniform()

template<typename Base >
void neogfx::shader< Base >::clear_uniform ( shader_uniform_id  aUniform)
inlinefinal

Definition at line 180 of file shader.hpp.

◆ clear_uniform_location()

template<typename Base >
void neogfx::shader< Base >::clear_uniform_location ( shader_uniform_id  aUniform)
inlinefinal

Definition at line 216 of file shader.hpp.

◆ clear_uniform_storage()

template<typename Base >
void neogfx::shader< Base >::clear_uniform_storage ( shader_uniform_id  aUniform)
inlinefinal

Definition at line 208 of file shader.hpp.

◆ clear_variable()

template<typename Base >
void neogfx::shader< Base >::clear_variable ( const i_string aName)
inlinefinal

Definition at line 232 of file shader.hpp.

◆ create_uniform()

template<typename Base >
shader_uniform_id neogfx::shader< Base >::create_uniform ( const i_string aName,
bool  aShared = false 
)
inlinefinal

Definition at line 185 of file shader.hpp.

◆ dirty()

template<typename Base >
bool neogfx::shader< Base >::dirty ( ) const
inlinefinal

Definition at line 144 of file shader.hpp.

◆ disable()

template<typename Base >
void neogfx::shader< Base >::disable ( )
inlinefinal

Definition at line 136 of file shader.hpp.

◆ disabled()

template<typename Base >
bool neogfx::shader< Base >::disabled ( ) const
inlinefinal

Definition at line 124 of file shader.hpp.

◆ enable()

template<typename Base >
void neogfx::shader< Base >::enable ( )
inlinefinal

Definition at line 128 of file shader.hpp.

◆ enabled()

template<typename Base >
bool neogfx::shader< Base >::enabled ( ) const
inlinefinal

Definition at line 120 of file shader.hpp.

◆ find_uniform()

template<typename Base >
shader_uniform_id neogfx::shader< Base >::find_uniform ( const i_string aName) const
inlinefinal

Definition at line 193 of file shader.hpp.

◆ generate_code()

template<typename Base >
void neogfx::shader< Base >::generate_code ( const i_shader_program aProgram,
shader_language  aLanguage,
i_string aOutput 
) const
inlineoverride

Definition at line 267 of file shader.hpp.

◆ generate_invoke()

template<typename Base >
void neogfx::shader< Base >::generate_invoke ( const i_shader_program aProgram,
shader_language  aLanguage,
i_string aInvokes 
) const
inlinefinal

Definition at line 368 of file shader.hpp.

◆ handle()

template<typename Base >
void * neogfx::shader< Base >::handle ( const i_shader_program aProgram) const
inlinefinal

Definition at line 110 of file shader.hpp.

◆ has_shared_uniforms()

template<typename Base >
bool neogfx::shader< Base >::has_shared_uniforms ( ) const
inlinefinal

Definition at line 170 of file shader.hpp.

◆ in_variables() [1/2]

template<typename Base >
variable_list & neogfx::shader< Base >::in_variables ( )
inlineprotected

Definition at line 383 of file shader.hpp.

◆ in_variables() [2/2]

template<typename Base >
const variable_list & neogfx::shader< Base >::in_variables ( ) const
inlinefinal

Definition at line 224 of file shader.hpp.

◆ name()

template<typename Base >
const i_string & neogfx::shader< Base >::name ( ) const
inlinefinal

Definition at line 102 of file shader.hpp.

◆ out_variables() [1/2]

template<typename Base >
variable_list & neogfx::shader< Base >::out_variables ( )
inlineprotected

Definition at line 387 of file shader.hpp.

◆ out_variables() [2/2]

template<typename Base >
const variable_list & neogfx::shader< Base >::out_variables ( ) const
inlinefinal

Definition at line 228 of file shader.hpp.

◆ prepare_uniforms()

template<typename Base >
void neogfx::shader< Base >::prepare_uniforms ( const i_rendering_context ,
i_shader_program  
)
inlineoverride

Definition at line 264 of file shader.hpp.

◆ set_clean()

template<typename Base >
void neogfx::shader< Base >::set_clean ( )
inlinefinal

Definition at line 154 of file shader.hpp.

◆ set_dirty()

template<typename Base >
void neogfx::shader< Base >::set_dirty ( )
inlinefinal

Definition at line 148 of file shader.hpp.

◆ set_uniform()

template<typename Base >
void neogfx::shader< Base >::set_uniform ( shader_uniform_id  aUniform,
const abstract_value_type aValue 
)
inlinefinal

Definition at line 201 of file shader.hpp.

◆ supports()

template<typename Base >
bool neogfx::shader< Base >::supports ( vertex_buffer_type  aBufferType) const
inlineoverride

Definition at line 106 of file shader.hpp.

◆ type()

template<typename Base >
shader_type neogfx::shader< Base >::type ( ) const
inlinefinal

Definition at line 98 of file shader.hpp.

◆ uniforms() [1/2]

template<typename Base >
uniform_list & neogfx::shader< Base >::uniforms ( )
inlineprotected

Definition at line 175 of file shader.hpp.

◆ uniforms() [2/2]

template<typename Base >
const i_shader::uniform_list & neogfx::shader< Base >::uniforms ( ) const
inlinefinal

Definition at line 166 of file shader.hpp.

◆ uniforms_changed()

template<typename Base >
bool neogfx::shader< Base >::uniforms_changed ( ) const
inlinefinal

Definition at line 158 of file shader.hpp.

◆ update_uniform_location()

template<typename Base >
void neogfx::shader< Base >::update_uniform_location ( shader_uniform_id  aUniform,
shader_uniform_location  aLocation 
)
inlinefinal

Definition at line 220 of file shader.hpp.

◆ update_uniform_storage()

template<typename Base >
void neogfx::shader< Base >::update_uniform_storage ( shader_uniform_id  aUniform,
shader_uniform_storage  aStorage 
)
inlinefinal

Definition at line 212 of file shader.hpp.


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