#include <msp/datafile/objectloader.h>
#include "color.h"
#include "programdata.h"
+#include "texture.h"
namespace Msp {
namespace GL {
-class Texture;
class Texturing;
class Material
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; }
template<typename C>
void Material::LoaderBase<C>::property_texture(void (C::*set_texture)(const Texture *), const std::string &name)
{
- (static_cast<C &>(obj).*set_texture)(&get_collection().get<GL::Texture>(name));
+ /* The static_cast around get_collection is needed because otherwise Android
+ SDK's g++ 4.9 fails to parse get<Texture> as a template function call */
+ (static_cast<C &>(obj).*set_texture)(&static_cast<Collection &>(get_collection()).get<Texture>(name));
}