mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 16:19:19 +02:00
work
This commit is contained in:
24
gl/shader.h
24
gl/shader.h
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user