Skip to content

add imgui stats on next wgpu release #749

@kushalkolar

Description

@kushalkolar

very easy to implement this: pygfx/wgpu-py#670

Image

In ImguiFigure._render():

     def _render(self, draw=False):
-        super()._render(draw)
+        if self.show_fps:
+            with self._stats:
+                super()._render(draw)
 
         self.imgui_renderer.render()
         self.canvas.request_draw()

Until then this actually works using latest wgpu@main:

from wgpu.utils.imgui import Stats
stats = Stats(figure.renderer.device, figure.canvas)
figure.add_animations(stats.start, pre_render=True, post_render=False)
figure.add_animations(stats.stop, pre_render=False, post_render=True)

figure.show()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions