Remove ImPlot3D
This commit is contained in:
@@ -969,7 +969,7 @@ public unsafe static class ImGuiSDL3Platform
|
||||
{
|
||||
ViewPortData vd = ImGuiUserData<ViewPortData>.Get(viewport.PlatformUserData)!;
|
||||
|
||||
string? oldHint = SDL.GetHint(SDL.Hints.WindowActivateWhenShown);
|
||||
string oldHint = SDL.GetHint(SDL.Hints.WindowActivateWhenShown)!;
|
||||
|
||||
SDL.SetHint(SDL.Hints.WindowActivateWhenShown, (viewport.Flags & ImGuiViewportFlags.NoFocusOnAppearing) != 0 ? "0" : "1");
|
||||
|
||||
|
||||
+12
-19
@@ -2,7 +2,6 @@
|
||||
using Hexa.NET.ImGui;
|
||||
using Hexa.NET.ImGuizmo;
|
||||
using Hexa.NET.ImPlot;
|
||||
using Hexa.NET.ImPlot3D;
|
||||
using SDL3;
|
||||
|
||||
namespace SDL3_TestingSuite.SDL3;
|
||||
@@ -11,19 +10,25 @@ public sealed unsafe class SDL3Window : IDisposable
|
||||
{
|
||||
public readonly nint Window;
|
||||
public readonly nint Renderer;
|
||||
|
||||
public readonly Vector4 DefaultClearColor = new Vector4(0.06f, 0.06f, 0.06f, 1f);
|
||||
|
||||
public event Action RenderCallback;
|
||||
private Vector4? _clearColor;
|
||||
public Vector4 ClearColor
|
||||
{
|
||||
get => _clearColor ?? DefaultClearColor;
|
||||
set => _clearColor = value;
|
||||
}
|
||||
|
||||
public Vector4 ClearColor = new Vector4(0.06f, 0.05882353f, 0.05882353f, 1f);
|
||||
public event Action? RenderCallback;
|
||||
|
||||
private ImGuiContextPtr _imGuiContext;
|
||||
private ImPlotContextPtr _imPlotContext;
|
||||
private ImPlot3DContextPtr _imPlot3DContext;
|
||||
|
||||
public bool Disposed => _disposed;
|
||||
private bool _disposed;
|
||||
|
||||
private FileSystemWatcher? _watcher;
|
||||
private readonly FileSystemWatcher? _watcher;
|
||||
|
||||
public SDL3Window(string name, int posX, int posY, int width, int height, SDL.WindowFlags flags = SDL.WindowFlags.Resizable | SDL.WindowFlags.HighPixelDensity)
|
||||
{
|
||||
@@ -41,10 +46,8 @@ public sealed unsafe class SDL3Window : IDisposable
|
||||
// Create ImGui context
|
||||
_imGuiContext = ImGui.CreateContext();
|
||||
_imPlotContext = ImPlot.CreateContext();
|
||||
// _imPlot3DContext = ImPlot3D.CreateContext();
|
||||
ImPlot.SetImGuiContext(_imGuiContext);
|
||||
ImGuizmo.SetImGuiContext(_imGuiContext);
|
||||
// ImPlot3D.SetImGuiContext(_imGuiContext);
|
||||
|
||||
ImGuiIOPtr io = ImGui.GetIO();
|
||||
io.ConfigFlags |= ImGuiConfigFlags.NavEnableKeyboard | ImGuiConfigFlags.NavEnableGamepad | ImGuiConfigFlags.DockingEnable;
|
||||
@@ -60,7 +63,7 @@ public sealed unsafe class SDL3Window : IDisposable
|
||||
|
||||
_watcher = new FileSystemWatcher(fontsPath);
|
||||
_watcher.NotifyFilter = NotifyFilters.FileName | NotifyFilters.CreationTime;
|
||||
_watcher.Created += (a, b) =>
|
||||
_watcher.Created += (_, b) =>
|
||||
{
|
||||
if (!File.Exists(b.FullPath)) return;
|
||||
|
||||
@@ -68,7 +71,7 @@ public sealed unsafe class SDL3Window : IDisposable
|
||||
|
||||
ImGui.GetIO().AddFont(b.FullPath);
|
||||
};
|
||||
_watcher.Deleted += (a, b) =>
|
||||
_watcher.Deleted += (_, b) =>
|
||||
{
|
||||
if (Path.GetExtension(b.FullPath) != ".ttf") return;
|
||||
|
||||
@@ -180,10 +183,6 @@ public sealed unsafe class SDL3Window : IDisposable
|
||||
{
|
||||
ImPlot.SetCurrentContext(_imPlotContext);
|
||||
}
|
||||
// if (_imPlot3DContext.Handle != null)
|
||||
// {
|
||||
// ImPlot3D.SetCurrentContext(_imPlot3DContext);
|
||||
// }
|
||||
|
||||
ImGuiSDL3Renderer.Dispose();
|
||||
ImGuiSDL3Platform.Dispose();
|
||||
@@ -203,12 +202,6 @@ public sealed unsafe class SDL3Window : IDisposable
|
||||
ImPlot.DestroyContext(_imPlotContext);
|
||||
_imPlotContext = null;
|
||||
}
|
||||
// if (_imPlot3DContext.Handle != null)
|
||||
// {
|
||||
// ImPlot3D.SetCurrentContext(null);
|
||||
// ImPlot3D.DestroyContext(_imPlot3DContext);
|
||||
// _imPlot3DContext = null;
|
||||
// }
|
||||
|
||||
if (Renderer != nint.Zero)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user