Nabla icon indicating copy to clipboard operation
Nabla copied to clipboard

ImGUI extension should require the user set Viewport and Scissor state outside of `render()` method

Open devshgraphicsprogramming opened this issue 1 year ago • 0 comments

We have this piece of code which is not elegant / resillient https://github.com/Devsh-Graphics-Programming/Nabla/blob/bed64ec7a47d1972facdff6c5f250db550c568a1/src/nbl/ext/ImGui/ImGui.cpp#L1459

However for the user to be able to set this sanely, one must know the framebuffer Width and Height https://github.com/Devsh-Graphics-Programming/Nabla/blob/bed64ec7a47d1972facdff6c5f250db550c568a1/src/nbl/ext/ImGui/ImGui.cpp#L1167

and this seems only knowable from ImGUI::GetDrawData https://github.com/Devsh-Graphics-Programming/Nabla/blob/bed64ec7a47d1972facdff6c5f250db550c568a1/src/nbl/ext/ImGui/ImGui.cpp#L1161

Which probably needs a call to ImGUI::Render 🤦

P.S. also while you're at it, make the push constant setting an overridable lambda (so people can pump the data to the drawcall differently) https://github.com/Devsh-Graphics-Programming/Nabla/blob/bed64ec7a47d1972facdff6c5f250db550c568a1/src/nbl/ext/ImGui/ImGui.cpp#L1496

std::function<void(IGPUCommandBuffer*,const PushConstants&)>