Changeset e3bef3a in opengl-game for vulkan-game.cpp
- Timestamp:
- Nov 12, 2019, 6:55:07 AM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- cd487fb
- Parents:
- 5a23277
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.cpp
r5a23277 re3bef3a 254 254 255 255 cout << "Created " << graphicsPipelines.size() << " graphics pipelines" << endl; 256 257 numPlanes = 2; 256 258 257 259 createCommandBuffers(); … … 281 283 framebufferResized = true; 282 284 break; 283 case UI_EVENT_KEY :285 case UI_EVENT_KEYDOWN: 284 286 if (e.key.keycode == SDL_SCANCODE_ESCAPE) { 285 287 quit = true; 288 } else if (e.key.keycode == SDL_SCANCODE_SPACE) { 289 cout << "Adding a plane" << endl; 290 float zOffset = -0.5f + (0.5f * numPlanes); 291 vector<Vertex> vertices = { 292 {{-0.5f, -0.5f, zOffset}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}}, 293 {{ 0.5f, -0.5f, zOffset}, {0.0f, 1.0f, 0.0f}, {1.0f, 1.0f}}, 294 {{ 0.5f, 0.5f, zOffset}, {0.0f, 0.0f, 1.0f}, {1.0f, 0.0f}}, 295 {{-0.5f, 0.5f, zOffset}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}} 296 }; 297 vector<uint16_t> indices = { 298 0, 1, 2, 2, 3, 0 299 }; 300 301 if (graphicsPipelines[0].addObject(vertices, indices, commandPool, graphicsQueue)) { 302 vkFreeCommandBuffers(device, commandPool, static_cast<uint32_t>(commandBuffers.size()), commandBuffers.data()); 303 createCommandBuffers(); 304 305 numPlanes++; 306 } 286 307 } else { 287 308 cout << "Key event detected" << endl; … … 943 964 } 944 965 966 // TODO: Fix the crash that happens when alt-tabbing 945 967 void VulkanGame::recreateSwapChain() { 946 968 cout << "Recreating swap chain" << endl;
Note:
See TracChangeset
for help on using the changeset viewer.