diff --git a/源代码/.vs/ProjectEvaluation/stgsharpdevelop.metadata.v7.bin b/源代码/.vs/ProjectEvaluation/stgsharpdevelop.metadata.v7.bin index 144b224c..c2bd5e8f 100644 Binary files a/源代码/.vs/ProjectEvaluation/stgsharpdevelop.metadata.v7.bin and b/源代码/.vs/ProjectEvaluation/stgsharpdevelop.metadata.v7.bin differ diff --git a/源代码/.vs/ProjectEvaluation/stgsharpdevelop.projects.v7.bin b/源代码/.vs/ProjectEvaluation/stgsharpdevelop.projects.v7.bin index 494ff2aa..fed95760 100644 Binary files a/源代码/.vs/ProjectEvaluation/stgsharpdevelop.projects.v7.bin and b/源代码/.vs/ProjectEvaluation/stgsharpdevelop.projects.v7.bin differ diff --git a/源代码/.vs/StgSharpDevelop/DesignTimeBuild/.dtbcache.v2 b/源代码/.vs/StgSharpDevelop/DesignTimeBuild/.dtbcache.v2 index 49c84181..3f416849 100644 Binary files a/源代码/.vs/StgSharpDevelop/DesignTimeBuild/.dtbcache.v2 and b/源代码/.vs/StgSharpDevelop/DesignTimeBuild/.dtbcache.v2 differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/08bcfdd4-276b-424e-b2af-8e784bf74dd7.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/08bcfdd4-276b-424e-b2af-8e784bf74dd7.vsidx deleted file mode 100644 index 033ee35d..00000000 Binary files a/源代码/.vs/StgSharpDevelop/FileContentIndex/08bcfdd4-276b-424e-b2af-8e784bf74dd7.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/566744a5-d1b4-45e1-a1f2-dd05a0d4d9bd.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/566744a5-d1b4-45e1-a1f2-dd05a0d4d9bd.vsidx new file mode 100644 index 00000000..f017cc15 Binary files /dev/null and b/源代码/.vs/StgSharpDevelop/FileContentIndex/566744a5-d1b4-45e1-a1f2-dd05a0d4d9bd.vsidx differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/816e2b85-238a-4758-b4e4-636e6b010bf4.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/816e2b85-238a-4758-b4e4-636e6b010bf4.vsidx deleted file mode 100644 index 993af607..00000000 Binary files a/源代码/.vs/StgSharpDevelop/FileContentIndex/816e2b85-238a-4758-b4e4-636e6b010bf4.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/c1100f01-f137-4a5f-8cdf-0d75e4298590.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/c1100f01-f137-4a5f-8cdf-0d75e4298590.vsidx deleted file mode 100644 index 8eeacc50..00000000 Binary files a/源代码/.vs/StgSharpDevelop/FileContentIndex/c1100f01-f137-4a5f-8cdf-0d75e4298590.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/c39bbd2d-3c5e-4617-8a2f-57433dcc6fb3.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/c39bbd2d-3c5e-4617-8a2f-57433dcc6fb3.vsidx deleted file mode 100644 index abea8f4b..00000000 Binary files a/源代码/.vs/StgSharpDevelop/FileContentIndex/c39bbd2d-3c5e-4617-8a2f-57433dcc6fb3.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/c3abf06d-d9a5-4bff-acd3-07e913657a31.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/c3abf06d-d9a5-4bff-acd3-07e913657a31.vsidx new file mode 100644 index 00000000..1eeed60a Binary files /dev/null and b/源代码/.vs/StgSharpDevelop/FileContentIndex/c3abf06d-d9a5-4bff-acd3-07e913657a31.vsidx differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/c6c667cf-4fb3-44da-b976-d99d54674cec.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/c6c667cf-4fb3-44da-b976-d99d54674cec.vsidx new file mode 100644 index 00000000..50f950ec Binary files /dev/null and b/源代码/.vs/StgSharpDevelop/FileContentIndex/c6c667cf-4fb3-44da-b976-d99d54674cec.vsidx differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/d1c31b7a-69ba-459a-9cae-8d07153b5ed8.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/d1c31b7a-69ba-459a-9cae-8d07153b5ed8.vsidx new file mode 100644 index 00000000..cf7af104 Binary files /dev/null and b/源代码/.vs/StgSharpDevelop/FileContentIndex/d1c31b7a-69ba-459a-9cae-8d07153b5ed8.vsidx differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/d3d63655-39d9-4458-942e-23ccba7dd0aa.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/d3d63655-39d9-4458-942e-23ccba7dd0aa.vsidx new file mode 100644 index 00000000..6e3638a6 Binary files /dev/null and b/源代码/.vs/StgSharpDevelop/FileContentIndex/d3d63655-39d9-4458-942e-23ccba7dd0aa.vsidx differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/f208a6ac-ee12-4f28-ae4d-390ed8b542c9.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/f208a6ac-ee12-4f28-ae4d-390ed8b542c9.vsidx deleted file mode 100644 index 1a57f948..00000000 Binary files a/源代码/.vs/StgSharpDevelop/FileContentIndex/f208a6ac-ee12-4f28-ae4d-390ed8b542c9.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharpDevelop/v17/.futdcache.v2 b/源代码/.vs/StgSharpDevelop/v17/.futdcache.v2 index 66141ba4..0142a82e 100644 Binary files a/源代码/.vs/StgSharpDevelop/v17/.futdcache.v2 and b/源代码/.vs/StgSharpDevelop/v17/.futdcache.v2 differ diff --git a/源代码/.vs/StgSharpDevelop/v17/.suo b/源代码/.vs/StgSharpDevelop/v17/.suo index 727dc529..ee2a96f1 100644 Binary files a/源代码/.vs/StgSharpDevelop/v17/.suo and b/源代码/.vs/StgSharpDevelop/v17/.suo differ diff --git a/源代码/.vs/StgSharpDevelop/v17/Browse.VC.db b/源代码/.vs/StgSharpDevelop/v17/Browse.VC.db index 6de08835..05a445ad 100644 Binary files a/源代码/.vs/StgSharpDevelop/v17/Browse.VC.db and b/源代码/.vs/StgSharpDevelop/v17/Browse.VC.db differ diff --git a/源代码/.vs/StgSharpDevelop/v17/fileList.bin b/源代码/.vs/StgSharpDevelop/v17/fileList.bin index ccc4a64a..fdc1873a 100644 Binary files a/源代码/.vs/StgSharpDevelop/v17/fileList.bin and b/源代码/.vs/StgSharpDevelop/v17/fileList.bin differ diff --git a/源代码/.vs/StgSharpDevelop/v17/ipch/AutoPCH/9c607adfb7a4128e/STGSHARPC.ipch b/源代码/.vs/StgSharpDevelop/v17/ipch/AutoPCH/9c607adfb7a4128e/STGSHARPC.ipch deleted file mode 100644 index 70d3a9f7..00000000 Binary files a/源代码/.vs/StgSharpDevelop/v17/ipch/AutoPCH/9c607adfb7a4128e/STGSHARPC.ipch and /dev/null differ diff --git a/源代码/.vs/StgSharpDevelop/v17/ipch/AutoPCH/bfa604662193d2a/GLSC2.ipch b/源代码/.vs/StgSharpDevelop/v17/ipch/AutoPCH/bfa604662193d2a/GLSC2.ipch new file mode 100644 index 00000000..0e723006 Binary files /dev/null and b/源代码/.vs/StgSharpDevelop/v17/ipch/AutoPCH/bfa604662193d2a/GLSC2.ipch differ diff --git a/源代码/BenchMark/Program.cs b/源代码/BenchMark/Program.cs index 185e6656..8ac71296 100644 --- a/源代码/BenchMark/Program.cs +++ b/源代码/BenchMark/Program.cs @@ -14,13 +14,8 @@ namespace BenchMark static void Main(string[] args) { - uint[] array = new uint[] { 0, 10, 2, 3 }; - - fixed (uint* ptr = array) - { - IntPtr p = (IntPtr)ptr; - Console.WriteLine(*((uint*)p + 1)); - } + TypeCode c = TypeCode.Int32; + Console.WriteLine(c); } } diff --git a/源代码/BenchMark/bin/Release/net6.0/BenchMark.deps.json b/源代码/BenchMark/bin/Release/net6.0/BenchMark.deps.json deleted file mode 100644 index 940d921f..00000000 --- a/源代码/BenchMark/bin/Release/net6.0/BenchMark.deps.json +++ /dev/null @@ -1,694 +0,0 @@ -{ - "runtimeTarget": { - "name": ".NETCoreApp,Version=v6.0", - "signature": "" - }, - "compilationOptions": {}, - "targets": { - ".NETCoreApp,Version=v6.0": { - "BenchMark/1.0.0": { - "dependencies": { - "BenchmarkDotNet": "0.13.12" - }, - "runtime": { - "BenchMark.dll": {} - } - }, - "BenchmarkDotNet/0.13.12": { - "dependencies": { - "BenchmarkDotNet.Annotations": "0.13.12", - "CommandLineParser": "2.9.1", - "Gee.External.Capstone": "2.3.0", - "Iced": "1.17.0", - "Microsoft.CodeAnalysis.CSharp": "4.1.0", - "Microsoft.Diagnostics.Runtime": "2.2.332302", - "Microsoft.Diagnostics.Tracing.TraceEvent": "3.0.2", - "Microsoft.DotNet.PlatformAbstractions": "3.1.6", - "Perfolizer": "0.2.1", - "System.Management": "5.0.0" - }, - "runtime": { - "lib/net6.0/BenchmarkDotNet.dll": { - "assemblyVersion": "0.13.12.0", - "fileVersion": "0.13.12.0" - } - } - }, - "BenchmarkDotNet.Annotations/0.13.12": { - "runtime": { - "lib/netstandard2.0/BenchmarkDotNet.Annotations.dll": { - "assemblyVersion": "0.13.12.0", - "fileVersion": "0.13.12.0" - } - } - }, - "CommandLineParser/2.9.1": { - "runtime": { - "lib/netstandard2.0/CommandLine.dll": { - "assemblyVersion": "2.9.1.0", - "fileVersion": "2.9.1.0" - } - } - }, - "Gee.External.Capstone/2.3.0": { - "runtime": { - "lib/net6.0/Gee.External.Capstone.dll": { - "assemblyVersion": "2.3.0.0", - "fileVersion": "2.3.0.0" - } - }, - "runtimeTargets": { - "runtimes/linux-arm/native/libcapstone.so": { - "rid": "linux-arm", - "assetType": "native", - "fileVersion": "0.0.0.0" - }, - "runtimes/linux-arm64/native/libcapstone.so": { - "rid": "linux-arm64", - "assetType": "native", - "fileVersion": "0.0.0.0" - }, - "runtimes/linux-x64/native/libcapstone.so": { - "rid": "linux-x64", - "assetType": "native", - "fileVersion": "0.0.0.0" - }, - "runtimes/linux-x86/native/libcapstone.so": { - "rid": "linux-x86", - "assetType": "native", - "fileVersion": "0.0.0.0" - }, - "runtimes/osx-arm64/native/libcapstone.dylib": { - "rid": "osx-arm64", - "assetType": "native", - "fileVersion": "0.0.0.0" - }, - "runtimes/osx-x64/native/libcapstone.dylib": { - "rid": "osx-x64", - "assetType": "native", - "fileVersion": "0.0.0.0" - }, - "runtimes/win-arm64/native/capstone.dll": { - "rid": "win-arm64", - "assetType": "native", - "fileVersion": "0.0.0.0" - }, - "runtimes/win-x64/native/capstone.dll": { - "rid": "win-x64", - "assetType": "native", - "fileVersion": "0.0.0.0" - }, - "runtimes/win-x86/native/capstone.dll": { - "rid": "win-x86", - "assetType": "native", - "fileVersion": "0.0.0.0" - } - } - }, - "Iced/1.17.0": { - "runtime": { - "lib/netstandard2.1/Iced.dll": { - "assemblyVersion": "1.17.0.0", - "fileVersion": "1.17.0.0" - } - } - }, - "Microsoft.Bcl.AsyncInterfaces/1.1.0": { - "runtime": { - "lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll": { - "assemblyVersion": "1.0.0.0", - "fileVersion": "4.700.19.56404" - } - } - }, - "Microsoft.CodeAnalysis.Analyzers/3.3.3": {}, - "Microsoft.CodeAnalysis.Common/4.1.0": { - "dependencies": { - "Microsoft.CodeAnalysis.Analyzers": "3.3.3", - "System.Collections.Immutable": "5.0.0", - "System.Memory": "4.5.4", - "System.Reflection.Metadata": "5.0.0", - "System.Runtime.CompilerServices.Unsafe": "5.0.0", - "System.Text.Encoding.CodePages": "4.5.1", - "System.Threading.Tasks.Extensions": "4.5.4" - }, - "runtime": { - "lib/netcoreapp3.1/Microsoft.CodeAnalysis.dll": { - "assemblyVersion": "4.1.0.0", - "fileVersion": "4.100.22.11411" - } - }, - "resources": { - "lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.resources.dll": { - "locale": "cs" - }, - "lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.resources.dll": { - "locale": "de" - }, - "lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.resources.dll": { - "locale": "es" - }, - "lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.resources.dll": { - "locale": "fr" - }, - "lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.resources.dll": { - "locale": "it" - }, - "lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.resources.dll": { - "locale": "ja" - }, - "lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.resources.dll": { - "locale": "ko" - }, - "lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.resources.dll": { - "locale": "pl" - }, - "lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.resources.dll": { - "locale": "pt-BR" - }, - "lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.resources.dll": { - "locale": "ru" - }, - "lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.resources.dll": { - "locale": "tr" - }, - "lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.resources.dll": { - "locale": "zh-Hans" - }, - "lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.resources.dll": { - "locale": "zh-Hant" - } - } - }, - "Microsoft.CodeAnalysis.CSharp/4.1.0": { - "dependencies": { - "Microsoft.CodeAnalysis.Common": "4.1.0" - }, - "runtime": { - "lib/netcoreapp3.1/Microsoft.CodeAnalysis.CSharp.dll": { - "assemblyVersion": "4.1.0.0", - "fileVersion": "4.100.22.11411" - } - }, - "resources": { - "lib/netcoreapp3.1/cs/Microsoft.CodeAnalysis.CSharp.resources.dll": { - "locale": "cs" - }, - "lib/netcoreapp3.1/de/Microsoft.CodeAnalysis.CSharp.resources.dll": { - "locale": "de" - }, - "lib/netcoreapp3.1/es/Microsoft.CodeAnalysis.CSharp.resources.dll": { - "locale": "es" - }, - "lib/netcoreapp3.1/fr/Microsoft.CodeAnalysis.CSharp.resources.dll": { - "locale": "fr" - }, - "lib/netcoreapp3.1/it/Microsoft.CodeAnalysis.CSharp.resources.dll": { - "locale": "it" - }, - "lib/netcoreapp3.1/ja/Microsoft.CodeAnalysis.CSharp.resources.dll": { - "locale": "ja" - }, - "lib/netcoreapp3.1/ko/Microsoft.CodeAnalysis.CSharp.resources.dll": { - "locale": "ko" - }, - "lib/netcoreapp3.1/pl/Microsoft.CodeAnalysis.CSharp.resources.dll": { - "locale": "pl" - }, - "lib/netcoreapp3.1/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll": { - "locale": "pt-BR" - }, - "lib/netcoreapp3.1/ru/Microsoft.CodeAnalysis.CSharp.resources.dll": { - "locale": "ru" - }, - "lib/netcoreapp3.1/tr/Microsoft.CodeAnalysis.CSharp.resources.dll": { - "locale": "tr" - }, - "lib/netcoreapp3.1/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll": { - "locale": "zh-Hans" - }, - "lib/netcoreapp3.1/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll": { - "locale": "zh-Hant" - } - } - }, - "Microsoft.Diagnostics.NETCore.Client/0.2.251802": { - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0", - "Microsoft.Extensions.Logging": "2.1.1" - }, - "runtime": { - "lib/netcoreapp3.1/Microsoft.Diagnostics.NETCore.Client.dll": { - "assemblyVersion": "0.2.5.1802", - "fileVersion": "0.2.5.1802" - } - } - }, - "Microsoft.Diagnostics.Runtime/2.2.332302": { - "dependencies": { - "Microsoft.Diagnostics.NETCore.Client": "0.2.251802", - "System.Collections.Immutable": "5.0.0", - "System.Runtime.CompilerServices.Unsafe": "5.0.0" - }, - "runtime": { - "lib/net6.0/Microsoft.Diagnostics.Runtime.dll": { - "assemblyVersion": "2.2.6.32302", - "fileVersion": "2.2.6.32302" - } - } - }, - "Microsoft.Diagnostics.Tracing.TraceEvent/3.0.2": { - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "5.0.0" - }, - "runtime": { - "lib/netstandard2.0/Dia2Lib.dll": { - "assemblyVersion": "2.0.0.0", - "fileVersion": "2.0.0.0" - }, - "lib/netstandard2.0/Microsoft.Diagnostics.FastSerialization.dll": { - "assemblyVersion": "3.0.2.0", - "fileVersion": "3.0.2.0" - }, - "lib/netstandard2.0/Microsoft.Diagnostics.Tracing.TraceEvent.dll": { - "assemblyVersion": "3.0.2.0", - "fileVersion": "3.0.2.0" - }, - "lib/netstandard2.0/OSExtensions.dll": { - "assemblyVersion": "1.0.0.0", - "fileVersion": "1.0.0.0" - }, - "lib/netstandard2.0/TraceReloggerLib.dll": { - "assemblyVersion": "0.0.0.0", - "fileVersion": "0.0.0.0" - } - } - }, - "Microsoft.DotNet.PlatformAbstractions/3.1.6": { - "runtime": { - "lib/netstandard2.0/Microsoft.DotNet.PlatformAbstractions.dll": { - "assemblyVersion": "3.1.6.0", - "fileVersion": "3.100.620.31604" - } - } - }, - "Microsoft.Extensions.Configuration/2.1.1": { - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "2.1.1" - }, - "runtime": { - "lib/netstandard2.0/Microsoft.Extensions.Configuration.dll": { - "assemblyVersion": "2.1.1.0", - "fileVersion": "2.1.1.18157" - } - } - }, - "Microsoft.Extensions.Configuration.Abstractions/2.1.1": { - "dependencies": { - "Microsoft.Extensions.Primitives": "2.1.1" - }, - "runtime": { - "lib/netstandard2.0/Microsoft.Extensions.Configuration.Abstractions.dll": { - "assemblyVersion": "2.1.1.0", - "fileVersion": "2.1.1.18157" - } - } - }, - "Microsoft.Extensions.Configuration.Binder/2.1.1": { - "dependencies": { - "Microsoft.Extensions.Configuration": "2.1.1" - }, - "runtime": { - "lib/netstandard2.0/Microsoft.Extensions.Configuration.Binder.dll": { - "assemblyVersion": "2.1.1.0", - "fileVersion": "2.1.1.18157" - } - } - }, - "Microsoft.Extensions.DependencyInjection.Abstractions/2.1.1": { - "runtime": { - "lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": { - "assemblyVersion": "2.1.1.0", - "fileVersion": "2.1.1.18157" - } - } - }, - "Microsoft.Extensions.Logging/2.1.1": { - "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "2.1.1", - "Microsoft.Extensions.DependencyInjection.Abstractions": "2.1.1", - "Microsoft.Extensions.Logging.Abstractions": "2.1.1", - "Microsoft.Extensions.Options": "2.1.1" - }, - "runtime": { - "lib/netstandard2.0/Microsoft.Extensions.Logging.dll": { - "assemblyVersion": "2.1.1.0", - "fileVersion": "2.1.1.18157" - } - } - }, - "Microsoft.Extensions.Logging.Abstractions/2.1.1": { - "runtime": { - "lib/netstandard2.0/Microsoft.Extensions.Logging.Abstractions.dll": { - "assemblyVersion": "2.1.1.0", - "fileVersion": "2.1.1.18157" - } - } - }, - "Microsoft.Extensions.Options/2.1.1": { - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "2.1.1", - "Microsoft.Extensions.Primitives": "2.1.1" - }, - "runtime": { - "lib/netstandard2.0/Microsoft.Extensions.Options.dll": { - "assemblyVersion": "2.1.1.0", - "fileVersion": "2.1.1.18157" - } - } - }, - "Microsoft.Extensions.Primitives/2.1.1": { - "dependencies": { - "System.Memory": "4.5.4", - "System.Runtime.CompilerServices.Unsafe": "5.0.0" - }, - "runtime": { - "lib/netstandard2.0/Microsoft.Extensions.Primitives.dll": { - "assemblyVersion": "2.1.1.0", - "fileVersion": "2.1.1.18157" - } - } - }, - "Microsoft.NETCore.Platforms/5.0.0": {}, - "Microsoft.Win32.Registry/5.0.0": { - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "Perfolizer/0.2.1": { - "dependencies": { - "System.Memory": "4.5.4" - }, - "runtime": { - "lib/netstandard2.0/Perfolizer.dll": { - "assemblyVersion": "0.2.1.0", - "fileVersion": "0.2.1.0" - } - } - }, - "System.CodeDom/5.0.0": { - "runtime": { - "lib/netstandard2.0/System.CodeDom.dll": { - "assemblyVersion": "5.0.0.0", - "fileVersion": "5.0.20.51904" - } - } - }, - "System.Collections.Immutable/5.0.0": {}, - "System.Management/5.0.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "5.0.0", - "Microsoft.Win32.Registry": "5.0.0", - "System.CodeDom": "5.0.0" - }, - "runtime": { - "lib/netstandard2.0/System.Management.dll": { - "assemblyVersion": "4.0.0.0", - "fileVersion": "5.0.20.51904" - } - }, - "runtimeTargets": { - "runtimes/win/lib/netcoreapp2.0/System.Management.dll": { - "rid": "win", - "assetType": "runtime", - "assemblyVersion": "4.0.0.0", - "fileVersion": "5.0.20.51904" - } - } - }, - "System.Memory/4.5.4": {}, - "System.Reflection.Metadata/5.0.0": {}, - "System.Runtime.CompilerServices.Unsafe/5.0.0": {}, - "System.Security.AccessControl/5.0.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows/5.0.0": {}, - "System.Text.Encoding.CodePages/4.5.1": { - "dependencies": { - "Microsoft.NETCore.Platforms": "5.0.0", - "System.Runtime.CompilerServices.Unsafe": "5.0.0" - } - }, - "System.Threading.Tasks.Extensions/4.5.4": {} - } - }, - "libraries": { - "BenchMark/1.0.0": { - "type": "project", - "serviceable": false, - "sha512": "" - }, - "BenchmarkDotNet/0.13.12": { - "type": "package", - "serviceable": true, - "sha512": "sha512-aKnzpUZJJfLBHG7zcfQZhCexZQKcJgElC8qcFUTXPMYFlVauJBobuOmtRnmrapqC2j7EjjZCsPxa3yLvFLx5/Q==", - "path": "benchmarkdotnet/0.13.12", - "hashPath": "benchmarkdotnet.0.13.12.nupkg.sha512" - }, - "BenchmarkDotNet.Annotations/0.13.12": { - "type": "package", - "serviceable": true, - "sha512": "sha512-4zmFOOJqW1GrEP/t5XKgh97LH9r6zixGy2IA0JAaoTNNnZ8kPBt9u/XagsGNyV0e7rglOpFcWc6wI5EjefKpKA==", - "path": "benchmarkdotnet.annotations/0.13.12", - "hashPath": "benchmarkdotnet.annotations.0.13.12.nupkg.sha512" - }, - "CommandLineParser/2.9.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-OE0sl1/sQ37bjVsPKKtwQlWDgqaxWgtme3xZz7JssWUzg5JpMIyHgCTY9MVMxOg48fJ1AgGT3tgdH5m/kQ5xhA==", - "path": "commandlineparser/2.9.1", - "hashPath": "commandlineparser.2.9.1.nupkg.sha512" - }, - "Gee.External.Capstone/2.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-2ap/rYmjtzCOT8hxrnEW/QeiOt+paD8iRrIcdKX0cxVwWLFa1e+JDBNeECakmccXrSFeBQuu5AV8SNkipFMMMw==", - "path": "gee.external.capstone/2.3.0", - "hashPath": "gee.external.capstone.2.3.0.nupkg.sha512" - }, - "Iced/1.17.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-8x+HCVTl/HHTGpscH3vMBhV8sknN/muZFw9s3TsI8SA6+c43cOTCi2+jE4KsU8pNLbJ++iF2ZFcpcXHXtDglnw==", - "path": "iced/1.17.0", - "hashPath": "iced.1.17.0.nupkg.sha512" - }, - "Microsoft.Bcl.AsyncInterfaces/1.1.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-1Am6l4Vpn3/K32daEqZI+FFr96OlZkgwK2LcT3pZ2zWubR5zTPW3/FkO1Rat9kb7oQOa4rxgl9LJHc5tspCWfg==", - "path": "microsoft.bcl.asyncinterfaces/1.1.0", - "hashPath": "microsoft.bcl.asyncinterfaces.1.1.0.nupkg.sha512" - }, - "Microsoft.CodeAnalysis.Analyzers/3.3.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-j/rOZtLMVJjrfLRlAMckJLPW/1rze9MT1yfWqSIbUPGRu1m1P0fuo9PmqapwsmePfGB5PJrudQLvmUOAMF0DqQ==", - "path": "microsoft.codeanalysis.analyzers/3.3.3", - "hashPath": "microsoft.codeanalysis.analyzers.3.3.3.nupkg.sha512" - }, - "Microsoft.CodeAnalysis.Common/4.1.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-bNzTyxP3iD5FPFHfVDl15Y6/wSoI7e3MeV0lOaj9igbIKTjgrmuw6LoVJ06jUNFA7+KaDC/OIsStWl/FQJz6sQ==", - "path": "microsoft.codeanalysis.common/4.1.0", - "hashPath": "microsoft.codeanalysis.common.4.1.0.nupkg.sha512" - }, - "Microsoft.CodeAnalysis.CSharp/4.1.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-sbu6kDGzo9bfQxuqWpeEE7I9P30bSuZEnpDz9/qz20OU6pm79Z63+/BsAzO2e/R/Q97kBrpj647wokZnEVr97w==", - "path": "microsoft.codeanalysis.csharp/4.1.0", - "hashPath": "microsoft.codeanalysis.csharp.4.1.0.nupkg.sha512" - }, - "Microsoft.Diagnostics.NETCore.Client/0.2.251802": { - "type": "package", - "serviceable": true, - "sha512": "sha512-bqnYl6AdSeboeN4v25hSukK6Odm6/54E3Y2B8rBvgqvAW0mF8fo7XNRVE2DMOG7Rk0fiuA079QIH28+V+W1Zdg==", - "path": "microsoft.diagnostics.netcore.client/0.2.251802", - "hashPath": "microsoft.diagnostics.netcore.client.0.2.251802.nupkg.sha512" - }, - "Microsoft.Diagnostics.Runtime/2.2.332302": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Hp84ivxSKIMTBzYSATxmUsm3YSXHWivcwiRRbsydGmqujMUK8BAueLN0ssAVEOkOBmh0vjUBhrq7YcroT7VCug==", - "path": "microsoft.diagnostics.runtime/2.2.332302", - "hashPath": "microsoft.diagnostics.runtime.2.2.332302.nupkg.sha512" - }, - "Microsoft.Diagnostics.Tracing.TraceEvent/3.0.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Pr7t+Z/qBe6DxCow4BmYmDycHe2MrGESaflWXRcSUI4XNGyznx1ttS+9JNOxLuBZSoBSPTKw9Dyheo01Yi6anQ==", - "path": "microsoft.diagnostics.tracing.traceevent/3.0.2", - "hashPath": "microsoft.diagnostics.tracing.traceevent.3.0.2.nupkg.sha512" - }, - "Microsoft.DotNet.PlatformAbstractions/3.1.6": { - "type": "package", - "serviceable": true, - "sha512": "sha512-jek4XYaQ/PGUwDKKhwR8K47Uh1189PFzMeLqO83mXrXQVIpARZCcfuDedH50YDTepBkfijCZN5U/vZi++erxtg==", - "path": "microsoft.dotnet.platformabstractions/3.1.6", - "hashPath": "microsoft.dotnet.platformabstractions.3.1.6.nupkg.sha512" - }, - "Microsoft.Extensions.Configuration/2.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-LjVKO6P2y52c5ZhTLX/w8zc5H4Y3J/LJsgqTBj49TtFq/hAtVNue/WA0F6/7GMY90xhD7K0MDZ4qpOeWXbLvzg==", - "path": "microsoft.extensions.configuration/2.1.1", - "hashPath": "microsoft.extensions.configuration.2.1.1.nupkg.sha512" - }, - "Microsoft.Extensions.Configuration.Abstractions/2.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-VfuZJNa0WUshZ/+8BFZAhwFKiKuu/qOUCFntfdLpHj7vcRnsGHqd3G2Hse78DM+pgozczGM63lGPRLmy+uhUOA==", - "path": "microsoft.extensions.configuration.abstractions/2.1.1", - "hashPath": "microsoft.extensions.configuration.abstractions.2.1.1.nupkg.sha512" - }, - "Microsoft.Extensions.Configuration.Binder/2.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-fcLCTS03poWE4v9tSNBr3pWn0QwGgAn1vzqHXlXgvqZeOc7LvQNzaWcKRQZTdEc3+YhQKwMsOtm3VKSA2aWQ8w==", - "path": "microsoft.extensions.configuration.binder/2.1.1", - "hashPath": "microsoft.extensions.configuration.binder.2.1.1.nupkg.sha512" - }, - "Microsoft.Extensions.DependencyInjection.Abstractions/2.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-MgYpU5cwZohUMKKg3sbPhvGG+eAZ/59E9UwPwlrUkyXU+PGzqwZg9yyQNjhxuAWmoNoFReoemeCku50prYSGzA==", - "path": "microsoft.extensions.dependencyinjection.abstractions/2.1.1", - "hashPath": "microsoft.extensions.dependencyinjection.abstractions.2.1.1.nupkg.sha512" - }, - "Microsoft.Extensions.Logging/2.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-hh+mkOAQDTp6XH80xJt3+wwYVzkbwYQl9XZRCz4Um0JjP/o7N9vHM3rZ6wwwtr+BBe/L6iBO2sz0px6OWBzqZQ==", - "path": "microsoft.extensions.logging/2.1.1", - "hashPath": "microsoft.extensions.logging.2.1.1.nupkg.sha512" - }, - "Microsoft.Extensions.Logging.Abstractions/2.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-XRzK7ZF+O6FzdfWrlFTi1Rgj2080ZDsd46vzOjadHUB0Cz5kOvDG8vI7caa5YFrsHQpcfn0DxtjS4E46N4FZsA==", - "path": "microsoft.extensions.logging.abstractions/2.1.1", - "hashPath": "microsoft.extensions.logging.abstractions.2.1.1.nupkg.sha512" - }, - "Microsoft.Extensions.Options/2.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-V7lXCU78lAbzaulCGFKojcCyG8RTJicEbiBkPJjFqiqXwndEBBIehdXRMWEVU3UtzQ1yDvphiWUL9th6/4gJ7w==", - "path": "microsoft.extensions.options/2.1.1", - "hashPath": "microsoft.extensions.options.2.1.1.nupkg.sha512" - }, - "Microsoft.Extensions.Primitives/2.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-scJ1GZNIxMmjpENh0UZ8XCQ6vzr/LzeF9WvEA51Ix2OQGAs9WPgPu8ABVUdvpKPLuor/t05gm6menJK3PwqOXg==", - "path": "microsoft.extensions.primitives/2.1.1", - "hashPath": "microsoft.extensions.primitives.2.1.1.nupkg.sha512" - }, - "Microsoft.NETCore.Platforms/5.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==", - "path": "microsoft.netcore.platforms/5.0.0", - "hashPath": "microsoft.netcore.platforms.5.0.0.nupkg.sha512" - }, - "Microsoft.Win32.Registry/5.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "path": "microsoft.win32.registry/5.0.0", - "hashPath": "microsoft.win32.registry.5.0.0.nupkg.sha512" - }, - "Perfolizer/0.2.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Dt4aCxCT8NPtWBKA8k+FsN/RezOQ2C6omNGm5o/qmYRiIwlQYF93UgFmeF1ezVNsztTnkg7P5P63AE+uNkLfrw==", - "path": "perfolizer/0.2.1", - "hashPath": "perfolizer.0.2.1.nupkg.sha512" - }, - "System.CodeDom/5.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-JPJArwA1kdj8qDAkY2XGjSWoYnqiM7q/3yRNkt6n28Mnn95MuEGkZXUbPBf7qc3IjwrGY5ttQon7yqHZyQJmOQ==", - "path": "system.codedom/5.0.0", - "hashPath": "system.codedom.5.0.0.nupkg.sha512" - }, - "System.Collections.Immutable/5.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-FXkLXiK0sVVewcso0imKQoOxjoPAj42R8HtjjbSjVPAzwDfzoyoznWxgA3c38LDbN9SJux1xXoXYAhz98j7r2g==", - "path": "system.collections.immutable/5.0.0", - "hashPath": "system.collections.immutable.5.0.0.nupkg.sha512" - }, - "System.Management/5.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-MF1CHaRcC+MLFdnDthv4/bKWBZnlnSpkGqa87pKukQefgEdwtb9zFW6zs0GjPp73qtpYYg4q6PEKbzJbxCpKfw==", - "path": "system.management/5.0.0", - "hashPath": "system.management.5.0.0.nupkg.sha512" - }, - "System.Memory/4.5.4": { - "type": "package", - "serviceable": true, - "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", - "path": "system.memory/4.5.4", - "hashPath": "system.memory.4.5.4.nupkg.sha512" - }, - "System.Reflection.Metadata/5.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-5NecZgXktdGg34rh1OenY1rFNDCI8xSjFr+Z4OU4cU06AQHUdRnIIEeWENu3Wl4YowbzkymAIMvi3WyK9U53pQ==", - "path": "system.reflection.metadata/5.0.0", - "hashPath": "system.reflection.metadata.5.0.0.nupkg.sha512" - }, - "System.Runtime.CompilerServices.Unsafe/5.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==", - "path": "system.runtime.compilerservices.unsafe/5.0.0", - "hashPath": "system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512" - }, - "System.Security.AccessControl/5.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "path": "system.security.accesscontrol/5.0.0", - "hashPath": "system.security.accesscontrol.5.0.0.nupkg.sha512" - }, - "System.Security.Principal.Windows/5.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", - "path": "system.security.principal.windows/5.0.0", - "hashPath": "system.security.principal.windows.5.0.0.nupkg.sha512" - }, - "System.Text.Encoding.CodePages/4.5.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-4J2JQXbftjPMppIHJ7IC+VXQ9XfEagN92vZZNoG12i+zReYlim5dMoXFC1Zzg7tsnKDM7JPo5bYfFK4Jheq44w==", - "path": "system.text.encoding.codepages/4.5.1", - "hashPath": "system.text.encoding.codepages.4.5.1.nupkg.sha512" - }, - "System.Threading.Tasks.Extensions/4.5.4": { - "type": "package", - "serviceable": true, - "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", - "path": "system.threading.tasks.extensions/4.5.4", - "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" - } - } -} \ No newline at end of file diff --git a/源代码/BenchMark/bin/Release/net6.0/BenchMark.dll b/源代码/BenchMark/bin/Release/net6.0/BenchMark.dll deleted file mode 100644 index 6fe78566..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/BenchMark.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/BenchMark.exe b/源代码/BenchMark/bin/Release/net6.0/BenchMark.exe deleted file mode 100644 index 9403f766..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/BenchMark.exe and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/BenchMark.pdb b/源代码/BenchMark/bin/Release/net6.0/BenchMark.pdb deleted file mode 100644 index ceb6515c..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/BenchMark.pdb and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/BenchMark.runtimeconfig.json b/源代码/BenchMark/bin/Release/net6.0/BenchMark.runtimeconfig.json deleted file mode 100644 index e7b3b03d..00000000 --- a/源代码/BenchMark/bin/Release/net6.0/BenchMark.runtimeconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "runtimeOptions": { - "tfm": "net6.0", - "framework": { - "name": "Microsoft.NETCore.App", - "version": "6.0.0" - }, - "configProperties": { - "System.Reflection.Metadata.MetadataUpdater.IsSupported": false - } - } -} \ No newline at end of file diff --git a/源代码/BenchMark/bin/Release/net6.0/BenchmarkDotNet.Annotations.dll b/源代码/BenchMark/bin/Release/net6.0/BenchmarkDotNet.Annotations.dll deleted file mode 100644 index 6ea42361..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/BenchmarkDotNet.Annotations.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/BenchmarkDotNet.dll b/源代码/BenchMark/bin/Release/net6.0/BenchmarkDotNet.dll deleted file mode 100644 index 7d9a613b..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/BenchmarkDotNet.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/CommandLine.dll b/源代码/BenchMark/bin/Release/net6.0/CommandLine.dll deleted file mode 100644 index 3eab2be2..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/CommandLine.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Dia2Lib.dll b/源代码/BenchMark/bin/Release/net6.0/Dia2Lib.dll deleted file mode 100644 index 68b11b65..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Dia2Lib.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Gee.External.Capstone.dll b/源代码/BenchMark/bin/Release/net6.0/Gee.External.Capstone.dll deleted file mode 100644 index 035e1483..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Gee.External.Capstone.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Iced.dll b/源代码/BenchMark/bin/Release/net6.0/Iced.dll deleted file mode 100644 index bc4d149d..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Iced.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Bcl.AsyncInterfaces.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.Bcl.AsyncInterfaces.dll deleted file mode 100644 index c695bdd5..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Bcl.AsyncInterfaces.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.CodeAnalysis.CSharp.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.CodeAnalysis.CSharp.dll deleted file mode 100644 index 5a19219a..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.CodeAnalysis.CSharp.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.CodeAnalysis.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.CodeAnalysis.dll deleted file mode 100644 index 6fbab494..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.CodeAnalysis.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Diagnostics.FastSerialization.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.Diagnostics.FastSerialization.dll deleted file mode 100644 index e207037a..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Diagnostics.FastSerialization.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Diagnostics.NETCore.Client.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.Diagnostics.NETCore.Client.dll deleted file mode 100644 index 90f1f99f..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Diagnostics.NETCore.Client.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Diagnostics.Runtime.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.Diagnostics.Runtime.dll deleted file mode 100644 index b6bf84cd..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Diagnostics.Runtime.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Diagnostics.Tracing.TraceEvent.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.Diagnostics.Tracing.TraceEvent.dll deleted file mode 100644 index 23118e81..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Diagnostics.Tracing.TraceEvent.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.DotNet.PlatformAbstractions.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.DotNet.PlatformAbstractions.dll deleted file mode 100644 index 558229b6..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.DotNet.PlatformAbstractions.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Configuration.Abstractions.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Configuration.Abstractions.dll deleted file mode 100644 index 80d73edd..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Configuration.Abstractions.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Configuration.Binder.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Configuration.Binder.dll deleted file mode 100644 index 2415b679..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Configuration.Binder.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Configuration.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Configuration.dll deleted file mode 100644 index aa1f010c..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Configuration.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll deleted file mode 100644 index 7d8769b8..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Logging.Abstractions.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Logging.Abstractions.dll deleted file mode 100644 index 98b2019d..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Logging.Abstractions.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Logging.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Logging.dll deleted file mode 100644 index 662d975f..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Logging.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Options.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Options.dll deleted file mode 100644 index 065d0157..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Options.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Primitives.dll b/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Primitives.dll deleted file mode 100644 index 1999bace..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Microsoft.Extensions.Primitives.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/OSExtensions.dll b/源代码/BenchMark/bin/Release/net6.0/OSExtensions.dll deleted file mode 100644 index 49d7a56f..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/OSExtensions.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/Perfolizer.dll b/源代码/BenchMark/bin/Release/net6.0/Perfolizer.dll deleted file mode 100644 index 27947cc5..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/Perfolizer.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/System.CodeDom.dll b/源代码/BenchMark/bin/Release/net6.0/System.CodeDom.dll deleted file mode 100644 index 873495d3..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/System.CodeDom.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/System.Management.dll b/源代码/BenchMark/bin/Release/net6.0/System.Management.dll deleted file mode 100644 index c3a0320e..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/System.Management.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/TraceReloggerLib.dll b/源代码/BenchMark/bin/Release/net6.0/TraceReloggerLib.dll deleted file mode 100644 index 1a8280b9..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/TraceReloggerLib.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/amd64/KernelTraceControl.dll b/源代码/BenchMark/bin/Release/net6.0/amd64/KernelTraceControl.dll deleted file mode 100644 index 9a96bc79..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/amd64/KernelTraceControl.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/amd64/msdia140.dll b/源代码/BenchMark/bin/Release/net6.0/amd64/msdia140.dll deleted file mode 100644 index 9d280f50..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/amd64/msdia140.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/amd64/msvcp140.dll b/源代码/BenchMark/bin/Release/net6.0/amd64/msvcp140.dll deleted file mode 100644 index b12c9085..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/amd64/msvcp140.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/amd64/vcruntime140.dll b/源代码/BenchMark/bin/Release/net6.0/amd64/vcruntime140.dll deleted file mode 100644 index 63e4eba7..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/amd64/vcruntime140.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/amd64/vcruntime140_1.dll b/源代码/BenchMark/bin/Release/net6.0/amd64/vcruntime140_1.dll deleted file mode 100644 index 6230c020..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/amd64/vcruntime140_1.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/arm64/KernelTraceControl.dll b/源代码/BenchMark/bin/Release/net6.0/arm64/KernelTraceControl.dll deleted file mode 100644 index 2ca64281..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/arm64/KernelTraceControl.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/arm64/msdia140.dll b/源代码/BenchMark/bin/Release/net6.0/arm64/msdia140.dll deleted file mode 100644 index b34eb25f..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/arm64/msdia140.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/arm64/msvcp140.dll b/源代码/BenchMark/bin/Release/net6.0/arm64/msvcp140.dll deleted file mode 100644 index 56cacc4e..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/arm64/msvcp140.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/arm64/vcruntime140.dll b/源代码/BenchMark/bin/Release/net6.0/arm64/vcruntime140.dll deleted file mode 100644 index 24f202aa..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/arm64/vcruntime140.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/arm64/vcruntime140_1.dll b/源代码/BenchMark/bin/Release/net6.0/arm64/vcruntime140_1.dll deleted file mode 100644 index 66492fba..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/arm64/vcruntime140_1.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll b/源代码/BenchMark/bin/Release/net6.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll deleted file mode 100644 index c5e5708c..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/cs/Microsoft.CodeAnalysis.resources.dll b/源代码/BenchMark/bin/Release/net6.0/cs/Microsoft.CodeAnalysis.resources.dll deleted file mode 100644 index b620565d..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/cs/Microsoft.CodeAnalysis.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll b/源代码/BenchMark/bin/Release/net6.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll deleted file mode 100644 index 87be0062..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/de/Microsoft.CodeAnalysis.resources.dll b/源代码/BenchMark/bin/Release/net6.0/de/Microsoft.CodeAnalysis.resources.dll deleted file mode 100644 index 859490d8..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/de/Microsoft.CodeAnalysis.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll b/源代码/BenchMark/bin/Release/net6.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll deleted file mode 100644 index e868e23e..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/es/Microsoft.CodeAnalysis.resources.dll b/源代码/BenchMark/bin/Release/net6.0/es/Microsoft.CodeAnalysis.resources.dll deleted file mode 100644 index f57cafe2..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/es/Microsoft.CodeAnalysis.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll b/源代码/BenchMark/bin/Release/net6.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll deleted file mode 100644 index adccb684..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/fr/Microsoft.CodeAnalysis.resources.dll b/源代码/BenchMark/bin/Release/net6.0/fr/Microsoft.CodeAnalysis.resources.dll deleted file mode 100644 index 56d66a02..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/fr/Microsoft.CodeAnalysis.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll b/源代码/BenchMark/bin/Release/net6.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll deleted file mode 100644 index c0c8ba59..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/it/Microsoft.CodeAnalysis.resources.dll b/源代码/BenchMark/bin/Release/net6.0/it/Microsoft.CodeAnalysis.resources.dll deleted file mode 100644 index e4cb7cb4..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/it/Microsoft.CodeAnalysis.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll b/源代码/BenchMark/bin/Release/net6.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll deleted file mode 100644 index a73426e8..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/ja/Microsoft.CodeAnalysis.resources.dll b/源代码/BenchMark/bin/Release/net6.0/ja/Microsoft.CodeAnalysis.resources.dll deleted file mode 100644 index 98b55744..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/ja/Microsoft.CodeAnalysis.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll b/源代码/BenchMark/bin/Release/net6.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll deleted file mode 100644 index ac308094..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/ko/Microsoft.CodeAnalysis.resources.dll b/源代码/BenchMark/bin/Release/net6.0/ko/Microsoft.CodeAnalysis.resources.dll deleted file mode 100644 index 516c840d..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/ko/Microsoft.CodeAnalysis.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll b/源代码/BenchMark/bin/Release/net6.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll deleted file mode 100644 index c3d1e3ef..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/pl/Microsoft.CodeAnalysis.resources.dll b/源代码/BenchMark/bin/Release/net6.0/pl/Microsoft.CodeAnalysis.resources.dll deleted file mode 100644 index fd7a08aa..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/pl/Microsoft.CodeAnalysis.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll b/源代码/BenchMark/bin/Release/net6.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll deleted file mode 100644 index eca37ce3..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/pt-BR/Microsoft.CodeAnalysis.resources.dll b/源代码/BenchMark/bin/Release/net6.0/pt-BR/Microsoft.CodeAnalysis.resources.dll deleted file mode 100644 index 9723ccce..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/pt-BR/Microsoft.CodeAnalysis.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll b/源代码/BenchMark/bin/Release/net6.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll deleted file mode 100644 index 1c58cdda..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/ru/Microsoft.CodeAnalysis.resources.dll b/源代码/BenchMark/bin/Release/net6.0/ru/Microsoft.CodeAnalysis.resources.dll deleted file mode 100644 index f60218d8..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/ru/Microsoft.CodeAnalysis.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/runtimes/linux-arm/native/libcapstone.so b/源代码/BenchMark/bin/Release/net6.0/runtimes/linux-arm/native/libcapstone.so deleted file mode 100644 index d2c5e8fe..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/runtimes/linux-arm/native/libcapstone.so and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/runtimes/linux-arm64/native/libcapstone.so b/源代码/BenchMark/bin/Release/net6.0/runtimes/linux-arm64/native/libcapstone.so deleted file mode 100644 index 00815df9..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/runtimes/linux-arm64/native/libcapstone.so and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/runtimes/linux-x64/native/libcapstone.so b/源代码/BenchMark/bin/Release/net6.0/runtimes/linux-x64/native/libcapstone.so deleted file mode 100644 index e7778125..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/runtimes/linux-x64/native/libcapstone.so and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/runtimes/linux-x86/native/libcapstone.so b/源代码/BenchMark/bin/Release/net6.0/runtimes/linux-x86/native/libcapstone.so deleted file mode 100644 index 2a3dac36..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/runtimes/linux-x86/native/libcapstone.so and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/runtimes/osx-arm64/native/libcapstone.dylib b/源代码/BenchMark/bin/Release/net6.0/runtimes/osx-arm64/native/libcapstone.dylib deleted file mode 100644 index ef96a6b0..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/runtimes/osx-arm64/native/libcapstone.dylib and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/runtimes/osx-x64/native/libcapstone.dylib b/源代码/BenchMark/bin/Release/net6.0/runtimes/osx-x64/native/libcapstone.dylib deleted file mode 100644 index b9653dde..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/runtimes/osx-x64/native/libcapstone.dylib and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/runtimes/win-arm64/native/capstone.dll b/源代码/BenchMark/bin/Release/net6.0/runtimes/win-arm64/native/capstone.dll deleted file mode 100644 index c77717fb..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/runtimes/win-arm64/native/capstone.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/runtimes/win-x64/native/capstone.dll b/源代码/BenchMark/bin/Release/net6.0/runtimes/win-x64/native/capstone.dll deleted file mode 100644 index 4eb46278..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/runtimes/win-x64/native/capstone.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/runtimes/win-x86/native/capstone.dll b/源代码/BenchMark/bin/Release/net6.0/runtimes/win-x86/native/capstone.dll deleted file mode 100644 index 4728b4c1..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/runtimes/win-x86/native/capstone.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/runtimes/win/lib/netcoreapp2.0/System.Management.dll b/源代码/BenchMark/bin/Release/net6.0/runtimes/win/lib/netcoreapp2.0/System.Management.dll deleted file mode 100644 index a3a1f451..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/runtimes/win/lib/netcoreapp2.0/System.Management.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll b/源代码/BenchMark/bin/Release/net6.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll deleted file mode 100644 index 3c6ff564..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/tr/Microsoft.CodeAnalysis.resources.dll b/源代码/BenchMark/bin/Release/net6.0/tr/Microsoft.CodeAnalysis.resources.dll deleted file mode 100644 index 67f93548..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/tr/Microsoft.CodeAnalysis.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/x86/KernelTraceControl.Win61.dll b/源代码/BenchMark/bin/Release/net6.0/x86/KernelTraceControl.Win61.dll deleted file mode 100644 index 63bd7805..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/x86/KernelTraceControl.Win61.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/x86/KernelTraceControl.dll b/源代码/BenchMark/bin/Release/net6.0/x86/KernelTraceControl.dll deleted file mode 100644 index cf35dfa8..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/x86/KernelTraceControl.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/x86/msdia140.dll b/源代码/BenchMark/bin/Release/net6.0/x86/msdia140.dll deleted file mode 100644 index 8bd61c23..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/x86/msdia140.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/x86/msvcp140.dll b/源代码/BenchMark/bin/Release/net6.0/x86/msvcp140.dll deleted file mode 100644 index 02285ab6..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/x86/msvcp140.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/x86/vcruntime140.dll b/源代码/BenchMark/bin/Release/net6.0/x86/vcruntime140.dll deleted file mode 100644 index bb623b6b..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/x86/vcruntime140.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll b/源代码/BenchMark/bin/Release/net6.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll deleted file mode 100644 index 9c795310..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll b/源代码/BenchMark/bin/Release/net6.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll deleted file mode 100644 index 8d24aefd..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll b/源代码/BenchMark/bin/Release/net6.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll deleted file mode 100644 index 8b0d4dfc..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/bin/Release/net6.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll b/源代码/BenchMark/bin/Release/net6.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll deleted file mode 100644 index e949a2c8..00000000 Binary files a/源代码/BenchMark/bin/Release/net6.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll and /dev/null differ diff --git a/源代码/BenchMark/obj/Release/net6.0/BenchMark.AssemblyInfo.cs b/源代码/BenchMark/obj/Release/net6.0/BenchMark.AssemblyInfo.cs deleted file mode 100644 index 0271213e..00000000 --- a/源代码/BenchMark/obj/Release/net6.0/BenchMark.AssemblyInfo.cs +++ /dev/null @@ -1,23 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -using System; -using System.Reflection; - -[assembly: System.Reflection.AssemblyCompanyAttribute("BenchMark")] -[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8548757bbf17cb04ef554babef5b140fd02c1f53")] -[assembly: System.Reflection.AssemblyProductAttribute("BenchMark")] -[assembly: System.Reflection.AssemblyTitleAttribute("BenchMark")] -[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] - -// 由 MSBuild WriteCodeFragment 类生成。 - diff --git a/源代码/BenchMark/obj/Release/net6.0/BenchMark.AssemblyInfoInputs.cache b/源代码/BenchMark/obj/Release/net6.0/BenchMark.AssemblyInfoInputs.cache deleted file mode 100644 index 97f47a6f..00000000 --- a/源代码/BenchMark/obj/Release/net6.0/BenchMark.AssemblyInfoInputs.cache +++ /dev/null @@ -1 +0,0 @@ -82cb96ae7382da519b6703c815654474e1b0440eedcbbdfb523d786d8786efff diff --git a/源代码/BenchMark/obj/Release/net6.0/BenchMark.GeneratedMSBuildEditorConfig.editorconfig b/源代码/BenchMark/obj/Release/net6.0/BenchMark.GeneratedMSBuildEditorConfig.editorconfig deleted file mode 100644 index 2fb28716..00000000 --- a/源代码/BenchMark/obj/Release/net6.0/BenchMark.GeneratedMSBuildEditorConfig.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -is_global = true -build_property.TargetFramework = net6.0 -build_property.TargetPlatformMinVersion = -build_property.UsingMicrosoftNETSdkWeb = -build_property.ProjectTypeGuids = -build_property.InvariantGlobalization = -build_property.PlatformNeutralAssembly = -build_property.EnforceExtendedAnalyzerRules = -build_property._SupportedPlatformList = Linux,macOS,Windows -build_property.RootNamespace = BenchMark -build_property.ProjectDir = D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\ -build_property.EnableComHosting = -build_property.EnableGeneratedComInterfaceComImportInterop = diff --git a/源代码/BenchMark/obj/Release/net6.0/BenchMark.assets.cache b/源代码/BenchMark/obj/Release/net6.0/BenchMark.assets.cache index a665dade..5d2c4e49 100644 Binary files a/源代码/BenchMark/obj/Release/net6.0/BenchMark.assets.cache and b/源代码/BenchMark/obj/Release/net6.0/BenchMark.assets.cache differ diff --git a/源代码/BenchMark/obj/Release/net6.0/BenchMark.csproj.AssemblyReference.cache b/源代码/BenchMark/obj/Release/net6.0/BenchMark.csproj.AssemblyReference.cache deleted file mode 100644 index 98e0ad1d..00000000 Binary files a/源代码/BenchMark/obj/Release/net6.0/BenchMark.csproj.AssemblyReference.cache and /dev/null differ diff --git a/源代码/BenchMark/obj/Release/net6.0/BenchMark.csproj.CopyComplete b/源代码/BenchMark/obj/Release/net6.0/BenchMark.csproj.CopyComplete deleted file mode 100644 index e69de29b..00000000 diff --git a/源代码/BenchMark/obj/Release/net6.0/BenchMark.csproj.CoreCompileInputs.cache b/源代码/BenchMark/obj/Release/net6.0/BenchMark.csproj.CoreCompileInputs.cache deleted file mode 100644 index 7befced0..00000000 --- a/源代码/BenchMark/obj/Release/net6.0/BenchMark.csproj.CoreCompileInputs.cache +++ /dev/null @@ -1 +0,0 @@ -7ffa5eae9915894d5cf49861d340a328d8a97487bea694d511768ea0ca4ccc43 diff --git a/源代码/BenchMark/obj/Release/net6.0/BenchMark.csproj.FileListAbsolute.txt b/源代码/BenchMark/obj/Release/net6.0/BenchMark.csproj.FileListAbsolute.txt index f0c04cff..e69de29b 100644 --- a/源代码/BenchMark/obj/Release/net6.0/BenchMark.csproj.FileListAbsolute.txt +++ b/源代码/BenchMark/obj/Release/net6.0/BenchMark.csproj.FileListAbsolute.txt @@ -1,95 +0,0 @@ -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\TraceReloggerLib.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Dia2Lib.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\OSExtensions.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\x86\KernelTraceControl.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\x86\KernelTraceControl.Win61.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\x86\msdia140.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\x86\msvcp140.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\x86\vcruntime140.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\amd64\KernelTraceControl.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\amd64\msdia140.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\amd64\msvcp140.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\amd64\vcruntime140.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\amd64\vcruntime140_1.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\arm64\KernelTraceControl.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\arm64\msdia140.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\arm64\msvcp140.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\arm64\vcruntime140.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\arm64\vcruntime140_1.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\BenchMark.exe -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\BenchMark.deps.json -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\BenchMark.runtimeconfig.json -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\BenchMark.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\BenchMark.pdb -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\BenchmarkDotNet.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\BenchmarkDotNet.Annotations.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\CommandLine.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Gee.External.Capstone.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Iced.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.Bcl.AsyncInterfaces.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.CodeAnalysis.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.CodeAnalysis.CSharp.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.Diagnostics.NETCore.Client.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.Diagnostics.Runtime.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.Diagnostics.FastSerialization.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.Diagnostics.Tracing.TraceEvent.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.DotNet.PlatformAbstractions.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.Extensions.Configuration.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.Extensions.Configuration.Abstractions.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.Extensions.Configuration.Binder.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.Extensions.Logging.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.Extensions.Logging.Abstractions.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.Extensions.Options.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Microsoft.Extensions.Primitives.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\Perfolizer.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\System.CodeDom.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\System.Management.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\cs\Microsoft.CodeAnalysis.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\de\Microsoft.CodeAnalysis.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\es\Microsoft.CodeAnalysis.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\fr\Microsoft.CodeAnalysis.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\it\Microsoft.CodeAnalysis.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\ja\Microsoft.CodeAnalysis.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\ko\Microsoft.CodeAnalysis.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\pl\Microsoft.CodeAnalysis.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\pt-BR\Microsoft.CodeAnalysis.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\ru\Microsoft.CodeAnalysis.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\tr\Microsoft.CodeAnalysis.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\zh-Hans\Microsoft.CodeAnalysis.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\zh-Hant\Microsoft.CodeAnalysis.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\cs\Microsoft.CodeAnalysis.CSharp.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\de\Microsoft.CodeAnalysis.CSharp.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\es\Microsoft.CodeAnalysis.CSharp.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\fr\Microsoft.CodeAnalysis.CSharp.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\it\Microsoft.CodeAnalysis.CSharp.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\ja\Microsoft.CodeAnalysis.CSharp.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\ko\Microsoft.CodeAnalysis.CSharp.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\pl\Microsoft.CodeAnalysis.CSharp.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\pt-BR\Microsoft.CodeAnalysis.CSharp.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\ru\Microsoft.CodeAnalysis.CSharp.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\tr\Microsoft.CodeAnalysis.CSharp.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\zh-Hans\Microsoft.CodeAnalysis.CSharp.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\zh-Hant\Microsoft.CodeAnalysis.CSharp.resources.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\runtimes\linux-arm\native\libcapstone.so -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\runtimes\linux-arm64\native\libcapstone.so -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\runtimes\linux-x64\native\libcapstone.so -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\runtimes\linux-x86\native\libcapstone.so -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\runtimes\osx-arm64\native\libcapstone.dylib -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\runtimes\osx-x64\native\libcapstone.dylib -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\runtimes\win-arm64\native\capstone.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\runtimes\win-x64\native\capstone.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\runtimes\win-x86\native\capstone.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\bin\Release\net6.0\runtimes\win\lib\netcoreapp2.0\System.Management.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\obj\Release\net6.0\BenchMark.csproj.AssemblyReference.cache -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\obj\Release\net6.0\BenchMark.GeneratedMSBuildEditorConfig.editorconfig -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\obj\Release\net6.0\BenchMark.AssemblyInfoInputs.cache -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\obj\Release\net6.0\BenchMark.AssemblyInfo.cs -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\obj\Release\net6.0\BenchMark.csproj.CoreCompileInputs.cache -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\obj\Release\net6.0\BenchMark.sourcelink.json -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\obj\Release\net6.0\BenchMark.csproj.CopyComplete -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\obj\Release\net6.0\BenchMark.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\obj\Release\net6.0\refint\BenchMark.dll -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\obj\Release\net6.0\BenchMark.pdb -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\obj\Release\net6.0\BenchMark.genruntimeconfig.cache -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\BenchMark\obj\Release\net6.0\ref\BenchMark.dll diff --git a/源代码/BenchMark/obj/Release/net6.0/BenchMark.dll b/源代码/BenchMark/obj/Release/net6.0/BenchMark.dll deleted file mode 100644 index 6fe78566..00000000 Binary files a/源代码/BenchMark/obj/Release/net6.0/BenchMark.dll and /dev/null differ diff --git a/源代码/BenchMark/obj/Release/net6.0/BenchMark.genruntimeconfig.cache b/源代码/BenchMark/obj/Release/net6.0/BenchMark.genruntimeconfig.cache deleted file mode 100644 index cbc778d7..00000000 --- a/源代码/BenchMark/obj/Release/net6.0/BenchMark.genruntimeconfig.cache +++ /dev/null @@ -1 +0,0 @@ -0172166ad456d5aa696d69b035a37cc80103854c98e758f935d13563a382db43 diff --git a/源代码/BenchMark/obj/Release/net6.0/BenchMark.pdb b/源代码/BenchMark/obj/Release/net6.0/BenchMark.pdb deleted file mode 100644 index ceb6515c..00000000 Binary files a/源代码/BenchMark/obj/Release/net6.0/BenchMark.pdb and /dev/null differ diff --git a/源代码/BenchMark/obj/Release/net6.0/BenchMark.sourcelink.json b/源代码/BenchMark/obj/Release/net6.0/BenchMark.sourcelink.json deleted file mode 100644 index 27ffda5d..00000000 --- a/源代码/BenchMark/obj/Release/net6.0/BenchMark.sourcelink.json +++ /dev/null @@ -1 +0,0 @@ -{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/8548757bbf17cb04ef554babef5b140fd02c1f53/*"}} \ No newline at end of file diff --git a/源代码/BenchMark/obj/Release/net6.0/apphost.exe b/源代码/BenchMark/obj/Release/net6.0/apphost.exe index 9403f766..45338796 100644 Binary files a/源代码/BenchMark/obj/Release/net6.0/apphost.exe and b/源代码/BenchMark/obj/Release/net6.0/apphost.exe differ diff --git a/源代码/BenchMark/obj/Release/net6.0/ref/BenchMark.dll b/源代码/BenchMark/obj/Release/net6.0/ref/BenchMark.dll deleted file mode 100644 index f358582a..00000000 Binary files a/源代码/BenchMark/obj/Release/net6.0/ref/BenchMark.dll and /dev/null differ diff --git a/源代码/BenchMark/obj/Release/net6.0/refint/BenchMark.dll b/源代码/BenchMark/obj/Release/net6.0/refint/BenchMark.dll deleted file mode 100644 index f358582a..00000000 Binary files a/源代码/BenchMark/obj/Release/net6.0/refint/BenchMark.dll and /dev/null differ diff --git a/源代码/Output/x64/Benchmark/net6.0/StgSharpC.dll b/源代码/Output/x64/Benchmark/net6.0/StgSharpC.dll index bef54548..c8cc9fa8 100644 Binary files a/源代码/Output/x64/Benchmark/net6.0/StgSharpC.dll and b/源代码/Output/x64/Benchmark/net6.0/StgSharpC.dll differ diff --git a/源代码/StgSharp/Control/Add.cs b/源代码/StgSharp/Control/Add.cs deleted file mode 100644 index 8719cb26..00000000 --- a/源代码/StgSharp/Control/Add.cs +++ /dev/null @@ -1,23 +0,0 @@ -using StgSharp.Controlling; -using StgSharp.Graphics; -using StgSharp.Math; -using System; -using System.Security.Cryptography; - -namespace StgSharp -{ - public static partial class Operation - { - internal static void RegistForm(Form form) - { - - } - - public static void LoadTimeline() - { - - } - - - } -} diff --git a/源代码/StgSharp/Control/Change.cs b/源代码/StgSharp/Control/Change.cs deleted file mode 100644 index 3ee6fa21..00000000 --- a/源代码/StgSharp/Control/Change.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace StgSharp -{ - - public static partial class Operation - { - //method used for chaging the value of paameters will be listed here - internal static void RenderNextFrame() - { - - } - - } -} diff --git a/源代码/StgSharp/Control/Geoemtry.cs b/源代码/StgSharp/Control/Geoemtry.cs deleted file mode 100644 index ca6fb36c..00000000 --- a/源代码/StgSharp/Control/Geoemtry.cs +++ /dev/null @@ -1,21 +0,0 @@ -using StgSharp.Geometries; -using StgSharp.Math; - -namespace StgSharp -{ - public static unsafe partial class Geometry - { - public static unsafe Triangle InitTriagnle( - vec3d vertex1, - vec3d vertex2, - vec3d vertex3 - ) where T : Triangle - { - Triangle t = new Triangle(); - - - return t; - } - - } -} diff --git a/源代码/StgSharp/Control/Get.cs b/源代码/StgSharp/Control/Get.cs index 1af14b99..87f3eee7 100644 --- a/源代码/StgSharp/Control/Get.cs +++ b/源代码/StgSharp/Control/Get.cs @@ -7,8 +7,6 @@ namespace StgSharp { public static unsafe partial class Operation { - - /// /// Get the status of a certain key on the keyboard. /// @@ -17,7 +15,7 @@ namespace StgSharp /// public static KeyStatus GetKeyStatus(Form form, Key key) { - return InternalIO.glfw.GetKey(form.windowID, (int)key); + return InternalIO.glfwGetKey(form.windowID, (int)key); } } diff --git a/源代码/StgSharp/Control/IO/GLIO.cs b/源代码/StgSharp/Control/IO/GLIO.cs index f7ba46a0..26898940 100644 --- a/源代码/StgSharp/Control/IO/GLIO.cs +++ b/源代码/StgSharp/Control/IO/GLIO.cs @@ -37,8 +37,6 @@ namespace StgSharp internal static extern unsafe void InternalLoadImage(string fileName, Image.ImageInfo* output, ImageLoader loader); #endregion - - internal static IglFramework glfw = null; } } @@ -48,8 +46,6 @@ namespace StgSharp.Graphics [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi)] public delegate IntPtr ImageLoader(string name, ref int width, ref int height, ref int definedChannel, int desiredChannel); - - [StructLayout(LayoutKind.Sequential)] public struct GLcontext { @@ -192,8 +188,8 @@ namespace StgSharp.Graphics internal unsafe delegate* glBlitNamedFramebuffer; internal unsafe delegate* glBufferAddressRangeNV; internal unsafe delegate* glBufferAttachMemoryNV; - internal unsafe delegate* glBufferData; - internal unsafe delegate* glBufferDataARB; + internal unsafe delegate* glBufferData; + internal unsafe delegate* glBufferDataARB; internal unsafe delegate* glBufferPageCommitmentARB; internal unsafe delegate* glBufferPageCommitmentMemNV; internal unsafe delegate* glBufferParameteriAPPLE; @@ -2459,8 +2455,8 @@ namespace StgSharp.Graphics internal unsafe delegate* glVertexAttribP4ui; internal unsafe delegate* glVertexAttribP4uiv; internal unsafe delegate* glVertexAttribParameteriAMD; - internal unsafe delegate* glVertexAttribPointer; - internal unsafe delegate* glVertexAttribPointerARB; + internal unsafe delegate* glVertexAttribPointer; + internal unsafe delegate* glVertexAttribPointerARB; internal unsafe delegate* glVertexAttribPointerNV; internal unsafe delegate* glVertexAttribs1dvNV; internal unsafe delegate* glVertexAttribs1fvNV; diff --git a/源代码/StgSharp/Control/IO/InternalIO.cs b/源代码/StgSharp/Control/IO/InternalIO.cs index 9d7850d9..997b42f8 100644 --- a/源代码/StgSharp/Control/IO/InternalIO.cs +++ b/源代码/StgSharp/Control/IO/InternalIO.cs @@ -20,6 +20,9 @@ namespace StgSharp internal static unsafe partial class InternalIO { + internal static Dictionary GLtype = + new Dictionary(); + internal static IntPtr SSClibPtr = IntPtr.Zero; internal const string SS_errorlog = @@ -30,14 +33,13 @@ namespace StgSharp static InternalIO() { - GLtype.Add(typeof(float), GLconst.FLOAT); - GLtype.Add(typeof(int), GLconst.INT); - GLtype.Add(typeof(uint), GLconst.UNSIGNED_INT); - GLtype.Add(typeof(short), GLconst.SHORT); - GLtype.Add(typeof(ushort), GLconst.UNSIGNED_SHORT); - GLtype.Add(typeof(sbyte), GLconst.BYTE); - GLtype.Add(typeof(byte), GLconst.UNSIGNED_BYTE); - + GLtype.Add(TypeCode.Single, GLconst.FLOAT); + GLtype.Add(TypeCode.Int32, GLconst.INT); + GLtype.Add(TypeCode.UInt32, GLconst.UNSIGNED_INT); + GLtype.Add(TypeCode.Int16, GLconst.SHORT); + GLtype.Add(TypeCode.UInt16, GLconst.UNSIGNED_SHORT); + GLtype.Add(TypeCode.SByte, GLconst.BYTE); + GLtype.Add(TypeCode.Byte, GLconst.UNSIGNED_BYTE); } internal static T InternalLoadProc(IntPtr libPtr, string name) where T : Delegate @@ -48,7 +50,7 @@ namespace StgSharp T ret = Marshal.GetDelegateForFunctionPointer(procPtr); return ret; } - catch (Exception ex) + catch (Exception) { throw; } diff --git a/源代码/StgSharp/Control/Recycle.cs b/源代码/StgSharp/Control/Recycle.cs deleted file mode 100644 index 013a760c..00000000 --- a/源代码/StgSharp/Control/Recycle.cs +++ /dev/null @@ -1,15 +0,0 @@ -using StgSharp.Math; -using System; -using System.Collections.Generic; -using System.Text; - -namespace StgSharp.Controlling -{ - public static partial class Control - { - public static unsafe void RecycleMappedVec(Vec4d vec) - { - - } - } -} diff --git a/源代码/StgSharp/Control/Remove.cs b/源代码/StgSharp/Control/Remove.cs deleted file mode 100644 index 827f6caf..00000000 --- a/源代码/StgSharp/Control/Remove.cs +++ /dev/null @@ -1,15 +0,0 @@ -using StgSharp.Geometries; - -namespace StgSharp.Controlling -{ - public static class Remove - { - public static void Point(Point p) - { - - } - - - - } -} diff --git a/源代码/StgSharp/Control/RenderBuffer.cs b/源代码/StgSharp/Control/RenderBuffer.cs deleted file mode 100644 index ea11f062..00000000 --- a/源代码/StgSharp/Control/RenderBuffer.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Controlling -{ - internal static partial class TimeLine - { - } -} diff --git a/源代码/StgSharp/Environment/Platform.cs b/源代码/StgSharp/Environment/Platform.cs new file mode 100644 index 00000000..1c7783c2 --- /dev/null +++ b/源代码/StgSharp/Environment/Platform.cs @@ -0,0 +1,90 @@ +using StgSharp.Graphics; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp +{ + internal enum GraphicAPI : byte + { + GL, + DX, + VK + } + + public static class Platform + { + + internal static GraphicAPI API; + + /// + /// Version of current StgSharp platform. + /// Main version represent in hundred's digit, + /// and sub version represent in ten's digit. + /// + public const long version = 430; + + /// + /// Init an instance of OpenGL program, + /// This method should be called before other + /// graphic methods, after LoadGL method. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void InitGL(int majorVersion, int minorVersion) + { + InternalIO.InternalInitGL(majorVersion, minorVersion); + } + + /// + /// Write a log message to log file, and mark the level of this message. + /// + /// A string contains information of how current evironment runs. + /// The severity of current message. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void WriteLog(string message, LogType logType) + { + InternalIO.InternalWriteLog(message, logType); + } + + internal static TDele ConvertAPI(IntPtr funcPtr) + { + if (funcPtr == IntPtr.Zero) + { + throw new Exception("Failed to convert api, the function pointer is zero."); + } + try + { + return Marshal.GetDelegateForFunctionPointer(funcPtr); + + } + catch (Exception) + { + throw; + } + } + + internal static Delegate ConvertAPI(IntPtr funcPtr, Type T) + { + + if (funcPtr == IntPtr.Zero) + { + throw new Exception("Failed to convert api, the function pointer is zero."); + } + try + { + return Marshal.GetDelegateForFunctionPointer(funcPtr, T); + + } + catch (Exception) + { + throw; + } + } + + } +} diff --git a/源代码/StgSharp/Graphics/Define/glEnum.cs b/源代码/StgSharp/Graphics/Define/glEnum.cs index aa765742..8df4cfff 100644 --- a/源代码/StgSharp/Graphics/Define/glEnum.cs +++ b/源代码/StgSharp/Graphics/Define/glEnum.cs @@ -45,7 +45,7 @@ Vertex = 0x8B31, } - public enum BufferType : int + public enum BufferType : uint { ARRAY_BUFFER = 0x8892, ELEMENT_ARRAY_BUFFER = 0x8893, @@ -83,7 +83,7 @@ STENCIL = GLconst.STENCIL_BUFFER_BIT, } - public enum GepmetryType : int + public enum GepmetryType : uint { POINTS = 0x0000, LINES = 0x0001, diff --git a/源代码/StgSharp/Graphics/Define/glType.cs b/源代码/StgSharp/Graphics/Define/glType.cs index 4b537bc4..b55f3108 100644 --- a/源代码/StgSharp/Graphics/Define/glType.cs +++ b/源代码/StgSharp/Graphics/Define/glType.cs @@ -5,15 +5,6 @@ using System.Collections.ObjectModel; using System.Runtime.InteropServices; using System.Text; -namespace StgSharp -{ - internal static unsafe partial class InternalIO - { - internal static Dictionary GLtype = - new Dictionary(); - - } -} namespace StgSharp.Graphics { diff --git a/源代码/StgSharp/Graphics/Form.cs b/源代码/StgSharp/Graphics/Form.cs index a7cd8e59..2a7cd956 100644 --- a/源代码/StgSharp/Graphics/Form.cs +++ b/源代码/StgSharp/Graphics/Form.cs @@ -1,4 +1,5 @@ -using StgSharp.Controlling; +using StgSharp; +using StgSharp.Controlling; using StgSharp.Logic; using StgSharp.Math; using System; @@ -10,8 +11,10 @@ using System.Linq; using System.Numerics; using System.Reflection; using System.Reflection.Emit; +using System.Reflection.Metadata; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Security.Principal; using System.Text; using System.Threading; @@ -34,8 +37,8 @@ namespace StgSharp.Graphics internal Form sharedForm; internal int width; internal IntPtr windowID; - private IglFunc gl; private bool closed; + private IglFunc gl; #endregion #region form thread setting @@ -55,12 +58,13 @@ namespace StgSharp.Graphics { } - protected FrameBufferSizeHandler FrameBufferSizeCallback + /// + /// OpenGL package used by current form context. + /// + public IglFunc GL { - set - { - gl.SetFrameBufferSizeCallback(this.windowID, value); - } + get => gl; + internal set => gl = value; } /// @@ -72,20 +76,6 @@ namespace StgSharp.Graphics set => height = value; } - /// - /// OpenGL package used by current form context. - /// - public IglFunc GL - { - get => gl; - internal set => gl = value; - } - - internal Thread RenderThread - { - get { return renderThread; } - } - /// /// Representing /// @@ -94,6 +84,14 @@ namespace StgSharp.Graphics get { return isSingleThread; } } + public bool ShouldClose + { + set + { + InternalIO.glfwSetWindowShouldClose(windowID, value ? 1 : 0); + } + } + /// /// Width of this form, represent in /// @@ -132,11 +130,158 @@ namespace StgSharp.Graphics get { return _renderStartSignal; } set { _renderStartSignal = value; } } + + internal Thread RenderThread + { + get { return renderThread; } + } + + protected FrameBufferSizeHandler FrameBufferSizeCallback + { + set + { + IntPtr handlerPtr = Marshal.GetFunctionPointerForDelegate(value); + InternalIO.glfwSetFramebufferSizeCallback(windowID, handlerPtr); + } + } unsafe ~Form() { Marshal.FreeHGlobal((IntPtr)contextID); } + /// + /// Init an OpenGl context if current form has not been binded to any context. + /// and set the context binded to current form as current OpenGL context. + /// + /// Something goes wrong and + /// StgSharp fails in creating a new OpenGL context. + public unsafe void MakeAsCurrentContext() + { + if (windowID == default) + { + IntPtr windowPtr; + byte[] tittleBytes = Encoding.UTF8.GetBytes(name); + if (sharedForm == null) + { + windowPtr = InternalIO.glfwCreateWindow( + width, height, tittleBytes, monitor, IntPtr.Zero); + } + else + { + windowPtr = InternalIO.glfwCreateWindow( + width, height, tittleBytes, monitor, sharedForm.windowID); + } + if ((long)windowPtr == -1 || (long)windowPtr == -2) + { + throw new Exception("Cannot create window instance!"); + } + else + { + windowID = windowPtr; + } + } + InternalIO.InternalSetCurrentGLContext(windowID, contextID); + } + + /// + /// Set all necessary metadata to current form instance + /// + public void SetMetadata(int width, int height, string name, IntPtr monitor, Form sharedForm) + { + this.width = width; + this.height = height; + this.name = name; + this.sharedForm = sharedForm; + this.monitor = monitor; + } + + /// + /// Resize the current form + /// + /// New width of the window + /// New height of the window + public void SetSize(int width, int height) + { + this.Width = width; + this.Height = height; + InternalIO.glfwSetWindowSize(this.windowID, width, height); + } + + /// + /// Resize the current form + /// + /// + /// A (width,height) representing the new size of current form + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetSize(Vec2d size) + { + this.Size = size; + InternalIO.glfwSetWindowSize(this.windowID, (int)size.X, (int)size.Y); + + } + + /// + /// Set the size limit of current form + /// + /// Minimum width of current form + /// Minimum height of current form + /// Maximum width of curent form + /// Maximum height of current form + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetSizeLimit(int minWidth, int minHeight, int maxWidth, int maxHeight) + { + InternalIO.glfwSetWindowSizeLimits( + this.windowID, + minWidth, minHeight, maxWidth, maxHeight); + } + + /// + /// Set the size limit of current form + /// + /// + /// Minimun size of current form. In form of a of (width,height) + /// + /// + /// Maximum size of current form. In form of a of (width,height) + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetSizeLimit(Vec2d minSize, Vec2d maxSize) + { + InternalIO.glfwSetWindowSizeLimits( + this.windowID, + (int)minSize.X, (int)minSize.Y, (int)maxSize.X, (int)maxSize.Y); + } + + public unsafe void SwapAndPollEvent() + { + if (windowID == IntPtr.Zero) + { + return; + } + if (isSingleThread) + { + InternalIO.glfwSwapBuffers(windowID); + InternalIO.glfwPollEvents(); + } + else + { + M128 m = default; + m.IntPtr0 = windowID; + GLonUpdate glu = gl as GLonUpdate; + glu.frameworkHandleEnqueue( + (IntPtr)(delegate*)&InternalSwapBuffer, m); + } + } + + internal static void InternalSwapBuffer() + { + IntPtr handle = default; + GLonUpdate.ParamQueue.TryDequeue(out handle); + InternalIO.glfwSwapBuffers(handle); + InternalIO.glfwPollEvents(); + } + #region form main public abstract void Deinit(params object[] args); @@ -181,21 +326,6 @@ namespace StgSharp.Graphics } } - private unsafe void InternalRender() - { -#pragma warning disable CS8602 - ConcurrentQueue glActions = (gl as GLonUpdate).GLactionQueue; -#pragma warning restore CS8602 - IntPtr currentOperation; - while (gl.GetWindowShouldClose(this)) - { - if (glActions.TryDequeue(out currentOperation)) - { - ((delegate*)currentOperation)(); - } - } - } - internal void InternalDeinit(params object[] args) { Deinit(args); @@ -264,112 +394,21 @@ namespace StgSharp.Graphics renderThread = new Thread(new ThreadStart(InternalRender)); } } - #endregion - /// - /// Set all necessary metadata to current form instance - /// - public void SetMetadata(int width, int height, string name, IntPtr monitor, Form sharedForm) + private unsafe void InternalRender() { - this.width = width; - this.height = height; - this.name = name; - this.sharedForm = sharedForm; - this.monitor = monitor; - } - - /// - /// Init an OpenGl context if current form has not been binded to any context. - /// and set the context binded to current form as current OpenGL context. - /// - /// Something goes wrong and - /// StgSharp fails in creating a new OpenGL context. - public unsafe void MakeAsCurrentContext() - { - if (windowID == default) +#pragma warning disable CS8602 + ConcurrentQueue glActions = (gl as GLonUpdate).GLactionQueue; +#pragma warning restore CS8602 + IntPtr currentOperation; + while (gl.GetWindowShouldClose(this)) { - IntPtr windowPtr; - byte[] tittleBytes = Encoding.UTF8.GetBytes(name); - if (sharedForm == null) + if (glActions.TryDequeue(out currentOperation)) { - windowPtr = InternalIO.glfw.CreateWindow( - width, height, tittleBytes, monitor, IntPtr.Zero); - } - else - { - windowPtr = InternalIO.glfw.CreateWindow( - width, height, tittleBytes, monitor, sharedForm.windowID); - } - if ((long)windowPtr == -1 || (long)windowPtr == -2) - { - throw new Exception("Cannot create window instance!"); - } - else - { - windowID = windowPtr; + ((delegate*)currentOperation)(); } } - InternalIO.InternalSetCurrentGLContext(windowID, contextID); } - - /// - /// Resize the current form - /// - /// New width of the window - /// New height of the window - public void SetSize(int width, int height) - { - this.Width = width; - this.Height = height; - InternalIO.glfw.SetWindowSize(this.windowID, width, height); - } - - /// - /// Resize the current form - /// - /// - /// A (width,height) representing the new size of current form - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetSize(Vec2d size) - { - this.Size = size; - InternalIO.glfw.SetWindowSize(this.windowID, (int)size.X, (int)size.Y); - - } - - /// - /// Set the size limit of current form - /// - /// Minimum width of current form - /// Minimum height of current form - /// Maximum width of curent form - /// Maximum height of current form - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetSizeLimit(int minWidth, int minHeight, int maxWidth, int maxHeight) - { - InternalIO.glfw.SetWindowSizeLimits( - this.windowID, - minWidth, minHeight, maxWidth, maxHeight); - } - - /// - /// Set the size limit of current form - /// - /// - /// Minimun size of current form. In form of a of (width,height) - /// - /// - /// Maximum size of current form. In form of a of (width,height) - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetSizeLimit(Vec2d minSize, Vec2d maxSize) - { - InternalIO.glfw.SetWindowSizeLimits( - this.windowID, - (int)minSize.X, (int)minSize.Y, (int)maxSize.X, (int)maxSize.Y); - } - - + #endregion } } diff --git a/源代码/StgSharp/Graphics/FrameTime.cs b/源代码/StgSharp/Graphics/FrameTime.cs index 7210b366..eeb0b8ee 100644 --- a/源代码/StgSharp/Graphics/FrameTime.cs +++ b/源代码/StgSharp/Graphics/FrameTime.cs @@ -22,7 +22,7 @@ namespace StgSharp.Graphics public double timeAfterFrame { - get { return InternalIO.glfw.GetTime() - frameBegin; } + get { return InternalIO.glfwGetTime() - frameBegin; } } public uint totalFrame diff --git a/源代码/StgSharp/Graphics/GL/Buffer/EBO.cs b/源代码/StgSharp/Graphics/GL/Buffer/EBO.cs index 28e62662..148f3bd1 100644 --- a/源代码/StgSharp/Graphics/GL/Buffer/EBO.cs +++ b/源代码/StgSharp/Graphics/GL/Buffer/EBO.cs @@ -11,19 +11,18 @@ namespace StgSharp.Graphics /// /// A collecion of handle to Element Buffer Object in OpenGL. - /// Each value indexed from instance of this class this + /// Each value indexed from instance of this class this /// is the only handle to one Element Buffer Object. /// public unsafe class ElementBuffer : IBufferObject { - internal ElementBuffer(uint n, IglFunc gl) + internal ElementBuffer(int n, IglFunc gl) { - _bufferHandle = new glHandle((int)n); GL = gl; - GL.GenBuffers(n, _bufferHandle); + _bufferHandle = GL.GenBuffers(n); } - public uint this[int n] + public glHandle this[int n] { get { return _bufferHandle[n]; } } diff --git a/源代码/StgSharp/Graphics/GL/Buffer/IBufferObject.cs b/源代码/StgSharp/Graphics/GL/Buffer/IBufferObject.cs index 00b8c7fb..df42b0b1 100644 --- a/源代码/StgSharp/Graphics/GL/Buffer/IBufferObject.cs +++ b/源代码/StgSharp/Graphics/GL/Buffer/IBufferObject.cs @@ -11,7 +11,7 @@ namespace StgSharp.Graphics /// public abstract class IBufferObject : IDisposable { - protected glHandle _bufferHandle; + protected glHandleSet _bufferHandle; protected IglFunc GL; /// @@ -19,7 +19,7 @@ namespace StgSharp.Graphics /// /// /// - public uint this[int index] + public glHandle this[int index] { get { return _bufferHandle[index]; } } diff --git a/源代码/StgSharp/Graphics/GL/Buffer/VAO.cs b/源代码/StgSharp/Graphics/GL/Buffer/VAO.cs index baa7ef1b..1d74eaf3 100644 --- a/源代码/StgSharp/Graphics/GL/Buffer/VAO.cs +++ b/源代码/StgSharp/Graphics/GL/Buffer/VAO.cs @@ -8,11 +8,10 @@ namespace StgSharp.Graphics public unsafe class VertexArray : IBufferObject { - internal VertexArray(uint n, IglFunc gl) + internal VertexArray(int n, IglFunc gl) { - _bufferHandle = new glHandle((int)n); GL = gl; - GL.GenVertexArrays(n, _bufferHandle); + _bufferHandle = GL.GenVertexArrays(n); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -24,11 +23,11 @@ namespace StgSharp.Graphics [MethodImpl(MethodImplOptions.AggressiveInlining)] public void BindNull() { - GL.BindVertexArray(0); + GL.BindVertexArray(glHandle.Alloc(0)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetVertexAttribute(uint index, int vertexLength, Type dataType, bool isNomalized, uint stride, int pointer) + public void SetVertexAttribute(uint index, int vertexLength, TypeCode dataType, bool isNomalized, uint stride, int pointer) { GL.SetVertexAttribute( index, vertexLength, dataType, diff --git a/源代码/StgSharp/Graphics/GL/Buffer/VBO.cs b/源代码/StgSharp/Graphics/GL/Buffer/VBO.cs index 247d2fec..0fceda2e 100644 --- a/源代码/StgSharp/Graphics/GL/Buffer/VBO.cs +++ b/源代码/StgSharp/Graphics/GL/Buffer/VBO.cs @@ -12,16 +12,15 @@ namespace StgSharp.Graphics public unsafe class VertexBuffer : IBufferObject { - internal VertexBuffer(uint n, IglFunc glFunc) + internal VertexBuffer(int n, IglFunc glFunc) { - _bufferHandle = new glHandle((int)n); GL = glFunc; - GL.GenBuffers(n, _bufferHandle); + _bufferHandle = GL.GenBuffers(n); } public sealed override void Bind(int index) { - GL.BindBuffer(BufferType.ARRAY_BUFFER, (uint)index); + GL.BindBuffer(BufferType.ARRAY_BUFFER, _bufferHandle[index]); } /// @@ -57,7 +56,7 @@ namespace StgSharp.Graphics [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Unbind() { - GL.BindBuffer(BufferType.ARRAY_BUFFER, 0); + GL.BindBuffer(BufferType.ARRAY_BUFFER, glHandle.Zero); } internal void ChangeEnvironment(IglFunc gl) { diff --git a/源代码/StgSharp/Graphics/GL/Buffer/texture.cs b/源代码/StgSharp/Graphics/GL/Buffer/texture.cs index 11d296c9..5164bc8e 100644 --- a/源代码/StgSharp/Graphics/GL/Buffer/texture.cs +++ b/源代码/StgSharp/Graphics/GL/Buffer/texture.cs @@ -17,12 +17,11 @@ namespace StgSharp.Graphics internal Image[] sourceList; private IglFunc GL; - internal Texture(uint n, IglFunc gl) + internal Texture(int n, IglFunc gl) { - _textureHandle = new glHandleSet((int)n); sourceList = new Image[n]; GL = gl; - GL.GenTextures(n, _textureHandle); + _textureHandle = GL.GenTextures(n); } public void Activate(TextureUnit unit) @@ -65,10 +64,10 @@ namespace StgSharp.Graphics channel = 0; break; } - GL.TextureImage2d( + GL.TextureImage2d( GLconst.TEXTURE_2D, 0, channel, (uint)sourceList[index].Width, (uint)sourceList[index].Height, - channel, GLconst.UNSIGNED_BYTE, (byte*)sourceList[index].info.pixelPtr + channel, GLconst.UNSIGNED_BYTE, sourceList[index].pixelArray ); } else diff --git a/源代码/StgSharp/Graphics/GL/GLhandle.cs b/源代码/StgSharp/Graphics/GL/GLhandle.cs index 8ecb6981..218d15c3 100644 --- a/源代码/StgSharp/Graphics/GL/GLhandle.cs +++ b/源代码/StgSharp/Graphics/GL/GLhandle.cs @@ -13,6 +13,37 @@ using System.Threading.Tasks; namespace System { + public unsafe struct glSHandle + { + internal int* valuePtr; + internal glHandleSet source; + + public static glSHandle Zero + { + get { return Alloc(1); } + } + + public static glSHandle Alloc(int value) + { + glSHandle ret = default; + ret.source = new glHandleSet(1); + ret.valuePtr = (int*)ret.source.handle; + *ret.valuePtr = (int)value; + return ret; + } + + internal int DirectValue + { + get { return *valuePtr; } + } + + internal glSHandle(int* val, glHandleSet set) + { + source = set; + valuePtr = val; + } + } + /// /// A handle to an OpenGL object, /// must be indexed from a . @@ -23,6 +54,11 @@ namespace System internal uint* valuePtr; internal glHandleSet source; + public static glHandle Zero + { + get { return Alloc(0); } + } + public glHandle() { throw new InvalidOperationException(); @@ -32,6 +68,7 @@ namespace System { glHandle ret = default; ret.source = new glHandleSet(1); + ret.valuePtr = ret.source.handle; *ret.valuePtr = value; return ret; } @@ -54,6 +91,14 @@ namespace System } } + internal uint DirectValue + { + get + { + return *valuePtr; + } + } + public uint Value { get @@ -73,7 +118,6 @@ namespace System *valuePtr = value; } } - } /// @@ -85,6 +129,22 @@ namespace System internal int length; internal uint* handle; + public static void Copy(in glHandleSet source, glHandleSet target) + { + if (source == null || target == null) + { + throw new NullReferenceException(); + } + if (source.length != target.length) + { + throw new Exception($"Lengths of {nameof(source)} and {nameof(target)} are not equal."); + } + for (int i = 0; i < source.length; i++) + { + target._value[i] = source._value[i]; + } + } + public glHandle this[int index] { get @@ -97,6 +157,17 @@ namespace System } } + public glSHandle this[uint index] + { + get + { + if (index > length) + { + throw new IndexOutOfRangeException(); + } + return new glSHandle((int*)handle + index, this); + } + } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void SetValue(int index, uint value) diff --git a/源代码/StgSharp/Graphics/GL/GLonRender.cs b/源代码/StgSharp/Graphics/GL/GLonRender.cs index 2af1feb0..c774f108 100644 --- a/源代码/StgSharp/Graphics/GL/GLonRender.cs +++ b/源代码/StgSharp/Graphics/GL/GLonRender.cs @@ -3,7 +3,6 @@ using StgSharp.Math; using System; using System.Collections.Concurrent; using System.Collections.Generic; -using System.Reflection.Metadata; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; @@ -62,9 +61,9 @@ namespace StgSharp.Graphics } [MethodImpl(MethodImplOptions.AggressiveInlining)] - void IglFunc.BindTexture(uint type, uint texture) + void IglFunc.BindTexture(uint type, glHandle texture) { - api->glBindTexture(type, texture); + api->glBindTexture(type, texture.DirectValue); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -169,12 +168,12 @@ namespace StgSharp.Graphics IntPtr windowPtr; if (share == null) { - windowPtr = InternalIO.glfw.CreateWindow( + windowPtr = InternalIO.glfwCreateWindow( width, height, tittleBytes, monitor, IntPtr.Zero); } else { - windowPtr = InternalIO.glfw.CreateWindow( + windowPtr = InternalIO.glfwCreateWindow( width, height, tittleBytes, monitor, share.windowID); } @@ -195,9 +194,9 @@ namespace StgSharp.Graphics } [MethodImpl(MethodImplOptions.AggressiveInlining)] - unsafe void IglFunc.DeleteBuffer(uint handle) + unsafe void IglFunc.DeleteBuffer(glHandle handle) { - api->glDeleteBuffers(1, &handle); + api->glDeleteBuffers(1, (uint*)handle.Handle); } [MethodImpl(MethodImplOptions.AggressiveInlining)] unsafe void IglFunc.DeleteBuffers(glHandleSet handle) @@ -214,10 +213,10 @@ namespace StgSharp.Graphics } [MethodImpl(MethodImplOptions.AggressiveInlining)] - unsafe void IglFunc.DrawElements(GepmetryType mode, uint count, Type type, IntPtr ptr) + unsafe void IglFunc.DrawElements(GepmetryType mode, uint count, TypeCode type, IntPtr ptr) { uint a; - switch (Type.GetTypeCode(type)) + switch (type) { case TypeCode.UInt32: a = GLconst.UNSIGNED_INT; @@ -239,68 +238,53 @@ namespace StgSharp.Graphics } [MethodImpl(MethodImplOptions.AggressiveInlining)] - unsafe void IglFunc.GenBuffers(uint count, glHandleSet handle) + unsafe glHandleSet IglFunc.GenBuffers(int count) { - api->glGenBuffers(count, (uint*)handle.handle); + glHandleSet h = new glHandleSet((int)count); + api->glGenBuffers((uint)count, h.handle); + return h; } [MethodImpl(MethodImplOptions.AggressiveInlining)] - unsafe void IglFunc.GenTextures(uint count, glHandleSet handle) + unsafe glHandleSet IglFunc.GenTextures(int count) { - api->glGenTextures(count, (uint*)handle.handle); + glHandleSet h = new glHandleSet((int)count); + api->glGenTextures((uint)count, h.handle); + return h; } [MethodImpl(MethodImplOptions.AggressiveInlining)] - unsafe void IglFunc.GenVertexArrays(uint count, glHandleSet handle) + unsafe glHandleSet IglFunc.GenVertexArrays(int count) { - api->glGenVertexArrays(count, (uint*)handle.handle); + glHandleSet h = new glHandleSet(count); + api->glGenVertexArrays((uint)count, h.handle); + return h; } [MethodImpl(MethodImplOptions.AggressiveInlining)] - unsafe void IglFunc.GetGraphicError() + unsafe glSHandle IglFunc.GetUniformLocation(glHandle program, string name) { - string error = null; - uint code = api->glGetError(); - while (code != 0) + byte[] code = Encoding.UTF8.GetBytes(name); + fixed (byte* ptr = code) { - error += $"OpenGL error {code}\n"; + return glSHandle.Alloc(api->glGetUniformLocation(program.DirectValue, ptr)); } - try - { - if (error != null) - { - throw new Exception(); - } - } - catch (Exception ex) - { - /**/ - InternalIO.InternalWriteLog( - error + ex.StackTrace, - LogType.Error - ); - /**/ - } - return; } [MethodImpl(MethodImplOptions.AggressiveInlining)] - unsafe int IglFunc.GetUniformLocation(uint program, byte* ptr) - { - return api->glGetUniformLocation(program, ptr); - } - unsafe bool IglFunc.GetWindowShouldClose(Form form) { - return InternalIO.glfw.WindowShouldClose(form.windowID) == 0; + return InternalIO.glfwWindowShouldClose(form.windowID) == 0; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] unsafe void IglFunc.MakeContexCurrent(Form form) { if (form.windowID == IntPtr.Zero) { + InternalIO.InternalWriteLog($"From {nameof(form)} is not initted.", LogType.Warning); return; } - InternalIO.glfw.MakeContextCurrent(form.windowID); + InternalIO.glfwMakeContextCurrent(form.windowID); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -309,7 +293,7 @@ namespace StgSharp.Graphics int size = sizeof(T); api->glBufferData( (uint)bufferType, - (UIntPtr)size, + (IntPtr)size, &bufferData, (uint)usage); } @@ -325,62 +309,40 @@ namespace StgSharp.Graphics fixed (void* bufferPtr = bufferArray) api->glBufferData( (uint)bufferType, - (UIntPtr)size, + (IntPtr)size, bufferPtr, (uint)usage); } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - void IglFunc.SetFrameBufferSizeCallback(IntPtr id, FrameBufferSizeHandler handler) - { - IntPtr handlerPtr = Marshal.GetFunctionPointerForDelegate(handler); - InternalIO.glfw.SetFramebufferSizeCallback(id, handlerPtr); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - void IglFunc.SetVertexAttribute(uint index, int size, Type t, bool normalized, uint stride, int pointer) + void IglFunc.SetVertexAttribute(uint index, int size, TypeCode t, bool normalized, uint stride, int pointer) { uint type = InternalIO.GLtype[t]; - api->glVertexAttribPointer(index, size, type, normalized, stride, (void*)pointer); + api->glVertexAttribPointer(index, size, type, normalized ? 1 : 0, stride, (void*)pointer); api->glEnableVertexAttribArray(index); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - void IglFunc.SetWindowShouldClose(Form form, bool mark) - { - InternalIO.glfw.SetWindowShouldClose(form.windowID, mark ? 1 : 0); - } - - unsafe void IglFunc.SwapBuffers(Form form) - { - if (form.windowID == IntPtr.Zero) - { - return; - } - InternalIO.glfw.SwapBuffers(form.windowID); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - void IglFunc.TextureImage2d(uint target, int level, uint internalformat, uint width, uint height, uint format, uint type, void* pixels) + void IglFunc.TextureImage2d(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, T[] pixels) { + IntPtr source = GCHandle.Alloc(pixels, GCHandleType.Pinned).AddrOfPinnedObject(); api->glTexImage2D( - target, level, internalformat, width, height, 0, format, type, pixels + (uint)target, level, internalformat, width, height, 0, format, type, (void*)source ); + GCHandle.FromIntPtr(source).Free(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - void IglFunc.TextureParameter(uint target, uint pname, int param) + void IglFunc.TextureParameter(int target, uint pname, int param) { - api->glTexParameteri(target, pname, param); + api->glTexParameteri((uint)target, pname, param); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - void IglFunc.UseProgram(uint program) + void IglFunc.UseProgram(glHandle program) { - api->glUseProgram(program); + api->glUseProgram(program.DirectValue); } [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/源代码/StgSharp/Graphics/GL/GLonTimeout.cs b/源代码/StgSharp/Graphics/GL/GLonTimeout.cs index 7e6cf666..75e84940 100644 --- a/源代码/StgSharp/Graphics/GL/GLonTimeout.cs +++ b/源代码/StgSharp/Graphics/GL/GLonTimeout.cs @@ -29,7 +29,7 @@ namespace StgSharp.Graphics void IglFunc.BindBuffer(BufferType bufferType, glHandle handle) => throw signal; - void IglFunc.BindTexture(uint type, uint texture) => throw signal; + void IglFunc.BindTexture(uint type, glHandle texture) => throw signal; void IglFunc.BindVertexArray(glHandle handle) => throw signal; @@ -59,20 +59,17 @@ namespace StgSharp.Graphics void IglFunc.DeleteVertexArrays(glHandleSet handle) => throw signal; - void IglFunc.DrawElements(GepmetryType mode, uint count, Type type, IntPtr ptr) => throw signal; + void IglFunc.DrawElements(GepmetryType mode, uint count, TypeCode type, IntPtr ptr) => throw signal; - void IglFunc.GenBuffers(uint count, glHandleSet handle) => throw signal; + glHandleSet IglFunc.GenBuffers(int count) => throw signal; - void IglFunc.GenTextures(uint count, glHandleSet handle) => throw signal; + glHandleSet IglFunc.GenTextures(int count) => throw signal; - void IglFunc.GenVertexArrays(uint count, glHandleSet handle) => throw signal; + glHandleSet IglFunc.GenVertexArrays(int count) => throw signal; - - void IglFunc.GetGraphicError() => throw signal; - - unsafe int IglFunc.GetUniformLocation(uint program, byte* ptr) => throw signal; + unsafe glSHandle IglFunc.GetUniformLocation(glHandle program, string name) => throw signal; bool IglFunc.GetWindowShouldClose(Form form) => throw signal; @@ -82,8 +79,6 @@ namespace StgSharp.Graphics void IglFunc.SetBufferData(BufferType bufferType, T[] bufferArray, BufferUsage usage) => throw signal; - void IglFunc.SetFrameBufferSizeCallback(IntPtr id, FrameBufferSizeHandler handler) => throw signal; - void IglFunc.SetValue(Uniform uniform, float v0, float v1, float v2, float v3) => throw signal; void IglFunc.SetValue(Uniform uniform, Vec4d vec) => throw signal; @@ -98,17 +93,13 @@ namespace StgSharp.Graphics void IglFunc.SetValue(Uniform uniform, Vec4d vec) => throw signal; - void IglFunc.SetVertexAttribute(uint index, int size, Type t, bool normalized, uint stride, int pointer) => throw signal; + void IglFunc.SetVertexAttribute(uint index, int size, TypeCode t, bool normalized, uint stride, int pointer) => throw signal; - void IglFunc.SetWindowShouldClose(Form form, bool mark) => throw signal; + unsafe void IglFunc.TextureImage2d(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, T[] pixels) => throw signal; - void IglFunc.SwapBuffers(Form form) => throw signal; + void IglFunc.TextureParameter(int target, uint pname, int param) => throw signal; - unsafe void IglFunc.TextureImage2d(uint target, int level, uint internalformat, uint width, uint height, uint format, uint type, void* pixels) => throw signal; - - void IglFunc.TextureParameter(uint target, uint pname, int param) => throw signal; - - void IglFunc.UseProgram(uint program) => throw signal; + void IglFunc.UseProgram(glHandle program) => throw signal; void IglFunc.Viewport(int x, int y, uint width, uint height) => throw signal; diff --git a/源代码/StgSharp/Graphics/GL/GLonUpdate.cs b/源代码/StgSharp/Graphics/GL/GLonUpdate.cs index dcbbfc80..2a04dc33 100644 --- a/源代码/StgSharp/Graphics/GL/GLonUpdate.cs +++ b/源代码/StgSharp/Graphics/GL/GLonUpdate.cs @@ -16,10 +16,12 @@ namespace StgSharp.Graphics internal unsafe partial class GLonUpdate : IglFunc { - private ConcurrentQueue glActionQueue; + private static ConcurrentQueue glActionQueue; private static GLparamQueue paramQueue; private FrameTimeoutException refreshSignal = new(); + private IntPtr SwapBufferPtr = (IntPtr)(delegate*)&InternalIO.glfwSwapBuffers; + internal GLonUpdate(GLcontext* context) { if (paramQueue == null) @@ -29,6 +31,11 @@ namespace StgSharp.Graphics glActionQueue = new ConcurrentQueue(); } + internal static GLparamQueue ParamQueue + { + get { return paramQueue; } + } + internal ConcurrentQueue GLactionQueue { get @@ -36,13 +43,13 @@ namespace StgSharp.Graphics return glActionQueue; } } + void IglFunc.ActiveTexture(uint type) { paramQueue.Enqueue(type); glActionQueue.Enqueue(ActiveTexturePtr); } - void IglFunc.AfterAlign(Form form, Action action) { throw new NotImplementedException(); @@ -77,9 +84,11 @@ namespace StgSharp.Graphics } [MethodImpl(MethodImplOptions.AggressiveInlining)] - void IglFunc.BindTexture(uint type, uint texture) + void IglFunc.BindTexture(uint type, glHandle texture) { - paramQueue.Enqueue(type, texture); + M128 m = new M128 { IntPtr1 = (IntPtr)texture.valuePtr }; + m.UInt32[0] = (uint)type; + paramQueue.Enqueue(m); glActionQueue.Enqueue(BindTexturePtr); } @@ -109,12 +118,6 @@ namespace StgSharp.Graphics glActionQueue.Enqueue(ClearGraphicErrorPtr); } - //TODO:双线程,换运行环境 - void IglFunc.SwitchContext() - { - - } - glHandleSet IglFunc.CompileShader(ShaderType shaderType, params string[] shaderCode) { int l = shaderCode.Length; @@ -133,7 +136,6 @@ namespace StgSharp.Graphics return shaderHandle; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] glHandle IglFunc.CreateProgram() { @@ -161,12 +163,12 @@ namespace StgSharp.Graphics IntPtr windowPtr; if (share == null) { - windowPtr = InternalIO.glfw.CreateWindow( + windowPtr = InternalIO.glfwCreateWindow( width, height, tittleBytes, monitor, IntPtr.Zero); } else { - windowPtr = InternalIO.glfw.CreateWindow( + windowPtr = InternalIO.glfwCreateWindow( width, height, tittleBytes, monitor, share.windowID); } @@ -180,7 +182,6 @@ namespace StgSharp.Graphics } } - [MethodImpl(MethodImplOptions.AggressiveInlining)] glHandle IglFunc.CreatGraphicProgram() { @@ -208,25 +209,18 @@ namespace StgSharp.Graphics glActionQueue.Enqueue(DeleBufferPtr); } - //TODO: 从这里开始 unsafe void IglFunc.DeleteVertexArrays(glHandleSet arrays) { - glActionQueue.Enqueue( - () => - { - uint[] target = arrays; - fixed (uint* ptr = target) - { - api->glDeleteVertexArrays(count, ptr); - } - } - ); + M128 m = new() { IntPtr1 = (IntPtr)arrays.handle }; + m.Int32[0] = arrays.length; + paramQueue.Enqueue(m); + glActionQueue.Enqueue(DeleteVertexArrayPtr); } - void IglFunc.DrawElements(GepmetryType mode, uint count, Type type, IntPtr ptr) + void IglFunc.DrawElements(GepmetryType mode, uint count, TypeCode type, IntPtr ptr) { uint a; - switch (Type.GetTypeCode(type)) + switch (type) { case TypeCode.UInt32: a = GLconst.UNSIGNED_INT; @@ -239,73 +233,60 @@ namespace StgSharp.Graphics break; default: InternalIO.InternalWriteLog( - $"Parameter error in parameter {nameof(type)} method DrawElements. " + - $"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are suporrted.", + $"Parameter error in parameter {type} method DrawElements. " + + $"Only {TypeCode.Byte}, {TypeCode.UInt16}, {TypeCode.UInt32} types are suporrted.", LogType.Error); return; } - glActionQueue.Enqueue( - () => - { api->glDrawElements((uint)mode, count, a, (void*)ptr); } - ); + paramQueue.Enqueue((uint)mode, count, a); + paramQueue.Enqueue(ptr); + glActionQueue.Enqueue(DrawElementsPtr); } - unsafe void IglFunc.GenBuffers(uint count, glHandleSet handle) + unsafe glHandleSet IglFunc.GenBuffers(int count) { - glActionQueue.Enqueue( - () => - { - } - ); + glHandleSet h = new glHandleSet(count); + M128 m = default; m.UInt32[2] = (uint)count; m.IntPtr0 = (IntPtr)h.handle; + paramQueue.Enqueue(m); + glActionQueue.Enqueue(GenBufferPtr); + return h; } - unsafe void IglFunc.GenTextures(uint count, glHandleSet handle) + unsafe glHandleSet IglFunc.GenTextures(int count) { - glActionQueue.Enqueue( - () => - { - } - ); + glHandleSet h = new glHandleSet(count); + M128 m = default; m.UInt32[2] = (uint)count; m.IntPtr0 = (IntPtr)h.handle; + paramQueue.Enqueue(m); + glActionQueue.Enqueue(GenTexturesPtr); + return h; } - unsafe void IglFunc.GenVertexArrays(uint count, glHandleSet ptr) + unsafe glHandleSet IglFunc.GenVertexArrays(int count) { - glActionQueue.Enqueue( - () => - { - api->glGenVertexArrays(count, ptr); - } - ); + glHandleSet h = new glHandleSet(count); + M128 m = default; m.UInt32[2] = (uint)count; m.IntPtr0 = (IntPtr)h.handle; + paramQueue.Enqueue(m); + glActionQueue.Enqueue(GenTexturesPtr); + return h; } - public void GetGraphicError() + [MethodImpl(MethodImplOptions.AggressiveInlining)] + unsafe glSHandle IglFunc.GetUniformLocation(glHandle program, string ptr) { - throw new NotImplementedException(); - } - - void IglFunc.GetGraphicError() - { - throw new NotImplementedException(); - } - - unsafe int IglFunc.GetUniformLocation(uint program, byte* ptr) - { - int ret = -1; - glActionQueue.Enqueue( - () => - { - int location = api->glGetUniformLocation(program, ptr); - Interlocked.Add(ref ret, location + 1); - } - ); - while (ret < 0) { } - return ret; + glSHandle h = glSHandle.Alloc(0); + M128 m; + m.IntPtr0 = program.Handle; + m.IntPtr1 = GCHandle.Alloc(Encoding.UTF8.GetBytes(ptr)).AddrOfPinnedObject(); + paramQueue.Enqueue(m); + paramQueue.Enqueue((IntPtr)h.valuePtr); + glActionQueue.Enqueue(GetUniformLocationPtr); + return h; } [MethodImpl(MethodImplOptions.AggressiveInlining)] bool IglFunc.GetWindowShouldClose(Form form) { - return InternalIO.glfw.WindowShouldClose(form.windowID) == 0; + return InternalIO.glfwWindowShouldClose(form.windowID) == 0; } public void GLswapBuffers(Form form) @@ -314,7 +295,7 @@ namespace StgSharp.Graphics { return; } - InternalIO.glfw.SwapBuffers(form.windowID); + InternalIO.glfwSwapBuffers(form.windowID); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -324,120 +305,77 @@ namespace StgSharp.Graphics { return; } - InternalIO.glfw.MakeContextCurrent(form.windowID); + InternalIO.glfwMakeContextCurrent(form.windowID); } void IglFunc.SetBufferData(BufferType bufferType, T bufferData, BufferUsage usage) { - glActionQueue.Enqueue( - () => - { - T data = bufferData; - int size = sizeof(T); - api->glBufferData( - (uint)bufferType, - (UIntPtr)size, - &data, - (uint)usage); - } - ); + paramQueue.Enqueue((uint)bufferType, (uint)usage); + paramQueue.Enqueue((IntPtr)sizeof(T), GCHandle.Alloc(bufferData).AddrOfPinnedObject()); + glActionQueue.Enqueue(BufferDataPtr); } void IglFunc.SetBufferData(BufferType bufferType, T[] bufferArray, BufferUsage usage) { - glActionQueue.Enqueue( - () => - { - int size = bufferArray.Length * Marshal.SizeOf(typeof(T)); - if (bufferArray == null) - { - return; - } - fixed (void* bufferPtr = bufferArray) - api->glBufferData( - (uint)bufferType, - (UIntPtr)size, - bufferPtr, - (uint)usage); - } - ); + paramQueue.Enqueue((uint)bufferType, (uint)usage); + paramQueue.Enqueue((IntPtr)(Marshal.SizeOf() * bufferArray.Length), GCHandle.Alloc(bufferArray).AddrOfPinnedObject()); + glActionQueue.Enqueue(BufferDataPtr); } - void IglFunc.SetFrameBufferSizeCallback(IntPtr id, FrameBufferSizeHandler handler) + void IglFunc.SetVertexAttribute(uint index, int size, TypeCode t, bool normalized, uint stride, int pointer) { - IntPtr handlerPtr = Marshal.GetFunctionPointerForDelegate(handler); - InternalIO.glfw.SetFramebufferSizeCallback(id, handlerPtr); + uint type = InternalIO.GLtype[t]; + paramQueue.Enqueue(index, type, stride); + paramQueue.Enqueue(size, normalized ? 1 : 0, pointer); + glActionQueue.Enqueue(SetVertexArrayPtr); } - void IglFunc.SetVertexAttribute(uint index, int size, Type t, bool normalized, uint stride, int pointer) + //TODO:双线程,换运行环境 + void IglFunc.SwitchContext() { - glActionQueue.Enqueue( - () => - { - uint type = InternalIO.GLtype[t]; - api->glVertexAttribPointer(index, size, type, normalized, stride, (void*)pointer); - api->glEnableVertexAttribArray(index); - } - ); + } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - unsafe void IglFunc.SetWindowShouldClose(Form form, bool mark) + unsafe void IglFunc.TextureImage2d(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, T[] pixels) { - InternalIO.glfw.SetWindowShouldClose(form.windowID, mark ? 1 : 0); - } - void IglFunc.SwapBuffers(Form form) - { - glActionQueue.Enqueue( - () => - { - if (form.windowID == IntPtr.Zero) - { - return; - } - InternalIO.glfw.SwapBuffers(form.windowID); - } - ); + IntPtr source = GCHandle.Alloc(pixels, GCHandleType.Pinned).AddrOfPinnedObject(); + paramQueue.Enqueue(source); + paramQueue.Enqueue((uint)level, internalformat, width, height); + paramQueue.Enqueue((uint)target, format, type); + glActionQueue.Enqueue(textureImage2dPtr); } - unsafe void IglFunc.TextureImage2d(uint target, int level, uint internalformat, uint width, uint height, uint format, uint type, void* pixels) + void IglFunc.TextureParameter(int target, uint pname, int param) { - glActionQueue.Enqueue( - () => - { - api->glTexImage2D(target, level, internalformat, width, height, 0, format, type, pixels); - } - ); + M128 m = default; + m.Int32[0] = target; + m.UInt32[2] = pname; + m.Int32[3] = param; + paramQueue.Enqueue(m); + glActionQueue.Enqueue(TextureParameterPtr); } - void IglFunc.TextureParameter(uint target, uint pname, int param) + void IglFunc.UseProgram(glHandle program) { - glActionQueue.Enqueue( - () => - { - api->glTextureParameteri(target, pname, param); - } - ); - } - - void IglFunc.UseProgram(uint rogram) - { - glActionQueue.Enqueue( - () => - { - api->glUseProgram(rogram); - } - ); + paramQueue.Enqueue((IntPtr)program.valuePtr); + glActionQueue.Enqueue(UseProgramPtr); } void IglFunc.Viewport(int x, int y, uint width, uint height) { - glActionQueue.Enqueue( - () => - { - api->glViewport(x, y, width, height); - } - ); + Vec4d v = new Vec4d(x, y, (int)width, (int)height); + paramQueue.Enqueue(v); + glActionQueue.Enqueue(ViewPortPtr); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void frameworkHandleEnqueue(IntPtr methodHandle, params M128[] param) + { + glActionQueue.Enqueue(methodHandle); + foreach (M128 item in param) + { + paramQueue.Enqueue(item); + } } } } diff --git a/源代码/StgSharp/Graphics/GL/GLonUpdateInternal.cs b/源代码/StgSharp/Graphics/GL/GLonUpdateInternal.cs index 9db32368..07b7852a 100644 --- a/源代码/StgSharp/Graphics/GL/GLonUpdateInternal.cs +++ b/源代码/StgSharp/Graphics/GL/GLonUpdateInternal.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; @@ -13,15 +14,30 @@ namespace StgSharp.Graphics { internal unsafe partial class GLonUpdate : IglFunc { - internal IntPtr ActiveTexturePtr = (IntPtr)(delegate*)&InternalActiveTexture; - internal IntPtr AttachShaderPtr = (IntPtr)(delegate*)&InternalAttachShader; - internal IntPtr BindBufferPtr = (IntPtr)(delegate*)&InternalBindBuffer; - internal IntPtr ClearColorPtr = (IntPtr)(delegate*)&InternalClearColor; - internal IntPtr ClearGraphicErrorPtr = (IntPtr)(delegate*)&InternalClearGraphicError; - internal IntPtr CompileShaderPtr = (IntPtr)(delegate*)&InternalCompileShader; - IntPtr BindTexturePtr = (IntPtr)(delegate*)&InternalBindTexture; - IntPtr BindVertexArrayPtr = (IntPtr)(delegate*)&InternalBindVertexArray; + private IntPtr ActiveTexturePtr = (IntPtr)(delegate*)&InternalActiveTexture; + private IntPtr AttachShaderPtr = (IntPtr)(delegate*)&InternalAttachShader; + private IntPtr BindBufferPtr = (IntPtr)(delegate*)&InternalBindBuffer; + private IntPtr ClearColorPtr = (IntPtr)(delegate*)&InternalClearColor; + private IntPtr ClearGraphicErrorPtr = (IntPtr)(delegate*)&InternalClearGraphicError; + private IntPtr CompileShaderPtr = (IntPtr)(delegate*)&InternalCompileShader; + private IntPtr DeleBufferPtr = (IntPtr)(delegate*)&InternalDeleteBuffer; + private IntPtr BindTexturePtr = (IntPtr)(delegate*)&InternalBindTexture; + private IntPtr BindVertexArrayPtr = (IntPtr)(delegate*)&InternalBindVertexArray; + private IntPtr BufferDataPtr = (IntPtr)(delegate*)&InternalSetBufferData; private IntPtr ClearPtr = (IntPtr)(delegate*)&InternalClear; + private IntPtr CreateProgramPtr = (IntPtr)(delegate*)&InternalCreateProgram; + private IntPtr CreateProgramSetPtr = (IntPtr)(delegate*)&InternalCreateProgramSet; + private IntPtr DeleteVertexArrayPtr = (IntPtr)(delegate*)&InternalDeleteVertexArrays; + private IntPtr DrawElementsPtr = (IntPtr)(delegate*)&InternalDrawElements; + private IntPtr GenBufferPtr = (IntPtr)(delegate*)&InternalGenBuffers; + private IntPtr GenTexturesPtr = (IntPtr)(delegate*)&InternalGenTextures; + private IntPtr GenVertexArraysPtr = (IntPtr)(delegate*)&InternalGenVertexArrays; + private IntPtr GetUniformLocationPtr = (IntPtr)(delegate*)&InternalGetUniformLocation; + private IntPtr SetVertexArrayPtr = (IntPtr)(delegate*)&InternalSetVertexAttribute; + private IntPtr textureImage2dPtr = (IntPtr)(delegate*)&InternalTextureImage2d; + private IntPtr TextureParameterPtr = (IntPtr)(delegate*)&InternalTextureParameter; + private IntPtr UseProgramPtr = (IntPtr)(delegate*)&InternalUseProgram; + private IntPtr ViewPortPtr = (IntPtr)(delegate*)&InternalViewport; private static void InternalActiveTexture() { @@ -46,9 +62,9 @@ namespace StgSharp.Graphics private static void InternalBindTexture() { - uint t, te; - paramQueue.TryDequeue(out t, out te); - paramQueue.context->glBindTexture(t, te); + M128 m = default; + paramQueue.TryDequeue(out m); + paramQueue.context->glBindTexture(m.UInt32[0], *(uint*)m.IntPtr1); } private static void InternalBindVertexArray() @@ -121,17 +137,6 @@ namespace StgSharp.Graphics } } - private void InternalAfterAlign(Form form, Action action) - { - throw new NotImplementedException(); - } - - private void InternalAlignFrame(Form form) - { - throw new NotImplementedException(); - } - - IntPtr CreateProgramPtr = (IntPtr)(delegate*)&InternalCreateProgram; private static void InternalCreateProgram() { IntPtr programHandle = default; @@ -139,8 +144,6 @@ namespace StgSharp.Graphics *(uint*)programHandle = paramQueue.context->glCreateProgram(); } - - IntPtr CreateProgramSetPtr = (IntPtr)(delegate*)&InternalCreateProgramSet; private static void InternalCreateProgramSet() { IntPtr programHandle; @@ -153,8 +156,6 @@ namespace StgSharp.Graphics } } - internal IntPtr DeleBufferPtr = (IntPtr)(delegate*)&InternalDeleteBuffer; - private static void InternalDeleteBuffer() { M128 m = default; @@ -162,44 +163,101 @@ namespace StgSharp.Graphics paramQueue.context->glDeleteBuffers(m.UInt32[2], (uint*)m.IntPtr0); } - private void InternalDeleteVertexArrays(glHandleSet arrays) + private static void InternalDeleteVertexArrays() { - throw new NotImplementedException(); + M128 m = default; + paramQueue.TryDequeue(out m); + paramQueue.context->glDeleteVertexArrays((uint)m.Int32[0], (uint*)m.IntPtr1); } - private void InternalDrawElements(GepmetryType mode, uint count, Type type, IntPtr ptr) + private static void InternalDrawElements() { - throw new NotImplementedException(); + uint mode, count, type; + IntPtr ptr; + paramQueue.TryDequeue(out mode, out count, out type); + paramQueue.TryDequeue(out ptr); + paramQueue.context->glDrawElements(mode, count, type, (void*)ptr); } - private void InternalGenBuffers(uint count, glHandleSet ptr) + private static void InternalGenBuffers() { - throw new NotImplementedException(); + M128 m = default; + paramQueue.TryDequeue(out m); + paramQueue.context->glGenBuffers(m.UInt32[2], (uint*)m.IntPtr0); } - private void InternalGenTextures(uint count, glHandleSet ptr) + private static void InternalGenTextures() { - throw new NotImplementedException(); + M128 m = default; + paramQueue.TryDequeue(out m); + paramQueue.context->glGenTextures(m.UInt32[2], (uint*)m.IntPtr0); } - private void InternalGenVertexArrays(uint count, glHandleSet ptr) + private static void InternalGenVertexArrays() { - throw new NotImplementedException(); + M128 m = default; + paramQueue.TryDequeue(out m); + paramQueue.context->glGenVertexArrays(m.UInt32[2], (uint*)m.IntPtr0); } - private void InternalGetGraphicError() + private static void InternalGetUniformLocation() { - throw new NotImplementedException(); + IntPtr programHandle = default, nameHandle = default, targetHandle = default; + paramQueue.TryDequeue(out programHandle, out nameHandle); + paramQueue.TryDequeue(out targetHandle); + *(int*)targetHandle = paramQueue.context->glGetUniformLocation(*(uint*)programHandle, (byte*)nameHandle); } - private int InternalGetUniformLocation(uint program, byte* ptr) + private static void InternalSetBufferData() { - throw new NotImplementedException(); + uint type = 0, use = 0; + IntPtr size = default, handle = default; + paramQueue.TryDequeue(out type, out use); + paramQueue.TryDequeue(out size, out handle); + paramQueue.context->glBufferData(type, size, (void*)handle, use); + GCHandle.FromIntPtr(handle).Free(); } - private bool InternalGetWindowShouldClose(Form form) + private static void InternalSetVertexAttribute() { - throw new NotImplementedException(); + uint index, type, stride; + int size, normalized, pointer; + paramQueue.TryDequeue(out index, out type, out stride); + paramQueue.TryDequeue(out size, out normalized, out pointer); + paramQueue.context->glVertexAttribPointer(index, size, type, normalized, stride, (void*)pointer); + paramQueue.context->glEnableVertexAttribArray(index); + } + + private static void InternalTextureImage2d() + { + IntPtr pix = IntPtr.Zero; + uint target, level, internalFormat, width, height, format, type; + paramQueue.TryDequeue(out pix); + paramQueue.TryDequeue(out level, out internalFormat, out width, out height); + paramQueue.TryDequeue(out target, out format, out type); + paramQueue.context->glTexImage2D(target, (int)level, internalFormat, width, height, 0, format, type, (void*)pix); + GCHandle.FromIntPtr(pix).Free(); + } + + private static void InternalTextureParameter() + { + M128 m = default; + paramQueue.TryDequeue(out m); + paramQueue.context->glTextureParameteri(m.UInt32[0], m.UInt32[2], m.Int32[3]); + } + + private static void InternalUseProgram() + { + IntPtr handle = IntPtr.Zero; + paramQueue.TryDequeue(out handle); + paramQueue.context->glUseProgram(*(uint*)handle); + } + + private static void InternalViewport() + { + M128 m = default; + paramQueue.TryDequeue(out m); + paramQueue.context->glViewport(m.Int32[0], m.Int32[1], m.UInt32[2], m.UInt32[3]); } private void InternalMakeContexCurrent(Form form) @@ -207,94 +265,14 @@ namespace StgSharp.Graphics throw new NotImplementedException(); } - private void InternalSetBufferData(BufferType bufferType, T bufferData, BufferUsage usage) - { - throw new NotImplementedException(); - } - - private void InternalSetBufferData(BufferType bufferType, T[] bufferArray, BufferUsage usage) - { - throw new NotImplementedException(); - } - - private void InternalSetFrameBufferSizeCallback(IntPtr id, FrameBufferSizeHandler handler) - { - throw new NotImplementedException(); - } - private void InternalSetValue(Uniform uniform, float v0, float v1, float v2, float v3) { throw new NotImplementedException(); } - private void InternalSetValue(Uniform uniform, Vec4d vec) - { - throw new NotImplementedException(); - } - - private void InternalSetValue(Uniform uniform, float v0, float v1, float v2) - { - throw new NotImplementedException(); - } - - private void InternalSetValue(Uniform uniform, float v0, float v1) - { - throw new NotImplementedException(); - } - - private void InternalSetValue(Uniform uniform, float v0) - { - throw new NotImplementedException(); - } - - private void InternalSetValue(Uniform uniform, int i0) - { - throw new NotImplementedException(); - } - - private void InternalSetValue(Uniform uniform, Vec4d vec) - { - throw new NotImplementedException(); - } - - private void InternalSetVertexAttribute(uint index, int size, Type t, bool normalized, uint stride, int pointer) - { - throw new NotImplementedException(); - } - - private void InternalSetWindowShouldClose(Form form, bool mark) - { - throw new NotImplementedException(); - } - - private void InternalSwapBuffers(Form form) - { - throw new NotImplementedException(); - } - private void InternalSwitchContext() { throw new NotImplementedException(); } - - private void InternalTextureImage2d(uint target, int level, uint internalformat, uint width, uint height, uint format, uint type, void* pixels) - { - throw new NotImplementedException(); - } - - private void InternalTextureParameter(uint target, uint pname, int param) - { - throw new NotImplementedException(); - } - - private void InternalUseProgram(uint program) - { - throw new NotImplementedException(); - } - - private void InternalViewport(int x, int y, uint width, uint height) - { - throw new NotImplementedException(); - } } } diff --git a/源代码/StgSharp/Graphics/GL/GLresourceGenrator.cs b/源代码/StgSharp/Graphics/GL/GLresourceGenrator.cs index 2d9ee38a..a2ba05c5 100644 --- a/源代码/StgSharp/Graphics/GL/GLresourceGenrator.cs +++ b/源代码/StgSharp/Graphics/GL/GLresourceGenrator.cs @@ -15,7 +15,7 @@ namespace StgSharp.Graphics /// Amount of EBO to be created. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected ElementBuffer CreateElementBuffer(uint count) + protected ElementBuffer CreateElementBuffer(int count) { return new ElementBuffer(count, this.gl); } @@ -27,7 +27,7 @@ namespace StgSharp.Graphics /// Amount of VAO to be crated. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected VertexArray CreateVertexArray(uint count) + protected VertexArray CreateVertexArray(int count) { return new VertexArray(count, gl); } @@ -35,22 +35,21 @@ namespace StgSharp.Graphics /// /// Create a sets of /// - /// Amount of textures to be crated. + /// Amount of textures to be crated. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected Texture CreateTexture(uint n) + protected Texture CreateTexture(int count) { - return new Texture(n, this.GL); + return new Texture(count, this.GL); } - /// /// Create aset of . /// /// Amount of Object to be created. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected VertexBuffer CreateVertexBuffer(uint count) + protected VertexBuffer CreateVertexBuffer(int count) { return new VertexBuffer(count, gl); } diff --git a/源代码/StgSharp/Graphics/GL/ShaderEdit/Shader.cs b/源代码/StgSharp/Graphics/GL/ShaderEdit/Shader.cs index 6f503294..2579f7c3 100644 --- a/源代码/StgSharp/Graphics/GL/ShaderEdit/Shader.cs +++ b/源代码/StgSharp/Graphics/GL/ShaderEdit/Shader.cs @@ -14,33 +14,37 @@ namespace StgSharp.Graphics /// /// New instance of instance. [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected ShaderProgram CreateShaderProgram(ShaderType shaderType) + protected ShaderProgram CreateShaderProgram() { - return new ShaderProgram(GL, 1); + return new ShaderProgram(GL); + } + + protected Shader CreateShader(ShaderType type, int count) + { + return new Shader(this.gl, new glHandleSet(count), type); } } public class Shader { - internal readonly glHandle handle; + internal readonly glHandleSet handle; public readonly ShaderType type; private readonly IglFunc GL; - - - internal Shader(IglFunc gl, glHandle handle) + internal Shader(IglFunc gl, glHandleSet handle, ShaderType usage) { this.handle = handle; GL = gl; + type = usage; } /// /// Compile the vertex shader to be attached to this shader. /// /// GLSL code of vertex shader. - public unsafe void Compile(string shaderCode, ShaderType usage, int index) + public unsafe void Compile(ShaderType usage, params string[] code) { - handle.handle[index] = GL.CompileShader(shaderCode, type).handle; + glHandleSet.Copy(GL.CompileShader(usage, code), handle); } //TODO:写链接着色器的文档注释 @@ -48,20 +52,11 @@ namespace StgSharp.Graphics /// /// /// - /// - public void AttachTo(ShaderProgram target, ShaderType usage) + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void AttachTo(int index, ShaderProgram target) { - switch (usage) - { - case ShaderType.Fragment: - - break; - case ShaderType.Vertex: - GL.AttachShader(target.handle,) - break; - default: - throw new ArgumentException(); - } + GL.AttachShader(target.handle, handle[index]); } } @@ -74,7 +69,7 @@ namespace StgSharp.Graphics /// /// Inti a shader with no program attached. /// - internal unsafe ShaderProgram(IglFunc gl, int count) + internal unsafe ShaderProgram(IglFunc gl) { GL = gl; handle = GL.CreateProgram(); @@ -85,7 +80,7 @@ namespace StgSharp.Graphics /// public void Link() { - if (InternalIO.InternalLinkShaderProgram(handle[0]) == 0) + if (InternalIO.InternalLinkShaderProgram(handle.Value) == 0) { IntPtr logPtr = InternalIO.InternalReadLog(); try @@ -109,22 +104,10 @@ namespace StgSharp.Graphics /// /// Name of the Uniform in shader code /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe Uniform GetUniform(string name) where T : struct { - byte[] bytes = Encoding.ASCII.GetBytes(name); - int uniform; - fixed (byte* ptr = bytes) - { - uniform = GL.GetUniformLocation(handle[0], ptr); - } - if (uniform != -1) - { - return new Uniform(uniform); - } - else - { - throw new Exception($"Cannot find the uniform {name} in shader {handle[0]}"); - } + return new Uniform(this, name, GL); } /// /// Get a uniform form current shader, @@ -136,20 +119,7 @@ namespace StgSharp.Graphics where T : struct where U : struct { - byte[] bytes = Encoding.ASCII.GetBytes(name); - int uniform; - fixed (byte* ptr = bytes) - { - uniform = GL.GetUniformLocation(handle[0], ptr); - } - if (uniform != -1) - { - return new Uniform(uniform); - } - else - { - throw new Exception($"Cannot find the uniform {name} in shader {handle[0]}"); - } + return new Uniform(this, name, GL); } /// /// Get a uniform form current shader, @@ -157,34 +127,21 @@ namespace StgSharp.Graphics /// /// Name of the Uniform in shader code /// - public unsafe Uniform GetUniform(int index, string name) + public unsafe Uniform GetUniform(string name) where T : struct where U : struct where V : struct { - byte[] bytes = Encoding.ASCII.GetBytes(name); - int uniform; - fixed (byte* ptr = bytes) - { - uniform = GL.GetUniformLocation(handle[index], ptr); - } - if (uniform != -1) - { - return new Uniform(uniform); - } - else - { - throw new Exception($"Cannot find the uniform {name} in shader {handle[index]}"); - } + return new Uniform(this, name, GL); } /// /// Let the current context use this shader. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void Use(int index) + public unsafe void Use() { - GL.UseProgram(handle[index]); + GL.UseProgram(handle); } } diff --git a/源代码/StgSharp/Graphics/GL/ShaderEdit/Uniform.cs b/源代码/StgSharp/Graphics/GL/ShaderEdit/Uniform.cs index 0b41a032..83ccead6 100644 --- a/源代码/StgSharp/Graphics/GL/ShaderEdit/Uniform.cs +++ b/源代码/StgSharp/Graphics/GL/ShaderEdit/Uniform.cs @@ -11,21 +11,17 @@ namespace StgSharp.Graphics public class Uniform where T : struct { - internal int id; + internal glSHandle id; private IglFunc GL; internal unsafe Uniform( - uint shaderID, string name, IglFunc gL) + ShaderProgram program, string name, IglFunc gl) { - byte[] namearray = Encoding.ASCII.GetBytes(name); - GL = gL; - fixed (byte* ptr = namearray) - { - id = GL.GetUniformLocation(shaderID, ptr); - } + GL = gl; + id = GL.GetUniformLocation(program.handle, name); } - internal unsafe Uniform(int id) + internal unsafe Uniform(glSHandle id) { this.id = id; } @@ -37,21 +33,17 @@ namespace StgSharp.Graphics where T : struct where U : struct { - internal int id; + internal glSHandle id; private IglFunc GL; internal unsafe Uniform( - Shader program, string name, IglFunc glFunc) + ShaderProgram program, string name, IglFunc gl) { - byte[] namearray = Encoding.ASCII.GetBytes(name); - GL = glFunc; - fixed (byte* ptr = namearray) - { - id = GL.GetUniformLocation(program.programID, ptr); - } + GL = gl; + id = GL.GetUniformLocation(program.handle, name); } - internal unsafe Uniform(int id) + internal unsafe Uniform(glSHandle id) { this.id = id; } @@ -62,20 +54,16 @@ namespace StgSharp.Graphics where U : struct where V : struct { - internal int id; + internal glSHandle id; private IglFunc GL; - public unsafe Uniform(Shader program, string name, IglFunc glFunc) + public unsafe Uniform(ShaderProgram program, string name, IglFunc gl) { - byte[] namearray = Encoding.ASCII.GetBytes(name); - GL = glFunc; - fixed (byte* ptr = namearray) - { - id = GL.GetUniformLocation(program.programID, ptr); - } + GL = gl; + id = GL.GetUniformLocation(program.handle, name); } - internal unsafe Uniform(int id) + internal unsafe Uniform(glSHandle id) { this.id = id; } @@ -87,20 +75,16 @@ namespace StgSharp.Graphics where V : struct where W : struct { - internal int id; + internal glSHandle id; private IglFunc GL; - internal unsafe Uniform(Shader program, string name, IglFunc glFunc) + internal unsafe Uniform(ShaderProgram program, string name, IglFunc gl) { - byte[] namearray = Encoding.ASCII.GetBytes(name); - fixed (byte* ptr = namearray) - { - id = GL.GetUniformLocation(program.programID, ptr); - } - GL = glFunc; + GL = gl; + id = GL.GetUniformLocation(program.handle, name); } - internal unsafe Uniform(int id) + internal unsafe Uniform(glSHandle id) { this.id = id; } @@ -113,48 +97,56 @@ namespace StgSharp.Graphics [MethodImpl(MethodImplOptions.AggressiveInlining)] unsafe void IglFunc.SetValue(Uniform uniform, float v0) { - api->glUniform1f(uniform.id, v0); + api->glUniform1f(uniform.id.DirectValue, v0); } [MethodImpl(MethodImplOptions.AggressiveInlining)] unsafe void IglFunc.SetValue(Uniform uniform, int i0) { - api->glUniform1i(uniform.id, i0); + api->glUniform1i(uniform.id.DirectValue, i0); } [MethodImpl(MethodImplOptions.AggressiveInlining)] unsafe void IglFunc.SetValue(Uniform uniform, float v0, float v1) { - api->glUniform2f(uniform.id, v0, v1); + api->glUniform2f(uniform.id.DirectValue, v0, v1); } [MethodImpl(MethodImplOptions.AggressiveInlining)] unsafe void IglFunc.SetValue(Uniform uniform, float v0, float v1, float v2) { - api->glUniform3f(uniform.id, v0, v1, v2); + api->glUniform3f(uniform.id.DirectValue, v0, v1, v2); } [MethodImpl(MethodImplOptions.AggressiveInlining)] unsafe void IglFunc.SetValue(Uniform uniform, float v0, float v1, float v2, float v3) { - api->glUniform4f(uniform.id, v0, v1, v2, v3); + api->glUniform4f(uniform.id.DirectValue, v0, v1, v2, v3); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetValue(Uniform uniform, Vec4d vec) { - api->glUniform1fv(uniform.id, 4, &vec); + api->glUniform1fv(uniform.id.DirectValue, 4, &vec); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetValue(Uniform uniform, Vec4d vec) { - api->glUniform1fv(uniform.id, 4, &vec); + api->glUniform1fv(uniform.id.DirectValue, 4, &vec); } } - internal partial class GLonUpdate + internal unsafe partial class GLonUpdate { + private IntPtr UniformVal3fPtr = (IntPtr)(delegate*)&UniformVal3f; + //TODO xontinue here + private static void UniformVal3f() + { + + paramQueue. + } + unsafe void IglFunc.SetValue(Uniform uniform, float v0, float v1, float v2) { glActionQueue.Enqueue( diff --git a/源代码/StgSharp/Graphics/GL/framework.cs b/源代码/StgSharp/Graphics/GL/framework.cs index 5f2d6d0c..b5effb92 100644 --- a/源代码/StgSharp/Graphics/GL/framework.cs +++ b/源代码/StgSharp/Graphics/GL/framework.cs @@ -1,631 +1,136 @@ -using System; +using StgSharp.Graphics; +using System; using System.Collections.Generic; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -namespace StgSharp.Graphics +namespace StgSharp { - internal interface IglFramework - { - internal int Init(); - internal unsafe void Terminate(); - internal unsafe void InitHint(int hint, int value); - internal unsafe void GetVersion(int* major, int* minor, int* rev); - internal unsafe byte* GetVersionString(); - internal unsafe int GetError(byte** description); - internal unsafe GLFWerrorfun SetErrorCallback(GLFWerrorfun callback); - internal unsafe IntPtr* GetMonitors(int* count); - internal unsafe IntPtr GetPrimaryMonitor(); - internal unsafe void GetMonitorPos(IntPtr monitor, int* xpos, int* ypos); - internal unsafe void GetMonitorWorkarea(IntPtr monitor, int* xpos, int* ypos, int* width, int* height); - internal unsafe void GetMonitorPhysicalSize(IntPtr monitor, int* widthMM, int* heightMM); - internal unsafe void GetMonitorContentScale(IntPtr monitor, float* xscale, float* yscale); - internal unsafe byte* GetMonitorName(IntPtr monitor); - internal unsafe void SetMonitorUserPointer(IntPtr monitor, void* pointer); - internal unsafe void* GetMonitorUserPointer(IntPtr monitor); - internal unsafe GLFWmonitorfun SetMonitorCallback(GLFWmonitorfun callback); - internal unsafe GLFWvidmode* GetVideoModes(IntPtr monitor, int* count); - internal unsafe GLFWvidmode* GetVideoMode(IntPtr monitor); - internal unsafe void SetGamma(IntPtr monitor, float gamma); - internal unsafe GLFWgammaramp* GetGammaRamp(IntPtr monitor); - internal unsafe void SetGammaRamp(IntPtr monitor, GLFWgammaramp* ramp); - internal unsafe void DefaultWindowHints(); - internal unsafe void WindowHint(int hint, int value); - internal unsafe void WindowHintString(int hint, byte* value); - internal unsafe IntPtr CreateWindow(int width, int height, byte[] title, IntPtr monitor, IntPtr share); - internal unsafe void DestroyWindow(IntPtr window); - internal unsafe int WindowShouldClose(IntPtr window); - internal unsafe void SetWindowShouldClose(IntPtr window, int value); - internal unsafe void SetWindowTitle(IntPtr window, byte* title); - internal unsafe void SetWindowIcon(IntPtr window, int count, GLFWimage* images); - internal unsafe void GetWindowPos(IntPtr window, int* xpos, int* ypos); - internal unsafe void SetWindowPos(IntPtr window, int xpos, int ypos); - internal unsafe void GetWindowSize(IntPtr window, int* width, int* height); - internal unsafe void SetWindowSizeLimits(IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight); - internal unsafe void SetWindowAspectRatio(IntPtr window, int numer, int denom); - internal unsafe void SetWindowSize(IntPtr window, int width, int height); - internal unsafe void GetFramebufferSize(IntPtr window, int* width, int* height); - internal unsafe void GetWindowFrameSize(IntPtr window, int* left, int* top, int* right, int* bottom); - internal unsafe void GetWindowContentScale(IntPtr window, float* xscale, float* yscale); - internal unsafe float GetWindowOpacity(IntPtr window); - internal unsafe void SetWindowOpacity(IntPtr window, float opacity); - internal unsafe void IconifyWindow(IntPtr window); - internal unsafe void RestoreWindow(IntPtr window); - internal unsafe void MaximizeWindow(IntPtr window); - internal unsafe void ShowWindow(IntPtr window); - internal unsafe void HideWindow(IntPtr window); - internal unsafe void FocusWindow(IntPtr window); - internal unsafe void RequestWindowAttention(IntPtr window); - internal unsafe IntPtr GetWindowMonitor(IntPtr window); - internal unsafe void SetWindowMonitor(IntPtr window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate); - internal unsafe int GetWindowAttrib(IntPtr window, int attrib); - internal unsafe void SetWindowAttrib(IntPtr window, int attrib, int value); - internal unsafe void SetWindowUserPointer(IntPtr window, void* pointer); - internal unsafe void* GetWindowUserPointer(IntPtr window); - internal unsafe GLFWwindowposfun SetWindowPosCallback(IntPtr window, GLFWwindowposfun callback); - internal unsafe GLFWwindowsizefun SetWindowSizeCallback(IntPtr window, GLFWwindowsizefun callback); - internal unsafe GLFWwindowclosefun SetWindowCloseCallback(IntPtr window, GLFWwindowclosefun callback); - internal unsafe GLFWwindowrefreshfun SetWindowRefreshCallback(IntPtr window, GLFWwindowrefreshfun callback); - internal unsafe GLFWwindowfocusfun SetWindowFocusCallback(IntPtr window, GLFWwindowfocusfun callback); - internal unsafe GLFWwindowiconifyfun SetWindowIconifyCallback(IntPtr window, GLFWwindowiconifyfun callback); - internal unsafe GLFWwindowmaximizefun SetWindowMaximizeCallback(IntPtr window, GLFWwindowmaximizefun callback); - internal unsafe FramebuffersizeHandler SetFramebufferSizeCallback(IntPtr window, IntPtr callback); - internal unsafe GLFWwindowcontentscalefun SetWindowContentScaleCallback(IntPtr window, GLFWwindowcontentscalefun callback); - internal unsafe void PollEvents(); - internal unsafe void WaitEvents(); - internal unsafe void WaitEventsTimeout(double timeout); - internal unsafe void PostEmptyEvent(); - internal unsafe int GetInputMode(IntPtr window, int mode); - internal unsafe void SetInputMode(IntPtr window, int mode, int value); - internal unsafe int RawMouseMotionSupported(); - internal unsafe byte* GetKeyName(int key, int scancode); - internal unsafe int GetKeyScancode(int key); - internal unsafe KeyStatus GetKey(IntPtr window, int key); - internal unsafe int GetMouseButton(IntPtr window, int button); - internal unsafe void GetCursorPos(IntPtr window, double* xpos, double* ypos); - internal unsafe void SetCursorPos(IntPtr window, double xpos, double ypos); - internal unsafe GLFWcursor* CreateCursor(GLFWimage* image, int xhot, int yhot); - internal unsafe GLFWcursor* CreateStandardCursor(int shape); - internal unsafe void DestroyCursor(GLFWcursor* cursor); - internal unsafe void SetCursor(IntPtr window, GLFWcursor* cursor); - internal unsafe GLFWkeyfun SetKeyCallback(IntPtr window, GLFWkeyfun callback); - internal unsafe GLFWcharfun SetCharCallback(IntPtr window, GLFWcharfun callback); - internal unsafe GLFWcharmodsfun SetCharModsCallback(IntPtr window, GLFWcharmodsfun callback); - internal unsafe GLFWmousebuttonfun SetMouseButtonCallback(IntPtr window, GLFWmousebuttonfun callback); - internal unsafe GLFWcursorposfun SetCursorPosCallback(IntPtr window, GLFWcursorposfun callback); - internal unsafe GLFWcursorenterfun SetCursorEnterCallback(IntPtr window, GLFWcursorenterfun callback); - internal unsafe GLFWscrollfun SetScrollCallback(IntPtr window, GLFWscrollfun callback); - internal unsafe GLFWdropfun SetDropCallback(IntPtr window, GLFWdropfun callback); - internal unsafe int JoystickPresent(int jid); - internal unsafe float* GetJoystickAxes(int jid, int* count); - internal unsafe byte* GetJoystickButtons(int jid, int* count); - internal unsafe byte* GetJoystickHats(int jid, int* count); - internal unsafe byte* GetJoystickName(int jid); - internal unsafe byte* GetJoystickGUID(int jid); - internal unsafe void SetJoystickUserPointer(int jid, void* pointer); - internal unsafe void* GetJoystickUserPointer(int jid); - internal unsafe int JoystickIsGamepad(int jid); - internal unsafe GLFWjoystickfun SetJoystickCallback(GLFWjoystickfun callback); - internal unsafe int UpdateGamepadMappings(byte* str); - internal unsafe byte* GetGamepadName(int jid); - internal unsafe int GetGamepadState(int jid, GLFWgamepadstate* state); - internal unsafe void SetClipboardString(IntPtr window, byte* str); - internal unsafe byte* GetClipboardString(IntPtr window); - internal unsafe double GetTime(); - internal unsafe void SetTime(double time); - internal unsafe ulong* GetTimerValue(); - internal unsafe ulong* GetTimerFrequency(); - internal unsafe void MakeContextCurrent(IntPtr window); - internal unsafe IntPtr GetCurrentContext(); - internal unsafe void SwapBuffers(IntPtr window); - internal unsafe void SwapInterval(int interval); - internal unsafe int ExtensionSupported(byte* extension); - internal unsafe IntPtr GetProcAddress(string procname); - internal unsafe int VulkanSupported(); - internal unsafe byte** GetRequiredInstanceExtensions(uint* count); - //internal unsafe GLFWvkproc GetInstanceProcAddress(VkInstance instance, byte* procname); - //internal unsafe int GetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint* queuefamily); - //internal unsafe VkResult CreateWindowSurface(VkInstance instance, IntPtr window, VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); - - } - - internal class glFramework_PInvoke : IglFramework + internal partial class InternalIO { #region api call - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwInit")] internal extern unsafe static int glfwInit(); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwTerminate")] internal extern unsafe static void glfwTerminate(); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwInitHint")] internal extern unsafe static void glfwInitHint(int hint, int value); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetVersion")] internal extern unsafe static void glfwGetVersion(int* major, int* minor, int* rev); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetVersionString")] internal extern unsafe static byte* glfwGetVersionString(); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetError")] internal extern unsafe static int glfwGetError(byte** description); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetErrorCallback")] internal extern unsafe static GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMonitors")] internal extern unsafe static IntPtr* glfwGetMonitors(int* count); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetPrimaryMonitor")] internal extern unsafe static IntPtr glfwGetPrimaryMonitor(); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMonitorPos")] internal extern unsafe static void glfwGetMonitorPos(IntPtr monitor, int* xpos, int* ypos); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMonitorWorkarea")] internal extern unsafe static void glfwGetMonitorWorkarea(IntPtr monitor, int* xpos, int* ypos, int* width, int* height); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMonitorPhysicalSize")] internal extern unsafe static void glfwGetMonitorPhysicalSize(IntPtr monitor, int* widthMM, int* heightMM); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMonitorContentScale")] internal extern unsafe static void glfwGetMonitorContentScale(IntPtr monitor, float* xscale, float* yscale); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMonitorName")] internal extern unsafe static byte* glfwGetMonitorName(IntPtr monitor); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetMonitorUserPointer")] internal extern unsafe static void glfwSetMonitorUserPointer(IntPtr monitor, void* pointer); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMonitorUserPointer")] internal extern unsafe static void* glfwGetMonitorUserPointer(IntPtr monitor); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetMonitorCallback")] internal extern unsafe static GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetVideoModes")] internal extern unsafe static GLFWvidmode* glfwGetVideoModes(IntPtr monitor, int* count); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetVideoMode")] internal extern unsafe static GLFWvidmode* glfwGetVideoMode(IntPtr monitor); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetGamma")] internal extern unsafe static void glfwSetGamma(IntPtr monitor, float gamma); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetGammaRamp")] internal extern unsafe static GLFWgammaramp* glfwGetGammaRamp(IntPtr monitor); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetGammaRamp")] internal extern unsafe static void glfwSetGammaRamp(IntPtr monitor, GLFWgammaramp* ramp); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwDefaultWindowHints")] internal extern unsafe static void glfwDefaultWindowHints(); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwWindowHint")] internal extern unsafe static void glfwWindowHint(int hint, int value); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwWindowHintString")] internal extern unsafe static void glfwWindowHintString(int hint, byte* value); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwCreateWindow")] internal extern unsafe static IntPtr glfwCreateWindow(int width, int height, byte[] title, IntPtr monitor, IntPtr share); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwDestroyWindow")] internal extern unsafe static void glfwDestroyWindow(IntPtr window); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwWindowShouldClose")] internal extern unsafe static int glfwWindowShouldClose(IntPtr window); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowShouldClose")] internal extern unsafe static void glfwSetWindowShouldClose(IntPtr window, int value); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowTitle")] internal extern unsafe static void glfwSetWindowTitle(IntPtr window, byte* title); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowIcon")] internal extern unsafe static void glfwSetWindowIcon(IntPtr window, int count, GLFWimage* images); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowPos")] internal extern unsafe static void glfwGetWindowPos(IntPtr window, int* xpos, int* ypos); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowPos")] internal extern unsafe static void glfwSetWindowPos(IntPtr window, int xpos, int ypos); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowSize")] internal extern unsafe static void glfwGetWindowSize(IntPtr window, int* width, int* height); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowSizeLimits")] internal extern unsafe static void glfwSetWindowSizeLimits(IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowAspectRatio")] internal extern unsafe static void glfwSetWindowAspectRatio(IntPtr window, int numer, int denom); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowSize")] internal extern unsafe static void glfwSetWindowSize(IntPtr window, int width, int height); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetFramebufferSize")] internal extern unsafe static void glfwGetFramebufferSize(IntPtr window, int* width, int* height); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowFrameSize")] internal extern unsafe static void glfwGetWindowFrameSize(IntPtr window, int* left, int* top, int* right, int* bottom); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowContentScale")] internal extern unsafe static void glfwGetWindowContentScale(IntPtr window, float* xscale, float* yscale); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowOpacity")] internal extern unsafe static float glfwGetWindowOpacity(IntPtr window); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowOpacity")] internal extern unsafe static void glfwSetWindowOpacity(IntPtr window, float opacity); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwIconifyWindow")] internal extern unsafe static void glfwIconifyWindow(IntPtr window); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwRestoreWindow")] internal extern unsafe static void glfwRestoreWindow(IntPtr window); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwMaximizeWindow")] internal extern unsafe static void glfwMaximizeWindow(IntPtr window); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwShowWindow")] internal extern unsafe static void glfwShowWindow(IntPtr window); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwHideWindow")] internal extern unsafe static void glfwHideWindow(IntPtr window); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwFocusWindow")] internal extern unsafe static void glfwFocusWindow(IntPtr window); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwRequestWindowAttention")] internal extern unsafe static void glfwRequestWindowAttention(IntPtr window); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowMonitor")] internal extern unsafe static IntPtr glfwGetWindowMonitor(IntPtr window); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowMonitor")] internal extern unsafe static void glfwSetWindowMonitor(IntPtr window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowAttrib")] internal extern unsafe static int glfwGetWindowAttrib(IntPtr window, int attrib); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowAttrib")] internal extern unsafe static void glfwSetWindowAttrib(IntPtr window, int attrib, int value); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowUserPointer")] internal extern unsafe static void glfwSetWindowUserPointer(IntPtr window, void* pointer); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetWindowUserPointer")] internal extern unsafe static void* glfwGetWindowUserPointer(IntPtr window); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowPosCallback")] internal extern unsafe static GLFWwindowposfun glfwSetWindowPosCallback(IntPtr window, GLFWwindowposfun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowSizeCallback")] internal extern unsafe static GLFWwindowsizefun glfwSetWindowSizeCallback(IntPtr window, GLFWwindowsizefun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowCloseCallback")] internal extern unsafe static GLFWwindowclosefun glfwSetWindowCloseCallback(IntPtr window, GLFWwindowclosefun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowRefreshCallback")] internal extern unsafe static GLFWwindowrefreshfun glfwSetWindowRefreshCallback(IntPtr window, GLFWwindowrefreshfun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowFocusCallback")] internal extern unsafe static GLFWwindowfocusfun glfwSetWindowFocusCallback(IntPtr window, GLFWwindowfocusfun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowIconifyCallback")] internal extern unsafe static GLFWwindowiconifyfun glfwSetWindowIconifyCallback(IntPtr window, GLFWwindowiconifyfun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowMaximizeCallback")] internal extern unsafe static GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(IntPtr window, GLFWwindowmaximizefun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetFramebufferSizeCallback")] internal extern unsafe static FramebuffersizeHandler glfwSetFramebufferSizeCallback(IntPtr window, IntPtr callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetWindowContentScaleCallback")] internal extern unsafe static GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(IntPtr window, GLFWwindowcontentscalefun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwPollEvents")] internal extern unsafe static void glfwPollEvents(); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwWaitEvents")] internal extern unsafe static void glfwWaitEvents(); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwWaitEventsTimeout")] internal extern unsafe static void glfwWaitEventsTimeout(double timeout); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwPostEmptyEvent")] internal extern unsafe static void glfwPostEmptyEvent(); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetInputMode")] internal extern unsafe static int glfwGetInputMode(IntPtr window, int mode); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetInputMode")] internal extern unsafe static void glfwSetInputMode(IntPtr window, int mode, int value); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwRawMouseMotionSupported")] internal extern unsafe static int glfwRawMouseMotionSupported(); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetKeyName")] internal extern unsafe static byte* glfwGetKeyName(int key, int scancode); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetKeyScancode")] internal extern unsafe static int glfwGetKeyScancode(int key); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetKey")] internal extern unsafe static KeyStatus glfwGetKey(IntPtr window, int key); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetMouseButton")] internal extern unsafe static int glfwGetMouseButton(IntPtr window, int button); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetCursorPos")] internal extern unsafe static void glfwGetCursorPos(IntPtr window, double* xpos, double* ypos); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetCursorPos")] internal extern unsafe static void glfwSetCursorPos(IntPtr window, double xpos, double ypos); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwCreateCursor")] internal extern unsafe static GLFWcursor* glfwCreateCursor(GLFWimage* image, int xhot, int yhot); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwCreateStandardCursor")] internal extern unsafe static GLFWcursor* glfwCreateStandardCursor(int shape); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwDestroyCursor")] internal extern unsafe static void glfwDestroyCursor(GLFWcursor* cursor); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetCursor")] internal extern unsafe static void glfwSetCursor(IntPtr window, GLFWcursor* cursor); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetKeyCallback")] internal extern unsafe static GLFWkeyfun glfwSetKeyCallback(IntPtr window, GLFWkeyfun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetCharCallback")] internal extern unsafe static GLFWcharfun glfwSetCharCallback(IntPtr window, GLFWcharfun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetCharModsCallback")] internal extern unsafe static GLFWcharmodsfun glfwSetCharModsCallback(IntPtr window, GLFWcharmodsfun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetMouseButtonCallback")] internal extern unsafe static GLFWmousebuttonfun glfwSetMouseButtonCallback(IntPtr window, GLFWmousebuttonfun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetCursorPosCallback")] internal extern unsafe static GLFWcursorposfun glfwSetCursorPosCallback(IntPtr window, GLFWcursorposfun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetCursorEnterCallback")] internal extern unsafe static GLFWcursorenterfun glfwSetCursorEnterCallback(IntPtr window, GLFWcursorenterfun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetScrollCallback")] internal extern unsafe static GLFWscrollfun glfwSetScrollCallback(IntPtr window, GLFWscrollfun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetDropCallback")] internal extern unsafe static GLFWdropfun glfwSetDropCallback(IntPtr window, GLFWdropfun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwJoystickPresent")] internal extern unsafe static int glfwJoystickPresent(int jid); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetJoystickAxes")] internal extern unsafe static float* glfwGetJoystickAxes(int jid, int* count); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetJoystickButtons")] internal extern unsafe static byte* glfwGetJoystickButtons(int jid, int* count); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetJoystickHats")] internal extern unsafe static byte* glfwGetJoystickHats(int jid, int* count); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetJoystickName")] internal extern unsafe static byte* glfwGetJoystickName(int jid); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetJoystickGUID")] internal extern unsafe static byte* glfwGetJoystickGUID(int jid); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetJoystickUserPointer")] internal extern unsafe static void glfwSetJoystickUserPointer(int jid, void* pointer); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetJoystickUserPointer")] internal extern unsafe static void* glfwGetJoystickUserPointer(int jid); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwJoystickIsGamepad")] internal extern unsafe static int glfwJoystickIsGamepad(int jid); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetJoystickCallback")] internal extern unsafe static GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwUpdateGamepadMappings")] internal extern unsafe static int glfwUpdateGamepadMappings(byte* str); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetGamepadName")] internal extern unsafe static byte* glfwGetGamepadName(int jid); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetGamepadState")] internal extern unsafe static int glfwGetGamepadState(int jid, GLFWgamepadstate* state); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetClipboardString")] internal extern unsafe static void glfwSetClipboardString(IntPtr window, byte* str); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetClipboardString")] internal extern unsafe static byte* glfwGetClipboardString(IntPtr window); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetTime")] internal extern unsafe static double glfwGetTime(); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSetTime")] internal extern unsafe static void glfwSetTime(double time); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetTimerValue")] internal extern unsafe static ulong* glfwGetTimerValue(); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetTimerFrequency")] internal extern unsafe static ulong* glfwGetTimerFrequency(); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwMakeContextCurrent")] internal extern unsafe static void glfwMakeContextCurrent(IntPtr window); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetCurrentContext")] internal extern unsafe static IntPtr glfwGetCurrentContext(); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSwapBuffers")] internal extern unsafe static void glfwSwapBuffers(IntPtr window); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwSwapInterval")] internal extern unsafe static void glfwSwapInterval(int interval); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwExtensionSupported")] internal extern unsafe static int glfwExtensionSupported(byte* extension); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetProcAddress", CharSet = CharSet.Ansi)] internal extern unsafe static IntPtr glfwGetProcAddress(string procname); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwVulkanSupported")] internal extern unsafe static int glfwVulkanSupported(); - [DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetRequiredInstanceExtensions")] internal extern unsafe static byte** glfwGetRequiredInstanceExtensions(uint* count); + [DllImport(SSC_libname, EntryPoint = "glfwInit")] internal extern unsafe static int glfwInit(); + [DllImport(SSC_libname, EntryPoint = "glfwTerminate")] internal extern unsafe static void glfwTerminate(); + [DllImport(SSC_libname, EntryPoint = "glfwInitHint")] internal extern unsafe static void glfwInitHint(int hint, int value); + [DllImport(SSC_libname, EntryPoint = "glfwGetVersion")] internal extern unsafe static void glfwGetVersion(int* major, int* minor, int* rev); + [DllImport(SSC_libname, EntryPoint = "glfwGetVersionString")] internal extern unsafe static byte* glfwGetVersionString(); + [DllImport(SSC_libname, EntryPoint = "glfwGetError")] internal extern unsafe static int glfwGetError(byte** description); + [DllImport(SSC_libname, EntryPoint = "glfwSetErrorCallback")] internal extern unsafe static GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback); + [DllImport(SSC_libname, EntryPoint = "glfwGetMonitors")] internal extern unsafe static IntPtr* glfwGetMonitors(int* count); + [DllImport(SSC_libname, EntryPoint = "glfwGetPrimaryMonitor")] internal extern unsafe static IntPtr glfwGetPrimaryMonitor(); + [DllImport(SSC_libname, EntryPoint = "glfwGetMonitorPos")] internal extern unsafe static void glfwGetMonitorPos(IntPtr monitor, int* xpos, int* ypos); + [DllImport(SSC_libname, EntryPoint = "glfwGetMonitorWorkarea")] internal extern unsafe static void glfwGetMonitorWorkarea(IntPtr monitor, int* xpos, int* ypos, int* width, int* height); + [DllImport(SSC_libname, EntryPoint = "glfwGetMonitorPhysicalSize")] internal extern unsafe static void glfwGetMonitorPhysicalSize(IntPtr monitor, int* widthMM, int* heightMM); + [DllImport(SSC_libname, EntryPoint = "glfwGetMonitorContentScale")] internal extern unsafe static void glfwGetMonitorContentScale(IntPtr monitor, float* xscale, float* yscale); + [DllImport(SSC_libname, EntryPoint = "glfwGetMonitorName")] internal extern unsafe static byte* glfwGetMonitorName(IntPtr monitor); + [DllImport(SSC_libname, EntryPoint = "glfwSetMonitorUserPointer")] internal extern unsafe static void glfwSetMonitorUserPointer(IntPtr monitor, void* pointer); + [DllImport(SSC_libname, EntryPoint = "glfwGetMonitorUserPointer")] internal extern unsafe static void* glfwGetMonitorUserPointer(IntPtr monitor); + [DllImport(SSC_libname, EntryPoint = "glfwSetMonitorCallback")] internal extern unsafe static GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback); + [DllImport(SSC_libname, EntryPoint = "glfwGetVideoModes")] internal extern unsafe static GLFWvidmode* glfwGetVideoModes(IntPtr monitor, int* count); + [DllImport(SSC_libname, EntryPoint = "glfwGetVideoMode")] internal extern unsafe static GLFWvidmode* glfwGetVideoMode(IntPtr monitor); + [DllImport(SSC_libname, EntryPoint = "glfwSetGamma")] internal extern unsafe static void glfwSetGamma(IntPtr monitor, float gamma); + [DllImport(SSC_libname, EntryPoint = "glfwGetGammaRamp")] internal extern unsafe static GLFWgammaramp* glfwGetGammaRamp(IntPtr monitor); + [DllImport(SSC_libname, EntryPoint = "glfwSetGammaRamp")] internal extern unsafe static void glfwSetGammaRamp(IntPtr monitor, GLFWgammaramp* ramp); + [DllImport(SSC_libname, EntryPoint = "glfwDefaultWindowHints")] internal extern unsafe static void glfwDefaultWindowHints(); + [DllImport(SSC_libname, EntryPoint = "glfwWindowHint")] internal extern unsafe static void glfwWindowHint(int hint, int value); + [DllImport(SSC_libname, EntryPoint = "glfwWindowHintString")] internal extern unsafe static void glfwWindowHintString(int hint, byte* value); + [DllImport(SSC_libname, EntryPoint = "glfwCreateWindow")] internal extern unsafe static IntPtr glfwCreateWindow(int width, int height, byte[] title, IntPtr monitor, IntPtr share); + [DllImport(SSC_libname, EntryPoint = "glfwDestroyWindow")] internal extern unsafe static void glfwDestroyWindow(IntPtr window); + [DllImport(SSC_libname, EntryPoint = "glfwWindowShouldClose")] internal extern unsafe static int glfwWindowShouldClose(IntPtr window); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowShouldClose")] internal extern unsafe static void glfwSetWindowShouldClose(IntPtr window, int value); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowTitle")] internal extern unsafe static void glfwSetWindowTitle(IntPtr window, byte* title); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowIcon")] internal extern unsafe static void glfwSetWindowIcon(IntPtr window, int count, GLFWimage* images); + [DllImport(SSC_libname, EntryPoint = "glfwGetWindowPos")] internal extern unsafe static void glfwGetWindowPos(IntPtr window, int* xpos, int* ypos); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowPos")] internal extern unsafe static void glfwSetWindowPos(IntPtr window, int xpos, int ypos); + [DllImport(SSC_libname, EntryPoint = "glfwGetWindowSize")] internal extern unsafe static void glfwGetWindowSize(IntPtr window, int* width, int* height); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowSizeLimits")] internal extern unsafe static void glfwSetWindowSizeLimits(IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowAspectRatio")] internal extern unsafe static void glfwSetWindowAspectRatio(IntPtr window, int numer, int denom); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowSize")] internal extern unsafe static void glfwSetWindowSize(IntPtr window, int width, int height); + [DllImport(SSC_libname, EntryPoint = "glfwGetFramebufferSize")] internal extern unsafe static void glfwGetFramebufferSize(IntPtr window, int* width, int* height); + [DllImport(SSC_libname, EntryPoint = "glfwGetWindowFrameSize")] internal extern unsafe static void glfwGetWindowFrameSize(IntPtr window, int* left, int* top, int* right, int* bottom); + [DllImport(SSC_libname, EntryPoint = "glfwGetWindowContentScale")] internal extern unsafe static void glfwGetWindowContentScale(IntPtr window, float* xscale, float* yscale); + [DllImport(SSC_libname, EntryPoint = "glfwGetWindowOpacity")] internal extern unsafe static float glfwGetWindowOpacity(IntPtr window); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowOpacity")] internal extern unsafe static void glfwSetWindowOpacity(IntPtr window, float opacity); + [DllImport(SSC_libname, EntryPoint = "glfwIconifyWindow")] internal extern unsafe static void glfwIconifyWindow(IntPtr window); + [DllImport(SSC_libname, EntryPoint = "glfwRestoreWindow")] internal extern unsafe static void glfwRestoreWindow(IntPtr window); + [DllImport(SSC_libname, EntryPoint = "glfwMaximizeWindow")] internal extern unsafe static void glfwMaximizeWindow(IntPtr window); + [DllImport(SSC_libname, EntryPoint = "glfwShowWindow")] internal extern unsafe static void glfwShowWindow(IntPtr window); + [DllImport(SSC_libname, EntryPoint = "glfwHideWindow")] internal extern unsafe static void glfwHideWindow(IntPtr window); + [DllImport(SSC_libname, EntryPoint = "glfwFocusWindow")] internal extern unsafe static void glfwFocusWindow(IntPtr window); + [DllImport(SSC_libname, EntryPoint = "glfwRequestWindowAttention")] internal extern unsafe static void glfwRequestWindowAttention(IntPtr window); + [DllImport(SSC_libname, EntryPoint = "glfwGetWindowMonitor")] internal extern unsafe static IntPtr glfwGetWindowMonitor(IntPtr window); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowMonitor")] internal extern unsafe static void glfwSetWindowMonitor(IntPtr window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate); + [DllImport(SSC_libname, EntryPoint = "glfwGetWindowAttrib")] internal extern unsafe static int glfwGetWindowAttrib(IntPtr window, int attrib); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowAttrib")] internal extern unsafe static void glfwSetWindowAttrib(IntPtr window, int attrib, int value); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowUserPointer")] internal extern unsafe static void glfwSetWindowUserPointer(IntPtr window, void* pointer); + [DllImport(SSC_libname, EntryPoint = "glfwGetWindowUserPointer")] internal extern unsafe static void* glfwGetWindowUserPointer(IntPtr window); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowPosCallback")] internal extern unsafe static GLFWwindowposfun glfwSetWindowPosCallback(IntPtr window, GLFWwindowposfun callback); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowSizeCallback")] internal extern unsafe static GLFWwindowsizefun glfwSetWindowSizeCallback(IntPtr window, GLFWwindowsizefun callback); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowCloseCallback")] internal extern unsafe static GLFWwindowclosefun glfwSetWindowCloseCallback(IntPtr window, GLFWwindowclosefun callback); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowRefreshCallback")] internal extern unsafe static GLFWwindowrefreshfun glfwSetWindowRefreshCallback(IntPtr window, GLFWwindowrefreshfun callback); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowFocusCallback")] internal extern unsafe static GLFWwindowfocusfun glfwSetWindowFocusCallback(IntPtr window, GLFWwindowfocusfun callback); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowIconifyCallback")] internal extern unsafe static GLFWwindowiconifyfun glfwSetWindowIconifyCallback(IntPtr window, GLFWwindowiconifyfun callback); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowMaximizeCallback")] internal extern unsafe static GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(IntPtr window, GLFWwindowmaximizefun callback); + [DllImport(SSC_libname, EntryPoint = "glfwSetFramebufferSizeCallback")] internal extern unsafe static FramebuffersizeHandler glfwSetFramebufferSizeCallback(IntPtr window, IntPtr callback); + [DllImport(SSC_libname, EntryPoint = "glfwSetWindowContentScaleCallback")] internal extern unsafe static GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(IntPtr window, GLFWwindowcontentscalefun callback); + [DllImport(SSC_libname, EntryPoint = "glfwPollEvents")] internal extern unsafe static void glfwPollEvents(); + [DllImport(SSC_libname, EntryPoint = "glfwWaitEvents")] internal extern unsafe static void glfwWaitEvents(); + [DllImport(SSC_libname, EntryPoint = "glfwWaitEventsTimeout")] internal extern unsafe static void glfwWaitEventsTimeout(double timeout); + [DllImport(SSC_libname, EntryPoint = "glfwPostEmptyEvent")] internal extern unsafe static void glfwPostEmptyEvent(); + [DllImport(SSC_libname, EntryPoint = "glfwGetInputMode")] internal extern unsafe static int glfwGetInputMode(IntPtr window, int mode); + [DllImport(SSC_libname, EntryPoint = "glfwSetInputMode")] internal extern unsafe static void glfwSetInputMode(IntPtr window, int mode, int value); + [DllImport(SSC_libname, EntryPoint = "glfwRawMouseMotionSupported")] internal extern unsafe static int glfwRawMouseMotionSupported(); + [DllImport(SSC_libname, EntryPoint = "glfwGetKeyName")] internal extern unsafe static byte* glfwGetKeyName(int key, int scancode); + [DllImport(SSC_libname, EntryPoint = "glfwGetKeyScancode")] internal extern unsafe static int glfwGetKeyScancode(int key); + [DllImport(SSC_libname, EntryPoint = "glfwGetKey")] internal extern unsafe static KeyStatus glfwGetKey(IntPtr window, int key); + [DllImport(SSC_libname, EntryPoint = "glfwGetMouseButton")] internal extern unsafe static int glfwGetMouseButton(IntPtr window, int button); + [DllImport(SSC_libname, EntryPoint = "glfwGetCursorPos")] internal extern unsafe static void glfwGetCursorPos(IntPtr window, double* xpos, double* ypos); + [DllImport(SSC_libname, EntryPoint = "glfwSetCursorPos")] internal extern unsafe static void glfwSetCursorPos(IntPtr window, double xpos, double ypos); + [DllImport(SSC_libname, EntryPoint = "glfwCreateCursor")] internal extern unsafe static GLFWcursor* glfwCreateCursor(GLFWimage* image, int xhot, int yhot); + [DllImport(SSC_libname, EntryPoint = "glfwCreateStandardCursor")] internal extern unsafe static GLFWcursor* glfwCreateStandardCursor(int shape); + [DllImport(SSC_libname, EntryPoint = "glfwDestroyCursor")] internal extern unsafe static void glfwDestroyCursor(GLFWcursor* cursor); + [DllImport(SSC_libname, EntryPoint = "glfwSetCursor")] internal extern unsafe static void glfwSetCursor(IntPtr window, GLFWcursor* cursor); + [DllImport(SSC_libname, EntryPoint = "glfwSetKeyCallback")] internal extern unsafe static GLFWkeyfun glfwSetKeyCallback(IntPtr window, GLFWkeyfun callback); + [DllImport(SSC_libname, EntryPoint = "glfwSetCharCallback")] internal extern unsafe static GLFWcharfun glfwSetCharCallback(IntPtr window, GLFWcharfun callback); + [DllImport(SSC_libname, EntryPoint = "glfwSetCharModsCallback")] internal extern unsafe static GLFWcharmodsfun glfwSetCharModsCallback(IntPtr window, GLFWcharmodsfun callback); + [DllImport(SSC_libname, EntryPoint = "glfwSetMouseButtonCallback")] internal extern unsafe static GLFWmousebuttonfun glfwSetMouseButtonCallback(IntPtr window, GLFWmousebuttonfun callback); + [DllImport(SSC_libname, EntryPoint = "glfwSetCursorPosCallback")] internal extern unsafe static GLFWcursorposfun glfwSetCursorPosCallback(IntPtr window, GLFWcursorposfun callback); + [DllImport(SSC_libname, EntryPoint = "glfwSetCursorEnterCallback")] internal extern unsafe static GLFWcursorenterfun glfwSetCursorEnterCallback(IntPtr window, GLFWcursorenterfun callback); + [DllImport(SSC_libname, EntryPoint = "glfwSetScrollCallback")] internal extern unsafe static GLFWscrollfun glfwSetScrollCallback(IntPtr window, GLFWscrollfun callback); + [DllImport(SSC_libname, EntryPoint = "glfwSetDropCallback")] internal extern unsafe static GLFWdropfun glfwSetDropCallback(IntPtr window, GLFWdropfun callback); + [DllImport(SSC_libname, EntryPoint = "glfwJoystickPresent")] internal extern unsafe static int glfwJoystickPresent(int jid); + [DllImport(SSC_libname, EntryPoint = "glfwGetJoystickAxes")] internal extern unsafe static float* glfwGetJoystickAxes(int jid, int* count); + [DllImport(SSC_libname, EntryPoint = "glfwGetJoystickButtons")] internal extern unsafe static byte* glfwGetJoystickButtons(int jid, int* count); + [DllImport(SSC_libname, EntryPoint = "glfwGetJoystickHats")] internal extern unsafe static byte* glfwGetJoystickHats(int jid, int* count); + [DllImport(SSC_libname, EntryPoint = "glfwGetJoystickName")] internal extern unsafe static byte* glfwGetJoystickName(int jid); + [DllImport(SSC_libname, EntryPoint = "glfwGetJoystickGUID")] internal extern unsafe static byte* glfwGetJoystickGUID(int jid); + [DllImport(SSC_libname, EntryPoint = "glfwSetJoystickUserPointer")] internal extern unsafe static void glfwSetJoystickUserPointer(int jid, void* pointer); + [DllImport(SSC_libname, EntryPoint = "glfwGetJoystickUserPointer")] internal extern unsafe static void* glfwGetJoystickUserPointer(int jid); + [DllImport(SSC_libname, EntryPoint = "glfwJoystickIsGamepad")] internal extern unsafe static int glfwJoystickIsGamepad(int jid); + [DllImport(SSC_libname, EntryPoint = "glfwSetJoystickCallback")] internal extern unsafe static GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback); + [DllImport(SSC_libname, EntryPoint = "glfwUpdateGamepadMappings")] internal extern unsafe static int glfwUpdateGamepadMappings(byte* str); + [DllImport(SSC_libname, EntryPoint = "glfwGetGamepadName")] internal extern unsafe static byte* glfwGetGamepadName(int jid); + [DllImport(SSC_libname, EntryPoint = "glfwGetGamepadState")] internal extern unsafe static int glfwGetGamepadState(int jid, GLFWgamepadstate* state); + [DllImport(SSC_libname, EntryPoint = "glfwSetClipboardString")] internal extern unsafe static void glfwSetClipboardString(IntPtr window, byte* str); + [DllImport(SSC_libname, EntryPoint = "glfwGetClipboardString")] internal extern unsafe static byte* glfwGetClipboardString(IntPtr window); + [DllImport(SSC_libname, EntryPoint = "glfwGetTime")] internal extern unsafe static double glfwGetTime(); + [DllImport(SSC_libname, EntryPoint = "glfwSetTime")] internal extern unsafe static void glfwSetTime(double time); + [DllImport(SSC_libname, EntryPoint = "glfwGetTimerValue")] internal extern unsafe static ulong* glfwGetTimerValue(); + [DllImport(SSC_libname, EntryPoint = "glfwGetTimerFrequency")] internal extern unsafe static ulong* glfwGetTimerFrequency(); + [DllImport(SSC_libname, EntryPoint = "glfwMakeContextCurrent")] internal extern unsafe static void glfwMakeContextCurrent(IntPtr window); + [DllImport(SSC_libname, EntryPoint = "glfwGetCurrentContext")] internal extern unsafe static IntPtr glfwGetCurrentContext(); + [DllImport(SSC_libname, EntryPoint = "glfwSwapBuffers")] internal extern unsafe static void glfwSwapBuffers(IntPtr window); + [DllImport(SSC_libname, EntryPoint = "glfwSwapInterval")] internal extern unsafe static void glfwSwapInterval(int interval); + [DllImport(SSC_libname, EntryPoint = "glfwExtensionSupported")] internal extern unsafe static int glfwExtensionSupported(byte* extension); + [DllImport(SSC_libname, EntryPoint = "glfwGetProcAddress", CharSet = CharSet.Ansi)] internal extern unsafe static IntPtr glfwGetProcAddress(string procname); + [DllImport(SSC_libname, EntryPoint = "glfwVulkanSupported")] internal extern unsafe static int glfwVulkanSupported(); + [DllImport(SSC_libname, EntryPoint = "glfwGetRequiredInstanceExtensions")] internal extern unsafe static byte** glfwGetRequiredInstanceExtensions(uint* count); //[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetInstanceProcAddress")] internal extern unsafe static GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, byte* procname); //[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetPhysicalDevicePresentationSupport")] internal extern unsafe static int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint* queuefamily); //[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwCreateWindowSurface")] internal extern unsafe static VkResult glfwCreateWindowSurface(VkInstance instance, IntPtr window, VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); #endregion - #region api - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int Init() => glfwInit(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void Terminate() => glfwTerminate(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void InitHint(int hint, int value) => glfwInitHint(hint, value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetVersion(int* major, int* minor, int* rev) => glfwGetVersion(major, minor, rev); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetVersionString() => glfwGetVersionString(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetError(byte** description) => glfwGetError(description); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWerrorfun SetErrorCallback(GLFWerrorfun callback) => glfwSetErrorCallback(callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr* GetMonitors(int* count) => glfwGetMonitors(count); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetPrimaryMonitor() => glfwGetPrimaryMonitor(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorPos(IntPtr monitor, int* xpos, int* ypos) => glfwGetMonitorPos(monitor, xpos, ypos); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorWorkarea(IntPtr monitor, int* xpos, int* ypos, int* width, int* height) => glfwGetMonitorWorkarea(monitor, xpos, ypos, width, height); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorPhysicalSize(IntPtr monitor, int* widthMM, int* heightMM) => glfwGetMonitorPhysicalSize(monitor, widthMM, heightMM); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorContentScale(IntPtr monitor, float* xscale, float* yscale) => glfwGetMonitorContentScale(monitor, xscale, yscale); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetMonitorName(IntPtr monitor) => glfwGetMonitorName(monitor); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetMonitorUserPointer(IntPtr monitor, void* pointer) => glfwSetMonitorUserPointer(monitor, pointer); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void* GetMonitorUserPointer(IntPtr monitor) => glfwGetMonitorUserPointer(monitor); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWmonitorfun SetMonitorCallback(GLFWmonitorfun callback) => glfwSetMonitorCallback(callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWvidmode* GetVideoModes(IntPtr monitor, int* count) => glfwGetVideoModes(monitor, count); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWvidmode* GetVideoMode(IntPtr monitor) => glfwGetVideoMode(monitor); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetGamma(IntPtr monitor, float gamma) => glfwSetGamma(monitor, gamma); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWgammaramp* GetGammaRamp(IntPtr monitor) => glfwGetGammaRamp(monitor); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetGammaRamp(IntPtr monitor, GLFWgammaramp* ramp) => glfwSetGammaRamp(monitor, ramp); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void DefaultWindowHints() => glfwDefaultWindowHints(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WindowHint(int hint, int value) => glfwWindowHint(hint, value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WindowHintString(int hint, byte* value) => glfwWindowHintString(hint, value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr CreateWindow(int width, int height, byte[] title, IntPtr monitor, IntPtr share) => glfwCreateWindow(width, height, title, monitor, share); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void DestroyWindow(IntPtr window) => glfwDestroyWindow(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int WindowShouldClose(IntPtr window) => glfwWindowShouldClose(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowShouldClose(IntPtr window, int value) => glfwSetWindowShouldClose(window, value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowTitle(IntPtr window, byte* title) => glfwSetWindowTitle(window, title); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowIcon(IntPtr window, int count, GLFWimage* images) => glfwSetWindowIcon(window, count, images); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowPos(IntPtr window, int* xpos, int* ypos) => glfwGetWindowPos(window, xpos, ypos); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowPos(IntPtr window, int xpos, int ypos) => glfwSetWindowPos(window, xpos, ypos); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowSize(IntPtr window, int* width, int* height) => glfwGetWindowSize(window, width, height); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowSizeLimits(IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight) => glfwSetWindowSizeLimits(window, minwidth, minheight, maxwidth, maxheight); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowAspectRatio(IntPtr window, int numer, int denom) => glfwSetWindowAspectRatio(window, numer, denom); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowSize(IntPtr window, int width, int height) => glfwSetWindowSize(window, width, height); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetFramebufferSize(IntPtr window, int* width, int* height) => glfwGetFramebufferSize(window, width, height); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowFrameSize(IntPtr window, int* left, int* top, int* right, int* bottom) => glfwGetWindowFrameSize(window, left, top, right, bottom); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowContentScale(IntPtr window, float* xscale, float* yscale) => glfwGetWindowContentScale(window, xscale, yscale); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe float GetWindowOpacity(IntPtr window) => glfwGetWindowOpacity(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowOpacity(IntPtr window, float opacity) => glfwSetWindowOpacity(window, opacity); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void IconifyWindow(IntPtr window) => glfwIconifyWindow(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void RestoreWindow(IntPtr window) => glfwRestoreWindow(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void MaximizeWindow(IntPtr window) => glfwMaximizeWindow(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void ShowWindow(IntPtr window) => glfwShowWindow(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void HideWindow(IntPtr window) => glfwHideWindow(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void FocusWindow(IntPtr window) => glfwFocusWindow(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void RequestWindowAttention(IntPtr window) => glfwRequestWindowAttention(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetWindowMonitor(IntPtr window) => glfwGetWindowMonitor(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowMonitor(IntPtr window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate) => glfwSetWindowMonitor(window, monitor, xpos, ypos, width, height, refreshRate); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetWindowAttrib(IntPtr window, int attrib) => glfwGetWindowAttrib(window, attrib); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowAttrib(IntPtr window, int attrib, int value) => glfwSetWindowAttrib(window, attrib, value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowUserPointer(IntPtr window, void* pointer) => glfwSetWindowUserPointer(window, pointer); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void* GetWindowUserPointer(IntPtr window) => glfwGetWindowUserPointer(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowposfun SetWindowPosCallback(IntPtr window, GLFWwindowposfun callback) => glfwSetWindowPosCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowsizefun SetWindowSizeCallback(IntPtr window, GLFWwindowsizefun callback) => glfwSetWindowSizeCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowclosefun SetWindowCloseCallback(IntPtr window, GLFWwindowclosefun callback) => glfwSetWindowCloseCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowrefreshfun SetWindowRefreshCallback(IntPtr window, GLFWwindowrefreshfun callback) => glfwSetWindowRefreshCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowfocusfun SetWindowFocusCallback(IntPtr window, GLFWwindowfocusfun callback) => glfwSetWindowFocusCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowiconifyfun SetWindowIconifyCallback(IntPtr window, GLFWwindowiconifyfun callback) => glfwSetWindowIconifyCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowmaximizefun SetWindowMaximizeCallback(IntPtr window, GLFWwindowmaximizefun callback) => glfwSetWindowMaximizeCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe FramebuffersizeHandler SetFramebufferSizeCallback(IntPtr window, IntPtr callback) => glfwSetFramebufferSizeCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowcontentscalefun SetWindowContentScaleCallback(IntPtr window, GLFWwindowcontentscalefun callback) => glfwSetWindowContentScaleCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void PollEvents() => glfwPollEvents(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WaitEvents() => glfwWaitEvents(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WaitEventsTimeout(double timeout) => glfwWaitEventsTimeout(timeout); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void PostEmptyEvent() => glfwPostEmptyEvent(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetInputMode(IntPtr window, int mode) => glfwGetInputMode(window, mode); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetInputMode(IntPtr window, int mode, int value) => glfwSetInputMode(window, mode, value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int RawMouseMotionSupported() => glfwRawMouseMotionSupported(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetKeyName(int key, int scancode) => glfwGetKeyName(key, scancode); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetKeyScancode(int key) => glfwGetKeyScancode(key); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe KeyStatus GetKey(IntPtr window, int key) => glfwGetKey(window, key); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetMouseButton(IntPtr window, int button) => glfwGetMouseButton(window, button); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetCursorPos(IntPtr window, double* xpos, double* ypos) => glfwGetCursorPos(window, xpos, ypos); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetCursorPos(IntPtr window, double xpos, double ypos) => glfwSetCursorPos(window, xpos, ypos); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursor* CreateCursor(GLFWimage* image, int xhot, int yhot) => glfwCreateCursor(image, xhot, yhot); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursor* CreateStandardCursor(int shape) => glfwCreateStandardCursor(shape); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void DestroyCursor(GLFWcursor* cursor) => glfwDestroyCursor(cursor); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetCursor(IntPtr window, GLFWcursor* cursor) => glfwSetCursor(window, cursor); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWkeyfun SetKeyCallback(IntPtr window, GLFWkeyfun callback) => glfwSetKeyCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcharfun SetCharCallback(IntPtr window, GLFWcharfun callback) => glfwSetCharCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcharmodsfun SetCharModsCallback(IntPtr window, GLFWcharmodsfun callback) => glfwSetCharModsCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWmousebuttonfun SetMouseButtonCallback(IntPtr window, GLFWmousebuttonfun callback) => glfwSetMouseButtonCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursorposfun SetCursorPosCallback(IntPtr window, GLFWcursorposfun callback) => glfwSetCursorPosCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursorenterfun SetCursorEnterCallback(IntPtr window, GLFWcursorenterfun callback) => glfwSetCursorEnterCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWscrollfun SetScrollCallback(IntPtr window, GLFWscrollfun callback) => glfwSetScrollCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWdropfun SetDropCallback(IntPtr window, GLFWdropfun callback) => glfwSetDropCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int JoystickPresent(int jid) => glfwJoystickPresent(jid); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe float* GetJoystickAxes(int jid, int* count) => glfwGetJoystickAxes(jid, count); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickButtons(int jid, int* count) => glfwGetJoystickButtons(jid, count); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickHats(int jid, int* count) => glfwGetJoystickHats(jid, count); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickName(int jid) => glfwGetJoystickName(jid); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickGUID(int jid) => glfwGetJoystickGUID(jid); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetJoystickUserPointer(int jid, void* pointer) => glfwSetJoystickUserPointer(jid, pointer); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void* GetJoystickUserPointer(int jid) => glfwGetJoystickUserPointer(jid); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int JoystickIsGamepad(int jid) => glfwJoystickIsGamepad(jid); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWjoystickfun SetJoystickCallback(GLFWjoystickfun callback) => glfwSetJoystickCallback(callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int UpdateGamepadMappings(byte* str) => glfwUpdateGamepadMappings(str); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetGamepadName(int jid) => glfwGetGamepadName(jid); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetGamepadState(int jid, GLFWgamepadstate* state) => glfwGetGamepadState(jid, state); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetClipboardString(IntPtr window, byte* str) => glfwSetClipboardString(window, str); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetClipboardString(IntPtr window) => glfwGetClipboardString(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe double GetTime() => glfwGetTime(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetTime(double time) => glfwSetTime(time); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe ulong* GetTimerValue() => glfwGetTimerValue(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe ulong* GetTimerFrequency() => glfwGetTimerFrequency(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void MakeContextCurrent(IntPtr window) => glfwMakeContextCurrent(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetCurrentContext() => glfwGetCurrentContext(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SwapBuffers(IntPtr window) => glfwSwapBuffers(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SwapInterval(int interval) => glfwSwapInterval(interval); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int ExtensionSupported(byte* extension) => glfwExtensionSupported(extension); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetProcAddress(string procname) => glfwGetProcAddress(procname); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int VulkanSupported() => glfwVulkanSupported(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte** GetRequiredInstanceExtensions(uint* count) => glfwGetRequiredInstanceExtensions(count); - //[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWvkproc GetInstanceProcAddress(VkInstance instance, byte* procname)=>glfwGetInstanceProcAddress(instance, procname) - //[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint* queuefamily) => glfwGetPhysicalDevicePresentationSupport(instance, device, queuefamily); - //[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe VkResult CreateWindowSurface(VkInstance instance, IntPtr window, VkAllocationCallbacks* allocator, VkSurfaceKHR* surface)=>glfwCreateWindowSurface(instance, window, allocator, surface) - #endregion - } - internal class glFramework_Delegate : IglFramework - { - #region glfw api define - - internal static glfwCreateCursor glfw_CreateCursor; - internal static glfwCreateStandardCursor glfw_CreateStandardCursor; - internal static glfwCreateWindow glfw_CreateWindow; - internal static glfwDefaultWindowHints glfw_DefaultWindowHints; - internal static glfwDestroyCursor glfw_DestroyCursor; - internal static glfwDestroyWindow glfw_DestroyWindow; - internal static glfwExtensionSupported glfw_ExtensionSupported; - internal static glfwFocusWindow glfw_FocusWindow; - internal static glfwGetClipboardString glfw_GetClipboardString; - internal static glfwGetCurrentContext glfw_GetCurrentContext; - internal static glfwGetCursorPos glfw_GetCursorPos; - internal static glfwGetError glfw_GetError; - internal static glfwGetFramebufferSize glfw_GetFramebufferSize; - internal static glfwGetGamepadName glfw_GetGamepadName; - internal static glfwGetGamepadState glfw_GetGamepadState; - internal static glfwGetGammaRamp glfw_GetGammaRamp; - internal static glfwGetInputMode glfw_GetInputMode; - internal static glfwGetJoystickAxes glfw_GetJoystickAxes; - internal static glfwGetJoystickButtons glfw_GetJoystickButtons; - internal static glfwGetJoystickGUID glfw_GetJoystickGUID; - internal static glfwGetJoystickHats glfw_GetJoystickHats; - internal static glfwGetJoystickName glfw_GetJoystickName; - internal static glfwGetJoystickUserPointer glfw_GetJoystickUserPointer; - internal static glfwGetKey glfw_GetKey; - internal static glfwGetKeyName glfw_GetKeyName; - internal static glfwGetKeyScancode glfw_GetKeyScancode; - internal static glfwGetMonitorContentScale glfw_GetMonitorContentScale; - internal static glfwGetMonitorName glfw_GetMonitorName; - internal static glfwGetMonitorPhysicalSize glfw_GetMonitorPhysicalSize; - internal static glfwGetMonitorPos glfw_GetMonitorPos; - internal static glfwGetMonitors glfw_GetMonitors; - internal static glfwGetMonitorUserPointer glfw_GetMonitorUserPointer; - internal static glfwGetMonitorWorkarea glfw_GetMonitorWorkarea; - internal static glfwGetMouseButton glfw_GetMouseButton; - internal static glfwGetPrimaryMonitor glfw_GetPrimaryMonitor; - internal static glfwGetProcAddress glfw_GetProcAddress; - internal static glfwGetRequiredInstanceExtensions glfw_GetRequiredInstanceExtensions; - internal static glfwGetTime glfw_GetTime; - internal static glfwGetTimerFrequency glfw_GetTimerFrequency; - internal static glfwGetTimerValue glfw_GetTimerValue; - internal static glfwGetVersion glfw_GetVersion; - internal static glfwGetVersionString glfw_GetVersionString; - internal static glfwGetVideoMode glfw_GetVideoMode; - internal static glfwGetVideoModes glfw_GetVideoModes; - internal static glfwGetWindowAttrib glfw_GetWindowAttrib; - internal static glfwGetWindowContentScale glfw_GetWindowContentScale; - internal static glfwGetWindowFrameSize glfw_GetWindowFrameSize; - internal static glfwGetWindowMonitor glfw_GetWindowMonitor; - internal static glfwGetWindowOpacity glfw_GetWindowOpacity; - internal static glfwGetWindowPos glfw_GetWindowPos; - internal static glfwGetWindowSize glfw_GetWindowSize; - internal static glfwGetWindowUserPointer glfw_GetWindowUserPointer; - internal static glfwHideWindow glfw_HideWindow; - internal static glfwIconifyWindow glfw_IconifyWindow; - internal static glfwInit glfw_Init; - internal static glfwInitHint glfw_InitHint; - internal static glfwJoystickIsGamepad glfw_JoystickIsGamepad; - internal static glfwJoystickPresent glfw_JoystickPresent; - internal static glfwMakeContextCurrent glfw_MakeContextCurrent; - internal static glfwMaximizeWindow glfw_MaximizeWindow; - internal static glfwPollEvents glfw_PollEvents; - internal static glfwPostEmptyEvent glfw_PostEmptyEvent; - internal static glfwRawMouseMotionSupported glfw_RawMouseMotionSupported; - internal static glfwRequestWindowAttention glfw_RequestWindowAttention; - internal static glfwRestoreWindow glfw_RestoreWindow; - internal static glfwSetCharCallback glfw_SetCharCallback; - internal static glfwSetCharModsCallback glfw_SetCharModsCallback; - internal static glfwSetClipboardString glfw_SetClipboardString; - internal static glfwSetCursor glfw_SetCursor; - internal static glfwSetCursorEnterCallback glfw_SetCursorEnterCallback; - internal static glfwSetCursorPos glfw_SetCursorPos; - internal static glfwSetCursorPosCallback glfw_SetCursorPosCallback; - internal static glfwSetDropCallback glfw_SetDropCallback; - internal static glfwSetErrorCallback glfw_SetErrorCallback; - internal static glfwSetFramebufferSizeCallback glfw_SetFramebufferSizeCallback; - internal static glfwSetGamma glfw_SetGamma; - internal static glfwSetGammaRamp glfw_SetGammaRamp; - internal static glfwSetInputMode glfw_SetInputMode; - internal static glfwSetJoystickCallback glfw_SetJoystickCallback; - internal static glfwSetJoystickUserPointer glfw_SetJoystickUserPointer; - internal static glfwSetKeyCallback glfw_SetKeyCallback; - internal static glfwSetMonitorCallback glfw_SetMonitorCallback; - internal static glfwSetMonitorUserPointer glfw_SetMonitorUserPointer; - internal static glfwSetMouseButtonCallback glfw_SetMouseButtonCallback; - internal static glfwSetScrollCallback glfw_SetScrollCallback; - internal static glfwSetTime glfw_SetTime; - internal static glfwSetWindowAspectRatio glfw_SetWindowAspectRatio; - internal static glfwSetWindowAttrib glfw_SetWindowAttrib; - internal static glfwSetWindowCloseCallback glfw_SetWindowCloseCallback; - internal static glfwSetWindowContentScaleCallback glfw_SetWindowContentScaleCallback; - internal static glfwSetWindowFocusCallback glfw_SetWindowFocusCallback; - internal static glfwSetWindowIcon glfw_SetWindowIcon; - internal static glfwSetWindowIconifyCallback glfw_SetWindowIconifyCallback; - internal static glfwSetWindowMaximizeCallback glfw_SetWindowMaximizeCallback; - internal static glfwSetWindowMonitor glfw_SetWindowMonitor; - internal static glfwSetWindowOpacity glfw_SetWindowOpacity; - internal static glfwSetWindowPos glfw_SetWindowPos; - internal static glfwSetWindowPosCallback glfw_SetWindowPosCallback; - internal static glfwSetWindowRefreshCallback glfw_SetWindowRefreshCallback; - internal static glfwSetWindowShouldClose glfw_SetWindowShouldClose; - internal static glfwSetWindowSize glfw_SetWindowSize; - internal static glfwSetWindowSizeCallback glfw_SetWindowSizeCallback; - internal static glfwSetWindowSizeLimits glfw_SetWindowSizeLimits; - internal static glfwSetWindowTitle glfw_SetWindowTitle; - internal static glfwSetWindowUserPointer glfw_SetWindowUserPointer; - internal static glfwShowWindow glfw_ShowWindow; - internal static glfwSwapBuffers glfw_SwapBuffers; - internal static glfwSwapInterval glfw_SwapInterval; - internal static glfwTerminate glfw_Terminate; - internal static glfwUpdateGamepadMappings glfw_UpdateGamepadMappings; - internal static glfwVulkanSupported glfw_VulkanSupported; - internal static glfwWaitEvents glfw_WaitEvents; - internal static glfwWaitEventsTimeout glfw_WaitEventsTimeout; - internal static glfwWindowHint glfw_WindowHint; - internal static glfwWindowHintString glfw_WindowHintString; - internal static glfwWindowShouldClose glfw_WindowShouldClose; - //internal [NotNull] static glfwGetInstanceProcAddress glfw_GetInstanceProcAddress; - //internal [NotNull] static glfwGetPhysicalDevicePresentationSupport glfw_GetPhysicalDevicePresentationSupport; - //internal [NotNull] static glfwCreateWindowSurface glfw_CreateWindowSurface; - - - #endregion - - #region api - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int Init() => glfw_Init(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void Terminate() => glfw_Terminate(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void InitHint(int hint, int value) => glfw_InitHint(hint, value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetVersion(int* major, int* minor, int* rev) => glfw_GetVersion(major, minor, rev); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetVersionString() => glfw_GetVersionString(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetError(byte** description) => glfw_GetError(description); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWerrorfun SetErrorCallback(GLFWerrorfun callback) => glfw_SetErrorCallback(callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr* GetMonitors(int* count) => glfw_GetMonitors(count); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetPrimaryMonitor() => glfw_GetPrimaryMonitor(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorPos(IntPtr monitor, int* xpos, int* ypos) => glfw_GetMonitorPos(monitor, xpos, ypos); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorWorkarea(IntPtr monitor, int* xpos, int* ypos, int* width, int* height) => glfw_GetMonitorWorkarea(monitor, xpos, ypos, width, height); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorPhysicalSize(IntPtr monitor, int* widthMM, int* heightMM) => glfw_GetMonitorPhysicalSize(monitor, widthMM, heightMM); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetMonitorContentScale(IntPtr monitor, float* xscale, float* yscale) => glfw_GetMonitorContentScale(monitor, xscale, yscale); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetMonitorName(IntPtr monitor) => glfw_GetMonitorName(monitor); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetMonitorUserPointer(IntPtr monitor, void* pointer) => glfw_SetMonitorUserPointer(monitor, pointer); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void* GetMonitorUserPointer(IntPtr monitor) => glfw_GetMonitorUserPointer(monitor); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWmonitorfun SetMonitorCallback(GLFWmonitorfun callback) => glfw_SetMonitorCallback(callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWvidmode* GetVideoModes(IntPtr monitor, int* count) => glfw_GetVideoModes(monitor, count); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWvidmode* GetVideoMode(IntPtr monitor) => glfw_GetVideoMode(monitor); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetGamma(IntPtr monitor, float gamma) => glfw_SetGamma(monitor, gamma); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWgammaramp* GetGammaRamp(IntPtr monitor) => glfw_GetGammaRamp(monitor); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetGammaRamp(IntPtr monitor, GLFWgammaramp* ramp) => glfw_SetGammaRamp(monitor, ramp); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void DefaultWindowHints() => glfw_DefaultWindowHints(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WindowHint(int hint, int value) => glfw_WindowHint(hint, value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WindowHintString(int hint, byte* value) => glfw_WindowHintString(hint, value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr CreateWindow(int width, int height, byte[] title, IntPtr monitor, IntPtr share) => glfw_CreateWindow(width, height, title, monitor, share); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void DestroyWindow(IntPtr window) => glfw_DestroyWindow(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int WindowShouldClose(IntPtr window) => glfw_WindowShouldClose(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowShouldClose(IntPtr window, int value) => glfw_SetWindowShouldClose(window, value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowTitle(IntPtr window, byte* title) => glfw_SetWindowTitle(window, title); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowIcon(IntPtr window, int count, GLFWimage* images) => glfw_SetWindowIcon(window, count, images); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowPos(IntPtr window, int* xpos, int* ypos) => glfw_GetWindowPos(window, xpos, ypos); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowPos(IntPtr window, int xpos, int ypos) => glfw_SetWindowPos(window, xpos, ypos); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowSize(IntPtr window, int* width, int* height) => glfw_GetWindowSize(window, width, height); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowSizeLimits(IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight) => glfw_SetWindowSizeLimits(window, minwidth, minheight, maxwidth, maxheight); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowAspectRatio(IntPtr window, int numer, int denom) => glfw_SetWindowAspectRatio(window, numer, denom); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowSize(IntPtr window, int width, int height) => glfw_SetWindowSize(window, width, height); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetFramebufferSize(IntPtr window, int* width, int* height) => glfw_GetFramebufferSize(window, width, height); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowFrameSize(IntPtr window, int* left, int* top, int* right, int* bottom) => glfw_GetWindowFrameSize(window, left, top, right, bottom); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetWindowContentScale(IntPtr window, float* xscale, float* yscale) => glfw_GetWindowContentScale(window, xscale, yscale); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe float GetWindowOpacity(IntPtr window) => glfw_GetWindowOpacity(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowOpacity(IntPtr window, float opacity) => glfw_SetWindowOpacity(window, opacity); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void IconifyWindow(IntPtr window) => glfw_IconifyWindow(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void RestoreWindow(IntPtr window) => glfw_RestoreWindow(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void MaximizeWindow(IntPtr window) => glfw_MaximizeWindow(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void ShowWindow(IntPtr window) => glfw_ShowWindow(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void HideWindow(IntPtr window) => glfw_HideWindow(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void FocusWindow(IntPtr window) => glfw_FocusWindow(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void RequestWindowAttention(IntPtr window) => glfw_RequestWindowAttention(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetWindowMonitor(IntPtr window) => glfw_GetWindowMonitor(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowMonitor(IntPtr window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate) => glfw_SetWindowMonitor(window, monitor, xpos, ypos, width, height, refreshRate); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetWindowAttrib(IntPtr window, int attrib) => glfw_GetWindowAttrib(window, attrib); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowAttrib(IntPtr window, int attrib, int value) => glfw_SetWindowAttrib(window, attrib, value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetWindowUserPointer(IntPtr window, void* pointer) => glfw_SetWindowUserPointer(window, pointer); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void* GetWindowUserPointer(IntPtr window) => glfw_GetWindowUserPointer(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowposfun SetWindowPosCallback(IntPtr window, GLFWwindowposfun callback) => glfw_SetWindowPosCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowsizefun SetWindowSizeCallback(IntPtr window, GLFWwindowsizefun callback) => glfw_SetWindowSizeCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowclosefun SetWindowCloseCallback(IntPtr window, GLFWwindowclosefun callback) => glfw_SetWindowCloseCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowrefreshfun SetWindowRefreshCallback(IntPtr window, GLFWwindowrefreshfun callback) => glfw_SetWindowRefreshCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowfocusfun SetWindowFocusCallback(IntPtr window, GLFWwindowfocusfun callback) => glfw_SetWindowFocusCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowiconifyfun SetWindowIconifyCallback(IntPtr window, GLFWwindowiconifyfun callback) => glfw_SetWindowIconifyCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowmaximizefun SetWindowMaximizeCallback(IntPtr window, GLFWwindowmaximizefun callback) => glfw_SetWindowMaximizeCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe FramebuffersizeHandler SetFramebufferSizeCallback(IntPtr window, IntPtr callback) => glfw_SetFramebufferSizeCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWwindowcontentscalefun SetWindowContentScaleCallback(IntPtr window, GLFWwindowcontentscalefun callback) => glfw_SetWindowContentScaleCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void PollEvents() => glfw_PollEvents(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WaitEvents() => glfw_WaitEvents(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void WaitEventsTimeout(double timeout) => glfw_WaitEventsTimeout(timeout); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void PostEmptyEvent() => glfw_PostEmptyEvent(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetInputMode(IntPtr window, int mode) => glfw_GetInputMode(window, mode); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetInputMode(IntPtr window, int mode, int value) => glfw_SetInputMode(window, mode, value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int RawMouseMotionSupported() => glfw_RawMouseMotionSupported(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetKeyName(int key, int scancode) => glfw_GetKeyName(key, scancode); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetKeyScancode(int key) => glfw_GetKeyScancode(key); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe KeyStatus GetKey(IntPtr window, int key) => glfw_GetKey(window, key); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetMouseButton(IntPtr window, int button) => glfw_GetMouseButton(window, button); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void GetCursorPos(IntPtr window, double* xpos, double* ypos) => glfw_GetCursorPos(window, xpos, ypos); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetCursorPos(IntPtr window, double xpos, double ypos) => glfw_SetCursorPos(window, xpos, ypos); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursor* CreateCursor(GLFWimage* image, int xhot, int yhot) => glfw_CreateCursor(image, xhot, yhot); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursor* CreateStandardCursor(int shape) => glfw_CreateStandardCursor(shape); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void DestroyCursor(GLFWcursor* cursor) => glfw_DestroyCursor(cursor); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetCursor(IntPtr window, GLFWcursor* cursor) => glfw_SetCursor(window, cursor); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWkeyfun SetKeyCallback(IntPtr window, GLFWkeyfun callback) => glfw_SetKeyCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcharfun SetCharCallback(IntPtr window, GLFWcharfun callback) => glfw_SetCharCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcharmodsfun SetCharModsCallback(IntPtr window, GLFWcharmodsfun callback) => glfw_SetCharModsCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWmousebuttonfun SetMouseButtonCallback(IntPtr window, GLFWmousebuttonfun callback) => glfw_SetMouseButtonCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursorposfun SetCursorPosCallback(IntPtr window, GLFWcursorposfun callback) => glfw_SetCursorPosCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWcursorenterfun SetCursorEnterCallback(IntPtr window, GLFWcursorenterfun callback) => glfw_SetCursorEnterCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWscrollfun SetScrollCallback(IntPtr window, GLFWscrollfun callback) => glfw_SetScrollCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWdropfun SetDropCallback(IntPtr window, GLFWdropfun callback) => glfw_SetDropCallback(window, callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int JoystickPresent(int jid) => glfw_JoystickPresent(jid); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe float* GetJoystickAxes(int jid, int* count) => glfw_GetJoystickAxes(jid, count); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickButtons(int jid, int* count) => glfw_GetJoystickButtons(jid, count); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickHats(int jid, int* count) => glfw_GetJoystickHats(jid, count); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickName(int jid) => glfw_GetJoystickName(jid); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetJoystickGUID(int jid) => glfw_GetJoystickGUID(jid); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetJoystickUserPointer(int jid, void* pointer) => glfw_SetJoystickUserPointer(jid, pointer); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void* GetJoystickUserPointer(int jid) => glfw_GetJoystickUserPointer(jid); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int JoystickIsGamepad(int jid) => glfw_JoystickIsGamepad(jid); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWjoystickfun SetJoystickCallback(GLFWjoystickfun callback) => glfw_SetJoystickCallback(callback); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int UpdateGamepadMappings(byte* str) => glfw_UpdateGamepadMappings(str); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetGamepadName(int jid) => glfw_GetGamepadName(jid); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetGamepadState(int jid, GLFWgamepadstate* state) => glfw_GetGamepadState(jid, state); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetClipboardString(IntPtr window, byte* str) => glfw_SetClipboardString(window, str); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte* GetClipboardString(IntPtr window) => glfw_GetClipboardString(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe double GetTime() => glfw_GetTime(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SetTime(double time) => glfw_SetTime(time); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe ulong* GetTimerValue() => glfw_GetTimerValue(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe ulong* GetTimerFrequency() => glfw_GetTimerFrequency(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void MakeContextCurrent(IntPtr window) => glfw_MakeContextCurrent(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetCurrentContext() => glfw_GetCurrentContext(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SwapBuffers(IntPtr window) => glfw_SwapBuffers(window); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void SwapInterval(int interval) => glfw_SwapInterval(interval); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int ExtensionSupported(byte* extension) => glfw_ExtensionSupported(extension); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe IntPtr GetProcAddress(string procname) => glfw_GetProcAddress(procname); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int VulkanSupported() => glfw_VulkanSupported(); - [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe byte** GetRequiredInstanceExtensions(uint* count) => glfw_GetRequiredInstanceExtensions(count); - //[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe GLFWvkproc GetInstanceProcAddress(VkInstance instance, byte* procname)=>glfwGetInstanceProcAddress(instance, procname) - //[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe int GetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint* queuefamily) => glfw_GetPhysicalDevicePresentationSupport(instance, device, queuefamily); - //[MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe VkResult CreateWindowSurface(VkInstance instance, IntPtr window, VkAllocationCallbacks* allocator, VkSurfaceKHR* surface)=>glfwCreateWindowSurface(instance, window, allocator, surface) - #endregion - - } } diff --git a/源代码/StgSharp/Graphics/GL/glApiManager.cs b/源代码/StgSharp/Graphics/GL/glApiManager.cs index 97dc8a5b..707fd294 100644 --- a/源代码/StgSharp/Graphics/GL/glApiManager.cs +++ b/源代码/StgSharp/Graphics/GL/glApiManager.cs @@ -752,7 +752,7 @@ namespace StgSharp.Graphics /// The funtion pointer of the api in form of public static IntPtr LoadGLfunc(string name) { - IntPtr ret = InternalIO.glfw.GetProcAddress(name); + IntPtr ret = InternalIO.glfwGetProcAddress(name); if (ret == default) { InternalIO.InternalAppendLog( @@ -984,7 +984,7 @@ namespace StgSharp.Graphics #region load contextPtr->glBeginQuery = (delegate*)load("glBeginQuery"); contextPtr->glBindBuffer = (delegate*)load("glBindBuffer"); - contextPtr->glBufferData = (delegate*)load("glBufferData"); + contextPtr->glBufferData = (delegate*)load("glBufferData"); contextPtr->glBufferSubData = (delegate*)load("glBufferSubData"); contextPtr->glDeleteBuffers = (delegate*)load("glDeleteBuffers"); contextPtr->glDeleteQueries = (delegate*)load("glDeleteQueries"); @@ -1107,7 +1107,7 @@ namespace StgSharp.Graphics contextPtr->glVertexAttrib4ubv = (delegate*)load("glVertexAttrib4ubv"); contextPtr->glVertexAttrib4uiv = (delegate*)load("glVertexAttrib4uiv"); contextPtr->glVertexAttrib4usv = (delegate*)load("glVertexAttrib4usv"); - contextPtr->glVertexAttribPointer = (delegate*)load("glVertexAttribPointer"); + contextPtr->glVertexAttribPointer = (delegate*)load("glVertexAttribPointer"); #endregion InternalIO.InternalAppendLog("Successfully load all OpenGL 2.0 APIs"); diff --git a/源代码/StgSharp/Graphics/IglFunc.cs b/源代码/StgSharp/Graphics/IglFunc.cs index 34cc5548..939977b1 100644 --- a/源代码/StgSharp/Graphics/IglFunc.cs +++ b/源代码/StgSharp/Graphics/IglFunc.cs @@ -58,7 +58,7 @@ namespace StgSharp.Graphics /// /// Type of texture to bind /// Sign of texture - void BindTexture(uint type, uint texture); + void BindTexture(uint type, glHandle texture); /// /// Same function as OpenGL api, glBindVertexArray @@ -145,43 +145,41 @@ namespace StgSharp.Graphics /// /// /// - void DrawElements(GepmetryType mode, uint count, Type type, IntPtr ptr); + void DrawElements(GepmetryType mode, uint count, TypeCode type, IntPtr ptr); /// /// Same fucntion as the OpenGL api glGenBuffers /// /// - /// - unsafe void GenBuffers(uint count, glHandleSet handleSet); + /// + unsafe glHandleSet GenBuffers(int count); /// /// Same fucnction as OpenGL api glGenTextures. /// /// amount of textures to generate - /// Handle of texture - unsafe void GenTextures(uint count, glHandleSet handleSet); + unsafe glHandleSet GenTextures(int count); /// /// Same fucntion as OpenGL api, glGenVertexArray /// /// Amount of vao to be generated - /// Handle of vao sign array - unsafe void GenVertexArrays(uint count, glHandleSet handleSet); + unsafe glHandleSet GenVertexArrays(int count); - void GetGraphicError(); /// /// Same fucntion as OpenGL api, glGetUniformLocation /// /// Shader program to find the uniform - /// Pointer to byte array of name of the uniform + /// Name of the uniform /// - unsafe int GetUniformLocation(uint program, byte* ptr); + unsafe glSHandle GetUniformLocation(glHandle program, string name); + bool GetWindowShouldClose(Form form); /// - /// Make the OpenGL context of a vertain as the activated OpenGL context. + /// Make the OpenGL context of a certain as the activated OpenGL context. /// /// void MakeContexCurrent(Form form); @@ -190,8 +188,6 @@ namespace StgSharp.Graphics void SetBufferData(BufferType bufferType, T[] bufferArray, BufferUsage usage) where T : struct, IConvertible; - internal void SetFrameBufferSizeCallback(IntPtr id, FrameBufferSizeHandler handler); - /// /// Set data value to a float , /// all types of parameters are float. @@ -263,11 +259,7 @@ namespace StgSharp.Graphics /// /// Pixels stride of each sets of data /// - void SetVertexAttribute(uint index, int size, Type t, bool normalized, uint stride, int pointer); - - void SetWindowShouldClose(Form form, bool mark); - - void SwapBuffers(Form form); + void SetVertexAttribute(uint index, int size, TypeCode t, bool normalized, uint stride, int pointer); /// /// Same function as OpenGL api glTexImage2d @@ -279,8 +271,8 @@ namespace StgSharp.Graphics /// height of image /// color channels of this image /// how this image express each pixel - /// pointer to data array of pixels - unsafe void TextureImage2d(uint target, int level, uint internalformat, uint width, uint height, uint format, uint type, void* pixels); + /// data array of pixels + unsafe void TextureImage2d(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, T[] pixels) where T : struct; /// /// Same fucntion as OpenGL api glTexParameteri @@ -288,13 +280,13 @@ namespace StgSharp.Graphics /// texture target to set parameters /// name of parameter /// value of parameter - void TextureParameter(uint target, uint pname, int param); + void TextureParameter(int target, uint pname, int param); /// /// Same fucntion as OpenGL api glUseShader. /// /// Sign of program to be used - void UseProgram(uint program); + void UseProgram(glHandle program); /// /// Same function as the OpenGL api, glViewPort diff --git a/源代码/StgSharp/Logic/glParamQueue.cs b/源代码/StgSharp/Logic/glParamQueue.cs index 700b12ef..9356d825 100644 --- a/源代码/StgSharp/Logic/glParamQueue.cs +++ b/源代码/StgSharp/Logic/glParamQueue.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; -using System.Reflection.Metadata; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; @@ -51,6 +50,17 @@ namespace StgSharp.Logic paramQueue.Enqueue(m); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Enqueue(uint u0, uint u1, uint u2) + { + M128 m = default; + m.UInt32[0] = u0; + m.UInt32[1] = u1; + m.UInt32[2] = u2; + paramQueue.Enqueue(m); + + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Enqueue(float f0, float f1, float f2, float f3) { @@ -139,28 +149,14 @@ namespace StgSharp.Logic { paramQueue.TryDequeue(out m); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out glHandle handle) + public void TryDequeue(out Vec4d v) { - M128 ret; - if (paramQueue.TryDequeue(out ret)) + M128 m; + if (paramQueue.TryDequeue(out m)) { - handle.valuePtr = (uint*)ret.IntPtr0; - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out glHandle handle, out glHandle handle1) - { - M128 ret; - if (paramQueue.TryDequeue(out ret)) - { - handle.valuePtr = (uint*)ret.IntPtr0; - handle1.valuePtr = (uint*)ret.IntPtr1; + v = *(Vec4d*)&m; } else { @@ -168,6 +164,7 @@ namespace StgSharp.Logic throw new Exception(); } } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void TryDequeue(out int i0) { @@ -182,6 +179,7 @@ namespace StgSharp.Logic throw new Exception(); } } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void TryDequeue(out int i0, out int i1) { @@ -231,21 +229,6 @@ namespace StgSharp.Logic } } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out glHandle handle) - { - M128 ret; - if (paramQueue.TryDequeue(out ret)) - { - handle = ret.UInt32[0]; - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public void TryDequeue(out IntPtr p) { @@ -327,6 +310,41 @@ namespace StgSharp.Logic } } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TryDequeue(out uint u0, out uint u1, out uint u2) + { + M128 ret; + if (paramQueue.TryDequeue(out ret)) + { + u0 = ret.UInt32[0]; + u1 = ret.UInt32[1]; + u2 = ret.UInt32[2]; + } + else + { + InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); + throw new Exception(); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void TryDequeue(out uint u0, out uint u1, out uint u2, out uint u3) + { + M128 ret; + if (paramQueue.TryDequeue(out ret)) + { + u0 = ret.UInt32[0]; + u1 = ret.UInt32[1]; + u2 = ret.UInt32[2]; + u3 = ret.UInt32[3]; + } + else + { + InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); + throw new Exception(); + } + } + internal void SetContext(GLcontext* p) { context = p; diff --git a/源代码/StgSharp/Math/Linear/vec2d.cs b/源代码/StgSharp/Math/Linear/vec2d.cs index d5a16766..6f6c1877 100644 --- a/源代码/StgSharp/Math/Linear/vec2d.cs +++ b/源代码/StgSharp/Math/Linear/vec2d.cs @@ -4,12 +4,10 @@ using System.Runtime.InteropServices; namespace StgSharp.Math { - /// /// A two dimension vector defined by two elements. /// Vec2Ds in StgSharp are defaultly usaed as colum vector. /// - [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] public struct Vec2d { @@ -21,10 +19,17 @@ namespace StgSharp.Math [FieldOffset(0)] internal Vector4 vec; + [FieldOffset(0)] + internal Vector2 v; public Vec2d(float x, float y) { - X = x; Y = y; + v = new Vector2(x, y); + } + + internal Vec2d(Vector2 vec) + { + v = vec; } public static Vec2d Zero @@ -32,43 +37,36 @@ namespace StgSharp.Math get { return new Vec2d(0, 0); } } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec2d operator +(Vec2d vec1, Vec2d vec2) + public static Vec2d Unit { - return new Vec2d( - vec1.X + vec2.X, - vec1.Y + vec2.Y - ); + get { return new Vec2d(1, 1); } } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec2d operator -(Vec2d vec1, Vec2d vec2) + public static Vec2d operator +(Vec2d left, Vec2d right) { - return new Vec2d( - vec1.X - vec2.X, - vec1.Y - vec2.Y - ); + return new Vec2d(left.v + right.v); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Vec2d operator -(Vec2d left, Vec2d right) + { + return new Vec2d(left.v - right.v); } public static Vec2d operator *(Vec2d vec, float value) { - return new Vec2d( - vec.X * value, - vec.Y * value - ); + return new Vec2d(vec.v * value); } public static Vec2d operator /(Vec2d vec, float value) { - return new Vec2d( - vec.X / value, - vec.Y / value - ); + return new Vec2d(vec.v / value); } public static bool operator ==(Vec2d left, Vec2d right) { - return left.X == right.X && left.Y == right.Y; + return left.v == right.v; } public static bool operator !=(Vec2d left, Vec2d right) diff --git a/源代码/StgSharp/Math/Linear/vec3d.cs b/源代码/StgSharp/Math/Linear/vec3d.cs index 3598c3d0..1d664b5b 100644 --- a/源代码/StgSharp/Math/Linear/vec3d.cs +++ b/源代码/StgSharp/Math/Linear/vec3d.cs @@ -3,6 +3,7 @@ using System; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Security.AccessControl; namespace StgSharp.Math { @@ -11,6 +12,8 @@ namespace StgSharp.Math { [FieldOffset(0)] internal Vector4 vec; + [FieldOffset(0)] + internal Vector3 v; [FieldOffset(0)] public float X; [FieldOffset(4)] public float Y; @@ -28,7 +31,7 @@ namespace StgSharp.Math #if NET5_0_OR_GREATER Unsafe.SkipInit(out vec); #endif - X = x; Y = y; Z = z; + v = new Vector3(x, y, z); } internal vec3d(Vector4 vector) @@ -36,6 +39,11 @@ namespace StgSharp.Math vec = vector; } + internal vec3d(Vector3 vector) + { + v = vector; + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public float Dot(vec3d right) { @@ -76,61 +84,42 @@ namespace StgSharp.Math [MethodImpl(MethodImplOptions.AggressiveInlining)] public static vec3d operator -(vec3d left, vec3d right) { - return new vec3d( - left.X - right.X, - left.Y - right.Y, - left.Z - right.Z - ); + return new vec3d(left.v - right.v); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static vec3d operator *(vec3d vec, float value) { - return new vec3d( - vec.X * value, - vec.Y * value, - vec.Z * value - ); + return new vec3d(vec.v * value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static vec3d operator /(vec3d vec, float value) { - return new vec3d( - vec.X / value, - vec.Y / value, - vec.Z / value - ); + return new vec3d(vec.v / value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float operator *(vec3d left, vec3d right) { - return - left.X * right.X + - left.Y * right.Y + - left.Z * right.Z; + return Vector3.Dot(left.v, right.v); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(vec3d left, vec3d right) { - return left.X == right.X - && left.Y == right.Y - && left.Z == right.Z; + return left.v == right.v; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator !=(vec3d left, vec3d right) { - return left.X != right.X - && left.Y != right.Y - && left.Z != right.Z; + return left.v != right.v; } public string ToString(string sample) { - return $"{this.X}\t{this.Y}\t{this.Z}\t"; + return $"[{X.ToString(sample)},{Y.ToString(sample)},{Z.ToString(sample)}]"; } public bool Equals(vec3d other) diff --git a/源代码/StgSharp/Math/Linear/vec4d.cs b/源代码/StgSharp/Math/Linear/vec4d.cs index 4be04ea3..714f1196 100644 --- a/源代码/StgSharp/Math/Linear/vec4d.cs +++ b/源代码/StgSharp/Math/Linear/vec4d.cs @@ -1,5 +1,6 @@ using StgSharp.Controlling; using StgSharp.Math; +using System; using System.Data.Common; using System.Numerics; using System.Runtime.InteropServices; @@ -39,10 +40,10 @@ namespace StgSharp.Math [FieldOffset(8)] public float Z; [FieldOffset(12)] public float W; - public Vec4d( - float x, float y, float z, float w) + + public Vec4d(float x, float y, float z, float w) { - X = x; Y = y; Z = z; W = w; + vec = new Vector4(x, y, z, w); } public static implicit operator M128(Vec4d vec) diff --git a/源代码/StgSharpDebug/Environment/Platform.cs b/源代码/StgSharpDebug/Environment/Platform.cs index 40c7524e..1c7783c2 100644 --- a/源代码/StgSharpDebug/Environment/Platform.cs +++ b/源代码/StgSharpDebug/Environment/Platform.cs @@ -34,53 +34,9 @@ namespace StgSharp /// This method should be called before other /// graphic methods, after LoadGL method. /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void InitGL(int majorVersion, int minorVersion) { - if (InternalIO.glfw == null) - { - try - { - InternalIO.glfw = new glFramework_PInvoke(); - InternalIO.glfw.Init(); - InternalIO.InternalWriteLog("Successfully load GLFW APIs. StgSharp is now working on p/invoke mode", LogType.Info); - } - catch (Exception sig) - { - string log = $"Failed to load GLFW APIs by P/Invoke," + - $"StgSharp will switch to delegate mode. The detailed info is:\n" + - $"{sig.Message}\n"; - - if (InternalIO.SSClibPtr == default) - { - InternalIO.SSClibPtr = - InternalIO.InternalLoadWINlib(InternalIO.SSC_libname + ".dll"); - } - - InternalIO.glfw = new glFramework_Delegate(); - InternalIO.SSClibPtr = InternalIO.InternalLoadWINlib(InternalIO.SSC_libname); - FieldInfo[] glfwApis = typeof(glFramework_Delegate).GetFields(); - foreach (FieldInfo item in glfwApis) - { - if (item.FieldType.BaseType == typeof(Delegate)) - { - try - { - IntPtr funcptr = InternalIO.InternalGetWINproc( - InternalIO.SSClibPtr, item.Name); - item.SetValue(null, ConvertAPI(funcptr, item.FieldType)); - log += $"Successfully load GLFW API called {item.Name}"; - } - catch (Exception ex) - { - log += $"Failed to load GLFW API called {item.Name}, the detailed info is\n" + - $"{ex.Message}"; - continue; - } - } - } - InternalIO.InternalWriteLog(log, LogType.Warning); - } - } InternalIO.InternalInitGL(majorVersion, minorVersion); } diff --git a/源代码/StgSharpDebug/Program.cs b/源代码/StgSharpDebug/Program.cs index 8d96fc9f..b7ed486c 100644 --- a/源代码/StgSharpDebug/Program.cs +++ b/源代码/StgSharpDebug/Program.cs @@ -19,17 +19,17 @@ namespace StgSharp ElementBuffer ebo; Uniform ourTexture; Uniform ourTexture2; - Shader shader; + ShaderProgram shader; Texture texture; VertexArray vao; VertexBuffer vbo; public static unsafe void ProcessInput(IntPtr windowPtr) { - if (InternalIO.glfw.GetKey(windowPtr, (int)Operation.Key.ESCAPE) + if (InternalIO.glfwGetKey(windowPtr, (int)Operation.Key.ESCAPE) == KeyStatus.PRESS) { - InternalIO.glfw.SetWindowShouldClose(windowPtr, 1); + InternalIO.glfwSetWindowShouldClose(windowPtr, 1); } } @@ -41,7 +41,7 @@ namespace StgSharp ebo.Dispose(); /**/ - InternalIO.glfw.Terminate(); + InternalIO.glfwTerminate(); } public unsafe void FormSizeCallback(IntPtr window, uint width, uint height) @@ -69,12 +69,15 @@ namespace StgSharp this.LoadGLapi(null); - shader = CreateShader(ShaderType.Program, 1); + shader = CreateShaderProgram(); var vertex = CreateShader(ShaderType.Vertex, 1); var fragment = CreateShader(ShaderType.Fragment, 1); - vertex.Compile(File.ReadAllText("Shader\\vertex.vert")); - fragment.Compile(File.ReadAllText("Shader\\fragment.frag")); - shader.Link(0); + vertex.Compile(ShaderType.Vertex, File.ReadAllText("Shader\\vertex.vert")); + vertex.AttachTo(0, shader); + fragment.Compile(ShaderType.Fragment, File.ReadAllText("Shader\\fragment.frag")); + fragment.AttachTo(0, shader); + + shader.Link(); Triangle tri = new Triangle( -0.5f, -0.3f, 0.0f, @@ -115,13 +118,13 @@ namespace StgSharp ebo.SetValue(0, rec.Indices, BufferUsage.STATIC_DRAW); vbo.SetValue(0, rec.VertexBuffer, BufferUsage.STATIC_DRAW); - gl.SetVertexAttribute(0, 3, typeof(float), false, 4 * sizeof(float), 0); + gl.SetVertexAttribute(0, 3, TypeCode.Single, false, 4 * sizeof(float), 0); vbo.SetValueArray(1, texCoord, BufferUsage.STATIC_DRAW); - gl.SetVertexAttribute(2, 2, typeof(float), false, 2 * sizeof(float), 0); + gl.SetVertexAttribute(2, 2, TypeCode.Single, false, 2 * sizeof(float), 0); /**/ - gl.BindBuffer(BufferType.ARRAY_BUFFER, 0); + gl.BindBuffer(BufferType.ARRAY_BUFFER, glHandle.Zero); vao.BindNull(); /**/ @@ -168,7 +171,7 @@ namespace StgSharp texture.Bind2D(1); /**/ - float time = (float)InternalIO.glfw.GetTime(); + float time = (float)InternalIO.glfwGetTime(); gl.SetValue(color, 0.5f + MathF.Sin(time), 0.5f + MathF.Sin(time/* + 0.667f * 3.14f/**/), @@ -177,12 +180,12 @@ namespace StgSharp vao.Bind(0); - gl.DrawElements(GepmetryType.TRIANGLES, 6, typeof(uint), IntPtr.Zero); + gl.DrawElements(GepmetryType.TRIANGLES, 6, TypeCode.UInt32, IntPtr.Zero); vao.BindNull(); - InternalIO.glfw.SwapBuffers(windowID); - InternalIO.glfw.PollEvents(); + InternalIO.glfwSwapBuffers(windowID); + InternalIO.glfwPollEvents(); } } diff --git a/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.AssemblyInfo.cs b/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.AssemblyInfo.cs index 98e39ef1..91f1f92b 100644 --- a/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.AssemblyInfo.cs +++ b/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharpDebug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Benchmark")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6fe6b3b3cf0f9c3e9661a85bbe9b084eae6439cd")] [assembly: System.Reflection.AssemblyProductAttribute("StgSharpDebug")] [assembly: System.Reflection.AssemblyTitleAttribute("StgSharpDebug")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.AssemblyInfoInputs.cache b/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.AssemblyInfoInputs.cache index eb493cd1..db07d74d 100644 --- a/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.AssemblyInfoInputs.cache +++ b/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.AssemblyInfoInputs.cache @@ -1 +1 @@ -e340c06b75b4a2ce53efde5f4632c7a375a08a6b1987e3663da0e443a4eb16a3 +48dfbe97284dd3ebda2da46302a4529fe78a17c51349d96e6c0652ee5a8bf5f0 diff --git a/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.csproj.CoreCompileInputs.cache b/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.csproj.CoreCompileInputs.cache index 5671c309..75391be5 100644 --- a/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.csproj.CoreCompileInputs.cache +++ b/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -6bee2f0b7bdd2034c75e15618c5bcce64515bb43097f5e90879477a87416cc44 +aec1e613fe2e6b847e2739cf83946a30bb66e4ccb46edd6e47331a1ecca76c45 diff --git a/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.sourcelink.json b/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.sourcelink.json index 0fffb972..b58edf81 100644 --- a/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.sourcelink.json +++ b/源代码/StgSharpDebug/obj/x64/Benchmark/net6.0/StgSharpDebug.sourcelink.json @@ -1 +1 @@ -{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/5d778e0f2f6e677453cebc990919697968c771f9/*"}} \ No newline at end of file +{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/6fe6b3b3cf0f9c3e9661a85bbe9b084eae6439cd/*"}} \ No newline at end of file