| 1079 | } |
| 1080 | |
| 1081 | bool HelloTriangle::prepare(const vkb::ApplicationOptions &options) |
| 1082 | { |
| 1083 | // Headless is not supported to keep this sample as simple as possible |
| 1084 | assert(options.window != nullptr); |
| 1085 | assert(options.window->get_window_mode() != vkb::Window::Mode::Headless); |
| 1086 | |
| 1087 | init_instance(); |
| 1088 | |
| 1089 | context.surface = options.window->create_surface(context.instance, nullptr); |
| 1090 | auto &extent = options.window->get_extent(); |
| 1091 | context.swapchain_dimensions.width = extent.width; |
| 1092 | context.swapchain_dimensions.height = extent.height; |
| 1093 | |
| 1094 | if (!context.surface) |
| 1095 | { |
| 1096 | throw std::runtime_error("Failed to create window surface."); |
| 1097 | } |
| 1098 | |
| 1099 | init_device(); |
| 1100 | |
| 1101 | init_vertex_buffer(); |
| 1102 | |
| 1103 | init_swapchain(); |
| 1104 | |
| 1105 | // Create the necessary objects for rendering. |
| 1106 | init_render_pass(); |
| 1107 | init_pipeline(); |
| 1108 | init_framebuffers(); |
| 1109 | |
| 1110 | return true; |
| 1111 | } |
| 1112 | |
| 1113 | void HelloTriangle::update(float delta_time) |
| 1114 | { |
nothing calls this directly
no test coverage detected