• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

## Recommended Posts

I am using DX 7 and I have a couple questions: 1) Can a back buffer in a flipping chain be used for 3D rendering as well? Or does the rendering target HAVE to be an off-screen surface? 2) Is it possible to blt to an off-screen surface from the back buffer in a flipping chain? 3) How does Color fill with DDSurface->Blt and the DDBLTFX structure work? I can''t seem to get this to work, can someone show me an example of working code in this? Thanks for any help!!!

Can anyone help?

##### Share on other sites
Hi!

1) I dont know... Sorry...

2) As far as I know it is possible to blit from the backbuffer to and offscreen surface. But what about trying it out to see if it is possible?

3) This will clear the left half part of the backbuffer (if resolution is 640x480) to white:

  DDBLTFX ddBltFx;RECT rcDst = {0, 0, 320, 480};ddBltFx.dwSize = sizeof(ddBltFx);ddBltFx.dwFillColor = 0xffffffff;lpDDSurf->Blt(&rcDst, NULL, NULL, DDBLT_COLORFILL, &ddBltFx);

##### Share on other sites

I did try blt''ing from the back to another surface, but it didn''t work for me so I figured I would ask here on the forum to see if I was doing something wrong.

What is most common for question 1: Do you normally have a seperate surface specifically for rendering?

##### Share on other sites
Q1. Nope, you simply use a surface in the flip chain as usual.

The following are the flags we used on Pac-Man:Adventures In Time when creating the flip chain:

DDSCAPS_PRIMARYSURFACE
DDSCAPS_FLIP
DDSCAPS_COMPLEX
DDSCAPS_3DDEVICE

The surface used as the render target is obtained with GetAttachedSurface() with ddsCaps.dwCaps set to DDSCAPS_BACKBUFFER

BTW: if you''re doing any software rendering or locking the surface for update with the CPU, then it is often better to create an extra offscreen surface in system or AGP memory which you then Blt() to the backbuffer.

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

• ### Forum Statistics

• Total Topics
627715
• Total Posts
2978782

• 9
• 21
• 14
• 12
• 42