Implement viewChanged() in multiple examples for proper window resize handling, fix triangle example resizing on macOS

This commit is contained in:
Stephen Saunders 2022-06-13 23:04:53 -04:00
parent b2f501dc98
commit 279c95422d
42 changed files with 240 additions and 37 deletions

View file

@ -514,6 +514,8 @@ public:
case alignCenter:
x -= textWidth / 2.0f;
break;
case alignLeft:
break;
}
// Generate a uv mapped quad per char in the new text
@ -885,6 +887,10 @@ public:
if (!prepared)
return;
draw();
if (camera.updated)
{
updateUniformBuffers();
}
if (frameCounter == 0)
{
vkDeviceWaitIdle(device);
@ -892,13 +898,6 @@ public:
}
}
virtual void viewChanged()
{
vkDeviceWaitIdle(device);
updateUniformBuffers();
updateTextOverlay();
}
virtual void windowResized()
{
// SRS - Recreate text overlay resources in case number of swapchain images has changed on resize
@ -906,6 +905,12 @@ public:
prepareTextOverlay();
}
virtual void viewChanged()
{
updateUniformBuffers();
updateTextOverlay();
}
#if !defined(__ANDROID__)
virtual void keyPressed(uint32_t keyCode)
{