DDraw: why is pixel-getting SOOO slow

Started by
5 comments, last by NeBS 23 years, 9 months ago
There''s something that seems to me very strange: I want to save a section of my backbuffer in another surface. I''ve tried it with memcpy and BltFast but both is much more slowly then blitting TO the buffer... WHY???
Advertisement
When you use BltFast you blit TO a buffer...
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Yes, in most cases

But you can create another ddrawsurface
and then call BltFast from that:

surface->BltFast(...)

as source-surface set the buffer and
so you blit FROM buffer TO surface
It really works, I''ve tried it, also with Blt().
It seems to me like I''m doing anything wrong:
I''ve looked at another source code that get''s pixels
in that way:
pixel=*buffer (buffer is a 16bit integer)

Even if I get my pixels in that simple way
it''s slower than slow.

Could it be that I''m doing anything wrong with locking the surfaces ???

PLEASE HELP ME !!!
Of corse I sent this message above...I forgot to type in my password
Maybe:

1. one surface is in videomemory and other is in system memory...this is very slow...

2.backbuffer is busy doing a flip() at monitor refresh rate and waiting flag is set?

3. do u take care at Pitch ?

test this ones and the will see...

Anyway CPU done memcpy (or asm rep movsd) are faster or equal fast as DX only in system memory.

With both surfaces in video memory DX=graphics board drivers are 10 up to 100 times faster!

Bogdan
obysoft

You''re right, my backbuffer is in videomemory.

I''ll try it with both surfaces in videomemory.

Thanx

This topic is closed to new replies.

Advertisement