0

Can lpDDSrcSurface be NULL while calling IDirectDrawSurface7::Blt?

dest_surf->Blt(&dest_rect, NULL, NULL, blt_flags, NULL);

Seems like the code above simply skips blitting but MSDN says nothing about it however.

Ivars
  • 2,375
  • 7
  • 22
  • 31

1 Answers1

1

From the syntax side, that's OK to pass NULL, but in practice, it does not make sense, if the source surface is NULL, where did you copy from?

You can check the return value of Blt to see what happened if you pass NULL to source surface.

zdd
  • 8,258
  • 8
  • 46
  • 75
  • thanks. actually i have this line: `dest_surf->Blt(&dest_rect, srce_surf, &srce_rect, blt_flags, NULL);` inside of a render loop, where srce_surf can be NULL (if source surface is not created). will system be stable or some hidden errors will occur? – Ivars Jan 08 '14 at 07:41
  • why not add a if block? if source surface is null, do not call Blt any more. – zdd Jan 08 '14 at 10:46