Class ImAssertCallback

java.lang.Object
imgui.assertion.ImAssertCallback

public abstract class ImAssertCallback extends Object
Callback for native IM_ASSERT calls.
  • Constructor Details

    • ImAssertCallback

      public ImAssertCallback()
  • Method Details

    • imAssert

      public void imAssert(String assertion, int line, String file)
      Called from native code to bring the callback into java side. Will force the application to terminate with exit code 1 after forwarding the callback, this is required, otherwise if execution is returned to the native layer, a EXCEPTION_ACCESS_VIOLATION will be thrown. If the callback throws an exception, it will be caught and printed along with a warning to prevent execution from returning to the native layer.
      Parameters:
      assertion - The assertion string
      line - The line number of the assertion in the source file
      file - The source file where the assertion occurred
    • imAssertCallback

      public abstract void imAssertCallback(String assertion, int line, String file)
      The assertion callback from ImGui. Do not throw an exception within this callback, to prevent execution from returned to the native layer and cause a EXCEPTION_ACCESS_VIOLATION, the callback will catch any exceptions and print a warning.

      There is no way to catch the assertion and continue execution. You may however call System.exit(code) with your own exit code.

      Parameters:
      assertion - The assertion string
      line - The line number of the assertion in the source file
      file - The source file where the assertion occurred