Skip to content

Commit

Permalink
[engine][examples] Alias Lambertian texture semantics to SimpleMaterial.
Browse files Browse the repository at this point in the history
As suggested by MathiasPaulin.
  • Loading branch information
dlyr committed Oct 20, 2023
1 parent 53f13d5 commit c6f7758
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/TexturedQuad/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int main( int argc, char* argv[] ) {
auto e = app.m_engine->getEntityManager()->createEntity( "Textured quad" );

auto material = std::make_shared<Ra::Engine::Data::LambertianMaterial>( "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.
Expand Down
6 changes: 6 additions & 0 deletions src/Engine/Data/LambertianMaterial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c6f7758

Please sign in to comment.