X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmaterial.h;h=5515f29eee539a211059fb15f6869332659c1224;hb=5bc9c7214feaf4ea4797fc0d4a906e5e59b75839;hp=df55a56767c6318ad9f6f3effed314520604fcd7;hpb=3500f13f51dabadd2e7f06b81820936520cc8115;p=libs%2Fgl.git diff --git a/source/material.h b/source/material.h index df55a567..5515f29e 100644 --- a/source/material.h +++ b/source/material.h @@ -6,11 +6,11 @@ #include #include "color.h" #include "programdata.h" +#include "texture.h" namespace Msp { namespace GL { -class Texture; class Texturing; class Material @@ -82,6 +82,11 @@ protected: public: virtual ~Material() { } + virtual Program *create_compatible_shader() const; + virtual const Program *create_compatible_shader(DataFile::Collection &) const; +protected: + virtual std::string create_program_source() const = 0; + public: /** Returns the uniforms for the material. */ const ProgramData &get_shader_data() const { return shdata; } @@ -163,7 +168,9 @@ void Material::LoaderBase::property_value_srgb_alpha(void (C::*set_value)(con template void Material::LoaderBase::property_texture(void (C::*set_texture)(const Texture *), const std::string &name) { - (static_cast(obj).*set_texture)(&get_collection().get(name)); + /* The static_cast around get_collection is needed because otherwise Android + SDK's g++ 4.9 fails to parse get as a template function call */ + (static_cast(obj).*set_texture)(&static_cast(get_collection()).get(name)); }