Closed mandaxyz closed 3 years ago
Solved, I realize that every time I write an explanatory comment on a Forum then I see many details, and here is the solution:
_drawList->clear();
_drawList->_drawList->AddDrawCmd(); // Add this line because the clear function removes all draw commands.
I'm proud of my self that I have a spirit of developer.
Good to hear! (Might have been difficult for us to provide help for a version as old as 1.65, i would advise to update!)
Interesting read about this common effect: https://en.m.wikipedia.org/wiki/Rubber_duck_debugging
My code seems to work and it able to display the rectangles which means that it's almost ok, but when I close the program with the "close" button, then an error "Exception thrown at 0x????..." and it breaks on my custom FREE callback and tells that it found the "memory block" but the 'size' is 0 and the 'pointer' is not null, and it was allocated with an operator 'new' by a Vulkan allocation callback, also sometimes it doesn't crash (75% of case), and the "random crash" means that "There may be a problem on the initialization/use of ImDrawList object".
Version: dear imgui, v1.65 (because it's used by the current Vulkan C++ examples and demos)
Here is an algorithm explanation code, it cannot be reproduced because it requires Vulkan and many other stuff.
The code bellow is called just before multiple (maybe 3) calls of _shader->bind(commandBuffer); _batch.draw(commandBuffer);, where batch is the Vertex Buffer & Index Buffer.
Have anyone experienced the same issue? Because I cannot see where is the problem, my intuition tells me that "There maybe problem on my ImDrawList initialization/use". Any help please? I'm sure my custom memory managment has no bug because I used it for a long time without problem.
Can anyone tell me that I must update to the latest Dear ImGui? Nobody knows if the bug will gone if I do it, also it requires a lot of work because the Vulkan demo stucks on that old ImGui (Version from 3 years ago).