cgv
Loading...
Searching...
No Matches
cgv::render::shader_library Class Reference

provides a shader library that handles shader loading More...

#include <shader_library.h>

Classes

struct  shader_info
 

Public Member Functions

void clear (context &ctx)
 
bool add (const std::string &name, const std::string &file, const shader_define_map &defines={})
 
shader_programget (const std::string &name)
 
shader_define_mapget_defines (const std::string &name)
 
bool contains (const std::string &name) const
 
shader_lib_map::iterator begin ()
 
shader_lib_map::iterator end ()
 
bool load_all (context &ctx, const std::string &where="")
 
bool reload (context &ctx, const std::string &name, const shader_define_map &defines={}, const std::string &where="")
 
bool reload_all (context &ctx, const std::string &where="")
 

Static Public Member Functions

static bool load (context &ctx, shader_program &prog, const std::string &name, const bool reload=false, const std::string &where="")
 
static bool load (context &ctx, shader_program &prog, const std::string &name, const shader_define_map &defines, const bool reload=false, const std::string &where="")
 

Protected Types

typedef std::map< std::string, shader_infoshader_lib_map
 

Protected Member Functions

shader_infoget_shader_info (const std::string &name)
 

Protected Attributes

shader_lib_map shaders
 

Detailed Description

provides a shader library that handles shader loading

Definition at line 12 of file shader_library.h.

Member Typedef Documentation

◆ shader_lib_map

typedef std::map<std::string, shader_info> cgv::render::shader_library::shader_lib_map
protected

Definition at line 20 of file shader_library.h.

Constructor & Destructor Documentation

◆ shader_library()

cgv::render::shader_library::shader_library ( )

Definition at line 6 of file shader_library.cxx.

◆ ~shader_library()

cgv::render::shader_library::~shader_library ( )

Definition at line 11 of file shader_library.cxx.

Member Function Documentation

◆ add()

bool cgv::render::shader_library::add ( const std::string &  name,
const std::string &  file,
const shader_define_map defines = {} 
)

Definition at line 21 of file shader_library.cxx.

◆ begin()

shader_lib_map::iterator cgv::render::shader_library::begin ( )
inline

Definition at line 56 of file shader_library.h.

◆ clear()

void cgv::render::shader_library::clear ( context ctx)

Definition at line 16 of file shader_library.cxx.

◆ contains()

bool cgv::render::shader_library::contains ( const std::string &  name) const
inline

Definition at line 51 of file shader_library.h.

◆ end()

shader_lib_map::iterator cgv::render::shader_library::end ( )
inline

Definition at line 57 of file shader_library.h.

◆ get()

shader_program & cgv::render::shader_library::get ( const std::string &  name)
inline

Definition at line 41 of file shader_library.h.

◆ get_defines()

shader_define_map & cgv::render::shader_library::get_defines ( const std::string &  name)
inline

Definition at line 46 of file shader_library.h.

◆ get_shader_info()

shader_info & cgv::render::shader_library::get_shader_info ( const std::string &  name)
inlineprotected

Definition at line 23 of file shader_library.h.

◆ load() [1/2]

static bool cgv::render::shader_library::load ( context ctx,
shader_program prog,
const std::string &  name,
const bool  reload = false,
const std::string &  where = "" 
)
inlinestatic

Definition at line 63 of file shader_library.h.

◆ load() [2/2]

static bool cgv::render::shader_library::load ( context ctx,
shader_program prog,
const std::string &  name,
const shader_define_map defines,
const bool  reload = false,
const std::string &  where = "" 
)
inlinestatic

Definition at line 68 of file shader_library.h.

◆ load_all()

bool cgv::render::shader_library::load_all ( context ctx,
const std::string &  where = "" 
)

Definition at line 33 of file shader_library.cxx.

◆ reload()

bool cgv::render::shader_library::reload ( context ctx,
const std::string &  name,
const shader_define_map defines = {},
const std::string &  where = "" 
)

Definition at line 44 of file shader_library.cxx.

◆ reload_all()

bool cgv::render::shader_library::reload_all ( context ctx,
const std::string &  where = "" 
)

Definition at line 55 of file shader_library.cxx.

Member Data Documentation

◆ shaders

shader_lib_map cgv::render::shader_library::shaders
protected

Definition at line 21 of file shader_library.h.


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