Game Loop in MFC

Started by
0 comments, last by iNsAn1tY 17 years, 10 months ago
I have a D3D activex control using MFC and currently using OnIdle for update. As it seems not the good aproach, so what will be the best option to implement a game loop in this case? I came across this article, Continuous Updating in MFC is it sufficient for the purpose or there's more? Please elaborate in detail. Thanks.
Advertisement
Hmmm. I've just taken a look, and I don't think it's possible. Thing is, when I wrote that article, I was targeting MFC Win32 applications. You can override CWinApp::Run just fine, but that's because CWinApp is derived from CWinThread (ie. it gets called every cycle). The COleControl class, on the other hand, isn't derived from CWinThread, it's derived from CWnd. That means you can't use the technique in my article there because CWnd is completely event-driven. To put it another way, any program which uses your ActiveX control would have to specifically update it every cycle. And I don't think you can do that with an ActiveX control. I think they're event-driven, so you'll have to stick with the OnIdle messages. I could be wrong, though; I've never written an MFC ActiveX control doing what you're doing.
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]

This topic is closed to new replies.

Advertisement