Add a function to fetch the texture display config from texture viewer

This commit is contained in:
baldurk
2026-08-13 17:46:46 +01:00
parent 7d2477026a
commit 2d0ba78a49
3 changed files with 12 additions and 0 deletions
+7
View File
@@ -851,6 +851,13 @@ If no location is currently selected or there is no current texture, this will r
)");
virtual bool IsZoomAutoFit() = 0;
DOCUMENT(R"(Return the currently configured texture display structure.
:return: The current texture display.
:rtype: renderdoc.TextureDisplay
)");
virtual TextureDisplay GetTextureDisplay() = 0;
DOCUMENT(R"(Return the current zoom level, whether manually set or auto-calculated.
:return: The current zoom level, with 100% being represented as 1.0.
@@ -964,6 +964,10 @@ struct ITextureViewerInvoker : UIThreadInvoker<ITextureViewer>
return InvokeVoidFunction(&ITextureViewer::SetTextureOverlay, overlay);
}
bool IsZoomAutoFit() { return InvokeRetFunction<bool>(&ITextureViewer::IsZoomAutoFit); }
TextureDisplay GetTextureDisplay()
{
return InvokeRetFunction<TextureDisplay>(&ITextureViewer::GetTextureDisplay);
}
float GetZoomLevel() { return InvokeRetFunction<float>(&ITextureViewer::GetZoomLevel); }
void SetZoomLevel(bool autofit, float zoom)
{
+1
View File
@@ -147,6 +147,7 @@ public:
DebugOverlay GetTextureOverlay() override;
void SetTextureOverlay(DebugOverlay overlay) override;
TextureDisplay GetTextureDisplay() override { return m_TexDisplay; }
bool IsZoomAutoFit() override;
float GetZoomLevel() override;
void SetZoomLevel(bool autofit, float zoom) override;