X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmaterials%2Funlitmaterial.h;fp=source%2Fmaterials%2Funlitmaterial.h;h=b8b28835b7ce18f031c79a4cb0a877670555b2ac;hb=2f198e3210714c7abac53bbe1be4d41b1ef85c14;hp=0000000000000000000000000000000000000000;hpb=f65bb3d92340c1508fe37eeac849f60d6ab1399c;p=libs%2Fgl.git diff --git a/source/materials/unlitmaterial.h b/source/materials/unlitmaterial.h new file mode 100644 index 00000000..b8b28835 --- /dev/null +++ b/source/materials/unlitmaterial.h @@ -0,0 +1,49 @@ +#ifndef MSP_GL_UNLITMATERIAL_H_ +#define MSP_GL_UNLITMATERIAL_H_ + +#include "material.h" + +namespace Msp { +namespace GL { + +class UnlitMaterial: public Material +{ +public: + class Loader: public DataFile::DerivedObjectLoader > + { + private: + static ActionMap shared_actions; + + public: + Loader(UnlitMaterial &); + Loader(UnlitMaterial &, Collection &); + + private: + virtual void init_actions(); + + void texture(const std::string &); + }; + +private: + const Texture *texture; + Color tint; + bool vertex_color; + +public: + UnlitMaterial(); + +protected: + virtual std::string create_program_source() const; + +public: + virtual void attach_textures_to(Texturing &, ProgramData &) const; + + void set_texture(const Texture *); + void set_tint(const Color &); + void set_vertex_color(bool); +}; + +} // namespace GL +} // namespace Msp + +#endif