diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b7f51b6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = tab +insert_final_newline = true +trim_trailing_whitespace = true + +[*.cs] +csharp_space_after_cast = true +charset = utf-8-bom +max_line_length = 100 diff --git a/src/MoonWorksImguiExampleGame.cs b/src/MoonWorksImguiExampleGame.cs index 36d7580..8e4962e 100644 --- a/src/MoonWorksImguiExampleGame.cs +++ b/src/MoonWorksImguiExampleGame.cs @@ -1,4 +1,4 @@ -using MoonWorks.Graphics; +using MoonWorks.Graphics; using MoonWorks; using ImGuiNET; using System.Runtime.InteropServices; @@ -9,15 +9,15 @@ using System.Collections.Generic; namespace MoonWorksImGuiExample { - class MoonWorksImGuiExampleGame : Game - { + class MoonWorksImGuiExampleGame : Game + { private string ContentPath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "Content"); private ImFontPtr DefaultFontPtr; private int TextureID; private System.IntPtr? FontTexturePtr; private Dictionary LoadedTextures = new Dictionary(); - private Dictionary TextureHandles = new Dictionary(); + private Dictionary TextureHandles = new Dictionary(); private uint VertexCount = 0; private uint IndexCount = 0; @@ -28,12 +28,12 @@ namespace MoonWorksImGuiExample private ShaderModule ImGuiFragmentShader; private Sampler ImGuiSampler; - public MoonWorksImGuiExampleGame( - WindowCreateInfo windowCreateInfo, - PresentMode presentMode, - bool debugMode - ) : base(windowCreateInfo, presentMode, 60, debugMode) - { + public MoonWorksImGuiExampleGame( + WindowCreateInfo windowCreateInfo, + PresentMode presentMode, + bool debugMode + ) : base(windowCreateInfo, presentMode, 60, debugMode) + { var context = ImGui.CreateContext(); ImGui.SetCurrentContext(context); @@ -78,12 +78,12 @@ namespace MoonWorksImGuiExample MultisampleState = MultisampleState.None } ); - } + } - protected override void Update(System.TimeSpan dt) - { - // Insert your game update logic here. - } + protected override void Update(System.TimeSpan dt) + { + // Insert your game update logic here. + } private System.IntPtr BindTexture(Texture texture) { @@ -196,23 +196,23 @@ namespace MoonWorksImGuiExample GraphicsDevice.Submit(commandBuffer); } - protected override void Draw(System.TimeSpan dt, double alpha) - { - // Replace this with your own drawing code. + protected override void Draw(System.TimeSpan dt, double alpha) + { + // Replace this with your own drawing code. var io = ImGui.GetIO(); io.KeyShift = Inputs.Keyboard.IsDown(Keycode.LeftShift) || Inputs.Keyboard.IsDown(Keycode.RightShift); - io.KeyCtrl = Inputs.Keyboard.IsDown(Keycode.LeftControl) || Inputs.Keyboard.IsDown(Keycode.RightControl); - io.KeyAlt = Inputs.Keyboard.IsDown(Keycode.LeftAlt) || Inputs.Keyboard.IsDown(Keycode.RightAlt); - io.KeySuper = Inputs.Keyboard.IsDown(Keycode.LeftMeta) || Inputs.Keyboard.IsDown(Keycode.RightMeta); - io.KeyMap[(int)ImGuiKey.Backspace] = (int)Keycode.Backspace; + io.KeyCtrl = Inputs.Keyboard.IsDown(Keycode.LeftControl) || Inputs.Keyboard.IsDown(Keycode.RightControl); + io.KeyAlt = Inputs.Keyboard.IsDown(Keycode.LeftAlt) || Inputs.Keyboard.IsDown(Keycode.RightAlt); + io.KeySuper = Inputs.Keyboard.IsDown(Keycode.LeftMeta) || Inputs.Keyboard.IsDown(Keycode.RightMeta); + io.KeyMap[(int) ImGuiKey.Backspace] = (int) Keycode.Backspace; - io.MousePos = new System.Numerics.Vector2(Inputs.Mouse.X, Inputs.Mouse.Y); - io.MouseDown[0] = Inputs.Mouse.LeftButton.IsDown; - io.MouseDown[1] = Inputs.Mouse.RightButton.IsDown; - io.MouseDown[2] = Inputs.Mouse.MiddleButton.IsDown; - io.MouseWheel = Inputs.Mouse.Wheel > 0 ? 1 : Inputs.Mouse.Wheel < 0 ? -1 : 0; + io.MousePos = new System.Numerics.Vector2(Inputs.Mouse.X, Inputs.Mouse.Y); + io.MouseDown[0] = Inputs.Mouse.LeftButton.IsDown; + io.MouseDown[1] = Inputs.Mouse.RightButton.IsDown; + io.MouseDown[2] = Inputs.Mouse.MiddleButton.IsDown; + io.MouseWheel = Inputs.Mouse.Wheel > 0 ? 1 : Inputs.Mouse.Wheel < 0 ? -1 : 0; ImGui.NewFrame(); @@ -300,11 +300,11 @@ namespace MoonWorksImGuiExample } GraphicsDevice.Submit(commandBuffer); - } + } protected override void OnDestroy() { } - } + } } diff --git a/src/Program.cs b/src/Program.cs index 95d29fd..539d909 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -1,34 +1,34 @@ -using System; +using System; using System.IO; using System.Runtime.InteropServices; using MoonWorks; namespace MoonWorksImGuiExample { - class Program - { - [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool SetDllDirectory(string lpPathName); + class Program + { + [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool SetDllDirectory(string lpPathName); - static void Main(string[] args) - { - WindowCreateInfo windowCreateInfo = new WindowCreateInfo - { - WindowWidth = 1280, - WindowHeight = 720, - WindowTitle = "MoonWorksImGuiExample", - ScreenMode = ScreenMode.Windowed - }; + static void Main(string[] args) + { + WindowCreateInfo windowCreateInfo = new WindowCreateInfo + { + WindowWidth = 1280, + WindowHeight = 720, + WindowTitle = "MoonWorksImGuiExample", + ScreenMode = ScreenMode.Windowed + }; - MoonWorksImGuiExampleGame game = new MoonWorksImGuiExampleGame( - windowCreateInfo, - MoonWorks.Graphics.PresentMode.FIFORelaxed, - true - ); + MoonWorksImGuiExampleGame game = new MoonWorksImGuiExampleGame( + windowCreateInfo, + MoonWorks.Graphics.PresentMode.FIFORelaxed, + true + ); - game.Run(); - } - } + game.Run(); + } + } } diff --git a/src/VertexPositionTextureColor.cs b/src/VertexPositionTextureColor.cs index 7642564..aa7438a 100644 --- a/src/VertexPositionTextureColor.cs +++ b/src/VertexPositionTextureColor.cs @@ -1,4 +1,4 @@ -using MoonWorks.Graphics; +using MoonWorks.Graphics; using MoonWorks.Math; namespace MoonWorksImGuiExample