Changeset 187b0f5 in opengl-game for sdl-game.cpp
- Timestamp:
- Mar 11, 2021, 2:44:43 AM (4 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
-
sdl-game.cpp
r20e4c2b r187b0f5 49 49 swapChainPresentMode = VK_PRESENT_MODE_MAX_ENUM_KHR; 50 50 swapChainMinImageCount = 0; 51 51 currentFrame = 0; 52 imageIndex = 0; 52 53 shouldRecreateSwapChain = false; 53 54 … … 254 255 255 256 void VulkanGame::renderLoop() { 256 startTime = high_resolution_clock::now();257 curTime = duration<float, seconds::period>( high_resolution_clock::now() - startTime).count();257 startTime = steady_clock::now(); 258 curTime = duration<float, seconds::period>(steady_clock::now() - startTime).count(); 258 259 259 260 fpsStartTime = curTime; … … 265 266 while (!done) { 266 267 267 curTime = duration<float, seconds::period>( high_resolution_clock::now() - startTime).count();268 curTime = duration<float, seconds::period>(steady_clock::now() - startTime).count(); 268 269 269 270 if (curTime - fpsStartTime >= 1.0f) { … … 333 334 recreateSwapChain(); 334 335 335 imageIndex = 0;336 336 shouldRecreateSwapChain = false; 337 337 } … … 496 496 497 497 cout << "Device: " << deviceProperties.deviceName << endl; 498 499 // TODO: Eventually, maybe let the user pick out of a set of GPUs in case the user does want to use 500 // an integrated GPU. On my laptop, this function returns TRUE for the integrated GPU, but crashes 501 // when trying to use it to render. Maybe I just need to figure out which other extensions and features 502 // to check. 503 if (deviceProperties.deviceType != VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) { 504 return false; 505 } 498 506 499 507 QueueFamilyIndices indices = VulkanUtils::findQueueFamilies(physicalDevice, surface); … … 970 978 971 979 createSyncObjects(); 980 981 imageIndex = 0; 972 982 } 973 983
Note:
See TracChangeset
for help on using the changeset viewer.