Hi all,
I want to prove a 3d concept by adding irrlicht into an existing 2d game engine (DirectDraw) - with the aim of moving totally to irrlicht if it's suitable.
I want to blend a 3d image into my existing 2d drawing chain - I'm thinking the way to do this is to export my current backbuffer to irrlicht, use that as the background and render on top of it (as render to texture), then extract the rendered texture back into my backbuffer.
Is that possible? Is there a better way of doing it?
I have about 1hour's experience with Irrlicht so appologies if it's possible to get Irrlicht to render directly to a DirectDraw surface or backbuffer - that would be just heaven. Fingers crossed!
Thanks,
Stu
Integrating Irrlicht into existing 2D game
-
rogerborg
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
What you're proposing should work, although it won't be lightning fast.
Irrlicht can also render to any HWND, but it craps over it, so that's probably not a viable alternative. There's currently no way to pass a DDRAW surface in to the D3D9 driver; I'd suspect that it won't have the right caps anyway, but if you want to take a poke at the engine, it may be possible.
Irrlicht can also render to any HWND, but it craps over it, so that's probably not a viable alternative. There's currently no way to pass a DDRAW surface in to the D3D9 driver; I'd suspect that it won't have the right caps anyway, but if you want to take a poke at the engine, it may be possible.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Nox - you're right about the wanting to change, but unfortunately the "one or two days" estimate would be considerably more. The game engine is a bit of a beast and the graphics aren't easily abstracted.
Rogerborg - yep, I was expecting a performance hit. I've already tried rendering to the window, that works fine but as you say, you completely overwrite a chunk of your display.
hybrid - yes that was what I was thinking. I finally got what I wanted by doing quite a bit less, ie by only rendering to a part of my backbuffer that was static I only had to copy that portion once to irrlicht then render my stuff with the irrlicht child window sitting on top of my app - all smoke and mirrors but it looks just like irrlicht is rendering straight into my backbuffer.
This was really just an exercise for me to get familiar with the irrlicht engine which was good. I did have a problem with draw2DImage, I was expecting it to behave like a pixel blit but it started to scale itself and shrink if I didn't draw at (0,0), maybe this is normal, maybe I was doing something wrong, I'll check this again and post a new topic if I still think there's a problem.
Rogerborg - yep, I was expecting a performance hit. I've already tried rendering to the window, that works fine but as you say, you completely overwrite a chunk of your display.
hybrid - yes that was what I was thinking. I finally got what I wanted by doing quite a bit less, ie by only rendering to a part of my backbuffer that was static I only had to copy that portion once to irrlicht then render my stuff with the irrlicht child window sitting on top of my app - all smoke and mirrors but it looks just like irrlicht is rendering straight into my backbuffer.
This was really just an exercise for me to get familiar with the irrlicht engine which was good. I did have a problem with draw2DImage, I was expecting it to behave like a pixel blit but it started to scale itself and shrink if I didn't draw at (0,0), maybe this is normal, maybe I was doing something wrong, I'll check this again and post a new topic if I still think there's a problem.