Sign in to follow this  
ghost1206

(C++) bltfast or lock/unlock?

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this