Sign in to follow this  
stringa

MFC and DirectX ... How can I create a Render Loop () ...

Recommended Posts

stringa    100
Normally in Win32, I would override GetMessage with PeakMessage and run a render() right after DispatchMessage(). How can I do that with MFC? Thanks

Share this post


Link to post
Share on other sites
JohnHurt    334
Been a while since I did any MFC but if I remember correctly you implement the OnIdle() method in your App (or Doc or View, not sure which) and stick your rendering loop in there. OnIdle should get called whenever there is spare CPU time available, so should work pretty much all the time ;)

Share this post


Link to post
Share on other sites
iNsAn1tY    476
The answer :)

Look at the date I wrote that article, though. Long time ago. MFC is all but dead now. If you're developing a tool and need to implement a user interface, go with C# (you can still use "unsafe" C++ code with C#, btw).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this