Advertisement

Slow 16 bit Blit with large bitmaps

Started by February 23, 2000 08:25 PM
8 comments, last by theprogrammer 25 years ago
Hi folks! I was developing a simple blitting test. Then I tried a 640x480x16 blitting. If I run only this Blt I''ll get 15 fps! what is going on ? Note : The image is in Video Memory... My computer is a PII 400 - 64 MB - Savage4+ Card
What function are you using to blit?

Blt()?
BltFast()?
memCopy()?
Advertisement
How exactly would u do a Blt with memcpy? I''ve tried but can''t seem to get it to work.

memcpy(ddsdDest.lpSurface, ddsdSrc.lpSurface, ???);

What would u put in the size field? ddsdSrc.lPitch * ddsdSrc.dwHeight?

Thanks
That one line memcpy would only work if your surfaces are guaranteed linear. This is not always true for the primary display. A looping line-by-line copy would work, I think.

for(int i=0; i < ddsdSrc.dwHeight; i++)
memcpy(ddsdDst.lpSurface[i*ddsdDst.lPitch], ddsdSrc.lpSurface[i*ddsdSrc.lPitch], ddsdSrc.dwWidth);


Radhil Trebors
Persona Under Construction
Radhil TreborsPersona Under Construction
I''m using BltFast. However I''ll try a memcpy method or even a "Assembly" method with MMX instructions...

BTW I''m developing in Delphi... Which language did you use ?

Thanks for the advice!!
I don''t think you can make the blitting any faster with you own functions even if you do it with assembly and MMX routines. Even if you could you would have to implement the function for every card you want to support, so it is not recommended. Let the driver programmers do that work for you.

As to your original question:
Do you get the same performance with Blt()? I know BltFast should be faster, but this only true for software blitting (It''s only 10% anyways).

Are both surfaces in the same pixelformat, i.e. 16bit RGB565?

It might have something to do with caching too, but I doubt it. Try breaking up the image into smaller pieces and blit them separately.
Advertisement
Both surfaces are 16 bit, RGB565...

SpellBound : I have a little problem. This blt is supposed to draw a background image on my demo...
Anyway I''ll test your ideia... thanks!


Both surfaces are 16 bit, RGB565...

SpellBound : I have a little problem. This blt is supposed to draw a background image on my demo...
Anyway I''ll test your ideia... thanks!


15 fps doesn''t sound too bad for what you are trying to do
Hi folks!!!

I found what happened with my code!!!

I was using a home-made object called DDSurface, and when this object loaded an image, the object didn''t free it!!

Now I''m working with the IDirectDrawSurface7 directly....

Thanks to all!! See you again...

This topic is closed to new replies.

Advertisement