Jump to content
  • Advertisement

Archived

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

Logar

Fast 16bit Pixel ploting

This topic is 6308 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

I curently Lock the DX Backsurface and then write the data in the surface data. But I heard using the Blt function should be faster, I created a 1x1 quad added the colour (I did this for every pixel on the screen (640x480)) but it was very slow. What is a better way to draw the pixels?

Share this post


Link to post
Share on other sites
Advertisement
If you''re talking about DirectDraw 7, then you can either put every tile on its own offscreen surface, or cram them all onto one. Once you''ve done that, you can use the Blt/Bltfast methods. The blits are done by the hardware (if possible) and it''s uberfast.

''''A bird in hand is safer than one overhead''''

Share this post


Link to post
Share on other sites
I only had the the DX6 SDK (I live in Germany and downloading the new would take 4-5 hours). But perhaps it would work with DX6 too. But how can I change the offscreen data without lock it? (You see I`m not very experienced)

Share this post


Link to post
Share on other sites
I created a DDSURFACEDESC2 and then I changed the data, then I used GetSurfaceDesc to add the data to the surface. Now I had the surface I could use for Blt but problem is that I need to update the data of the first surface very often (60 times in a second would be fine :-) and to do this I need to lock it ? or is there another way ?

Share this post


Link to post
Share on other sites
If you actually need to draw pixel by pixel, then I''m not sure using Blt will be efficient. I''m not sure though, i''ve never tried using Blt for drawing single pixels.

One thing which could help with speed is to have a seperate draw surface in system memory, which you lock and draw to, and then Blt the whole thing onto the backbuffer. I''m pretty sure this is considerably faster than drawing straight onto the backbuffer.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!