8 #include <experimental/filesystem>
10 namespace fs
= std::experimental::filesystem
;
14 using ShaderHandle
= GLuint
;
15 using ProgramHandle
= GLuint
;
16 using ShaderType
= GLenum
;
21 bool operator<(const ShaderId
& rhs
) const {
22 return std::tie(path
, type
) < std::tie(rhs
.path
, rhs
.type
);
24 bool operator==(const ShaderId
& rhs
) const {
25 return std::tie(path
, type
) == std::tie(rhs
.path
, rhs
.type
);
36 // public handle; 0 until the program has successfully linked
39 ProgramHandle internal_handle
;
42 ShaderBundle() = default;
45 std::map
<ShaderId
, Shader
> shader_pool
;
46 std::map
<std::vector
<ShaderId
>, Program
> programs
;
48 ProgramHandle
* add_program(const std::vector
<std::pair
<fs::path
, ShaderType
>>& shaders
);
50 ShaderBundle
& recompile();
53 static std::string
preprocess(fs::path path
, std::string shader
);