From c6f775864be03b6a5d8acc81dfbe06fbf131496d Mon Sep 17 00:00:00 2001 From: dlyr Date: Thu, 5 Oct 2023 09:34:29 +0200 Subject: [PATCH] [engine][examples] Alias Lambertian texture semantics to SimpleMaterial. As suggested by MathiasPaulin. --- examples/TexturedQuad/main.cpp | 2 +- src/Engine/Data/LambertianMaterial.hpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/TexturedQuad/main.cpp b/examples/TexturedQuad/main.cpp index 86a2b201e36..37c6d4804a3 100644 --- a/examples/TexturedQuad/main.cpp +++ b/examples/TexturedQuad/main.cpp @@ -49,7 +49,7 @@ int main( int argc, char* argv[] ) { auto e = app.m_engine->getEntityManager()->createEntity( "Textured quad" ); auto material = std::make_shared( "myMaterialData" ); - material->addTexture( Ra::Engine::Data::TextureSemantics::SimpleMaterial::TEX_COLOR, + material->addTexture( Ra::Engine::Data::TextureSemantics::LambertianMaterial::TEX_COLOR, textureHandle ); // the entity get's this new component ownership. A bit wired since hidden in ctor. diff --git a/src/Engine/Data/LambertianMaterial.hpp b/src/Engine/Data/LambertianMaterial.hpp index ac0d53c268d..c462bf6baeb 100644 --- a/src/Engine/Data/LambertianMaterial.hpp +++ b/src/Engine/Data/LambertianMaterial.hpp @@ -6,6 +6,12 @@ namespace Ra { namespace Engine { namespace Data { +namespace TextureSemantics { +///@ LambertianMaterial's textures are the same than SimpleMaterial ones. Just alias the semantic +/// enumeration. +using LambertianMaterial = SimpleMaterial; +} // namespace TextureSemantics + /** * Implementation of the Lambertian Material BSDF. * This material implements a lambertian diffuse BSDF.