Hi all. I wrote a tutorial on how to integrate irrlicht with MFC. I spent 4 days to mix this two libraries correctly, in a way that both work. You can download tutorial and source from
here .
What do you think about this tutorial?
How to integrate irrlicht with MFC tutorial
-
Mancuso Raffaele
- Posts: 70
- Joined: Sat Dec 17, 2005 4:43 pm
- Location: licata (AG) italy
- Contact:
How to integrate irrlicht with MFC tutorial
Bye all,
Mancuso Raffaele (Ares FPS game)
Mancuso Raffaele (Ares FPS game)
-
Mancuso Raffaele
- Posts: 70
- Joined: Sat Dec 17, 2005 4:43 pm
- Location: licata (AG) italy
- Contact:
after 4 days of debug, I have discovered that OnDraw() function is called in 4 case:I use createDeviceEx in CIrrMFCTestView::OnCreate(), use smgr->drawAll() in CIrrMFCTestView::OnDraw(CDC* pDC)
but it isn't working! why?? please tell me,thank you!
-before the mainframe is created
-after the mainframe is created
-the first time the loop is execute
-when,according to the MFC, the scene is changed (when you click a menu element, when you move mouse,exc..)
but if none of the things above happens the OnDraw function is not called, so smgr->drawAll() is not called and the scene is not drawed. So you need create a "Irrlicht loop" in the function CApp::Run(). For default MFC use the function run of the class CWnd. Obviously this function don't call smgr->drawAll(), so you need to redefine it manually in your code (particularly in CApp derived from CWndApp), as I explain in the tutorial.
Thanks you for downloading my tut.
Bye all,
Mancuso Raffaele (Ares FPS game)
Mancuso Raffaele (Ares FPS game)
I use SetTimer(1,1,0) in OnInitialUpdate() function,and in OnTimer(UINT nIDEvent) I use Invalidate(0),so, CIrrMFCTestView::OnDraw(CDC* pDC)Mancuso Raffaele wrote:after 4 days of debug, I have discovered that OnDraw() function is called in 4 case:I use createDeviceEx in CIrrMFCTestView::OnCreate(), use smgr->drawAll() in CIrrMFCTestView::OnDraw(CDC* pDC)
but it isn't working! why?? please tell me,thank you!
-before the mainframe is created
-after the mainframe is created
-the first time the loop is execute
-when,according to the MFC, the scene is changed (when you click a menu element, when you move mouse,exc..)
but if none of the things above happens the OnDraw function is not called, so smgr->drawAll() is not called and the scene is not drawed. So you need create a "Irrlicht loop" in the function CApp::Run(). For default MFC use the function run of the class CWnd. Obviously this function don't call smgr->drawAll(), so you need to redefine it manually in your code (particularly in CApp derived from CWndApp), as I explain in the tutorial.
Thanks you for downloading my tut.
is update always
I want to build a particle editor and scene editor ,I now receive the keyboard and mouse message and pass them to the irrlicht engine's sceneManage,so I can control camera by mouse and keyboard
I tried this out (both the tutorial and the downloaded source code). In both cases, it compiles and runs, but the document window is just a black screen. The only change I made was to change the addTestSceneNode to addCubeSceneNode, which I understand was a change in version 1.1. Any ideas what I'm missing?