Skip to content

Way to display images(imgui.image) that are already on GPU #729

@REDxEYE

Description

@REDxEYE

Hello, I haven't found a way to display image/texture that i have created in pygfx in wgpu-py/imgui-bundle.

Currently i'm manually adding my texture to ImguiWgpuBackend._texture_views like so

    def _get_imgui_image_id(self, texture: gfx.Texture) -> int:
        """Get the ImGui image ID for the given texture."""
        if self._current_texture_id is None or self._current_texture_id != id(texture):
            self._current_texture_id = id(texture)
            texture_view = GfxTextureView(texture)
            self._current_texture_view = ensure_wgpu_object(texture_view)
            id_32 = ctypes.c_int32(id(self._current_texture_view)).value
            self.window.imgui_renderer.backend._texture_views[id_32] = self._current_texture_view
            return id_32
        return ctypes.c_int32(id(self._current_texture_view)).value

Please help me find correct way to display images

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