Changeset 8d92284 in opengl-game for vulkan-game.cpp
- Timestamp:
- Apr 10, 2021, 1:31:20 AM (3 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- b8efa56
- Parents:
- a00eb06
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.cpp
ra00eb06 r8d92284 174 174 modelPipeline.createDescriptorSets(swapChainImages); 175 175 176 shipPipeline.addAttribute(VK_FORMAT_R32G32B32_SFLOAT, offset_of(&ShipVertex::pos)); 177 shipPipeline.addAttribute(VK_FORMAT_R32G32B32_SFLOAT, offset_of(&ShipVertex::color)); 178 shipPipeline.addAttribute(VK_FORMAT_R32G32B32_SFLOAT, offset_of(&ShipVertex::normal)); 179 shipPipeline.addAttribute(VK_FORMAT_R32_UINT, offset_of(&ShipVertex::objIndex)); 176 // START UNREVIEWED SECTION 177 shipPipeline.addAttribute(VK_FORMAT_R32G32B32_SFLOAT, offset_of(&ModelVertex::pos)); 178 shipPipeline.addAttribute(VK_FORMAT_R32G32B32_SFLOAT, offset_of(&ModelVertex::color)); 179 shipPipeline.addAttribute(VK_FORMAT_R32G32_SFLOAT, offset_of(&ModelVertex::texCoord)); 180 shipPipeline.addAttribute(VK_FORMAT_R32G32B32_SFLOAT, offset_of(&ModelVertex::normal)); 181 shipPipeline.addAttribute(VK_FORMAT_R32_UINT, offset_of(&ModelVertex::objIndex)); 180 182 181 183 createBufferSet(sizeof(UBO_VP_mats), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, … … 188 190 // TODO: With the normals, indexing basically becomes pointless since no vertices will have exactly 189 191 // the same data. Add an option to make some pipelines not use indexing 190 SceneObject< ShipVertex, SSBO_ModelObject>& ship = addObject(shipObjects, shipPipeline,191 addObjectIndex< ShipVertex>(shipObjects.size(),192 addVertexNormals< ShipVertex>({192 SceneObject<ModelVertex, SSBO_ModelObject>& ship = addObject(shipObjects, shipPipeline, 193 addObjectIndex<ModelVertex>(shipObjects.size(), 194 addVertexNormals<ModelVertex>({ 193 195 194 196 //back … … 482 484 explosionPipeline.createDescriptorSets(swapChainImages); 483 485 486 // END UNREVIEWED SECTION 487 484 488 currentRenderScreenFn = &VulkanGame::renderMainScreen; 485 489 … … 582 586 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, swapChainImages, 24, 24, 10); 583 587 584 shipPipeline = GraphicsPipeline_Vulkan< ShipVertex, SSBO_ModelObject>(588 shipPipeline = GraphicsPipeline_Vulkan<ModelVertex, SSBO_ModelObject>( 585 589 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, physicalDevice, device, renderPass, 586 590 { 0, 0, (int)swapChainExtent.width, (int)swapChainExtent.height }, swapChainImages, 138, 138, 10); … … 723 727 translate(mat4(1.0f), vec3(0.0f, 0.0f, zOffset)); 724 728 texturedSquare.modified = true; 729 // START UNREVIEWED SECTION 725 730 } else if (e.key.keycode == SDL_SCANCODE_Z && leftLaserIdx == -1) { 726 731 // TODO: When I start actually removing objects from the object vectors, … … 745 750 746 751 rightLaserIdx = laserObjects.size() - 1; 752 // END UNREVIEWED SECTION 747 753 } else { 748 754 cout << "Key event detected" << endl; … … 750 756 break; 751 757 case UI_EVENT_KEYUP: 758 // START UNREVIEWED SECTION 752 759 if (e.key.keycode == SDL_SCANCODE_Z && leftLaserIdx != -1) { 753 760 laserObjects[leftLaserIdx].ssbo.deleted = true; … … 769 776 } 770 777 } 778 // END UNREVIEWED SECTION 771 779 break; 772 780 case UI_EVENT_WINDOW: … … 792 800 // Check which keys are held down 793 801 794 SceneObject< ShipVertex, SSBO_ModelObject>& ship = shipObjects[0];802 SceneObject<ModelVertex, SSBO_ModelObject>& ship = shipObjects[0]; 795 803 796 804 if (gui->keyPressed(SDL_SCANCODE_LEFT)) { … … 836 844 shouldRecreateSwapChain = false; 837 845 } 838 } 846 }// REVIEWED TO THIS POINT 839 847 840 848 updateScene();
Note:
See TracChangeset
for help on using the changeset viewer.