Snapshot for release 2026.10.9.3 (internal 3bc5f9f)
This commit is contained in:
parent
c94fa9deec
commit
194ea479a0
28 changed files with 1902 additions and 127 deletions
24
src/RynthCore.Engine/ImGui/IconSampling.cs
Normal file
24
src/RynthCore.Engine/ImGui/IconSampling.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// ============================================================================
|
||||
// RynthCore.Engine - ImGui/IconSampling.cs
|
||||
// Item icons are 32x32 pictures drawn bigger; retail draws them point-sampled (crisp, hard-edged
|
||||
// pixels, so its black outline stays a black line) and ImGui's default is a linear filter that blurs
|
||||
// them. A face wraps its icon draws in Begin / End: two draw-list "callbacks" that DX9Backend answers by
|
||||
// switching sampler 0's filter for the commands after them (no managed code runs in the render path).
|
||||
// Every list starts back on linear (SetupRenderState), so a missed End cannot leak past its list.
|
||||
// ============================================================================
|
||||
|
||||
using System;
|
||||
using ImGuiNET;
|
||||
|
||||
namespace RynthCore.Engine.ImGuiBackend;
|
||||
|
||||
internal static class IconSampling
|
||||
{
|
||||
public const int PointSentinel = -101, LinearSentinel = -102;
|
||||
|
||||
/// <summary>The draws after this are point-sampled.</summary>
|
||||
public static void Begin(ImDrawListPtr dl) => dl.AddCallback(new IntPtr(PointSentinel), IntPtr.Zero);
|
||||
|
||||
/// <summary>The draws after this are linear again.</summary>
|
||||
public static void End(ImDrawListPtr dl) => dl.AddCallback(new IntPtr(LinearSentinel), IntPtr.Zero);
|
||||
}
|
||||
Loading…
Reference in a new issue