#pragma once #include #include #include #include "object.h" #include "bindable.h" namespace gl { class shader : public object { public: shader(const std::string &filename); ~shader(); enum class components_e { R, RG, RGB, RGBA, sRGB, sRGB_A }; struct texture_entry { std::string name; size_t id; components_e components; }; std::vector texture_conf; private: void expand_includes(std::string &str); void parse_config(std::string &str); std::string read_file(const std::string &filename); static std::unordered_map components_mapping; }; class program : public object, public bindable { public: program(); program(std::vector>); ~program(); using bindable::bind; static void bind(GLuint i); void attach(const shader &); void link(); std::vector texture_conf; private: void init(); }; }