Jump to content
  • Advertisement

Archived

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

WizHarDx

Pixel plotting

This topic is 6084 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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!