Closed Aman-Anas closed 6 months ago
If I read correctly the linked info, the correction should be
gl.glDrawElements(
gl.GL_TRIANGLES,
command.elem_count,
gltype,
ctypes.c_void_p(idx_buffer_offset + command.idx_offset * imgui.INDEX_SIZE)
)
Could you confirm that it works? If so, could you please send a PR?
The weird thing is, I tried it like (idx_buffer_offset + command.idx_offset * imgui.INDEX_SIZE)
and it seems to break rendering all over the place. The link does mention that some backends try and calculate the offsets manually, which may be what's happening here with idx_buffer_offset
being incorrect.
Based on info here https://github.com/ocornut/imgui/issues/4845 apparently the start offsets are no longer simply the sum of the ElemCount's, and that's essentially how idx_buffer_offset
is calculated right now. Still need to test, but I think idx_buffer_offset
may not be needed. It could also be that since idx_buffer is already initialized to 0 in the ProgrammablePipeline it doesn't affect anything, and maybe the FixedPipeline is different.
I opened a pull request for the version using command.idx_offset * imgui.INDEX_SIZE
Thanks, I'll answer in the PR
The interior of modal windows is grayed out in the backend, rather than the exterior area. This seems to be a documented issue with some backends with a newer Dear Imgui version
Documented here: https://github.com/ocornut/imgui/releases/tag/v1.86
I was able to fix it by changing some lines in the opengl renderer
to
I don't really know opengl too well, but it seems to work fine.