From ad8ce037fd478ea16851f6e9ef362c72f13e452c Mon Sep 17 00:00:00 2001 From: Xiang Silian Date: Fri, 19 Sep 2025 18:06:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=91=E9=80=9A=E7=82=B9=E7=9A=84=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/texture_loading/texture_loading.cpp | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/samples/api/texture_loading/texture_loading.cpp b/samples/api/texture_loading/texture_loading.cpp index a5cdd41..53a713c 100644 --- a/samples/api/texture_loading/texture_loading.cpp +++ b/samples/api/texture_loading/texture_loading.cpp @@ -24,7 +24,8 @@ TextureLoading::TextureLoading() { zoom = -1.f; - rotation = { 0.0f, 15.0f, 0.0f }; + //rotation = { 0.0f, 15.0f, 0.0f }; + rotation = { 0.0f, 0.0f, 0.0f }; title = "Texture loading"; this_instance = this; } @@ -182,10 +183,10 @@ std::vector generateSimpleTestImage(int width, int height, int cell_wid const uint8_t* color = cellColors[gridY][gridX].data(); int index = (y * width + x) * 4; - imageData[index] = color[0]; - imageData[index + 1] = color[1]; - imageData[index + 2] = color[2]; - imageData[index + 3] = color[3]; + imageData[index] = color[0]/10; + imageData[index + 1] = color[1]/10; + imageData[index + 2] = color[2]/10; + imageData[index + 3] = color[3]/10; } } } @@ -1219,7 +1220,14 @@ bool TextureLoading::prepare(const vkb::ApplicationOptions& options) prepare_pipeline_bg(); prepare_pipeline_point(); - + float z = 0.1f; + float testPoint[] = { + 1,1,z, + 0,0,z, + 0.5,0.5,z, + }; + int pointCount = sizeof(testPoint) / (3*4); + update_point_vertex_buffer(testPoint, pointCount); prepared = true; //start(); @@ -1273,6 +1281,7 @@ void TextureLoading::render(float delta_time) void TextureLoading::view_changed() { update_uniform_buffers(); + update_uniform_buffers_point(); } void TextureLoading::on_update_ui_overlay(vkb::Drawer& drawer)