Hello dear people from the underworld called the internet,
I’m creating an editor for Directx 11 and it’s going pretty well so far, but only one small problem:
This is how i make my form call the render function:
Application::Idle += gcnew EventHandler(&Ideling);
Now this actually works, but, it only works if i hover my mouse over it, if I lay my mouse still over it(and the focus is on it), it wont do anything. So the idling function is only called when the mouse is hovered over it. And my question is: How can i avoid this? Making it always render.
Now this is a great pain for me.
Thank You
The rule is that it is called once after the last message from the message queue was retrieved. So keeping it going would require keeping generating messages, by moving the mouse around for example. Or by having your Idle event generate a message. Call the form’s Invalidate() method. That generates a Paint event. Which is then followed again by the Idle event if nothing else needs to be done.
Find more approaches by googling “Winforms game loop”.