diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-01-17 15:40:15 +0100 |
|---|---|---|
| committer | j-p <jp_bruyere@hotmail.com> | 2021-02-06 20:28:02 +0100 |
| commit | e7da508d07c90eb62fedc765db0e9b67b58b92ca (patch) | |
| tree | 271c06b6c16a3989e55fc6caa6539dc62b58b4f9 | |
| parent | 0299b2c358f322a4ff012dbc8f9989dfe7cc3d2a (diff) | |
add netcore NativeResolve for PerfTests
| -rw-r--r-- | Samples/PerfTests/Program.cs | 20 | ||||
| -rw-r--r-- | Samples/common/ui/Interfaces/Divers/2.crow | 11 |
2 files changed, 23 insertions, 8 deletions
diff --git a/Samples/PerfTests/Program.cs b/Samples/PerfTests/Program.cs index 73b97448..a50003f6 100644 --- a/Samples/PerfTests/Program.cs +++ b/Samples/PerfTests/Program.cs @@ -6,11 +6,31 @@ using System.CodeDom.Compiler; using System.Diagnostics; using System.IO; using Crow; +using System.Reflection; +using System.Runtime.InteropServices; namespace PerfTests { class TestInterface : Interface { +#if NETCOREAPP + static IntPtr resolveUnmanaged (Assembly assembly, String libraryName) { + + switch (libraryName) + { + case "glfw3": + return NativeLibrary.Load("glfw", assembly, null); + case "rsvg-2.40": + return NativeLibrary.Load("rsvg-2", assembly, null); + } + Console.WriteLine ($"[UNRESOLVE] {assembly} {libraryName}"); + return IntPtr.Zero; + } + + static TestInterface () { + System.Runtime.Loader.AssemblyLoadContext.Default.ResolvingUnmanagedDll+=resolveUnmanaged; + } +#endif readonly int count = 1, updateCycles = 0; readonly bool miliseconds = false; readonly bool resetItors = false; diff --git a/Samples/common/ui/Interfaces/Divers/2.crow b/Samples/common/ui/Interfaces/Divers/2.crow index d2c8c370..a1896248 100644 --- a/Samples/common/ui/Interfaces/Divers/2.crow +++ b/Samples/common/ui/Interfaces/Divers/2.crow @@ -2,13 +2,8 @@ <VerticalStack Fit="true"> <TextBox Font="droid, 20" Text="test text box" Width="Stretched"/> <HorizontalStack Margin="5" Fit="true" MouseEnter="{Background=White}" MouseLeave="{Background=Transparent}"> - <Label Text="left" Width="80" Height="30" Background="DarkBlue" TextAlignment="Left"/> - <Label Text="centered" Width="80" Height="30" Background="DarkBlue" TextAlignment="Center"/> - <Label Text="top left" Width="80" Height="30" Background="DarkBlue" TextAlignment="TopLeft"/> - <Label Text="top right" Width="80" Height="30" Background="DarkBlue" TextAlignment="TopRight"/> - <Label Text="right" Width="80" Height="30" Background="DarkBlue" TextAlignment="Right"/> - <Label Text="bottom left" Width="80" Height="30" Background="DarkBlue" TextAlignment="BottomLeft"/> - <Label Text="bottom" Width="80" Height="30" Background="DarkBlue" TextAlignment="Bottom"/> - <Label Text="bottom right" Width="80" Height="30" Background="DarkBlue" TextAlignment="BottomRight"/> + <Label Focusable="true" Text="left" Width="80" Height="30" Background="DarkBlue" TextAlignment="Left"/> + <Label Focusable="true" Text="centered" Width="80" Height="30" Background="DarkBlue" TextAlignment="Center"/> + <Label Focusable="true" Text="right" Width="80" Height="30" Background="DarkBlue" TextAlignment="Right"/> </HorizontalStack> </VerticalStack>
\ No newline at end of file |