3 #include <cgv/render/context.h>
70 static std::string find_file(
const std::string& file_name);
72 static std::string get_last_error(
const std::string& file_name,
const std::string& last_error);
74 static std::string read_code_file(
const std::string &file_name, std::string* _last_error = 0);
82 static ShaderType detect_shader_type(
const std::string& file_name);
84 void destruct(
const context& ctx);
88 bool read_code(
const context& ctx,
const std::string &file_name,
ShaderType st = ST_DETECT, std::string defines =
"");
92 void set_defines(std::string& source,
const std::string& defines);
96 bool compile(
const context& ctx);
100 bool read_and_compile(
const context& ctx,
const std::string &file_name,
ShaderType st = ST_DETECT,
bool show_error =
true, std::string defines =
"");
102 bool is_compiled()
const;
109 #include <cgv/config/lib_end.h>
base interface for all render components
Definition: context.h:246
std::vector< std::string > inserted_shader_file_names
mapping of shader index to inserted files name
Definition: shader_code.h:35
std::vector< std::string > shader_file_names
mapping of shader index to file name
Definition: shader_code.h:33
cgv::data::ref_ptr< shader_config > shader_config_ptr
type of ref counted pointer to shader configuration
Definition: shader_code.h:45
ShaderType
different shader types
Definition: context.h:391
ShaderType st
store the shader type
Definition: shader_code.h:57
bool show_file_paths
whether to output full paths of read shaders
Definition: shader_code.h:31
Definition: reflection_handler.h:63
shader_config_ptr get_shader_config()
return a reference to the current shader configuration
Definition: shader_code.cxx:43
bool trace_file_names
whether to keep track of file names
Definition: shader_code.h:29
std::string shader_path
the path used to find shaders with the cgv::utils::file::find_in_paths function
Definition: shader_code.h:27
Definition: shader_code.h:54
const char * get_type_name(TypeId tid)
function that returns the name of a type specified through TypeId
Definition: type_id.cxx:117
the cgv namespace
Definition: vr_calib.cxx:9
Definition: context.h:525
Definition: shader_code.h:25