Dragonfly Q&A

Dividing by zero?

0 like 0 dislike

I am getting a weird error when attempting to test my graphics manager that when I try to set a vector - to the result of spacesToPixels I get an error telling me I shouldn't be dividing by zero.  I am not, however, dividing at all and can't seem to find the root of this problem.  Using breakpoints I have determined that the error happens after calling the method but not inside of it, because none of the breakpoints inside spacesToPixels are triggered. As far as I can tell there is nothing that should be causing this and was wondering if you could think of anything.

 

asked Sep 18, 2016 in Engine Development by mjszpunar

1 Answer

0 like 0 dislike
Odd.  You should first find out what line, exactly, is causing the divide by zero.  Determining the error is after the method is not precise enough.  It should be faulting on a specific line of your code (or, perhaps a method call from SFML or something).  Once you find the offending line (and I'm assuming it is a division), you should be able to figure out what is happening.
answered Sep 18, 2016 by claypool
The strange part is it seems to be happening exactly on the spacesToPixels call.  None of the break points within that method are being triggered at all which leads me to believe that it is not being gone into.  It also isn't recieveing anything that divides at all, only a vector which is predefined.
More information about Dragonfly can be found on the Dragonfly Home Page.
...