Archived

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

BltFast() or someting else??

This topic is 5116 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´ve created my Back and Primery surfaces/loaded DD and everything... Now what? The tutorials sux about that.. Want so many FPS as possible. Im talking about a 2D game, I have all these skills but is learning Direct Draw. Only have problem with how to "paint/control frames" Now, A. Shuld I BltFast my bitmaps to my backsurface and then flip? // Causes lagg/slow less FPS?? B. 1. create an Offscreen thing and BltFast to it, to make it look like my Bitmap. 2. and do something else that is faster than BltFast to my backsurface and then Flip? Shall i use A or B :S or ... die??

Share this post


Link to post
Share on other sites
A.
// Does NOT cause lag/slow FPS

I don''t know why you say "the tutorials sux about that." There are hundreds of DirectDraw tutorials and all of them show how to draw to the backbuffer and flip to the primary.

Share this post


Link to post
Share on other sites
There is generally no benefit to using BltFast instead of Blt. Don''t let the name fool you. BltFast does absolutely no clipping, so you can''t use it with DD Clippers, which means it''s useless in windowed mode (unless you do your own clipping, which IMO is pointless when DD provides a clipper for you). Blt to the backbuffer, then flip. If your framerate is too low (<30 fps or so), then consider optimizing your blts by using a dirty rectangle scheme to minimize the area you update each frame. Additionally, if you are blitting over the entire back buffer every frame (don''t bother clearing - this will give you a slight boost as well in most cases.

Also, don''t get caught up in chasing after 100+ fps. Most games released in DD''s heyday ran at 30-60 fps. If you can get more, great. But don''t stress over it.

Share this post


Link to post
Share on other sites
I think by A he mean that he is loading his image from a file directly to his backbuffer when he wants to blt (is BltFast not used at some point in that process umong all the HDC stuff, if I can remeber that long ago?). Most definetly do not do that.
By B I think he means creating a surface for his bitmap and then blting from the surface to the backbuffer.
Obviously, the efficiant (and done) method is B. A is only meant to be used when loading a surface. Do B, and then flip your backbuffer and frontbuffer.

If you ask me, however, I would go for option C - drop DDraw and get going on Direct3D. DirectDraw is old and no longer being updated. Do not be confused about D3D - it is used for both 2D and 3D games. However, I think D3D might be a bit ahead of you at this stage...

[edited by - jack_1313 on December 13, 2003 8:37:06 PM]

Share this post


Link to post
Share on other sites