diff options
| author | Andre Weissflog <floooh@gmail.com> | 2025-07-21 12:41:41 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2025-07-21 12:41:41 +0200 |
| commit | e325ea45bebd56c03493c792c9ed99be9ea73857 (patch) | |
| tree | 3e5ea2d277d388e3012771b42332af1d5b9c2a92 /util | |
| parent | 01413f2c65e471c37693bd90f314e6076ae38ff3 (diff) | |
sokol_gfx_imgui.h: don't attempt to render non-2d texture views
Diffstat (limited to 'util')
| -rw-r--r-- | util/sokol_gfx_imgui.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/util/sokol_gfx_imgui.h b/util/sokol_gfx_imgui.h index 9e254e70..75d4d78d 100644 --- a/util/sokol_gfx_imgui.h +++ b/util/sokol_gfx_imgui.h @@ -3230,7 +3230,11 @@ _SOKOL_PRIVATE void _sgimgui_draw_image(sgimgui_t* ctx, sg_image img, float* opt if (sg_query_view_type(view) == SG_VIEWTYPE_TEXTURE) { sg_image view_img = sg_query_view_image(view); if (view_img.id == img.id) { - break; + // FIXME: once texture views can have a separate image type, + // check this instead + if (sg_query_image_type(view_img) == SG_IMAGETYPE_2D) { + break; + } } } } @@ -3250,7 +3254,7 @@ _SOKOL_PRIVATE void _sgimgui_draw_image(sgimgui_t* ctx, sg_image img, float* opt _sgimgui_igimage(simgui_imtextureid(view), IMVEC2(w, h)); _sgimgui_igpopid(); } else { - _sgimgui_igtext("Image has no texture view.", img.id); + _sgimgui_igtext("Image has no renderable texture view.", img.id); } } |