Use in a MFC single Dialog application

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
declos

Use in a MFC single Dialog application

Post by declos »

Hi all.

I want to use the library in a Dialog application MFC. For example consider the wizard included in dx sdk 8.1 that builds a simple dialog with a frame in that you see a teapot.

:roll:
solehome

use createDeviceEx instead of createDevice

Post by solehome »

In Irrlicht 0.10.0 "createDeviceEx" can accept a window's handle as a input.
see a code fragment as below:
...
HWND hWnd;
hWnd = GetDlgItem(IDC_STATIC)->m_hWnd;
SIrrlichtCreationParameters p;
p.DriverType = EDT_SOFTWARE;

p.WindowId = (s32)hWnd;
IrrlichtDevice *device = createDeviceEx(p);
...

I think it is natural. And I have tested it in a dialog-based MFC program.
no need to modify the source code.
aigam
Posts: 17
Joined: Fri May 06, 2005 3:17 pm

Post by aigam »

The problem with MFC is that is not directly compatible with device->run();

You must do manually all the mouse, keyboard input... or modify the mfc internal loop.
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

I wish someone would do an example or something.

I'm trying to do this myself but the problem is I learned c++ from Irrlicht and have no experience with mfc and it's very confusing.

if I could get Irrlicht to work with mfc I could devolop alot of useful tools and projects with irrlicht that are not possable otherwise without rewritting alot of the engine.
aigam
Posts: 17
Joined: Fri May 06, 2005 3:17 pm

Post by aigam »

I have integrated irrlicht with mfc, and is really strange, is necesary to modify the internal message loop of mfc.

I will write this weekend a mini-tutorial to explain my code and view if some people can improve this.
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

sounds awsome 8)
Masdus
Posts: 186
Joined: Tue Aug 26, 2003 1:13 pm
Location: Australia

Post by Masdus »

I was thinking of using MFC to create the GUI for some Irrlicht toolkits i'm planning. Then i came across www.wxwidgets.org . I thought using this (or a similar library) might be a better option as the application should then be compatible on all platforms supported by Irrlicht
Post Reply