Skip to content

Commit

Permalink
ModelViewer: make PostRender an extension delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
sturnclaw committed Nov 22, 2023
1 parent dcc27dc commit c410eb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/editor/ModelViewerWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ void ModelViewerWidget::OnRender(Graphics::Renderer *r)
}

// Render any extra effects
PostRender();
m_extPostRender();

// helper rendering
if (m_options.showLandingPad) {
Expand Down
5 changes: 3 additions & 2 deletions src/editor/ModelViewerWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ namespace Editor

const matrix4x4f &GetModelViewMat() const { return m_modelViewMat; }

// Extend to render in-world using Graphics::Renderer
UIDelegate &GetUIExtPostRender() { return m_extPostRender; }
// Extend to render on top of the viewport surface using ImDrawList
UIDelegate &GetUIExtOverlay() { return m_extOverlay; }
// Extend to add additional viewport menu buttons
Expand All @@ -105,8 +107,7 @@ namespace Editor

bool OnCloseRequested() override { return true; };

virtual void PostRender() {};

UIDelegate m_extPostRender;
UIDelegate m_extOverlay;
UIDelegate m_extMenus;
UIDelegate m_extViewportControls;
Expand Down

0 comments on commit c410eb3

Please sign in to comment.