The invisible blit

Started by
2 comments, last by SMurf7 22 years, 8 months ago
Hi, I'm working on converting my old system memory/memcpy-based routines into supposedly better DDraw surfaces, and after creating an offscreen surface for my "land generation" code (just a sine wave that's filled beneath it) using dimensions of 640x32, I have tried to BltFast the surface to my backbuffer. However, when I run the program, it's not visible when a flip occurs. Sometimes I think I can just quickly see it appear before it disappears at the start of the program, but I'm not sure (maybe I'm just tired ) I've got error trapping code (using the FAILED macro) on the BltFast functions, but it appears they do not report an error, so something must be wrong somewhere else. Any ideas? Edited by - SMurf7 on August 4, 2001 9:02:33 AM
Advertisement
Try:

- Using Blt() to test, instead of BltFast(), Blt() is more robust and (I think) tends to fail less if you don't have a DDClipper installed on the blitted-to surface.
- Are you Flip()ping surfaces? If you're running windowed mode, make sure that you are blitting to the primary buffer instead of flipping.
- Also try spitting the error code to a text file so you can review it offline... I don't think DX has "ErrorToString()" routines but you can always just review the .h file to see what the return is.
- Keep in mind too that you must Unlock() a surface after using it (e.g. if you edit surface memory directly) otherwise the surface may remain unusable by other functions.



Edited by - MatrixCubed on August 4, 2001 11:31:56 AM
Hmm, it works with Blt (and its associated RECTs), but not with BltFast. And not a Clipper in sight...
BltFast seems to fail if it overlaps the edge of the surface. If it''s fully within the surface, I don''t know why it''d fail then...

This topic is closed to new replies.

Advertisement