Buidling command buffers inside mouse event handlers

Hello, I am using push constants for updating per-object matrix when I drag an object using mouse

Updating push constants (per-object matrix) is done inside buildCommandBuffers function
That is, mouse dragging event handler call “buildCommandBuffers function”

But this looks unsafe and does not look a good idea
If I drag the mouse very fast and abusively, lots of mouse dragging events will occur too fast

In this situation, what is the better or the best strategy to handle this programming?
(How to update per-object data when dragging or clicking mouse?)

Thank you

Don’t. Do graphics work in the graphics thread(s) where it belongs. Message handlers should do as little as possible so that the program can be responsive. So just store whatever data is needed because of the drag, and when its time to redraw the screen, then use that data to prepare the drawing command as normal.

1 Like

Hello, Alfonse

Thank you. I will rewrite my sources according to your advise
See you later, Alfonse

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.