Exemplo n.º 1
0
	static shader from_file(shader_type type, char const * file_name) {
		std::ifstream f(file_name);
		if (!f) throw std::runtime_error(std::string("Unable to open file: ") + file_name);
		return from_source(
			type,
			{ std::istreambuf_iterator<char>(f), std::istreambuf_iterator<char>() }
		);
	}
Exemplo n.º 2
0
	static shader from_source(shader_type type, std::string const & source) {
		return from_source(type, source.data());
	}
Exemplo n.º 3
0
typename shader<Stage>::ptr shader<Stage>::from_file(std::string filename, const parameters_t& params, bool compile_now) {
    return from_source(load_file_(filename), params, compile_now);
}
Exemplo n.º 4
0
typename shader<Stage>::ptr shader<Stage>::from_source(std::string source, const parameters_t& params, bool compile_now) {
    return from_source(render_source_(source, params), compile_now);
}
Exemplo n.º 5
0
typename shader<Stage>::ptr shader<Stage>::from_file(std::string filename, bool compile_now) {
    return from_source(load_file_(filename), compile_now);
}