brutal/brutal.imgui/Brutal.ImGui/Manual/ImAssert.cs
2026-10-15 14:12:02 +13:00

15 lines
438 B
C#

namespace Brutal.ImGuiApi;
public class ImException(string message) : Exception(message);
public partial class ImGui
{
/// <summary>
/// This is an equivalent of the IM_ASSERT C++ macro, intended for similar validation in ported code.
/// </summary>
public static void Assert(bool condition, string? message = null)
{
if (!condition)
throw new ImException(message ?? "Assertion failed");
}
}