Author Topic:   Assertion errors
posted December 21, 1999 11:24 PM            
Thanks for the help on 3 byte structures, but I decided to ditch that for 32 bit color (much, much easier, and oh so cool looking blending! )

But I have hit a new problem, I wrote a bitmap loader, but after writing the sprite loader I compiled, got 0-0, fine, ran it, and BOOM!, got an "assertion error", and I isolated it down to where I attemp calling the bitmap loader (after which I dice the image up into the sprite frames and anaylyze the alpha channel strip). I have tried many many things, including changing the call to using globals instead of parms, and other stuff, and it constantly gives me that error, does anyone know what that means?

(background note: if this is a simple problem, please reply because I'm not stupid, I'm just learning how to make my own windows game library using DirectX for a high school class, so please do help me, please?)


LDA Seumas
posted December 22, 1999 02:44 AM           
Can you give a little more info on the crash?

An "assertion error" usually has to do with an ASSERT() macro or function, which usually checks to make sure some insanely implausible and wrong situation is not true and totally stops the program if it is true (although ASSERT() fails if its argument is false, I think, so if you're checking for a super unlikely problem situation you'll ASSERT() that it is not true). As an aside I don't use asserts, and I don't like asserts, since I see way too many of them pop up in production code where sensible error handling should otherwise keep things running, but I digress...

Unless you're using ASSERT()s in your own code, this probably stems from something going horribly wrong in code you are calling, such as DirectX code. If you're using BackBuffer, make sure you unlock after all successful locks, and etc.

Try using the debugger to single step through your bitmap loading code to the point where it crashes, so you can see exactly which part or function call is doing you in.

-- Seumas McNally, Lead Programmer, Longbow Digital Arts


posted December 25, 1999 03:53 AM            
Thanks for the tips, and I guess it is a prob with DirectX, because up until now I didn't even know what ASSERTION() would mean, and yes, I am am properly lock-unlocking the backbuffer.
So now, I look through the code, for one bug that deserves a sledge hammer...