Jump to content
  • Advertisement


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


Direct Draw: Clippers + Blitting.

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

Ok, All I''ve ever wanted out of life (excuse me, I''m prone to exageration) is to have a backbuffer with a clipper on it so I don''t have to worry about bounds checking myself. Now when I put this clipper in place, I was disgusted to find that I could no longer use Direct Draw''s BltFast() to copy my images. My current blit function now looks like this: void gfx_blit(LPDIRECTDRAWSURFACE4 Src,LPDIRECTDRAWSURFACE4 Dest,int X,int Y,long BltParams) { HRESULT hRet; RECT drect; Src->GetSurfaceDesc(&ddsd); drect.top = Y; drect.left = X; drect.bottom = Y+ddsd.dwHeight; drect.right = X+ddsd.dwWidth; do { hRet = Dest->Blt(&drect,Src,NULL,BltParams,NULL); } while (hRet == DDERR_WASSTILLDRAWING); } now I''m positive (I haven''t tested this though) that this function will be a million times too slow. Does anyone know a better way? I''m using DX 6 at the moment, does DX 7 improve on this? (I''m downloading the sdk today) Any help on this one will be absoposativically appreciated. ---------- Disco Love For Everyone

Share this post

Link to post
Share on other sites
Hi, SpazBoy_the_Mitey

Unfortunately, according to DirectX SDK, you cannot use BltFast to blit to a surface which has a clipper attach to it.

Here is the sentence that I extract from SDK :
This method works only on display memory surfaces and cannot clip when blitting. If you use this method on a surface with an attached clipper, the call fails, and the method returns DDERR_UNSUPPORTED.

So, if you have a clipper on surface, the only way to blit is to use Blt. That''s it. You have no other choice.

But I don''t think Blt is faster than BltFast in normal curcumstances, because in the SDK, they also say :

"The software implementation of IDirectDrawSurface7::BltFast is 10 percent faster than the IDirectDrawSurface7::Blt method. However, there is no speed difference between the two if display hardware is used."

Nowaday, almost video card has hardward accelerator for blitting, isn''t it? So, don''t worry so much. :-)


Share this post

Link to post
Share on other sites
That''s correct. When using video memory, Blt is the same speed as BltFast, and you can use cool effects with it.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!