跑通点的渲染。

This commit is contained in:
xsl
2025-09-19 18:06:16 +08:00
parent 41756e71df
commit ad8ce037fd
@@ -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<uint8_t> 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)