Changeset 187b0f5 in opengl-game for vulkan-game.cpp
- Timestamp:
- Mar 11, 2021, 2:44:43 AM (3 years ago)
- Branches:
- feature/imgui-sdl
- Children:
- 301c90a
- Parents:
- 20e4c2b
- git-author:
- Dmitry Portnoy <dportnoy@…> (03/11/21 02:39:25)
- git-committer:
- Dmitry Portnoy <dportnoy@…> (03/11/21 02:44:43)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vulkan-game.cpp
r20e4c2b r187b0f5 59 59 swapChainPresentMode = VK_PRESENT_MODE_MAX_ENUM_KHR; 60 60 swapChainMinImageCount = 0; 61 62 61 currentFrame = 0; 62 imageIndex = 0; 63 63 shouldRecreateSwapChain = false; 64 64 … … 706 706 707 707 void VulkanGame::renderLoop() { 708 startTime = high_resolution_clock::now();709 curTime = duration<float, seconds::period>( high_resolution_clock::now() - startTime).count();708 startTime = steady_clock::now(); 709 curTime = duration<float, seconds::period>(steady_clock::now() - startTime).count(); 710 710 711 711 fpsStartTime = curTime; … … 720 720 721 721 this->prevTime = curTime; 722 curTime = duration<float, seconds::period>( high_resolution_clock::now() - this->startTime).count();722 curTime = duration<float, seconds::period>(steady_clock::now() - this->startTime).count(); 723 723 this->elapsedTime = curTime - this->prevTime; 724 724 … … 901 901 recreateSwapChain(); 902 902 903 imageIndex = 0;904 903 shouldRecreateSwapChain = false; 905 904 } … … 1277 1276 1278 1277 cout << "Device: " << deviceProperties.deviceName << endl; 1278 1279 // TODO: Eventually, maybe let the user pick out of a set of GPUs in case the user does want to use 1280 // an integrated GPU. On my laptop, this function returns TRUE for the integrated GPU, but crashes 1281 // when trying to use it to render. Maybe I just need to figure out which other extensions and features 1282 // to check. 1283 if (deviceProperties.deviceType != VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) { 1284 return false; 1285 } 1279 1286 1280 1287 QueueFamilyIndices indices = VulkanUtils::findQueueFamilies(physicalDevice, surface);
Note:
See TracChangeset
for help on using the changeset viewer.