MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / prepare

Method prepare

samples/api/hello_triangle_1_3/hello_triangle_1_3.cpp:1203–1229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1201}
1202
1203bool HelloTriangleV13::prepare(const vkb::ApplicationOptions &options)
1204{
1205 assert(options.window != nullptr);
1206
1207 init_instance();
1208
1209 context.surface = options.window->create_surface(context.instance, nullptr);
1210 auto &extent = options.window->get_extent();
1211 context.swapchain_dimensions.width = extent.width;
1212 context.swapchain_dimensions.height = extent.height;
1213
1214 if (!context.surface)
1215 {
1216 throw std::runtime_error("Failed to create window surface.");
1217 }
1218
1219 init_device();
1220
1221 init_vertex_buffer();
1222
1223 init_swapchain();
1224
1225 // Create the necessary objects for rendering.
1226 init_pipeline();
1227
1228 return true;
1229}
1230
1231void HelloTriangleV13::update(float delta_time)
1232{

Callers

nothing calls this directly

Calls 1

create_surfaceMethod · 0.45

Tested by

no test coverage detected