Changeset 4e705d6 in opengl-game for vulkan-game.hpp
- Timestamp:
- Jun 9, 2020, 2:14:06 PM (5 years ago)
- Branches:
- feature/imgui-sdl, master
- Children:
- e1f88a9
- Parents:
- b8d4456
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.hpp
rb8d4456 r4e705d6 11 11 #include <glm/gtc/matrix_transform.hpp> 12 12 13 #include "vulkan-utils.hpp" 14 #include "graphics-pipeline_vulkan.hpp" 15 13 16 #include "game-gui-sdl.hpp" 14 #include "graphics-pipeline_vulkan.hpp"15 16 #include "vulkan-utils.hpp"17 17 18 18 using namespace glm; 19 19 using namespace std::chrono; 20 21 // TODO: Switch from union to std::variant 20 22 21 23 #ifdef NDEBUG … … 193 195 void run(int width, int height, unsigned char guiFlags); 194 196 197 GraphicsPipeline_Vulkan<OverlayVertex, void*> overlayPipeline; 198 199 GraphicsPipeline_Vulkan<ModelVertex, SSBO_ModelObject> modelPipeline; 200 201 GraphicsPipeline_Vulkan<ShipVertex, SSBO_ModelObject> shipPipeline; 202 203 GraphicsPipeline_Vulkan<AsteroidVertex, SSBO_Asteroid> asteroidPipeline; 204 205 GraphicsPipeline_Vulkan<LaserVertex, SSBO_Laser> laserPipeline; 206 207 GraphicsPipeline_Vulkan<ExplosionVertex, SSBO_Explosion> explosionPipeline; 208 195 209 private: 196 210 // TODO: Make these consts static 211 // Also, maybe move them into consts.hpp 197 212 198 213 const int MAX_FRAMES_IN_FLIGHT; … … 207 222 vec3 cam_pos; 208 223 224 // TODO: Good place to start using smart pointers 209 225 GameGui* gui; 210 226 … … 237 253 VulkanImage depthImage; 238 254 239 VkSampler textureSampler;240 241 VulkanImage sdlOverlayImage;242 VkDescriptorImageInfo sdlOverlayImageDescriptor;243 244 VulkanImage floorTextureImage;245 VkDescriptorImageInfo floorTextureImageDescriptor;246 247 VulkanImage laserTextureImage;248 VkDescriptorImageInfo laserTextureImageDescriptor;249 250 TTF_Font* font;251 SDL_Texture* fontSDLTexture;252 253 SDL_Texture* imageSDLTexture;254 255 255 vector<VkSemaphore> imageAvailableSemaphores; 256 256 vector<VkSemaphore> renderFinishedSemaphores; … … 261 261 bool framebufferResized; 262 262 263 VkSampler textureSampler; 264 265 VulkanImage sdlOverlayImage; 266 VkDescriptorImageInfo sdlOverlayImageDescriptor; 267 268 VulkanImage floorTextureImage; 269 VkDescriptorImageInfo floorTextureImageDescriptor; 270 271 VulkanImage laserTextureImage; 272 VkDescriptorImageInfo laserTextureImageDescriptor; 273 274 TTF_Font* font; 275 SDL_Texture* fontSDLTexture; 276 277 SDL_Texture* imageSDLTexture; 278 263 279 mat4 viewMat, projMat; 264 265 GraphicsPipeline_Vulkan<OverlayVertex, void*> overlayPipeline;266 vector<SceneObject<OverlayVertex, void*>> overlayObjects;267 280 268 281 // TODO: Maybe make the ubo objects part of the pipeline class since there's only one ubo … … 274 287 // if there is a need to add other uniform variables to one or more of the shaders 275 288 276 GraphicsPipeline_Vulkan<ModelVertex, SSBO_ModelObject> modelPipeline; 289 vector<SceneObject<OverlayVertex, void*>> overlayObjects; 290 277 291 vector<SceneObject<ModelVertex, SSBO_ModelObject>> modelObjects; 278 292 … … 283 297 UBO_VP_mats object_VP_mats; 284 298 285 GraphicsPipeline_Vulkan<ShipVertex, SSBO_ModelObject> shipPipeline;286 299 vector<SceneObject<ShipVertex, SSBO_ModelObject>> shipObjects; 287 300 … … 292 305 UBO_VP_mats ship_VP_mats; 293 306 294 GraphicsPipeline_Vulkan<AsteroidVertex, SSBO_Asteroid> asteroidPipeline;295 307 vector<SceneObject<AsteroidVertex, SSBO_Asteroid>> asteroidObjects; 296 308 … … 301 313 UBO_VP_mats asteroid_VP_mats; 302 314 303 GraphicsPipeline_Vulkan<LaserVertex, SSBO_Laser> laserPipeline;304 315 vector<SceneObject<LaserVertex, SSBO_Laser>> laserObjects; 305 316 … … 310 321 UBO_VP_mats laser_VP_mats; 311 322 312 GraphicsPipeline_Vulkan<ExplosionVertex, SSBO_Explosion> explosionPipeline;313 323 vector<SceneObject<ExplosionVertex, SSBO_Explosion>> explosionObjects; 314 324 … … 336 346 EffectOverTime<AsteroidVertex, SSBO_Asteroid>* rightLaserEffect = nullptr; 337 347 338 bool init Window(int width, int height, unsigned char guiFlags);348 bool initUI(int width, int height, unsigned char guiFlags); 339 349 void initVulkan(); 340 350 void initGraphicsPipelines();
Note:
See TracChangeset
for help on using the changeset viewer.