Archived

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

Confused

Problems with blitting to backbuffer

Recommended Posts

This may sound weird...but I can draw to my backbuffer! I am using BltFast and this is my blitting function: int inline CGraphics::Draw(LPDIRECTDRAWSURFACE7 picture, int x, int y) { if(FAILED(lpddsback->BltFast(x, y, picture, NULL, DDBLTFAST_WAIT))) return(0); return(1); } I AM clearing, drawing, then flipping the backbuffer, and my clearing functions work because if I change the color of the fill I can see it. Plus, if I change lpddsback (my backbuffer) in my function to lpddsprimary (my primary surface), and comment out the clearing and flipping calls in my main game function, I see the picture! Has anybody else had this problem? I''m going to try the regular Blt function to see if it works. ------------- cOnfuSed

Share this post


Link to post
Share on other sites
Never mind!! I figured it out...it''s becuase I have a clipper attached to the backbuffer.

But it kind of sucks, I have a couple objects in my game that aren''t going to go out of the screen but I have to use Blt instead of BltFast...I wish there was a way around it.

-------------
cOnfuSed

Share this post


Link to post
Share on other sites
If your surfaces are all in video memory BltFast() is no faster than Blt(). If your source surface is in system memory then I would recommend just getting the pointer to the backbuffer memory when you lock and moving the image onto the backbuffer surface using memcopy() which is faster than BltFast() in almost all cases. It also gives you total control over everything being moved.

Unless there is a real need to use a clipper (I can''t think of any) then get rid of it.

Share this post


Link to post
Share on other sites