pass overlay member to virtual update function
This commit is contained in:
parent
f6af0bde03
commit
ab407f5346
2 changed files with 6 additions and 7 deletions
|
|
@ -559,7 +559,9 @@ void VulkanExampleBase::updateOverlay()
|
|||
ImGui::Text(deviceProperties.deviceName);
|
||||
ImGui::Text("%.2f ms/frame (%.1d fps)", (frameTimer * 1000.0f), lastFPS);
|
||||
|
||||
OnUpdateUIOverlay();
|
||||
ImGui::PushItemWidth(110.0f);
|
||||
OnUpdateUIOverlay(UIOverlay);
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
ImGui::End();
|
||||
ImGui::PopStyleVar();
|
||||
|
|
@ -569,8 +571,6 @@ void VulkanExampleBase::updateOverlay()
|
|||
UIOverlay->update();
|
||||
}
|
||||
|
||||
//void VulkanExampleBase::getOverlayText(VulkanTextOverlay*) {}
|
||||
|
||||
void VulkanExampleBase::prepareFrame()
|
||||
{
|
||||
// Acquire the next image from the swap chain
|
||||
|
|
@ -2153,4 +2153,4 @@ void VulkanExampleBase::setupSwapChain()
|
|||
swapChain.create(&width, &height, settings.vsync);
|
||||
}
|
||||
|
||||
void VulkanExampleBase::OnUpdateUIOverlay() {}
|
||||
void VulkanExampleBase::OnUpdateUIOverlay(vks::UIOverlay *overlay) {}
|
||||
|
|
@ -66,6 +66,7 @@ private:
|
|||
uint32_t destHeight;
|
||||
bool resizing = false;
|
||||
vks::Benchmark benchmark;
|
||||
vks::UIOverlay *UIOverlay = nullptr;
|
||||
// Called if the window is resized and some resources have to be recreatesd
|
||||
void windowResize();
|
||||
protected:
|
||||
|
|
@ -167,8 +168,6 @@ public:
|
|||
|
||||
bool paused = false;
|
||||
|
||||
vks::UIOverlay *UIOverlay = nullptr;
|
||||
|
||||
// Use to adjust mouse rotation speed
|
||||
float rotationSpeed = 1.0f;
|
||||
// Use to adjust mouse zoom speed
|
||||
|
|
@ -394,7 +393,7 @@ public:
|
|||
void submitFrame();
|
||||
|
||||
/** @brief (Virtual) Called when the UI overlay is updating, can be used to add custom elements to the overlay */
|
||||
virtual void OnUpdateUIOverlay();
|
||||
virtual void OnUpdateUIOverlay(vks::UIOverlay *overlay);
|
||||
};
|
||||
|
||||
// OS specific macros for the example main entry points
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue