Skip to content

Commit

Permalink
use simplified imgui setup
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Mar 28, 2024
1 parent 8b5dad2 commit 06bcd18
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ogre_mesh_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,9 @@ def setup(self):
self.getRoot().setRenderSystem(self.getRoot().getRenderSystemByName(self.next_rendersystem))

OgreBites.ApplicationContext.setup(self)
self.addInputListener(self)

self.restart = False
imgui_overlay = Ogre.Overlay.ImGuiOverlay()
imgui_overlay = self.initialiseImGui()
ImGui.GetIO().IniFilename = self.getFSLayer().getWritablePath("imgui.ini")

root = self.getRoot()
Expand All @@ -581,8 +580,6 @@ def setup(self):
self.logwin.font = imgui_overlay.addFont("LogText", RGN_MESHVIEWER)

imgui_overlay.show()
Ogre.Overlay.OverlayManager.getSingleton().addOverlay(imgui_overlay)
imgui_overlay.disown() # owned by OverlayMgr now

shadergen = OgreRTShader.ShaderGenerator.getSingleton()
shadergen.addSceneManager(scn_mgr) # must be done before we do anything with the scene
Expand Down Expand Up @@ -645,8 +642,7 @@ def setup(self):
self.camman.setYawPitchDist(0, 0.3, diam)
self.camman.setFixedYaw(False)

self.imgui_input = OgreBites.ImGuiInputListener()
self.input_dispatcher = OgreBites.InputListenerChain([self.imgui_input, self.camman])
self.input_dispatcher = OgreBites.InputListenerChain([self.getImGuiInputListener(), self.camman, self])
self.addInputListener(self.input_dispatcher)

def shutdown(self):
Expand Down

0 comments on commit 06bcd18

Please sign in to comment.