Changeset 1abebc1 in opengl-game for vulkan-game.cpp
- Timestamp:
- May 19, 2021, 4:49:43 PM (4 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- c163d81
- Parents:
- a3cefaa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.cpp
ra3cefaa r1abebc1 157 157 {{-0.5f, 0.5f, 0.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}}, 158 158 {{-0.5f, -0.5f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}} 159 })), { 160 0, 1, 2, 3, 4, 5 161 }, { 162 mat4(1.0f) 163 }, storageBuffers_modelPipeline); 159 })), 160 { 161 0, 1, 2, 3, 4, 5 162 }, { 163 mat4(1.0f) 164 }); 164 165 165 166 objects_modelPipeline.numObjects++; … … 178 179 {{-0.5f, 0.5f, 0.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}}, 179 180 {{-0.5f, -0.5f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}} 180 })), { 181 0, 1, 2, 3, 4, 5 182 }, { 183 mat4(1.0f) 184 }, storageBuffers_modelPipeline); 181 })), 182 { 183 0, 1, 2, 3, 4, 5 184 }, { 185 mat4(1.0f) 186 }); 185 187 186 188 objects_modelPipeline.numObjects++; … … 412 414 {{ 1.5f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.3f}}, 413 415 {{ 1.3f, 0.0f, -0.3f}, {0.0f, 0.0f, 0.3f}}, 414 })), { 415 0, 1, 2, 3, 4, 5, 416 6, 7, 8, 9, 10, 11, 417 12, 13, 14, 15, 16, 17, 418 18, 19, 20, 21, 22, 23, 419 24, 25, 26, 27, 28, 29, 420 30, 31, 32, 421 33, 34, 35, 422 36, 37, 38, 39, 40, 41, 423 42, 43, 44, 45, 46, 47, 424 48, 49, 50, 51, 52, 53, 425 54, 55, 56, 57, 58, 59, 426 60, 61, 62, 427 63, 64, 65, 428 66, 67, 68, 69, 70, 71, 429 72, 73, 74, 75, 76, 77, 430 78, 79, 80, 81, 82, 83, 431 84, 85, 86, 87, 88, 89, 432 90, 91, 92, 433 93, 94, 95, 434 96, 97, 98, 435 99, 100, 101, 436 102, 103, 104, 105, 106, 107, 437 108, 109, 110, 111, 112, 113, 438 114, 115, 116, 117, 118, 119, 439 120, 121, 122, 123, 124, 125, 440 126, 127, 128, 441 129, 130, 131, 442 132, 133, 134, 443 135, 136, 137, 416 })), 417 { 418 0, 1, 2, 3, 4, 5, 419 6, 7, 8, 9, 10, 11, 420 12, 13, 14, 15, 16, 17, 421 18, 19, 20, 21, 22, 23, 422 24, 25, 26, 27, 28, 29, 423 30, 31, 32, 424 33, 34, 35, 425 36, 37, 38, 39, 40, 41, 426 42, 43, 44, 45, 46, 47, 427 48, 49, 50, 51, 52, 53, 428 54, 55, 56, 57, 58, 59, 429 60, 61, 62, 430 63, 64, 65, 431 66, 67, 68, 69, 70, 71, 432 72, 73, 74, 75, 76, 77, 433 78, 79, 80, 81, 82, 83, 434 84, 85, 86, 87, 88, 89, 435 90, 91, 92, 436 93, 94, 95, 437 96, 97, 98, 438 99, 100, 101, 439 102, 103, 104, 105, 106, 107, 440 108, 109, 110, 111, 112, 113, 441 114, 115, 116, 117, 118, 119, 442 120, 121, 122, 123, 124, 125, 443 126, 127, 128, 444 129, 130, 131, 445 132, 133, 134, 446 135, 136, 137, 444 447 }, { 445 448 mat4(1.0f) 446 } , storageBuffers_shipPipeline);449 }); 447 450 448 451 objects_shipPipeline.numObjects++; … … 780 783 {{-0.5f, 0.5f, 0.0f}, {1.0f, 1.0f, 1.0f}, {0.0f, 0.0f}}, 781 784 {{-0.5f, -0.5f, 0.0f}, {1.0f, 0.0f, 0.0f}, {0.0f, 1.0f}} 782 })), { 783 0, 1, 2, 3, 4, 5 784 }, { 785 mat4(1.0f) 786 }, storageBuffers_modelPipeline); 785 })), 786 { 787 0, 1, 2, 3, 4, 5 788 }, { 789 mat4(1.0f) 790 }); 787 791 788 792 objects_modelPipeline.numObjects++; … … 1056 1060 {{-1.0f, -1.0f, -1.0f}, {0.4f, 0.4f, 0.4f}}, 1057 1061 {{-1.0f, -1.0f, 1.0f}, {0.4f, 0.4f, 0.4f}}, 1058 })), { 1059 0, 1, 2, 3, 4, 5, 1060 6, 7, 8, 9, 10, 11, 1061 12, 13, 14, 15, 16, 17, 1062 18, 19, 20, 21, 22, 23, 1063 24, 25, 26, 27, 28, 29, 1064 30, 31, 32, 33, 34, 35, 1065 }, { 1066 mat4(1.0f), 1067 10.0f, 1068 false 1069 }, storageBuffers_asteroidPipeline); 1062 })), 1063 { 1064 0, 1, 2, 3, 4, 5, 1065 6, 7, 8, 9, 10, 11, 1066 12, 13, 14, 15, 16, 17, 1067 18, 19, 20, 21, 22, 23, 1068 24, 25, 26, 27, 28, 29, 1069 30, 31, 32, 33, 34, 35, 1070 }, { 1071 mat4(1.0f), 1072 10.0f, 1073 false 1074 }); 1070 1075 1071 1076 objects_asteroidPipeline.numObjects++; … … 1096 1101 // TODO: Probably move the resizing to the VulkanBuffer class 1097 1102 if (objects_modelPipeline.numObjects > objects_modelPipeline.capacity) { 1098 resize StorageBufferSet(storageBuffers_modelPipeline, objects_modelPipeline, modelPipeline, resourceCommandPool,1099 1103 resizeBufferSet(storageBuffers_modelPipeline, objects_modelPipeline, modelPipeline, resourceCommandPool, 1104 graphicsQueue); 1100 1105 } 1101 1106 1102 1107 for (size_t i = 0; i < modelObjects.size(); i++) { 1103 1108 if (modelObjects[i].modified) { 1104 updateObject(modelObjects , modelPipeline, i);1105 update StorageBuffer(storageBuffers_modelPipeline, i, modelObjects[i].ssbo);1109 updateObject(modelObjects[i]); 1110 updateBufferSet(storageBuffers_modelPipeline, i, modelObjects[i].ssbo); 1106 1111 } 1107 1112 } … … 1109 1114 // TODO: Probably move the resizing to the VulkanBuffer class 1110 1115 if (objects_shipPipeline.numObjects > objects_shipPipeline.capacity) { 1111 resize StorageBufferSet(storageBuffers_shipPipeline, objects_shipPipeline, shipPipeline, resourceCommandPool,1112 1116 resizeBufferSet(storageBuffers_shipPipeline, objects_shipPipeline, shipPipeline, resourceCommandPool, 1117 graphicsQueue); 1113 1118 } 1114 1119 1115 1120 for (size_t i = 0; i < shipObjects.size(); i++) { 1116 1121 if (shipObjects[i].modified) { 1117 updateObject(shipObjects , shipPipeline, i);1118 update StorageBuffer(storageBuffers_shipPipeline, i, shipObjects[i].ssbo);1122 updateObject(shipObjects[i]); 1123 updateBufferSet(storageBuffers_shipPipeline, i, shipObjects[i].ssbo); 1119 1124 } 1120 1125 } … … 1122 1127 // TODO: Probably move the resizing to the VulkanBuffer class 1123 1128 if (objects_asteroidPipeline.numObjects > objects_asteroidPipeline.capacity) { 1124 resize StorageBufferSet(storageBuffers_asteroidPipeline, objects_asteroidPipeline, asteroidPipeline,1125 1129 resizeBufferSet(storageBuffers_asteroidPipeline, objects_asteroidPipeline, asteroidPipeline, 1130 resourceCommandPool, graphicsQueue); 1126 1131 } 1127 1132 1128 1133 for (size_t i = 0; i < asteroidObjects.size(); i++) { 1129 1134 if (asteroidObjects[i].modified) { 1130 updateObject(asteroidObjects , asteroidPipeline, i);1131 update StorageBuffer(storageBuffers_asteroidPipeline, i, asteroidObjects[i].ssbo);1135 updateObject(asteroidObjects[i]); 1136 updateBufferSet(storageBuffers_asteroidPipeline, i, asteroidObjects[i].ssbo); 1132 1137 } 1133 1138 } … … 1135 1140 // TODO: Probably move the resizing to the VulkanBuffer class 1136 1141 if (objects_laserPipeline.numObjects > objects_laserPipeline.capacity) { 1137 resize StorageBufferSet(storageBuffers_laserPipeline, objects_laserPipeline, laserPipeline, resourceCommandPool,1138 1142 resizeBufferSet(storageBuffers_laserPipeline, objects_laserPipeline, laserPipeline, resourceCommandPool, 1143 graphicsQueue); 1139 1144 } 1140 1145 1141 1146 for (size_t i = 0; i < laserObjects.size(); i++) { 1142 1147 if (laserObjects[i].modified) { 1143 updateObject(laserObjects , laserPipeline, i);1144 update StorageBuffer(storageBuffers_laserPipeline, i, laserObjects[i].ssbo);1148 updateObject(laserObjects[i]); 1149 updateBufferSet(storageBuffers_laserPipeline, i, laserObjects[i].ssbo); 1145 1150 } 1146 1151 } … … 1148 1153 // TODO: Probably move the resizing to the VulkanBuffer class 1149 1154 if (objects_explosionPipeline.numObjects > objects_explosionPipeline.capacity) { 1150 resize StorageBufferSet(storageBuffers_explosionPipeline, objects_explosionPipeline, explosionPipeline,1151 1155 resizeBufferSet(storageBuffers_explosionPipeline, objects_explosionPipeline, explosionPipeline, 1156 resourceCommandPool, graphicsQueue); 1152 1157 } 1153 1158 1154 1159 for (size_t i = 0; i < explosionObjects.size(); i++) { 1155 1160 if (explosionObjects[i].modified) { 1156 updateObject(explosionObjects , explosionPipeline, i);1157 update StorageBuffer(storageBuffers_explosionPipeline, i, explosionObjects[i].ssbo);1161 updateObject(explosionObjects[i]); 1162 updateBufferSet(storageBuffers_explosionPipeline, i, explosionObjects[i].ssbo); 1158 1163 } 1159 1164 } … … 1976 1981 color, 1977 1982 false 1978 } , storageBuffers_laserPipeline);1983 }); 1979 1984 1980 1985 objects_laserPipeline.numObjects++; … … 2181 2186 2182 2187 SceneObject<ExplosionVertex, SSBO_Explosion>& explosion = addObject( 2183 explosionObjects, explosionPipeline, 2184 addObjectIndex(explosionObjects.size(), vertices), 2185 indices, { 2188 explosionObjects, explosionPipeline, addObjectIndex(explosionObjects.size(), vertices), indices, { 2186 2189 mat4(1.0f), 2187 2190 cur_time, 2188 2191 duration, 2189 2192 false 2190 } , storageBuffers_explosionPipeline);2193 }); 2191 2194 2192 2195 objects_explosionPipeline.numObjects++;
Note:
See TracChangeset
for help on using the changeset viewer.