surface-to-surface copying

Started by
1 comment, last by Psybr 22 years, 3 months ago
To copy data from a Direct3DSurface8 to a DirectDrawSurface7, is there a more efficient way than copying pixel by pixel? Or is that the only way, because there could be format complexities? In response: I'm trying to render to a surface, but SetRenderTarget() cannot handle DirectDraw, I don't think. My main screen is a fullscreen, 800x600 16-bit, D3DFMT_R5G6B5. Edited by - Psybr on January 9, 2002 8:09:18 PM
Advertisement
Can you explain what you are actually trying to do? I''m not sure what operation would justify this fairly heavy operation. The only thing I can guess is that you are rendering to a DirectX 8 surface and then copying it to a DirectDraw surface for output (???). I this is true, that will be a horrible performance hit and I can''t think of what the benefit would be.

Please explain what you are trying to do.
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials

I''d also like to echo CrazedGenius'' question as far as what it is you''re trying to do? Why would you want to use DirectDraw7 surfaces with Direct3D v8 surfaces? Trying to mix DDraw 7 and D3D 8 is going to cause you huge problems, they aren''t meant to be used together.

In general, though, whenever possible, use memory copying mechanisms that can work on larger blocks of data. This is much easier to do if the surfaces are the same pixel format (it also helps if they''re the same size, though you can always do your own clipping even if they arent).

If you don''t want to learn x86 asm/MMX/SSE/etc, just use the standard C memcpy function -- under most compilers memcpy will do a pretty good job of moving memory..a hell of a lot better than doing it pixel by pixel, that''s for sure.

If you give us a bit more information on your surfaces (sizes, pixel format, using alpha, colorkeying, etc?) it would be helpful in giving a more useful example.

This topic is closed to new replies.

Advertisement