PDA

View Full Version : IDirectDraw & IDirectDrawSurface (Offscreen Surface need



Gadget
01-04-2005, 03:39 PM
I have spent some time playing around with the Omega components and they appear to do everything that I need (very well).

The problem I have is that I need to draw my map to a DirectDrawSurface. The map comprises of various layers of different sized tiles, and to draw each of these on the fly (when you scroll in a particular direction) will really hit the CPU / GFX card.

The way I have done this in DirectDraw is to blit the centre (non changing bit) section of the current map screen and move it one tile in the direction the map is scrolling, then just draw the new tiles to that buffer surface, finally blitting the new map image to the back buffer. How can I do this with Omega? There doesn't appear to be any DirectDraw interface, or DirectDrawSurface for the back buffer?

I thought Direct3D used the DirectDraw interface, and needed a surface for the backbuffer? I did have a quick look at the Screen type to see if I could expose the interfaces but I couldn't see them >.<

Any ideas on how I could get around this? What else can I use in Omega as an offscreen rendering area to store the current map screen?

Sly
01-04-2005, 09:00 PM
Direct3D does not use any part of DirectDraw.

You can create a render target (IDirect3DDevice8.CreateRenderTarget) which you can use to draw to, then use that render target as a texture to draw a quad on the screen.

Gadget
01-04-2005, 09:04 PM
Direct3D does not use any part of DirectDraw.

You can create a render target (IDirect3DDevice8.CreateRenderTarget) which you can use to draw to, then use that render target as a texture to draw a quad on the screen.

Thanks, I will have a play around with that =D

I read in my Sams DirectX 7 book that Direct3D uses the DirectDraw interface and a surface to output?

Sly
01-04-2005, 10:06 PM
DirectX 8 was a large change in which DirectDraw support was dropped.

czar
02-04-2005, 05:12 AM
@Gadget

On Delphi Sanctuary this same problem was discussed and a solution was created

http://www.delphisanctuary.com/forums/viewtopic.php?t=554

Unless I am mistaken this system will work for you.