mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 13:08:24 +01:00
first
This commit is contained in:
parent
bd62d51ec9
commit
b578433e37
3 changed files with 784842 additions and 0 deletions
23
Brutal.ImGui/Manual/StructExtensions/ImDrawCmd.cs
Normal file
23
Brutal.ImGui/Manual/StructExtensions/ImDrawCmd.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
namespace Brutal.ImGuiApi;
|
||||
|
||||
public partial struct ImDrawCmd
|
||||
{
|
||||
/// <inheritdoc cref="ImDrawCmdExtensions.GetTexID(ImDrawCmdPtr)"/>
|
||||
/// <remarks>
|
||||
/// Port of definition in imgui.h for backend use on underlying struct
|
||||
/// </remarks>
|
||||
public unsafe ImTextureID GetTexID()
|
||||
{
|
||||
if (TexRef._TexData.IsNotNull())
|
||||
{
|
||||
var texId = TexRef._TexData.TexID;
|
||||
ImGui.Assert(
|
||||
texId != ImTextureID.Invalid,
|
||||
"ImDrawCmd is referring to ImTextureData that wasn't uploaded to graphics system. Backend must call ImTextureData::SetTexID() after handling ImTextureStatus_WantCreate request!"
|
||||
);
|
||||
return texId;
|
||||
}
|
||||
|
||||
return TexRef._TexID;
|
||||
}
|
||||
}
|
||||
12
Brutal.ImGui/Manual/StructExtensions/ImGuiPlatformIO.cs
Normal file
12
Brutal.ImGui/Manual/StructExtensions/ImGuiPlatformIO.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Brutal.ImGuiApi;
|
||||
|
||||
public partial struct ImGuiPlatformIO
|
||||
{
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate byte* GetClipboardTextFnDelegate(ImGuiContextPtr ctx);
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void SetClipboardTextFnDelegate(ImGuiContextPtr ctx, byte* text);
|
||||
}
|
||||
23
Brutal.ImGui/Manual/StructExtensions/ImGuiTextFilter.cs
Normal file
23
Brutal.ImGui/Manual/StructExtensions/ImGuiTextFilter.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
namespace Brutal.ImGuiApi;
|
||||
|
||||
public partial struct ImGuiTextFilter
|
||||
{
|
||||
private static int InputBufSize => 256;
|
||||
|
||||
public unsafe ImGuiTextFilter(ImString defaultFilter = default)
|
||||
: this()
|
||||
{
|
||||
if (!defaultFilter.IsNull())
|
||||
{
|
||||
fixed (byte* inputBufPtr = InputBuf)
|
||||
{
|
||||
var target = new Span<byte>(inputBufPtr, InputBufSize);
|
||||
var source = defaultFilter.AsSpan();
|
||||
if (source.Length > InputBufSize)
|
||||
source = source[..InputBufSize];
|
||||
source.CopyTo(target);
|
||||
this.Build();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue