Archived

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

ElGrimo

Best way to draw individual pixels?

Recommended Posts

I am currently trying to draw single pixels with Direct3D8, but I don''t know what''s the most efficient way to do it. I tried to lock the backbuffer, but it does not work... The only other solution I can think of is creating a surface, lock it, write my pixels, then use CopyRects... does not seem really efficient to me... Any ideas?

Share this post


Link to post
Share on other sites
You can lock the backbuffer with most newer 3d cards I think, but you need to specify D3DPRESENTFLAG_LOCKABLE_BACKBUFFER in the presentation parameter "Flags". This is however not recommended, although I haven''t found a faster method when doing fullscreen individual pixelplotting (for instance when drawing a fractal).

The other method I''ve used is a textured quad using D3DPOOL_MANAGED for storage. Lock the texture surface and modify directly though the pointer. This method was about 30-40% slower than the first method on my hardware when plotting all pixels on a screen. (You don''t need to use copyrects)

Share this post


Link to post
Share on other sites