Drawlist issues when using cimgui-go wrapper + ebiten, possibly stemming from imgui #7372

Closed
opened 2024-03-06 15:20:29 +00:00 by damntourists · 0 comments
damntourists commented 2024-03-06 15:20:29 +00:00 (Migrated from github.com)

Version/Branch of Dear ImGui:

i believe cimgui uses the docking branch by default. wrapper i'm using is this one: https://github.com/AllenDang/cimgui-go

Back-ends:

https://github.com/damntourists/cimgui-go-ebiten

Compiler, OS:

ubuntu

Full config/build information:

git clone https://github.com/damntourists/cimgui-go-ebiten.git
cd cimgui-go-ebiten
go run -tags exclude_cimgui_glfw,exclude_cimgui_sdli examples/basic/main.go

Details:

My Issue/Question:

Hi there, I apologize in advance if this is the wrong place to post this! I posted here because I saw a couple other issues that seemed to be similar that occurred in the past and have since been resolved for others.

I'm currently using AllenDang's cimgui-go wrapper, which shows the following in one of the generated files:

//This file is automatically generated by generator.lua from https://github.com/cimgui/cimgui
//based on imgui.h file version "1.90.4" 19040 from Dear ImGui https://github.com/ocornut/imgui

I was using this drawlist rendering code as reference, which seemed to work fine with older versions of imgui https://github.com/gabstv/ebiten-imgui/blob/master/render.go#L52 to allow me to render drawlists on a frame rendered with ebitengen. Never encountered any drawlist issues with the version used on gabstv's repository, however the version used there is forked and old.

Unfortunately, using the same rendering code caused a number of display issues with a more up to date version of imgui which I believe have to do with the cliprect for the scrolling areas.
imgui_drawlist_issue

In the attached image, I've enabled the debug windows to show the cliprects and you can see that the cyan colored rect for the text exceeds the size of the magenta cliprect. This is also happening with other widgets as well (child scroll areas or hovered items for example) Sometimes they'll be visible outside of the window when scrolling.
imgui_drawlist_issue2

Another issue I encountered was with modal dialogs appearing with the dim background covering the modal itself.
imgui_drawlist_issue3

I am unsure if this has something to do with the wrappers, or if it's underlying code in imgui that is causing issues.

Any insight would be helpful!

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

git clone https://github.com/damntourists/cimgui-go-ebiten.git
cd cimgui-go-ebiten
go run -tags exclude_cimgui_glfw,exclude_cimgui_sdli examples/basic/main.go
### Version/Branch of Dear ImGui: i believe cimgui uses the docking branch by default. wrapper i'm using is this one: https://github.com/AllenDang/cimgui-go ### Back-ends: https://github.com/damntourists/cimgui-go-ebiten ### Compiler, OS: ubuntu ### Full config/build information: git clone https://github.com/damntourists/cimgui-go-ebiten.git cd cimgui-go-ebiten go run -tags exclude_cimgui_glfw,exclude_cimgui_sdli examples/basic/main.go ### Details: **My Issue/Question:** Hi there, I apologize in advance if this is the wrong place to post this! I posted here because I saw a couple other issues that seemed to be similar that occurred in the past and have since been resolved for others. I'm currently using AllenDang's cimgui-go wrapper, which shows the following in one of the generated files: ``` //This file is automatically generated by generator.lua from https://github.com/cimgui/cimgui //based on imgui.h file version "1.90.4" 19040 from Dear ImGui https://github.com/ocornut/imgui ``` I was using this drawlist rendering code as reference, which seemed to work fine with older versions of imgui https://github.com/gabstv/ebiten-imgui/blob/master/render.go#L52 to allow me to render drawlists on a frame rendered with [ebitengen](https://ebitengine.org/). Never encountered any drawlist issues with the version used on gabstv's repository, however the version used there is forked and old. Unfortunately, using the same rendering code caused a number of display issues with a more up to date version of imgui which I believe have to do with the cliprect for the scrolling areas. ![imgui_drawlist_issue](https://github.com/ocornut/imgui/assets/1501643/826253db-aef0-41c6-b850-33cdf10ed484) In the attached image, I've enabled the debug windows to show the cliprects and you can see that the cyan colored rect for the text exceeds the size of the magenta cliprect. This is also happening with other widgets as well (child scroll areas or hovered items for example) Sometimes they'll be visible outside of the window when scrolling. ![imgui_drawlist_issue2](https://github.com/ocornut/imgui/assets/1501643/6b01be6f-c842-4897-91ae-b492c94245d8) Another issue I encountered was with modal dialogs appearing with the dim background covering the modal itself. ![imgui_drawlist_issue3](https://github.com/ocornut/imgui/assets/1501643/86494bb7-e013-4579-9371-c4b740298cc9) I am unsure if this has something to do with the wrappers, or if it's underlying code in imgui that is causing issues. Any insight would be helpful! ### Screenshots/Video: _No response_ ### Minimal, Complete and Verifiable Example code: ``` git clone https://github.com/damntourists/cimgui-go-ebiten.git cd cimgui-go-ebiten go run -tags exclude_cimgui_glfw,exclude_cimgui_sdli examples/basic/main.go ```
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#7372
No description provided.