Graphics: Add new functions to get default material types/presets

This commit is contained in:
SirLynix
2023-08-08 18:17:58 +02:00
parent 32f8141bd8
commit cf6fdf258f
20 changed files with 111 additions and 117 deletions

View File

@@ -52,12 +52,10 @@ int main(int argc, char* argv[])
labelWidget->UpdateText(Nz::SimpleTextDrawer::Draw("You clicked the button " + std::to_string(++clickCount) + " times", 72));
});
std::shared_ptr<Nz::Material> material = Nz::Graphics::Instance()->GetDefaultMaterials().basicMaterial;
Nz::TextureSamplerInfo samplerInfo;
samplerInfo.anisotropyLevel = 8;
std::shared_ptr<Nz::MaterialInstance> materialInstance = material->Instantiate();
std::shared_ptr<Nz::MaterialInstance> materialInstance = Nz::MaterialInstance::Instantiate(Nz::MaterialType::Basic);
materialInstance->SetTextureProperty("BaseColorMap", fs.Load<Nz::Texture>("assets/lynix.jpg"));
Nz::ImageWidget* imageWidget = canvas2D.Add<Nz::ImageWidget>(materialInstance);