• Advertisement
Sign in to follow this  

(C++) bltfast or lock/unlock?

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

Greetings to all, I am currently trying to write a strategy game and the problem that I am facing relates to a decision I must make: should I stick with bltfast or should I try to implement my own blitter using memcpy and locking/unlocking the surface only once per flip? I noticed that people in the internet are saying that there isn't much difference. In fact in case a video accelerator is present, bltfast is the best one can get. Others, however, say that a custom blitter could be twice or even three time as fast as bltfast! I would appreciate if you could spare some time to state your opinion on the matter, since I would hate to spend a great deal of time in something too "hairy" and not really beneficial. Cheers, G.

Share this post


Link to post
Share on other sites
Advertisement
BltFast is usually hardware accelerated, while lock/memcpy/unlock isn't (and can't be). Use BltFast as long as it works for you. The only reason to do a lock/memcpy/unlock would be to render something that's not rectangular (e.g. A software 3D engine would need access to the backbuffer directly to plot pixels during rasterization)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement