1

I'm currently developing a game using libgdx (java) which in turns uses native C++ (box2d) libraries. Sometimes I get an assertion in box2d (C++ library). It takes all from five minutes to an hour until I find my erroneous code, seeing a stack trace for my java code would be sufficient to locate my error much faster.

Stack example
—— My code ——
Application.java
Level.java
Enemy.java
—— Libgdx ——
World.java (with jni-wrapper)
—— Box2d ——
b2World.cpp
...
b2PolygonShape.cpp

1 Answer 1

0

You might want to check out http://www.codeproject.com/Articles/17558/Exception-handling-in-JNI

There is a bunch of code, but must of it is a tutorial on how to use it. I grabbed it for a quick JNI_ASSERT().

I use the standard output and just use a small subset of that library but if you use the full library, it can toss up message boxes like so:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.