diff --git a/.run/Example _ Bliss.run.xml b/.run/Example _ Bliss.run.xml
new file mode 100644
index 0000000..cd437b6
--- /dev/null
+++ b/.run/Example _ Bliss.run.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.run/Example - OpenGl (Silk.Net).run.xml b/.run/Example _ OpenGl - Silk.Net.run.xml
similarity index 90%
rename from .run/Example - OpenGl (Silk.Net).run.xml
rename to .run/Example _ OpenGl - Silk.Net.run.xml
index 5fac34b..a734631 100644
--- a/.run/Example - OpenGl (Silk.Net).run.xml
+++ b/.run/Example _ OpenGl - Silk.Net.run.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.run/Example - Raylib-CSharp-Vinculum.run.xml b/.run/Example _ Raylib - Raylib-CSharp-Vinculum.run.xml
similarity index 89%
rename from .run/Example - Raylib-CSharp-Vinculum.run.xml
rename to .run/Example _ Raylib - Raylib-CSharp-Vinculum.run.xml
index f1f84c7..5ee085c 100644
--- a/.run/Example - Raylib-CSharp-Vinculum.run.xml
+++ b/.run/Example _ Raylib - Raylib-CSharp-Vinculum.run.xml
@@ -1,6 +1,6 @@
-
-
+
+
diff --git a/.run/Example - Raylib-CSharp.run.xml b/.run/Example _ Raylib - Raylib-CSharp.run.xml
similarity index 86%
rename from .run/Example - Raylib-CSharp.run.xml
rename to .run/Example _ Raylib - Raylib-CSharp.run.xml
index 5a0ce63..032a9ed 100644
--- a/.run/Example - Raylib-CSharp.run.xml
+++ b/.run/Example _ Raylib - Raylib-CSharp.run.xml
@@ -1,6 +1,6 @@
-
-
+
+
diff --git a/.run/Example - Raylib-cs.run.xml b/.run/Example _ Raylib - Raylib-cs.run.xml
similarity index 86%
rename from .run/Example - Raylib-cs.run.xml
rename to .run/Example _ Raylib - Raylib-cs.run.xml
index e9abd18..d23a61e 100644
--- a/.run/Example - Raylib-cs.run.xml
+++ b/.run/Example _ Raylib - Raylib-cs.run.xml
@@ -1,6 +1,6 @@
-
-
+
+
diff --git a/.run/Example - Sparkle.run.xml b/.run/Example _ Sparkle.run.xml
similarity index 91%
rename from .run/Example - Sparkle.run.xml
rename to .run/Example _ Sparkle.run.xml
index 7241745..e039b61 100644
--- a/.run/Example - Sparkle.run.xml
+++ b/.run/Example _ Sparkle.run.xml
@@ -1,6 +1,6 @@
-
-
+
+
diff --git a/.run/Publish _ Bliss.run.xml b/.run/Publish _ Bliss.run.xml
new file mode 100644
index 0000000..3f0416e
--- /dev/null
+++ b/.run/Publish _ Bliss.run.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.run/Publish - Core.run.xml b/.run/Publish _ Core.run.xml
similarity index 86%
rename from .run/Publish - Core.run.xml
rename to .run/Publish _ Core.run.xml
index 1e65b1c..2176a09 100644
--- a/.run/Publish - Core.run.xml
+++ b/.run/Publish _ Core.run.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.run/Publish - OpenGl (Silk.Net).run.xml b/.run/Publish _ OpenGl - Silk.Net.run.xml
similarity index 75%
rename from .run/Publish - OpenGl (Silk.Net).run.xml
rename to .run/Publish _ OpenGl - Silk.Net.run.xml
index 6b40041..9cfe587 100644
--- a/.run/Publish - OpenGl (Silk.Net).run.xml
+++ b/.run/Publish _ OpenGl - Silk.Net.run.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.run/Publish - Raylib-CSharp Renderer.run.xml b/.run/Publish _ Raylib - Raylib-CSharp Renderer.run.xml
similarity index 74%
rename from .run/Publish - Raylib-CSharp Renderer.run.xml
rename to .run/Publish _ Raylib - Raylib-CSharp Renderer.run.xml
index 80ddb6b..8f325bd 100644
--- a/.run/Publish - Raylib-CSharp Renderer.run.xml
+++ b/.run/Publish _ Raylib - Raylib-CSharp Renderer.run.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.run/Publish - Raylib-CSharp-Vinculum Renderer.run.xml b/.run/Publish _ Raylib - Raylib-CSharp-Vinculum.run.xml
similarity index 76%
rename from .run/Publish - Raylib-CSharp-Vinculum Renderer.run.xml
rename to .run/Publish _ Raylib - Raylib-CSharp-Vinculum.run.xml
index 463d022..bbf6293 100644
--- a/.run/Publish - Raylib-CSharp-Vinculum Renderer.run.xml
+++ b/.run/Publish _ Raylib - Raylib-CSharp-Vinculum.run.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.run/Publish - Raylib-cs Renderer.run.xml b/.run/Publish _ Raylib - Raylib-cs.run.xml
similarity index 75%
rename from .run/Publish - Raylib-cs Renderer.run.xml
rename to .run/Publish _ Raylib - Raylib-cs.run.xml
index 69eb3c0..d2acec7 100644
--- a/.run/Publish - Raylib-cs Renderer.run.xml
+++ b/.run/Publish _ Raylib - Raylib-cs.run.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.run/Publish - Raylib Core.run.xml b/.run/Publish _ Raylib.run.xml
similarity index 76%
rename from .run/Publish - Raylib Core.run.xml
rename to .run/Publish _ Raylib.run.xml
index d5b277b..eb5aa19 100644
--- a/.run/Publish - Raylib Core.run.xml
+++ b/.run/Publish _ Raylib.run.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.run/Publish all projects.run.xml b/.run/Publish all projects.run.xml
index 0d05163..f95a139 100644
--- a/.run/Publish all projects.run.xml
+++ b/.run/Publish all projects.run.xml
@@ -1,5 +1,6 @@
+
diff --git a/.run/Testing - Core.run.xml b/.run/Testing _ Core.run.xml
similarity index 94%
rename from .run/Testing - Core.run.xml
rename to .run/Testing _ Core.run.xml
index 69bb45d..fdb67f7 100644
--- a/.run/Testing - Core.run.xml
+++ b/.run/Testing _ Core.run.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/CopperDevs.DearImGui.sln b/CopperDevs.DearImGui.sln
index 6ae94bf..748f95d 100644
--- a/CopperDevs.DearImGui.sln
+++ b/CopperDevs.DearImGui.sln
@@ -56,6 +56,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CopperDevs.DearImGui.Exampl
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CopperDevs.DearImGui.Example.Raylib.Raylib-CSharp-Vinculum", "src\Examples\Raylib\CopperDevs.DearImGui.Example.Raylib.Raylib-CSharp-Vinculum\CopperDevs.DearImGui.Example.Raylib.Raylib-CSharp-Vinculum.csproj", "{CB536AF6-86A5-449A-9E2B-CEB6446547DE}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library", "Library", "{30D16054-850F-4B3B-BAB1-187D50E0D87C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CopperDevs.DearImGui.Example.Bliss", "src\Examples\Library\CopperDevs.DearImGui.Example.Bliss\CopperDevs.DearImGui.Example.Bliss.csproj", "{20DD99E6-1DB4-4110-A5EB-09C0C15276CA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CopperDevs.DearImGui.Renderer.Bliss", "src\Renderers\Library\CopperDevs.DearImGui.Renderer.Bliss\CopperDevs.DearImGui.Renderer.Bliss.csproj", "{9E73464D-92F2-4988-9EA7-785FDE2A8EF9}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -118,6 +124,14 @@ Global
{CB536AF6-86A5-449A-9E2B-CEB6446547DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB536AF6-86A5-449A-9E2B-CEB6446547DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB536AF6-86A5-449A-9E2B-CEB6446547DE}.Release|Any CPU.Build.0 = Release|Any CPU
+ {20DD99E6-1DB4-4110-A5EB-09C0C15276CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {20DD99E6-1DB4-4110-A5EB-09C0C15276CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {20DD99E6-1DB4-4110-A5EB-09C0C15276CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {20DD99E6-1DB4-4110-A5EB-09C0C15276CA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9E73464D-92F2-4988-9EA7-785FDE2A8EF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9E73464D-92F2-4988-9EA7-785FDE2A8EF9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9E73464D-92F2-4988-9EA7-785FDE2A8EF9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9E73464D-92F2-4988-9EA7-785FDE2A8EF9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{BCB5D11D-AC1A-4B7A-9415-BD38C8FA6584} = {D80512F7-C352-4BD7-99A8-2D380494B3E8}
@@ -140,5 +154,8 @@ Global
{6A8A9C0C-F2E8-48A8-9FC2-9B041E381B6D} = {C58E73B1-33D4-4C9C-97D9-59FCBCDAB7D1}
{C98F8037-E5E1-4DD0-99EF-1522DA861A06} = {C58E73B1-33D4-4C9C-97D9-59FCBCDAB7D1}
{CB536AF6-86A5-449A-9E2B-CEB6446547DE} = {C58E73B1-33D4-4C9C-97D9-59FCBCDAB7D1}
+ {30D16054-850F-4B3B-BAB1-187D50E0D87C} = {D80512F7-C352-4BD7-99A8-2D380494B3E8}
+ {20DD99E6-1DB4-4110-A5EB-09C0C15276CA} = {4223FF19-0D8A-4F4B-A056-A1FDFC0602F7}
+ {9E73464D-92F2-4988-9EA7-785FDE2A8EF9} = {30D16054-850F-4B3B-BAB1-187D50E0D87C}
EndGlobalSection
EndGlobal
diff --git a/global.json b/global.json
index caa7611..f4fd385 100644
--- a/global.json
+++ b/global.json
@@ -1,7 +1,7 @@
{
"sdk": {
- "version": "8.0.10",
- "rollForward": "latestMinor",
- "allowPrerelease": false
+ "version": "9.0.0",
+ "rollForward": "latestMajor",
+ "allowPrerelease": true
}
-}
+}
\ No newline at end of file
diff --git a/src/Examples/Library/CopperDevs.DearImGui.Example.Bliss/CopperDevs.DearImGui.Example.Bliss.csproj b/src/Examples/Library/CopperDevs.DearImGui.Example.Bliss/CopperDevs.DearImGui.Example.Bliss.csproj
new file mode 100644
index 0000000..a7a23e3
--- /dev/null
+++ b/src/Examples/Library/CopperDevs.DearImGui.Example.Bliss/CopperDevs.DearImGui.Example.Bliss.csproj
@@ -0,0 +1,15 @@
+
+
+
+ Exe
+ net9.0
+ enable
+ enable
+
+
+
+
+
+
+
+
diff --git a/src/Examples/Library/CopperDevs.DearImGui.Example.Bliss/Data/ExampleGameOptions.cs b/src/Examples/Library/CopperDevs.DearImGui.Example.Bliss/Data/ExampleGameOptions.cs
new file mode 100644
index 0000000..a2ed658
--- /dev/null
+++ b/src/Examples/Library/CopperDevs.DearImGui.Example.Bliss/Data/ExampleGameOptions.cs
@@ -0,0 +1,22 @@
+using Veldrid;
+
+namespace CopperDevs.DearImGui.Example.Bliss.Data;
+
+public record ExampleGameOptions
+{
+ public GraphicsDeviceOptions GraphicsDeviceOptions = new()
+ {
+ Debug = false,
+ HasMainSwapchain = true,
+ SwapchainDepthFormat = null,
+ SyncToVerticalBlank = true,
+ ResourceBindingModel = ResourceBindingModel.Improved,
+ PreferDepthRangeZeroToOne = true,
+ PreferStandardClipSpaceYDirection = true,
+ SwapchainSrgbFormat = false
+ };
+
+ public WindowOptions WindowOptions = new();
+
+ public static ExampleGameOptions Default => new();
+}
\ No newline at end of file
diff --git a/src/Examples/Library/CopperDevs.DearImGui.Example.Bliss/Data/WindowOptions.cs b/src/Examples/Library/CopperDevs.DearImGui.Example.Bliss/Data/WindowOptions.cs
new file mode 100644
index 0000000..34ddc36
--- /dev/null
+++ b/src/Examples/Library/CopperDevs.DearImGui.Example.Bliss/Data/WindowOptions.cs
@@ -0,0 +1,11 @@
+using Bliss.CSharp.Windowing;
+using CopperDevs.Core.Data;
+
+namespace CopperDevs.DearImGui.Example.Bliss.Data;
+
+public record WindowOptions
+{
+ public string Title = "Window";
+ public Vector2Int Size = new(1150, 680);
+ public WindowState Flags = WindowState.Resizable;
+}
\ No newline at end of file
diff --git a/src/Examples/Library/CopperDevs.DearImGui.Example.Bliss/ExampleGame.cs b/src/Examples/Library/CopperDevs.DearImGui.Example.Bliss/ExampleGame.cs
new file mode 100644
index 0000000..89b6449
--- /dev/null
+++ b/src/Examples/Library/CopperDevs.DearImGui.Example.Bliss/ExampleGame.cs
@@ -0,0 +1,80 @@
+using Bliss.CSharp.Colors;
+using Bliss.CSharp.Interact;
+using Bliss.CSharp.Transformations;
+using Bliss.CSharp.Windowing;
+using CopperDevs.Core.Utility;
+using CopperDevs.DearImGui.Example.Bliss.Data;
+using CopperDevs.DearImGui.Renderer.Bliss;
+using Veldrid;
+using BlissWindow = Bliss.CSharp.Windowing.Window;
+
+namespace CopperDevs.DearImGui.Example.Bliss;
+
+public class ExampleGame(ExampleGameOptions options) : SafeDisposable
+{
+ public readonly ExampleGameOptions Options = options;
+
+ private IWindow window = null!;
+ private GraphicsDevice graphicsDevice = null!;
+ private CommandList commandList = null!;
+
+ public void Setup()
+ {
+ window = BlissWindow.CreateWindow(WindowType.Sdl3,
+ Options.WindowOptions.Size.X,
+ Options.WindowOptions.Size.Y,
+ Options.WindowOptions.Title,
+ Options.WindowOptions.Flags,
+ Options.GraphicsDeviceOptions,
+ BlissWindow.GetPlatformDefaultBackend(),
+ out graphicsDevice);
+
+ commandList = graphicsDevice.ResourceFactory.CreateCommandList();
+
+ window.Resized += OnResize;
+
+ BlissRenderer.SetupReferences(window, graphicsDevice, commandList);
+ CopperImGui.Setup(RenderingSettings.DockingEnabled | RenderingSettings.UseCustomStyling);
+ }
+
+ public void Run()
+ {
+ while (window.Exists)
+ {
+ window.PumpEvents();
+ Input.Begin();
+
+ if (!window.Exists)
+ {
+ break;
+ }
+
+ Update();
+ }
+ }
+
+ private void Update()
+ {
+ commandList.Begin();
+ commandList.SetFramebuffer(graphicsDevice.SwapchainFramebuffer);
+ commandList.ClearColorTarget(0, Color.DarkGray.ToRgbaFloat());
+
+ CopperImGui.Render();
+
+ commandList.End();
+ graphicsDevice.SubmitCommands(commandList);
+ graphicsDevice.SwapBuffers();
+ }
+
+ protected virtual void OnResize()
+ {
+ graphicsDevice.MainSwapchain.Resize((uint)window.GetWidth(), (uint)window.GetHeight());
+ }
+
+ public override void DisposeResources()
+ {
+ window.Dispose();
+ graphicsDevice.Dispose();
+ CopperImGui.Shutdown();
+ }
+}
\ No newline at end of file
diff --git a/src/Examples/Library/CopperDevs.DearImGui.Example.Bliss/Program.cs b/src/Examples/Library/CopperDevs.DearImGui.Example.Bliss/Program.cs
new file mode 100644
index 0000000..d92087d
--- /dev/null
+++ b/src/Examples/Library/CopperDevs.DearImGui.Example.Bliss/Program.cs
@@ -0,0 +1,15 @@
+using CopperDevs.DearImGui.Example.Bliss.Data;
+
+namespace CopperDevs.DearImGui.Example.Bliss;
+
+public static class Program
+{
+ public static void Main()
+ {
+ var options = new ExampleGameOptions();
+ using var game = new ExampleGame(options);
+
+ game.Setup();
+ game.Run();
+ }
+}
\ No newline at end of file
diff --git a/src/Renderers/Library/CopperDevs.DearImGui.Renderer.Bliss/BlissImGui.cs b/src/Renderers/Library/CopperDevs.DearImGui.Renderer.Bliss/BlissImGui.cs
new file mode 100644
index 0000000..388c784
--- /dev/null
+++ b/src/Renderers/Library/CopperDevs.DearImGui.Renderer.Bliss/BlissImGui.cs
@@ -0,0 +1,584 @@
+using System.Numerics;
+using System.Runtime.InteropServices;
+using System.Text;
+using Bliss.CSharp.Interact;
+using Bliss.CSharp.Interact.Gamepads;
+using Bliss.CSharp.Interact.Keyboards;
+using Bliss.CSharp.Interact.Mice;
+using Bliss.CSharp.Interact.Mice.Cursors;
+using Bliss.CSharp.Textures;
+using Bliss.CSharp.Windowing;
+using CopperDevs.Logger;
+using Hexa.NET.ImGui;
+using Veldrid;
+using BlissWindow = Bliss.CSharp.Windowing.Window;
+
+namespace CopperDevs.DearImGui.Renderer.Bliss;
+
+// ReSharper disable once InconsistentNaming
+internal static class BlissImGui
+{
+ private static ImGuiContextPtr imGuiContext = ImGuiContextPtr.Null;
+
+ private static ImGuiMouseCursor currentMouseCursor = ImGuiMouseCursor.Count;
+ private static Dictionary mouseCursorMap = [];
+ private static Texture2D fontTexture;
+
+ private static readonly Dictionary BlissKeyMap = [];
+
+ private static bool lastFrameFocused;
+
+ private static bool lastControlPressed;
+ private static bool lastShiftPressed;
+ private static bool lastAltPressed;
+ private static bool lastSuperPressed;
+
+ // ReSharper disable once InconsistentNaming
+ private static bool IsControlDown() => Input.IsKeyDown(KeyboardKey.ControlRight) || Input.IsKeyDown(KeyboardKey.ControlLeft);
+
+ // ReSharper disable once InconsistentNaming
+ private static bool IsShiftDown() => Input.IsKeyDown(KeyboardKey.ShiftRight) || Input.IsKeyDown(KeyboardKey.ShiftLeft);
+
+ // ReSharper disable once InconsistentNaming
+ private static bool IsAltDown() => Input.IsKeyDown(KeyboardKey.AltRight) || Input.IsKeyDown(KeyboardKey.AltLeft);
+
+ // ReSharper disable once InconsistentNaming
+ private static bool IsSuperDown() => Input.IsKeyDown(KeyboardKey.WinRight) || Input.IsKeyDown(KeyboardKey.WinLeft);
+
+ ///
+ /// Sets up ImGui, loads fonts and themes
+ ///
+ public static void Setup()
+ {
+ BeginInitImGui();
+
+ EndInitImGui();
+ }
+
+ public static void BeginInitImGui()
+ {
+ mouseCursorMap = new Dictionary();
+
+ lastFrameFocused = BlissRenderer.Window.IsFocused;
+ lastControlPressed = false;
+ lastShiftPressed = false;
+ lastAltPressed = false;
+ lastSuperPressed = false;
+
+ SetupKeymap();
+
+ imGuiContext = CopperImGui.CreateContext(true);
+ }
+
+ internal static void SetupKeymap()
+ {
+ if (BlissKeyMap.Count > 0)
+ return;
+
+ // BlissKeyMap[KeyboardKey.Apostrophe] = ImGuiKey.Apostrophe;
+ BlissKeyMap[KeyboardKey.Comma] = ImGuiKey.Comma;
+ BlissKeyMap[KeyboardKey.Minus] = ImGuiKey.Minus;
+ BlissKeyMap[KeyboardKey.Period] = ImGuiKey.Period;
+ BlissKeyMap[KeyboardKey.Slash] = ImGuiKey.Slash;
+ BlissKeyMap[KeyboardKey.Number0] = ImGuiKey.Key0;
+ BlissKeyMap[KeyboardKey.Number1] = ImGuiKey.Key1;
+ BlissKeyMap[KeyboardKey.Number2] = ImGuiKey.Key2;
+ BlissKeyMap[KeyboardKey.Number3] = ImGuiKey.Key3;
+ BlissKeyMap[KeyboardKey.Number4] = ImGuiKey.Key4;
+ BlissKeyMap[KeyboardKey.Number5] = ImGuiKey.Key5;
+ BlissKeyMap[KeyboardKey.Number6] = ImGuiKey.Key6;
+ BlissKeyMap[KeyboardKey.Number7] = ImGuiKey.Key7;
+ BlissKeyMap[KeyboardKey.Number8] = ImGuiKey.Key8;
+ BlissKeyMap[KeyboardKey.Number9] = ImGuiKey.Key9;
+ BlissKeyMap[KeyboardKey.Semicolon] = ImGuiKey.Semicolon;
+ BlissKeyMap[KeyboardKey.Plus] = ImGuiKey.Equal;
+ BlissKeyMap[KeyboardKey.A] = ImGuiKey.A;
+ BlissKeyMap[KeyboardKey.B] = ImGuiKey.B;
+ BlissKeyMap[KeyboardKey.C] = ImGuiKey.C;
+ BlissKeyMap[KeyboardKey.D] = ImGuiKey.D;
+ BlissKeyMap[KeyboardKey.E] = ImGuiKey.E;
+ BlissKeyMap[KeyboardKey.F] = ImGuiKey.F;
+ BlissKeyMap[KeyboardKey.G] = ImGuiKey.G;
+ BlissKeyMap[KeyboardKey.H] = ImGuiKey.H;
+ BlissKeyMap[KeyboardKey.I] = ImGuiKey.I;
+ BlissKeyMap[KeyboardKey.J] = ImGuiKey.J;
+ BlissKeyMap[KeyboardKey.K] = ImGuiKey.K;
+ BlissKeyMap[KeyboardKey.L] = ImGuiKey.L;
+ BlissKeyMap[KeyboardKey.M] = ImGuiKey.M;
+ BlissKeyMap[KeyboardKey.N] = ImGuiKey.N;
+ BlissKeyMap[KeyboardKey.O] = ImGuiKey.O;
+ BlissKeyMap[KeyboardKey.P] = ImGuiKey.P;
+ BlissKeyMap[KeyboardKey.Q] = ImGuiKey.Q;
+ BlissKeyMap[KeyboardKey.R] = ImGuiKey.R;
+ BlissKeyMap[KeyboardKey.S] = ImGuiKey.S;
+ BlissKeyMap[KeyboardKey.T] = ImGuiKey.T;
+ BlissKeyMap[KeyboardKey.U] = ImGuiKey.U;
+ BlissKeyMap[KeyboardKey.V] = ImGuiKey.V;
+ BlissKeyMap[KeyboardKey.W] = ImGuiKey.W;
+ BlissKeyMap[KeyboardKey.X] = ImGuiKey.X;
+ BlissKeyMap[KeyboardKey.Y] = ImGuiKey.Y;
+ BlissKeyMap[KeyboardKey.Z] = ImGuiKey.Z;
+ BlissKeyMap[KeyboardKey.Space] = ImGuiKey.Space;
+ BlissKeyMap[KeyboardKey.Escape] = ImGuiKey.Escape;
+ BlissKeyMap[KeyboardKey.Enter] = ImGuiKey.Enter;
+ BlissKeyMap[KeyboardKey.Tab] = ImGuiKey.Tab;
+ BlissKeyMap[KeyboardKey.BackSpace] = ImGuiKey.Backspace;
+ BlissKeyMap[KeyboardKey.Insert] = ImGuiKey.Insert;
+ BlissKeyMap[KeyboardKey.Delete] = ImGuiKey.Delete;
+ BlissKeyMap[KeyboardKey.Right] = ImGuiKey.RightArrow;
+ BlissKeyMap[KeyboardKey.Left] = ImGuiKey.LeftArrow;
+ BlissKeyMap[KeyboardKey.Down] = ImGuiKey.DownArrow;
+ BlissKeyMap[KeyboardKey.Up] = ImGuiKey.UpArrow;
+ BlissKeyMap[KeyboardKey.PageUp] = ImGuiKey.PageUp;
+ BlissKeyMap[KeyboardKey.PageDown] = ImGuiKey.PageDown;
+ BlissKeyMap[KeyboardKey.Home] = ImGuiKey.Home;
+ BlissKeyMap[KeyboardKey.End] = ImGuiKey.End;
+ BlissKeyMap[KeyboardKey.CapsLock] = ImGuiKey.CapsLock;
+ BlissKeyMap[KeyboardKey.ScrollLock] = ImGuiKey.ScrollLock;
+ BlissKeyMap[KeyboardKey.NumLock] = ImGuiKey.NumLock;
+ BlissKeyMap[KeyboardKey.PrintScreen] = ImGuiKey.PrintScreen;
+ BlissKeyMap[KeyboardKey.Pause] = ImGuiKey.Pause;
+ BlissKeyMap[KeyboardKey.F1] = ImGuiKey.F1;
+ BlissKeyMap[KeyboardKey.F2] = ImGuiKey.F2;
+ BlissKeyMap[KeyboardKey.F3] = ImGuiKey.F3;
+ BlissKeyMap[KeyboardKey.F4] = ImGuiKey.F4;
+ BlissKeyMap[KeyboardKey.F5] = ImGuiKey.F5;
+ BlissKeyMap[KeyboardKey.F6] = ImGuiKey.F6;
+ BlissKeyMap[KeyboardKey.F7] = ImGuiKey.F7;
+ BlissKeyMap[KeyboardKey.F8] = ImGuiKey.F8;
+ BlissKeyMap[KeyboardKey.F9] = ImGuiKey.F9;
+ BlissKeyMap[KeyboardKey.F10] = ImGuiKey.F10;
+ BlissKeyMap[KeyboardKey.F11] = ImGuiKey.F11;
+ BlissKeyMap[KeyboardKey.F12] = ImGuiKey.F12;
+ BlissKeyMap[KeyboardKey.ShiftLeft] = ImGuiKey.LeftShift;
+ BlissKeyMap[KeyboardKey.ControlLeft] = ImGuiKey.LeftCtrl;
+ BlissKeyMap[KeyboardKey.AltLeft] = ImGuiKey.LeftAlt;
+ BlissKeyMap[KeyboardKey.WinLeft] = ImGuiKey.LeftSuper;
+ BlissKeyMap[KeyboardKey.ShiftRight] = ImGuiKey.RightShift;
+ BlissKeyMap[KeyboardKey.ControlRight] = ImGuiKey.RightCtrl;
+ BlissKeyMap[KeyboardKey.AltRight] = ImGuiKey.RightAlt;
+ BlissKeyMap[KeyboardKey.WinRight] = ImGuiKey.RightSuper;
+ BlissKeyMap[KeyboardKey.Menu] = ImGuiKey.Menu;
+ BlissKeyMap[KeyboardKey.BracketLeft] = ImGuiKey.LeftBracket;
+ BlissKeyMap[KeyboardKey.BackSlash] = ImGuiKey.Backslash;
+ BlissKeyMap[KeyboardKey.BracketRight] = ImGuiKey.RightBracket;
+ BlissKeyMap[KeyboardKey.Grave] = ImGuiKey.GraveAccent;
+ BlissKeyMap[KeyboardKey.Keypad0] = ImGuiKey.Keypad0;
+ BlissKeyMap[KeyboardKey.Keypad1] = ImGuiKey.Keypad1;
+ BlissKeyMap[KeyboardKey.Keypad2] = ImGuiKey.Keypad2;
+ BlissKeyMap[KeyboardKey.Keypad3] = ImGuiKey.Keypad3;
+ BlissKeyMap[KeyboardKey.Keypad4] = ImGuiKey.Keypad4;
+ BlissKeyMap[KeyboardKey.Keypad5] = ImGuiKey.Keypad5;
+ BlissKeyMap[KeyboardKey.Keypad6] = ImGuiKey.Keypad6;
+ BlissKeyMap[KeyboardKey.Keypad7] = ImGuiKey.Keypad7;
+ BlissKeyMap[KeyboardKey.Keypad8] = ImGuiKey.Keypad8;
+ BlissKeyMap[KeyboardKey.Keypad9] = ImGuiKey.Keypad9;
+ BlissKeyMap[KeyboardKey.KeypadDecimal] = ImGuiKey.KeypadDecimal;
+ BlissKeyMap[KeyboardKey.KeypadDivide] = ImGuiKey.KeypadDivide;
+ BlissKeyMap[KeyboardKey.KeypadMultiply] = ImGuiKey.KeypadMultiply;
+ BlissKeyMap[KeyboardKey.KeypadMinus] = ImGuiKey.KeypadSubtract;
+ BlissKeyMap[KeyboardKey.KeypadPlus] = ImGuiKey.KeypadAdd;
+ BlissKeyMap[KeyboardKey.KeypadEnter] = ImGuiKey.KeypadEnter;
+ // BlissKeyMap[KeyboardKey.] = ImGuiKey.KeypadEqual;
+ }
+
+ private static void SetupMouseCursors()
+ {
+ mouseCursorMap.Clear();
+ mouseCursorMap[ImGuiMouseCursor.Arrow] = SystemCursor.Pointer;
+ mouseCursorMap[ImGuiMouseCursor.TextInput] = SystemCursor.Text;
+ mouseCursorMap[ImGuiMouseCursor.Hand] = SystemCursor.NotAllowed;
+ mouseCursorMap[ImGuiMouseCursor.ResizeAll] = SystemCursor.Move;
+ mouseCursorMap[ImGuiMouseCursor.ResizeEw] = SystemCursor.EWResize;
+ mouseCursorMap[ImGuiMouseCursor.ResizeNesw] = SystemCursor.NESWResize;
+ mouseCursorMap[ImGuiMouseCursor.ResizeNs] = SystemCursor.NSResize;
+ mouseCursorMap[ImGuiMouseCursor.ResizeNwse] = SystemCursor.NWSEResize;
+ mouseCursorMap[ImGuiMouseCursor.NotAllowed] = SystemCursor.NotAllowed;
+ }
+
+ ///
+ /// Forces the font texture atlas to be recomputed and re-cached
+ ///
+ public static unsafe void ReloadFonts()
+ {
+ CopperImGui.SetCurrentContext(imGuiContext);
+ var io = ImGui.GetIO();
+
+ byte* pixels;
+ int width;
+ int height;
+
+ ImGui.GetTexDataAsRGBA32(io.Fonts, &pixels, &width, &height);
+
+ // TODO: Add font support - waiting for Bliss version with full image support
+ // new Texture2D(BlissRenderer.Device);
+
+ // fontTexture = binding.LoadFontTexture(new IntPtr(pixels), new Vector2(width, height));
+
+ // io.Fonts.SetTexID(new ImTextureID(fontTexture.Id));
+ }
+
+ // ReSharper disable once InconsistentNaming
+ private static unsafe sbyte* GetClipboardText(IntPtr userData)
+ {
+ var bytes = Encoding.ASCII.GetBytes(Input.GetClipboardText());
+
+ fixed (byte* p = bytes)
+ return (sbyte*)p;
+ }
+
+ // ReSharper disable once InconsistentNaming
+ private static unsafe void SetClipboardText(IntPtr userData, sbyte* text)
+ {
+ try
+ {
+ Input.SetClipboardText(text->ToString());
+ }
+ catch (Exception e)
+ {
+ Log.Exception(e);
+ }
+ }
+
+ private unsafe delegate sbyte* GetClipTextCallback(IntPtr userData);
+
+ private unsafe delegate void SetClipTextCallback(IntPtr userData, sbyte* text);
+
+ private static GetClipTextCallback getClipCallback = null!;
+ private static SetClipTextCallback setClipCallback = null!;
+
+ ///
+ /// End Custom initialization. Not needed if you call Setup. Only needed if you want to add custom setup code.
+ /// must be proceeded by BeginInitImGui
+ ///
+ public static void EndInitImGui()
+ {
+ SetupMouseCursors();
+
+ CopperImGui.SetCurrentContext(imGuiContext);
+
+ CopperImGui.LoadFonts();
+
+ var io = ImGui.GetIO();
+ io.BackendFlags |= ImGuiBackendFlags.HasMouseCursors | ImGuiBackendFlags.HasSetMousePos | ImGuiBackendFlags.HasGamepad;
+
+ io.MousePos.X = 0;
+ io.MousePos.Y = 0;
+
+ var platformIO = ImGui.GetPlatformIO();
+
+ // copy/paste callbacks
+ unsafe
+ {
+ setClipCallback = SetClipboardText;
+ platformIO.PlatformSetClipboardTextFn = (void*)Marshal.GetFunctionPointerForDelegate(setClipCallback);
+
+ getClipCallback = GetClipboardText;
+ platformIO.PlatformGetClipboardTextFn = (void*)Marshal.GetFunctionPointerForDelegate(getClipCallback);
+
+ platformIO.PlatformClipboardUserData = null;
+ }
+
+
+ ReloadFonts();
+ }
+
+ private static void SetMouseEvent(ImGuiIOPtr io, MouseButton mouseButton, ImGuiMouseButton imGuiMouse)
+ {
+ if (Input.IsMouseButtonPressed(mouseButton))
+ io.AddMouseButtonEvent((int)imGuiMouse, true);
+ else if (Input.IsMouseButtonReleased(mouseButton))
+ io.AddMouseButtonEvent((int)imGuiMouse, false);
+ }
+
+ private static void NewFrame(float dt = -1)
+ {
+ var io = ImGui.GetIO();
+
+ if (BlissRenderer.Window.GetState().HasFlag(WindowState.FullScreen) && false)
+ {
+ // TODO: See if theres a way to get monitor size w/ bliss
+ // var monitor = binding.WindowGetCurrentMonitor();
+ // io.DisplaySize = new Vector2(binding.WindowGetMonitorWidth(monitor), binding.WindowGetMonitorHeight(monitor));
+ }
+ else
+ {
+ io.DisplaySize = new Vector2(BlissRenderer.Window.GetSize().Item1, BlissRenderer.Window.GetSize().Item2);
+ }
+
+ io.DisplayFramebufferScale = new Vector2(1, 1);
+
+ // TODO: See if theres a way to do high dpi stuff w/ bliss
+ // if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || binding.WindowIsState(ConfigFlags.HighDpiWindow))
+ // io.DisplayFramebufferScale = binding.WindowGetScaleDPI();
+
+ io.DeltaTime = dt >= 0 ? dt : (float)BlissRenderer.DeltaTime;
+
+
+ if (io.WantSetMousePos)
+ {
+ Input.SetMousePosition(io.MousePos);
+ }
+ else
+ {
+ io.AddMousePosEvent(Input.GetMousePosition().X, Input.GetMousePosition().Y);
+ }
+
+ SetMouseEvent(io, MouseButton.Left, ImGuiMouseButton.Left);
+ SetMouseEvent(io, MouseButton.Right, ImGuiMouseButton.Right);
+ SetMouseEvent(io, MouseButton.Middle, ImGuiMouseButton.Middle);
+ // SetMouseEvent(io, MouseButton.Forward, ImGuiMouseButton.Middle + 1); // TODO
+ // SetMouseEvent(io, MouseButton.Back, ImGuiMouseButton.Middle + 2); // TODO
+
+ var wheelMove = Input.GetMouseDelta();
+ io.AddMouseWheelEvent(wheelMove.X, wheelMove.Y);
+
+ if ((io.ConfigFlags & ImGuiConfigFlags.NoMouseCursorChange) != 0)
+ return;
+
+ var imguiCursor = ImGui.GetMouseCursor();
+
+ if (imguiCursor == currentMouseCursor && !io.MouseDrawCursor)
+ return;
+
+ currentMouseCursor = imguiCursor;
+ if (io.MouseDrawCursor || imguiCursor == ImGuiMouseCursor.None)
+ {
+ Input.HideCursor();
+ }
+ else
+ {
+ Input.ShowCursor();
+
+
+ if ((io.ConfigFlags & ImGuiConfigFlags.NoMouseCursorChange) == 0)
+ Input.SetMouseCursor(new Sdl3Cursor(mouseCursorMap.GetValueOrDefault(imguiCursor, SystemCursor.Default)));
+ }
+ }
+
+ private static void FrameEvents()
+ {
+ var io = ImGui.GetIO();
+
+ var focused = BlissRenderer.Window.IsFocused;
+ if (focused != lastFrameFocused)
+ io.AddFocusEvent(focused);
+ lastFrameFocused = focused;
+
+
+ // handle the modifier key events so that shortcuts work
+ var ctrlDown = IsControlDown();
+ if (ctrlDown != lastControlPressed)
+ io.AddKeyEvent(ImGuiKey.ModCtrl, ctrlDown);
+ lastControlPressed = ctrlDown;
+
+ var shiftDown = IsShiftDown();
+ if (shiftDown != lastShiftPressed)
+ io.AddKeyEvent(ImGuiKey.ModShift, shiftDown);
+ lastShiftPressed = shiftDown;
+
+ var altDown = IsAltDown();
+ if (altDown != lastAltPressed)
+ io.AddKeyEvent(ImGuiKey.ModAlt, altDown);
+ lastAltPressed = altDown;
+
+ var superDown = IsSuperDown();
+ if (superDown != lastSuperPressed)
+ io.AddKeyEvent(ImGuiKey.ModSuper, superDown);
+ lastSuperPressed = superDown;
+
+ // get the pressed keys, they are in event order
+// var keyId = Input.GetKeyPressed();
+// while (keyId != 0)
+// {
+// var key = keyId;
+// if (BlissKeyMap.TryGetValue(key, out var value))
+// io.AddKeyEvent(value, true);
+// keyId = Input.GetKeyPressed();
+// }
+
+ // look for any keys that were down last frame and see if they were down and are released
+ // ReSharper disable once ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator
+ foreach (var keyItr in BlissKeyMap)
+ {
+ if (Input.IsKeyReleased(keyItr.Key))
+ io.AddKeyEvent(keyItr.Value, false);
+ }
+
+ // add the text input in order
+ foreach (var c in Input.GetPressedChars())
+ io.AddInputCharacter(c);
+
+ // gamepads
+ if ((io.ConfigFlags & ImGuiConfigFlags.NavEnableGamepad) == 0 || !Input.IsGamepadAvailable(0))
+ return;
+
+ // TODO: make sure gamepad controls are correct
+ HandleGamepadButtonEvent(io, GamepadButton.DpadUp, ImGuiKey.GamepadDpadUp);
+ HandleGamepadButtonEvent(io, GamepadButton.DpadRight, ImGuiKey.GamepadDpadRight);
+ HandleGamepadButtonEvent(io, GamepadButton.DpadDown, ImGuiKey.GamepadDpadDown);
+ HandleGamepadButtonEvent(io, GamepadButton.DpadLeft, ImGuiKey.GamepadDpadLeft);
+
+// HandleGamepadButtonEvent(io, GamepadButton.RightFaceUp, ImGuiKey.GamepadFaceUp);
+// HandleGamepadButtonEvent(io, GamepadButton.RightFaceRight, ImGuiKey.GamepadFaceLeft);
+// HandleGamepadButtonEvent(io, GamepadButton.RightFaceDown, ImGuiKey.GamepadFaceDown);
+// HandleGamepadButtonEvent(io, GamepadButton.RightFaceLeft, ImGuiKey.GamepadFaceRight);
+
+ HandleGamepadButtonEvent(io, GamepadButton.LeftShoulder, ImGuiKey.GamepadL1);
+ HandleGamepadButtonEvent(io, GamepadButton.LeftPaddle1, ImGuiKey.GamepadL2);
+// HandleGamepadButtonEvent(io, GamepadButton.RightTrigger1, ImGuiKey.GamepadR1);
+// HandleGamepadButtonEvent(io, GamepadButton.RightTrigger2, ImGuiKey.GamepadR2);
+ HandleGamepadButtonEvent(io, GamepadButton.LeftPaddle2, ImGuiKey.GamepadL3);
+// HandleGamepadButtonEvent(io, GamepadButton.RightThumb, ImGuiKey.GamepadR3);
+
+ HandleGamepadButtonEvent(io, GamepadButton.Start, ImGuiKey.GamepadStart);
+ HandleGamepadButtonEvent(io, GamepadButton.Back, ImGuiKey.GamepadBack);
+
+ // left stick
+ HandleGamepadStickEvent(io, GamepadAxis.LeftX, ImGuiKey.GamepadLStickLeft, ImGuiKey.GamepadLStickRight);
+ HandleGamepadStickEvent(io, GamepadAxis.LeftY, ImGuiKey.GamepadLStickUp, ImGuiKey.GamepadLStickDown);
+
+ // right stick
+ HandleGamepadStickEvent(io, GamepadAxis.RightX, ImGuiKey.GamepadRStickLeft, ImGuiKey.GamepadRStickRight);
+ HandleGamepadStickEvent(io, GamepadAxis.RightY, ImGuiKey.GamepadRStickUp, ImGuiKey.GamepadRStickDown);
+ }
+
+
+ private static void HandleGamepadButtonEvent(ImGuiIOPtr io, GamepadButton button, ImGuiKey key)
+ {
+ if (Input.IsGamepadButtonPressed(0, button))
+ io.AddKeyEvent(key, true);
+ else if (Input.IsGamepadButtonReleased(0, button))
+ io.AddKeyEvent(key, false);
+ }
+
+ private static void HandleGamepadStickEvent(ImGuiIOPtr io, GamepadAxis axis, ImGuiKey negKey, ImGuiKey posKey)
+ {
+ const float deadZone = 0.20f;
+
+ var axisValue = Input.GetGamepadAxisMovement(0, axis);
+
+ io.AddKeyAnalogEvent(negKey, axisValue < -deadZone, axisValue < -deadZone ? -axisValue : 0);
+ io.AddKeyAnalogEvent(posKey, axisValue > deadZone, axisValue > deadZone ? axisValue : 0);
+ }
+
+ ///
+ /// Starts a new ImGui Frame
+ ///
+ /// optional delta time, any value less than 0 will use raylib GetFrameTime
+ public static void Begin(float dt = -1)
+ {
+ CopperImGui.SetCurrentContext(imGuiContext);
+
+ NewFrame(dt);
+ FrameEvents();
+ ImGui.NewFrame();
+ }
+
+ private static GraphicsDevice Gd => BlissRenderer.Device;
+ private static CommandList Cl => BlissRenderer.CommandList;
+
+ private static void EnableScissor(float x, float y, float width, float height)
+ {
+ var io = ImGui.GetIO();
+ var scale = new Vector2(1.0f, 1.0f);
+
+ uint xPos = (uint)(x * scale.X);
+ uint yPos = (uint)((io.DisplaySize.Y - (y + height)) * scale.Y);
+ uint w = (uint)(width * scale.X);
+ uint h = (uint)(height * scale.Y);
+
+ Cl.SetScissorRect(0, xPos, yPos, w, h);
+ }
+
+ private static void RenderTriangles(uint count, uint indexStart, ImVector indexBuffer, ImVector vertBuffer, ImTextureID texturePtr)
+ {
+ if (count < 3)
+ return;
+
+ // Bind the pipeline
+ Cl.SetPipeline(_pipeline);
+
+ // Bind the vertex and index buffers
+ Cl.SetVertexBuffer(0, _vertexBuffer);
+ Cl.SetIndexBuffer(_indexBuffer, IndexFormat.UInt16);
+
+ // Bind texture if available
+ if (texturePtr != IntPtr.Zero)
+ {
+ TextureView? textureView = (TextureView?)GCHandle.FromIntPtr((IntPtr)texturePtr.Handle).Target;
+ if (textureView != null)
+ {
+ Cl.SetGraphicsResourceSet(0, Gd.ResourceFactory.CreateResourceSet(new ResourceSetDescription(
+ _resourceLayout, textureView, Gd.PointSampler)));
+ }
+ }
+
+ // Issue draw call
+ Cl.DrawIndexed(count, 1, indexStart, 0, 0);
+ }
+
+
+ public static unsafe void RenderData()
+ {
+ var data = ImGui.GetDrawData();
+ if (data == null || data.CmdListsCount == 0)
+ return;
+
+ Cl.Begin();
+
+ for (var l = 0; l < data.CmdListsCount; l++)
+ {
+ var commandList = data.CmdLists[l];
+
+ for (var cmdIndex = 0; cmdIndex < commandList.CmdBuffer.Size; cmdIndex++)
+ {
+ var cmd = commandList.CmdBuffer[cmdIndex];
+
+ EnableScissor(
+ cmd.ClipRect.X - data.DisplayPos.X,
+ cmd.ClipRect.Y - data.DisplayPos.Y,
+ cmd.ClipRect.Z - (cmd.ClipRect.X - data.DisplayPos.X),
+ cmd.ClipRect.W - (cmd.ClipRect.Y - data.DisplayPos.Y));
+
+ if (cmd.UserCallback != null)
+ {
+ var cb = Marshal.GetDelegateForFunctionPointer(new IntPtr(cmd.UserCallback));
+ cb(commandList, new ImDrawCmdPtr(&cmd));
+ continue;
+ }
+
+ RenderTriangles(cmd.ElemCount, cmd.IdxOffset, commandList.IdxBuffer, commandList.VtxBuffer, cmd.TextureId);
+ }
+ }
+
+ Cl.End();
+ Gd.SubmitCommands(Cl);
+ }
+
+ ///
+ /// Ends an ImGui frame and submits all ImGui drawing to raylib for processing.
+ ///
+ public static void End()
+ {
+ CopperImGui.SetCurrentContext(imGuiContext);
+ ImGui.Render();
+ ImGui.EndFrame();
+ RenderData();
+
+ if (ImGui.GetIO().ConfigFlags.HasFlag(ImGuiConfigFlags.ViewportsEnable))
+ {
+ ImGui.UpdatePlatformWindows();
+ ImGui.RenderPlatformWindowsDefault();
+ }
+ }
+
+ ///
+ /// Cleanup ImGui and unload font atlas
+ ///
+ public static void Shutdown()
+ {
+ fontTexture.Dispose();
+ CopperImGui.DestroyContext(imGuiContext);
+ }
+}
\ No newline at end of file
diff --git a/src/Renderers/Library/CopperDevs.DearImGui.Renderer.Bliss/BlissRenderer.cs b/src/Renderers/Library/CopperDevs.DearImGui.Renderer.Bliss/BlissRenderer.cs
new file mode 100644
index 0000000..fbafbe8
--- /dev/null
+++ b/src/Renderers/Library/CopperDevs.DearImGui.Renderer.Bliss/BlissRenderer.cs
@@ -0,0 +1,43 @@
+using Bliss.CSharp.Windowing;
+using CopperDevs.DearImGui.Rendering;
+using Veldrid;
+
+namespace CopperDevs.DearImGui.Renderer.Bliss;
+
+public class BlissRenderer : ImGuiRenderer
+{
+ internal static IWindow Window = null!;
+ internal static GraphicsDevice Device = null!;
+ internal static CommandList CommandList = null!;
+
+ internal static double DeltaTime;
+
+ public static void SetupReferences(IWindow targetWindow, GraphicsDevice targetDevice, CommandList commandList)
+ {
+ Window = targetWindow;
+ Device = targetDevice;
+ CommandList = commandList;
+ }
+
+ public static void SetDeltaTime(double deltaTimeValue) => DeltaTime = deltaTimeValue;
+
+ public override void Setup()
+ {
+ BlissImGui.Setup();
+ }
+
+ public override void Begin()
+ {
+ BlissImGui.Begin();
+ }
+
+ public override void End()
+ {
+ BlissImGui.End();
+ }
+
+ public override void Shutdown()
+ {
+ BlissImGui.Shutdown();
+ }
+}
\ No newline at end of file
diff --git a/src/Renderers/Library/CopperDevs.DearImGui.Renderer.Bliss/CopperDevs.DearImGui.Renderer.Bliss.csproj b/src/Renderers/Library/CopperDevs.DearImGui.Renderer.Bliss/CopperDevs.DearImGui.Renderer.Bliss.csproj
new file mode 100644
index 0000000..7dd99d7
--- /dev/null
+++ b/src/Renderers/Library/CopperDevs.DearImGui.Renderer.Bliss/CopperDevs.DearImGui.Renderer.Bliss.csproj
@@ -0,0 +1,17 @@
+
+
+
+ net9.0
+ enable
+ enable
+ true
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Renderers/Raylib/CopperDevs.DearImGui.Renderer.Raylib.Raylib-CSharp/RlImGuiBinding.cs b/src/Renderers/Raylib/CopperDevs.DearImGui.Renderer.Raylib.Raylib-CSharp/RlImGuiBinding.cs
index fc91122..af07460 100644
--- a/src/Renderers/Raylib/CopperDevs.DearImGui.Renderer.Raylib.Raylib-CSharp/RlImGuiBinding.cs
+++ b/src/Renderers/Raylib/CopperDevs.DearImGui.Renderer.Raylib.Raylib-CSharp/RlImGuiBinding.cs
@@ -21,7 +21,6 @@
using rlMouseCursor = Raylib_CSharp.Interact.MouseCursor;
using rlGamepadButton = Raylib_CSharp.Interact.GamepadButton;
using rlGamepadAxis = Raylib_CSharp.Interact.GamepadAxis;
-
using GameWindow = Raylib_CSharp.Windowing.Window;
using Vector2 = System.Numerics.Vector2;
@@ -35,7 +34,7 @@ public RlImGuiBinding()
CopperImGui.RegisterFieldRenderer();
CopperImGui.RegisterFieldRenderer();
}
-
+
public override Texture2D LoadFontTexture(IntPtr data, Vector2Int size)
{
var image = new Image
@@ -46,7 +45,7 @@ public override Texture2D LoadFontTexture(IntPtr data, Vector2Int size)
Mipmaps = 1,
Format = PixelFormat.UncompressedR8G8B8A8,
};
-
+
var rlTexture = rlTexture2D.LoadFromImage(image);
return new Texture2D()