Archived

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

Pixel plotting

This topic is 5776 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I have to use pixel plotting ( don''t ask why). I was just wondering when I lock the surface & covert ddsd.lpSurface to a word*, is it slower than me making a WORD* varible initlizeing it then using memcpy to copy to surface ? if so why , is because of the bus or something ? thanx in advance WizHarD

Share this post


Link to post
Share on other sites
I have been using ye old pixel averaging algorithm for a fire simulation. It of course uses pixel plotting.

I found that when I create an off screen surface in system memory, I don''t have to keep locking/unlocking the surface. I do it once upon initialization to get a pointer to the surface. Then I just calculate offsets for the surface.

I have used memcpy for copying to surfaces, though I did not use it in this case. I would think it would be quite fast. My fire simulator uses something like this.

for ( ptr = surf_start ; ptr < surf_end ; ptr++ )
*ptr = some_colour;

I have found to be quite quick as well.
You could use something like that for source destination copies, but I would use memcpy in case like that.

Guy

Share this post


Link to post
Share on other sites