Changeset 3f32dfd in opengl-game for vulkan-game.hpp
- Timestamp:
- Jan 24, 2021, 5:56:07 PM (4 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- ce9dc9f
- Parents:
- 7f60b28
- git-author:
- Dmitry Portnoy <dportnoy@…> (01/24/21 17:47:00)
- git-committer:
- Dmitry Portnoy <dportnoy@…> (01/24/21 17:56:07)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.hpp
r7f60b28 r3f32dfd 198 198 class VulkanGame { 199 199 public: 200 VulkanGame( int maxFramesInFlight);200 VulkanGame(); 201 201 ~VulkanGame(); 202 202 … … 234 234 void* pUserData); 235 235 236 // TODO: Make these consts static237 // Also, maybe move them into consts.hpp238 239 const int MAX_FRAMES_IN_FLIGHT;240 241 236 const float NEAR_CLIP = 0.1f; 242 237 const float FAR_CLIP = 100.0f; … … 268 263 VkQueue presentQueue; 269 264 265 // TODO: Maybe make a swapchain struct for convenience 266 VkSurfaceFormatKHR swapChainSurfaceFormat; 267 VkPresentModeKHR swapChainPresentMode; 268 VkExtent2D swapChainExtent; 269 uint32_t swapChainMinImageCount; 270 270 uint32_t swapChainImageCount; 271 271 VkSwapchainKHR swapChain; 272 272 vector<VkImage> swapChainImages; 273 VkFormat swapChainImageFormat;274 VkExtent2D swapChainExtent;275 273 vector<VkImageView> swapChainImageViews; 276 274 vector<VkFramebuffer> swapChainFramebuffers; 277 275 278 276 VkRenderPass renderPass; 277 278 VkCommandPool resourceCommandPool; 279 279 280 VkCommandPool commandPool; 281 vector<VkCommandPool> commandPools; // This is not used yet, but will be once 280 282 vector<VkCommandBuffer> commandBuffers; 281 283 282 284 VulkanImage depthImage; 283 285 284 vector<VkSemaphore> imageAvailableSemaphores; 285 vector<VkSemaphore> renderFinishedSemaphores; 286 // These are per frame 287 vector<VkSemaphore> imageAcquiredSemaphores; 288 vector<VkSemaphore> renderCompleteSemaphores; 289 290 // These are per swap chain image 286 291 vector<VkFence> inFlightFences; 287 292 288 size_t currentFrame; 293 uint32_t imageIndex; 294 uint32_t currentFrame; 289 295 290 296 bool framebufferResized; … … 380 386 void initMatrices(); 381 387 void mainLoop(); 382 void updateScene( uint32_t currentImage);388 void updateScene(); 383 389 void renderScene(); 384 390 void cleanup(); … … 392 398 void createLogicalDevice(const vector<const char*>& validationLayers, 393 399 const vector<const char*>& deviceExtensions); 400 void chooseSwapChainProperties(); 394 401 void createSwapChain(); 395 402 void createImageViews(); 396 403 void createRenderPass(); 397 VkFormat findDepthFormat(); 404 VkFormat findDepthFormat(); // TODO: Declare/define (in the cpp file) this function in some util functions section 405 void createResourceCommandPool(); 398 406 void createCommandPool(); 399 407 void createImageResources(); 400 401 void createTextureSampler();402 408 void createFramebuffers(); 403 409 void createCommandBuffers(); 404 410 void createSyncObjects(); 411 412 void createTextureSampler(); 405 413 406 414 void createImguiDescriptorPool();
Note:
See TracChangeset
for help on using the changeset viewer.