Skip to content

Commit dc7771a

Browse files
committed
feat: add Window and GraphicsManager accessors to the testbed
1 parent 5de07a4 commit dc7771a

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎src_testbed/viewer.rs‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,28 @@ impl TestbedViewer {
419419
self.window.egui_context_mut()
420420
}
421421

422+
/// The underlying kiss3d window.
423+
pub fn window(&self) -> &Window {
424+
&self.window
425+
}
426+
427+
/// The graphics manager owning the kiss3d scene.
428+
pub fn graphics(&self) -> &GraphicsManager {
429+
&self.graphics
430+
}
431+
432+
/// Mutable access to the graphics manager owning the kiss3d scene, e.g. to
433+
/// add custom render nodes from an example's render loop.
434+
pub fn graphics_mut(&mut self) -> &mut GraphicsManager {
435+
&mut self.graphics
436+
}
437+
438+
/// Mutable access to the underlying kiss3d window, e.g. for immediate-mode
439+
/// drawing (`draw_point`, `draw_line`, ...) from an example's render loop.
440+
pub fn window_mut(&mut self) -> &mut Window {
441+
&mut self.window
442+
}
443+
422444
// ───────────────────────────── registry / loop ──────────────────────────
423445

424446
/// Display index of the example the UI currently has selected, clamped to a

0 commit comments

Comments
 (0)