]> git.tdb.fi Git - libs/gl.git/blobdiff - source/materials/unlitmaterial.cpp
Overhaul texture management in rendering classes
[libs/gl.git] / source / materials / unlitmaterial.cpp
index e81be8ae136c3b8a915ef3b440b4c6946ffd5cb0..38dbd3a3bdfc9104295fb87983839b9d19cdff29 100644 (file)
@@ -5,6 +5,12 @@ using namespace std;
 namespace Msp {
 namespace GL {
 
+const Tag UnlitMaterial::texture_tags[] =
+{
+       Tag("color_tex"),
+       Tag()
+};
+
 UnlitMaterial::UnlitMaterial():
        texture(0),
        vertex_color(false)
@@ -19,10 +25,21 @@ void UnlitMaterial::fill_program_info(string &module_name, map<string, int> &spe
        spec_values["use_vertex_color"] = vertex_color;
 }
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 void UnlitMaterial::attach_textures_to(Texturing &texturing, ProgramData &tex_shdata) const
 {
        attach_texture_to(texture, texturing, tex_shdata, "color_tex");
 }
+#pragma GCC diagnostic pop
+
+const Texture *UnlitMaterial::get_texture(Tag tag) const
+{
+       if(tag==texture_tags[0])
+               return texture;
+       else
+               return 0;
+}
 
 void UnlitMaterial::set_texture(const Texture *tex)
 {