BasicMaterial::Ptr BasicMaterial::diffuseMap(TexturePtr texture) { #ifdef DEBUG assert(texture == nullptr || texture->type() == TextureType::Texture2D); #endif if (texture) data()->set("diffuseMap", texture->sampler()); else data()->unset("diffuseMap"); return std::static_pointer_cast<BasicMaterial>(shared_from_this()); }
RenderViewPtr GLGraphicFactory::createRenderView(const TexturePtr& texture) const { if(texture->type() == TT_Texture2D) return MakeSharedPtr<GLTexture2DRenderView>(texture, 0, 0); return RenderViewPtr(); }