diff --git a/example/Vulkan/first_triangle.cpp b/example/Vulkan/first_triangle.cpp index 5b671e6d..9784cc56 100644 --- a/example/Vulkan/first_triangle.cpp +++ b/example/Vulkan/first_triangle.cpp @@ -98,7 +98,12 @@ private: bool InitAutoMaterial() { - AutoDelete mci=mtl::CreateVertexColor2D(mtl::CoordinateSystem2D::NDC); + mtl::Material2DConfig cfg; + + cfg.coordinate_system=mtl::CoordinateSystem2D::NDC; + cfg.local_to_world=false; + + AutoDelete mci=mtl::CreateVertexColor2D(&cfg); material_instance=db->CreateMaterialInstance(mci,&vil_config); diff --git a/example/Vulkan/second_triangle.cpp b/example/Vulkan/second_triangle.cpp index 351d3e25..3b7d5c32 100644 --- a/example/Vulkan/second_triangle.cpp +++ b/example/Vulkan/second_triangle.cpp @@ -45,15 +45,17 @@ private: bool InitMaterial() { - AutoDelete mci; + mtl::Material2DConfig cfg; #ifdef USE_ZERO2ONE_COORD - mci=mtl::CreateVertexColor2D(mtl::CoordinateSystem2D::ZeroToOne); + cfg.coordinate_system=mtl::CoordinateSystem2D::ZeroToOne; #else - mci=mtl::CreateVertexColor2D(mtl::CoordinateSystem2D::Ortho); + cfg.coordinate_system=mtl::CoordinateSystem2D::Ortho; #endif//USE_ZERO2ONE_COORD - //material_instance=db->CreateMaterialInstance(OS_TEXT("res/material/VertexColor2D")); + cfg.local_to_world=false; + + AutoDelete mci=mtl::CreateVertexColor2D(&cfg); material_instance=db->CreateMaterialInstance(mci); diff --git a/example/common/VulkanAppFramework.h b/example/common/VulkanAppFramework.h index c2ec093b..dae9020b 100644 --- a/example/common/VulkanAppFramework.h +++ b/example/common/VulkanAppFramework.h @@ -205,7 +205,7 @@ public: cb->BindDescriptorSets(ri); cb->BindVBO(ri); - if (vid->index_buffer) + if (vid->index_buffer->buffer) cb->DrawIndexed(vid->index_buffer->buffer->GetCount()); else cb->Draw(vid->vertex_count);