16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 16:19:19 +02:00
This commit is contained in:
milek7
2018-07-15 23:46:53 +02:00
parent 794093dad4
commit 4c855d5980
26 changed files with 690 additions and 183 deletions

View File

@@ -15,9 +15,31 @@ namespace gl
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_entry> 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<std::string, components_e> components_mapping;
};
class program : public object, public bindable<program>
@@ -33,6 +55,8 @@ namespace gl
void attach(const shader &);
void link();
std::vector<shader::texture_entry> texture_conf;
private:
void init();
};