HELP Assertion failed Chili DirectX Framework V12.04.24

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

HELP Assertion failed Chili DirectX Framework V12.04.24

Post by cameron » July 28th, 2012, 7:19 pm

I put the program on my desktop and it pops this up.
Assertion failed!

Program: C:\Users\cameron\ShipGame2.exe
File: c:\users\cameron\desktop\shipgame2\D3DGraphics.cpp
Line: 73


Expression: x < 800

blah blah blah
Computer too slow? Consider running a VM on your toaster.

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: HELP Assertion failed Chili DirectX Framework V12.04.24

Post by Asimov » July 29th, 2012, 12:47 am

Hi cameron,

This means you tried to put a pixel outside the bounds of the screen. If you try to put a pixed at point 801 you will get this error.

However later you can update your code to do clipping and you won't see this error anymore. It is better you learn the basics before getting to this though.

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Re: HELP Assertion failed Chili DirectX Framework V12.04.24

Post by cameron » July 29th, 2012, 2:50 am

Thanks Asimov. Note that this only pops up on debug configuration.Why is this?
Computer too slow? Consider running a VM on your toaster.

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: HELP Assertion failed Chili DirectX Framework V12.04.24

Post by Asimov » July 29th, 2012, 8:03 am

Hi Cameron,
Thanks Asimov. Note that this only pops up on debug configuration.Why is this?
Assertion is a debug tool, and so it only shows up in debug mode. However it is showing you that a bad thing is happening and so it is good.

If you compile in Release mode chances are that if you go off the right hand edge you will appear on the left, but really you are going into memory that shouldn't be written too. It probably won't crash if you go off the right or left, but it will definately crash if you go off the top or bottom.

It is best to stay in debug mode and sort the problem than to use release mode and ignore it. There will be possible memory leaks if you do not, and you could be causing more problems down the line.

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

cameron
Posts: 794
Joined: June 26th, 2012, 5:38 pm
Location: USA

Re: HELP Assertion failed Chili DirectX Framework V12.04.24

Post by cameron » July 29th, 2012, 6:17 pm

Thanks again Asimov but I still have a few questions.This had never poped up before in debug mode it just crashed, until I switched to this framework.And 1 more thing whats the diffrence between assertion failed dialog box and a crash.
Computer too slow? Consider running a VM on your toaster.

User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: HELP Assertion failed Chili DirectX Framework V12.04.24

Post by Asimov » July 29th, 2012, 7:35 pm

Hi Cameron,

The assertion is catching the problem before it happens.

A program may not necessarily crash if you are writing to memory which hasn't been allocated, but it is not a good thing to do.

You may be writing over an area of memory another program is using, so it is best to make your program work without writing to that area of memory.

You can clip your sprites so that when they are drawn slightly off the screen they don't draw, but I would learn the basics before you do that first.

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

Post Reply