Testing CBool type instead of bool
This commit is contained in:
parent
794b82de0e
commit
5014ebbfe0
3 changed files with 89 additions and 116 deletions
|
|
@ -4,6 +4,32 @@ using Raylib_cs;
|
|||
|
||||
namespace Raylib_cs
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public readonly struct CBool
|
||||
{
|
||||
private readonly byte value;
|
||||
|
||||
private CBool(bool value)
|
||||
{
|
||||
this.value = Convert.ToByte(value);
|
||||
}
|
||||
|
||||
public static implicit operator CBool(bool value)
|
||||
{
|
||||
return new CBool(value);
|
||||
}
|
||||
|
||||
public static implicit operator bool(CBool x)
|
||||
{
|
||||
return Convert.ToBoolean(x.value);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Convert.ToBoolean(value).ToString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Utility functions for parts of the api that are not easy to interact with via pinvoke.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue