Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/nuget/MSTest.TestAdapter-3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-edmondson authored Sep 18, 2024
2 parents 977be08 + 03b8240 commit 766f496
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 27 deletions.
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ updates:
directory: "/"
schedule:
interval: "daily"
assignees:
- "matt-edmondson"
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
if: steps.metadata.outputs.update-type == 'version-update:semver-major'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Build and Analyze
name: Build and Test

on:
push:
branches: [ "main" ]
pull_request:
types: [opened, synchronize, reopened]
types: [opened, synchronize, reopened, closed]

permissions:
packages: write
contents: write

jobs:
build-dotnet-library:
uses: ktsu-io/workflows/.github/workflows/build-dotnet-library.yml@main
uses: ktsu-dev/workflows/.github/workflows/build-dotnet-library.yml@main
secrets: inherit
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ktsu.io
ktsu
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<PackageReference Include="coverlet.collector" Version="6.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion ImGuiApp/ForceDpiAware.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Adapted From: https://github.com/Ryujinx/Ryujinx/blob/master/src/Ryujinx.Common/SystemInterop/ForceDpiAware.cs
// License: MIT

namespace ktsu.io.ImGuiApp;
namespace ktsu.ImGuiApp;

using System.Globalization;
using System.Runtime.InteropServices;
Expand Down
2 changes: 1 addition & 1 deletion ImGuiApp/GdiPlusHelper.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Adapted From: https://github.com/Ryujinx/Ryujinx/blob/master/src/Ryujinx.Common/SystemInterop/GdiPlusHelper.cs
// License: MIT

namespace ktsu.io.ImGuiApp;
namespace ktsu.ImGuiApp;

using System.Runtime.InteropServices;
using System.Runtime.Versioning;
Expand Down
11 changes: 9 additions & 2 deletions ImGuiApp/ImGuiApp.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// Ignore Spelling: App Im

namespace ktsu.io.ImGuiApp;
namespace ktsu.ImGuiApp;

using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using ImGuiNET;
using ktsu.io.StrongPaths;
using ktsu.Extensions;
using ktsu.StrongPaths;
using Silk.NET.Input;
using Silk.NET.OpenGL;
using Silk.NET.OpenGL.Extensions.ImGui;
Expand Down Expand Up @@ -47,6 +48,7 @@ public static ImGuiAppWindowState WindowState

private static int[] FontSizes { get; } = [12, 13, 14, 16, 18, 20, 24, 28, 32, 40, 48];
private static Dictionary<int, ImFontPtr> Fonts { get; } = [];
private static Collection<nint> FontDataPtrs { get; } = [];

public static bool IsFocused { get; private set; } = true;
public static bool IsVisible => (window?.WindowState != Silk.NET.Windowing.WindowState.Minimized) && (window?.IsVisible ?? false);
Expand Down Expand Up @@ -254,6 +256,9 @@ public static void Start(AppConfig config)
{
lock (LockGL)
{
// Free the natively allocated font data
FontDataPtrs.ForEach(p => Marshal.FreeHGlobal(p));

// Dispose our controller first
controller?.Dispose();

Expand Down Expand Up @@ -457,6 +462,7 @@ internal static void InitFonts()
var io = ImGui.GetIO();
var fontAtlasPtr = io.Fonts;
nint fontBytesPtr = Marshal.AllocHGlobal(fontBytes.Length);
FontDataPtrs.Add(fontBytesPtr);
Marshal.Copy(fontBytes, 0, fontBytesPtr, fontBytes.Length);
_ = fontAtlasPtr.AddFontDefault();
foreach (int size in FontSizes)
Expand All @@ -469,6 +475,7 @@ internal static void InitFonts()
OversampleH = 2,
OversampleV = 2,
PixelSnapH = true,
FontDataOwnedByAtlas = false,
};
_ = fontAtlasPtr.AddFontFromMemoryTTF(fontBytesPtr, fontBytes.Length, size, fontConfig, fontAtlasPtr.GetGlyphRangesDefault());
}
Expand Down
4 changes: 2 additions & 2 deletions ImGuiApp/ImGuiApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ktsu.io.ScopedAction" Version="1.0.0-alpha.4" />
<PackageReference Include="ktsu.io.StrongPaths" Version="1.1.1" />
<PackageReference Include="ktsu.ScopedAction" Version="1.0.0-alpha.5" />
<PackageReference Include="ktsu.StrongPaths" Version="1.1.3" />
<PackageReference Include="Silk.NET" Version="2.21.0" />
<PackageReference Include="Silk.NET.OpenGL.Extensions.ImGui" Version="2.21.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
Expand Down
4 changes: 2 additions & 2 deletions ImGuiApp/Resources/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ImGuiApp/UIScaler.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace ktsu.io.ImGuiApp;
namespace ktsu.ImGuiApp;

using ktsu.io.ScopedAction;
using ktsu.ScopedAction;
using ImGuiNET;
using System.Numerics;

Expand Down
6 changes: 3 additions & 3 deletions ImGuiAppDemo/ImGuiAppDemo.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Ignore Spelling: App Im

namespace ktsu.io.ImGuiApp.Demo;
namespace ktsu.ImGuiApp.Demo;

using System.Runtime.InteropServices;
using ImGuiNET;
using ktsu.io.ImGuiApp;
using ktsu.io.ImGuiApp.Demo.Properties;
using ktsu.ImGuiApp;
using ktsu.ImGuiApp.Demo.Properties;

internal static class ImGuiAppDemo
{
Expand Down
4 changes: 2 additions & 2 deletions ImGuiAppDemo/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023-2024 ktsu.io
Copyright (c) 2023-2024 ktsu.dev

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ A bootstrap library to give you an environment to build an ImGUI.NET application

## Minimal Example
```csharp
namespace ktsu.io.ImGuiAppDemo;
namespace ktsu.ImGuiAppDemo;

using ImGuiNET;
using ktsu.io.ImGuiApp;
using ktsu.ImGuiApp;

internal class ImGuiAppDemo
{
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0-alpha.33
1.0.0-alpha.36

0 comments on commit 766f496

Please sign in to comment.