diff --git a/CCD_Cloud_Sync.ffs_batch b/CCD_Cloud_Sync.ffs_batch new file mode 100644 index 00000000..97d64e45 --- /dev/null +++ b/CCD_Cloud_Sync.ffs_batch @@ -0,0 +1,45 @@ + + + + + Content + Exclude + + + + + Versioning + C:\Users\Nitlo\OneDrive - MSFT\CCD_Project_File\0-0\ProjectBackupHistory + + + + * + + + \System Volume Information\ + \$Recycle.Bin\ + \RECYCLE?\ + *\thumbs.db + *\.git + + 0 + 0 + 0 + + + + D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile + C:\Users\Nitlo\OneDrive - MSFT\CCD_Project_File\0-0\ProjectBackup + + + + + C:\Users\Nitlo\OneDrive - MSFT\CCD_Project_File\0-0\ProjectBackupLog + + Action + + + Show + None + + diff --git a/CCD_Sync.ffs_batch b/CCD_Sync.ffs_batch index 07a93c4f..6bde7dff 100644 --- a/CCD_Sync.ffs_batch +++ b/CCD_Sync.ffs_batch @@ -1,13 +1,13 @@ - + + Content Exclude - Update - false + Versioning A:\荷城工业\研究项目\1-旗舰级\东方同人TH2020\历史版本 @@ -21,9 +21,9 @@ \RECYCLE?\ *\thumbs.db - 0 0 0 + 0 @@ -35,6 +35,7 @@ A:\荷城工业\研究项目\1-旗舰级\东方同人TH2020\历史版本\同步日志 + Action Show diff --git a/公文/文件确认单.pdf b/公文/文件确认单.pdf new file mode 100644 index 00000000..b46cc618 Binary files /dev/null and b/公文/文件确认单.pdf differ diff --git a/公文/文件确认单.pub b/公文/文件确认单.pub index d31d5bb2..c6a0d6f5 100644 Binary files a/公文/文件确认单.pub and b/公文/文件确认单.pub differ diff --git a/图像/测试素材/参考人物立绘600x1200.png b/图像/测试素材/参考人物立绘600x1200.png new file mode 100644 index 00000000..c5d8e653 Binary files /dev/null and b/图像/测试素材/参考人物立绘600x1200.png differ diff --git a/图像/测试素材/参考人物立绘600x1200.psd b/图像/测试素材/参考人物立绘600x1200.psd new file mode 100644 index 00000000..73e241bf Binary files /dev/null and b/图像/测试素材/参考人物立绘600x1200.psd differ diff --git a/图像/测试素材/参考背景1440x1080.png b/图像/测试素材/参考背景1440x1080.png new file mode 100644 index 00000000..ba5d7c5a Binary files /dev/null and b/图像/测试素材/参考背景1440x1080.png differ diff --git a/图像/测试素材/参考背景1440x1080.psd b/图像/测试素材/参考背景1440x1080.psd new file mode 100644 index 00000000..245da95e Binary files /dev/null and b/图像/测试素材/参考背景1440x1080.psd differ diff --git a/图像/测试素材/字符显示测试图形.png b/图像/测试素材/字符显示测试图形.png new file mode 100644 index 00000000..33f03267 Binary files /dev/null and b/图像/测试素材/字符显示测试图形.png differ diff --git a/图像/测试素材/字符显示测试图形.psd b/图像/测试素材/字符显示测试图形.psd new file mode 100644 index 00000000..38baeca6 Binary files /dev/null and b/图像/测试素材/字符显示测试图形.psd differ diff --git a/图像/测试素材/无方向标记点.png b/图像/测试素材/无方向标记点.png new file mode 100644 index 00000000..b4aff56a Binary files /dev/null and b/图像/测试素材/无方向标记点.png differ diff --git a/图像/测试素材/无方向标记点.psd b/图像/测试素材/无方向标记点.psd new file mode 100644 index 00000000..fdfb9eff Binary files /dev/null and b/图像/测试素材/无方向标记点.psd differ diff --git a/图像/测试素材/有方向标记点.png b/图像/测试素材/有方向标记点.png new file mode 100644 index 00000000..94c9cffd Binary files /dev/null and b/图像/测试素材/有方向标记点.png differ diff --git a/图像/测试素材/有方向标记点.psd b/图像/测试素材/有方向标记点.psd new file mode 100644 index 00000000..9e8a2739 Binary files /dev/null and b/图像/测试素材/有方向标记点.psd differ diff --git a/声音/音乐委托/Staff/2. Paradise ~ Deep Mountain (ZUN).mid b/声音/音乐委托/Staff/2. Paradise ~ Deep Mountain (ZUN).mid new file mode 100644 index 00000000..44365e40 Binary files /dev/null and b/声音/音乐委托/Staff/2. Paradise ~ Deep Mountain (ZUN).mid differ diff --git a/声音/音乐委托/Staff/Crimson Tower ~ Eastern Dream... (ZUN).mid b/声音/音乐委托/Staff/Crimson Tower ~ Eastern Dream... (ZUN).mid new file mode 100644 index 00000000..cb255b9e Binary files /dev/null and b/声音/音乐委托/Staff/Crimson Tower ~ Eastern Dream... (ZUN).mid differ diff --git a/声音/音乐委托/Staff/Staff.zip b/声音/音乐委托/Staff/Staff.zip new file mode 100644 index 00000000..9faebc7f Binary files /dev/null and b/声音/音乐委托/Staff/Staff.zip differ diff --git a/声音/音乐委托/Staff/社团荷城空间向“千叶明里”发出《东方秘闻章》音乐制作Staff曲委托技术说明书.pdf b/声音/音乐委托/Staff/社团荷城空间向“千叶明里”发出《东方秘闻章》音乐制作Staff曲委托技术说明书.pdf new file mode 100644 index 00000000..27fbdd49 Binary files /dev/null and b/声音/音乐委托/Staff/社团荷城空间向“千叶明里”发出《东方秘闻章》音乐制作Staff曲委托技术说明书.pdf differ diff --git a/声音/音乐委托/标题/Project1-Thema.wav b/声音/音乐委托/标题/Project1-Thema.wav new file mode 100644 index 00000000..ed5aea7f Binary files /dev/null and b/声音/音乐委托/标题/Project1-Thema.wav differ diff --git a/声音/音乐委托/标题/Romantic Children (TouhouMIDICreator).mid b/声音/音乐委托/标题/Romantic Children (TouhouMIDICreator).mid new file mode 100644 index 00000000..c714134f Binary files /dev/null and b/声音/音乐委托/标题/Romantic Children (TouhouMIDICreator).mid differ diff --git a/声音/音乐委托/标题/东方秘闻章角色设定.docx b/声音/音乐委托/标题/东方秘闻章角色设定.docx new file mode 100644 index 00000000..ff085112 Binary files /dev/null and b/声音/音乐委托/标题/东方秘闻章角色设定.docx differ diff --git a/声音/音乐委托/标题/标题.zip b/声音/音乐委托/标题/标题.zip new file mode 100644 index 00000000..ab336f6b Binary files /dev/null and b/声音/音乐委托/标题/标题.zip differ diff --git a/声音/音乐委托/标题/社团荷城空间向“千叶明里”发出《东方秘闻章》音乐制作委托技术说明书.pdf b/声音/音乐委托/标题/社团荷城空间向“千叶明里”发出《东方秘闻章》音乐制作委托技术说明书.pdf new file mode 100644 index 00000000..cca0cb66 Binary files /dev/null and b/声音/音乐委托/标题/社团荷城空间向“千叶明里”发出《东方秘闻章》音乐制作委托技术说明书.pdf differ diff --git a/源代码/BenchMark/obj/Debug/net6.0/BenchMark.AssemblyInfoInputs.cache b/源代码/BenchMark/obj/Debug/net6.0/BenchMark.AssemblyInfoInputs.cache index 24b1b192..39025a5f 100644 --- a/源代码/BenchMark/obj/Debug/net6.0/BenchMark.AssemblyInfoInputs.cache +++ b/源代码/BenchMark/obj/Debug/net6.0/BenchMark.AssemblyInfoInputs.cache @@ -1 +1 @@ -366f5c2b7d0e718099c3e85a9ebf2cbf2a21cf7a6057af17e10cdb8df21f1f72 +4e2f772e3efb870291921325d240f96f8f7127093b5e0e65dca2f43393dcf94f diff --git a/源代码/BenchMark/obj/project.nuget.cache b/源代码/BenchMark/obj/project.nuget.cache index 94c76221..808228e2 100644 --- a/源代码/BenchMark/obj/project.nuget.cache +++ b/源代码/BenchMark/obj/project.nuget.cache @@ -1,6 +1,6 @@ { "version": 2, - "dgSpecHash": "4123sdokvi3zmnXMS9g0nQffUhtM78Dpcc2I+ILecRU3r3EDyKfyL6vNAxyfnuMXMHX5JuQ/V4BucHdj6AlkOA==", + "dgSpecHash": "pN+0KRm1EuqKniTJ321gPZHAydRCvNP+dkmkVcAMOjV5Not5KW22V73A7HB12P5Zye2pfbDx7qebBQIlhZmCqg==", "success": true, "projectFilePath": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\源代码\\BenchMark\\BenchMark.csproj", "expectedPackageFiles": [ diff --git a/源代码/OEM/bin/Debug/net8.0/OEM.deps.json b/源代码/OEM/bin/Debug/net8.0/OEM.deps.json deleted file mode 100644 index d83d4fbd..00000000 --- a/源代码/OEM/bin/Debug/net8.0/OEM.deps.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "runtimeTarget": { - "name": ".NETCoreApp,Version=v8.0", - "signature": "" - }, - "compilationOptions": {}, - "targets": { - ".NETCoreApp,Version=v8.0": { - "OEM/1.0.0": { - "dependencies": { - "Microsoft.DotNet.ILCompiler": "8.0.3", - "Microsoft.NET.ILLink.Tasks": "8.0.3", - "StgSharp": "1.0.0" - }, - "runtime": { - "OEM.dll": {} - } - }, - "Microsoft.CSharp/4.7.0": {}, - "Microsoft.DotNet.ILCompiler/8.0.3": {}, - "Microsoft.NET.ILLink.Tasks/8.0.3": {}, - "StgSharp/1.0.0": { - "dependencies": { - "Microsoft.CSharp": "4.7.0" - }, - "runtime": { - "StgSharp.dll": {} - } - } - } - }, - "libraries": { - "OEM/1.0.0": { - "type": "project", - "serviceable": false, - "sha512": "" - }, - "Microsoft.CSharp/4.7.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==", - "path": "microsoft.csharp/4.7.0", - "hashPath": "microsoft.csharp.4.7.0.nupkg.sha512" - }, - "Microsoft.DotNet.ILCompiler/8.0.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-LGNORlVTRa2FDy3OcP3Xu1ZSJW4tz2ATO3WrHUwHg7kxbR9HChezgJ51CwZJQt8+Yp6acp32FDC/FTPdFDOumQ==", - "path": "microsoft.dotnet.ilcompiler/8.0.3", - "hashPath": "microsoft.dotnet.ilcompiler.8.0.3.nupkg.sha512" - }, - "Microsoft.NET.ILLink.Tasks/8.0.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-0kwNg0LBIvVTx9A2mo9Mnw4wLGtaeQgjSz5P13bOOwdWPPLe9HzI+XTkwiMhS7iQCM6X4LAbFR76xScaMw0MrA==", - "path": "microsoft.net.illink.tasks/8.0.3", - "hashPath": "microsoft.net.illink.tasks.8.0.3.nupkg.sha512" - }, - "StgSharp/1.0.0": { - "type": "project", - "serviceable": false, - "sha512": "" - } - } -} \ No newline at end of file diff --git a/源代码/OEM/bin/Debug/net8.0/OEM.runtimeconfig.json b/源代码/OEM/bin/Debug/net8.0/OEM.runtimeconfig.json deleted file mode 100644 index e18f4ac3..00000000 --- a/源代码/OEM/bin/Debug/net8.0/OEM.runtimeconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "runtimeOptions": { - "tfm": "net8.0", - "framework": { - "name": "Microsoft.NETCore.App", - "version": "8.0.0" - }, - "configProperties": { - "Microsoft.Extensions.DependencyInjection.VerifyOpenGenericServiceTrimmability": true, - "System.ComponentModel.TypeConverter.EnableUnsafeBinaryFormatterInDesigntimeLicenseContextSerialization": false, - "System.Diagnostics.Tracing.EventSource.IsSupported": false, - "System.Globalization.Invariant": true, - "System.Globalization.PredefinedCulturesOnly": true, - "System.Resources.ResourceManager.AllowCustomResourceTypes": false, - "System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeSupported": false, - "System.Runtime.InteropServices.BuiltInComInterop.IsSupported": false, - "System.Runtime.InteropServices.EnableConsumingManagedCodeFromNativeHosting": false, - "System.Runtime.InteropServices.EnableCppCLIHostActivation": false, - "System.Runtime.InteropServices.Marshalling.EnableGeneratedComInterfaceComImportInterop": false, - "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false, - "System.StartupHookProvider.IsSupported": false, - "System.Text.Encoding.EnableUnsafeUTF7Encoding": false, - "System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault": false, - "System.Threading.Thread.EnableAutoreleasePool": false, - "System.Linq.Expressions.CanEmitObjectArrayDelegate": false - } - } -} \ No newline at end of file diff --git a/源代码/OEM/obj/Debug/net8.0/OEM.AssemblyInfoInputs.cache b/源代码/OEM/obj/Debug/net8.0/OEM.AssemblyInfoInputs.cache new file mode 100644 index 00000000..d7b4b302 --- /dev/null +++ b/源代码/OEM/obj/Debug/net8.0/OEM.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +640e9f98257352e84ae37176833512dc5627a4b2d18e9b9603dac0bdaa9c70df diff --git a/源代码/OEM/obj/Debug/net8.0/OEM.GeneratedMSBuildEditorConfig.editorconfig b/源代码/OEM/obj/Debug/net8.0/OEM.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 00000000..1c39a368 --- /dev/null +++ b/源代码/OEM/obj/Debug/net8.0/OEM.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,17 @@ +is_global = true +build_property.EnableAotAnalyzer = true +build_property.EnableSingleFileAnalyzer = true +build_property.EnableTrimAnalyzer = true +build_property.IncludeAllContentForSelfExtract = +build_property.TargetFramework = net8.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = true +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = OEM +build_property.ProjectDir = D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\OEM\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = false diff --git a/源代码/OEM/obj/Debug/net8.0/OEM.assets.cache b/源代码/OEM/obj/Debug/net8.0/OEM.assets.cache new file mode 100644 index 00000000..c6bb7ee1 Binary files /dev/null and b/源代码/OEM/obj/Debug/net8.0/OEM.assets.cache differ diff --git a/源代码/OEM/obj/Debug/net8.0/OEM.csproj.AssemblyReference.cache b/源代码/OEM/obj/Debug/net8.0/OEM.csproj.AssemblyReference.cache new file mode 100644 index 00000000..eb994780 Binary files /dev/null and b/源代码/OEM/obj/Debug/net8.0/OEM.csproj.AssemblyReference.cache differ diff --git a/源代码/OEM/obj/Debug/net8.0/OEM.sourcelink.json b/源代码/OEM/obj/Debug/net8.0/OEM.sourcelink.json deleted file mode 100644 index 523161d1..00000000 --- a/源代码/OEM/obj/Debug/net8.0/OEM.sourcelink.json +++ /dev/null @@ -1 +0,0 @@ -{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/0cd01ed9ddc7e151899218121d69a29650b39b34/*"}} \ No newline at end of file diff --git a/源代码/OEM/obj/OEM.csproj.nuget.g.props b/源代码/OEM/obj/OEM.csproj.nuget.g.props new file mode 100644 index 00000000..ee6cc4dd --- /dev/null +++ b/源代码/OEM/obj/OEM.csproj.nuget.g.props @@ -0,0 +1,24 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\Nitlo\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages + PackageReference + 6.9.2 + + + + + + + + + + + C:\Users\Nitlo\.nuget\packages\microsoft.net.illink.tasks\8.0.5 + C:\Users\Nitlo\.nuget\packages\microsoft.dotnet.ilcompiler\8.0.5 + + \ No newline at end of file diff --git a/源代码/OEM/obj/OEM.csproj.nuget.g.targets b/源代码/OEM/obj/OEM.csproj.nuget.g.targets new file mode 100644 index 00000000..3dc06ef3 --- /dev/null +++ b/源代码/OEM/obj/OEM.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/源代码/OEM/obj/project.nuget.cache b/源代码/OEM/obj/project.nuget.cache new file mode 100644 index 00000000..ff401522 --- /dev/null +++ b/源代码/OEM/obj/project.nuget.cache @@ -0,0 +1,13 @@ +{ + "version": 2, + "dgSpecHash": "kxXQBFhQdutFjT2gId8hH7v60+roPUePVqxb1y4tNVZireLqsssXpCmL0m//w3iotiwfRwon5DxMxbP2oSqgRA==", + "success": true, + "projectFilePath": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\源代码\\OEM\\OEM.csproj", + "expectedPackageFiles": [ + "C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.csharp\\4.7.0\\microsoft.csharp.4.7.0.nupkg.sha512", + "C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.dotnet.ilcompiler\\8.0.5\\microsoft.dotnet.ilcompiler.8.0.5.nupkg.sha512", + "C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.net.illink.tasks\\8.0.5\\microsoft.net.illink.tasks.8.0.5.nupkg.sha512", + "C:\\Users\\Nitlo\\.nuget\\packages\\runtime.win-x64.microsoft.dotnet.ilcompiler\\8.0.5\\runtime.win-x64.microsoft.dotnet.ilcompiler.8.0.5.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/源代码/Output/x64/Debug/net6.0/SS_errorlog.log b/源代码/Output/x64/Debug/net6.0/SS_errorlog.log index a2d84d1e..2ddf3da8 100644 --- a/源代码/Output/x64/Debug/net6.0/SS_errorlog.log +++ b/源代码/Output/x64/Debug/net6.0/SS_errorlog.log @@ -2,9 +2,9 @@ -Info @ 2024-04-13T02:52:48.7521438+08:00 -Program start -Info @ 2024-04-13T02:52:48.8697616+08:00 +Info 2024-06-10T03:51:45.3844560+08:00 +Program StgSharpDebug, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null Started. +Info 2024-06-10T03:51:45.5301845+08:00 Find core OpenGL version. Successfully load all OpenGL 1.0 APIs Successfully load all OpenGL 1.1 APIs @@ -25,15 +25,15 @@ Successfully load all OpenGL 4.3 APIs Successfully load all OpenGL 4.4 APIs Successfully load all OpenGL 4.5 APIs Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T02:52:48.8788256+08:00 +Info 2024-06-10T03:51:45.5394697+08:00 No supported OpenGL extensions are found. -Info @ 2024-04-13T02:52:59.2185185+08:00 -Program start -Info @ 2024-04-13T02:52:59.3330778+08:00 +Info 2024-06-10T03:53:05.2638737+08:00 +Program StgSharpDebug, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null Started. +Info 2024-06-10T03:53:05.3986813+08:00 Find core OpenGL version. Successfully load all OpenGL 1.0 APIs Successfully load all OpenGL 1.1 APIs @@ -54,15 +54,15 @@ Successfully load all OpenGL 4.3 APIs Successfully load all OpenGL 4.4 APIs Successfully load all OpenGL 4.5 APIs Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T02:52:59.3425036+08:00 +Info 2024-06-10T03:53:05.4074243+08:00 No supported OpenGL extensions are found. -Info @ 2024-04-13T02:54:08.7419490+08:00 -Program start -Info @ 2024-04-13T02:54:08.8526510+08:00 +Info 2024-06-10T03:53:20.0978686+08:00 +Program StgSharpDebug, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null Started. +Info 2024-06-10T03:53:20.2405718+08:00 Find core OpenGL version. Successfully load all OpenGL 1.0 APIs Successfully load all OpenGL 1.1 APIs @@ -83,15 +83,15 @@ Successfully load all OpenGL 4.3 APIs Successfully load all OpenGL 4.4 APIs Successfully load all OpenGL 4.5 APIs Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T02:54:08.8635945+08:00 +Info 2024-06-10T03:53:20.2486427+08:00 No supported OpenGL extensions are found. -Info @ 2024-04-13T02:55:07.9130422+08:00 -Program start -Info @ 2024-04-13T02:55:08.0192427+08:00 +Info 2024-06-10T03:58:44.9904084+08:00 +Program StgSharpDebug, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null Started. +Info 2024-06-10T03:59:35.5661006+08:00 Find core OpenGL version. Successfully load all OpenGL 1.0 APIs Successfully load all OpenGL 1.1 APIs @@ -112,15 +112,15 @@ Successfully load all OpenGL 4.3 APIs Successfully load all OpenGL 4.4 APIs Successfully load all OpenGL 4.5 APIs Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T02:55:08.0278843+08:00 +Info 2024-06-10T03:59:35.7041981+08:00 No supported OpenGL extensions are found. -Info @ 2024-04-13T02:55:53.1402835+08:00 -Program start -Info @ 2024-04-13T02:55:53.2452824+08:00 +Info 2024-06-10T04:02:09.9071531+08:00 +Program StgSharpDebug, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null Started. +Info 2024-06-10T04:02:10.7951542+08:00 Find core OpenGL version. Successfully load all OpenGL 1.0 APIs Successfully load all OpenGL 1.1 APIs @@ -141,15 +141,15 @@ Successfully load all OpenGL 4.3 APIs Successfully load all OpenGL 4.4 APIs Successfully load all OpenGL 4.5 APIs Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T02:55:53.2553702+08:00 +Info 2024-06-10T04:02:10.8047643+08:00 No supported OpenGL extensions are found. -Info @ 2024-04-13T02:56:12.6623320+08:00 -Program start -Info @ 2024-04-13T02:56:13.2334858+08:00 +Info 2024-06-10T04:05:20.9151190+08:00 +Program StgSharpDebug, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null Started. +Info 2024-06-10T04:05:21.0924552+08:00 Find core OpenGL version. Successfully load all OpenGL 1.0 APIs Successfully load all OpenGL 1.1 APIs @@ -170,15 +170,15 @@ Successfully load all OpenGL 4.3 APIs Successfully load all OpenGL 4.4 APIs Successfully load all OpenGL 4.5 APIs Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T02:56:13.2467090+08:00 +Info 2024-06-10T04:05:21.1020065+08:00 No supported OpenGL extensions are found. -Info @ 2024-04-13T02:56:39.7380286+08:00 -Program start -Info @ 2024-04-13T02:56:40.3303218+08:00 +Info 2024-06-10T04:05:53.0098837+08:00 +Program StgSharpDebug, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null Started. +Info 2024-06-10T04:05:53.1706206+08:00 Find core OpenGL version. Successfully load all OpenGL 1.0 APIs Successfully load all OpenGL 1.1 APIs @@ -199,15 +199,15 @@ Successfully load all OpenGL 4.3 APIs Successfully load all OpenGL 4.4 APIs Successfully load all OpenGL 4.5 APIs Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T02:56:40.3413755+08:00 +Info 2024-06-10T04:05:53.1809108+08:00 No supported OpenGL extensions are found. -Info @ 2024-04-13T02:58:49.7721882+08:00 -Program start -Info @ 2024-04-13T02:58:50.3308199+08:00 +Info 2024-06-10T04:22:18.9955029+08:00 +Program StgSharpDebug, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null Started. +Info 2024-06-10T04:22:19.1161027+08:00 Find core OpenGL version. Successfully load all OpenGL 1.0 APIs Successfully load all OpenGL 1.1 APIs @@ -228,324 +228,5 @@ Successfully load all OpenGL 4.3 APIs Successfully load all OpenGL 4.4 APIs Successfully load all OpenGL 4.5 APIs Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T02:58:50.3449039+08:00 -No supported OpenGL extensions are found. - - - - -Info @ 2024-04-13T03:00:24.9239677+08:00 -Program start -Info @ 2024-04-13T03:00:25.5254989+08:00 -Find core OpenGL version. -Successfully load all OpenGL 1.0 APIs -Successfully load all OpenGL 1.1 APIs -Successfully load all OpenGL 1.2 APIs -Successfully load all OpenGL 1.3 APIs -Successfully load all OpenGL 1.4 APIs -Successfully load all OpenGL 1.5 APIs -Successfully load all OpenGL 2.0 APIs -Successfully load all OpenGL 2.1 APIs -Successfully load all OpenGL 3.0 APIs -Successfully load all OpenGL 3.1 APIs -Successfully load all OpenGL 3.2 APIs -Successfully load all OpenGL 3.3 APIs -Successfully load all OpenGL 4.0 APIs -Successfully load all OpenGL 4.1 APIs -Successfully load all OpenGL 4.2 APIs -Successfully load all OpenGL 4.3 APIs -Successfully load all OpenGL 4.4 APIs -Successfully load all OpenGL 4.5 APIs -Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T03:00:25.5361593+08:00 -No supported OpenGL extensions are found. - - - - -Info @ 2024-04-13T03:01:32.8809509+08:00 -Program start -Info @ 2024-04-13T03:01:33.5108932+08:00 -Find core OpenGL version. -Successfully load all OpenGL 1.0 APIs -Successfully load all OpenGL 1.1 APIs -Successfully load all OpenGL 1.2 APIs -Successfully load all OpenGL 1.3 APIs -Successfully load all OpenGL 1.4 APIs -Successfully load all OpenGL 1.5 APIs -Successfully load all OpenGL 2.0 APIs -Successfully load all OpenGL 2.1 APIs -Successfully load all OpenGL 3.0 APIs -Successfully load all OpenGL 3.1 APIs -Successfully load all OpenGL 3.2 APIs -Successfully load all OpenGL 3.3 APIs -Successfully load all OpenGL 4.0 APIs -Successfully load all OpenGL 4.1 APIs -Successfully load all OpenGL 4.2 APIs -Successfully load all OpenGL 4.3 APIs -Successfully load all OpenGL 4.4 APIs -Successfully load all OpenGL 4.5 APIs -Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T03:01:33.5239470+08:00 -No supported OpenGL extensions are found. - - - - -Info @ 2024-04-13T03:02:19.8654976+08:00 -Program start -Info @ 2024-04-13T03:02:20.4252932+08:00 -Find core OpenGL version. -Successfully load all OpenGL 1.0 APIs -Successfully load all OpenGL 1.1 APIs -Successfully load all OpenGL 1.2 APIs -Successfully load all OpenGL 1.3 APIs -Successfully load all OpenGL 1.4 APIs -Successfully load all OpenGL 1.5 APIs -Successfully load all OpenGL 2.0 APIs -Successfully load all OpenGL 2.1 APIs -Successfully load all OpenGL 3.0 APIs -Successfully load all OpenGL 3.1 APIs -Successfully load all OpenGL 3.2 APIs -Successfully load all OpenGL 3.3 APIs -Successfully load all OpenGL 4.0 APIs -Successfully load all OpenGL 4.1 APIs -Successfully load all OpenGL 4.2 APIs -Successfully load all OpenGL 4.3 APIs -Successfully load all OpenGL 4.4 APIs -Successfully load all OpenGL 4.5 APIs -Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T03:02:20.4361538+08:00 -No supported OpenGL extensions are found. - - - - -Info @ 2024-04-13T03:04:22.5428745+08:00 -Program start -Info @ 2024-04-13T03:04:22.6439014+08:00 -Find core OpenGL version. -Successfully load all OpenGL 1.0 APIs -Successfully load all OpenGL 1.1 APIs -Successfully load all OpenGL 1.2 APIs -Successfully load all OpenGL 1.3 APIs -Successfully load all OpenGL 1.4 APIs -Successfully load all OpenGL 1.5 APIs -Successfully load all OpenGL 2.0 APIs -Successfully load all OpenGL 2.1 APIs -Successfully load all OpenGL 3.0 APIs -Successfully load all OpenGL 3.1 APIs -Successfully load all OpenGL 3.2 APIs -Successfully load all OpenGL 3.3 APIs -Successfully load all OpenGL 4.0 APIs -Successfully load all OpenGL 4.1 APIs -Successfully load all OpenGL 4.2 APIs -Successfully load all OpenGL 4.3 APIs -Successfully load all OpenGL 4.4 APIs -Successfully load all OpenGL 4.5 APIs -Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T03:04:22.6525133+08:00 -No supported OpenGL extensions are found. - - - - -Info @ 2024-04-13T03:04:44.5704728+08:00 -Program start -Info @ 2024-04-13T03:04:44.6748419+08:00 -Find core OpenGL version. -Successfully load all OpenGL 1.0 APIs -Successfully load all OpenGL 1.1 APIs -Successfully load all OpenGL 1.2 APIs -Successfully load all OpenGL 1.3 APIs -Successfully load all OpenGL 1.4 APIs -Successfully load all OpenGL 1.5 APIs -Successfully load all OpenGL 2.0 APIs -Successfully load all OpenGL 2.1 APIs -Successfully load all OpenGL 3.0 APIs -Successfully load all OpenGL 3.1 APIs -Successfully load all OpenGL 3.2 APIs -Successfully load all OpenGL 3.3 APIs -Successfully load all OpenGL 4.0 APIs -Successfully load all OpenGL 4.1 APIs -Successfully load all OpenGL 4.2 APIs -Successfully load all OpenGL 4.3 APIs -Successfully load all OpenGL 4.4 APIs -Successfully load all OpenGL 4.5 APIs -Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T03:04:44.6833998+08:00 -No supported OpenGL extensions are found. - - - - -Info @ 2024-04-13T03:07:59.3402835+08:00 -Program start -Info @ 2024-04-13T03:07:59.4471354+08:00 -Find core OpenGL version. -Successfully load all OpenGL 1.0 APIs -Successfully load all OpenGL 1.1 APIs -Successfully load all OpenGL 1.2 APIs -Successfully load all OpenGL 1.3 APIs -Successfully load all OpenGL 1.4 APIs -Successfully load all OpenGL 1.5 APIs -Successfully load all OpenGL 2.0 APIs -Successfully load all OpenGL 2.1 APIs -Successfully load all OpenGL 3.0 APIs -Successfully load all OpenGL 3.1 APIs -Successfully load all OpenGL 3.2 APIs -Successfully load all OpenGL 3.3 APIs -Successfully load all OpenGL 4.0 APIs -Successfully load all OpenGL 4.1 APIs -Successfully load all OpenGL 4.2 APIs -Successfully load all OpenGL 4.3 APIs -Successfully load all OpenGL 4.4 APIs -Successfully load all OpenGL 4.5 APIs -Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T03:07:59.4562065+08:00 -No supported OpenGL extensions are found. - - - - -Info @ 2024-04-13T03:09:09.4964707+08:00 -Program start -Info @ 2024-04-13T03:09:09.6158168+08:00 -Find core OpenGL version. -Successfully load all OpenGL 1.0 APIs -Successfully load all OpenGL 1.1 APIs -Successfully load all OpenGL 1.2 APIs -Successfully load all OpenGL 1.3 APIs -Successfully load all OpenGL 1.4 APIs -Successfully load all OpenGL 1.5 APIs -Successfully load all OpenGL 2.0 APIs -Successfully load all OpenGL 2.1 APIs -Successfully load all OpenGL 3.0 APIs -Successfully load all OpenGL 3.1 APIs -Successfully load all OpenGL 3.2 APIs -Successfully load all OpenGL 3.3 APIs -Successfully load all OpenGL 4.0 APIs -Successfully load all OpenGL 4.1 APIs -Successfully load all OpenGL 4.2 APIs -Successfully load all OpenGL 4.3 APIs -Successfully load all OpenGL 4.4 APIs -Successfully load all OpenGL 4.5 APIs -Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T03:09:09.6250462+08:00 -No supported OpenGL extensions are found. - - - - -Info @ 2024-04-13T03:12:22.0284867+08:00 -Program start -Info @ 2024-04-13T03:12:22.1393133+08:00 -Find core OpenGL version. -Successfully load all OpenGL 1.0 APIs -Successfully load all OpenGL 1.1 APIs -Successfully load all OpenGL 1.2 APIs -Successfully load all OpenGL 1.3 APIs -Successfully load all OpenGL 1.4 APIs -Successfully load all OpenGL 1.5 APIs -Successfully load all OpenGL 2.0 APIs -Successfully load all OpenGL 2.1 APIs -Successfully load all OpenGL 3.0 APIs -Successfully load all OpenGL 3.1 APIs -Successfully load all OpenGL 3.2 APIs -Successfully load all OpenGL 3.3 APIs -Successfully load all OpenGL 4.0 APIs -Successfully load all OpenGL 4.1 APIs -Successfully load all OpenGL 4.2 APIs -Successfully load all OpenGL 4.3 APIs -Successfully load all OpenGL 4.4 APIs -Successfully load all OpenGL 4.5 APIs -Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T03:12:22.1482595+08:00 -No supported OpenGL extensions are found. - - - - -Info @ 2024-04-13T03:13:14.6103713+08:00 -Program start -Info @ 2024-04-13T03:13:14.7181688+08:00 -Find core OpenGL version. -Successfully load all OpenGL 1.0 APIs -Successfully load all OpenGL 1.1 APIs -Successfully load all OpenGL 1.2 APIs -Successfully load all OpenGL 1.3 APIs -Successfully load all OpenGL 1.4 APIs -Successfully load all OpenGL 1.5 APIs -Successfully load all OpenGL 2.0 APIs -Successfully load all OpenGL 2.1 APIs -Successfully load all OpenGL 3.0 APIs -Successfully load all OpenGL 3.1 APIs -Successfully load all OpenGL 3.2 APIs -Successfully load all OpenGL 3.3 APIs -Successfully load all OpenGL 4.0 APIs -Successfully load all OpenGL 4.1 APIs -Successfully load all OpenGL 4.2 APIs -Successfully load all OpenGL 4.3 APIs -Successfully load all OpenGL 4.4 APIs -Successfully load all OpenGL 4.5 APIs -Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T03:13:14.7273602+08:00 -No supported OpenGL extensions are found. - - - - -Info @ 2024-04-13T03:13:58.4941103+08:00 -Program start -Info @ 2024-04-13T03:13:58.6021716+08:00 -Find core OpenGL version. -Successfully load all OpenGL 1.0 APIs -Successfully load all OpenGL 1.1 APIs -Successfully load all OpenGL 1.2 APIs -Successfully load all OpenGL 1.3 APIs -Successfully load all OpenGL 1.4 APIs -Successfully load all OpenGL 1.5 APIs -Successfully load all OpenGL 2.0 APIs -Successfully load all OpenGL 2.1 APIs -Successfully load all OpenGL 3.0 APIs -Successfully load all OpenGL 3.1 APIs -Successfully load all OpenGL 3.2 APIs -Successfully load all OpenGL 3.3 APIs -Successfully load all OpenGL 4.0 APIs -Successfully load all OpenGL 4.1 APIs -Successfully load all OpenGL 4.2 APIs -Successfully load all OpenGL 4.3 APIs -Successfully load all OpenGL 4.4 APIs -Successfully load all OpenGL 4.5 APIs -Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T03:13:58.6110611+08:00 -No supported OpenGL extensions are found. - - - - -Info @ 2024-04-13T03:15:17.8566685+08:00 -Program start -Info @ 2024-04-13T03:15:17.9644144+08:00 -Find core OpenGL version. -Successfully load all OpenGL 1.0 APIs -Successfully load all OpenGL 1.1 APIs -Successfully load all OpenGL 1.2 APIs -Successfully load all OpenGL 1.3 APIs -Successfully load all OpenGL 1.4 APIs -Successfully load all OpenGL 1.5 APIs -Successfully load all OpenGL 2.0 APIs -Successfully load all OpenGL 2.1 APIs -Successfully load all OpenGL 3.0 APIs -Successfully load all OpenGL 3.1 APIs -Successfully load all OpenGL 3.2 APIs -Successfully load all OpenGL 3.3 APIs -Successfully load all OpenGL 4.0 APIs -Successfully load all OpenGL 4.1 APIs -Successfully load all OpenGL 4.2 APIs -Successfully load all OpenGL 4.3 APIs -Successfully load all OpenGL 4.4 APIs -Successfully load all OpenGL 4.5 APIs -Successfully load all OpenGL 4.6 APIs -Info @ 2024-04-13T03:15:17.9738674+08:00 +Info 2024-06-10T04:22:19.1243615+08:00 No supported OpenGL extensions are found. diff --git a/源代码/Output/x64/Debug/net6.0/StgSharpC.dll b/源代码/Output/x64/Debug/net6.0/StgSharpC.dll index ba96cd2d..7ebc661a 100644 Binary files a/源代码/Output/x64/Debug/net6.0/StgSharpC.dll and b/源代码/Output/x64/Debug/net6.0/StgSharpC.dll differ diff --git a/源代码/Output/x64/Debug/net6.0/StgSharpDebug.dll b/源代码/Output/x64/Debug/net6.0/StgSharpDebug.dll index c8c14000..6ea9c0f6 100644 Binary files a/源代码/Output/x64/Debug/net6.0/StgSharpDebug.dll and b/源代码/Output/x64/Debug/net6.0/StgSharpDebug.dll differ diff --git a/源代码/Output/x64/Debug/net6.0/StgSharpDebug.exe b/源代码/Output/x64/Debug/net6.0/StgSharpDebug.exe index ddc40aa9..ebad299e 100644 Binary files a/源代码/Output/x64/Debug/net6.0/StgSharpDebug.exe and b/源代码/Output/x64/Debug/net6.0/StgSharpDebug.exe differ diff --git a/源代码/Output/x64/Debug/net6.0/StgSharpDebug.pdb b/源代码/Output/x64/Debug/net6.0/StgSharpDebug.pdb index 31d4904a..59749b6c 100644 Binary files a/源代码/Output/x64/Debug/net6.0/StgSharpDebug.pdb and b/源代码/Output/x64/Debug/net6.0/StgSharpDebug.pdb differ diff --git a/源代码/Output/x64/Debug/net6.0/StgSharpDebug.xml b/源代码/Output/x64/Debug/net6.0/StgSharpDebug.xml index 6ea62cd1..1ca3ac39 100644 --- a/源代码/Output/x64/Debug/net6.0/StgSharpDebug.xml +++ b/源代码/Output/x64/Debug/net6.0/StgSharpDebug.xml @@ -4,7 +4,12 @@ StgSharpDebug - + + + + + + Get the status of a certain key on the keyboard. @@ -14,43 +19,132 @@ - Function handler to load an opengl function by serching its name. + Function handler to load an opengl function by searching its name. the name of the Opengl function An intptr value representing the pointer to the function - + + + Interface of all kinds OpenGL buffer objects + + + + + Get the only handle to one of the Object instance + + + + + + + Bind a buffer instance to OpenGL + + Index of handle of the object in this instance to be bind + + + + + + + A collection of handle to Element Buffer Object in OpenglFunc. + Each value indexed from instance of this class this + is the only handle to one Element Buffer Object. + + + + + Bind the frame buffer object with name frame buffer to the frame buffer target specified by target. + will be set as default target. + + Index of object to be binded in handle set + + + + Bind the frame buffer object with name frame buffer to the frame buffer target specified by target. + Target of this frame buffer should be set manually. + + The frame buffer target of the binding operation. + Index of object to be binded in handle set + + + + + + + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + Data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + Data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + A of data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + A of data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + A array of data to write in + How OpenGL use these data, defined by + + - + - Height of this form, represent in + Load all supported OpenGL APIs and bind them to given context. + The used as current OpenGL context - + - Width of this form, represent in + Get the function pointer of given OpenGL api name + ContextName of the OpenGL api + The funtion pointer of the api in stream of - + - Width of this form, represent in + Bind a frame buffer to a frame buffer target + Same function as glBindFramebuffer. + The frame buffer target of the binding operation. + The handle of the frame buffer object to bind. - - - Necessary operation to init graphic elements this form. - - OpenGL library binded to current form. - - - - Behaviour of current form when in a frame cycle. - - - + 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. @@ -59,227 +153,93 @@ Something goes wrong and StgSharp fails in creating a new OpenGL context. - + - Set all necessary metadata to current form instance - - - - - Resize the current form - - - A (width,height) representing the new size of current form - - - - - Resize the current form - - New width of the window - New height of the window - - - - 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) - - - - - Set the size limit of current form - - Minimum width of current form - Minimum height of current form - Maximum width of current form - Maximum height of current form - - - - Init this form and render it on screen, and respond with operation - - - - - Create a set of . + Create a set of . Amount of EBO to be created. - + - Create a sets of + Create a sets of - Amount of textures to be crated. + Amount of textures to be created. - + - Create a set of . + Create a set of . - Amount of VAO to be crated. + Amount of VAO to be created. - + - Create aset of . + Create a set of . Amount of Object to be created. - + - Create an instance of program + Create an instance of program - New instance of instance. + New instance of instance. - + - Mark that a method in a - should be called when rendering. + Attach one shader code to a shader program. + + Shader program to attach + Index of shader code in current shader code set. + + + + Init a program with no shader attached. - + - Priority level of a render activity. + Get a uniform form current shader, + the value type of the uniform should be provided. - - - - One level higher than . - - - - - Two level higher than . - - - - - Three level higher than . - - - - - One level lower than . - - - - - Two level lower than . - - - - - Three level lower than . - - - - - Highest priority, in , it is . - - - - - Default priority, usually is in this priority. - - - - - Lowest priority, in , it is . - - - - - Interface of all kinds OpenGL buffer objects - - - - - Get the only handle to one of the Object instance - - + ContextName of the Uniform in shader code - + - Bind a buffer instance to OpenGL + Get a uniform form current shader, + the value type of the uniform should be provided. - Index of handle of the object in this instance to be bind + ContextName of the Uniform in shader code + - - - - + - A collection of handle to Element Buffer Object in OpenGL. - Each value indexed from instance of this class this - is the only handle to one Element Buffer Object. + Get a uniform form current shader, + the value type of the uniform should be provided. + + ContextName of the Uniform in shader code + + + + + Get a uniform form current shader, + the value type of the uniform should be provided. + + ContextName of the Uniform in shader code + + + + + Link the shader to current context. - + - Bind the frame buffer object with name frame buffer to the frame buffer target specified by target. - will be set as default target. + Let the current context use this shader. - Index of object to be binded in handle set - - - - Bind the frame buffer object with name frame buffer to the frame buffer target specified by target. - Target of this frame buffer should be set manually. - - The frame buffer target of the binding operation. - Index of object to be binded in handle set - - - - - - - - - - - Set data to current vertex buffer object - - Type of bufferData - Index to find certain VBO in this instance - Data to write in - How OpenGL use these data, defined by - - - - Set data to current vertex buffer object - - Type of bufferData - Index to find certain VBO in this instance - A array of data to write in - How OpenGL use these data, defined by - - - - - - - - - Load all aupportable OpenGL APIs and bind them to given context. - - The used as current OpenGL context - A delegate to get address of OprnGL api - - - - Get the function pointer of given OpenGL api name - - Name of the OpenGL api - The funtion pointer of the api in form of @@ -300,20 +260,12 @@ This will be not usable. - - - Bind a frame buffer to a frame buffer target - Same function as glBindFramebuffer. - - The frame buffer target of the binding operation. - The handle of the frame buffer object to bind. - - + @@ -329,79 +281,39 @@ - + - Attach one shader code to a shader program. + Set the size limit of current form - Shader program to attach - Index of shader code in current shader code set. + Minimum width of current form + Minimum height of current form + Maximum width of current form + Maximum height of current form - + - Init a program with no shader attached. + Get (T is ) uniform from a shader. + This uniform will be used as projection matrix of this camera. + Additionally, for multi-shader rendering, each shader requires a uniform, + so do not ignore return value of this method. + Shader using this camera + ContextName of projection camera named in shader + + (T is ) representing + projection matrix in shader program. + - + - Get a uniform form current shader, - the value type of the uniform should be provided. - - Name of the Uniform in shader code - - - - - Get a uniform form current shader, - the value type of the uniform should be provided. - - Name of the Uniform in shader code - - - - - Get a uniform form current shader, - the value type of the uniform should be provided. - - Name of the Uniform in shader code - - - - - Get a uniform form current shader, - the value type of the uniform should be provided. - - Name of the Uniform in shader code - - - - - Link the shader to current context. - - - - - Let the current context use this shader. - - - - - A sensor used for cheking out if a bullet hit a player or something else - - - - - A 2D vector presenting the position of an enemy entity, position can also be visited by X, Y - - - - - X position of an enenmy entity - - - - - Y position of an enemy entity + Get all uniform related to this . + Shader program requires this camera. + + ContextName of all related uniforms. + If you fallow form from + + @@ -418,7 +330,7 @@ - Write a log message to log file, and mark the level of this message. + 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. @@ -438,9 +350,17 @@ A two dimension vector defined by two elements. - Vec2Ds in StgSharp are defaultly usaed as colum vector. + Vec2Ds in StgSharp are default used as colum vector. + + + Orthogonalize two s, let their length be 1 + and perpendicular to each other. + + + + Reurns the value of ArcSin(x) @@ -479,7 +399,7 @@ - + @@ -491,14 +411,41 @@ - + - Part of a circle. All points on a arc has the same distance to their center. + A class contains a sets of methods to serialize several types - + - A collection of all point on the same plain and has the same distance to a point + An independent storage area, used as the only folder type in root folder. + Contains several files reference as virtual disc. + Data is actually stored in s in certain RAID mode. + + + + + A sensor used for checking out if a bullet hit a player or something else + + + + + A 2D vector presenting the position of an enemy entity, position can also be visited by X, Y + + + + + X position of an enenmy entity + + + + + Y position of an enemy entity + + + + + 当几何体调用了过多的CalcVec方法时,产生UnusedVertexException异常 @@ -518,86 +465,16 @@ Point to the top direction. - - - 当几何体调用了过多的CalcVec方法时,产生UnusedVertexException异常 - - - - - Caculate the movement of a point. - - The game tick represent time passed by - A 3d vector representing movement - - - - Move begin side of a line. - It is recommended to override this function rather than - loading an with same function. - - Time passed since current line was created. - - - - Move end side of a line. - It is recommended to override this function rather than - loading an with same function. - - Time passed since current line was created. - - - - - Move the third vertix. this is a useless method for Parallelograms. - - Current time tick - - Geometry overdefined - - - - Move the third vertix. This method is useless for Parallelograms. - - Current time tick - - Geometry overdefined - - 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。 + Plain geometry only contains straight sides. - - - Tick time this geometry eas crested - - - - - Get all sides of this . - - A array contains all straight s of current geometry item. - - - - Get a flat cincide with current geometry. - - - - - - Update the coordinate of the point. If this is a moving point, - (Points on sides or surface if other geometry items) - please do not define any motion here, codes will be ignored by program - - Time passes since the program begin, counted by frames - - 计算中心点相对于参考原点的位移 + Calculate movement to center - 当前游戏刻 + Current time tick @@ -605,80 +482,95 @@ A square - + - A linear data structure with dynamic length. - It contains a of , - each is twice longer than the former one. + Run all nodes repeatedly until it is instructed to terminate. - + Instructor to terminate all tasks. Returns if tasks should terminate - + - Init a with a certain amount of elements prepared. + - Amount of elements to be prepared. + + Reset pipeline has risk, this operation is a direct operation to port + in current node, the port on the other node cannot get the change. + - + - Create a new instance of , - and fill the begining ones of elemtns as given instance. - - Amount of beginning elements to be filled - - - - - Length of this + Init this form and render it on screen, and respond with operation - + - A pair of value + Height of this form, represent in - + - The first value. + Width of this form, represent in - + - The second value. + Width of this form, represent in - + - A value. - The lower byte is , - and higher byte is . + Resize the current form + + A (width,height) representing the new size of current form + + + + + Set the size limit of current form + + + Minimum size of current form. In form of a of (width,height) + + + Maximum size of current form. In form of a of (width,height) + + + + + Set the size limit of current form + + Minimum width of current form + Minimum height of current form + Maximum width of current form + Maximum height of current form A microsecond-accuracy timer. It will refresh every a certain time span. - + Create a new and define the length of time span. Length of a single time span is defined in microseconds. - + - + Create a new and define the length of time span. Length of a single time span is defined in seconds. - + - + Create a new and define the length of time span. Length of a single time span is defined in microseconds. + @@ -691,17 +583,6 @@ The method this will call every time a new time span started. - - - Get all uniform related to this . - - Shader program requires this camera. - - Name of all related uniforms. - If you fallow form from - - - The COLORREF value is used to specify an RGB color. diff --git a/源代码/StgSharp/Control/ProcessInput.cs b/源代码/StgSharp/Control/ProcessInput.cs deleted file mode 100644 index f91c2f4e..00000000 --- a/源代码/StgSharp/Control/ProcessInput.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Graphics -{ - - - public partial class Form - { - Dictionary keyEventDictionary = new Dictionary(); - - internal void InternalLoadInput(MethodInfo[] methods) - { - if (methods.Length == 0) - { - return; - } - foreach (MethodInfo m in methods) //find all methods decorated by RenderActivityAttribute - { - KeyEventAttribute attr = m.GetCustomAttribute(false); - if (attr == null) - { - continue; - } - if (!m.IsStatic && (m.GetParameters().Length != 0) && (m.ReturnType != typeof(void))) - { - throw new NotSupportedException("A render activity cannot have parameters, returning value or be static."); - } - } - } - - internal void InternalProcessInput() - { - - } - - } - - public delegate void KeyBoardEvent(KeyboardKey key, KeyStatus status); - public delegate void MouseEvent(Mouse mouse, KeyStatus status); - public delegate void JoystickEvent(Joystick joystick, KeyStatus status); - -} diff --git a/源代码/StgSharp/Controlling/ProcessInput.cs b/源代码/StgSharp/Controlling/ProcessInput.cs deleted file mode 100644 index 03f34c56..00000000 --- a/源代码/StgSharp/Controlling/ProcessInput.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Graphics -{ - - - public partial class ViewModel - { - Dictionary keyEventDictionary = new Dictionary(); - - internal void InternalLoadInput(MethodInfo[] methods) - { - if (methods.Length == 0) - { - return; - } - foreach (MethodInfo m in methods) //find all methods decorated by RenderActivityAttribute - { - KeyEventAttribute attr = m.GetCustomAttribute(false); - if (attr == null) - { - continue; - } - if (!m.IsStatic && (m.GetParameters().Length != 0) && (m.ReturnType != typeof(void))) - { - throw new NotSupportedException("A render activity cannot have parameters, returning value or be static."); - } - } - } - - internal void InternalProcessInput() - { - - } - - } - - public delegate void KeyBoardEvent(KeyboardKey key, KeyStatus status); - public delegate void MouseEvent(Mouse mouse, KeyStatus status); - public delegate void JoystickEvent(Joystick joystick, KeyStatus status); - -} diff --git a/源代码/StgSharp/Data/Encode/HuffmanTree.cs b/源代码/StgSharp/Data/Encode/HuffmanTree.cs deleted file mode 100644 index 42e386cd..00000000 --- a/源代码/StgSharp/Data/Encode/HuffmanTree.cs +++ /dev/null @@ -1,237 +0,0 @@ -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="HuffmanTree.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Xml; -using System.Xml.Linq; - -namespace StgSharp.Data -{ - public partial class HuffmanTree where T : struct - { - - HuffmanNodeList leaves; - - internal HuffmanTree(HuffmanNodeList nodeList) - { - leaves = nodeList; - } - - public HuffmanNodeList LeafList -=> leaves; - - public TreeNode Root -=> leaves.Last; - - public static HuffmanTree BuildHuffmanTree(List<(T, ulong)> metaData) - { - if (metaData.Count <= 3) - { - throw new Exception("Data is too little, no need to compress"); - } - HuffmanNodeList leaves = new HuffmanNodeList(); - HuffmanNodeList all = new HuffmanNodeList(); - - foreach (var item in metaData) - { - leaves.Add(new TreeNode(item)); - } - - - while (leaves.Count > 2) - { - TreeNode node, toMove; - if (leaves.Last._frequency < leaves.BeforeLast._frequency) - { - if (leaves.BeforeLast._frequency < leaves.OverLast._frequency) - { - //第三节点最大 - node = new TreeNode(leaves.BeforeLast, leaves.Last); - toMove = leaves.RemoveAndGetLast; all.Add(toMove); - toMove = leaves.RemoveAndGetLast; all.Add(toMove); - leaves.Add(node); - } - else - { - //第二节点最大 - node = (leaves.Last._frequency < leaves.OverLast._frequency) ? - (new TreeNode(leaves.OverLast, leaves.Last)) : - (new TreeNode(leaves.Last, leaves.OverLast)); - toMove = leaves.RemoveAndGetLast; all.Add(toMove); - toMove = leaves.RemoveAndGetBeforeLast; all.Add(toMove); - leaves.Add(node); - } - } - else - { - - if (leaves.Last._frequency < leaves.OverLast._frequency) - { - //第三节点最大 - node = new TreeNode(leaves.Last, leaves.BeforeLast); - toMove = leaves.RemoveAndGetLast; all.Add(toMove); - toMove = leaves.RemoveAndGetLast; all.Add(toMove); - leaves.Add(node); - } - else - { - //第一节点最大 - node = (leaves.BeforeLast._frequency < leaves.OverLast._frequency) ? - (new TreeNode(leaves.OverLast, leaves.BeforeLast)) : - (new TreeNode(leaves.BeforeLast, leaves.OverLast)); - toMove = leaves.RemoveAndGetBeforeLast; all.Add(toMove); - toMove = leaves.RemoveAndGetBeforeLast; all.Add(toMove); - leaves.Add(node); - } - } - - leaves = new HuffmanNodeList(leaves.OrderByDescending(pair => pair.frequency) - .Select(pair => pair).ToList()); - } - - TreeNode lastOne = leaves[0]; - TreeNode lastTwo = leaves[1]; - TreeNode root = (lastOne.frequency > lastTwo.frequency) ? - (new TreeNode(lastOne, lastTwo)) : - (new TreeNode(lastTwo, lastOne)); - - all.Add(lastOne); - all.Add(lastTwo); - all.Add(root); - - leaves = all; - return new HuffmanTree(all); - } - - - } - - public class HuffmanNodeList : List> where T : struct - { - - public HuffmanNodeList() : base() - { - - } - - public HuffmanNodeList(IEnumerable> values) : base(values) - { } - - public TreeNode BeforeLast -=> this[Count - 2]; - - public TreeNode Last -=> this[Count - 1]; - - public TreeNode OverLast -=> this[Count - 3]; - - public TreeNode RemoveAndGetBeforeLast - { - get - { - TreeNode ret = this[Count - 2]; - RemoveAt(Count - 2); - return ret; - } - } - - public TreeNode RemoveAndGetLast - { - get - { - TreeNode ret = this[Count - 1]; - RemoveAt(Count - 1); - return ret; - } - } - - public TreeNode RemoveAndGetOverLast - { - get - { - TreeNode ret = this[Count - 3]; - RemoveAt(Count - 3); - return ret; - } - } - - public void Add(T element, ulong f) - { - base.Add(new TreeNode(element, f)); - } - - } - - public class TreeNode where T : struct - { - - internal ulong _frequency; - internal TreeNode _left; - internal TreeNode _right; - internal T? _value; - - internal TreeNode(TreeNode left, TreeNode right) - { - _left = left; - _right = right; - _value = null; - _frequency = left._frequency + right._frequency; - } - - public TreeNode((T, ulong) data) - { - _value = data.Item1; - _frequency = data.Item2; - - } - - public TreeNode(T? value, ulong frequncy) - { - _value = value; - _frequency = frequncy; - - } - - public ulong frequency => _frequency; - - public TreeNode Left => _left; - public TreeNode Right => _right; - - public T? Value => _value; - - } -} diff --git a/源代码/StgSharp/Data/Encode/MappingTable.cs b/源代码/StgSharp/Data/Encode/MappingTable.cs deleted file mode 100644 index f8d3cf67..00000000 --- a/源代码/StgSharp/Data/Encode/MappingTable.cs +++ /dev/null @@ -1,189 +0,0 @@ -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="MappingTable.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; - -namespace StgSharp.Data -{ - public partial class HuffmanTree where T : struct - { - - public Dictionary> BuildHuffmanDictionary() - { - Dictionary> ret = new Dictionary>(); - TreeNode root = Root; - HuffmanKey key = new HuffmanKey(); - key = key.SetSide(KeySide.Right); - InternalBuildDictionary(ret, root, key); - return ret; - } - - public void InternalBuildDictionary( - Dictionary> dict, - TreeNode node, - HuffmanKey valueTemp - ) - { - HuffmanKey nativeNode = new HuffmanKey(valueTemp.bitList); - nativeNode.AddIndexLevel(); - //检查左节点 - if (node._left.Value == null) - { - //左节点不是叶子节点,继续搜索 - InternalBuildDictionary( - dict, - node._left, - nativeNode.SetSide(KeySide.Left)); - } - else - { - //左节点是叶子节点,添加值 - dict.Add(node._left.Value.Value, nativeNode.SetSide(KeySide.Left)); - } - //检查右节点 - if (node._right.Value == null) - { - //右节点不是叶子节点,继续搜索 - InternalBuildDictionary( - dict, - node._right, - nativeNode.SetSide(KeySide.Right)); - } - else - { - //右节点是叶子节点,添加值 - dict.Add(node._right.Value.Value, nativeNode.SetSide(KeySide.Right)); - } - //这里检查自己是不是叶子节点 - //但是上面已经检查过了,不需要被检查 - } - - } - - - - public class HuffmanKey where T : struct - { - - internal List bitList; - internal BitArray code; - - public HuffmanKey() - { - bitList = new List(); - bitList.Add(false); - } - - public HuffmanKey(List former) - { - bitList = new List(former); - } - - public bool IsSupported - { - get - { - return - (typeof(T) == typeof(byte)) || - (typeof(T) == typeof(uint)) || - (typeof(T) == typeof(ushort)) || - (typeof(T) == typeof(ulong)) || -#if NET7_0_OR_GREATER - typeof(T) == typeof(UInt128) || -#endif - (typeof(T) == typeof(M128)); - } - } - - public unsafe void AddIndexLevel() - { - bitList.Add(true); - } - - public void Freeze() - { - if (code != null) - { - return; - } - bitList.RemoveAt(0); - code = new BitArray(bitList.ToArray()); - } - - public BitArray GetBitArray() - { - if (code == null) - { - List list = new List(bitList); - list.RemoveAt(0); - return new BitArray(list.ToArray()); - } - return code; - } - - public unsafe byte[] GetBytes() - { - byte[] bytes = new byte[(bitList.Count / 8) + 1]; - BitArray array = new BitArray(bitList.ToArray()); - array.CopyTo(bytes, 0); - return bytes; - } - - public unsafe HuffmanKey SetSide(KeySide side) - { - HuffmanKey newKey = new HuffmanKey(bitList); - newKey.bitList[newKey.bitList.Count - 1] = side == KeySide.Left; - return newKey; - } - - public override string ToString() - { - string str = string.Empty; - foreach (var bit in bitList) - { - str += $"{bit} "; - } - return str; - } - - } - - public enum KeySide - { - Left, - Right - } - -} diff --git a/源代码/StgSharp/Data/GlobalData/idProvider.cs b/源代码/StgSharp/Data/GlobalData/idProvider.cs deleted file mode 100644 index 8c2b5c82..00000000 --- a/源代码/StgSharp/Data/GlobalData/idProvider.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Data -{ - - public partial class Area - { - private static byte leastUnusedDisc; - - public byte NewDisc(byte raidWith) - { - byte ret = leastUnusedDisc; - leastUnusedDisc++; - return ret; - } - - public void ClearDiscIDBuffer() - { - leastUnusedDisc = 0; - } - - private int leastUnusedID; - - public int NewID() - { - int ret = leastUnusedID; - if (ret == int.MaxValue) - { - throw new ArgumentOutOfRangeException("Reaches max IDs that one ssd file can provide."); - } - leastUnusedID++; - return ret; - } - - public void ClearIDBuffer() - { - leastUnusedID = 1; - } - - } - -} diff --git a/源代码/StgSharp/Data/Serialize/BitArray.cs b/源代码/StgSharp/Data/Serialize/BitArray.cs deleted file mode 100644 index d8236bc2..00000000 --- a/源代码/StgSharp/Data/Serialize/BitArray.cs +++ /dev/null @@ -1,161 +0,0 @@ -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="BitArray.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; - -namespace StgSharp.Data -{ - public static partial class Serializer - { - - public static void Deserialize(byte[] stream, out BitArray target) - { - List boolStream = new List(4 * stream.Length); - int i = 0, count = 0; - foreach (byte b in stream) - { - uint raw = b; - for (i = 0; i < 4; i++) - { - switch (raw & 0b11) - { - case (uint)BoolMap.True_0: - boolStream.Add(true); - break; - case (uint)BoolMap.False_0: - boolStream.Add(false); - break; - case (uint)BoolMap.None_0: - goto end; - default: - throw new Exception(); - } - raw >>= 2; - count++; - continue; - end: - { - break; - } - } - } - while (boolStream.Count > count) - { - boolStream.RemoveAt(count); - } - target = new BitArray(boolStream.ToArray()); - } - - /// - /// Serialize a , useful when writing - /// a Huffman tree index dictionary to file. - /// - /// - /// - /// - public static byte[] Serialize(BitArray bits) - { - int size = (bits.Count / 4) + 1; - List ret = new List(size); - int count = 0, total = 0; byte temp = new byte(); - for (int i = 0; i < bits.Count; i++) - { - if (count == 4) - { - ret.Add(temp); - count = 0; - temp = 0; - total++; - } - switch (count) - { - case 0: - temp |= (byte)(bits[i] ? BoolMap.True_0 : BoolMap.False_0); - break; - case 1: - temp |= (byte)(bits[i] ? BoolMap.True_1 : BoolMap.False_1); - break; - case 2: - temp |= (byte)(bits[i] ? BoolMap.True_2 : BoolMap.False_2); - break; - case 3: - temp |= (byte)(bits[i] ? BoolMap.True_3 : BoolMap.False_3); - break; - default: - throw new Exception(); - } - count++; - } - for (; count < 4; count++) - { - switch (count) - { - case 1: - temp |= (byte)BoolMap.None_1; - break; - case 2: - temp |= (byte)BoolMap.None_2; - break; - case 3: - temp |= (byte)BoolMap.None_3; - break; - default: - throw new Exception(); - } - continue; - } - ret.Add(temp); - return ret.ToArray(); - } - - } - - - internal enum BoolMap : byte - { - False_0 = 0b00000010, - True_0 = 0b00000001, - None_0 = 0b00000011, - False_1 = 0b00001000, - True_1 = 0b00000100, - None_1 = 0b00001100, - False_2 = 0b00100000, - True_2 = 0b00010000, - None_2 = 0b00110000, - False_3 = 0b10000000, - True_3 = 0b01000000, - None_3 = 0b11000000, - } -} diff --git a/源代码/StgSharp/Data/Serialize/Dictionary.cs b/源代码/StgSharp/Data/Serialize/Dictionary.cs deleted file mode 100644 index 1d1a3e2c..00000000 --- a/源代码/StgSharp/Data/Serialize/Dictionary.cs +++ /dev/null @@ -1,97 +0,0 @@ -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Dictionary.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; - -namespace StgSharp.Data -{ - - /// - /// A class contains a sets of methods to serialize several types - /// - public static partial class Serializer - { - /**/ - - public static void Deserialize(byte[] data, out Dictionary dict) - { - dict = new Dictionary(); - int stat = 0; byte key = 0; - byte[] raw = new byte[0]; - foreach (var b in data) - { - switch (stat) - { - case 0: //getting key - if (raw.Length != 0) - { - BitArray bits; - Deserialize(raw, out bits); - dict.Add(key, bits); - } - key = b; - stat -= 1; - break; - case -1: //getting length - raw = new byte[b]; - stat = b; - break; - default: - raw[raw.Length - stat] = b; - stat--; - break; - } - } - } - - /**/ - public static byte[] Serialize(Dictionary table) - { - using (var stream = new MemoryStream()) - { - foreach (var pair in table) - { - stream.WriteByte(pair.Key); - - byte[] keyCode = Serialize(pair.Value); - stream.WriteByte((byte)keyCode.Length); - - stream.Write(keyCode, 0, keyCode.Length); - } - return stream.ToArray(); - } - } - - } -} diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Line.cs b/源代码/StgSharp/Geometries/PlainGeometry/Line.cs deleted file mode 100644 index 932e1044..00000000 --- a/源代码/StgSharp/Geometries/PlainGeometry/Line.cs +++ /dev/null @@ -1,107 +0,0 @@ -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Line.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -using StgSharp.Math; - -using System; -using System.Numerics; - -namespace StgSharp.Geometries -{ - public class Line : PlainGeometry - { - - internal Point basePoint; - internal Point beginPoint; - internal Point endPoint; - internal Func movBegin; - internal Func movEnd; - - internal Line(Vector4 begin, Vector4 end) - { - beginPoint = new Point(begin); - endPoint = new Point(end); - } - - public Line() - { - - } - - public Line(Point begin, Point end) - { - this.beginPoint = begin; - this.endPoint = end; - } - - - internal override int[] Indices => throw new NotSupportedException(); - - public override Line[] GetAllSides() - { - throw new NotImplementedException(); - } - - public override Plain GetPlain() - { - throw new ToUpperDimensionException(); - } - - /// - /// Move begin side of a line. - /// It is recommended to override this function rather than - /// loading an with same function. - /// - /// Time passed since current line was created. - public virtual vec3d MoveBeginPoint(int tick) - { - return movBegin(time); - } - - /// - /// Move end side of a line. - /// It is recommended to override this function rather than - /// loading an with same function. - /// - /// Time passed since current line was created. - /// - public virtual vec3d MoveEndPoint(int tick) - { - return movEnd.Invoke(time); - } - - internal override void UpdateCoordinate(int tick) - { - beginPoint.Position = coordinate.Origin + MoveBeginPoint(time); - endPoint.Position = coordinate.Origin + MoveEndPoint(time); - } - - } -} diff --git a/源代码/StgSharp/Geometries/PlainGeometry/PlainGeometry.cs b/源代码/StgSharp/Geometries/PlainGeometry/PlainGeometry.cs deleted file mode 100644 index 5b4d6635..00000000 --- a/源代码/StgSharp/Geometries/PlainGeometry/PlainGeometry.cs +++ /dev/null @@ -1,99 +0,0 @@ -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="PlainGeometry.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -using StgSharp.Graphics; -using StgSharp.Math; - -using System; - -namespace StgSharp.Geometries -{ - /// - /// 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。 - /// - public abstract class PlainGeometry: IGeometry - { - - protected TimeSpanProvider time; - - internal ICoord coordinate; - internal Matrix24 textureFrame; - - public PlainGeometry() - { - } - - vec4d IGeometry.this[int index] - { - get => throw new NotImplementedException(); - set => throw new NotImplementedException(); - } - - /// - /// Tick time this geometry eas crested - /// - public int BornTime => time; - - public ICoord ReferenceCoordinate => this.coordinate; - - internal abstract int[] Indices { get; } - - int IGeometry.VertexCount => throw new NotImplementedException(); - - vec4d[] IGeometry.VertexStream => throw new NotImplementedException(); - - /// - /// Get all sides of this . - /// - /// A array contains all straight s of current geometry item. - public abstract Line[] GetAllSides(); - - /// - /// Get a flat cincide with current geometry. - /// - /// - public abstract Plain GetPlain(); - - - internal abstract void UpdateCoordinate(int tick); - - void IGeometry.GetVertexHandle(ICoord coordinate, int count) - { - throw new NotImplementedException(); - } - - void IGeometry.Transform(Matrix44 transFormMatrix) - { - throw new NotImplementedException(); - } - - //public abstract Rectangle GetRenderFrame(); - } -} \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/Form/FormThreadAttribute.cs b/源代码/StgSharp/Graphics/Form/FormThreadAttribute.cs deleted file mode 100644 index 5431238f..00000000 --- a/源代码/StgSharp/Graphics/Form/FormThreadAttribute.cs +++ /dev/null @@ -1,117 +0,0 @@ -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="FormThreadAttribute.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -using System; -using System.Collections.Generic; -using System.Text; - -namespace StgSharp.Graphics -{ - /// - /// Mark that a method in a - /// should be called when rendering. - /// - [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] - public class RenderActivityAttribute : Attribute - { - - internal bool _isRenderProgress; - internal int _priority; - - public RenderActivityAttribute() - { - _priority = (int)RenderPriority.Default; - } - - public RenderActivityAttribute(RenderPriority priority) - { - _priority = (int)priority; - } - public RenderActivityAttribute(int priority) - { - _priority = priority; - } - - public int Priority { get => _priority; set => _priority = value; } - - } - - - [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] - public class MultiFrameActivityAttribute : Attribute - { - - internal int _minFrameCount; - - } - - /// - /// Priority level of a render activity. - /// - public enum RenderPriority : int - { - /// - /// One level higher than . - /// - Pre_1 = -1, - /// - /// Two level higher than . - /// - Pre_2 = -2, - /// - /// Three level higher than . - /// - Pre_3 = -3, - /// - /// One level lower than . - /// - Aft_1 = 1, - /// - /// Two level lower than . - /// - Aft_2 = 2, - /// - /// Three level lower than . - /// - Aft_3 = 3, - /// - /// Highest priority, in , it is . - /// - Highest = Pre_3, - /// - /// Default priority, usually is in this priority. - /// - Default = 0, - /// - /// Lowest priority, in , it is . - /// - Least = Aft_3, - } -} diff --git a/源代码/StgSharp/Graphics/Form/FrameAsyncThread.cs b/源代码/StgSharp/Graphics/Form/FrameAsyncThread.cs deleted file mode 100644 index 94aa0181..00000000 --- a/源代码/StgSharp/Graphics/Form/FrameAsyncThread.cs +++ /dev/null @@ -1,640 +0,0 @@ -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="FrameAsyncThread.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -using StgSharp.Data; -using StgSharp.Math; - -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace StgSharp.Graphics -{ - internal sealed class FrameOperationBuffer - { - - private IntPtr _func; - private ConcurrentQueue _funcQueue; - private readonly unsafe GLcontext* currentContext; - - public unsafe FrameOperationBuffer() - { - currentContext = GL.api; - _funcQueue = new ConcurrentQueue(); - } - - public unsafe bool CallNext() - { - if (_funcQueue.TryDequeue(out _func)) - { - ((delegate*)_func)(this, currentContext); - return true; - } - else - { - return false; - } - } - - #region gl param queue - - private ConcurrentQueue paramQueue = new ConcurrentQueue(); - private ConcurrentQueue streamQueue = new ConcurrentQueue(); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void MethodEnqueue(IntPtr p) - { - _funcQueue.Enqueue(p); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(vec4d v) - { - paramQueue.Enqueue(v); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(M128 m) - { - paramQueue.Enqueue(m); - //Console.Write(paramQueue.Count + streamQueue.Count); - //Console.Write($":{m.ToString(16)}\n"); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(uint u0) - { - M128 m = default; - m.Write(0, u0); - this.ParamEnqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(uint u0, uint u1) - { - M128 m = default; - m.Write(0, u0); - m.Write(1, u1); - this.ParamEnqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(ulong u0, ulong u1) - { - M128 m = default; - m.Write(0, u0); - m.Write(1, u1); - this.ParamEnqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(uint u0, uint u1, uint u2) - { - M128 m = default; - m.Write(0, u0); - m.Write(1, u1); - m.Write(2, u2); - this.ParamEnqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(float f0, float f1, float f2) - { - M128 m = default; - m.Write(0, f0); - m.Write(1, f1); - this.ParamEnqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(float f0, float f1, float f2, float f3) - { - M128 m = default; - m.Write(0, f0); - m.Write(1, f1); - m.Write(2, f2); - m.Write(3, f3); - this.ParamEnqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(IntPtr p0, IntPtr p1) - { - M128 m = default; - m.Write(0, (ulong)p0); - m.Write(1, (ulong)p1); - this.ParamEnqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(IntPtr p) - { - M128 m = default; - m.Write(0, (ulong)p); - this.ParamEnqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void ParamEnqueue(glHandle handle) - { - M128 m = default; - m.Write(0, (ulong)handle.valuePtr); - this.ParamEnqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void ParamEnqueue(glHandle handle, glHandle handle1) - { - M128 m = default; - m.Write(0, (ulong)handle.valuePtr); - m.Write(1, (ulong)handle1.valuePtr); - this.ParamEnqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(int i0) - { - M128 m = default; - m.Write(0, i0); - this.ParamEnqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(int i0, int i1) - { - M128 m = default; - m.Write(0, i0); - m.Write(1, i1); - this.ParamEnqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(int i0, int i1, int i2) - { - M128 m = default; - m.Write(0, i0); - m.Write(1, i1); - m.Write(2, i2); - this.ParamEnqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(int i0, int i1, int i2, int i3) - { - M128 m = default; - m.Write(0, i0); - m.Write(1, i1); - m.Write(2, i2); - m.Write(3, i3); - this.ParamEnqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(string str) - { - byte[] code = Encoding.UTF8.GetBytes(str); - streamQueue.Enqueue(glArrayHandle.Alloc(code)); - //Console.WriteLine(paramQueue.Count + streamQueue.Count); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void ParamEnqueue(T[] array) where T : struct - { - streamQueue.Enqueue(glArrayHandle.Alloc(array)); - //Console.WriteLine(paramQueue.Count + streamQueue.Count); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out glArrayHandle arrayHandle) - { - if (!streamQueue.TryDequeue(out arrayHandle)) - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function:", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool TryDequeue(out M128 m) - { - m = new(); - bool ret = paramQueue.TryDequeue(out m); - Console.WriteLine(m.ToString(16)); - return ret; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void TryDequeue(out vec4d v) - { - M128 m; - if (this.TryDequeue(out m)) - { - v = *(vec4d*)&m; - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out T[] array) - { - glArrayHandle output = default; - if (streamQueue.TryDequeue(out output)) - { - array = output.a as T[]; - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out int i0) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - i0 = ret.Read(0); - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out int i0, out int i1) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - i0 = ret.Read(0); - i1 = ret.Read(1); - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out int i0, out int i1, out int i2) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - i0 = ret.Read(0); - i1 = ret.Read(1); - i2 = ret.Read(2); - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out int i0, out int i1, out int i2, out int i3) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - i0 = ret.Read(0); - i1 = ret.Read(1); - i2 = ret.Read(2); - i3 = ret.Read(3); - } - 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) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - p = (IntPtr)ret.Read(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 p0, out IntPtr p1) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - p0 = (IntPtr)ret.Read(0); - p1 = (IntPtr)ret.Read(1); - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out float f0, out float f1, out float f2, out float f3) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - f0 = ret.Read(0); - f1 = ret.Read(1); - f2 = ret.Read(2); - f3 = ret.Read(3); - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out float f0, out float f1, out float f2) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - f0 = ret.Read(0); - f1 = ret.Read(1); - f2 = ret.Read(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) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - u0 = ret.Read(0); - } - 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) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - u0 = ret.Read(0); - u1 = ret.Read(1); - } - 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) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - u0 = ret.Read(0); - u1 = ret.Read(1); - u2 = ret.Read(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 (this.TryDequeue(out ret)) - { - u0 = ret.Read(0); - u1 = ret.Read(1); - u2 = ret.Read(2); - u3 = ret.Read(3); - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - /* - internal void SetContext(GLcontext* p) - { - context = p; - } - /**/ - - #endregion gl param queue - - - } - - public class FrameAsyncThread - { - - private int _priority; - - private Thread _task; - private volatile int _terminateToken; - - protected Barrier _frameSpeedSyncBarrier; - - - protected Barrier _spanCompleteBarrier; - protected ThreadStart _taskTODO; - - public FrameAsyncThread(ThreadStart action, int priority) - { - _taskTODO = action; - _terminateToken = 1; - _spanCompleteBarrier = new Barrier(2); - _priority = priority; - } - - public int Priority - { - get => _priority; - internal set => _priority = value; - } - - public ThreadStart TaskTODO - { - get => _taskTODO; - set => _taskTODO = value; - } - - public Barrier TodoCompleteBarrier -=> _spanCompleteBarrier; - - public void AsyncStart() - { - _task = new Thread( - () => - { - while (true) - { - _frameSpeedSyncBarrier.SignalAndWait(); - if (_terminateToken == 0) - { - break; - } - _taskTODO(); - _spanCompleteBarrier.SignalAndWait(); - } - }); - _task.Start(); - } - - public static void AsyncStartAll(IEnumerable threadList) - { - foreach (FrameAsyncThread t in threadList) - { - t.AsyncStart(); - } - } - - public static (Barrier, Barrier) CombineAsync(bool needOuterMonitor, IEnumerable taskList) - { - if (taskList.Count() == 0) - { - return (null, null); - } - Barrier b_start = new Barrier(taskList.Count() + (needOuterMonitor ? 1 : 0)); - Barrier b_complete = new Barrier(taskList.Count() + (needOuterMonitor ? 1 : 0)); - foreach (FrameAsyncThread item in taskList) - { - item._frameSpeedSyncBarrier = b_start; - item._spanCompleteBarrier = b_complete; - } - return (b_start, b_complete); - } - - public static (Barrier, Barrier) CombineAsync(bool needOuterMonitor, params FrameAsyncThread[] taskList) - { - if (taskList.Length == 0) - { - return (null, null); - } - Barrier b_start = new Barrier(taskList.Length + (needOuterMonitor ? 1 : 0)); - Barrier b_complete = new Barrier(taskList.Length + (needOuterMonitor ? 1 : 0)); - foreach (FrameAsyncThread item in taskList) - { - item._frameSpeedSyncBarrier = b_start; - item._spanCompleteBarrier = b_complete; - } - return (b_start, b_complete); - } - public static Barrier CombineAsyncAfter(Barrier begin, bool needOuterMonitor, IEnumerable taskList) - { - if (taskList.Count() == 0) - { - return null; - } - Barrier b_complete = new Barrier(taskList.Count() + (needOuterMonitor ? 1 : 0)); - foreach (FrameAsyncThread item in taskList) - { - item._frameSpeedSyncBarrier = begin; - item._spanCompleteBarrier = b_complete; - } - return b_complete; - } - - public void Terminate() - { - Interlocked.Exchange(ref _terminateToken, 0); - } - - public static void TerminateAll(params FrameAsyncThread[] threadList) - { - foreach (FrameAsyncThread t in threadList) - { - t.Terminate(); - } - } - - public static void TerminateAll(IEnumerable threadList) - { - foreach (FrameAsyncThread t in threadList) - { - t.Terminate(); - } - } - - public static void WaitAll(IEnumerable threadList) - { - foreach (FrameAsyncThread t in threadList) - { - t._task.Join(); - } - } - - } - - -} \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/Form/ShowForm.cs b/源代码/StgSharp/Graphics/Form/ShowForm.cs deleted file mode 100644 index cf4e788d..00000000 --- a/源代码/StgSharp/Graphics/Form/ShowForm.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Graphics -{ - public class FormFormatter - { - - } - - public abstract unsafe partial class ViewModel - { - - static internal Dictionary activatedForms ; - - public static void ShowForm(FormFormatter f) where T : ViewModel - { - if (activatedForms == null) - { - activatedForms = new Dictionary(); - } - } - - - - } -} diff --git a/源代码/StgSharp/Logic/ArrayList.cs b/源代码/StgSharp/Logic/ArrayList.cs deleted file mode 100644 index 12871f71..00000000 --- a/源代码/StgSharp/Logic/ArrayList.cs +++ /dev/null @@ -1,452 +0,0 @@ -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ArrayList.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -using StgSharp.Graphics; - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Logic -{ - [StructLayout(LayoutKind.Explicit, Size = 8)] - internal struct LogSeperator - { - - [FieldOffset(0)] public ulong all; - [FieldOffset(0)] public long all_s; - [FieldOffset(4)] public uint high; - [FieldOffset(4)] public int high_s; - - [FieldOffset(0)] public uint low; - - [FieldOffset(0)] public int low_s; - - public LogSeperator(uint high, uint low) - { - this.high = high; - this.low = low; - } - - } - - /// - /// A linear data structure with dynamic length. - /// It contains a of , - /// each is twice longer than the former one. - /// - /// - public class DynamicArrayList - { - - private List arrayIndexList; - private LogSeperator indexpair; - private int lastMain = 0; - - // main index to the last used element - private int lastSub = 0; - - private int length; - private int subLength = 1; - - // sub index to the last used element - private Queue unusedMainIndex; - - private Queue unusedSubIndex; - - public DynamicArrayList() - { - arrayIndexList = [new T[1]]; - length = 0; - unusedMainIndex = new Queue(); - unusedSubIndex = new Queue(); - unusedMainIndex.Enqueue(0); - unusedSubIndex.Enqueue(0); - } - - /// - /// Init a with a certain amount of elements prepared. - /// - /// Amount of elements to be prepared. - public DynamicArrayList(int count) - { - arrayIndexList = new List(); - length = count; - unusedMainIndex = new(); - unusedSubIndex = new(); - - SeprateIndex(count); - int subcount = 1; - for (int i = 0; i < indexpair.high_s; i++) - { - arrayIndexList.Add(new T[count]); - for (int j = 0; j < subcount; j++) - { - unusedMainIndex.Enqueue(i); - unusedSubIndex.Enqueue(j); - } - count >>= 1; - } - if (indexpair.low_s != 0) - { - arrayIndexList.Add(new T[1 >> indexpair.high_s]); - for (int j = 0; j < indexpair.high_s; j++) - { - unusedMainIndex.Enqueue(indexpair.high_s); - unusedSubIndex.Enqueue(j); - } - } - } - - /// - /// Create a new instance of , - /// and fill the begining ones of elemtns as given instance. - /// - /// Amount of beginning elements to be filled - /// - public DynamicArrayList(int count, T instace) - { - arrayIndexList = new List(); - length = count; - unusedMainIndex = new(); - unusedSubIndex = new(); - - SeprateIndex(count); - int subcount = 1; - for (int i = 0; i < indexpair.high_s; i++) - { - arrayIndexList.Add(new T[count]); - for (int j = 0; j < subcount; j++) - { - unusedMainIndex.Enqueue(i); - unusedSubIndex.Enqueue(j); - } - count >>= 1; - } - if (indexpair.low_s != 0) - { - arrayIndexList.Add(new T[1 >> indexpair.high_s]); - for (int j = 0; j < indexpair.high_s; j++) - { - unusedMainIndex.Enqueue(indexpair.high_s); - unusedSubIndex.Enqueue(j); - } - } - } - - internal T this[long index] - { - get - { - indexpair.all_s = index; - if ( - (indexpair.low_s > lastSub) || - (indexpair.high_s > lastMain) || - (indexpair.low_s < 0) || - (indexpair.high_s < 0)) - { - throw new IndexOutOfRangeException(); - } - return arrayIndexList[indexpair.high_s][indexpair.low_s]; - } - set - { - indexpair.all_s = index; - if ( - (indexpair.low_s > lastSub) || - (indexpair.high_s > lastMain) || - (indexpair.low_s < 0) || - (indexpair.high_s < 0)) - { - throw new IndexOutOfRangeException(); - } - arrayIndexList[indexpair.high_s][indexpair.low_s] = value; - } - } - - public T this[int index] - { - get - { - if ((index + 1 > length) || (index < 0)) - { - throw new ArgumentOutOfRangeException("index"); - } - SeprateIndex(index); - return arrayIndexList[indexpair.high_s][indexpair.low_s]; - } - set - { - if ((index + 1 > length) || (index < 0)) - { - throw new ArgumentOutOfRangeException("index"); - } - SeprateIndex(index); - arrayIndexList[indexpair.high_s][indexpair.low_s] = value; - } - } - - public T this[uint index] - { - get - { - if ((index + 1 > length) || (index < 0)) - { - throw new ArgumentOutOfRangeException("index"); - } - SeprateIndex(index); - return arrayIndexList[indexpair.high_s][indexpair.low_s]; - } - set - { - if ((index + 1 > length) || (index < 0)) - { - throw new ArgumentOutOfRangeException("index"); - } - SeprateIndex(index); - arrayIndexList[indexpair.high_s][indexpair.low_s] = value; - } - } - - public int Count => length; - - /// - /// Length of this - /// - public int Length => length; - - public int Add(T item) - { - // this list is tite, all item is side by side - if (unusedMainIndex.Count == 0) - { - // no extra space, a new sub array is needed - if (lastSub + 1 == 1 << lastMain) - { - subLength <<= 1; - arrayIndexList.Add(new T[subLength]); - lastMain++; - lastSub = 0; - arrayIndexList[lastMain][0] = item; - - length++; - subLength = 1; - return length - 1; - } - - length++; - lastSub++; - arrayIndexList[lastMain][lastSub] = item; - subLength = 1; - return length - 1; - } - - length++; - int main = unusedMainIndex.Dequeue(); - int sub = unusedSubIndex.Dequeue(); - arrayIndexList[main][sub] = item; - - subLength = 1; - return sub + (1 << main); - } - - public void Clear() - { - arrayIndexList.Clear(); - arrayIndexList.Add(new T[1]); - unusedMainIndex.Clear(); - unusedSubIndex.Clear(); - length = 0; - unusedMainIndex.Enqueue(0); - unusedSubIndex.Enqueue(0); - } - - public bool Contains(T item) - { - foreach (T[] list in arrayIndexList) - { - foreach (T i in list) - { - if (i.Equals(item)) - { - return true; - } - } - } - return false; - } - - public void CopyTo(DynamicArrayList target) - { - target.arrayIndexList.Clear(); - int length = 1; - foreach (T[] tList in target.arrayIndexList) - { - T[] newIndex = new T[length]; - Buffer.BlockCopy(tList, 0, newIndex, 0, length); - target.arrayIndexList.Add(newIndex); - length <<= 1; - } - - target.lastMain = lastMain; - target.lastSub = lastSub; - target.length = length; - target.unusedMainIndex = new Queue(unusedMainIndex.ToArray()); - target.unusedSubIndex = new Queue(unusedSubIndex.ToArray()); - } - - public int IndexOf(T item) - { - int index = 1; - foreach (T[] list in arrayIndexList) - { - int subindex = 0; - foreach (T i in list) - { - if (i.Equals(item)) - { - return (index + subindex) - 1; - } - subindex++; - } - index <<= 1; - } - return -1; - } - - [Obsolete("This method is not same, you may read data form an empty index.", false)] - public bool Remove(T item) - { - int index = 0; - foreach (T[] list in arrayIndexList) - { - int subindex = 0; - foreach (T i in list) - { - if (i.Equals(item)) - { - list[subindex] = default; - if ((subindex == lastSub) && (index == lastMain)) - { - if (lastSub == 0) - { - lastMain = (lastMain == 0) ? 0 : (lastMain - 1); - lastSub = arrayIndexList[lastMain].Length - 1; - } - else - { - lastSub--; - } - length--; - return true; - } - unusedMainIndex.Enqueue(index); - unusedSubIndex.Enqueue(subindex); - return true; - } - subindex++; - } - index++; - } - return false; - } - - [Obsolete("This method is not same, you may read data form an empty index.", false)] - public void RemoveAt(int index) - { - if ((index > length) || (index < 0)) - { - throw new ArgumentOutOfRangeException(nameof(index)); - } - SeprateIndex(index); - - //the last element was removed. - if (index + 1 == length) - { - //the last array can be disposed - if (lastSub == 0) - { - arrayIndexList.RemoveAt(lastMain); - lastMain--; - lastSub = (length / 2) - 1; - } - length--; - return; - } - - unusedMainIndex.Enqueue(indexpair.high_s); - unusedSubIndex.Enqueue(indexpair.low_s); - } - - public void ShowStructure() - { - foreach (T[] l in arrayIndexList) - { - foreach (T item in l) - { - Console.Write($"{item}\t"); - } - Console.Write("\n\n"); - } - } - - private void SeprateIndex(uint ulongIndex) - { - indexpair.high = ulongIndex; - int mainindex = 0; - while (indexpair.high > 1) - { - indexpair.all >>= 1; - mainindex++; - } - indexpair.high_s = mainindex; - indexpair.low >>= 32 - mainindex; - } - - private void SeprateIndex(int longIndex) - { - indexpair.high_s = longIndex; - int mainindex = 0; - while (indexpair.high > 1) - { - indexpair.all >>= 1; - mainindex++; - } - indexpair.high_s = mainindex; - indexpair.low >>= 32 - mainindex; - } - - } -} \ No newline at end of file diff --git a/源代码/StgSharp/Logic/Blueprint.cs b/源代码/StgSharp/Logic/Blueprint.cs deleted file mode 100644 index 71082163..00000000 --- a/源代码/StgSharp/Logic/Blueprint.cs +++ /dev/null @@ -1,167 +0,0 @@ -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Blueprint.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -using StgSharp; -using StgSharp.Logic; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharpDebug.Logic -{ - public class Blueprint - { - - private BlueprintNode beginNode; - private Dictionary allNode; - private Func terminate; - - private int currentNodeIndex = 0; - private List allThread; - private List nativeNodeList; - private List nodeList; - - public Blueprint() - { - allThread = new List(); - nodeList = new List(); - nativeNodeList = new List(); - terminate = () => false; - } - - public bool IsRunning => allThread.Any(t => t.Status == TaskStatus.Running); - - public void Init(int threadCount) - { - foreach (var item in allNode) - { - if (item.Value.IsNative) - { - nativeNodeList.Add(item.Value); - } - else - { - nodeList.Add(item.Value); - } - } - nativeNodeList.Sort(); - nodeList.Sort(); - if (threadCount > nodeList.Count) - { - InternalIO.InternalWriteLog( - "Thread setting error: amount of threads of this blueprint is larger than amount of nodes.", LogType.Warning); - threadCount = nodeList.Count; - } - for (int i = 0; i < threadCount; i++) - { - allThread.Add(new Task( - - () => - { - while (true) - { - try - { - while (true) - { - RequestNextNode().Run(); - } - } - catch (NodeClearException) { } - if (terminate()) - { - return; - } - } - } - - )); - } - } - - /// - /// Run all nodes in current blueprint once. - /// - public void Run() - { - foreach (var t in allThread) - { - t.Start(); - } - foreach (var node in nativeNodeList) - { - node.Run(); - } - Task.WaitAll(allThread.ToArray()); - } - - /// - /// Run all nodes repeatedly until it is instructed to terminate. - /// - /// Instructor to terminate all tasks. Returns if tasks should terminate - public void RunRepeatedly(Func terminateInstructor) - { - terminate = terminateInstructor; - foreach (var t in allThread) - { - t.Start(); - } - foreach (var node in nativeNodeList) - { - node.Run(); - } - foreach (var node in nativeNodeList) - { - node.Run(); - } - } - - private BlueprintNode RequestNextNode() - { - if (currentNodeIndex < nodeList.Count) - { - BlueprintNode ret = nodeList[currentNodeIndex]; - Interlocked.Increment(ref currentNodeIndex); - return ret; - } - throw new NodeClearException(); - } - - } - - internal class NodeClearException : Exception - { - - } -} diff --git a/源代码/StgSharp/Logic/BlueprintNode.cs b/源代码/StgSharp/Logic/BlueprintNode.cs deleted file mode 100644 index e510cc24..00000000 --- a/源代码/StgSharp/Logic/BlueprintNode.cs +++ /dev/null @@ -1,186 +0,0 @@ -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="BlueprintNode.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -using StgSharpDebug.Logic; - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace StgSharp.Logic -{ - public delegate void BlueprintNodeAction( - in Dictionary inpput, - in Dictionary output); - - public abstract class BlueprintNode:IComparable - { - - private Blueprint local; - private BlueprintNodeAction mainOperation; - - private bool levelAvailabel, nativeRequested; - - private Dictionary inputInterfaces; - private Dictionary outputInterface; - private int level; - private string name; - - protected BlueprintNode(string name, BlueprintNodeAction operation) - { - this.levelAvailabel = false; - this.name = name; - mainOperation = operation; - inputInterfaces = new Dictionary(); - outputInterface = new Dictionary(); - } - - internal BlueprintNode(string name, bool isNative) - { - this.levelAvailabel = false; - this.name = name; - nativeRequested = isNative; - inputInterfaces = new Dictionary(); - outputInterface = new Dictionary(); - } - - public bool IsNative => nativeRequested; - - public int Level - { - get - { - if (levelAvailabel) - { - return level; - } - level = 0; - foreach (var item in inputInterfaces) - { - if (level <= item.Value.Level) - { - level = item.Value.Level; - } - } - level += 1; - return level; - } - } - - internal Dictionary InputInterfaces => inputInterfaces; - internal Dictionary OutputInterface => outputInterface; - - - public void AddAfter( - BlueprintNode former, - string formerOutputPortName, - string thisInputPortName) - { - this.levelAvailabel = false; - BlueprintPipeline pipeline = new BlueprintPipeline(former,this); - - } - - public void Run() - { - try - { - foreach (var item in inputInterfaces) - { - item.Value.WaitForStart(); - } - mainOperation(in inputInterfaces, in outputInterface); - } - catch (Exception) - { - throw; - } - } - - int IComparable.CompareTo(BlueprintNode other) - { - return this.Level.CompareTo(other.Level); - } - }//--------------------------------- end of class ----------------------------- - - public class BlueprintNodeRunException : Exception - { - private Exception realException; - - public BlueprintNodeRunException(string message, Exception ex) : base(message, ex) - { - } - - public BlueprintNodeRunException(Exception ex):base("",ex) - { - } - } - - public class BlueprintPipeline - { - - private BlueprintNode former; - private BlueprintNode after; - private BlueprintPipelineArgs args; - private SemaphoreSlim formerCompleteSemaphore; - - public BlueprintPipeline(BlueprintNode former, BlueprintNode after) - { - this.former = former; - this.after = after; - formerCompleteSemaphore = new SemaphoreSlim(initialCount: 0, maxCount: 1); - } - - public BlueprintNode Former => former; - - public BlueprintNode After => after; - - public int Level => former.Level; - - public void CompleteAndWriteData(BlueprintPipelineArgs args) - { - formerCompleteSemaphore.Release(); - this.args = args; - } - - public void WaitForStart() - { - formerCompleteSemaphore.Release(); - } - - } - - public abstract class BlueprintPipelineArgs - { - } -} diff --git a/源代码/StgSharp/Logic/glParamQueue.cs b/源代码/StgSharp/Logic/glParamQueue.cs deleted file mode 100644 index f2ecf27f..00000000 --- a/源代码/StgSharp/Logic/glParamQueue.cs +++ /dev/null @@ -1,469 +0,0 @@ -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="glParamQueue.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- -using StgSharp.Data; -using StgSharp.Graphics; -using StgSharp.Math; - -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace StgSharp.Logic -{ - internal unsafe class GLparamQueue - { - - private ConcurrentQueue paramQueue; - private ConcurrentQueue streamQueue; - internal GLcontext* context; - - public GLparamQueue() - { - paramQueue = new ConcurrentQueue(); - streamQueue = new ConcurrentQueue(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(vec4d v) - { - paramQueue.Enqueue(v); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(M128 m) - { - paramQueue.Enqueue(m); - Console.WriteLine(paramQueue.Count + streamQueue.Count); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(uint u0) - { - M128 m = default; - m.Write(0, u0); - this.Enqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(IntPtr p) - { - M128 m = default; - m.Write(0, (ulong)p); - this.Enqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(glHandle handle) - { - M128 m = default; - m.Write(0, (ulong)handle.valuePtr); - this.Enqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(int i0) - { - M128 m = default; - m.Write(0, i0); - this.Enqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(string str) - { - byte[] code = Encoding.UTF8.GetBytes(str); - streamQueue.Enqueue(glArrayHandle.Alloc(code)); - Console.WriteLine(paramQueue.Count + streamQueue.Count); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(T[] array) where T : struct - { - streamQueue.Enqueue(glArrayHandle.Alloc(array)); - Console.WriteLine(paramQueue.Count + streamQueue.Count); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(uint u0, uint u1) - { - M128 m = default; - m.Write(0, u0); - m.Write(1, u1); - this.Enqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(ulong u0, ulong u1) - { - M128 m = default; - m.Write(0, u0); - m.Write(1, u1); - this.Enqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(IntPtr p0, IntPtr p1) - { - M128 m = default; - m.Write(0, (ulong)p0); - m.Write(1, (ulong)p1); - this.Enqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(glHandle handle, glHandle handle1) - { - M128 m = default; - m.Write(0, (ulong)handle.valuePtr); - m.Write(1, (ulong)handle1.valuePtr); - this.Enqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(int i0, int i1) - { - M128 m = default; - m.Write(0, i0); - m.Write(1, i1); - this.Enqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(uint u0, uint u1, uint u2) - { - M128 m = default; - m.Write(0, u0); - m.Write(1, u1); - m.Write(2, u2); - this.Enqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(float f0, float f1, float f2) - { - M128 m = default; - m.Write(0, f0); - m.Write(1, f1); - this.Enqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(int i0, int i1, int i2) - { - M128 m = default; - m.Write(0, i0); - m.Write(1, i1); - m.Write(2, i2); - this.Enqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(float f0, float f1, float f2, float f3) - { - M128 m = default; - m.Write(0, f0); - m.Write(1, f1); - m.Write(2, f2); - m.Write(3, f3); - this.Enqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Enqueue(int i0, int i1, int i2, int i3) - { - M128 m = default; - m.Write(0, i0); - m.Write(1, i1); - m.Write(2, i2); - m.Write(3, i3); - this.Enqueue(m); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out glArrayHandle arrayHandle) - { - if (!streamQueue.TryDequeue(out arrayHandle)) - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function:", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool TryDequeue(out M128 m) - { - bool ret = paramQueue.TryDequeue(out m); - return ret; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out vec4d v) - { - M128 m; - if (this.TryDequeue(out m)) - { - v = *(vec4d*)&m; - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out T[] array) - { - glArrayHandle output = default; - if (streamQueue.TryDequeue(out output)) - { - array = output.a as T[]; - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out int i0) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - i0 = ret.Read(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) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - p = (IntPtr)ret.Read(0); - } - 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) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - u0 = ret.Read(0); - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out int i0, out int i1) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - i0 = ret.Read(0); - i1 = ret.Read(1); - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out IntPtr p0, out IntPtr p1) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - p0 = (IntPtr)ret.Read(0); - p1 = (IntPtr)ret.Read(1); - } - 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) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - u0 = ret.Read(0); - u1 = ret.Read(1); - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out int i0, out int i1, out int i2) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - i0 = ret.Read(0); - i1 = ret.Read(1); - i2 = ret.Read(2); - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out float f0, out float f1, out float f2) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - f0 = ret.Read(0); - f1 = ret.Read(1); - f2 = ret.Read(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) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - u0 = ret.Read(0); - u1 = ret.Read(1); - u2 = ret.Read(2); - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out int i0, out int i1, out int i2, out int i3) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - i0 = ret.Read(0); - i1 = ret.Read(1); - i2 = ret.Read(2); - i3 = ret.Read(3); - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryDequeue(out float f0, out float f1, out float f2, out float f3) - { - M128 ret; - if (this.TryDequeue(out ret)) - { - f0 = ret.Read(0); - f1 = ret.Read(1); - f2 = ret.Read(2); - f3 = ret.Read(3); - } - 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 (this.TryDequeue(out ret)) - { - u0 = ret.Read(0); - u1 = ret.Read(1); - u2 = ret.Read(2); - u3 = ret.Read(3); - } - else - { - InternalIO.InternalWriteLog("No param in buffer when calling gl function.", LogType.Error); - throw new Exception(); - } - } - - /* - internal void SetContext(GLcontext* p) - { - context = p; - } - /**/ - } -} \ No newline at end of file diff --git a/源代码/StgSharp/StgSharp.csproj.user b/源代码/StgSharp/StgSharp.csproj.user new file mode 100644 index 00000000..88a55094 --- /dev/null +++ b/源代码/StgSharp/StgSharp.csproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/源代码/StgSharp/bin/x64/Release/netstandard2.1/StgSharp.dll b/源代码/StgSharp/bin/x64/Release/netstandard2.1/StgSharp.dll index 1d82da97..f7441a71 100644 Binary files a/源代码/StgSharp/bin/x64/Release/netstandard2.1/StgSharp.dll and b/源代码/StgSharp/bin/x64/Release/netstandard2.1/StgSharp.dll differ diff --git a/源代码/StgSharp/bin/x64/Release/netstandard2.1/StgSharp.xml b/源代码/StgSharp/bin/x64/Release/netstandard2.1/StgSharp.xml index 871eb06e..83fc7379 100644 --- a/源代码/StgSharp/bin/x64/Release/netstandard2.1/StgSharp.xml +++ b/源代码/StgSharp/bin/x64/Release/netstandard2.1/StgSharp.xml @@ -4,13 +4,12 @@ StgSharp - - - Add a pool to timeline controller, and return the instance of the pool. - - + + + + - + Get the status of a certain key on the keyboard. @@ -18,128 +17,415 @@ - - - sets the framebuffer resize callback of the specified , - which is called when the framebuffer of the specified is resized. - - The Form instance to be controlled - Method hadler - - - - Call glClearColor in OpenGL - specifies the red, green, blue, and alpha values used by glClear to clear the color buffers. - Values specified by glClearColor are clamped to the range [0,1] - - Specify the red values used when the color buffers are cleared. - Specify the red values used when the color buffers are cleared. - Specify the red values used when the color buffers are cleared. - Specify the red values used when the color buffers are cleared. - - - - Conpile the provided shader code in string form. - - A string represent the shader's code - An enum represent the type of the shader to - conpile, including vertex shader and fragment shader. - An uint value as the only mark of conpiled shader - - - - Creates a form and its associated - - Required width - Required width - Tittle of the window - - - The instance of created form - - - Function handler to load an opengl function by serching its name. + Function handler to load an opengl function by searching its name. - the name of the Opengl function + the name of the Opengl function An intptr value representing the pointer to the function - + - Constructor of a Form, creats an instance of a form and - initilize all the customizing operations. + Interface of all kinds OpenGL buffer objects - + + + Get the only handle to one of the Object instance + + + + + + + Bind a buffer instance to OpenGL + + Index of handle of the object in this instance to be bind + + + + + + + A collection of handle to Element Buffer Object in OpenglFunc. + Each value indexed from instance of this class this + is the only handle to one Element Buffer Object. + + + + + Bind the frame buffer object with name frame buffer to the frame buffer target specified by target. + will be set as default target. + + Index of object to be binded in handle set + + + + Bind the frame buffer object with name frame buffer to the frame buffer target specified by target. + Target of this frame buffer should be set manually. + + The frame buffer target of the binding operation. + Index of object to be binded in handle set + + + + + + + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + Data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + Data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + A of data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + A of data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + A array of data to write in + How OpenGL use these data, defined by + + + + + + + + + Load all supported OpenGL APIs and bind them to given context. + + The used as current OpenGL context + + + + Get the function pointer of given OpenGL api name + + ContextName of the OpenGL api + The funtion pointer of the api in stream of + + + + Bind a frame buffer to a frame buffer target + Same function as glBindFramebuffer. + + The frame buffer target of the binding operation. + The handle of the frame buffer object to bind. + + + + 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. + + + + + Create a set of . + + Amount of EBO to be created. + + + + + Create a sets of + + Amount of textures to be created. + + + + + Create a set of . + + Amount of VAO to be created. + + + + + Create a set of . + + Amount of Object to be created. + + + + + Create an instance of program + + New instance of instance. + + + + Attach one shader code to a shader program. + + Shader program to attach + Index of shader code in current shader code set. + + + + Init a program with no shader attached. + + + + + Get a uniform form current shader, + the value type of the uniform should be provided. + + ContextName of the Uniform in shader code + + + + + Get a uniform form current shader, + the value type of the uniform should be provided. + + ContextName of the Uniform in shader code + + + + + Get a uniform form current shader, + the value type of the uniform should be provided. + + ContextName of the Uniform in shader code + + + + + Get a uniform form current shader, + the value type of the uniform should be provided. + + ContextName of the Uniform in shader code + + + + + Link the shader to current context. + + + + + Let the current context use this shader. + + + + + A handle to an OpenGL object, + must be indexed from a . + Direct call will cause + + + + + A handle to an OpenGL object. + + + + + Release all resource in this handle. + This will release all resource in this . + This will be not usable. + + + - - + - Resize the current form + - New width of the window - New height of the window - + - Resize the current form + - - A (width,height) representing the new size of current form - - + + + + + + + Set the size limit of current form - Minimum width of current form + Minimum width of current form Minimum height of current form - Maximum width of curent form + Maximum width of current form Maximum height of current form - + - Set the size limit of current form + Get (T is ) uniform from a shader. + This uniform will be used as projection matrix of this camera. + Additionally, for multi-shader rendering, each shader requires a uniform, + so do not ignore return value of this method. - - Minimun size of current form. In form of a of (width,height) - - - Maximum size of current form. In form of a of (width,height) + Shader using this camera + ContextName of projection camera named in shader + + (T is ) representing + projection matrix in shader program. + + + + + Get all uniform related to this . + + Shader program requires this camera. + + ContextName of all related uniforms. + If you fallow form from + - - - - - - - - - - - - - - + Init an instance of OpenGL program, - This method should be called before other - graphic methods, after LoadGL method. + This method should be called before any other StgSharp api. - + - Tick counter count the frames passed since the program start. + Version of current StgSharp platform. + Main version represent in hundred's digit, + and sub version represent in ten's digit. + + + + + 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. + + + + OpenGL numeric type. + An IEEE-754 floating-point value, clamped to the range [0,1]. + + + + + OpenGL numeric type. + An IEEE-754 double precision floating-point value, clamped to the range [0,1]. + + + + + A two dimension vector defined by two elements. + Vec2Ds in StgSharp are default used as colum vector. + + + + + Orthogonalize two s, let their length be 1 + and perpendicular to each other. + + + + + + + Reurns the value of ArcSin(x) + + The sine value of the angle + + + + + + Get the value of E ^ x; + + + + + + + + + + + Returns the value of ln(x). + + + + + calculate the value of x^y + + + + Returns the value of x^y + + + + returns a random float number between 0 and 1. + + + + + + + + + + + + Generates a random seed in int value. + + + + + + A class contains a sets of methods to serialize several types + + + + + An independent storage area, used as the only folder type in root folder. + Contains several files reference as virtual disc. + Data is actually stored in s in certain RAID mode. - A sensor used for cheking out if a bullet hit a player or something else + A sensor used for checking out if a bullet hit a player or something else @@ -162,47 +448,33 @@ 当几何体调用了过多的CalcVec方法时,产生UnusedVertexException异常 - + - Caculate the movement of a point. + The origin of this coordinate. - The game tick represent time passed by - A 3d vector representing movement - + - Move the third vertix. this is a useless method for Parallelograms. + The horizontial axis of the coordinate. + Point to the right direction. - Current time tick - - Geometry overdefined - + - Move the third vertix. This method is useless for Parallelograms. + The vertical axis of the coordinate. + Point to the top direction. - Current time tick - - Geometry overdefined - 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。 + Plain geometry only contains straight sides. - - - Update the coordinate of the point. If this is a moving point, - (Points on sides or surface if other geometry items) - please do not define any motion here, codes will be ignored by program - - Time passes since the program begin, counted by frames - - 计算中心点相对于参考原点的位移 + Calculate movement to center - 当前游戏刻 + Current time tick @@ -210,61 +482,1288 @@ A square - + - Add an item to the tail of linked list. + Run all nodes repeatedly until it is instructed to terminate. - The item ready to add to the list + Instructor to terminate all tasks. Returns if tasks should terminate - - - A two dimension vector defined by two elements. - Vec2Ds in StgSharp are defaultly usaed as colum vector. - - - - - Reurns the value of ArcSin(x) - - The sine value of the angle - - - - - - Get the value of E ^ x; - - - - - + - + + Reset pipeline has risk, this operation is a direct operation to port + in current node, the port on the other node cannot get the change. + + + + + Init this form and render it on screen, and respond with operation + + + + + Height of this form, represent in + + + + + Width of this form, represent in + + + + + Width of this form, represent in + + + + + Resize the current form + + + A (width,height) representing the new size of current form + + + + + Set the size limit of current form + + + Minimum size of current form. In form of a of (width,height) + + + Maximum size of current form. In form of a of (width,height) + + + + + Set the size limit of current form + + Minimum width of current form + Minimum height of current form + Maximum width of current form + Maximum height of current form + + + + A microsecond-accuracy timer. It will refresh every a certain time span. + + + + + Create a new and define the length of time span. Length of a single time span is defined in microseconds. + + + + + + + Create a new and define the length of time span. + Length of a single time span is defined in seconds. + + + + + + + Create a new and define the length of time span. Length of a single time span is defined in microseconds. + + + + + + + + Time source provider provided in internal framework. + + + + + The method this will call every time a new time span started. + + + + The COLORREF value is used to specify an RGB color. + + When specifying an explicit [RGB](/windows/desktop/api/Wingdi/nf-wingdi-rgb) color, the **COLORREF** value has the following hexadecimal form: `0x00bbggrr` The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF. To create a **COLORREF** color value, use the [RGB](/windows/desktop/api/Wingdi/nf-wingdi-rgb) macro. To extract the individual values for the red, green, and blue components of a color value, use the [**GetRValue**](/windows/desktop/api/Wingdi/nf-wingdi-getrvalue), [GetGValue](/windows/desktop/api/Wingdi/nf-wingdi-getgvalue), and [GetBValue](/windows/desktop/api/Wingdi/nf-wingdi-getbvalue) macros, respectively. + Read more on docs.microsoft.com. + + + + + A pointer to a null-terminated, constant, ANSI character string. + + + + + A pointer to the first character in the string. The content should be considered readonly, as it was typed as constant in the SDK. + + + + + Gets the number of characters up to the first null character (exclusive). + + + + + Returns a with a copy of this character array, decoding as UTF-8. + + A , or if is . + + + + Returns a span of the characters in this string, up to the first null character (exclusive). + + + + + A pointer to a null-terminated, constant character string. + + + + + A pointer to the first character in the string. The content should be considered readonly, as it was typed as constant in the SDK. + + + + + Gets the number of characters up to the first null character (exclusive). + + + + + Returns a with a copy of this character array, up to the first null character (exclusive). + + A , or if is . + + + + Returns a span of the characters in this string, up to the first null character (exclusive). + + + + The RECT structure defines a rectangle by the coordinates of its upper-left and lower-right corners. + The RECT structure is identical to the RECTL structure. + + + Specifies the x-coordinate of the upper-left corner of the rectangle. + + + Specifies the y-coordinate of the upper-left corner of the rectangle. + + + Specifies the x-coordinate of the lower-right corner of the rectangle. + + + Specifies the y-coordinate of the lower-right corner of the rectangle. + + + Contains message information from a thread's message queue. + + Learn more about this API from docs.microsoft.com. + + + + + Type: HWND A handle to the window whose window procedure receives the message. This member is NULL when the message is a thread message. + Read more on docs.microsoft.com. + + + + + Type: UINT The message identifier. Applications can only use the low word; the high word is reserved by the system. + Read more on docs.microsoft.com. + + + + + Type: WPARAM Additional information about the message. The exact meaning depends on the value of the message member. + Read more on docs.microsoft.com. + + + + + Type: LPARAM Additional information about the message. The exact meaning depends on the value of the message member. + Read more on docs.microsoft.com. + + + + + Type: DWORD The time at which the message was posted. + Read more on docs.microsoft.com. + + + + + Type: POINT The cursor position, in screen coordinates, when the message was posted. + Read more on docs.microsoft.com. + + + + Contains the window class attributes that are registered by the RegisterClass function. (ANSI) + + > [!NOTE] > The winuser.h header defines WNDCLASS as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see [Conventions for Function Prototypes](/windows/win32/intl/conventions-for-function-prototypes). + Read more on docs.microsoft.com. + + + + + Type: UINT The class style(s). This member can be any combination of the Class Styles. + Read more on docs.microsoft.com. + + + + + Type: WNDPROC A pointer to the window procedure. You must use the CallWindowProc function to call the window procedure. For more information, see WindowProc. + Read more on docs.microsoft.com. + + + + + Type: int The number of extra bytes to allocate following the window-class structure. The system initializes the bytes to zero. + Read more on docs.microsoft.com. + + + + + Type: int The number of extra bytes to allocate following the window instance. The system initializes the bytes to zero. If an application uses WNDCLASS to register a dialog box created by using the CLASS directive in the resource file, it must set this member to DLGWINDOWEXTRA. + Read more on docs.microsoft.com. + + + + + Type: HINSTANCE A handle to the instance that contains the window procedure for the class. + Read more on docs.microsoft.com. + + + + + Type: HICON A handle to the class icon. This member must be a handle to an icon resource. If this member is NULL, the system provides a default icon. + Read more on docs.microsoft.com. + + + + + Type: HCURSOR A handle to the class cursor. This member must be a handle to a cursor resource. If this member is NULL, an application must explicitly set the cursor shape whenever the mouse moves into the application's window. + Read more on docs.microsoft.com. + + + + + Type: HBRUSH A handle to the class background brush. This member can be a handle to the physical brush to be used for painting the background, or it can be a color value. A color value must be one of the following standard system colors (the value 1 must be added to the chosen color). If a color value is given, you must convert it to one of the following HBRUSH types: + + This doc was truncated. + Read more on docs.microsoft.com. + + + + + Type: LPCTSTR The resource name of the class menu, as the name appears in the resource file. If you use an integer to identify the menu, use the MAKEINTRESOURCE macro. If this member is NULL, windows belonging to this class have no default menu. + Read more on docs.microsoft.com. + + + + + Type: LPCTSTR A pointer to a null-terminated string or is an atom. If this parameter is an atom, it must be a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpszClassName; the high-order word must be zero. + If lpszClassName is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, or any of the predefined control-class names. The maximum length for lpszClassName is 256. If lpszClassName is greater than the maximum length, the RegisterClass function will fail. + Read more on docs.microsoft.com. + + + + Contains the window class attributes that are registered by the RegisterClass function. (Unicode) + + > [!NOTE] > The winuser.h header defines WNDCLASS as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see [Conventions for Function Prototypes](/windows/win32/intl/conventions-for-function-prototypes). + Read more on docs.microsoft.com. + + + + + Type: UINT The class style(s). This member can be any combination of the Class Styles. + Read more on docs.microsoft.com. + + + + + Type: WNDPROC A pointer to the window procedure. You must use the CallWindowProc function to call the window procedure. For more information, see WindowProc. + Read more on docs.microsoft.com. + + + + + Type: int The number of extra bytes to allocate following the window-class structure. The system initializes the bytes to zero. + Read more on docs.microsoft.com. + + + + + Type: int The number of extra bytes to allocate following the window instance. The system initializes the bytes to zero. If an application uses WNDCLASS to register a dialog box created by using the CLASS directive in the resource file, it must set this member to DLGWINDOWEXTRA. + Read more on docs.microsoft.com. + + + + + Type: HINSTANCE A handle to the instance that contains the window procedure for the class. + Read more on docs.microsoft.com. + + + + + Type: HICON A handle to the class icon. This member must be a handle to an icon resource. If this member is NULL, the system provides a default icon. + Read more on docs.microsoft.com. + + + + + Type: HCURSOR A handle to the class cursor. This member must be a handle to a cursor resource. If this member is NULL, an application must explicitly set the cursor shape whenever the mouse moves into the application's window. + Read more on docs.microsoft.com. + + + + + Type: HBRUSH A handle to the class background brush. This member can be a handle to the physical brush to be used for painting the background, or it can be a color value. A color value must be one of the following standard system colors (the value 1 must be added to the chosen color). If a color value is given, you must convert it to one of the following HBRUSH types: + + This doc was truncated. + Read more on docs.microsoft.com. + + + + + Type: LPCTSTR The resource name of the class menu, as the name appears in the resource file. If you use an integer to identify the menu, use the MAKEINTRESOURCE macro. If this member is NULL, windows belonging to this class have no default menu. + Read more on docs.microsoft.com. + + + + + Type: LPCTSTR A pointer to a null-terminated string or is an atom. If this parameter is an atom, it must be a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpszClassName; the high-order word must be zero. + If lpszClassName is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, or any of the predefined control-class names. The maximum length for lpszClassName is 256. If lpszClassName is greater than the maximum length, the RegisterClass function will fail. + Read more on docs.microsoft.com. + + + + + Represents a Win32 handle that can be closed with . + + + + + Represents a Win32 handle that can be closed with . + + + + The GLYPHMETRICSFLOAT structure contains information about the placement and orientation of a glyph in a character cell. + The values of GLYPHMETRICSFLOAT are specified as notional units. + + + Specifies the width of the smallest rectangle (the glyph's black box) that completely encloses the glyph. + + + Specifies the height of the smallest rectangle (the glyph's black box) that completely encloses the glyph. + + + Specifies the x and y coordinates of the upper-left corner of the smallest rectangle that completely encloses the glyph. + + + Specifies the horizontal distance from the origin of the current character cell to the origin of the next character cell. + + + Specifies the vertical distance from the origin of the current character cell to the origin of the next character cell. + + + The LAYERPLANEDESCRIPTOR structure describes the pixel format of a drawing surface. + Please notice, as documented above, that certain layer plane properties are not supported in the current implementation. The implementation is the Microsoft GDI software implementation of OpenGL. Hardware manufacturers that enhance parts of OpenGL may support some layer plane properties not supported by the generic implementation. + + + Specifies the size of this data structure. Set this value to sizeof(LAYERPLANEDESCRIPTOR). + + + Specifies the version of this data structure. Set this value to 1. + + + + A set of bit flags that specify properties of the layer plane. The properties are generally not mutually exclusive; any combination of bit flags can be set, with the exceptions noted. The following bit flag constants are defined. + This doc was truncated. + Read more on docs.microsoft.com. + + + + + Specifies the type of pixel data. The following types are defined. + This doc was truncated. + Read more on docs.microsoft.com. + + + + Specifies the number of color bitplanes in each color buffer. For RGBA pixel types, it is the size of the color buffer, excluding the alpha bitplanes. For color-index pixels, it is the size of the color-index buffer. + + + Specifies the number of red bitplanes in each RGBA color buffer. + + + Specifies the shift count for red bitplanes in each RGBA color buffer. + + + Specifies the number of green bitplanes in each RGBA color buffer. + + + Specifies the shift count for green bitplanes in each RGBA color buffer. + + + Specifies the number of blue bitplanes in each RGBA color buffer. + + + Specifies the shift count for blue bitplanes in each RGBA color buffer. + + + Specifies the number of alpha bitplanes in each RGBA color buffer. Alpha bitplanes are not supported. + + + Specifies the shift count for alpha bitplanes in each RGBA color buffer. Alpha bitplanes are not supported. + + + Specifies the total number of bitplanes in the accumulation buffer. + + + Specifies the number of red bitplanes in the accumulation buffer. + + + Specifies the number of green bitplanes in the accumulation buffer. + + + Specifies the number of blue bitplanes in the accumulation buffer. + + + Specifies the number of alpha bitplanes in the accumulation buffer. + + + Specifies the depth of the depth (z-axis) buffer. + + + Specifies the depth of the stencil buffer. + + + Specifies the number of auxiliary buffers. Auxiliary buffers are not supported. + + + + + + Not used. Must be zero. + + + When the LPD_TRANSPARENT flag is set, specifies the transparent color or index value. Typically the value is zero. + + + The PIXELFORMATDESCRIPTOR structure describes the pixel format of a drawing surface. + Please notice carefully, as documented above, that certain pixel format properties are not supported in the current generic implementation. The generic implementation is the Microsoft GDI software implementation of OpenGL. Hardware manufacturers may enhance parts of OpenGL, and may support some pixel format properties not supported by the generic implementation. + + + Specifies the size of this data structure. This value should be set to sizeof(PIXELFORMATDESCRIPTOR). + + + Specifies the version of this data structure. This value should be set to 1. + + + + A set of bit flags that specify properties of the pixel buffer. The properties are generally not mutually exclusive; you can set any combination of bit flags, with the exceptions noted. The following bit flag constants are defined. + This doc was truncated. + Read more on docs.microsoft.com. + + + + + Specifies the type of pixel data. The following types are defined. + This doc was truncated. + Read more on docs.microsoft.com. + + + + Specifies the number of color bitplanes in each color buffer. For RGBA pixel types, it is the size of the color buffer, excluding the alpha bitplanes. For color-index pixels, it is the size of the color-index buffer. + + + Specifies the number of red bitplanes in each RGBA color buffer. + + + Specifies the shift count for red bitplanes in each RGBA color buffer. + + + Specifies the number of green bitplanes in each RGBA color buffer. + + + Specifies the shift count for green bitplanes in each RGBA color buffer. + + + Specifies the number of blue bitplanes in each RGBA color buffer. + + + Specifies the shift count for blue bitplanes in each RGBA color buffer. + + + Specifies the number of alpha bitplanes in each RGBA color buffer. Alpha bitplanes are not supported. + + + Specifies the shift count for alpha bitplanes in each RGBA color buffer. Alpha bitplanes are not supported. + + + Specifies the total number of bitplanes in the accumulation buffer. + + + Specifies the number of red bitplanes in the accumulation buffer. + + + Specifies the number of green bitplanes in the accumulation buffer. + + + Specifies the number of blue bitplanes in the accumulation buffer. + + + Specifies the number of alpha bitplanes in the accumulation buffer. + + + Specifies the depth of the depth (z-axis) buffer. + + + Specifies the depth of the stencil buffer. + + + Specifies the number of auxiliary buffers. Auxiliary buffers are not supported. + + + Specifies the number of overlay and underlay planes. Bits 0 through 3 specify up to 15 overlay planes and bits 4 through 7 specify up to 15 underlay planes. + + + Ignored. Earlier implementations of OpenGL used this member, but it is no longer used. + + + Specifies the transparent color or index of an underlay plane. When the pixel type is RGBA, dwVisibleMask is a transparent RGB color value. When the pixel type is color index, it is a transparent index value. + + + Ignored. Earlier implementations of OpenGL used this member, but it is no longer used. + + + The POINTFLOAT structure contains the x and y coordinates of a point. + + Learn more about this API from docs.microsoft.com. + + + + Specifies the horizontal (x) coordinate of a point. + + + Specifies the vertical (y) coordinate of a point. + + + + Contains extern methods from "GDI32.dll". + + + Contains extern methods from "KERNEL32.dll". + + + Contains extern methods from "OPENGL32.dll". + + + Contains extern methods from "USER32.dll". + + + + The DeleteObject function deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object. After the object is deleted, the specified handle is no longer valid. + A handle to a logical pen, brush, font, bitmap, region, or palette. - Returns the value of ln(x). + If the function succeeds, the return value is nonzero. If the specified handle is not valid or is currently selected into a DC, the return value is zero. + + Do not delete a drawing object (pen or brush) while it is still selected into a DC. When a pattern brush is deleted, the bitmap associated with the brush is not deleted. The bitmap must be deleted independently. + Read more on docs.microsoft.com. + - - - calculate the value of x^y - - - - Returns the value of x^y + + - - - returns a random float number between 0 and 1. - - + + The ChoosePixelFormat function attempts to match an appropriate pixel format supported by a device context to a given pixel format specification. + Specifies the device context that the function examines to determine the best match for the pixel format descriptor pointed to by ppfd. + + Pointer to a PIXELFORMATDESCRIPTOR structure that specifies the requested pixel format. In this context, the members of the PIXELFORMATDESCRIPTOR structure that ppfd points to are used as follows: + This doc was truncated. + Read more on docs.microsoft.com. + + + If the function succeeds, the return value is a pixel format index (one-based) that is the closest match to the given pixel format descriptor. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + You must ensure that the pixel format matched by the ChoosePixelFormat function satisfies your requirements. For example, if you request a pixel format with a 24-bit RGB color buffer but the device context offers only 8-bit RGB color buffers, the function returns a pixel format with an 8-bit RGB color buffer. - + + The DescribePixelFormat function obtains information about the pixel format identified by iPixelFormat of the device associated with hdc. The function sets the members of the PIXELFORMATDESCRIPTOR structure pointed to by ppfd with that pixel format data. + Specifies the device context. + Index that specifies the pixel format. The pixel formats that a device context supports are identified by positive one-based integer indexes. + The size, in bytes, of the structure pointed to by ppfd. The DescribePixelFormat function stores no more than nBytes bytes of data to that structure. Set this value to sizeof(PIXELFORMATDESCRIPTOR). + Pointer to a PIXELFORMATDESCRIPTOR structure whose members the function sets with pixel format data. The function stores the number of bytes copied to the structure in the structure's nSize member. If, upon entry, ppfd is NULL, the function writes no data to the structure. This is useful when you only want to obtain the maximum pixel format index of a device context. + + If the function succeeds, the return value is the maximum pixel format index of the device context. In addition, the function sets the members of the PIXELFORMATDESCRIPTOR structure pointed to by ppfd according to the specified pixel format. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + Learn more about this API from docs.microsoft.com. + + + + The DeleteEnhMetaFile function deletes an enhanced-format metafile or an enhanced-format metafile handle. + A handle to an enhanced metafile. + + If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. + + If the hemf parameter identifies an enhanced metafile stored in memory, the DeleteEnhMetaFile function deletes the metafile. If hemf identifies a metafile stored on a disk, the function deletes the metafile handle but does not destroy the actual metafile. An application can retrieve the file by calling the GetEnhMetaFile function. + + + + + + The GetEnhMetaFilePixelFormat function retrieves pixel format information for an enhanced metafile. + Identifies the enhanced metafile. + Specifies the size, in bytes, of the buffer into which the pixel format information is copied. + Pointer to a PIXELFORMATDESCRIPTOR structure that contains the logical pixel format specification. The metafile uses this structure to record the logical pixel format specification. + + If the function succeeds and finds a pixel format, the return value is the size of the metafile's pixel format. If no pixel format is present, the return value is zero. If an error occurs and the function fails, the return value is GDI_ERROR. To get extended error information, call GetLastError. + + + When an enhanced metafile specifies a pixel format in its ENHMETAHEADER structure and the pixel format fits in the buffer, the pixel format information is copied into ppfd. When cbBuffer is too small to contain the pixel format of the metafile, the pixel format is not copied to the buffer. In either case, the function returns the size of the metafile's pixel format. For information on metafile recording and other operations, see Enhanced Metafile Operations. + Read more on docs.microsoft.com. + + + + The GetPixelFormat function obtains the index of the currently selected pixel format of the specified device context. + Specifies the device context of the currently selected pixel format index returned by the function. + + If the function succeeds, the return value is the currently selected pixel format index of the specified device context. This is a positive, one-based index value. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + Learn more about this API from docs.microsoft.com. + + + + + + + The SetPixelFormat function sets the pixel format of the specified device context to the format specified by the iPixelFormat index. + Specifies the device context whose pixel format the function attempts to set. + Index that identifies the pixel format to set. The various pixel formats supported by a device context are identified by one-based indexes. + Pointer to a PIXELFORMATDESCRIPTOR structure that contains the logical pixel format specification. The system's metafile component uses this structure to record the logical pixel format specification. The structure has no other effect upon the behavior of the SetPixelFormat function. + + If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. + + + If hdc references a window, calling the SetPixelFormat function also changes the pixel format of the window. Setting the pixel format of a window more than once can lead to significant complications for the Window Manager and for multithread applications, so it is not allowed. An application can only set the pixel format of a window one time. Once a window's pixel format is set, it cannot be changed. You should select a pixel format in the device context before calling the wglCreateContext function. The wglCreateContext function creates a rendering context for drawing on the device in the selected pixel format of the device context. An OpenGL window has its own pixel format. Because of this, only device contexts retrieved for the client area of an OpenGL window are allowed to draw into the window. As a result, an OpenGL window should be created with the WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles. Additionally, the window class attribute should not include the CS_PARENTDC style. + Read more on docs.microsoft.com. + + + + The SwapBuffers function exchanges the front and back buffers if the current pixel format for the window referenced by the specified device context includes a back buffer. + + If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. + + + If the current pixel format for the window referenced by the device context does not include a back buffer, this call has no effect and the content of the back buffer is undefined when the function returns. With multithread applications, flush the drawing commands in any other threads drawing to the same window before calling SwapBuffers. + Read more on docs.microsoft.com. + + + + Closes an open object handle. + A valid handle to an open object. + + If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. If the application is running under a debugger, the function will throw an exception if it receives either a handle value that is not valid or a pseudo-handle value. This can happen if you close a handle twice, or if you call CloseHandle on a handle returned by the FindFirstFile function instead of calling the FindClose function. + + + The CloseHandle function closes handles to the following objects: + This doc was truncated. + Read more on docs.microsoft.com. + + + + Frees the loaded dynamic-link library (DLL) module and, if necessary, decrements its reference count. + + A handle to the loaded library module. The LoadLibrary, LoadLibraryEx, GetModuleHandle, or GetModuleHandleEx function returns this handle. + Read more on docs.microsoft.com. + + + If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call the GetLastError function. + + + The system maintains a per-process reference count for each loaded module. A module that was loaded at process initialization due to load-time dynamic linking has a reference count of one. The reference count for a module is incremented each time the module is loaded by a call to LoadLibrary. The reference count is also incremented by a call to LoadLibraryEx unless the module is being loaded for the first time and is being loaded as a data or image file. The reference count is decremented each time the FreeLibrary or FreeLibraryAndExitThread function is called for the module. When a module's reference count reaches zero or the process terminates, the system unloads the module from the address space of the process. Before unloading a library module, the system enables the module to detach from the process by calling the module's DllMain function, if it has one, with the DLL_PROCESS_DETACH value. Doing so gives the library module an opportunity to clean up resources allocated on behalf of the current process. After the entry-point function returns, the library module is removed from the address space of the current process. It is not safe to call FreeLibrary from DllMain. For more information, see the Remarks section in DllMain. Calling FreeLibrary does not affect other processes that are using the same module. Use caution when calling FreeLibrary with a handle returned by GetModuleHandle. The GetModuleHandle function does not increment a module's reference count, so passing this handle to FreeLibrary can cause a module to be unloaded prematurely. A thread that must unload the DLL in which it is executing and then terminate itself should call FreeLibraryAndExitThread instead of calling FreeLibrary and ExitThread separately. Otherwise, a race condition can occur. For details, see the Remarks section of FreeLibraryAndExitThread. + Read more on docs.microsoft.com. + + + + + + + Retrieves a module handle for the specified module. The module must have been loaded by the calling process. (Unicode) + + The name of the loaded module (either a .dll or .exe file). If the file name extension is omitted, the default library extension .dll is appended. The file name string can include a trailing point character (.) to indicate that the module name has no extension. The string does not have to specify a path. When specifying a path, be sure to use backslashes (\\), not forward slashes (/). The name is compared (case independently) to the names of modules currently mapped into the address space of the calling process. + If this parameter is NULL, GetModuleHandle returns a handle to the file used to create the calling process (.exe file). The GetModuleHandle function does not retrieve handles for modules that were loaded using the LOAD_LIBRARY_AS_DATAFILE flag. For more information, see LoadLibraryEx. + Read more on docs.microsoft.com. + + + If the function succeeds, the return value is a handle to the specified module. If the function fails, the return value is NULL. To get extended error information, call GetLastError. + + + The returned handle is not global or inheritable. It cannot be duplicated or used by another process. If lpModuleName does not include a path and there is more than one loaded module with the same base name and extension, you cannot predict which module handle will be returned. To work around this problem, you could specify a path, use side-by-side assemblies, or use GetModuleHandleEx to specify a memory location rather than a DLL name. The GetModuleHandle function returns a handle to a mapped module without incrementing its reference count. However, if this handle is passed to the FreeLibrary function, the reference count of the mapped module will be decremented. Therefore, do not pass a handle returned by GetModuleHandle to the FreeLibrary function. Doing so can cause a DLL module to be unmapped prematurely. This function must be used carefully in a multithreaded application. There is no guarantee that the module handle remains valid between the time this function returns the handle and the time it is used. For example, suppose that a thread retrieves a module handle, but before it uses the handle, a second thread frees the module. If the system loads another module, it could reuse the module handle that was recently freed. Therefore, the first thread would have a handle to a different module than the one intended. + Read more on docs.microsoft.com. + + + + + + + Retrieves the address of an exported function or variable from the specified dynamic-link library (DLL). + + A handle to the DLL module that contains the function or variable. The LoadLibrary, LoadLibraryEx, LoadPackagedLibrary, or GetModuleHandle function returns this handle. The GetProcAddress function does not retrieve addresses from modules that were loaded using the LOAD_LIBRARY_AS_DATAFILE flag. For more information, see LoadLibraryEx. + Read more on docs.microsoft.com. + + The function or variable name, or the function's ordinal value. If this parameter is an ordinal value, it must be in the low-order word; the high-order word must be zero. + + If the function succeeds, the return value is the address of the exported function or variable. If the function fails, the return value is NULL. To get extended error information, call GetLastError. + + + The spelling and case of a function name pointed to by lpProcName must be identical to that in the EXPORTS statement of the source DLL's module-definition (.def) file. The exported names of functions may differ from the names you use when calling these functions in your code. This difference is hidden by macros used in the SDK header files. For more information, see Conventions for Function Prototypes. The lpProcName parameter can identify the DLL function by specifying an ordinal value associated with the function in the EXPORTS statement. GetProcAddress verifies that the specified ordinal is in the range 1 through the highest ordinal value exported in the .def file. The function then uses the ordinal as an index to read the function's address from a function table. If the .def file does not number the functions consecutively from 1 to N (where N is the number of exported functions), an error can occur where GetProcAddress returns an invalid, non-NULL address, even though there is no function with the specified ordinal. If the function might not exist in the DLL module—for example, if the function is available only on Windows Vista but the application might be running on Windows XP—specify the function by name rather than by ordinal value and design your application to handle the case when the function is not available, as shown in the following code fragment. + + This doc was truncated. + Read more on docs.microsoft.com. + + + + + + + Loads the specified module into the address space of the calling process. (LoadLibraryW) + + The name of the module. This can be either a library module (a .dll file) or an executable module (an .exe file). If the specified module is an executable module, static imports are not loaded; instead, the module is loaded as if by LoadLibraryEx with the `DONT_RESOLVE_DLL_REFERENCES` flag. The name specified is the file name of the module and is not related to the name stored in the library module itself, as specified by the LIBRARY keyword in the module-definition (.def) file. If the string specifies a full path, the function searches only that path for the module. If the string specifies a relative path or a module name without a path, the function uses a standard search strategy to find the module; for more information, see the Remarks. If the function cannot find the module, the function fails. When specifying a path, be sure to use backslashes (\\), not forward slashes (/). For more information about paths, see Naming a File or Directory. If the string specifies a module name without a path and the file name extension is omitted, the function appends the default library extension ".DLL" to the module name. To prevent the function from appending ".DLL" to the module name, include a trailing point character (.) in the module name string. + Read more on docs.microsoft.com. + + + If the function succeeds, the return value is a handle to the module. If the function fails, the return value is NULL. To get extended error information, call GetLastError. + + + To enable or disable error messages displayed by the loader during DLL loads, use the SetErrorMode function. LoadLibrary can be used to load a library module into the address space of the process and return a handle that can be used in GetProcAddress to get the address of a DLL function. LoadLibrary can also be used to load other executable modules. For example, the function can specify an .exe file to get a handle that can be used in FindResource or LoadResource. However, do not use LoadLibrary to run an .exe file. Instead, use the CreateProcess function. If the specified module is a DLL that is not already loaded for the calling process, the system calls the DLL's DllMain function with the DLL_PROCESS_ATTACH value. If DllMain returns TRUE, LoadLibrary returns a handle to the module. If DllMain returns FALSE, the system unloads the DLL from the process address space and LoadLibrary returns NULL. It is not safe to call LoadLibrary from DllMain. For more information, see the Remarks section in DllMain. Module handles are not global or inheritable. A call to LoadLibrary by one process does not produce a handle that another process can use — for example, in calling GetProcAddress. The other process must make its own call to LoadLibrary for the module before calling GetProcAddress. If lpFileName does not include a path and there is more than one loaded module with the same base name and extension, the function returns a handle to the module that was loaded first. If no file name extension is specified in the lpFileName parameter, the default library extension .dll is appended. However, the file name string can include a trailing point character (.) to indicate that the module name has no extension. When no path is specified, the function searches for loaded modules whose base name matches the base name of the module to be loaded. If the name matches, the load succeeds. Otherwise, the function searches for the file. The first directory searched is the directory containing the image file used to create the calling process (for more information, see the CreateProcess function). Doing this allows private dynamic-link library (DLL) files associated with a process to be found without adding the process's installed directory to the PATH environment variable. If a relative path is specified, the entire relative path is appended to every token in the DLL search path list. To load a module from a relative path without searching any other path, use GetFullPathName to get a nonrelative path and call LoadLibrary with the nonrelative path. For more information on the DLL search order, see Dynamic-Link Library Search Order. The search path can be altered using the SetDllDirectory function. This solution is recommended instead of using SetCurrentDirectory or hard-coding the full path to the DLL. If a path is specified and there is a redirection file for the application, the function searches for the module in the application's directory. If the module exists in the application's directory, LoadLibrary ignores the specified path and loads the module from the application's directory. If the module does not exist in the application's directory, LoadLibrary loads the module from the specified directory. For more information, see Dynamic Link Library Redirection. If you call LoadLibrary with the name of an assembly without a path specification and the assembly is listed in the system compatible manifest, the call is automatically redirected to the side-by-side assembly. The system maintains a per-process reference count on all loaded modules. Calling LoadLibrary increments the reference count. Calling the FreeLibrary or FreeLibraryAndExitThread function decrements the reference count. The system unloads a module when its reference count reaches zero or when the process terminates (regardless of the reference count). Windows Server 2003 and Windows XP:  The Visual C++ compiler supports a syntax that enables you to declare thread-local variables: _declspec(thread). If you use this syntax in a DLL, you will not be able to load the DLL explicitly using LoadLibrary on versions of Windows prior to Windows Vista. If your DLL will be loaded explicitly, you must use the thread local storage functions instead of _declspec(thread). For an example, see Using Thread Local Storage in a Dynamic Link Library.

Security Remarks

Do not use the SearchPath function to retrieve a path to a DLL for a subsequent LoadLibrary call. The SearchPath function uses a different search order than LoadLibrary and it does not use safe process search mode unless this is explicitly enabled by calling SetSearchPathMode with BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE. Therefore, SearchPath is likely to first search the user’s current working directory for the specified DLL. If an attacker has copied a malicious version of a DLL into the current working directory, the path retrieved by SearchPath will point to the malicious DLL, which LoadLibrary will then load. Do not make assumptions about the operating system version based on a LoadLibrary call that searches for a DLL. If the application is running in an environment where the DLL is legitimately not present but a malicious version of the DLL is in the search path, the malicious version of the DLL may be loaded. Instead, use the recommended techniques described in Getting the System Version.
+ Read more on docs.microsoft.com. +
+
+ + + + + The wglGetProcAddress function returns the address of an OpenGL extension function for use with the current OpenGL rendering context. + + When the function succeeds, the return value is the address of the extension function. When no current rendering context exists or the function fails, the return value is NULL. To get extended error information, call GetLastError. + + + The OpenGL library supports multiple implementations of its functions. Extension functions supported in one rendering context are not necessarily available in a separate rendering context. Thus, for a given rendering context in an application, use the function addresses returned by the wglGetProcAddress function only. The spelling and the case of the extension function pointed to by lpszProc must be identical to that of a function supported and implemented by OpenGL. Because extension functions are not exported by OpenGL, you must use wglGetProcAddress to get the addresses of vendor-specific extension functions. The extension function addresses are unique for each pixel format. All rendering contexts of a given pixel format share the same extension function addresses. + Read more on docs.microsoft.com. + + + + The wglDeleteContext function deletes a specified OpenGL rendering context. + + If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. + + + It is an error to delete an OpenGL rendering context that is the current context of another thread. However, if a rendering context is the calling thread's current context, the wglDeleteContext function changes the rendering context to being not current before deleting it. The wglDeleteContext function does not delete the device context associated with the OpenGL rendering context when you call the wglMakeCurrent function. After calling wglDeleteContext, you must call DeleteDC to delete the associated device context. + Read more on docs.microsoft.com. + + + + + + + The wglCreateContext function creates a new OpenGL rendering context, which is suitable for drawing on the device referenced by hdc. The rendering context has the same pixel format as the device context. + + If the function succeeds, the return value is a valid handle to an OpenGL rendering context. If the function fails, the return value is NULL. To get extended error information, call GetLastError. + + + A rendering context is not the same as a device context. Set the pixel format of the device context before creating a rendering context. For more information on setting the device context's pixel format, see the SetPixelFormat function. To use OpenGL, you create a rendering context, select it as a thread's current rendering context, and then call OpenGL functions. When you are finished with the rendering context, you dispose of it by calling the wglDeleteContext function. The following code example shows wglCreateContext usage. + + This doc was truncated. + Read more on docs.microsoft.com. + + + + + + + The wglCreateLayerContext function creates a new OpenGL rendering context for drawing to a specified layer plane on a device context. + + If the function succeeds, the return value is a handle to an OpenGL rendering context. If the function fails, the return value is NULL. To get extended error information, call GetLastError. + + + A rendering context is a port through which all OpenGL commands pass. Every thread that makes OpenGL calls must have one current, active rendering context. A rendering context is not the same as a device context; a rendering context contains information specific to OpenGL, while a device context contains information specific to GDI. Before you create a rendering context, set the pixel format of the device context with the SetPixelFormat function. You can use a rendering context in a specified layer plane of a window with identical pixel formats only. With OpenGL applications that use multiple threads, you create a rendering context, select it as the current rendering context of a thread, and make OpenGL calls for the specified thread. When you are finished with the rendering context of the thread, call the wglDeleteContext function. + Read more on docs.microsoft.com. + + + + + + + The wglCopyContext function copies selected groups of rendering states from one OpenGL rendering context to another. + If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. + + Using the wglCopyContext function, you can synchronize the rendering state of two rendering contexts. You can only copy the rendering state between two rendering contexts within the same process. The rendering contexts must be from the same OpenGL implementation. For example, you can always copy a rendering state between two rendering contexts with identical pixel format in the same process. You can copy the same state information available only with the glPushAttrib function. You cannot copy some state information, such as pixel pack/unpack state, render mode state, select state, and feedback state. When you call wglCopyContext, make sure that the destination rendering context, hglrcDst, is not current to any thread. + Read more on docs.microsoft.com. + + + + + + + The wglDescribeLayerPlane function obtains information about the layer planes of a given pixel format. + + If the function succeeds, the return value is TRUE. In addition, the wglDescribeLayerPlane function sets the members of the LAYERPLANEDESCRIPTOR structure pointed to by plpd according to the specified layer plane (iLayerPlane ) of the specified pixel format (iPixelFormat ). If the function fails, the return value is FALSE. + + The numbering of planes (iLayerPlane ) determines their order. Higher-numbered planes overlay lower-numbered planes. + + + + + + The wglGetCurrentContext function obtains a handle to the current OpenGL rendering context of the calling thread. + If the calling thread has a current OpenGL rendering context, wglGetCurrentContext returns a handle to that rendering context. Otherwise, the return value is NULL. + The current OpenGL rendering context of a thread is associated with a device context by means of the wglMakeCurrent function. You can use the wglGetCurrentDC function to obtain a handle to the device context associated with the current OpenGL rendering context. + + + The wglGetCurrentDC function obtains a handle to the device context that is associated with the current OpenGL rendering context of the calling thread. + If the calling thread has a current OpenGL rendering context, the function returns a handle to the device context associated with that rendering context by means of the wglMakeCurrent function. Otherwise, the return value is NULL. + You associate a device context with an OpenGL rendering context when it calls the wglMakeCurrent function. You can use the wglGetCurrentContext function to obtain a handle to the calling thread's current OpenGL rendering context. + + + + + + Retrieves the palette entries from a given color-index layer plane for a specified device context. + + Type: int If the function succeeds, the return value is the number of entries that were set in the palette in the specified layer plane of the window. If the function fails or when no pixel format is selected, the return value is zero. To get extended error information, call GetLastError. + + + Each color-index layer plane in a window has a palette with a size 2^n, where n is the number of bit planes in the layer plane. You cannot modify the transparent index of a palette. Use the wglRealizeLayerPalette function to realize the layer palette. Initially the layer palette contains only entries for white. + Read more on docs.microsoft.com. + + + + + + + The wglMakeCurrent function makes a specified OpenGL rendering context the calling thread's current rendering context. + When the wglMakeCurrent function succeeds, the return value is TRUE; otherwise the return value is FALSE. To get extended error information, call GetLastError. + + The hdc parameter must refer to a drawing surface supported by OpenGL. It need not be the same hdc that was passed to wglCreateContext when hglrc was created, but it must be on the same device and have the same pixel format. GDI transformation and clipping in hdc are not supported by the rendering context. The current rendering context uses the hdc device context until the rendering context is no longer current. Before switching to the new rendering context, OpenGL flushes any previous rendering context that was current to the calling thread. A thread can have one current rendering context. A process can have multiple rendering contexts by means of multithreading. A thread must set a current rendering context before calling any OpenGL functions. Otherwise, all OpenGL calls are ignored. A rendering context can be current to only one thread at a time. You cannot make a rendering context current to multiple threads. An application can perform multithread drawing by making different rendering contexts current to different threads, supplying each thread with its own rendering context and device context. If an error occurs, the wglMakeCurrent function makes the thread's current rendering context not current before returning. + Read more on docs.microsoft.com. + + + + The wglRealizeLayerPalette function maps palette entries from a given color-index layer plane into the physical palette or initializes the palette of an RGBA layer plane. + If the function succeeds, the return value is TRUE, even if bRealize is TRUE and the physical palette is not available. If the function fails or when no pixel format is selected, the return value is FALSE. To get extended error information, call GetLastError. + + The physical palette for a layer plane is a shared resource among windows with layer planes. When more than one window attempts to realize a palette for a given physical layer plane, only one palette at a time is realized. When you call the wglRealizeLayerPalette function, the layer palette of a foreground window is always realized first. When a window's layer palette is realized, its palette entries are always mapped one-to-one into the physical palette. Unlike GDI logical palettes, with wglRealizeLayerPalette there is no mapping of other windows' layer palettes to the current physical palette. Whenever a window becomes the foreground window, call wglRealizeLayerPalette to realize its layer palettes again, even if the pixel type of the layer plane is RGBA. Because wglRealizeLayerPalette doesn't realize the palette of the main plane, use GDI palette functions to realize the main plane palette. + Read more on docs.microsoft.com. + + + + + + + Sets the palette entries in a given color-index layer plane for a specified device context. + + Type: int If the function succeeds, the return value is the number of entries that were set in the palette in the specified layer plane of the window. If the function fails or no pixel format is selected, the return value is zero. To get extended error information, call GetLastError. + + + Each color-index plane in a window has a palette with a size 2^n, where n is the number of bit planes in the layer plane. You cannot modify the transparent index of a palette. Use the wglRealizeLayerPalette function to realize the layer palette. Initially the layer palette contains only entries for white. The wglSetLayerPaletteEntries function doesn't set the palette entries of the main plane palette. To update the main plane palette, use GDI palette functions. + Read more on docs.microsoft.com. + + + + + + + The wglShareLists function enables multiple OpenGL rendering contexts to share a single display-list space. + + When the function succeeds, the return value is TRUE. When the function fails, the return value is FALSE and the display lists are not shared. To get extended error information, call GetLastError. + + + When you create an OpenGL rendering context, it has its own display-list space. The wglShareLists function enables a rendering context to share the display-list space of another rendering context; any number of rendering contexts can share a single display-list space. Once a rendering context shares a display-list space, the rendering context always uses the display-list space until the rendering context is deleted. When the last rendering context of a shared display-list space is deleted, the shared display-list space is deleted. All the indexes and definitions of display lists in a shared display-list space are shared. You can only share display lists with rendering contexts within the same process. However, not all rendering contexts in a process can share display lists. Rendering contexts can share display lists only if they use the same implementation of OpenGL functions. All client rendering contexts of a given pixel format can always share display lists. All rendering contexts of a shared display list must use an identical pixel format. Otherwise the results depend on the implementation of OpenGL used.
Note  The wglShareLists function is only available with OpenGL version 1.01 or later. To determine the version number of the implementation of OpenGL, call glGetString.
 
+ Read more on docs.microsoft.com. +
+
+ + The wglSwapLayerBuffers function swaps the front and back buffers in the overlay, underlay, and main planes of the window referenced by a specified device context. + If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. + + When a layer plane doesn't include a back buffer, calling the wglSwapLayerBuffers function has no effect on that layer plane. After you call wglSwapLayerBuffers, the state of the back buffer content is given in the corresponding LAYERPLANEDESCRIPTOR structure of the layer plane or in the PIXELFORMATDESCRIPTOR structure of the main plane. The wglSwapLayerBuffers function swaps the front and back buffers in the specified layer planes simultaneously. Some devices don't support swapping layer planes individually; they swap all layer planes as a group. When the PFD_SWAP_LAYER_BUFFERS flag of the PIXELFORMATDESCRIPTOR structure is set, it indicates that a device can swap individual layer planes and that you can call wglSwapLayerBuffers. With applications that use multiple threads, before calling wglSwapLayerBuffers, clear all drawing commands in all threads drawing to the same window. + Read more on docs.microsoft.com. + + + + The wglUseFontBitmaps function creates a set of bitmap display lists for use in the current OpenGL rendering context. (Unicode) + + If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. + + + The wglUseFontBitmaps function defines count display lists in the current OpenGL rendering context. Each display list has an identifying number, starting at listBase. Each display list consists of a single call to glBitmap. The definition of bitmap listBase + i is taken from the glyph first + i of the font currently selected in the device context specified by hdc. If a glyph is not defined, then the function defines an empty display list for it. The wglUseFontBitmaps function creates bitmap text in the plane of the screen. It enables the labeling of objects in OpenGL. In the current version of Microsoft's implementation of OpenGL, you cannot make GDI calls to a device context that has a double-buffered pixel format. Therefore, you cannot use the GDI fonts and text functions with such device contexts. You can use the wglUseFontBitmaps function to circumvent this limitation and draw text in a double-buffered device context. The function determines the parameters of each call to glBitmap as follows. + This doc was truncated. + Read more on docs.microsoft.com. + + + + + + + The wglUseFontOutlines function creates a set of display lists, one for each glyph of the currently selected outline font of a device context, for use with the current rendering context. (Unicode) + + When the function succeeds, the return value is TRUE. When the function fails, the return value is FALSE and no display lists are generated. To get extended error information, call GetLastError. + + + The wglUseFontOutlines function defines the glyphs of an outline font with display lists in the current rendering context. The wglUseFontOutlines function works with TrueType fonts only; stroke and raster fonts are not supported. Each display list consists of either line segments or polygons, and has a unique identifying number starting with the listBase number. The wglUseFontOutlines function approximates glyph outlines by subdividing the quadratic B-spline curves of the outline into line segments, until the distance between the outline and the interpolated midpoint is within the value specified by deviation. This is the final format used when format is WGL_FONT_LINES. When you specify WGL_FONT_OUTLINES, the display lists created don't contain any normals; thus lighting doesn't work properly. To get the correct lighting of lines use WGL_FONT_POLYGONS and set glPolygonMode( GL_FRONT, GL_LINE ). When you specify format as WGL_FONT_POLYGONS the outlines are further tessellated into separate triangles, triangle fans, triangle strips, or quadrilateral strips to create the surface of each glyph. With WGL_FONT_POLYGONS, the created display lists call glFrontFace( GL_CW ) or glFrontFace( GL_CCW ); thus the current front-face value might be altered. For the best appearance of text with WGL_FONT_POLYGONS, cull the back faces as follows: + + This doc was truncated. + Read more on docs.microsoft.com. + + + + Destroys an icon and frees any memory the icon occupied. + + Type: HICON A handle to the icon to be destroyed. The icon must not be in use. + Read more on docs.microsoft.com. + + + Type: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + It is only necessary to call DestroyIcon for icons and cursors created with the following functions: CreateIconFromResourceEx (if called without the LR_SHARED flag), CreateIconIndirect, and CopyIcon. Do not use this function to destroy a shared icon. A shared icon is valid as long as the module from which it was loaded remains in memory. The following functions obtain a shared icon. + This doc was truncated. + Read more on docs.microsoft.com. + + + + Destroys a cursor and frees any memory the cursor occupied. Do not use this function to destroy a shared cursor. + + Type: HCURSOR A handle to the cursor to be destroyed. The cursor must not be in use. + Read more on docs.microsoft.com. + + + Type: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + The DestroyCursor function destroys a nonshared cursor. Do not use this function to destroy a shared cursor. A shared cursor is valid as long as the module from which it was loaded remains in memory. The following functions obtain a shared cursor: + This doc was truncated. + Read more on docs.microsoft.com. + + + + + + + Calculates the required size of the window rectangle, based on the desired client-rectangle size. The window rectangle can then be passed to the CreateWindow function to create a window whose client area is the desired size. + + Type: LPRECT A pointer to a RECT structure that contains the coordinates of the top-left and bottom-right corners of the desired client area. When the function returns, the structure contains the coordinates of the top-left and bottom-right corners of the window to accommodate the desired client area. + Read more on docs.microsoft.com. + + + Type: DWORD The window style of the window whose required size is to be calculated. Note that you cannot specify the WS_OVERLAPPED style. + Read more on docs.microsoft.com. + + + Type: BOOL Indicates whether the window has a menu. + Read more on docs.microsoft.com. + + + Type: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + A client rectangle is the smallest rectangle that completely encloses a client area. A window rectangle is the smallest rectangle that completely encloses the window, which includes the client area and the nonclient area. The AdjustWindowRect function does not add extra space when a menu bar wraps to two or more rows. The AdjustWindowRect function does not take the WS_VSCROLL or WS_HSCROLL styles into account. To account for the scroll bars, call the GetSystemMetrics function with SM_CXVSCROLL or SM_CYHSCROLL. + Read more on docs.microsoft.com. + + + + Destroys the specified menu and frees any memory that the menu occupies. + + Type: HMENU A handle to the menu to be destroyed. + Read more on docs.microsoft.com. + + + Type: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + Before closing, an application must use the DestroyMenu function to destroy a menu not assigned to a window. A menu that is assigned to a window is automatically destroyed when the application closes. DestroyMenu is recursive, that is, it will destroy the menu and all its submenus. + Read more on docs.microsoft.com. + + + + + + + Creates an overlapped, pop-up, or child window with an extended window style; otherwise, this function is identical to the CreateWindow function. (Unicode) + + Type: DWORD The extended window style of the window being created. For a list of possible values, see Extended Window Styles. + Read more on docs.microsoft.com. + + + Type: LPCTSTR A null-terminated string or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero. If lpClassName is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, provided that the module that registers the class is also the module that creates the window. The class name can also be any of the predefined system class names. + Read more on docs.microsoft.com. + + + Type: LPCTSTR The window name. If the window style specifies a title bar, the window title pointed to by lpWindowName is displayed in the title bar. When using CreateWindow to create controls, such as buttons, check boxes, and static controls, use lpWindowName to specify the text of the control. When creating a static control with the SS_ICON style, use lpWindowName to specify the icon name or identifier. To specify an identifier, use the syntax "#num". + Read more on docs.microsoft.com. + + + Type: DWORD The style of the window being created. This parameter can be a combination of the window style values, plus the control styles indicated in the Remarks section. + Read more on docs.microsoft.com. + + + Type: int The initial horizontal position of the window. For an overlapped or pop-up window, the x parameter is the initial x-coordinate of the window's upper-left corner, in screen coordinates. For a child window, x is the x-coordinate of the upper-left corner of the window relative to the upper-left corner of the parent window's client area. If x is set to CW_USEDEFAULT, the system selects the default position for the window's upper-left corner and ignores the y parameter. CW_USEDEFAULT is valid only for overlapped windows; if it is specified for a pop-up or child window, the x and y parameters are set to zero. + Read more on docs.microsoft.com. + + + Type: int The initial vertical position of the window. For an overlapped or pop-up window, the y parameter is the initial y-coordinate of the window's upper-left corner, in screen coordinates. For a child window, y is the initial y-coordinate of the upper-left corner of the child window relative to the upper-left corner of the parent window's client area. For a list box y is the initial y-coordinate of the upper-left corner of the list box's client area relative to the upper-left corner of the parent window's client area. + If an overlapped window is created with the WS_VISIBLE style bit set and the x parameter is set to CW_USEDEFAULT, then the y parameter determines how the window is shown. If the y parameter is CW_USEDEFAULT, then the window manager calls ShowWindow with the SW_SHOW flag after the window has been created. If the y parameter is some other value, then the window manager calls ShowWindow with that value as the nCmdShow parameter. + Read more on docs.microsoft.com. + + + Type: int The width, in device units, of the window. For overlapped windows, nWidth is the window's width, in screen coordinates, or CW_USEDEFAULT. If nWidth is CW_USEDEFAULT, the system selects a default width and height for the window; the default width extends from the initial x-coordinates to the right edge of the screen; the default height extends from the initial y-coordinate to the top of the icon area. CW_USEDEFAULT is valid only for overlapped windows; if CW_USEDEFAULT is specified for a pop-up or child window, the nWidth and nHeight parameter are set to zero. + Read more on docs.microsoft.com. + + + Type: int The height, in device units, of the window. For overlapped windows, nHeight is the window's height, in screen coordinates. If the nWidth parameter is set to CW_USEDEFAULT, the system ignores nHeight. + Read more on docs.microsoft.com. + + + Type: HWND A handle to the parent or owner window of the window being created. To create a child window or an owned window, supply a valid window handle. This parameter is optional for pop-up windows. To create a message-only window, supply HWND_MESSAGE or a handle to an existing message-only window. + Read more on docs.microsoft.com. + + + Type: HMENU A handle to a menu, or specifies a child-window identifier, depending on the window style. For an overlapped or pop-up window, hMenu identifies the menu to be used with the window; it can be NULL if the class menu is to be used. For a child window, hMenu specifies the child-window identifier, an integer value used by a dialog box control to notify its parent about events. The application determines the child-window identifier; it must be unique for all child windows with the same parent window. + Read more on docs.microsoft.com. + + + Type: HINSTANCE A handle to the instance of the module to be associated with the window. + Read more on docs.microsoft.com. + + + Type: LPVOID Pointer to a value to be passed to the window through the CREATESTRUCT structure (lpCreateParams member) pointed to by the lParam param of the WM_CREATE message. This message is sent to the created window by this function before it returns. If an application calls CreateWindow to create a MDI client window, lpParam should point to a CLIENTCREATESTRUCT structure. If an MDI client window calls CreateWindow to create an MDI child window, lpParam should point to a MDICREATESTRUCT structure. lpParam may be NULL if no additional data is needed. + Read more on docs.microsoft.com. + + + Type: HWND If the function succeeds, the return value is a handle to the new window. If the function fails, the return value is NULL. To get extended error information, call GetLastError. This function typically fails for one of the following reasons: + This doc was truncated. + + + The CreateWindowEx function sends WM_NCCREATE, WM_NCCALCSIZE, and WM_CREATE messages to the window being created. If the created window is a child window, its default position is at the bottom of the Z-order. If the created window is a top-level window, its default position is at the top of the Z-order (but beneath all topmost windows unless the created window is itself topmost). For information on controlling whether the Taskbar displays a button for the created window, see Managing Taskbar Buttons. For information on removing a window, see the DestroyWindow function. The following predefined control classes can be specified in the lpClassName parameter. Note the corresponding control styles you can use in the dwStyle parameter. + This doc was truncated. + Read more on docs.microsoft.com. + + + + Calls the default window procedure to provide default processing for any window messages that an application does not process. (Unicode) + + Type: HWND A handle to the window procedure that received the message. + Read more on docs.microsoft.com. + + + Type: UINT The message. + Read more on docs.microsoft.com. + + + Type: WPARAM Additional message information. The content of this parameter depends on the value of the Msg parameter. + Read more on docs.microsoft.com. + + + Type: LPARAM Additional message information. The content of this parameter depends on the value of the Msg parameter. + Read more on docs.microsoft.com. + + + Type: LRESULT The return value is the result of the message processing and depends on the message. + + + > [!NOTE] > The winuser.h header defines DefWindowProc as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see [Conventions for Function Prototypes](/windows/win32/intl/conventions-for-function-prototypes). + Read more on docs.microsoft.com. + + + + Destroys the specified window. + + Type: HWND A handle to the window to be destroyed. + Read more on docs.microsoft.com. + + + Type: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + A thread cannot use DestroyWindow to destroy a window created by a different thread. If the window being destroyed is a child window that does not have the WS_EX_NOPARENTNOTIFY style, a WM_PARENTNOTIFY message is sent to the parent. + Read more on docs.microsoft.com. + + + + + + + Dispatches a message to a window procedure. It is typically used to dispatch a message retrieved by the GetMessage function. (DispatchMessageW) + + Type: const MSG* A pointer to a structure that contains the message. + Read more on docs.microsoft.com. + + + Type: LRESULT The return value specifies the value returned by the window procedure. Although its meaning depends on the message being dispatched, the return value generally is ignored. + + + The MSG structure must contain valid message values. If the lpmsg parameter points to a WM_TIMER message and the lParam parameter of the WM_TIMER message is not NULL, lParam points to a function that is called instead of the window procedure. Note that the application is responsible for retrieving and dispatching input messages to the dialog box. Most applications use the main message loop for this. However, to permit the user to move to and to select controls by using the keyboard, the application must call IsDialogMessage. For more information, see Dialog Box Keyboard Interface. + Read more on docs.microsoft.com. + + + + The GetDC function retrieves a handle to a device context (DC) for the client area of a specified window or for the entire screen. + A handle to the window whose DC is to be retrieved. If this value is NULL, GetDC retrieves the DC for the entire screen. + + If the function succeeds, the return value is a handle to the DC for the specified window's client area. If the function fails, the return value is NULL. + + + The GetDC function retrieves a common, class, or private DC depending on the class style of the specified window. For class and private DCs, GetDC leaves the previously assigned attributes unchanged. However, for common DCs, GetDC assigns default attributes to the DC each time it is retrieved. For example, the default font is System, which is a bitmap font. Because of this, the handle to a common DC returned by GetDC does not tell you what font, color, or brush was used when the window was drawn. To determine the font, call GetTextFace. Note that the handle to the DC can only be used by a single thread at any one time. After painting with a common DC, the ReleaseDC function must be called to release the DC. Class and private DCs do not have to be released. ReleaseDC must be called from the same thread that called GetDC. The number of DCs is limited only by available memory. + Read more on docs.microsoft.com. + + + + + + + Loads the specified cursor resource from the executable (.EXE) file associated with an application instance. (Unicode) + + Type: HINSTANCE A handle to an instance of the module whose executable file contains the cursor to be loaded. + Read more on docs.microsoft.com. + + + Type: LPCTSTR The name of the cursor resource to be loaded. Alternatively, this parameter can consist of the resource identifier in the low-order word and zero in the high-order word. The MAKEINTRESOURCE macro can also be used to create this value. To use one of the predefined cursors, the application must set the hInstance parameter to NULL and the lpCursorName parameter to one the following values. + This doc was truncated. + Read more on docs.microsoft.com. + + + Type: HCURSOR If the function succeeds, the return value is the handle to the newly loaded cursor. If the function fails, the return value is NULL. To get extended error information, call GetLastError. + + + The LoadCursor function loads the cursor resource only if it has not been loaded; otherwise, it retrieves the handle to the existing resource. This function returns a valid cursor handle only if the lpCursorName parameter is a pointer to a cursor resource. If lpCursorName is a pointer to any type of resource other than a cursor (such as an icon), the return value is not NULL, even though it is not a valid cursor handle. The LoadCursor function searches the cursor resource most appropriate for the cursor for the current display device. The cursor resource can be a color or monochrome bitmap.

DPI Virtualization

This API does not participate in DPI virtualization. The output returned is not affected by the DPI of the calling thread.
+ Read more on docs.microsoft.com. +
+
+ + + + + Dispatches incoming nonqueued messages, checks the thread message queue for a posted message, and retrieves the message (if any exist). (Unicode) + + Type: LPMSG A pointer to an MSG structure that receives message information. + Read more on docs.microsoft.com. + + + Type: HWND A handle to the window whose messages are to be retrieved. The window must belong to the current thread. + If hWnd is NULL, PeekMessage retrieves messages for any window that belongs to the current thread, and any messages on the current thread's message queue whose hwnd value is NULL (see the MSG structure). Therefore if hWnd is NULL, both window messages and thread messages are processed. If hWnd is -1, PeekMessage retrieves only messages on the current thread's message queue whose hwnd value is NULL, that is, thread messages as posted by PostMessage (when the hWnd parameter is NULL) or PostThreadMessage. + Read more on docs.microsoft.com. + + + Type: UINT The value of the first message in the range of messages to be examined. Use WM_KEYFIRST (0x0100) to specify the first keyboard message or WM_MOUSEFIRST (0x0200) to specify the first mouse message. If wMsgFilterMin and wMsgFilterMax are both zero, PeekMessage returns all available messages (that is, no range filtering is performed). + Read more on docs.microsoft.com. + + + Type: UINT The value of the last message in the range of messages to be examined. Use WM_KEYLAST to specify the last keyboard message or WM_MOUSELAST to specify the last mouse message. If wMsgFilterMin and wMsgFilterMax are both zero, PeekMessage returns all available messages (that is, no range filtering is performed). + Read more on docs.microsoft.com. + + Type: UINT + + Type: BOOL If a message is available, the return value is nonzero. If no messages are available, the return value is zero. + + + PeekMessage retrieves messages associated with the window identified by the hWnd parameter or any of its children as specified by the IsChild function, and within the range of message values given by the wMsgFilterMin and wMsgFilterMax parameters. Note that an application can only use the low word in the wMsgFilterMin and wMsgFilterMax parameters; the high word is reserved for the system. Note that PeekMessage always retrieves WM_QUIT messages, no matter which values you specify for wMsgFilterMin and wMsgFilterMax. During this call, the system dispatches (DispatchMessage) pending, nonqueued messages, that is, messages sent to windows owned by the calling thread using the SendMessage, SendMessageCallback, SendMessageTimeout, or SendNotifyMessage function. Then the first queued message that matches the specified filter is retrieved. The system may also process internal events. If no filter is specified, messages are processed in the following order: + This doc was truncated. + Read more on docs.microsoft.com. + + + + Indicates to the system that a thread has made a request to terminate (quit). It is typically used in response to a WM_DESTROY message. + + Type: int The application exit code. This value is used as the wParam parameter of the WM_QUIT message. + Read more on docs.microsoft.com. + + + The PostQuitMessage function posts a WM_QUIT message to the thread's message queue and returns immediately; the function simply indicates to the system that the thread is requesting to quit at some time in the future. When the thread retrieves the WM_QUIT message from its message queue, it should exit its message loop and return control to the system. The exit value returned to the system must be the wParam parameter of the WM_QUIT message. + Read more on docs.microsoft.com. + + + + Registers a window class for subsequent use in calls to the CreateWindow or CreateWindowEx function. (RegisterClassW) + + Type: const WNDCLASS* A pointer to a WNDCLASS structure. You must fill the structure with the appropriate class attributes before passing it to the function. + Read more on docs.microsoft.com. + + + Type: ATOM If the function succeeds, the return value is a class atom that uniquely identifies the class being registered. This atom can only be used by the CreateWindow, CreateWindowEx, GetClassInfo, GetClassInfoEx, FindWindow, FindWindowEx, and UnregisterClass functions and the IActiveIMMap::FilterClientWindows method. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + If you register the window class by using RegisterClassA, the application tells the system that the windows of the created class expect messages with text or character parameters to use the ANSI character set; if you register it by using RegisterClassW, the application requests that the system pass text parameters of messages as Unicode. The IsWindowUnicode function enables applications to query the nature of each window. For more information on ANSI and Unicode functions, see Conventions for Function Prototypes. All window classes that an application registers are unregistered when it terminates. No window classes registered by a DLL are unregistered when the DLL is unloaded. A DLL must explicitly unregister its classes when it is unloaded. + Read more on docs.microsoft.com. + + + + The ReleaseDC function releases a device context (DC), freeing it for use by other applications. The effect of the ReleaseDC function depends on the type of DC. It frees only common and window DCs. It has no effect on class or private DCs. + A handle to the window whose DC is to be released. + A handle to the DC to be released. + + The return value indicates whether the DC was released. If the DC was released, the return value is 1. If the DC was not released, the return value is zero. + + + The application must call the ReleaseDC function for each call to the GetWindowDC function and for each call to the GetDC function that retrieves a common DC. An application cannot use the ReleaseDC function to release a DC that was created by calling the CreateDC function; instead, it must use the DeleteDC function. ReleaseDC must be called from the same thread that called GetDC. + Read more on docs.microsoft.com. + + + + Sets the specified window's show state. + + Type: HWND A handle to the window. + Read more on docs.microsoft.com. + + Type: int + + Type: BOOL If the window was previously visible, the return value is nonzero. If the window was previously hidden, the return value is zero. + + + To perform certain special effects when showing or hiding a window, use AnimateWindow. The first time an application calls ShowWindow, it should use the WinMain function's nCmdShow parameter as its nCmdShow parameter. Subsequent calls to ShowWindow must use one of the values in the given list, instead of the one specified by the WinMain function's nCmdShow parameter. As noted in the discussion of the nCmdShow parameter, the nCmdShow value is ignored in the first call to ShowWindow if the program that launched the application specifies startup information in the structure. In this case, ShowWindow uses the information specified in the STARTUPINFO structure to show the window. On subsequent calls, the application must call ShowWindow with nCmdShow set to SW_SHOWDEFAULT to use the startup information provided by the program that launched the application. This behavior is designed for the following situations: + This doc was truncated. + Read more on docs.microsoft.com. + + + + + + + Translates virtual-key messages into character messages. The character messages are posted to the calling thread's message queue, to be read the next time the thread calls the GetMessage or PeekMessage function. + + Type: const MSG* A pointer to an MSG structure that contains message information retrieved from the calling thread's message queue by using the GetMessage or PeekMessage function. + Read more on docs.microsoft.com. + + + Type: BOOL If the message is translated (that is, a character message is posted to the thread's message queue), the return value is nonzero. If the message is WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, or WM_SYSKEYUP, the return value is nonzero, regardless of the translation. If the message is not translated (that is, a character message is not posted to the thread's message queue), the return value is zero. + + + The TranslateMessage function does not modify the message pointed to by the lpMsg parameter. + WM_KEYDOWN and WM_KEYUP combinations produce a WM_CHAR or WM_DEADCHAR message. WM_SYSKEYDOWN and WM_SYSKEYUP combinations produce a WM_SYSCHAR or WM_SYSDEADCHAR message. TranslateMessage produces WM_CHAR messages only for keys that are mapped to ASCII characters by the keyboard driver. If applications process virtual-key messages for some other purpose, they should not call TranslateMessage. For instance, an application should not call TranslateMessage if the TranslateAccelerator function returns a nonzero value. Note that the application is responsible for retrieving and dispatching input messages to the dialog box. Most applications use the main message loop for this. However, to permit the user to move to and to select controls by using the keyboard, the application must call IsDialogMessage. For more information, see Dialog Box Keyboard Interface. + Read more on docs.microsoft.com. + + + + The UpdateWindow function updates the client area of the specified window by sending a WM_PAINT message to the window if the window's update region is not empty. + Handle to the window to be updated. + + If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. + + + Learn more about this API from docs.microsoft.com. + + + - Generates a random seed in int value. + Represents a Win32 handle that can be closed with . -
diff --git a/源代码/StgSharp/obj/Release/netstandard2.1/StgSharp.AssemblyInfoInputs.cache b/源代码/StgSharp/obj/Release/netstandard2.1/StgSharp.AssemblyInfoInputs.cache new file mode 100644 index 00000000..34b4e67d --- /dev/null +++ b/源代码/StgSharp/obj/Release/netstandard2.1/StgSharp.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +de50efab9ad17092195f29830b896b77e872265cfb93d08224b3e1a0bc0b0dca diff --git a/源代码/StgSharp/obj/Release/netstandard2.1/StgSharp.GeneratedMSBuildEditorConfig.editorconfig b/源代码/StgSharp/obj/Release/netstandard2.1/StgSharp.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 00000000..44183f7b --- /dev/null +++ b/源代码/StgSharp/obj/Release/netstandard2.1/StgSharp.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,15 @@ +is_global = true +build_property.CsWin32InputMetadataPaths = C:\Users\Nitlo\.nuget\packages\microsoft.windows.sdk.win32metadata\55.0.45-preview\Windows.Win32.winmd|C:\Users\Nitlo\.nuget\packages\microsoft.windows.wdk.win32metadata\0.9.9-experimental\Windows.Wdk.winmd +build_property.CsWin32InputDocPaths = C:\Users\Nitlo\.nuget\packages\microsoft.windows.sdk.win32docs\0.1.42-alpha\apidocs.msgpack +build_property.TargetFramework = netstandard2.1 +build_property.TargetPlatformMinVersion = 7.0 +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = StgSharp +build_property.ProjectDir = D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp\ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = diff --git a/源代码/StgSharp/obj/Release/netstandard2.1/StgSharp.assets.cache b/源代码/StgSharp/obj/Release/netstandard2.1/StgSharp.assets.cache new file mode 100644 index 00000000..452c09df Binary files /dev/null and b/源代码/StgSharp/obj/Release/netstandard2.1/StgSharp.assets.cache differ diff --git a/源代码/StgSharp/obj/Release/netstandard2.1/StgSharp.csproj.AssemblyReference.cache b/源代码/StgSharp/obj/Release/netstandard2.1/StgSharp.csproj.AssemblyReference.cache new file mode 100644 index 00000000..950133b6 Binary files /dev/null and b/源代码/StgSharp/obj/Release/netstandard2.1/StgSharp.csproj.AssemblyReference.cache differ diff --git a/源代码/StgSharp/obj/project.nuget.cache b/源代码/StgSharp/obj/project.nuget.cache index f086c819..df8b2ebe 100644 --- a/源代码/StgSharp/obj/project.nuget.cache +++ b/源代码/StgSharp/obj/project.nuget.cache @@ -1,6 +1,6 @@ { "version": 2, - "dgSpecHash": "ZPDe1JI7Wx6qgAfoUxccO7bepdlHRo3d3YlIJ3OaR4SOQAO2IFjQgv3H5Y8S5d37x/fP3pn350jCofkiCwCIsw==", + "dgSpecHash": "6vH7gozY3nlutAvycQCQBpFugaBd+eT4Uj5P/nMDlmS2xt5e7Cw17gX8+p3vXVTBjKgDitDDnucb2v8GcacRcw==", "success": true, "projectFilePath": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\源代码\\StgSharp\\StgSharp.csproj", "expectedPackageFiles": [ diff --git a/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.AssemblyInfoInputs.cache b/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.AssemblyInfoInputs.cache index 7992a0ab..d86cb2e0 100644 --- a/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.AssemblyInfoInputs.cache +++ b/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.AssemblyInfoInputs.cache @@ -1 +1 @@ -10a5597183260351018995f463258da2d5589454468940a16d3a53d17785c9e0 +ce2864c500078b726caaf79382f20f5fe8c787b07bda81dd387eddbce2a0954f diff --git a/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache b/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache index c1d3815f..368b3930 100644 --- a/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache +++ b/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -6e1c38d1590cf376451723047286bd9f89272ce1 +28f63d3bc726f046f56812aba0ce94432bcf3fa0d93682df4908bad19488c21c diff --git a/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.dll b/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.dll index 1d82da97..f7441a71 100644 Binary files a/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.dll and b/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.dll differ diff --git a/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.xml b/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.xml index 871eb06e..83fc7379 100644 --- a/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.xml +++ b/源代码/StgSharp/obj/x64/Release/netstandard2.1/StgSharp.xml @@ -4,13 +4,12 @@ StgSharp - - - Add a pool to timeline controller, and return the instance of the pool. - - + + + + - + Get the status of a certain key on the keyboard. @@ -18,128 +17,415 @@ - - - sets the framebuffer resize callback of the specified , - which is called when the framebuffer of the specified is resized. - - The Form instance to be controlled - Method hadler - - - - Call glClearColor in OpenGL - specifies the red, green, blue, and alpha values used by glClear to clear the color buffers. - Values specified by glClearColor are clamped to the range [0,1] - - Specify the red values used when the color buffers are cleared. - Specify the red values used when the color buffers are cleared. - Specify the red values used when the color buffers are cleared. - Specify the red values used when the color buffers are cleared. - - - - Conpile the provided shader code in string form. - - A string represent the shader's code - An enum represent the type of the shader to - conpile, including vertex shader and fragment shader. - An uint value as the only mark of conpiled shader - - - - Creates a form and its associated - - Required width - Required width - Tittle of the window - - - The instance of created form - - - Function handler to load an opengl function by serching its name. + Function handler to load an opengl function by searching its name. - the name of the Opengl function + the name of the Opengl function An intptr value representing the pointer to the function - + - Constructor of a Form, creats an instance of a form and - initilize all the customizing operations. + Interface of all kinds OpenGL buffer objects - + + + Get the only handle to one of the Object instance + + + + + + + Bind a buffer instance to OpenGL + + Index of handle of the object in this instance to be bind + + + + + + + A collection of handle to Element Buffer Object in OpenglFunc. + Each value indexed from instance of this class this + is the only handle to one Element Buffer Object. + + + + + Bind the frame buffer object with name frame buffer to the frame buffer target specified by target. + will be set as default target. + + Index of object to be binded in handle set + + + + Bind the frame buffer object with name frame buffer to the frame buffer target specified by target. + Target of this frame buffer should be set manually. + + The frame buffer target of the binding operation. + Index of object to be binded in handle set + + + + + + + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + Data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + Data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + A of data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + A of data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + A array of data to write in + How OpenGL use these data, defined by + + + + + + + + + Load all supported OpenGL APIs and bind them to given context. + + The used as current OpenGL context + + + + Get the function pointer of given OpenGL api name + + ContextName of the OpenGL api + The funtion pointer of the api in stream of + + + + Bind a frame buffer to a frame buffer target + Same function as glBindFramebuffer. + + The frame buffer target of the binding operation. + The handle of the frame buffer object to bind. + + + + 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. + + + + + Create a set of . + + Amount of EBO to be created. + + + + + Create a sets of + + Amount of textures to be created. + + + + + Create a set of . + + Amount of VAO to be created. + + + + + Create a set of . + + Amount of Object to be created. + + + + + Create an instance of program + + New instance of instance. + + + + Attach one shader code to a shader program. + + Shader program to attach + Index of shader code in current shader code set. + + + + Init a program with no shader attached. + + + + + Get a uniform form current shader, + the value type of the uniform should be provided. + + ContextName of the Uniform in shader code + + + + + Get a uniform form current shader, + the value type of the uniform should be provided. + + ContextName of the Uniform in shader code + + + + + Get a uniform form current shader, + the value type of the uniform should be provided. + + ContextName of the Uniform in shader code + + + + + Get a uniform form current shader, + the value type of the uniform should be provided. + + ContextName of the Uniform in shader code + + + + + Link the shader to current context. + + + + + Let the current context use this shader. + + + + + A handle to an OpenGL object, + must be indexed from a . + Direct call will cause + + + + + A handle to an OpenGL object. + + + + + Release all resource in this handle. + This will release all resource in this . + This will be not usable. + + + - - + - Resize the current form + - New width of the window - New height of the window - + - Resize the current form + - - A (width,height) representing the new size of current form - - + + + + + + + Set the size limit of current form - Minimum width of current form + Minimum width of current form Minimum height of current form - Maximum width of curent form + Maximum width of current form Maximum height of current form - + - Set the size limit of current form + Get (T is ) uniform from a shader. + This uniform will be used as projection matrix of this camera. + Additionally, for multi-shader rendering, each shader requires a uniform, + so do not ignore return value of this method. - - Minimun size of current form. In form of a of (width,height) - - - Maximum size of current form. In form of a of (width,height) + Shader using this camera + ContextName of projection camera named in shader + + (T is ) representing + projection matrix in shader program. + + + + + Get all uniform related to this . + + Shader program requires this camera. + + ContextName of all related uniforms. + If you fallow form from + - - - - - - - - - - - - - - + Init an instance of OpenGL program, - This method should be called before other - graphic methods, after LoadGL method. + This method should be called before any other StgSharp api. - + - Tick counter count the frames passed since the program start. + Version of current StgSharp platform. + Main version represent in hundred's digit, + and sub version represent in ten's digit. + + + + + 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. + + + + OpenGL numeric type. + An IEEE-754 floating-point value, clamped to the range [0,1]. + + + + + OpenGL numeric type. + An IEEE-754 double precision floating-point value, clamped to the range [0,1]. + + + + + A two dimension vector defined by two elements. + Vec2Ds in StgSharp are default used as colum vector. + + + + + Orthogonalize two s, let their length be 1 + and perpendicular to each other. + + + + + + + Reurns the value of ArcSin(x) + + The sine value of the angle + + + + + + Get the value of E ^ x; + + + + + + + + + + + Returns the value of ln(x). + + + + + calculate the value of x^y + + + + Returns the value of x^y + + + + returns a random float number between 0 and 1. + + + + + + + + + + + + Generates a random seed in int value. + + + + + + A class contains a sets of methods to serialize several types + + + + + An independent storage area, used as the only folder type in root folder. + Contains several files reference as virtual disc. + Data is actually stored in s in certain RAID mode. - A sensor used for cheking out if a bullet hit a player or something else + A sensor used for checking out if a bullet hit a player or something else @@ -162,47 +448,33 @@ 当几何体调用了过多的CalcVec方法时,产生UnusedVertexException异常 - + - Caculate the movement of a point. + The origin of this coordinate. - The game tick represent time passed by - A 3d vector representing movement - + - Move the third vertix. this is a useless method for Parallelograms. + The horizontial axis of the coordinate. + Point to the right direction. - Current time tick - - Geometry overdefined - + - Move the third vertix. This method is useless for Parallelograms. + The vertical axis of the coordinate. + Point to the top direction. - Current time tick - - Geometry overdefined - 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。 + Plain geometry only contains straight sides. - - - Update the coordinate of the point. If this is a moving point, - (Points on sides or surface if other geometry items) - please do not define any motion here, codes will be ignored by program - - Time passes since the program begin, counted by frames - - 计算中心点相对于参考原点的位移 + Calculate movement to center - 当前游戏刻 + Current time tick @@ -210,61 +482,1288 @@ A square - + - Add an item to the tail of linked list. + Run all nodes repeatedly until it is instructed to terminate. - The item ready to add to the list + Instructor to terminate all tasks. Returns if tasks should terminate - - - A two dimension vector defined by two elements. - Vec2Ds in StgSharp are defaultly usaed as colum vector. - - - - - Reurns the value of ArcSin(x) - - The sine value of the angle - - - - - - Get the value of E ^ x; - - - - - + - + + Reset pipeline has risk, this operation is a direct operation to port + in current node, the port on the other node cannot get the change. + + + + + Init this form and render it on screen, and respond with operation + + + + + Height of this form, represent in + + + + + Width of this form, represent in + + + + + Width of this form, represent in + + + + + Resize the current form + + + A (width,height) representing the new size of current form + + + + + Set the size limit of current form + + + Minimum size of current form. In form of a of (width,height) + + + Maximum size of current form. In form of a of (width,height) + + + + + Set the size limit of current form + + Minimum width of current form + Minimum height of current form + Maximum width of current form + Maximum height of current form + + + + A microsecond-accuracy timer. It will refresh every a certain time span. + + + + + Create a new and define the length of time span. Length of a single time span is defined in microseconds. + + + + + + + Create a new and define the length of time span. + Length of a single time span is defined in seconds. + + + + + + + Create a new and define the length of time span. Length of a single time span is defined in microseconds. + + + + + + + + Time source provider provided in internal framework. + + + + + The method this will call every time a new time span started. + + + + The COLORREF value is used to specify an RGB color. + + When specifying an explicit [RGB](/windows/desktop/api/Wingdi/nf-wingdi-rgb) color, the **COLORREF** value has the following hexadecimal form: `0x00bbggrr` The low-order byte contains a value for the relative intensity of red; the second byte contains a value for green; and the third byte contains a value for blue. The high-order byte must be zero. The maximum value for a single byte is 0xFF. To create a **COLORREF** color value, use the [RGB](/windows/desktop/api/Wingdi/nf-wingdi-rgb) macro. To extract the individual values for the red, green, and blue components of a color value, use the [**GetRValue**](/windows/desktop/api/Wingdi/nf-wingdi-getrvalue), [GetGValue](/windows/desktop/api/Wingdi/nf-wingdi-getgvalue), and [GetBValue](/windows/desktop/api/Wingdi/nf-wingdi-getbvalue) macros, respectively. + Read more on docs.microsoft.com. + + + + + A pointer to a null-terminated, constant, ANSI character string. + + + + + A pointer to the first character in the string. The content should be considered readonly, as it was typed as constant in the SDK. + + + + + Gets the number of characters up to the first null character (exclusive). + + + + + Returns a with a copy of this character array, decoding as UTF-8. + + A , or if is . + + + + Returns a span of the characters in this string, up to the first null character (exclusive). + + + + + A pointer to a null-terminated, constant character string. + + + + + A pointer to the first character in the string. The content should be considered readonly, as it was typed as constant in the SDK. + + + + + Gets the number of characters up to the first null character (exclusive). + + + + + Returns a with a copy of this character array, up to the first null character (exclusive). + + A , or if is . + + + + Returns a span of the characters in this string, up to the first null character (exclusive). + + + + The RECT structure defines a rectangle by the coordinates of its upper-left and lower-right corners. + The RECT structure is identical to the RECTL structure. + + + Specifies the x-coordinate of the upper-left corner of the rectangle. + + + Specifies the y-coordinate of the upper-left corner of the rectangle. + + + Specifies the x-coordinate of the lower-right corner of the rectangle. + + + Specifies the y-coordinate of the lower-right corner of the rectangle. + + + Contains message information from a thread's message queue. + + Learn more about this API from docs.microsoft.com. + + + + + Type: HWND A handle to the window whose window procedure receives the message. This member is NULL when the message is a thread message. + Read more on docs.microsoft.com. + + + + + Type: UINT The message identifier. Applications can only use the low word; the high word is reserved by the system. + Read more on docs.microsoft.com. + + + + + Type: WPARAM Additional information about the message. The exact meaning depends on the value of the message member. + Read more on docs.microsoft.com. + + + + + Type: LPARAM Additional information about the message. The exact meaning depends on the value of the message member. + Read more on docs.microsoft.com. + + + + + Type: DWORD The time at which the message was posted. + Read more on docs.microsoft.com. + + + + + Type: POINT The cursor position, in screen coordinates, when the message was posted. + Read more on docs.microsoft.com. + + + + Contains the window class attributes that are registered by the RegisterClass function. (ANSI) + + > [!NOTE] > The winuser.h header defines WNDCLASS as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see [Conventions for Function Prototypes](/windows/win32/intl/conventions-for-function-prototypes). + Read more on docs.microsoft.com. + + + + + Type: UINT The class style(s). This member can be any combination of the Class Styles. + Read more on docs.microsoft.com. + + + + + Type: WNDPROC A pointer to the window procedure. You must use the CallWindowProc function to call the window procedure. For more information, see WindowProc. + Read more on docs.microsoft.com. + + + + + Type: int The number of extra bytes to allocate following the window-class structure. The system initializes the bytes to zero. + Read more on docs.microsoft.com. + + + + + Type: int The number of extra bytes to allocate following the window instance. The system initializes the bytes to zero. If an application uses WNDCLASS to register a dialog box created by using the CLASS directive in the resource file, it must set this member to DLGWINDOWEXTRA. + Read more on docs.microsoft.com. + + + + + Type: HINSTANCE A handle to the instance that contains the window procedure for the class. + Read more on docs.microsoft.com. + + + + + Type: HICON A handle to the class icon. This member must be a handle to an icon resource. If this member is NULL, the system provides a default icon. + Read more on docs.microsoft.com. + + + + + Type: HCURSOR A handle to the class cursor. This member must be a handle to a cursor resource. If this member is NULL, an application must explicitly set the cursor shape whenever the mouse moves into the application's window. + Read more on docs.microsoft.com. + + + + + Type: HBRUSH A handle to the class background brush. This member can be a handle to the physical brush to be used for painting the background, or it can be a color value. A color value must be one of the following standard system colors (the value 1 must be added to the chosen color). If a color value is given, you must convert it to one of the following HBRUSH types: + + This doc was truncated. + Read more on docs.microsoft.com. + + + + + Type: LPCTSTR The resource name of the class menu, as the name appears in the resource file. If you use an integer to identify the menu, use the MAKEINTRESOURCE macro. If this member is NULL, windows belonging to this class have no default menu. + Read more on docs.microsoft.com. + + + + + Type: LPCTSTR A pointer to a null-terminated string or is an atom. If this parameter is an atom, it must be a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpszClassName; the high-order word must be zero. + If lpszClassName is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, or any of the predefined control-class names. The maximum length for lpszClassName is 256. If lpszClassName is greater than the maximum length, the RegisterClass function will fail. + Read more on docs.microsoft.com. + + + + Contains the window class attributes that are registered by the RegisterClass function. (Unicode) + + > [!NOTE] > The winuser.h header defines WNDCLASS as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see [Conventions for Function Prototypes](/windows/win32/intl/conventions-for-function-prototypes). + Read more on docs.microsoft.com. + + + + + Type: UINT The class style(s). This member can be any combination of the Class Styles. + Read more on docs.microsoft.com. + + + + + Type: WNDPROC A pointer to the window procedure. You must use the CallWindowProc function to call the window procedure. For more information, see WindowProc. + Read more on docs.microsoft.com. + + + + + Type: int The number of extra bytes to allocate following the window-class structure. The system initializes the bytes to zero. + Read more on docs.microsoft.com. + + + + + Type: int The number of extra bytes to allocate following the window instance. The system initializes the bytes to zero. If an application uses WNDCLASS to register a dialog box created by using the CLASS directive in the resource file, it must set this member to DLGWINDOWEXTRA. + Read more on docs.microsoft.com. + + + + + Type: HINSTANCE A handle to the instance that contains the window procedure for the class. + Read more on docs.microsoft.com. + + + + + Type: HICON A handle to the class icon. This member must be a handle to an icon resource. If this member is NULL, the system provides a default icon. + Read more on docs.microsoft.com. + + + + + Type: HCURSOR A handle to the class cursor. This member must be a handle to a cursor resource. If this member is NULL, an application must explicitly set the cursor shape whenever the mouse moves into the application's window. + Read more on docs.microsoft.com. + + + + + Type: HBRUSH A handle to the class background brush. This member can be a handle to the physical brush to be used for painting the background, or it can be a color value. A color value must be one of the following standard system colors (the value 1 must be added to the chosen color). If a color value is given, you must convert it to one of the following HBRUSH types: + + This doc was truncated. + Read more on docs.microsoft.com. + + + + + Type: LPCTSTR The resource name of the class menu, as the name appears in the resource file. If you use an integer to identify the menu, use the MAKEINTRESOURCE macro. If this member is NULL, windows belonging to this class have no default menu. + Read more on docs.microsoft.com. + + + + + Type: LPCTSTR A pointer to a null-terminated string or is an atom. If this parameter is an atom, it must be a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpszClassName; the high-order word must be zero. + If lpszClassName is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, or any of the predefined control-class names. The maximum length for lpszClassName is 256. If lpszClassName is greater than the maximum length, the RegisterClass function will fail. + Read more on docs.microsoft.com. + + + + + Represents a Win32 handle that can be closed with . + + + + + Represents a Win32 handle that can be closed with . + + + + The GLYPHMETRICSFLOAT structure contains information about the placement and orientation of a glyph in a character cell. + The values of GLYPHMETRICSFLOAT are specified as notional units. + + + Specifies the width of the smallest rectangle (the glyph's black box) that completely encloses the glyph. + + + Specifies the height of the smallest rectangle (the glyph's black box) that completely encloses the glyph. + + + Specifies the x and y coordinates of the upper-left corner of the smallest rectangle that completely encloses the glyph. + + + Specifies the horizontal distance from the origin of the current character cell to the origin of the next character cell. + + + Specifies the vertical distance from the origin of the current character cell to the origin of the next character cell. + + + The LAYERPLANEDESCRIPTOR structure describes the pixel format of a drawing surface. + Please notice, as documented above, that certain layer plane properties are not supported in the current implementation. The implementation is the Microsoft GDI software implementation of OpenGL. Hardware manufacturers that enhance parts of OpenGL may support some layer plane properties not supported by the generic implementation. + + + Specifies the size of this data structure. Set this value to sizeof(LAYERPLANEDESCRIPTOR). + + + Specifies the version of this data structure. Set this value to 1. + + + + A set of bit flags that specify properties of the layer plane. The properties are generally not mutually exclusive; any combination of bit flags can be set, with the exceptions noted. The following bit flag constants are defined. + This doc was truncated. + Read more on docs.microsoft.com. + + + + + Specifies the type of pixel data. The following types are defined. + This doc was truncated. + Read more on docs.microsoft.com. + + + + Specifies the number of color bitplanes in each color buffer. For RGBA pixel types, it is the size of the color buffer, excluding the alpha bitplanes. For color-index pixels, it is the size of the color-index buffer. + + + Specifies the number of red bitplanes in each RGBA color buffer. + + + Specifies the shift count for red bitplanes in each RGBA color buffer. + + + Specifies the number of green bitplanes in each RGBA color buffer. + + + Specifies the shift count for green bitplanes in each RGBA color buffer. + + + Specifies the number of blue bitplanes in each RGBA color buffer. + + + Specifies the shift count for blue bitplanes in each RGBA color buffer. + + + Specifies the number of alpha bitplanes in each RGBA color buffer. Alpha bitplanes are not supported. + + + Specifies the shift count for alpha bitplanes in each RGBA color buffer. Alpha bitplanes are not supported. + + + Specifies the total number of bitplanes in the accumulation buffer. + + + Specifies the number of red bitplanes in the accumulation buffer. + + + Specifies the number of green bitplanes in the accumulation buffer. + + + Specifies the number of blue bitplanes in the accumulation buffer. + + + Specifies the number of alpha bitplanes in the accumulation buffer. + + + Specifies the depth of the depth (z-axis) buffer. + + + Specifies the depth of the stencil buffer. + + + Specifies the number of auxiliary buffers. Auxiliary buffers are not supported. + + + + + + Not used. Must be zero. + + + When the LPD_TRANSPARENT flag is set, specifies the transparent color or index value. Typically the value is zero. + + + The PIXELFORMATDESCRIPTOR structure describes the pixel format of a drawing surface. + Please notice carefully, as documented above, that certain pixel format properties are not supported in the current generic implementation. The generic implementation is the Microsoft GDI software implementation of OpenGL. Hardware manufacturers may enhance parts of OpenGL, and may support some pixel format properties not supported by the generic implementation. + + + Specifies the size of this data structure. This value should be set to sizeof(PIXELFORMATDESCRIPTOR). + + + Specifies the version of this data structure. This value should be set to 1. + + + + A set of bit flags that specify properties of the pixel buffer. The properties are generally not mutually exclusive; you can set any combination of bit flags, with the exceptions noted. The following bit flag constants are defined. + This doc was truncated. + Read more on docs.microsoft.com. + + + + + Specifies the type of pixel data. The following types are defined. + This doc was truncated. + Read more on docs.microsoft.com. + + + + Specifies the number of color bitplanes in each color buffer. For RGBA pixel types, it is the size of the color buffer, excluding the alpha bitplanes. For color-index pixels, it is the size of the color-index buffer. + + + Specifies the number of red bitplanes in each RGBA color buffer. + + + Specifies the shift count for red bitplanes in each RGBA color buffer. + + + Specifies the number of green bitplanes in each RGBA color buffer. + + + Specifies the shift count for green bitplanes in each RGBA color buffer. + + + Specifies the number of blue bitplanes in each RGBA color buffer. + + + Specifies the shift count for blue bitplanes in each RGBA color buffer. + + + Specifies the number of alpha bitplanes in each RGBA color buffer. Alpha bitplanes are not supported. + + + Specifies the shift count for alpha bitplanes in each RGBA color buffer. Alpha bitplanes are not supported. + + + Specifies the total number of bitplanes in the accumulation buffer. + + + Specifies the number of red bitplanes in the accumulation buffer. + + + Specifies the number of green bitplanes in the accumulation buffer. + + + Specifies the number of blue bitplanes in the accumulation buffer. + + + Specifies the number of alpha bitplanes in the accumulation buffer. + + + Specifies the depth of the depth (z-axis) buffer. + + + Specifies the depth of the stencil buffer. + + + Specifies the number of auxiliary buffers. Auxiliary buffers are not supported. + + + Specifies the number of overlay and underlay planes. Bits 0 through 3 specify up to 15 overlay planes and bits 4 through 7 specify up to 15 underlay planes. + + + Ignored. Earlier implementations of OpenGL used this member, but it is no longer used. + + + Specifies the transparent color or index of an underlay plane. When the pixel type is RGBA, dwVisibleMask is a transparent RGB color value. When the pixel type is color index, it is a transparent index value. + + + Ignored. Earlier implementations of OpenGL used this member, but it is no longer used. + + + The POINTFLOAT structure contains the x and y coordinates of a point. + + Learn more about this API from docs.microsoft.com. + + + + Specifies the horizontal (x) coordinate of a point. + + + Specifies the vertical (y) coordinate of a point. + + + + Contains extern methods from "GDI32.dll". + + + Contains extern methods from "KERNEL32.dll". + + + Contains extern methods from "OPENGL32.dll". + + + Contains extern methods from "USER32.dll". + + + + The DeleteObject function deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object. After the object is deleted, the specified handle is no longer valid. + A handle to a logical pen, brush, font, bitmap, region, or palette. - Returns the value of ln(x). + If the function succeeds, the return value is nonzero. If the specified handle is not valid or is currently selected into a DC, the return value is zero. + + Do not delete a drawing object (pen or brush) while it is still selected into a DC. When a pattern brush is deleted, the bitmap associated with the brush is not deleted. The bitmap must be deleted independently. + Read more on docs.microsoft.com. + - - - calculate the value of x^y - - - - Returns the value of x^y + + - - - returns a random float number between 0 and 1. - - + + The ChoosePixelFormat function attempts to match an appropriate pixel format supported by a device context to a given pixel format specification. + Specifies the device context that the function examines to determine the best match for the pixel format descriptor pointed to by ppfd. + + Pointer to a PIXELFORMATDESCRIPTOR structure that specifies the requested pixel format. In this context, the members of the PIXELFORMATDESCRIPTOR structure that ppfd points to are used as follows: + This doc was truncated. + Read more on docs.microsoft.com. + + + If the function succeeds, the return value is a pixel format index (one-based) that is the closest match to the given pixel format descriptor. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + You must ensure that the pixel format matched by the ChoosePixelFormat function satisfies your requirements. For example, if you request a pixel format with a 24-bit RGB color buffer but the device context offers only 8-bit RGB color buffers, the function returns a pixel format with an 8-bit RGB color buffer. - + + The DescribePixelFormat function obtains information about the pixel format identified by iPixelFormat of the device associated with hdc. The function sets the members of the PIXELFORMATDESCRIPTOR structure pointed to by ppfd with that pixel format data. + Specifies the device context. + Index that specifies the pixel format. The pixel formats that a device context supports are identified by positive one-based integer indexes. + The size, in bytes, of the structure pointed to by ppfd. The DescribePixelFormat function stores no more than nBytes bytes of data to that structure. Set this value to sizeof(PIXELFORMATDESCRIPTOR). + Pointer to a PIXELFORMATDESCRIPTOR structure whose members the function sets with pixel format data. The function stores the number of bytes copied to the structure in the structure's nSize member. If, upon entry, ppfd is NULL, the function writes no data to the structure. This is useful when you only want to obtain the maximum pixel format index of a device context. + + If the function succeeds, the return value is the maximum pixel format index of the device context. In addition, the function sets the members of the PIXELFORMATDESCRIPTOR structure pointed to by ppfd according to the specified pixel format. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + Learn more about this API from docs.microsoft.com. + + + + The DeleteEnhMetaFile function deletes an enhanced-format metafile or an enhanced-format metafile handle. + A handle to an enhanced metafile. + + If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. + + If the hemf parameter identifies an enhanced metafile stored in memory, the DeleteEnhMetaFile function deletes the metafile. If hemf identifies a metafile stored on a disk, the function deletes the metafile handle but does not destroy the actual metafile. An application can retrieve the file by calling the GetEnhMetaFile function. + + + + + + The GetEnhMetaFilePixelFormat function retrieves pixel format information for an enhanced metafile. + Identifies the enhanced metafile. + Specifies the size, in bytes, of the buffer into which the pixel format information is copied. + Pointer to a PIXELFORMATDESCRIPTOR structure that contains the logical pixel format specification. The metafile uses this structure to record the logical pixel format specification. + + If the function succeeds and finds a pixel format, the return value is the size of the metafile's pixel format. If no pixel format is present, the return value is zero. If an error occurs and the function fails, the return value is GDI_ERROR. To get extended error information, call GetLastError. + + + When an enhanced metafile specifies a pixel format in its ENHMETAHEADER structure and the pixel format fits in the buffer, the pixel format information is copied into ppfd. When cbBuffer is too small to contain the pixel format of the metafile, the pixel format is not copied to the buffer. In either case, the function returns the size of the metafile's pixel format. For information on metafile recording and other operations, see Enhanced Metafile Operations. + Read more on docs.microsoft.com. + + + + The GetPixelFormat function obtains the index of the currently selected pixel format of the specified device context. + Specifies the device context of the currently selected pixel format index returned by the function. + + If the function succeeds, the return value is the currently selected pixel format index of the specified device context. This is a positive, one-based index value. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + Learn more about this API from docs.microsoft.com. + + + + + + + The SetPixelFormat function sets the pixel format of the specified device context to the format specified by the iPixelFormat index. + Specifies the device context whose pixel format the function attempts to set. + Index that identifies the pixel format to set. The various pixel formats supported by a device context are identified by one-based indexes. + Pointer to a PIXELFORMATDESCRIPTOR structure that contains the logical pixel format specification. The system's metafile component uses this structure to record the logical pixel format specification. The structure has no other effect upon the behavior of the SetPixelFormat function. + + If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. + + + If hdc references a window, calling the SetPixelFormat function also changes the pixel format of the window. Setting the pixel format of a window more than once can lead to significant complications for the Window Manager and for multithread applications, so it is not allowed. An application can only set the pixel format of a window one time. Once a window's pixel format is set, it cannot be changed. You should select a pixel format in the device context before calling the wglCreateContext function. The wglCreateContext function creates a rendering context for drawing on the device in the selected pixel format of the device context. An OpenGL window has its own pixel format. Because of this, only device contexts retrieved for the client area of an OpenGL window are allowed to draw into the window. As a result, an OpenGL window should be created with the WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles. Additionally, the window class attribute should not include the CS_PARENTDC style. + Read more on docs.microsoft.com. + + + + The SwapBuffers function exchanges the front and back buffers if the current pixel format for the window referenced by the specified device context includes a back buffer. + + If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. + + + If the current pixel format for the window referenced by the device context does not include a back buffer, this call has no effect and the content of the back buffer is undefined when the function returns. With multithread applications, flush the drawing commands in any other threads drawing to the same window before calling SwapBuffers. + Read more on docs.microsoft.com. + + + + Closes an open object handle. + A valid handle to an open object. + + If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. If the application is running under a debugger, the function will throw an exception if it receives either a handle value that is not valid or a pseudo-handle value. This can happen if you close a handle twice, or if you call CloseHandle on a handle returned by the FindFirstFile function instead of calling the FindClose function. + + + The CloseHandle function closes handles to the following objects: + This doc was truncated. + Read more on docs.microsoft.com. + + + + Frees the loaded dynamic-link library (DLL) module and, if necessary, decrements its reference count. + + A handle to the loaded library module. The LoadLibrary, LoadLibraryEx, GetModuleHandle, or GetModuleHandleEx function returns this handle. + Read more on docs.microsoft.com. + + + If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call the GetLastError function. + + + The system maintains a per-process reference count for each loaded module. A module that was loaded at process initialization due to load-time dynamic linking has a reference count of one. The reference count for a module is incremented each time the module is loaded by a call to LoadLibrary. The reference count is also incremented by a call to LoadLibraryEx unless the module is being loaded for the first time and is being loaded as a data or image file. The reference count is decremented each time the FreeLibrary or FreeLibraryAndExitThread function is called for the module. When a module's reference count reaches zero or the process terminates, the system unloads the module from the address space of the process. Before unloading a library module, the system enables the module to detach from the process by calling the module's DllMain function, if it has one, with the DLL_PROCESS_DETACH value. Doing so gives the library module an opportunity to clean up resources allocated on behalf of the current process. After the entry-point function returns, the library module is removed from the address space of the current process. It is not safe to call FreeLibrary from DllMain. For more information, see the Remarks section in DllMain. Calling FreeLibrary does not affect other processes that are using the same module. Use caution when calling FreeLibrary with a handle returned by GetModuleHandle. The GetModuleHandle function does not increment a module's reference count, so passing this handle to FreeLibrary can cause a module to be unloaded prematurely. A thread that must unload the DLL in which it is executing and then terminate itself should call FreeLibraryAndExitThread instead of calling FreeLibrary and ExitThread separately. Otherwise, a race condition can occur. For details, see the Remarks section of FreeLibraryAndExitThread. + Read more on docs.microsoft.com. + + + + + + + Retrieves a module handle for the specified module. The module must have been loaded by the calling process. (Unicode) + + The name of the loaded module (either a .dll or .exe file). If the file name extension is omitted, the default library extension .dll is appended. The file name string can include a trailing point character (.) to indicate that the module name has no extension. The string does not have to specify a path. When specifying a path, be sure to use backslashes (\\), not forward slashes (/). The name is compared (case independently) to the names of modules currently mapped into the address space of the calling process. + If this parameter is NULL, GetModuleHandle returns a handle to the file used to create the calling process (.exe file). The GetModuleHandle function does not retrieve handles for modules that were loaded using the LOAD_LIBRARY_AS_DATAFILE flag. For more information, see LoadLibraryEx. + Read more on docs.microsoft.com. + + + If the function succeeds, the return value is a handle to the specified module. If the function fails, the return value is NULL. To get extended error information, call GetLastError. + + + The returned handle is not global or inheritable. It cannot be duplicated or used by another process. If lpModuleName does not include a path and there is more than one loaded module with the same base name and extension, you cannot predict which module handle will be returned. To work around this problem, you could specify a path, use side-by-side assemblies, or use GetModuleHandleEx to specify a memory location rather than a DLL name. The GetModuleHandle function returns a handle to a mapped module without incrementing its reference count. However, if this handle is passed to the FreeLibrary function, the reference count of the mapped module will be decremented. Therefore, do not pass a handle returned by GetModuleHandle to the FreeLibrary function. Doing so can cause a DLL module to be unmapped prematurely. This function must be used carefully in a multithreaded application. There is no guarantee that the module handle remains valid between the time this function returns the handle and the time it is used. For example, suppose that a thread retrieves a module handle, but before it uses the handle, a second thread frees the module. If the system loads another module, it could reuse the module handle that was recently freed. Therefore, the first thread would have a handle to a different module than the one intended. + Read more on docs.microsoft.com. + + + + + + + Retrieves the address of an exported function or variable from the specified dynamic-link library (DLL). + + A handle to the DLL module that contains the function or variable. The LoadLibrary, LoadLibraryEx, LoadPackagedLibrary, or GetModuleHandle function returns this handle. The GetProcAddress function does not retrieve addresses from modules that were loaded using the LOAD_LIBRARY_AS_DATAFILE flag. For more information, see LoadLibraryEx. + Read more on docs.microsoft.com. + + The function or variable name, or the function's ordinal value. If this parameter is an ordinal value, it must be in the low-order word; the high-order word must be zero. + + If the function succeeds, the return value is the address of the exported function or variable. If the function fails, the return value is NULL. To get extended error information, call GetLastError. + + + The spelling and case of a function name pointed to by lpProcName must be identical to that in the EXPORTS statement of the source DLL's module-definition (.def) file. The exported names of functions may differ from the names you use when calling these functions in your code. This difference is hidden by macros used in the SDK header files. For more information, see Conventions for Function Prototypes. The lpProcName parameter can identify the DLL function by specifying an ordinal value associated with the function in the EXPORTS statement. GetProcAddress verifies that the specified ordinal is in the range 1 through the highest ordinal value exported in the .def file. The function then uses the ordinal as an index to read the function's address from a function table. If the .def file does not number the functions consecutively from 1 to N (where N is the number of exported functions), an error can occur where GetProcAddress returns an invalid, non-NULL address, even though there is no function with the specified ordinal. If the function might not exist in the DLL module—for example, if the function is available only on Windows Vista but the application might be running on Windows XP—specify the function by name rather than by ordinal value and design your application to handle the case when the function is not available, as shown in the following code fragment. + + This doc was truncated. + Read more on docs.microsoft.com. + + + + + + + Loads the specified module into the address space of the calling process. (LoadLibraryW) + + The name of the module. This can be either a library module (a .dll file) or an executable module (an .exe file). If the specified module is an executable module, static imports are not loaded; instead, the module is loaded as if by LoadLibraryEx with the `DONT_RESOLVE_DLL_REFERENCES` flag. The name specified is the file name of the module and is not related to the name stored in the library module itself, as specified by the LIBRARY keyword in the module-definition (.def) file. If the string specifies a full path, the function searches only that path for the module. If the string specifies a relative path or a module name without a path, the function uses a standard search strategy to find the module; for more information, see the Remarks. If the function cannot find the module, the function fails. When specifying a path, be sure to use backslashes (\\), not forward slashes (/). For more information about paths, see Naming a File or Directory. If the string specifies a module name without a path and the file name extension is omitted, the function appends the default library extension ".DLL" to the module name. To prevent the function from appending ".DLL" to the module name, include a trailing point character (.) in the module name string. + Read more on docs.microsoft.com. + + + If the function succeeds, the return value is a handle to the module. If the function fails, the return value is NULL. To get extended error information, call GetLastError. + + + To enable or disable error messages displayed by the loader during DLL loads, use the SetErrorMode function. LoadLibrary can be used to load a library module into the address space of the process and return a handle that can be used in GetProcAddress to get the address of a DLL function. LoadLibrary can also be used to load other executable modules. For example, the function can specify an .exe file to get a handle that can be used in FindResource or LoadResource. However, do not use LoadLibrary to run an .exe file. Instead, use the CreateProcess function. If the specified module is a DLL that is not already loaded for the calling process, the system calls the DLL's DllMain function with the DLL_PROCESS_ATTACH value. If DllMain returns TRUE, LoadLibrary returns a handle to the module. If DllMain returns FALSE, the system unloads the DLL from the process address space and LoadLibrary returns NULL. It is not safe to call LoadLibrary from DllMain. For more information, see the Remarks section in DllMain. Module handles are not global or inheritable. A call to LoadLibrary by one process does not produce a handle that another process can use — for example, in calling GetProcAddress. The other process must make its own call to LoadLibrary for the module before calling GetProcAddress. If lpFileName does not include a path and there is more than one loaded module with the same base name and extension, the function returns a handle to the module that was loaded first. If no file name extension is specified in the lpFileName parameter, the default library extension .dll is appended. However, the file name string can include a trailing point character (.) to indicate that the module name has no extension. When no path is specified, the function searches for loaded modules whose base name matches the base name of the module to be loaded. If the name matches, the load succeeds. Otherwise, the function searches for the file. The first directory searched is the directory containing the image file used to create the calling process (for more information, see the CreateProcess function). Doing this allows private dynamic-link library (DLL) files associated with a process to be found without adding the process's installed directory to the PATH environment variable. If a relative path is specified, the entire relative path is appended to every token in the DLL search path list. To load a module from a relative path without searching any other path, use GetFullPathName to get a nonrelative path and call LoadLibrary with the nonrelative path. For more information on the DLL search order, see Dynamic-Link Library Search Order. The search path can be altered using the SetDllDirectory function. This solution is recommended instead of using SetCurrentDirectory or hard-coding the full path to the DLL. If a path is specified and there is a redirection file for the application, the function searches for the module in the application's directory. If the module exists in the application's directory, LoadLibrary ignores the specified path and loads the module from the application's directory. If the module does not exist in the application's directory, LoadLibrary loads the module from the specified directory. For more information, see Dynamic Link Library Redirection. If you call LoadLibrary with the name of an assembly without a path specification and the assembly is listed in the system compatible manifest, the call is automatically redirected to the side-by-side assembly. The system maintains a per-process reference count on all loaded modules. Calling LoadLibrary increments the reference count. Calling the FreeLibrary or FreeLibraryAndExitThread function decrements the reference count. The system unloads a module when its reference count reaches zero or when the process terminates (regardless of the reference count). Windows Server 2003 and Windows XP:  The Visual C++ compiler supports a syntax that enables you to declare thread-local variables: _declspec(thread). If you use this syntax in a DLL, you will not be able to load the DLL explicitly using LoadLibrary on versions of Windows prior to Windows Vista. If your DLL will be loaded explicitly, you must use the thread local storage functions instead of _declspec(thread). For an example, see Using Thread Local Storage in a Dynamic Link Library.

Security Remarks

Do not use the SearchPath function to retrieve a path to a DLL for a subsequent LoadLibrary call. The SearchPath function uses a different search order than LoadLibrary and it does not use safe process search mode unless this is explicitly enabled by calling SetSearchPathMode with BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE. Therefore, SearchPath is likely to first search the user’s current working directory for the specified DLL. If an attacker has copied a malicious version of a DLL into the current working directory, the path retrieved by SearchPath will point to the malicious DLL, which LoadLibrary will then load. Do not make assumptions about the operating system version based on a LoadLibrary call that searches for a DLL. If the application is running in an environment where the DLL is legitimately not present but a malicious version of the DLL is in the search path, the malicious version of the DLL may be loaded. Instead, use the recommended techniques described in Getting the System Version.
+ Read more on docs.microsoft.com. +
+
+ + + + + The wglGetProcAddress function returns the address of an OpenGL extension function for use with the current OpenGL rendering context. + + When the function succeeds, the return value is the address of the extension function. When no current rendering context exists or the function fails, the return value is NULL. To get extended error information, call GetLastError. + + + The OpenGL library supports multiple implementations of its functions. Extension functions supported in one rendering context are not necessarily available in a separate rendering context. Thus, for a given rendering context in an application, use the function addresses returned by the wglGetProcAddress function only. The spelling and the case of the extension function pointed to by lpszProc must be identical to that of a function supported and implemented by OpenGL. Because extension functions are not exported by OpenGL, you must use wglGetProcAddress to get the addresses of vendor-specific extension functions. The extension function addresses are unique for each pixel format. All rendering contexts of a given pixel format share the same extension function addresses. + Read more on docs.microsoft.com. + + + + The wglDeleteContext function deletes a specified OpenGL rendering context. + + If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. + + + It is an error to delete an OpenGL rendering context that is the current context of another thread. However, if a rendering context is the calling thread's current context, the wglDeleteContext function changes the rendering context to being not current before deleting it. The wglDeleteContext function does not delete the device context associated with the OpenGL rendering context when you call the wglMakeCurrent function. After calling wglDeleteContext, you must call DeleteDC to delete the associated device context. + Read more on docs.microsoft.com. + + + + + + + The wglCreateContext function creates a new OpenGL rendering context, which is suitable for drawing on the device referenced by hdc. The rendering context has the same pixel format as the device context. + + If the function succeeds, the return value is a valid handle to an OpenGL rendering context. If the function fails, the return value is NULL. To get extended error information, call GetLastError. + + + A rendering context is not the same as a device context. Set the pixel format of the device context before creating a rendering context. For more information on setting the device context's pixel format, see the SetPixelFormat function. To use OpenGL, you create a rendering context, select it as a thread's current rendering context, and then call OpenGL functions. When you are finished with the rendering context, you dispose of it by calling the wglDeleteContext function. The following code example shows wglCreateContext usage. + + This doc was truncated. + Read more on docs.microsoft.com. + + + + + + + The wglCreateLayerContext function creates a new OpenGL rendering context for drawing to a specified layer plane on a device context. + + If the function succeeds, the return value is a handle to an OpenGL rendering context. If the function fails, the return value is NULL. To get extended error information, call GetLastError. + + + A rendering context is a port through which all OpenGL commands pass. Every thread that makes OpenGL calls must have one current, active rendering context. A rendering context is not the same as a device context; a rendering context contains information specific to OpenGL, while a device context contains information specific to GDI. Before you create a rendering context, set the pixel format of the device context with the SetPixelFormat function. You can use a rendering context in a specified layer plane of a window with identical pixel formats only. With OpenGL applications that use multiple threads, you create a rendering context, select it as the current rendering context of a thread, and make OpenGL calls for the specified thread. When you are finished with the rendering context of the thread, call the wglDeleteContext function. + Read more on docs.microsoft.com. + + + + + + + The wglCopyContext function copies selected groups of rendering states from one OpenGL rendering context to another. + If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. + + Using the wglCopyContext function, you can synchronize the rendering state of two rendering contexts. You can only copy the rendering state between two rendering contexts within the same process. The rendering contexts must be from the same OpenGL implementation. For example, you can always copy a rendering state between two rendering contexts with identical pixel format in the same process. You can copy the same state information available only with the glPushAttrib function. You cannot copy some state information, such as pixel pack/unpack state, render mode state, select state, and feedback state. When you call wglCopyContext, make sure that the destination rendering context, hglrcDst, is not current to any thread. + Read more on docs.microsoft.com. + + + + + + + The wglDescribeLayerPlane function obtains information about the layer planes of a given pixel format. + + If the function succeeds, the return value is TRUE. In addition, the wglDescribeLayerPlane function sets the members of the LAYERPLANEDESCRIPTOR structure pointed to by plpd according to the specified layer plane (iLayerPlane ) of the specified pixel format (iPixelFormat ). If the function fails, the return value is FALSE. + + The numbering of planes (iLayerPlane ) determines their order. Higher-numbered planes overlay lower-numbered planes. + + + + + + The wglGetCurrentContext function obtains a handle to the current OpenGL rendering context of the calling thread. + If the calling thread has a current OpenGL rendering context, wglGetCurrentContext returns a handle to that rendering context. Otherwise, the return value is NULL. + The current OpenGL rendering context of a thread is associated with a device context by means of the wglMakeCurrent function. You can use the wglGetCurrentDC function to obtain a handle to the device context associated with the current OpenGL rendering context. + + + The wglGetCurrentDC function obtains a handle to the device context that is associated with the current OpenGL rendering context of the calling thread. + If the calling thread has a current OpenGL rendering context, the function returns a handle to the device context associated with that rendering context by means of the wglMakeCurrent function. Otherwise, the return value is NULL. + You associate a device context with an OpenGL rendering context when it calls the wglMakeCurrent function. You can use the wglGetCurrentContext function to obtain a handle to the calling thread's current OpenGL rendering context. + + + + + + Retrieves the palette entries from a given color-index layer plane for a specified device context. + + Type: int If the function succeeds, the return value is the number of entries that were set in the palette in the specified layer plane of the window. If the function fails or when no pixel format is selected, the return value is zero. To get extended error information, call GetLastError. + + + Each color-index layer plane in a window has a palette with a size 2^n, where n is the number of bit planes in the layer plane. You cannot modify the transparent index of a palette. Use the wglRealizeLayerPalette function to realize the layer palette. Initially the layer palette contains only entries for white. + Read more on docs.microsoft.com. + + + + + + + The wglMakeCurrent function makes a specified OpenGL rendering context the calling thread's current rendering context. + When the wglMakeCurrent function succeeds, the return value is TRUE; otherwise the return value is FALSE. To get extended error information, call GetLastError. + + The hdc parameter must refer to a drawing surface supported by OpenGL. It need not be the same hdc that was passed to wglCreateContext when hglrc was created, but it must be on the same device and have the same pixel format. GDI transformation and clipping in hdc are not supported by the rendering context. The current rendering context uses the hdc device context until the rendering context is no longer current. Before switching to the new rendering context, OpenGL flushes any previous rendering context that was current to the calling thread. A thread can have one current rendering context. A process can have multiple rendering contexts by means of multithreading. A thread must set a current rendering context before calling any OpenGL functions. Otherwise, all OpenGL calls are ignored. A rendering context can be current to only one thread at a time. You cannot make a rendering context current to multiple threads. An application can perform multithread drawing by making different rendering contexts current to different threads, supplying each thread with its own rendering context and device context. If an error occurs, the wglMakeCurrent function makes the thread's current rendering context not current before returning. + Read more on docs.microsoft.com. + + + + The wglRealizeLayerPalette function maps palette entries from a given color-index layer plane into the physical palette or initializes the palette of an RGBA layer plane. + If the function succeeds, the return value is TRUE, even if bRealize is TRUE and the physical palette is not available. If the function fails or when no pixel format is selected, the return value is FALSE. To get extended error information, call GetLastError. + + The physical palette for a layer plane is a shared resource among windows with layer planes. When more than one window attempts to realize a palette for a given physical layer plane, only one palette at a time is realized. When you call the wglRealizeLayerPalette function, the layer palette of a foreground window is always realized first. When a window's layer palette is realized, its palette entries are always mapped one-to-one into the physical palette. Unlike GDI logical palettes, with wglRealizeLayerPalette there is no mapping of other windows' layer palettes to the current physical palette. Whenever a window becomes the foreground window, call wglRealizeLayerPalette to realize its layer palettes again, even if the pixel type of the layer plane is RGBA. Because wglRealizeLayerPalette doesn't realize the palette of the main plane, use GDI palette functions to realize the main plane palette. + Read more on docs.microsoft.com. + + + + + + + Sets the palette entries in a given color-index layer plane for a specified device context. + + Type: int If the function succeeds, the return value is the number of entries that were set in the palette in the specified layer plane of the window. If the function fails or no pixel format is selected, the return value is zero. To get extended error information, call GetLastError. + + + Each color-index plane in a window has a palette with a size 2^n, where n is the number of bit planes in the layer plane. You cannot modify the transparent index of a palette. Use the wglRealizeLayerPalette function to realize the layer palette. Initially the layer palette contains only entries for white. The wglSetLayerPaletteEntries function doesn't set the palette entries of the main plane palette. To update the main plane palette, use GDI palette functions. + Read more on docs.microsoft.com. + + + + + + + The wglShareLists function enables multiple OpenGL rendering contexts to share a single display-list space. + + When the function succeeds, the return value is TRUE. When the function fails, the return value is FALSE and the display lists are not shared. To get extended error information, call GetLastError. + + + When you create an OpenGL rendering context, it has its own display-list space. The wglShareLists function enables a rendering context to share the display-list space of another rendering context; any number of rendering contexts can share a single display-list space. Once a rendering context shares a display-list space, the rendering context always uses the display-list space until the rendering context is deleted. When the last rendering context of a shared display-list space is deleted, the shared display-list space is deleted. All the indexes and definitions of display lists in a shared display-list space are shared. You can only share display lists with rendering contexts within the same process. However, not all rendering contexts in a process can share display lists. Rendering contexts can share display lists only if they use the same implementation of OpenGL functions. All client rendering contexts of a given pixel format can always share display lists. All rendering contexts of a shared display list must use an identical pixel format. Otherwise the results depend on the implementation of OpenGL used.
Note  The wglShareLists function is only available with OpenGL version 1.01 or later. To determine the version number of the implementation of OpenGL, call glGetString.
 
+ Read more on docs.microsoft.com. +
+
+ + The wglSwapLayerBuffers function swaps the front and back buffers in the overlay, underlay, and main planes of the window referenced by a specified device context. + If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. + + When a layer plane doesn't include a back buffer, calling the wglSwapLayerBuffers function has no effect on that layer plane. After you call wglSwapLayerBuffers, the state of the back buffer content is given in the corresponding LAYERPLANEDESCRIPTOR structure of the layer plane or in the PIXELFORMATDESCRIPTOR structure of the main plane. The wglSwapLayerBuffers function swaps the front and back buffers in the specified layer planes simultaneously. Some devices don't support swapping layer planes individually; they swap all layer planes as a group. When the PFD_SWAP_LAYER_BUFFERS flag of the PIXELFORMATDESCRIPTOR structure is set, it indicates that a device can swap individual layer planes and that you can call wglSwapLayerBuffers. With applications that use multiple threads, before calling wglSwapLayerBuffers, clear all drawing commands in all threads drawing to the same window. + Read more on docs.microsoft.com. + + + + The wglUseFontBitmaps function creates a set of bitmap display lists for use in the current OpenGL rendering context. (Unicode) + + If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError. + + + The wglUseFontBitmaps function defines count display lists in the current OpenGL rendering context. Each display list has an identifying number, starting at listBase. Each display list consists of a single call to glBitmap. The definition of bitmap listBase + i is taken from the glyph first + i of the font currently selected in the device context specified by hdc. If a glyph is not defined, then the function defines an empty display list for it. The wglUseFontBitmaps function creates bitmap text in the plane of the screen. It enables the labeling of objects in OpenGL. In the current version of Microsoft's implementation of OpenGL, you cannot make GDI calls to a device context that has a double-buffered pixel format. Therefore, you cannot use the GDI fonts and text functions with such device contexts. You can use the wglUseFontBitmaps function to circumvent this limitation and draw text in a double-buffered device context. The function determines the parameters of each call to glBitmap as follows. + This doc was truncated. + Read more on docs.microsoft.com. + + + + + + + The wglUseFontOutlines function creates a set of display lists, one for each glyph of the currently selected outline font of a device context, for use with the current rendering context. (Unicode) + + When the function succeeds, the return value is TRUE. When the function fails, the return value is FALSE and no display lists are generated. To get extended error information, call GetLastError. + + + The wglUseFontOutlines function defines the glyphs of an outline font with display lists in the current rendering context. The wglUseFontOutlines function works with TrueType fonts only; stroke and raster fonts are not supported. Each display list consists of either line segments or polygons, and has a unique identifying number starting with the listBase number. The wglUseFontOutlines function approximates glyph outlines by subdividing the quadratic B-spline curves of the outline into line segments, until the distance between the outline and the interpolated midpoint is within the value specified by deviation. This is the final format used when format is WGL_FONT_LINES. When you specify WGL_FONT_OUTLINES, the display lists created don't contain any normals; thus lighting doesn't work properly. To get the correct lighting of lines use WGL_FONT_POLYGONS and set glPolygonMode( GL_FRONT, GL_LINE ). When you specify format as WGL_FONT_POLYGONS the outlines are further tessellated into separate triangles, triangle fans, triangle strips, or quadrilateral strips to create the surface of each glyph. With WGL_FONT_POLYGONS, the created display lists call glFrontFace( GL_CW ) or glFrontFace( GL_CCW ); thus the current front-face value might be altered. For the best appearance of text with WGL_FONT_POLYGONS, cull the back faces as follows: + + This doc was truncated. + Read more on docs.microsoft.com. + + + + Destroys an icon and frees any memory the icon occupied. + + Type: HICON A handle to the icon to be destroyed. The icon must not be in use. + Read more on docs.microsoft.com. + + + Type: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + It is only necessary to call DestroyIcon for icons and cursors created with the following functions: CreateIconFromResourceEx (if called without the LR_SHARED flag), CreateIconIndirect, and CopyIcon. Do not use this function to destroy a shared icon. A shared icon is valid as long as the module from which it was loaded remains in memory. The following functions obtain a shared icon. + This doc was truncated. + Read more on docs.microsoft.com. + + + + Destroys a cursor and frees any memory the cursor occupied. Do not use this function to destroy a shared cursor. + + Type: HCURSOR A handle to the cursor to be destroyed. The cursor must not be in use. + Read more on docs.microsoft.com. + + + Type: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + The DestroyCursor function destroys a nonshared cursor. Do not use this function to destroy a shared cursor. A shared cursor is valid as long as the module from which it was loaded remains in memory. The following functions obtain a shared cursor: + This doc was truncated. + Read more on docs.microsoft.com. + + + + + + + Calculates the required size of the window rectangle, based on the desired client-rectangle size. The window rectangle can then be passed to the CreateWindow function to create a window whose client area is the desired size. + + Type: LPRECT A pointer to a RECT structure that contains the coordinates of the top-left and bottom-right corners of the desired client area. When the function returns, the structure contains the coordinates of the top-left and bottom-right corners of the window to accommodate the desired client area. + Read more on docs.microsoft.com. + + + Type: DWORD The window style of the window whose required size is to be calculated. Note that you cannot specify the WS_OVERLAPPED style. + Read more on docs.microsoft.com. + + + Type: BOOL Indicates whether the window has a menu. + Read more on docs.microsoft.com. + + + Type: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + A client rectangle is the smallest rectangle that completely encloses a client area. A window rectangle is the smallest rectangle that completely encloses the window, which includes the client area and the nonclient area. The AdjustWindowRect function does not add extra space when a menu bar wraps to two or more rows. The AdjustWindowRect function does not take the WS_VSCROLL or WS_HSCROLL styles into account. To account for the scroll bars, call the GetSystemMetrics function with SM_CXVSCROLL or SM_CYHSCROLL. + Read more on docs.microsoft.com. + + + + Destroys the specified menu and frees any memory that the menu occupies. + + Type: HMENU A handle to the menu to be destroyed. + Read more on docs.microsoft.com. + + + Type: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + Before closing, an application must use the DestroyMenu function to destroy a menu not assigned to a window. A menu that is assigned to a window is automatically destroyed when the application closes. DestroyMenu is recursive, that is, it will destroy the menu and all its submenus. + Read more on docs.microsoft.com. + + + + + + + Creates an overlapped, pop-up, or child window with an extended window style; otherwise, this function is identical to the CreateWindow function. (Unicode) + + Type: DWORD The extended window style of the window being created. For a list of possible values, see Extended Window Styles. + Read more on docs.microsoft.com. + + + Type: LPCTSTR A null-terminated string or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero. If lpClassName is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, provided that the module that registers the class is also the module that creates the window. The class name can also be any of the predefined system class names. + Read more on docs.microsoft.com. + + + Type: LPCTSTR The window name. If the window style specifies a title bar, the window title pointed to by lpWindowName is displayed in the title bar. When using CreateWindow to create controls, such as buttons, check boxes, and static controls, use lpWindowName to specify the text of the control. When creating a static control with the SS_ICON style, use lpWindowName to specify the icon name or identifier. To specify an identifier, use the syntax "#num". + Read more on docs.microsoft.com. + + + Type: DWORD The style of the window being created. This parameter can be a combination of the window style values, plus the control styles indicated in the Remarks section. + Read more on docs.microsoft.com. + + + Type: int The initial horizontal position of the window. For an overlapped or pop-up window, the x parameter is the initial x-coordinate of the window's upper-left corner, in screen coordinates. For a child window, x is the x-coordinate of the upper-left corner of the window relative to the upper-left corner of the parent window's client area. If x is set to CW_USEDEFAULT, the system selects the default position for the window's upper-left corner and ignores the y parameter. CW_USEDEFAULT is valid only for overlapped windows; if it is specified for a pop-up or child window, the x and y parameters are set to zero. + Read more on docs.microsoft.com. + + + Type: int The initial vertical position of the window. For an overlapped or pop-up window, the y parameter is the initial y-coordinate of the window's upper-left corner, in screen coordinates. For a child window, y is the initial y-coordinate of the upper-left corner of the child window relative to the upper-left corner of the parent window's client area. For a list box y is the initial y-coordinate of the upper-left corner of the list box's client area relative to the upper-left corner of the parent window's client area. + If an overlapped window is created with the WS_VISIBLE style bit set and the x parameter is set to CW_USEDEFAULT, then the y parameter determines how the window is shown. If the y parameter is CW_USEDEFAULT, then the window manager calls ShowWindow with the SW_SHOW flag after the window has been created. If the y parameter is some other value, then the window manager calls ShowWindow with that value as the nCmdShow parameter. + Read more on docs.microsoft.com. + + + Type: int The width, in device units, of the window. For overlapped windows, nWidth is the window's width, in screen coordinates, or CW_USEDEFAULT. If nWidth is CW_USEDEFAULT, the system selects a default width and height for the window; the default width extends from the initial x-coordinates to the right edge of the screen; the default height extends from the initial y-coordinate to the top of the icon area. CW_USEDEFAULT is valid only for overlapped windows; if CW_USEDEFAULT is specified for a pop-up or child window, the nWidth and nHeight parameter are set to zero. + Read more on docs.microsoft.com. + + + Type: int The height, in device units, of the window. For overlapped windows, nHeight is the window's height, in screen coordinates. If the nWidth parameter is set to CW_USEDEFAULT, the system ignores nHeight. + Read more on docs.microsoft.com. + + + Type: HWND A handle to the parent or owner window of the window being created. To create a child window or an owned window, supply a valid window handle. This parameter is optional for pop-up windows. To create a message-only window, supply HWND_MESSAGE or a handle to an existing message-only window. + Read more on docs.microsoft.com. + + + Type: HMENU A handle to a menu, or specifies a child-window identifier, depending on the window style. For an overlapped or pop-up window, hMenu identifies the menu to be used with the window; it can be NULL if the class menu is to be used. For a child window, hMenu specifies the child-window identifier, an integer value used by a dialog box control to notify its parent about events. The application determines the child-window identifier; it must be unique for all child windows with the same parent window. + Read more on docs.microsoft.com. + + + Type: HINSTANCE A handle to the instance of the module to be associated with the window. + Read more on docs.microsoft.com. + + + Type: LPVOID Pointer to a value to be passed to the window through the CREATESTRUCT structure (lpCreateParams member) pointed to by the lParam param of the WM_CREATE message. This message is sent to the created window by this function before it returns. If an application calls CreateWindow to create a MDI client window, lpParam should point to a CLIENTCREATESTRUCT structure. If an MDI client window calls CreateWindow to create an MDI child window, lpParam should point to a MDICREATESTRUCT structure. lpParam may be NULL if no additional data is needed. + Read more on docs.microsoft.com. + + + Type: HWND If the function succeeds, the return value is a handle to the new window. If the function fails, the return value is NULL. To get extended error information, call GetLastError. This function typically fails for one of the following reasons: + This doc was truncated. + + + The CreateWindowEx function sends WM_NCCREATE, WM_NCCALCSIZE, and WM_CREATE messages to the window being created. If the created window is a child window, its default position is at the bottom of the Z-order. If the created window is a top-level window, its default position is at the top of the Z-order (but beneath all topmost windows unless the created window is itself topmost). For information on controlling whether the Taskbar displays a button for the created window, see Managing Taskbar Buttons. For information on removing a window, see the DestroyWindow function. The following predefined control classes can be specified in the lpClassName parameter. Note the corresponding control styles you can use in the dwStyle parameter. + This doc was truncated. + Read more on docs.microsoft.com. + + + + Calls the default window procedure to provide default processing for any window messages that an application does not process. (Unicode) + + Type: HWND A handle to the window procedure that received the message. + Read more on docs.microsoft.com. + + + Type: UINT The message. + Read more on docs.microsoft.com. + + + Type: WPARAM Additional message information. The content of this parameter depends on the value of the Msg parameter. + Read more on docs.microsoft.com. + + + Type: LPARAM Additional message information. The content of this parameter depends on the value of the Msg parameter. + Read more on docs.microsoft.com. + + + Type: LRESULT The return value is the result of the message processing and depends on the message. + + + > [!NOTE] > The winuser.h header defines DefWindowProc as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see [Conventions for Function Prototypes](/windows/win32/intl/conventions-for-function-prototypes). + Read more on docs.microsoft.com. + + + + Destroys the specified window. + + Type: HWND A handle to the window to be destroyed. + Read more on docs.microsoft.com. + + + Type: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + A thread cannot use DestroyWindow to destroy a window created by a different thread. If the window being destroyed is a child window that does not have the WS_EX_NOPARENTNOTIFY style, a WM_PARENTNOTIFY message is sent to the parent. + Read more on docs.microsoft.com. + + + + + + + Dispatches a message to a window procedure. It is typically used to dispatch a message retrieved by the GetMessage function. (DispatchMessageW) + + Type: const MSG* A pointer to a structure that contains the message. + Read more on docs.microsoft.com. + + + Type: LRESULT The return value specifies the value returned by the window procedure. Although its meaning depends on the message being dispatched, the return value generally is ignored. + + + The MSG structure must contain valid message values. If the lpmsg parameter points to a WM_TIMER message and the lParam parameter of the WM_TIMER message is not NULL, lParam points to a function that is called instead of the window procedure. Note that the application is responsible for retrieving and dispatching input messages to the dialog box. Most applications use the main message loop for this. However, to permit the user to move to and to select controls by using the keyboard, the application must call IsDialogMessage. For more information, see Dialog Box Keyboard Interface. + Read more on docs.microsoft.com. + + + + The GetDC function retrieves a handle to a device context (DC) for the client area of a specified window or for the entire screen. + A handle to the window whose DC is to be retrieved. If this value is NULL, GetDC retrieves the DC for the entire screen. + + If the function succeeds, the return value is a handle to the DC for the specified window's client area. If the function fails, the return value is NULL. + + + The GetDC function retrieves a common, class, or private DC depending on the class style of the specified window. For class and private DCs, GetDC leaves the previously assigned attributes unchanged. However, for common DCs, GetDC assigns default attributes to the DC each time it is retrieved. For example, the default font is System, which is a bitmap font. Because of this, the handle to a common DC returned by GetDC does not tell you what font, color, or brush was used when the window was drawn. To determine the font, call GetTextFace. Note that the handle to the DC can only be used by a single thread at any one time. After painting with a common DC, the ReleaseDC function must be called to release the DC. Class and private DCs do not have to be released. ReleaseDC must be called from the same thread that called GetDC. The number of DCs is limited only by available memory. + Read more on docs.microsoft.com. + + + + + + + Loads the specified cursor resource from the executable (.EXE) file associated with an application instance. (Unicode) + + Type: HINSTANCE A handle to an instance of the module whose executable file contains the cursor to be loaded. + Read more on docs.microsoft.com. + + + Type: LPCTSTR The name of the cursor resource to be loaded. Alternatively, this parameter can consist of the resource identifier in the low-order word and zero in the high-order word. The MAKEINTRESOURCE macro can also be used to create this value. To use one of the predefined cursors, the application must set the hInstance parameter to NULL and the lpCursorName parameter to one the following values. + This doc was truncated. + Read more on docs.microsoft.com. + + + Type: HCURSOR If the function succeeds, the return value is the handle to the newly loaded cursor. If the function fails, the return value is NULL. To get extended error information, call GetLastError. + + + The LoadCursor function loads the cursor resource only if it has not been loaded; otherwise, it retrieves the handle to the existing resource. This function returns a valid cursor handle only if the lpCursorName parameter is a pointer to a cursor resource. If lpCursorName is a pointer to any type of resource other than a cursor (such as an icon), the return value is not NULL, even though it is not a valid cursor handle. The LoadCursor function searches the cursor resource most appropriate for the cursor for the current display device. The cursor resource can be a color or monochrome bitmap.

DPI Virtualization

This API does not participate in DPI virtualization. The output returned is not affected by the DPI of the calling thread.
+ Read more on docs.microsoft.com. +
+
+ + + + + Dispatches incoming nonqueued messages, checks the thread message queue for a posted message, and retrieves the message (if any exist). (Unicode) + + Type: LPMSG A pointer to an MSG structure that receives message information. + Read more on docs.microsoft.com. + + + Type: HWND A handle to the window whose messages are to be retrieved. The window must belong to the current thread. + If hWnd is NULL, PeekMessage retrieves messages for any window that belongs to the current thread, and any messages on the current thread's message queue whose hwnd value is NULL (see the MSG structure). Therefore if hWnd is NULL, both window messages and thread messages are processed. If hWnd is -1, PeekMessage retrieves only messages on the current thread's message queue whose hwnd value is NULL, that is, thread messages as posted by PostMessage (when the hWnd parameter is NULL) or PostThreadMessage. + Read more on docs.microsoft.com. + + + Type: UINT The value of the first message in the range of messages to be examined. Use WM_KEYFIRST (0x0100) to specify the first keyboard message or WM_MOUSEFIRST (0x0200) to specify the first mouse message. If wMsgFilterMin and wMsgFilterMax are both zero, PeekMessage returns all available messages (that is, no range filtering is performed). + Read more on docs.microsoft.com. + + + Type: UINT The value of the last message in the range of messages to be examined. Use WM_KEYLAST to specify the last keyboard message or WM_MOUSELAST to specify the last mouse message. If wMsgFilterMin and wMsgFilterMax are both zero, PeekMessage returns all available messages (that is, no range filtering is performed). + Read more on docs.microsoft.com. + + Type: UINT + + Type: BOOL If a message is available, the return value is nonzero. If no messages are available, the return value is zero. + + + PeekMessage retrieves messages associated with the window identified by the hWnd parameter or any of its children as specified by the IsChild function, and within the range of message values given by the wMsgFilterMin and wMsgFilterMax parameters. Note that an application can only use the low word in the wMsgFilterMin and wMsgFilterMax parameters; the high word is reserved for the system. Note that PeekMessage always retrieves WM_QUIT messages, no matter which values you specify for wMsgFilterMin and wMsgFilterMax. During this call, the system dispatches (DispatchMessage) pending, nonqueued messages, that is, messages sent to windows owned by the calling thread using the SendMessage, SendMessageCallback, SendMessageTimeout, or SendNotifyMessage function. Then the first queued message that matches the specified filter is retrieved. The system may also process internal events. If no filter is specified, messages are processed in the following order: + This doc was truncated. + Read more on docs.microsoft.com. + + + + Indicates to the system that a thread has made a request to terminate (quit). It is typically used in response to a WM_DESTROY message. + + Type: int The application exit code. This value is used as the wParam parameter of the WM_QUIT message. + Read more on docs.microsoft.com. + + + The PostQuitMessage function posts a WM_QUIT message to the thread's message queue and returns immediately; the function simply indicates to the system that the thread is requesting to quit at some time in the future. When the thread retrieves the WM_QUIT message from its message queue, it should exit its message loop and return control to the system. The exit value returned to the system must be the wParam parameter of the WM_QUIT message. + Read more on docs.microsoft.com. + + + + Registers a window class for subsequent use in calls to the CreateWindow or CreateWindowEx function. (RegisterClassW) + + Type: const WNDCLASS* A pointer to a WNDCLASS structure. You must fill the structure with the appropriate class attributes before passing it to the function. + Read more on docs.microsoft.com. + + + Type: ATOM If the function succeeds, the return value is a class atom that uniquely identifies the class being registered. This atom can only be used by the CreateWindow, CreateWindowEx, GetClassInfo, GetClassInfoEx, FindWindow, FindWindowEx, and UnregisterClass functions and the IActiveIMMap::FilterClientWindows method. If the function fails, the return value is zero. To get extended error information, call GetLastError. + + + If you register the window class by using RegisterClassA, the application tells the system that the windows of the created class expect messages with text or character parameters to use the ANSI character set; if you register it by using RegisterClassW, the application requests that the system pass text parameters of messages as Unicode. The IsWindowUnicode function enables applications to query the nature of each window. For more information on ANSI and Unicode functions, see Conventions for Function Prototypes. All window classes that an application registers are unregistered when it terminates. No window classes registered by a DLL are unregistered when the DLL is unloaded. A DLL must explicitly unregister its classes when it is unloaded. + Read more on docs.microsoft.com. + + + + The ReleaseDC function releases a device context (DC), freeing it for use by other applications. The effect of the ReleaseDC function depends on the type of DC. It frees only common and window DCs. It has no effect on class or private DCs. + A handle to the window whose DC is to be released. + A handle to the DC to be released. + + The return value indicates whether the DC was released. If the DC was released, the return value is 1. If the DC was not released, the return value is zero. + + + The application must call the ReleaseDC function for each call to the GetWindowDC function and for each call to the GetDC function that retrieves a common DC. An application cannot use the ReleaseDC function to release a DC that was created by calling the CreateDC function; instead, it must use the DeleteDC function. ReleaseDC must be called from the same thread that called GetDC. + Read more on docs.microsoft.com. + + + + Sets the specified window's show state. + + Type: HWND A handle to the window. + Read more on docs.microsoft.com. + + Type: int + + Type: BOOL If the window was previously visible, the return value is nonzero. If the window was previously hidden, the return value is zero. + + + To perform certain special effects when showing or hiding a window, use AnimateWindow. The first time an application calls ShowWindow, it should use the WinMain function's nCmdShow parameter as its nCmdShow parameter. Subsequent calls to ShowWindow must use one of the values in the given list, instead of the one specified by the WinMain function's nCmdShow parameter. As noted in the discussion of the nCmdShow parameter, the nCmdShow value is ignored in the first call to ShowWindow if the program that launched the application specifies startup information in the structure. In this case, ShowWindow uses the information specified in the STARTUPINFO structure to show the window. On subsequent calls, the application must call ShowWindow with nCmdShow set to SW_SHOWDEFAULT to use the startup information provided by the program that launched the application. This behavior is designed for the following situations: + This doc was truncated. + Read more on docs.microsoft.com. + + + + + + + Translates virtual-key messages into character messages. The character messages are posted to the calling thread's message queue, to be read the next time the thread calls the GetMessage or PeekMessage function. + + Type: const MSG* A pointer to an MSG structure that contains message information retrieved from the calling thread's message queue by using the GetMessage or PeekMessage function. + Read more on docs.microsoft.com. + + + Type: BOOL If the message is translated (that is, a character message is posted to the thread's message queue), the return value is nonzero. If the message is WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, or WM_SYSKEYUP, the return value is nonzero, regardless of the translation. If the message is not translated (that is, a character message is not posted to the thread's message queue), the return value is zero. + + + The TranslateMessage function does not modify the message pointed to by the lpMsg parameter. + WM_KEYDOWN and WM_KEYUP combinations produce a WM_CHAR or WM_DEADCHAR message. WM_SYSKEYDOWN and WM_SYSKEYUP combinations produce a WM_SYSCHAR or WM_SYSDEADCHAR message. TranslateMessage produces WM_CHAR messages only for keys that are mapped to ASCII characters by the keyboard driver. If applications process virtual-key messages for some other purpose, they should not call TranslateMessage. For instance, an application should not call TranslateMessage if the TranslateAccelerator function returns a nonzero value. Note that the application is responsible for retrieving and dispatching input messages to the dialog box. Most applications use the main message loop for this. However, to permit the user to move to and to select controls by using the keyboard, the application must call IsDialogMessage. For more information, see Dialog Box Keyboard Interface. + Read more on docs.microsoft.com. + + + + The UpdateWindow function updates the client area of the specified window by sending a WM_PAINT message to the window if the window's update region is not empty. + Handle to the window to be updated. + + If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. + + + Learn more about this API from docs.microsoft.com. + + + - Generates a random seed in int value. + Represents a Win32 handle that can be closed with . -
diff --git a/源代码/StgSharp/obj/x64/Release/netstandard2.1/TempPE/Data.InternalEssentialData.Designer.cs.dll b/源代码/StgSharp/obj/x64/Release/netstandard2.1/TempPE/Data.InternalEssentialData.Designer.cs.dll new file mode 100644 index 00000000..659b1ace Binary files /dev/null and b/源代码/StgSharp/obj/x64/Release/netstandard2.1/TempPE/Data.InternalEssentialData.Designer.cs.dll differ diff --git a/源代码/StgSharp/obj/x64/Release/netstandard2.1/ref/StgSharp.dll b/源代码/StgSharp/obj/x64/Release/netstandard2.1/ref/StgSharp.dll index a17f2cde..122ffd03 100644 Binary files a/源代码/StgSharp/obj/x64/Release/netstandard2.1/ref/StgSharp.dll and b/源代码/StgSharp/obj/x64/Release/netstandard2.1/ref/StgSharp.dll differ diff --git a/源代码/StgSharp/obj/x64/Release/netstandard2.1/refint/StgSharp.dll b/源代码/StgSharp/obj/x64/Release/netstandard2.1/refint/StgSharp.dll index a17f2cde..122ffd03 100644 Binary files a/源代码/StgSharp/obj/x64/Release/netstandard2.1/refint/StgSharp.dll and b/源代码/StgSharp/obj/x64/Release/netstandard2.1/refint/StgSharp.dll differ diff --git a/源代码/StgSharpC.bsc b/源代码/StgSharpC.bsc index 7aacf7ba..88703244 100644 Binary files a/源代码/StgSharpC.bsc and b/源代码/StgSharpC.bsc differ diff --git a/源代码/StgSharpC.dll b/源代码/StgSharpC.dll index ba96cd2d..7ebc661a 100644 Binary files a/源代码/StgSharpC.dll and b/源代码/StgSharpC.dll differ diff --git a/源代码/StgSharp/Resources/Collisionfs.txt b/源代码/StgSharpC.dll.lastcodeanalysissucceeded similarity index 100% rename from 源代码/StgSharp/Resources/Collisionfs.txt rename to 源代码/StgSharpC.dll.lastcodeanalysissucceeded diff --git a/源代码/StgSharpC.exp b/源代码/StgSharpC.exp index 516d2ebc..d973038f 100644 Binary files a/源代码/StgSharpC.exp and b/源代码/StgSharpC.exp differ diff --git a/源代码/StgSharpC.lib b/源代码/StgSharpC.lib index b7524271..79aed3a2 100644 Binary files a/源代码/StgSharpC.lib and b/源代码/StgSharpC.lib differ diff --git a/源代码/StgSharpC.pdb b/源代码/StgSharpC.pdb index c6c6f031..f2013b6c 100644 Binary files a/源代码/StgSharpC.pdb and b/源代码/StgSharpC.pdb differ diff --git a/源代码/StgSharpC/x64/Debug/NativeCodeAnalysis.read.1.tlog b/源代码/StgSharpC/x64/Debug/NativeCodeAnalysis.read.1.tlog new file mode 100644 index 00000000..024f685a --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/NativeCodeAnalysis.read.1.tlog @@ -0,0 +1 @@ +C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\ENTERPRISE\TEAM TOOLS\STATIC ANALYSIS TOOLS\\RULE SETS\NATIVERECOMMENDEDRULES.RULESET diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.Build.CppClean.log b/源代码/StgSharpC/x64/Debug/StgSharpC.Build.CppClean.log index c287abc1..ca6584ad 100644 --- a/源代码/StgSharpC/x64/Debug/StgSharpC.Build.CppClean.log +++ b/源代码/StgSharpC/x64/Debug/StgSharpC.Build.CppClean.log @@ -1 +1,40 @@ +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc.bsc +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\vc143.pdb +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\vc143.idb +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\dllmain.sbr +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\mat2.sbr +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\mat3.sbr +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\mat4.sbr +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stb_image.sbr +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stgsharpc.sbr +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\vector.sbr +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\vector.obj +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\vector.cod +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stgsharpc.obj +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stgsharpc.cod +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stb_image.obj +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stb_image.cod +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\mat4.obj +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\mat4.cod +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\mat3.obj +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\mat3.cod +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\mat2.obj +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\mat2.cod +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\dllmain.obj +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\dllmain.cod +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc.dll +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc.pdb +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc.lib +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc.exp +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stgsharpc.ilk +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stgsharpc.tlog\bscmake.command.1.tlog +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stgsharpc.tlog\bscmake.read.1.tlog +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stgsharpc.tlog\bscmake.write.1.tlog d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stgsharpc.tlog\cl.command.1.tlog +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stgsharpc.tlog\cl.items.tlog +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stgsharpc.tlog\cl.read.1.tlog +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stgsharpc.tlog\cl.write.1.tlog +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stgsharpc.tlog\link.command.1.tlog +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stgsharpc.tlog\link.read.1.tlog +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stgsharpc.tlog\link.secondary.1.tlog +d:\nitloadindustry\研究项目\1-flagship\th2020\projectfile\源代码\stgsharpc\x64\debug\stgsharpc.tlog\link.write.1.tlog diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.cod b/源代码/StgSharpC/x64/Debug/StgSharpC.cod index ff2a2f8d..7419c2b6 100644 --- a/源代码/StgSharpC/x64/Debug/StgSharpC.cod +++ b/源代码/StgSharpC/x64/Debug/StgSharpC.cod @@ -142,6 +142,7 @@ msvcjmc ENDS PUBLIC __local_stdio_printf_options PUBLIC _vfprintf_l PUBLIC printf +PUBLIC glCheckShaderStat PUBLIC initGL PUBLIC linkShaderProgram PUBLIC loadImageData @@ -149,7 +150,6 @@ PUBLIC loadGlfuncDefault PUBLIC unloadImageData PUBLIC readLog PUBLIC __JustMyCode_Default -PUBLIC ??_C@_05JMLLFKBP@?$CFllu?6@ ; `string' PUBLIC ??_C@_0BL@MOJGOJJP@Failed?5to?5load?5OpenGL?5api?3@ ; `string' PUBLIC ??_C@_03OFAPEBGM@?$CFs?6@ ; `string' EXTRN __report_rangecheckfailure:PROC @@ -189,6 +189,12 @@ $pdata$printf DD imagerel $LN3 pdata ENDS ; COMDAT pdata pdata SEGMENT +$pdata$glCheckShaderStat DD imagerel $LN4 + DD imagerel $LN4+229 + DD imagerel $unwind$glCheckShaderStat +pdata ENDS +; COMDAT pdata +pdata SEGMENT $pdata$initGL DD imagerel $LN3 DD imagerel $LN3+91 DD imagerel $unwind$initGL @@ -208,7 +214,7 @@ pdata ENDS ; COMDAT pdata pdata SEGMENT $pdata$loadGlfuncDefault DD imagerel $LN7 - DD imagerel $LN7+202 + DD imagerel $LN7+186 DD imagerel $unwind$loadGlfuncDefault pdata ENDS ; COMDAT pdata @@ -240,10 +246,6 @@ CONST SEGMENT ??_C@_0BL@MOJGOJJP@Failed?5to?5load?5OpenGL?5api?3@ DB 'Failed to load Op' DB 'enGL api:', 00H ; `string' CONST ENDS -; COMDAT ??_C@_05JMLLFKBP@?$CFllu?6@ -CONST SEGMENT -??_C@_05JMLLFKBP@?$CFllu?6@ DB '%llu', 0aH, 00H ; `string' -CONST ENDS ; COMDAT xdata xdata SEGMENT $unwind$readLog DD 025050f01H @@ -314,6 +316,36 @@ $unwind$initGL DD 025051601H xdata ENDS ; COMDAT voltbl voltbl SEGMENT +_volmd DB 045H + DB 0ccH +voltbl ENDS +; COMDAT xdata +xdata SEGMENT +$unwind$glCheckShaderStat DD 025054c19H + DD 011d2322H + DD 070160021H + DD 05015H + DD imagerel __GSHandlerCheck + DD 0f8H +xdata ENDS +; COMDAT CONST +CONST SEGMENT +glCheckShaderStat$rtcName$0 DB 073H + DB 074H + DB 061H + DB 074H + DB 00H + ORG $+11 +glCheckShaderStat$rtcVarDesc DD 024H + DD 04H + DQ FLAT:glCheckShaderStat$rtcName$0 + ORG $+48 +glCheckShaderStat$rtcFrameData DD 01H + DD 00H + DQ FLAT:glCheckShaderStat$rtcVarDesc +CONST ENDS +; COMDAT voltbl +voltbl SEGMENT _volmd DB 045H DB 0a6H voltbl ENDS @@ -374,7 +406,7 @@ _TEXT SEGMENT $T1 = 200 readLog PROC ; COMDAT -; 65 : { +; 77 : { $LN5: 00000 40 55 push rbp @@ -386,7 +418,7 @@ $LN5: 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 00016 e8 00 00 00 00 call __CheckForDebuggerJustMyCode -; 66 : infolog[511] = '\0'; +; 78 : infolog[511] = '\0'; 0001b b8 01 00 00 00 mov eax, 1 00020 48 69 c0 ff 01 @@ -407,13 +439,13 @@ $LN4@readLog: 00 00 mov rcx, QWORD PTR $T1[rbp] 00050 c6 04 08 00 mov BYTE PTR [rax+rcx], 0 -; 67 : return &infolog; +; 79 : return &infolog; 00054 48 8d 05 00 00 00 00 lea rax, OFFSET FLAT:infolog $LN2@readLog: -; 68 : } +; 80 : } 0005b 48 8d a5 e8 00 00 00 lea rsp, QWORD PTR [rbp+232] @@ -429,7 +461,7 @@ _TEXT SEGMENT out$ = 224 unloadImageData PROC ; COMDAT -; 60 : { +; 72 : { $LN3: 00000 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx @@ -442,7 +474,7 @@ $LN3: 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 0001a e8 00 00 00 00 call __CheckForDebuggerJustMyCode -; 61 : free(out->pixelPtr); +; 73 : free(out->pixelPtr); 0001f 48 8b 85 e0 00 00 00 mov rax, QWORD PTR out$[rbp] @@ -450,7 +482,7 @@ $LN3: 0002a ff 15 00 00 00 00 call QWORD PTR __imp_free -; 62 : } +; 74 : } 00030 48 8d a5 c8 00 00 00 lea rsp, QWORD PTR [rbp+200] @@ -468,7 +500,7 @@ i$1 = 40 procName$ = 288 loadGlfuncDefault PROC ; COMDAT -; 18 : { +; 30 : { $LN7: 00000 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx @@ -481,91 +513,85 @@ $LN7: 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 0001a e8 00 00 00 00 call __CheckForDebuggerJustMyCode -; 19 : void* ret = glfwGetProcAddress(procName); +; 31 : void* ret = glfwGetProcAddress(procName); 0001f 48 8b 8d 20 01 00 00 mov rcx, QWORD PTR procName$[rbp] 00026 e8 00 00 00 00 call glfwGetProcAddress 0002b 48 89 45 08 mov QWORD PTR ret$[rbp], rax -; 20 : printf("%llu\n", (uint64_t)ret); +; 32 : //printf("%llu\n", (uint64_t)ret); +; 33 : if (ret = NULL) - 0002f 48 8b 55 08 mov rdx, QWORD PTR ret$[rbp] - 00033 48 8d 0d 00 00 - 00 00 lea rcx, OFFSET FLAT:??_C@_05JMLLFKBP@?$CFllu?6@ - 0003a e8 00 00 00 00 call printf - -; 21 : if (ret = NULL) - - 0003f 48 c7 45 08 00 + 0002f 48 c7 45 08 00 00 00 00 mov QWORD PTR ret$[rbp], 0 - 00047 48 83 7d 08 00 cmp QWORD PTR ret$[rbp], 0 - 0004c 74 6e je SHORT $LN5@loadGlfunc + 00037 48 83 7d 08 00 cmp QWORD PTR ret$[rbp], 0 + 0003c 74 6e je SHORT $LN5@loadGlfunc -; 22 : { -; 23 : *infolog = "Failed to load OpenGL api:"; +; 34 : { +; 35 : *infolog = "Failed to load OpenGL api:"; - 0004e b8 01 00 00 00 mov eax, 1 - 00053 48 6b c0 00 imul rax, rax, 0 - 00057 48 8d 0d 00 00 + 0003e b8 01 00 00 00 mov eax, 1 + 00043 48 6b c0 00 imul rax, rax, 0 + 00047 48 8d 0d 00 00 00 00 lea rcx, OFFSET FLAT:infolog - 0005e 48 8d 15 00 00 + 0004e 48 8d 15 00 00 00 00 lea rdx, OFFSET FLAT:??_C@_0BL@MOJGOJJP@Failed?5to?5load?5OpenGL?5api?3@ - 00065 88 14 01 mov BYTE PTR [rcx+rax], dl + 00055 88 14 01 mov BYTE PTR [rcx+rax], dl -; 24 : for (size_t i = 0; i < sizeof(procName); i++) +; 36 : for (size_t i = 0; i < sizeof(procName); i++) - 00068 48 c7 45 28 00 + 00058 48 c7 45 28 00 00 00 00 mov QWORD PTR i$1[rbp], 0 - 00070 eb 0b jmp SHORT $LN4@loadGlfunc + 00060 eb 0b jmp SHORT $LN4@loadGlfunc $LN2@loadGlfunc: - 00072 48 8b 45 28 mov rax, QWORD PTR i$1[rbp] - 00076 48 ff c0 inc rax - 00079 48 89 45 28 mov QWORD PTR i$1[rbp], rax + 00062 48 8b 45 28 mov rax, QWORD PTR i$1[rbp] + 00066 48 ff c0 inc rax + 00069 48 89 45 28 mov QWORD PTR i$1[rbp], rax $LN4@loadGlfunc: - 0007d 48 83 7d 28 08 cmp QWORD PTR i$1[rbp], 8 - 00082 73 25 jae SHORT $LN3@loadGlfunc + 0006d 48 83 7d 28 08 cmp QWORD PTR i$1[rbp], 8 + 00072 73 25 jae SHORT $LN3@loadGlfunc -; 25 : { -; 26 : infolog[30 + i] = procName[i]; +; 37 : { +; 38 : infolog[30 + i] = procName[i]; - 00084 48 8d 05 00 00 + 00074 48 8d 05 00 00 00 00 lea rax, OFFSET FLAT:infolog - 0008b 48 8b 4d 28 mov rcx, QWORD PTR i$1[rbp] - 0008f 48 8b 95 20 01 + 0007b 48 8b 4d 28 mov rcx, QWORD PTR i$1[rbp] + 0007f 48 8b 95 20 01 00 00 mov rdx, QWORD PTR procName$[rbp] - 00096 48 03 d1 add rdx, rcx - 00099 48 8b ca mov rcx, rdx - 0009c 48 8b 55 28 mov rdx, QWORD PTR i$1[rbp] - 000a0 0f b6 09 movzx ecx, BYTE PTR [rcx] - 000a3 88 4c 10 1e mov BYTE PTR [rax+rdx+30], cl + 00086 48 03 d1 add rdx, rcx + 00089 48 8b ca mov rcx, rdx + 0008c 48 8b 55 28 mov rdx, QWORD PTR i$1[rbp] + 00090 0f b6 09 movzx ecx, BYTE PTR [rcx] + 00093 88 4c 10 1e mov BYTE PTR [rax+rdx+30], cl -; 27 : } +; 39 : } - 000a7 eb c9 jmp SHORT $LN2@loadGlfunc + 00097 eb c9 jmp SHORT $LN2@loadGlfunc $LN3@loadGlfunc: -; 28 : printf("%s\n", infolog); +; 40 : printf("%s\n", infolog); - 000a9 48 8d 15 00 00 + 00099 48 8d 15 00 00 00 00 lea rdx, OFFSET FLAT:infolog - 000b0 48 8d 0d 00 00 + 000a0 48 8d 0d 00 00 00 00 lea rcx, OFFSET FLAT:??_C@_03OFAPEBGM@?$CFs?6@ - 000b7 e8 00 00 00 00 call printf + 000a7 e8 00 00 00 00 call printf $LN5@loadGlfunc: -; 29 : } -; 30 : return (GLFWglproc)ret; +; 41 : } +; 42 : return (GLFWglproc)ret; - 000bc 48 8b 45 08 mov rax, QWORD PTR ret$[rbp] + 000ac 48 8b 45 08 mov rax, QWORD PTR ret$[rbp] -; 31 : } +; 43 : } - 000c0 48 8d a5 08 01 + 000b0 48 8d a5 08 01 00 00 lea rsp, QWORD PTR [rbp+264] - 000c7 5f pop rdi - 000c8 5d pop rbp - 000c9 c3 ret 0 + 000b7 5f pop rdi + 000b8 5d pop rbp + 000b9 c3 ret 0 loadGlfuncDefault ENDP _TEXT ENDS ; Function compile flags: /Odtp /RTCsu /ZI @@ -577,7 +603,7 @@ out$ = 232 loader$ = 240 loadImageData PROC ; COMDAT -; 51 : { +; 63 : { $LN4: 00000 4c 89 44 24 18 mov QWORD PTR [rsp+24], r8 @@ -592,14 +618,14 @@ $LN4: 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 00024 e8 00 00 00 00 call __CheckForDebuggerJustMyCode -; 52 : if (loader == NULL) +; 64 : if (loader == NULL) 00029 48 83 bd f0 00 00 00 00 cmp QWORD PTR loader$[rbp], 0 00031 75 0e jne SHORT $LN2@loadImageD -; 53 : { -; 54 : loader = stbi_load; +; 65 : { +; 66 : loader = stbi_load; 00033 48 8d 05 00 00 00 00 lea rax, OFFSET FLAT:stbi_load @@ -607,8 +633,8 @@ $LN4: 00 00 mov QWORD PTR loader$[rbp], rax $LN2@loadImageD: -; 55 : } -; 56 : out->pixelPtr = loader(location, &(out->width), &(out->height), &(out->channel), 0); +; 67 : } +; 68 : out->pixelPtr = loader(location, &(out->width), &(out->height), &(out->channel), 0); 00041 48 8b 85 e8 00 00 00 mov rax, QWORD PTR out$[rbp] @@ -630,7 +656,7 @@ $LN2@loadImageD: 00 00 mov rcx, QWORD PTR out$[rbp] 00080 48 89 41 10 mov QWORD PTR [rcx+16], rax -; 57 : } +; 69 : } 00084 48 8d a5 c8 00 00 00 lea rsp, QWORD PTR [rbp+200] @@ -649,7 +675,7 @@ context$ = 256 shaderProgram$ = 264 linkShaderProgram PROC ; COMDAT -; 34 : { +; 46 : { $LN5: 00000 89 54 24 10 mov DWORD PTR [rsp+16], edx @@ -674,7 +700,7 @@ $LN5: 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 00048 e8 00 00 00 00 call __CheckForDebuggerJustMyCode -; 35 : context->LinkProgram(shaderProgram); +; 47 : context->LinkProgram(shaderProgram); 0004d 8b 8d 08 01 00 00 mov ecx, DWORD PTR shaderProgram$[rbp] @@ -683,9 +709,9 @@ $LN5: 0005a ff 90 80 22 00 00 call QWORD PTR [rax+8832] -; 36 : -; 37 : int success; -; 38 : context->GetProgramiv(shaderProgram, GL_LINK_STATUS, &success); +; 48 : +; 49 : int success; +; 50 : context->GetProgramiv(shaderProgram, GL_LINK_STATUS, &success); 00060 4c 8d 45 04 lea r8, QWORD PTR success$[rbp] 00064 ba 82 8b 00 00 mov edx, 35714 ; 00008b82H @@ -696,13 +722,13 @@ $LN5: 00076 ff 90 48 1a 00 00 call QWORD PTR [rax+6728] -; 39 : if (!success) +; 51 : if (!success) 0007c 83 7d 04 00 cmp DWORD PTR success$[rbp], 0 00080 75 28 jne SHORT $LN2@linkShader -; 40 : { -; 41 : context->GetProgramInfoLog(shaderProgram, 512, NULL, infolog); +; 52 : { +; 53 : context->GetProgramInfoLog(shaderProgram, 512, NULL, infolog); 00082 4c 8d 0d 00 00 00 00 lea r9, OFFSET FLAT:infolog @@ -715,27 +741,27 @@ $LN5: 0009e ff 90 98 19 00 00 call QWORD PTR [rax+6552] -; 42 : return 0; +; 54 : return 0; 000a4 33 c0 xor eax, eax 000a6 eb 08 jmp SHORT $LN1@linkShader -; 43 : } +; 55 : } 000a8 eb 06 jmp SHORT $LN3@linkShader $LN2@linkShader: -; 44 : else -; 45 : { -; 46 : return shaderProgram; +; 56 : else +; 57 : { +; 58 : return shaderProgram; 000aa 8b 85 08 01 00 00 mov eax, DWORD PTR shaderProgram$[rbp] $LN3@linkShader: $LN1@linkShader: -; 47 : } -; 48 : } +; 59 : } +; 60 : } 000b0 48 8b f8 mov rdi, rax 000b3 48 8d 4d e0 lea rcx, QWORD PTR [rbp-32] @@ -762,7 +788,7 @@ majorVersion$ = 224 minorVersion$ = 232 initGL PROC ; COMDAT -; 11 : { +; 23 : { $LN3: 00000 89 54 24 10 mov DWORD PTR [rsp+16], edx @@ -776,27 +802,27 @@ $LN3: 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 0001d e8 00 00 00 00 call __CheckForDebuggerJustMyCode -; 12 : glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, majorVersion); +; 24 : glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, majorVersion); 00022 8b 95 e0 00 00 00 mov edx, DWORD PTR majorVersion$[rbp] 00028 b9 02 20 02 00 mov ecx, 139266 ; 00022002H 0002d e8 00 00 00 00 call glfwWindowHint -; 13 : glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minorVersion); +; 25 : glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minorVersion); 00032 8b 95 e8 00 00 00 mov edx, DWORD PTR minorVersion$[rbp] 00038 b9 03 20 02 00 mov ecx, 139267 ; 00022003H 0003d e8 00 00 00 00 call glfwWindowHint -; 14 : glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); +; 26 : glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); 00042 ba 01 20 03 00 mov edx, 204801 ; 00032001H 00047 b9 08 20 02 00 mov ecx, 139272 ; 00022008H 0004c e8 00 00 00 00 call glfwWindowHint -; 15 : } +; 27 : } 00051 48 8d a5 c8 00 00 00 lea rsp, QWORD PTR [rbp+200] @@ -806,6 +832,114 @@ $LN3: initGL ENDP _TEXT ENDS ; Function compile flags: /Odtp /RTCsu /ZI +; File D:\NitloadIndustry\Ñо¿ÏîĿ\1-Flagship\TH2020\ProjectFile\Դ´úÂë\StgSharpC\StgSharpC.c +; COMDAT glCheckShaderStat +_TEXT SEGMENT +stat$ = 4 +__$ArrayPad$ = 216 +context$ = 256 +shaderHandle$ = 264 +key$ = 272 +logRef$ = 280 +glCheckShaderStat PROC ; COMDAT + +; 11 : { + +$LN4: + 00000 4c 89 4c 24 20 mov QWORD PTR [rsp+32], r9 + 00005 44 89 44 24 18 mov DWORD PTR [rsp+24], r8d + 0000a 48 89 54 24 10 mov QWORD PTR [rsp+16], rdx + 0000f 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx + 00014 55 push rbp + 00015 57 push rdi + 00016 48 81 ec 08 01 + 00 00 sub rsp, 264 ; 00000108H + 0001d 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32] + 00022 48 8d 7c 24 20 lea rdi, QWORD PTR [rsp+32] + 00027 b9 0a 00 00 00 mov ecx, 10 + 0002c b8 cc cc cc cc mov eax, -858993460 ; ccccccccH + 00031 f3 ab rep stosd + 00033 48 8b 8c 24 28 + 01 00 00 mov rcx, QWORD PTR [rsp+296] + 0003b 48 8b 05 00 00 + 00 00 mov rax, QWORD PTR __security_cookie + 00042 48 33 c5 xor rax, rbp + 00045 48 89 85 d8 00 + 00 00 mov QWORD PTR __$ArrayPad$[rbp], rax + 0004c 48 8d 0d 00 00 + 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c + 00053 e8 00 00 00 00 call __CheckForDebuggerJustMyCode + +; 12 : int stat = 0; + + 00058 c7 45 04 00 00 + 00 00 mov DWORD PTR stat$[rbp], 0 + +; 13 : context->GetShaderiv(shaderHandle, key, &stat); + + 0005f 4c 8d 45 04 lea r8, QWORD PTR stat$[rbp] + 00063 8b 95 10 01 00 + 00 mov edx, DWORD PTR key$[rbp] + 00069 8b 8d 08 01 00 + 00 mov ecx, DWORD PTR shaderHandle$[rbp] + 0006f 48 8b 85 00 01 + 00 00 mov rax, QWORD PTR context$[rbp] + 00076 ff 90 40 1b 00 + 00 call QWORD PTR [rax+6976] + +; 14 : if (!stat) + + 0007c 83 7d 04 00 cmp DWORD PTR stat$[rbp], 0 + 00080 75 22 jne SHORT $LN2@glCheckSha + +; 15 : { +; 16 : context->GetShaderInfoLog(shaderHandle, 512, NULL, infolog); + + 00082 4c 8d 0d 00 00 + 00 00 lea r9, OFFSET FLAT:infolog + 00089 45 33 c0 xor r8d, r8d + 0008c ba 00 02 00 00 mov edx, 512 ; 00000200H + 00091 8b 8d 08 01 00 + 00 mov ecx, DWORD PTR shaderHandle$[rbp] + 00097 48 8b 85 00 01 + 00 00 mov rax, QWORD PTR context$[rbp] + 0009e ff 90 20 1b 00 + 00 call QWORD PTR [rax+6944] +$LN2@glCheckSha: + +; 17 : } +; 18 : *logRef = infolog; + + 000a4 48 8b 85 18 01 + 00 00 mov rax, QWORD PTR logRef$[rbp] + 000ab 48 8d 0d 00 00 + 00 00 lea rcx, OFFSET FLAT:infolog + 000b2 48 89 08 mov QWORD PTR [rax], rcx + +; 19 : return stat; + + 000b5 8b 45 04 mov eax, DWORD PTR stat$[rbp] + +; 20 : } + + 000b8 8b f8 mov edi, eax + 000ba 48 8d 4d e0 lea rcx, QWORD PTR [rbp-32] + 000be 48 8d 15 00 00 + 00 00 lea rdx, OFFSET FLAT:glCheckShaderStat$rtcFrameData + 000c5 e8 00 00 00 00 call _RTC_CheckStackVars + 000ca 8b c7 mov eax, edi + 000cc 48 8b 8d d8 00 + 00 00 mov rcx, QWORD PTR __$ArrayPad$[rbp] + 000d3 48 33 cd xor rcx, rbp + 000d6 e8 00 00 00 00 call __security_check_cookie + 000db 48 8d a5 e8 00 + 00 00 lea rsp, QWORD PTR [rbp+232] + 000e2 5f pop rdi + 000e3 5d pop rbp + 000e4 c3 ret 0 +glCheckShaderStat ENDP +_TEXT ENDS +; Function compile flags: /Odtp /RTCsu /ZI ; File C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\stdio.h ; COMDAT printf _TEXT SEGMENT diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.ilk b/源代码/StgSharpC/x64/Debug/StgSharpC.ilk index 7ce03636..1bbbb424 100644 Binary files a/源代码/StgSharpC/x64/Debug/StgSharpC.ilk and b/源代码/StgSharpC/x64/Debug/StgSharpC.ilk differ diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.log b/源代码/StgSharpC/x64/Debug/StgSharpC.log index 43b10474..df116f83 100644 --- a/源代码/StgSharpC/x64/Debug/StgSharpC.log +++ b/源代码/StgSharpC/x64/Debug/StgSharpC.log @@ -1,4 +1,6 @@ - mat2.c + dllmain.c + mat2.c + mat3.c D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat2.c(6,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat2.c(6,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat2.c(7,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 @@ -7,4 +9,73 @@ D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat2.c(16,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat2.c(17,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat2.c(17,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat3.c(7,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat3.c(7,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat3.c(8,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat3.c(16,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat3.c(16,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat3.c(17,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat3.c(17,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat3.c(18,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat3.c(19,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat3.c(28,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat3.c(28,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat3.c(29,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat3.c(29,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat3.c(30,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat3.c(31,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 + mat4.c +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(8,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(8,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(9,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(9,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(17,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(17,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(18,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(18,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(19,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(19,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(20,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(20,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(30,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(30,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(31,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(31,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(32,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(32,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(33,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(33,57): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(42,18): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(43,18): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(44,18): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(45,18): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\mat4.c(53,32): warning C4133: “函数”: 从“__m128 *”到“const float *”的类型不兼容 + stb_image.c +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\stb_image.c(832,17): warning C4047: “=”:“stbi_uc”与“char [33]”的间接级别不同 + StgSharpC.c +C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\minwindef.h(130,1): warning C4005: “APIENTRY”: 宏重定义 + (编译源文件“StgSharpC.c”) + D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\glfw3.h(123,1): + 参见“APIENTRY”的前一个定义 + +C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um\wingdi.h(36,1): warning C4005: “WINGDIAPI”: 宏重定义 + (编译源文件“StgSharpC.c”) + D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\glfw3.h(133,1): + 参见“WINGDIAPI”的前一个定义 + +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\StgSharpC.c(10,70): warning C4028: 形参 2 与声明不同 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\StgSharpC.c(10,89): warning C4028: 形参 3 与声明不同 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\StgSharpC.c(11,1): warning C4029: 声明的形参表不同于定义 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\StgSharpC.c(13,26): warning C4244: “函数”: 从“uint64_t”转换到“GLuint”,可能丢失数据 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\StgSharpC.c(16,35): warning C4244: “函数”: 从“uint64_t”转换到“GLuint”,可能丢失数据 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\StgSharpC.c(35,18): warning C4047: “=”:“char”与“char [27]”的间接级别不同 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\StgSharpC.c(79,5): warning C4047: “return”:“char *”与“char (*)[512]”的间接级别不同 + vector.c + 正在运行 C/C++ 代码分析... + 正在生成代码... + 正在创建库 D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC.lib 和对象 D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC.exp +LINK : warning LNK4098: 默认库“MSVCRT”与其他库的使用冲突;请使用 /NODEFAULTLIB:library StgSharpC.vcxproj -> D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC.dll +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\stb_image.c(6525): warning C6262: 函数使用堆叠的 "35036" 字节。请考虑将一些数据移动到堆。 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\stb_image.c(6612): warning C6262: 函数使用堆叠的 "34980" 字节。请考虑将一些数据移动到堆。 +D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\StgSharpC.c(33): warning C6282: 运算符不正确。 diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.nativecodeanalysis.sarif b/源代码/StgSharpC/x64/Debug/StgSharpC.nativecodeanalysis.sarif new file mode 100644 index 00000000..06c1c3f3 --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/StgSharpC.nativecodeanalysis.sarif @@ -0,0 +1,129 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [ + { + "ruleId": "C6282", + "message": { + "text": "运算符不正确。" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///D:/NitloadIndustry/研究项目/1-Flagship/TH2020/ProjectFile/源代码/StgSharpC/StgSharpC.c" + }, + "region": { + "startLine": 33, + "startColumn": 9, + "endLine": 33, + "endColumn": 15 + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "loadGlfuncDefault", + "decoratedName": "loadGlfuncDefault", + "kind": "function" + } + ] + } + ] + } + ], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.39.33523.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///D:/NitloadIndustry/研究项目/1-Flagship/TH2020/ProjectFile/源代码/StgSharpC/StgSharpC.c" + }, + "roles": [ + "analysisTarget", + "resultFile" + ], + "hashes": { + "sha-256": "0ab9c2f04d59355c6c4581557f42b5b39f286bf159094e4b6f48ce08171d8bdf" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/ssgc_framework.h" + }, + "hashes": { + "sha-256": "fc75606e68c89d5e890316fa9798fa5f209e9f7f1596cac315f24f5016d20652" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/gl.h" + }, + "hashes": { + "sha-256": "0d4da36d20ceb98804584beb77fdde6923c48c83e032fa453d459af2ff5dd1dc" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/khrplatform.h" + }, + "hashes": { + "sha-256": "7b1e01aaa7ad8f6fc34b5c7bdf79ebf5189bb09e2c4d2e79fc5d350623d11e83" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/glfw3.h" + }, + "hashes": { + "sha-256": "a1ac46397841f26f8bc290ea1496d1009b65862ded7944567cd7830015d4b376" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/ssgc_internal.h" + }, + "hashes": { + "sha-256": "f9a595a71140053e0ff25ce143983b905d9b3ad9c672d8752845364a8a2c7807" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/stgsharpc.h" + }, + "hashes": { + "sha-256": "46efce7e03c053a63fbaec27d92f7ef754e5c368b9bf3dde60683b99f109903e" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/wgl.h" + }, + "hashes": { + "sha-256": "f2c2c934cc6135662cf9bbbfab774fc4609a7fbd827b1a688455d813854f514b" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/stb_image.h" + }, + "hashes": { + "sha-256": "3249df7a8c1996a53cff688577b835d0f3fcd05a599fdcbfa36d1fc30b76b7ea" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.nativecodeanalysis.xml b/源代码/StgSharpC/x64/Debug/StgSharpC.nativecodeanalysis.xml new file mode 100644 index 00000000..15d0a226 --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/StgSharpC.nativecodeanalysis.xml @@ -0,0 +1,17 @@ + + + + + D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\ + StgSharpC.c + 33 + 12 + + 6282 + 运算符不正确。 + loadGlfuncDefault + loadGlfuncDefault + 29 + + + \ No newline at end of file diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.obj b/源代码/StgSharpC/x64/Debug/StgSharpC.obj index 3ad1c399..fa596070 100644 Binary files a/源代码/StgSharpC/x64/Debug/StgSharpC.obj and b/源代码/StgSharpC/x64/Debug/StgSharpC.obj differ diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.sbr b/源代码/StgSharpC/x64/Debug/StgSharpC.sbr index 600d1f4f..b8f2a0b8 100644 Binary files a/源代码/StgSharpC/x64/Debug/StgSharpC.sbr and b/源代码/StgSharpC/x64/Debug/StgSharpC.sbr differ diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/CL.command.1.tlog b/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/CL.command.1.tlog index 756b9c03..49219445 100644 Binary files a/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/CL.command.1.tlog and b/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/CL.command.1.tlog differ diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/CL.read.1.tlog b/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/CL.read.1.tlog index d721e01c..d02cd116 100644 Binary files a/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/CL.read.1.tlog and b/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/CL.read.1.tlog differ diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/CL.write.1.tlog b/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/CL.write.1.tlog index 080e6e3f..4f779d36 100644 Binary files a/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/CL.write.1.tlog and b/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/CL.write.1.tlog differ diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/bscmake.read.1.tlog b/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/bscmake.read.1.tlog index 6763b49f..264c92fb 100644 Binary files a/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/bscmake.read.1.tlog and b/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/bscmake.read.1.tlog differ diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/link.read.1.tlog b/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/link.read.1.tlog index 957c1ac4..2ccf42a8 100644 Binary files a/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/link.read.1.tlog and b/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/link.read.1.tlog differ diff --git a/源代码/StgSharpC/x64/Debug/dllmain.nativecodeanalysis.sarif b/源代码/StgSharpC/x64/Debug/dllmain.nativecodeanalysis.sarif new file mode 100644 index 00000000..43c051d1 --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/dllmain.nativecodeanalysis.sarif @@ -0,0 +1,99 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.39.33523.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/dllmain.c" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "63095add7f9d5fd1a9a7117194ac56ff67ac41aa3262a54d1033e51c55b9bb98" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/ssgc_framework.h" + }, + "hashes": { + "sha-256": "fc75606e68c89d5e890316fa9798fa5f209e9f7f1596cac315f24f5016d20652" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/stgsharpc.h" + }, + "hashes": { + "sha-256": "46efce7e03c053a63fbaec27d92f7ef754e5c368b9bf3dde60683b99f109903e" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/ssgc_internal.h" + }, + "hashes": { + "sha-256": "f9a595a71140053e0ff25ce143983b905d9b3ad9c672d8752845364a8a2c7807" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/gl.h" + }, + "hashes": { + "sha-256": "0d4da36d20ceb98804584beb77fdde6923c48c83e032fa453d459af2ff5dd1dc" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/khrplatform.h" + }, + "hashes": { + "sha-256": "7b1e01aaa7ad8f6fc34b5c7bdf79ebf5189bb09e2c4d2e79fc5d350623d11e83" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/wgl.h" + }, + "hashes": { + "sha-256": "f2c2c934cc6135662cf9bbbfab774fc4609a7fbd827b1a688455d813854f514b" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/glfw3.h" + }, + "hashes": { + "sha-256": "a1ac46397841f26f8bc290ea1496d1009b65862ded7944567cd7830015d4b376" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/stb_image.h" + }, + "hashes": { + "sha-256": "3249df7a8c1996a53cff688577b835d0f3fcd05a599fdcbfa36d1fc30b76b7ea" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/源代码/StgSharpC/x64/Debug/dllmain.nativecodeanalysis.xml b/源代码/StgSharpC/x64/Debug/dllmain.nativecodeanalysis.xml new file mode 100644 index 00000000..dcdf0885 --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/dllmain.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/源代码/StgSharpC/x64/Debug/dllmain.obj b/源代码/StgSharpC/x64/Debug/dllmain.obj index d233980b..63967de6 100644 Binary files a/源代码/StgSharpC/x64/Debug/dllmain.obj and b/源代码/StgSharpC/x64/Debug/dllmain.obj differ diff --git a/源代码/StgSharpC/x64/Debug/dllmain.sbr b/源代码/StgSharpC/x64/Debug/dllmain.sbr index daf24c3d..6a04eb52 100644 Binary files a/源代码/StgSharpC/x64/Debug/dllmain.sbr and b/源代码/StgSharpC/x64/Debug/dllmain.sbr differ diff --git a/源代码/StgSharpC/x64/Debug/mat2.nativecodeanalysis.sarif b/源代码/StgSharpC/x64/Debug/mat2.nativecodeanalysis.sarif new file mode 100644 index 00000000..0f66c46f --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/mat2.nativecodeanalysis.sarif @@ -0,0 +1,99 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.39.33523.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/mat2.c" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "ef359aeba66abe5a161203c02317f5027512f7ea8ec5002f18ae66f721242b91" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/stgsharpc.h" + }, + "hashes": { + "sha-256": "46efce7e03c053a63fbaec27d92f7ef754e5c368b9bf3dde60683b99f109903e" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/ssgc_framework.h" + }, + "hashes": { + "sha-256": "fc75606e68c89d5e890316fa9798fa5f209e9f7f1596cac315f24f5016d20652" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/ssgc_internal.h" + }, + "hashes": { + "sha-256": "f9a595a71140053e0ff25ce143983b905d9b3ad9c672d8752845364a8a2c7807" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/gl.h" + }, + "hashes": { + "sha-256": "0d4da36d20ceb98804584beb77fdde6923c48c83e032fa453d459af2ff5dd1dc" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/khrplatform.h" + }, + "hashes": { + "sha-256": "7b1e01aaa7ad8f6fc34b5c7bdf79ebf5189bb09e2c4d2e79fc5d350623d11e83" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/wgl.h" + }, + "hashes": { + "sha-256": "f2c2c934cc6135662cf9bbbfab774fc4609a7fbd827b1a688455d813854f514b" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/glfw3.h" + }, + "hashes": { + "sha-256": "a1ac46397841f26f8bc290ea1496d1009b65862ded7944567cd7830015d4b376" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/stb_image.h" + }, + "hashes": { + "sha-256": "3249df7a8c1996a53cff688577b835d0f3fcd05a599fdcbfa36d1fc30b76b7ea" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/源代码/StgSharpC/x64/Debug/mat2.nativecodeanalysis.xml b/源代码/StgSharpC/x64/Debug/mat2.nativecodeanalysis.xml new file mode 100644 index 00000000..dcdf0885 --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/mat2.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/源代码/StgSharpC/x64/Debug/mat2.obj b/源代码/StgSharpC/x64/Debug/mat2.obj index 68597f7b..dd82fb8f 100644 Binary files a/源代码/StgSharpC/x64/Debug/mat2.obj and b/源代码/StgSharpC/x64/Debug/mat2.obj differ diff --git a/源代码/StgSharpC/x64/Debug/mat2.sbr b/源代码/StgSharpC/x64/Debug/mat2.sbr index 86631fca..4d110c80 100644 Binary files a/源代码/StgSharpC/x64/Debug/mat2.sbr and b/源代码/StgSharpC/x64/Debug/mat2.sbr differ diff --git a/源代码/StgSharpC/x64/Debug/mat3.nativecodeanalysis.sarif b/源代码/StgSharpC/x64/Debug/mat3.nativecodeanalysis.sarif new file mode 100644 index 00000000..ccbbece0 --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/mat3.nativecodeanalysis.sarif @@ -0,0 +1,99 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.39.33523.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/mat3.c" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "d4a90feb0ed209a93b7b285f0abf6159ef0a137362f765edd2f9e34196ff5666" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/stgsharpc.h" + }, + "hashes": { + "sha-256": "46efce7e03c053a63fbaec27d92f7ef754e5c368b9bf3dde60683b99f109903e" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/ssgc_framework.h" + }, + "hashes": { + "sha-256": "fc75606e68c89d5e890316fa9798fa5f209e9f7f1596cac315f24f5016d20652" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/ssgc_internal.h" + }, + "hashes": { + "sha-256": "f9a595a71140053e0ff25ce143983b905d9b3ad9c672d8752845364a8a2c7807" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/gl.h" + }, + "hashes": { + "sha-256": "0d4da36d20ceb98804584beb77fdde6923c48c83e032fa453d459af2ff5dd1dc" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/khrplatform.h" + }, + "hashes": { + "sha-256": "7b1e01aaa7ad8f6fc34b5c7bdf79ebf5189bb09e2c4d2e79fc5d350623d11e83" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/wgl.h" + }, + "hashes": { + "sha-256": "f2c2c934cc6135662cf9bbbfab774fc4609a7fbd827b1a688455d813854f514b" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/glfw3.h" + }, + "hashes": { + "sha-256": "a1ac46397841f26f8bc290ea1496d1009b65862ded7944567cd7830015d4b376" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/stb_image.h" + }, + "hashes": { + "sha-256": "3249df7a8c1996a53cff688577b835d0f3fcd05a599fdcbfa36d1fc30b76b7ea" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/源代码/StgSharpC/x64/Debug/mat3.nativecodeanalysis.xml b/源代码/StgSharpC/x64/Debug/mat3.nativecodeanalysis.xml new file mode 100644 index 00000000..dcdf0885 --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/mat3.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/源代码/StgSharpC/x64/Debug/mat3.obj b/源代码/StgSharpC/x64/Debug/mat3.obj index c4add583..1149a52d 100644 Binary files a/源代码/StgSharpC/x64/Debug/mat3.obj and b/源代码/StgSharpC/x64/Debug/mat3.obj differ diff --git a/源代码/StgSharpC/x64/Debug/mat3.sbr b/源代码/StgSharpC/x64/Debug/mat3.sbr index 683309c9..ace52265 100644 Binary files a/源代码/StgSharpC/x64/Debug/mat3.sbr and b/源代码/StgSharpC/x64/Debug/mat3.sbr differ diff --git a/源代码/StgSharpC/x64/Debug/mat4.nativecodeanalysis.sarif b/源代码/StgSharpC/x64/Debug/mat4.nativecodeanalysis.sarif new file mode 100644 index 00000000..8208386c --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/mat4.nativecodeanalysis.sarif @@ -0,0 +1,99 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.39.33523.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/mat4.c" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "d961704d2c358a7810a70fb91c4488d4076d761c29609d9601bb7acbb6e0b493" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/stgsharpc.h" + }, + "hashes": { + "sha-256": "46efce7e03c053a63fbaec27d92f7ef754e5c368b9bf3dde60683b99f109903e" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/ssgc_framework.h" + }, + "hashes": { + "sha-256": "fc75606e68c89d5e890316fa9798fa5f209e9f7f1596cac315f24f5016d20652" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/ssgc_internal.h" + }, + "hashes": { + "sha-256": "f9a595a71140053e0ff25ce143983b905d9b3ad9c672d8752845364a8a2c7807" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/gl.h" + }, + "hashes": { + "sha-256": "0d4da36d20ceb98804584beb77fdde6923c48c83e032fa453d459af2ff5dd1dc" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/khrplatform.h" + }, + "hashes": { + "sha-256": "7b1e01aaa7ad8f6fc34b5c7bdf79ebf5189bb09e2c4d2e79fc5d350623d11e83" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/wgl.h" + }, + "hashes": { + "sha-256": "f2c2c934cc6135662cf9bbbfab774fc4609a7fbd827b1a688455d813854f514b" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/glfw3.h" + }, + "hashes": { + "sha-256": "a1ac46397841f26f8bc290ea1496d1009b65862ded7944567cd7830015d4b376" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/stb_image.h" + }, + "hashes": { + "sha-256": "3249df7a8c1996a53cff688577b835d0f3fcd05a599fdcbfa36d1fc30b76b7ea" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/源代码/StgSharpC/x64/Debug/mat4.nativecodeanalysis.xml b/源代码/StgSharpC/x64/Debug/mat4.nativecodeanalysis.xml new file mode 100644 index 00000000..dcdf0885 --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/mat4.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/源代码/StgSharpC/x64/Debug/mat4.obj b/源代码/StgSharpC/x64/Debug/mat4.obj index 9df381d1..536d7225 100644 Binary files a/源代码/StgSharpC/x64/Debug/mat4.obj and b/源代码/StgSharpC/x64/Debug/mat4.obj differ diff --git a/源代码/StgSharpC/x64/Debug/mat4.sbr b/源代码/StgSharpC/x64/Debug/mat4.sbr index e21d86e6..8c7409bb 100644 Binary files a/源代码/StgSharpC/x64/Debug/mat4.sbr and b/源代码/StgSharpC/x64/Debug/mat4.sbr differ diff --git a/源代码/StgSharpC/x64/Debug/stb_image.nativecodeanalysis.sarif b/源代码/StgSharpC/x64/Debug/stb_image.nativecodeanalysis.sarif new file mode 100644 index 00000000..7ab85b85 --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/stb_image.nativecodeanalysis.sarif @@ -0,0 +1,97 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [ + { + "ruleId": "C6262", + "message": { + "text": "函数使用堆叠的 \"35036\" 字节。请考虑将一些数据移动到堆。" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///D:/NitloadIndustry/研究项目/1-Flagship/TH2020/ProjectFile/源代码/StgSharpC/stb_image.c" + }, + "region": { + "startLine": 6525, + "startColumn": 14 + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "stbi__load_gif_main", + "decoratedName": "stbi__load_gif_main", + "kind": "function" + } + ] + } + ] + }, + { + "ruleId": "C6262", + "message": { + "text": "函数使用堆叠的 \"34980\" 字节。请考虑将一些数据移动到堆。" + }, + "locations": [ + { + "physicalLocation": { + "artifactLocation": { + "uri": "file:///D:/NitloadIndustry/研究项目/1-Flagship/TH2020/ProjectFile/源代码/StgSharpC/stb_image.c" + }, + "region": { + "startLine": 6612, + "startColumn": 14 + } + }, + "logicalLocations": [ + { + "fullyQualifiedName": "stbi__gif_load", + "decoratedName": "stbi__gif_load", + "kind": "function" + } + ] + } + ] + } + ], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.39.33523.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///D:/NitloadIndustry/研究项目/1-Flagship/TH2020/ProjectFile/源代码/StgSharpC/stb_image.c" + }, + "roles": [ + "analysisTarget", + "resultFile" + ], + "hashes": { + "sha-256": "4fc54859a0df9ecaf5e5bc4c24148eddecce0314a8d8275559204b2b67c9454b" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/stb_image.h" + }, + "hashes": { + "sha-256": "3249df7a8c1996a53cff688577b835d0f3fcd05a599fdcbfa36d1fc30b76b7ea" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/源代码/StgSharpC/x64/Debug/stb_image.nativecodeanalysis.xml b/源代码/StgSharpC/x64/Debug/stb_image.nativecodeanalysis.xml new file mode 100644 index 00000000..2dcc657d --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/stb_image.nativecodeanalysis.xml @@ -0,0 +1,31 @@ + + + + + D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\ + stb_image.c + 6525 + 13 + + 6262 + 函数使用堆叠的 "35036" 字节。请考虑将一些数据移动到堆。 + stbi__load_gif_main + stbi__load_gif_main + 6525 + + + + + D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\ + stb_image.c + 6612 + 13 + + 6262 + 函数使用堆叠的 "34980" 字节。请考虑将一些数据移动到堆。 + stbi__gif_load + stbi__gif_load + 6612 + + + \ No newline at end of file diff --git a/源代码/StgSharpC/x64/Debug/stb_image.obj b/源代码/StgSharpC/x64/Debug/stb_image.obj index 782a9121..f3174b6a 100644 Binary files a/源代码/StgSharpC/x64/Debug/stb_image.obj and b/源代码/StgSharpC/x64/Debug/stb_image.obj differ diff --git a/源代码/StgSharpC/x64/Debug/vc.nativecodeanalysis.all.xml b/源代码/StgSharpC/x64/Debug/vc.nativecodeanalysis.all.xml new file mode 100644 index 00000000..3881b5ba --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/vc.nativecodeanalysis.all.xml @@ -0,0 +1,40 @@ + + + D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\ + stb_image.c + 6525 + 13 + + 6262 + 函数使用堆叠的 "35036" 字节。请考虑将一些数据移动到堆。 + stbi__load_gif_main + stbi__load_gif_main + 6525 + + + + D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\ + stb_image.c + 6612 + 13 + + 6262 + 函数使用堆叠的 "34980" 字节。请考虑将一些数据移动到堆。 + stbi__gif_load + stbi__gif_load + 6612 + + + + D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\ + StgSharpC.c + 33 + 12 + + 6282 + 运算符不正确。 + loadGlfuncDefault + loadGlfuncDefault + 29 + + \ No newline at end of file diff --git a/源代码/StgSharpC/x64/Debug/vc143.idb b/源代码/StgSharpC/x64/Debug/vc143.idb index 81f7e4f1..e696559a 100644 Binary files a/源代码/StgSharpC/x64/Debug/vc143.idb and b/源代码/StgSharpC/x64/Debug/vc143.idb differ diff --git a/源代码/StgSharpC/x64/Debug/vc143.pdb b/源代码/StgSharpC/x64/Debug/vc143.pdb index 2144260c..4cbab6cb 100644 Binary files a/源代码/StgSharpC/x64/Debug/vc143.pdb and b/源代码/StgSharpC/x64/Debug/vc143.pdb differ diff --git a/源代码/StgSharpC/x64/Debug/vector.nativecodeanalysis.sarif b/源代码/StgSharpC/x64/Debug/vector.nativecodeanalysis.sarif new file mode 100644 index 00000000..649107b3 --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/vector.nativecodeanalysis.sarif @@ -0,0 +1,99 @@ +{ + "version": "2.1.0", + "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json", + "runs": [ + { + "results": [], + "tool": { + "driver": { + "name": "PREfast", + "fullName": "PREfast Code Analysis", + "version": "14.39.33523.0", + "informationUri": "https://aka.ms/cpp/ca" + } + }, + "invocations": [ + { + "executionSuccessful": true + } + ], + "artifacts": [ + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/vector.c" + }, + "roles": [ + "analysisTarget" + ], + "hashes": { + "sha-256": "fd0d2ec5f700a3ac16bd1d1cb9ebbaea5ec24ac58e6c3cac4a7d58fb279084ef" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/stgsharpc.h" + }, + "hashes": { + "sha-256": "46efce7e03c053a63fbaec27d92f7ef754e5c368b9bf3dde60683b99f109903e" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/ssgc_framework.h" + }, + "hashes": { + "sha-256": "fc75606e68c89d5e890316fa9798fa5f209e9f7f1596cac315f24f5016d20652" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/ssgc_internal.h" + }, + "hashes": { + "sha-256": "f9a595a71140053e0ff25ce143983b905d9b3ad9c672d8752845364a8a2c7807" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/gl.h" + }, + "hashes": { + "sha-256": "0d4da36d20ceb98804584beb77fdde6923c48c83e032fa453d459af2ff5dd1dc" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/khrplatform.h" + }, + "hashes": { + "sha-256": "7b1e01aaa7ad8f6fc34b5c7bdf79ebf5189bb09e2c4d2e79fc5d350623d11e83" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/wgl.h" + }, + "hashes": { + "sha-256": "f2c2c934cc6135662cf9bbbfab774fc4609a7fbd827b1a688455d813854f514b" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/glfw3.h" + }, + "hashes": { + "sha-256": "a1ac46397841f26f8bc290ea1496d1009b65862ded7944567cd7830015d4b376" + } + }, + { + "location": { + "uri": "file:///d:/nitloadindustry/研究项目/1-flagship/th2020/projectfile/源代码/stgsharpc/stb_image.h" + }, + "hashes": { + "sha-256": "3249df7a8c1996a53cff688577b835d0f3fcd05a599fdcbfa36d1fc30b76b7ea" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/源代码/StgSharpC/x64/Debug/vector.nativecodeanalysis.xml b/源代码/StgSharpC/x64/Debug/vector.nativecodeanalysis.xml new file mode 100644 index 00000000..dcdf0885 --- /dev/null +++ b/源代码/StgSharpC/x64/Debug/vector.nativecodeanalysis.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/源代码/StgSharpC/x64/Debug/vector.obj b/源代码/StgSharpC/x64/Debug/vector.obj index aa532aa0..c12a8c78 100644 Binary files a/源代码/StgSharpC/x64/Debug/vector.obj and b/源代码/StgSharpC/x64/Debug/vector.obj differ diff --git a/源代码/StgSharpC/x64/Debug/vector.sbr b/源代码/StgSharpC/x64/Debug/vector.sbr index 5fe35076..4e24d705 100644 Binary files a/源代码/StgSharpC/x64/Debug/vector.sbr and b/源代码/StgSharpC/x64/Debug/vector.sbr differ diff --git a/源代码/StgSharp/Logic/BluePaint.cs b/源代码/StgSharpDebug/Controlling/Controls/BattleField.cs similarity index 79% rename from 源代码/StgSharp/Logic/BluePaint.cs rename to 源代码/StgSharpDebug/Controlling/Controls/BattleField.cs index 771822d9..ff413cbc 100644 --- a/源代码/StgSharp/Logic/BluePaint.cs +++ b/源代码/StgSharpDebug/Controlling/Controls/BattleField.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="BluePaint.cs" +// file="BattleField.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -28,37 +28,29 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- +using StgSharp.Geometries; +using StgSharp.Graphics; using StgSharp.Logic; +using StgSharp.Math; using System; using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; -namespace StgSharpDebug.Logic +//TODO 这玩意如何加载一个渲染流程以获得各个图元还没搞清楚 + +namespace StgSharp.Controls { - public class BluePaint + public class BattleField : ControllingItem { - - private bool running; - private List allNode; - - private BluePaintNode beginNode; - - public bool IsRunning + public override vec4d[] TextureBox { - get => running; set => running = value; + get ; } - public void Start() + public override IEnumerator GetEnumerator() { - foreach (var pipeline in beginNode.OutputInterface) - { - - - } + throw new NotImplementedException(); } - } } diff --git a/源代码/StgSharpDebug/Controlling/Controls/ButtonGroup.cs b/源代码/StgSharpDebug/Controlling/Controls/ButtonGroup.cs new file mode 100644 index 00000000..7342c1fc --- /dev/null +++ b/源代码/StgSharpDebug/Controlling/Controls/ButtonGroup.cs @@ -0,0 +1,71 @@ +using StgSharp.Geometries; +using StgSharp.Graphics; +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; + +namespace StgSharp.Controls +{ + public class KeyboardButtonGroup : ControllingItem + { + private List buttonList; + + private TriggerButton current; + + public KeyboardButtonGroup() + { + buttonList = new List(); + } + + public void AddButton(TriggerButton button) + { + buttonList.Add(button); + } + + public TriggerButton CurrentButton + { + get => current; + } + public override vec4d[] TextureBox + { + get => throw new NotSupportedException(); + } + + public void MoveLeft() + { + + } + + public void MoveRight() + { + + } + + public void MoveUp() + { + + } + + public void MoveDown() + { + + } + + public void Confirm() + { + + } + + public override IEnumerator GetEnumerator() + { + foreach (var item in buttonList) + { + yield return item.Single(); + } + } + } +} diff --git a/源代码/StgSharpDebug/Controlling/Controls/CharacterIndexImage.cs b/源代码/StgSharpDebug/Controlling/Controls/CharacterIndexImage.cs new file mode 100644 index 00000000..35f1081b --- /dev/null +++ b/源代码/StgSharpDebug/Controlling/Controls/CharacterIndexImage.cs @@ -0,0 +1,62 @@ +using StgSharp.Geometries; +using StgSharp.Graphics; +using StgSharp.Math; + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Text; + +namespace StgSharp.Controls +{ + public class CharacterLineIndexImage : ControllingItem + { + private int length; + private char[] displayIndex; + private char defaultChar; + + Dictionary texIndex; + PlainGeometryMesh _tittleMesh; + + public override vec4d[] TextureBox + { + get => throw new NotSupportedException(); + } + + public void Display(string message) + { + if (string.IsNullOrEmpty(message)) + { + message = string.Empty; + } + + string result = message.Length >= length ? + message.Substring(message.Length - displayIndex.Length) : + message.PadLeft(length,defaultChar); + + displayIndex = result.ToCharArray(); + } + + public override IEnumerator GetEnumerator() + { + yield return _tittleMesh; + foreach (char item in displayIndex) + { + yield return texIndex[item]; + } + } + + public CharacterLineIndexImage( + int length, char defaultChar, PlainGeometryMesh tittleMesh, + IEnumerable<(char, PlainGeometryMesh)> indexEnumeration) + { + this.length = length; + displayIndex = new char[length]; + _tittleMesh = tittleMesh; + texIndex = indexEnumeration.ToDictionary(item => item.Item1, item => item.Item2); + } + + } +} diff --git a/源代码/StgSharpDebug/Controlling/Controls/ControllingIntem.cs b/源代码/StgSharpDebug/Controlling/Controls/ControllingIntem.cs new file mode 100644 index 00000000..66945e17 --- /dev/null +++ b/源代码/StgSharpDebug/Controlling/Controls/ControllingIntem.cs @@ -0,0 +1,27 @@ +using StgSharp.Geometries; +using StgSharp.Graphics; +using StgSharp.Math; + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Controls +{ + public abstract partial class ControllingItem: IEnumerable + { + public vec2d Position { get; set; } + + public Rectangle BoundingBox { get; set; } + public abstract vec4d[] TextureBox { get; } + + + public abstract IEnumerator GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/源代码/StgSharpDebug/Controlling/Controls/DecorationBox.cs b/源代码/StgSharpDebug/Controlling/Controls/DecorationBox.cs new file mode 100644 index 00000000..bce85ff0 --- /dev/null +++ b/源代码/StgSharpDebug/Controlling/Controls/DecorationBox.cs @@ -0,0 +1,31 @@ +using StgSharp.Controls; +using StgSharp.Geometries; +using StgSharp.Graphics; +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Controls +{ + public class DecorationBox : ControllingItem + { + private PlainGeometryMesh renderMesh; + + public override vec4d[] TextureBox + { + get => renderMesh.TextureCoord; + } + + public override IEnumerator GetEnumerator() + { + yield return renderMesh; + } + + public DecorationBox(Rectangle bound, Image texture, vec4d[] texCoord) + { + renderMesh = new PlainGeometryMesh(BoundingBox, texture, texCoord); + } + } +} diff --git a/源代码/StgSharpDebug/Controlling/Controls/MarkingLable.cs b/源代码/StgSharpDebug/Controlling/Controls/MarkingLable.cs new file mode 100644 index 00000000..58a9a248 --- /dev/null +++ b/源代码/StgSharpDebug/Controlling/Controls/MarkingLable.cs @@ -0,0 +1,50 @@ +using StgSharp.Controls; +using StgSharp.Geometries; +using StgSharp.Graphics; +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; + +namespace StgSharp.Controls +{ + public class MarkingLabel : ControllingItem + { + public override vec4d[] TextureBox + { + get => marker.TextureCoord; + } + + private vec2d _currentPosition, _movementVec; + + private TimeFunction _movement; + private PlainGeometryMesh marker; + + public void MoveTo(vec2d target) + { + Move(target - Position); + } + + public void Move(vec2d movement) + { + if (!_movement.IsComplete) + { + Position = _currentPosition + _movement.Calculate() * _movementVec; + } + } + + public MarkingLabel(PlainGeometryMesh marker, TimeFunction movement) + { + this.marker = marker; + _movement = movement; + } + + public override IEnumerator GetEnumerator() + { + yield return marker; + } + } + +} diff --git a/源代码/StgSharp/Controlling/Controls/KeyboardButton.cs b/源代码/StgSharpDebug/Controlling/Controls/TriggerButton.cs similarity index 84% rename from 源代码/StgSharp/Controlling/Controls/KeyboardButton.cs rename to 源代码/StgSharpDebug/Controlling/Controls/TriggerButton.cs index 1304c498..876fbce9 100644 --- a/源代码/StgSharp/Controlling/Controls/KeyboardButton.cs +++ b/源代码/StgSharpDebug/Controlling/Controls/TriggerButton.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="KeyboardButton.cs" +// file="TriggerButton.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -39,18 +39,24 @@ using System.Text; namespace StgSharp.Controls { - public class KeyboardButton : ControllingItem + public class TriggerButton : ControllingItem { - private PlainGeometryMesh current; private AnimationBuilder switchAnimationBuilder; +#nullable enable private Action? enableAction; private Action? disableAction; private Action? confirmAction; +#nullable restore + + public override vec4d[] TextureBox + { + get { return switchAnimationBuilder.TextureFrame.VertexStream; } + } public bool IsHighLighted { get; internal set; } public bool IsDisabled { get; internal set; } - + public event Action EnableEvent { add { enableAction += value; } @@ -75,7 +81,7 @@ namespace StgSharp.Controls { return; } - if (switchAnimationBuilder.IsComplete || switchAnimationBuilder == null) + if (switchAnimationBuilder == null || switchAnimationBuilder.IsComplete) { switchAnimationBuilder = animation; } @@ -84,7 +90,7 @@ namespace StgSharp.Controls public void Disable(AnimationBuilder animation) { - if (switchAnimationBuilder.IsComplete || switchAnimationBuilder == null) + if (switchAnimationBuilder == null || switchAnimationBuilder.IsComplete) { switchAnimationBuilder = animation; } @@ -93,7 +99,7 @@ namespace StgSharp.Controls public void Highlight(AnimationBuilder animation) { - if (switchAnimationBuilder.IsComplete || switchAnimationBuilder == null) + if (switchAnimationBuilder == null || switchAnimationBuilder.IsComplete) { switchAnimationBuilder = animation; } @@ -102,8 +108,8 @@ namespace StgSharp.Controls public override IEnumerator GetEnumerator() { - current.Texture = switchAnimationBuilder.GetAnimationFrame(); - yield return current; + yield return new PlainGeometryMesh(this.BoundingBox, switchAnimationBuilder.GetAnimationFrame(), + this.TextureBox); } }//----------------------------------- End of class -------------------------------------------- diff --git a/源代码/StgSharpDebug/Controlling/Designer.cs b/源代码/StgSharpDebug/Controlling/Designer.cs new file mode 100644 index 00000000..3d05953e --- /dev/null +++ b/源代码/StgSharpDebug/Controlling/Designer.cs @@ -0,0 +1,72 @@ +using StgSharp.Geometries; +using StgSharp.Graphics; +using StgSharp.Controls; +using StgSharp.Controlling.UsrActivity; +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Net; +using System.Text; + +namespace StgSharp.Graphics +{ + public class ViewPortDesigner + { + private KeyboardButtonGroup currentButtonGroup; + + private List _controlList; + + public ViewPortDesigner() + { + _controlList = new List(); + } + + public KeyboardButtonGroup CreateKeyboardButtonGroup( + ITrigger leftBidning, + ITrigger rightBinding, + ITrigger upBinding, + ITrigger downBinding, + ITrigger confirmBinding + ) + { + var ret = new KeyboardButtonGroup(); + _controlList.Add(ret); + currentButtonGroup = ret; + return ret; + } + + public TriggerButton CreateKeyboardButton( + Rectangle bonding, AnimationBuilder defaultAnimation, bool isEnable + ) + { + var ret = new TriggerButton(); + ret.BoundingBox = bonding; + if (isEnable) + { + ret.IsDisabled = false; + ret.Enable(defaultAnimation); + } + else + { + ret.IsDisabled = true; + ret.Disable(defaultAnimation); + } + currentButtonGroup.AddButton(ret); + return ret; + } + + + + public CharacterLineIndexImage CreateCharacterLine( + int length, char blankFilling, PlainGeometryMesh tittle, IEnumerable<(char,PlainGeometryMesh)> charList + ) + { + var ret = new CharacterLineIndexImage(length, blankFilling,tittle,charList); + _controlList.Add(ret); + return ret; + } + + }//---------------------------------- End of Class ----------------------------------------- + +} diff --git a/源代码/StgSharp/Control/Get.cs b/源代码/StgSharpDebug/Controlling/Get.cs similarity index 91% rename from 源代码/StgSharp/Control/Get.cs rename to 源代码/StgSharpDebug/Controlling/Get.cs index 6165bac5..3c11f5c9 100644 --- a/源代码/StgSharp/Control/Get.cs +++ b/源代码/StgSharpDebug/Controlling/Get.cs @@ -28,14 +28,14 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- -using StgSharp.Controlling; + using StgSharp.Graphics; using StgSharp.Logic; using StgSharp.Math; namespace StgSharp.Graphics { - public partial class Form + public partial class View { /// @@ -44,9 +44,9 @@ namespace StgSharp.Graphics /// /// /// - public static KeyStatus GetKeyStatus(Form form, KeyboardKey key) + public static KeyStatus GetKeyStatus(ViewModelBase form, KeyboardKey key) { - return InternalIO.glfwGetKey(form.id, (int)key); + return InternalIO.glfwGetKey(form.WindowID, (int)key); } } diff --git a/源代码/StgSharp/Control/IO/GLIO.cs b/源代码/StgSharpDebug/Controlling/IO/GLIO.cs similarity index 99% rename from 源代码/StgSharp/Control/IO/GLIO.cs rename to 源代码/StgSharpDebug/Controlling/IO/GLIO.cs index ac8bd1a8..ecb885a6 100644 --- a/源代码/StgSharp/Control/IO/GLIO.cs +++ b/源代码/StgSharpDebug/Controlling/IO/GLIO.cs @@ -28,7 +28,7 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- -using StgSharp.Controlling; + using StgSharp.Graphics; using StgSharp.Math; @@ -670,7 +670,7 @@ namespace StgSharp.Graphics internal unsafe delegate* glGenQueries; internal unsafe delegate* glGenQueriesARB; internal unsafe delegate* glGenQueryResourceTagNV; - internal unsafe delegate* glGenRenderbuffers; + internal unsafe delegate* glGenRenderbuffers; internal unsafe delegate* glGenRenderbuffersEXT; internal unsafe delegate* glGenSamplers; internal unsafe delegate* glGenSemaphoresEXT; @@ -1746,16 +1746,16 @@ namespace StgSharp.Graphics internal unsafe delegate* glRasterSamplesEXT; internal unsafe delegate* glReadBuffer; internal unsafe delegate* glReadInstrumentsSGIX; - internal unsafe delegate* glReadPixels; - internal unsafe delegate* glReadnPixels; - internal unsafe delegate* glReadnPixelsARB; + internal unsafe delegate* glReadPixels; + internal unsafe delegate* glReadnPixels; + internal unsafe delegate* glReadnPixelsARB; internal unsafe delegate* glRectxOES; internal unsafe delegate* glRectxvOES; internal unsafe delegate* glReferencePlaneSGIX; internal unsafe delegate* glReleaseKeyedMutexWin32EXT; internal unsafe delegate* glReleaseShaderCompiler; internal unsafe delegate* glRenderGpuMaskNV; - internal unsafe delegate* glRenderbufferStorage; + internal unsafe delegate* glRenderbufferStorage; internal unsafe delegate* glRenderbufferStorageEXT; internal unsafe delegate* glRenderbufferStorageMultisample; internal unsafe delegate* glRenderbufferStorageMultisampleAdvancedAMD; diff --git a/源代码/StgSharp/Control/IO/InternalIO.cs b/源代码/StgSharpDebug/Controlling/IO/InternalIO.cs similarity index 99% rename from 源代码/StgSharp/Control/IO/InternalIO.cs rename to 源代码/StgSharpDebug/Controlling/IO/InternalIO.cs index f9c7e230..b3a37e34 100644 --- a/源代码/StgSharp/Control/IO/InternalIO.cs +++ b/源代码/StgSharpDebug/Controlling/IO/InternalIO.cs @@ -30,6 +30,7 @@ //----------------------------------------------------------------------- using StgSharp.Geometries; using StgSharp.Graphics; +using StgSharp.Graphics.GL; using System; using System.Collections.Generic; @@ -52,10 +53,9 @@ namespace StgSharp InfoError, InfoWarning, } - + internal static unsafe partial class InternalIO { - internal const string SS_errorLog = "SS_errorlog.log"; diff --git a/源代码/StgSharp/Control/KeyControl.cs b/源代码/StgSharpDebug/Controlling/KeyControl.cs similarity index 99% rename from 源代码/StgSharp/Control/KeyControl.cs rename to 源代码/StgSharpDebug/Controlling/KeyControl.cs index d97f555d..78a68c75 100644 --- a/源代码/StgSharp/Control/KeyControl.cs +++ b/源代码/StgSharpDebug/Controlling/KeyControl.cs @@ -143,7 +143,7 @@ namespace StgSharp NumPad8 = 328, NumPad9 = 329, NumPadDec = 330, - NumPadSiv = 331, + NumPadDiv = 331, NumPadMul = 332, NumPadSub = 333, NumPadAdd = 334, diff --git a/源代码/StgSharp/Control/KeyEventAttribute.cs b/源代码/StgSharpDebug/Controlling/KeyEventAttribute.cs similarity index 100% rename from 源代码/StgSharp/Control/KeyEventAttribute.cs rename to 源代码/StgSharpDebug/Controlling/KeyEventAttribute.cs diff --git a/源代码/StgSharpDebug/Controlling/UsrActivity/ITrigger.cs b/源代码/StgSharpDebug/Controlling/UsrActivity/ITrigger.cs new file mode 100644 index 00000000..1b9b7aa8 --- /dev/null +++ b/源代码/StgSharpDebug/Controlling/UsrActivity/ITrigger.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Controlling.UsrActivity +{ + public interface ITrigger + { + public int TargetKeyOrButtonID { get; } + public KeyStatus TriggeredStatus { get; } + } +} diff --git a/源代码/StgSharpDebug/Controlling/UsrActivity/JoystickTrigger.cs b/源代码/StgSharpDebug/Controlling/UsrActivity/JoystickTrigger.cs new file mode 100644 index 00000000..fd591bae --- /dev/null +++ b/源代码/StgSharpDebug/Controlling/UsrActivity/JoystickTrigger.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Controlling.UsrActivity +{ + public struct JoystickTrigger : ITrigger, IEquatable + { + public Joystick Stick; + + private KeyStatus _triggeredStat; + + public int TargetKeyOrButtonID => (int)Stick; + + public KeyStatus TriggeredStatus => _triggeredStat; + + public JoystickTrigger(Joystick targetKey) + { + this.Stick = targetKey; + } + + public static bool operator ==(JoystickTrigger left, JoystickTrigger right) + { + return left._triggeredStat == right._triggeredStat && left.Stick == right.Stick; + } + + public static bool operator !=(JoystickTrigger left, JoystickTrigger right) + { + return !(left == right); + } + + public override bool Equals(object obj) + { + return base.Equals(obj); + } + + public override int GetHashCode() + { + return (int)Stick + 17 * (int)_triggeredStat; + } + + public override string ToString() + { + return $"Key {Stick} triggered when {_triggeredStat}"; + } + + bool IEquatable.Equals(JoystickTrigger other) + { + return other == this; + } + } +} diff --git a/源代码/StgSharpDebug/Controlling/UsrActivity/KeyTrigger.cs b/源代码/StgSharpDebug/Controlling/UsrActivity/KeyTrigger.cs new file mode 100644 index 00000000..99a1b244 --- /dev/null +++ b/源代码/StgSharpDebug/Controlling/UsrActivity/KeyTrigger.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Data.Common; +using System.Text; + +namespace StgSharp.Controlling.UsrActivity +{ + + public struct KeyTrigger: ITrigger,IEquatable + { + public KeyboardKey TargetKey; + private KeyStatus _triggerStat; + + int ITrigger.TargetKeyOrButtonID => (int)TargetKey; + + KeyStatus ITrigger.TriggeredStatus => _triggerStat; + + public KeyTrigger(KeyboardKey targetKey) + { + this.TargetKey = targetKey; + } + + public static bool operator ==(KeyTrigger left, KeyTrigger right) + { + return left._triggerStat == right._triggerStat && left.TargetKey == right.TargetKey; + } + + public static bool operator !=(KeyTrigger left, KeyTrigger right) + { + return !(left == right); + } + + public override bool Equals(object obj) + { + return base.Equals(obj); + } + + public override int GetHashCode() + { + return (int)TargetKey + 17 * (int)_triggerStat; + } + + public override string ToString() + { + return $"Key {TargetKey} triggered when {_triggerStat}"; + } + + bool IEquatable.Equals(KeyTrigger other) + { + return other == this; + } + } +} diff --git a/源代码/StgSharpDebug/Data/GlobalData/root.cs b/源代码/StgSharpDebug/Data/GlobalData/root.cs new file mode 100644 index 00000000..3e78efc6 --- /dev/null +++ b/源代码/StgSharpDebug/Data/GlobalData/root.cs @@ -0,0 +1,27 @@ +using StgSharp.Data; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp +{ + public static unsafe partial class StgSharp + { + private static SSD defaultIdProvider = new SSD(); + private static List root = new List(); + + private static byte leastUnusedArea; + + public static byte NewArea() + { + byte ret = leastUnusedArea; + leastUnusedArea++; + return ret; + } + + + }//------------------ end of class --------------------- +} diff --git a/源代码/StgSharpDebug/Data/IMemoryType.cs b/源代码/StgSharpDebug/Data/IMemoryType.cs new file mode 100644 index 00000000..d7556d10 --- /dev/null +++ b/源代码/StgSharpDebug/Data/IMemoryType.cs @@ -0,0 +1,60 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="IMemoryType.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Math +{ + public interface IMemoryType + { + + public T Read(int index) where T : struct +#if NET8_0_OR_GREATER + , INumber +#else + , IConvertible +#endif + ; + + public void Write(int index, T value) where T : struct +#if NET8_0_OR_GREATER + , INumber +#else + , IConvertible +#endif + ; + + + } +} diff --git a/源代码/StgSharpDebug/Data/InternalData.cs b/源代码/StgSharpDebug/Data/InternalData.cs new file mode 100644 index 00000000..cfc94781 --- /dev/null +++ b/源代码/StgSharpDebug/Data/InternalData.cs @@ -0,0 +1,14 @@ +using StgSharp; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp +{ + internal partial class InternalIO + { + internal const string CollisionTextureVertexShader ="#version 430 core\r\n\r\nlayout(location = 0) in vec2 localCollisionCoord;\r\nlayout(location = 1) in vec2 spaceCoord;\r\nlayout(location = 2) in float rotation;\r\nlayout(location = 3) in float scaling;\r\n\r\nuniform vec2 target;\r\nuniform mat2 projection;\r\n\r\nvoid main()\r\n{\r\n mat2 scaling = mat2(\r\n scaling,0,\r\n 0,scaling\r\n );\r\n mat2 rotation = mat2(\r\n cos(rotation),-sin(rotation),\r\n sin(rotation),cos(rotation) \r\n );\r\n vec2 realCoord = (rotation * scaling * localCollisionCoord) + spaceCoord - target;\r\n realCoord = projection * realCoord;\r\n\r\n float dist = distance(realCoord, vec2(0,0));\r\n float angle = atan(realCoord.y, realCoord.x);\r\n \r\n gl_Position = vec4(angle, realCoord.y, dist, 1);\r\n}"; + internal const string CollisionTextureFragmentShader = "#version 430 core\r\n\r\nout vec4 Color;\r\n\r\nuniform float range;\r\n\r\nvoid main()\r\n{\r\n float dist = gl_FragCoord.z;\r\n\r\n if(dist > range)\r\n {\r\n discard;\r\n }\r\n dist /= range;\r\n gl_FragDepth = min(dist, gl_FragDepth);\r\n\r\n Color = vec4(dist,0,0,1);\r\n}"; + } +} diff --git a/源代码/StgSharp/Math/Linear/M128.cs b/源代码/StgSharpDebug/Data/M128.cs similarity index 92% rename from 源代码/StgSharp/Math/Linear/M128.cs rename to 源代码/StgSharpDebug/Data/M128.cs index ae5773a5..9a720c97 100644 --- a/源代码/StgSharp/Math/Linear/M128.cs +++ b/源代码/StgSharpDebug/Data/M128.cs @@ -28,36 +28,44 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- +using StgSharp.Math; + using System; using System.Collections.Generic; -using System.Linq; using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - #if NET5_0_OR_GREATER - using System.Runtime.Intrinsics; - #endif - using System.Text; -using System.Threading.Tasks; -namespace StgSharp.Math +namespace StgSharp.Data { [StructLayout(LayoutKind.Explicit, Pack = 16)] - public unsafe struct M128 + public unsafe struct M128:IMemoryType { - [FieldOffset(0)] internal Vector4 vec; + internal M128(Vector4 v) + { + vec = v; + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public T Read(int index) where T : struct +#if NET8_0_OR_GREATER + , INumber +#else + , IConvertible +#endif + { fixed (Vector4* p = &vec) { +#pragma warning disable CS8500 return *(((T*)p) + index); +#pragma warning restore CS8500 } } @@ -80,14 +88,20 @@ namespace StgSharp.Math public void Write(int index, T value) where T : struct #if NET8_0_OR_GREATER , INumber +#else + ,IConvertible #endif { fixed (Vector4* p = &vec) { +#pragma warning disable CS8500 *(((T*)p) + index) = value; +#pragma warning restore CS8500 } } + + #if NET5_0_OR_GREATER [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -152,4 +166,4 @@ namespace StgSharp.Math #endif } -} \ No newline at end of file +} diff --git a/源代码/StgSharpDebug/Data/M256.cs b/源代码/StgSharpDebug/Data/M256.cs new file mode 100644 index 00000000..af2d8fb9 --- /dev/null +++ b/源代码/StgSharpDebug/Data/M256.cs @@ -0,0 +1,37 @@ +using StgSharp.Data; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Math.HighPrecession +{ + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct M256:IMemoryType + { + private M128 v0; + private M128 v1; + + + T IMemoryType.Read(int index) + { + fixed (M128* mptr = &v0) + { + return *(((T*)mptr) + index); + } + } + + void IMemoryType.Write(int index, T value) + { + fixed (M128* mptr = &v0) + { + *(((T*)mptr) + index) = value; + } + } + } +} diff --git a/源代码/StgSharpDebug/Data/RandomGenerator.cs b/源代码/StgSharpDebug/Data/RandomGenerator.cs new file mode 100644 index 00000000..e1d9acc1 --- /dev/null +++ b/源代码/StgSharpDebug/Data/RandomGenerator.cs @@ -0,0 +1,156 @@ +using StgSharp.Data; + +using System; +using System.IO; +using System.Numerics; +using System.Security.Cryptography; +using System.Text; +using System.Transactions; +using System.Xml; +using System.Xml.Serialization; + +namespace StgSharp.Data +{ + public class RandomGenerator + { + + + private readonly byte[] originKey; + private byte[] currentKey; + private int cycleCount; + private SHA512 hash; + + public RandomGenerator():this(DateTime.UtcNow.ToBinary()) + { + + } + + public RandomGenerator(object source) + { + try + { + if (source == null) + { + throw new ArgumentNullException(nameof(source)); + } + XmlSerializer s = new XmlSerializer(source.GetType()); + using (StringWriter sw = new StringWriter()) + { + s.Serialize(sw, source); + string data = sw.ToString(); + originKey = Encoding.UTF8.GetBytes(data); + } + } + catch (Exception) + { + throw; + } + hash = SHA512.Create(); + originKey = hash.ComputeHash(originKey); + currentKey = originKey; + cycleCount = 0; + } + + public int TotalGeneratedRandom + { + get => cycleCount; + } + + public unsafe int GenRandomInt() + { + M128 source = PrivateRand(); + cycleCount++; + + /* + float d0 = MathF.Sin(1 / source.Read(0)); + float d1 = MathF.Sin(1 / source.Read(1)); + float d2 = MathF.Sin(1 / source.Read(2)); + float d3 = MathF.Sin(1 / source.Read(3)); + + source.Write(0, *( short*)&d3); + source.Write(2, *((short*)&d2+1)); + source.Write(4, *( short*)&d1); + source.Write(6, *((short*)&d0+1)); + + /**/ + + return source.Read(cycleCount % 4); + } + + public float GenRandomSingle() + { + cycleCount++; + + while (true) + { + M128 source = PrivateRand(); + + uint + temp0 = source.Read(0), + temp1 = source.Read(2); + + if (temp0 * temp1 != 0) + { + float ret = (temp0 % temp1) * 1.0f / temp1; + if (ret < 0.335f) + { + ret = ret * (ret * -0.7811934f + 1.4489113f); + } + else + { + ret = ret * (ret * -0.1158368f + 1.0580600f) + 0.0590584f; + } + if (ret > 1) + { + continue; + } + return ret; + } + + } + + } + + public byte GenRandomInt8() + { + cycleCount++; + if (cycleCount % 64 == 0) + { + PrivateRand(); + } + return (byte)(currentKey[ cycleCount % 64 ]); + } + + private unsafe M128 PrivateRand() + { + currentKey = hash.ComputeHash(currentKey); + M128 ret; + fixed (byte* bptr = currentKey) + { + switch ((cycleCount % 16) / 4) + { + case 0: + ret= *((M128*)bptr + 0);break; + case 1: + ret= *((M128*)bptr + 1);break; + case 2: + ret= *((M128*)bptr + 2);break; + case 3: + ret= *((M128*)bptr + 3);break; + default: + throw new InvalidOperationException(); + } + } + //Console.WriteLine(ret.ToString(16)); + return ret; + } + + + public void Reset() + { + currentKey = originKey; + cycleCount = 0; + } + + } +} diff --git a/源代码/StgSharpDebug/Data/SSD/Area.cs b/源代码/StgSharpDebug/Data/SSD/Area.cs new file mode 100644 index 00000000..eb5b8c5b --- /dev/null +++ b/源代码/StgSharpDebug/Data/SSD/Area.cs @@ -0,0 +1,20 @@ +using StgSharp.Data.FileIO; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Data +{ + /// + /// An independent storage area, used as the only folder type in root folder. + /// Contains several files reference as virtual disc. + /// Data is actually stored in s in certain RAID mode. + /// + public partial class Area + { + + } +} diff --git a/源代码/StgSharpDebug/Data/SSD/DataHead.cs b/源代码/StgSharpDebug/Data/SSD/DataHead.cs new file mode 100644 index 00000000..0b131bbf --- /dev/null +++ b/源代码/StgSharpDebug/Data/SSD/DataHead.cs @@ -0,0 +1,89 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="DataHead.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.InteropServices; +using System.Security.Cryptography; +using System.Text; + +namespace StgSharp.Data +{ + + [StructLayout(LayoutKind.Explicit, Size = 16)] + public struct SSDSegmentHead + { + + [FieldOffset(0)] internal M128 data; + + [FieldOffset(0)] public int globalID; + [FieldOffset(4)] public int nextID; + [FieldOffset(8)] public int previousHash; + + + [FieldOffset(12)] internal byte size; + [FieldOffset(13)] public byte selfDefine_1; + [FieldOffset(14)] public byte selfDefine_2; + [FieldOffset(15)] public byte selfDefine_3; + + + public int Size + { + get => ((int)size) + 1; + set + { + if ((value > 256) || (value < 0)) + { + throw new ArgumentOutOfRangeException(); + } + size = (byte)(value - 1); + } + } + + public unsafe byte[] GetBytes() + { + byte[] ret = new byte[16]; + fixed (Vector4* vptr = &data.vec) + { + byte* bptr = (byte*)vptr; + for (int i = 0; i < 15; i++) + { + ret[i] = *bptr; + } + } + return ret; + } + + } + + +} diff --git a/源代码/StgSharpDebug/Data/SSD/DataSegment.cs b/源代码/StgSharpDebug/Data/SSD/DataSegment.cs new file mode 100644 index 00000000..649b7ac5 --- /dev/null +++ b/源代码/StgSharpDebug/Data/SSD/DataSegment.cs @@ -0,0 +1,195 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="DataSegment.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Data +{ + [StructLayout(LayoutKind.Explicit, Size = StgSharp.ssdSegmentLength * 16)] + public unsafe struct SSDSegment : IComparable, IComparable + { + + [FieldOffset(16)] public fixed byte Data[16 * (StgSharp.ssdSegmentLength - 1)]; + [FieldOffset(12)] public int DataHash; + [FieldOffset(8)] public int PreviousHash; + [FieldOffset(0 * 16)] public SSDSegmentHead Head; + + public SSDSegment(int previousHash) + { + this.PreviousHash = previousHash; + } + + public static SSDSegment FromStream(byte[] stream) + { + if (stream.Length != 16 * StgSharp.ssdSegmentLength) + { + throw new ArgumentException(); + } + SSDSegment ret = new SSDSegment(); + fixed (byte* bptr = stream) + { + ret.Head.data = *(M128*)bptr; + for (int i = 1; i < StgSharp.ssdSegmentLength; i++) + { + ret.WriteData(i - 1, *(M128*)(bptr + 16 * i)); + } + } + return ret; + } + + public byte this[int index] + { + get + { + if (index > (16 * (StgSharp.ssdSegmentLength - 1)) - 1) + { + throw new IndexOutOfRangeException(); + } + return Data[index]; + } + + set + { + if (index > (16 * (StgSharp.ssdSegmentLength - 1)) - 1) + { + throw new IndexOutOfRangeException(); + } + Data[index] = value; + } + } + + public int ID + { + get { return Head.globalID; } + set { Head.globalID = value; } + } + + public short Size => Head.size; + + public void FillRandomBytes(int begin) + { + if (begin > 255) + { + return; + } + for (int i = begin; i < 255; i++) + { + Data[i] = Scaler.Random(); //TODO: 使用STGSHARP内部随机数工具处理它 + } + } + + public byte[] GetBytes() + { + byte[] ret = new byte[16 * StgSharp.ssdSegmentLength]; + fixed (M128* mptr = &Head.data) + { + fixed (byte* aptr = ret) + { + Vector4* vsptr = (Vector4*)mptr; + Vector4* vtptr = (Vector4*)aptr; + for (int i = 0; i < 18; i++) + { + *(vtptr + i) = *(vsptr + i); + } + } + } + + return ret; + } + + public int GetDataHash() + { + Vector4 v = Vector4.One; + fixed (M128* mptr = &Head.data) + { + Vector4* vptr = (Vector4*)mptr; + for (int i = 0; i < StgSharp.ssdSegmentLength - 1; i += 1) + { + v += (*vptr) * 31; + } + } + M128 m = new M128(v); + DataHash = m.vec.GetHashCode(); + return DataHash; + } + + public override int GetHashCode() + { + int ret = 17; + fixed (M128* mptr = &Head.data) + { + Vector4* vptr = (Vector4*)mptr; + for (int i = 0; i < StgSharp.ssdSegmentLength; i++) + { + ret = (ret + (*vptr).GetHashCode()) * 31; + } + } + return ret; + } + + public unsafe T ReadData(int index) where T : struct + { + fixed (byte* bptr = Data) + { + T* tptr = (T*)bptr; + return *(tptr + index); + } + } + + public unsafe void WriteData(int index, T value) where T : struct + { + fixed (byte* bptr = Data) + { + T* tptr = (T*)bptr; + *(tptr + index) = value; + } + } + + int IComparable.CompareTo(int other) + { + return ID.CompareTo(other); + } + + int IComparable.CompareTo(SSDSegment other) + { + return ID.CompareTo(other.ID); + } + + } + +} diff --git a/源代码/StgSharpDebug/Data/SSD/SSD.cs b/源代码/StgSharpDebug/Data/SSD/SSD.cs new file mode 100644 index 00000000..f19147c2 --- /dev/null +++ b/源代码/StgSharpDebug/Data/SSD/SSD.cs @@ -0,0 +1,66 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="SSD.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Data.FileIO; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace StgSharp.Data +{ + public partial class SSD + { + private SSDrawHead head; + + private Dictionary fileList; + + private FileStream file; + + public SSD() + { + fileList = new Dictionary(); + } + + public SSD(FileStream fileStream) + { + fileList = new Dictionary(); + file = fileStream; + } + + public static SSD FromFile(string fileRoute) + { + return new SSD(new FileStream(fileRoute, FileMode.Open, FileAccess.Read)) { }; + } + + } + +} diff --git a/源代码/StgSharpDebug/Data/SSD/SSDVirtualFolder.cs b/源代码/StgSharpDebug/Data/SSD/SSDVirtualFolder.cs new file mode 100644 index 00000000..578ed0bb --- /dev/null +++ b/源代码/StgSharpDebug/Data/SSD/SSDVirtualFolder.cs @@ -0,0 +1,84 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="SSDVirtualFolder.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Data.FileIO; + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Data +{ + public class SSDFolder : ISSDSerializable + { + internal int _folderID; + internal string _name; + internal Dictionary folders; + + internal SSDFolder() + { + folders = new Dictionary(); + } + + internal SSDFolder(string name) + { + if (name == "root") + { + throw new ArgumentException( + "Name cannot be root," + + "it is preserved for root file indexer."); + } + if (name == "default") + { + throw new ArgumentException( + "Name cannot be default," + + "it is preserved for default file id provider."); + } + _name = name; + folders = new Dictionary(); + } + + public SerializableTypeCode SSDTypeCode => SerializableTypeCode.VirtualFolder; + + + //TODO 虚拟文件夹的GetBytes好难写 + public byte[] GetBytes() + { + throw new NotImplementedException(); + } + + public void FromBytes(byte[] stream) + { + throw new NotImplementedException(); + } + + } +} diff --git a/源代码/StgSharp/Logic/LogicValue.cs b/源代码/StgSharpDebug/Data/SSD/SSDraw.cs similarity index 65% rename from 源代码/StgSharp/Logic/LogicValue.cs rename to 源代码/StgSharpDebug/Data/SSD/SSDraw.cs index 2a64f778..279e14f0 100644 --- a/源代码/StgSharp/Logic/LogicValue.cs +++ b/源代码/StgSharpDebug/Data/SSD/SSDraw.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="LogicValue.cs" +// file="SSDraw.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -28,42 +28,48 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- +using StgSharp.Graphics.ShaderEdit; + using System; +using System.Collections; using System.Collections.Generic; +using System.Globalization; +using System.IO; using System.Linq; +using System.Numerics; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Security.Cryptography; using System.Text; -using System.Threading.Tasks; +using System.Xml.Serialization; -namespace StgSharp.Logic +namespace StgSharp.Data.FileIO { - /// - /// A pair of value - /// - [StructLayout(LayoutKind.Explicit, Size = 2)] - public struct Bool2 + public class SSDraw { + private byte[] data; - /// - /// The first value. - /// - [FieldOffset(0)] public bool bool0; - - /// - /// The second value. - /// - [FieldOffset(1)] public bool bool1; - - [FieldOffset(0)] public byte byte0; - - [FieldOffset(1)] public bool byte1; - - /// - /// A value. - /// The lower byte is , - /// and higher byte is . - /// - [FieldOffset(0)] public ushort Value; + public SSDraw(string name, Stream streamSource) + { + if ((streamSource == null) || (streamSource.Length == 0)) + { + throw new ArgumentNullException(nameof(streamSource)); + } + Name = name; + data = new byte[streamSource.Length]; + streamSource.Read(data.AsSpan()); + } + public SSDrawHead Head { get; set; } + public string Name { get; set; } } + + + [StructLayout(LayoutKind.Explicit, Size = 32 * 16)] + public unsafe struct SSDrawHead + { + + } + + } diff --git a/源代码/StgSharp/Data/Encode/Encoder.cs b/源代码/StgSharpDebug/Data/Serialize/Define.cs similarity index 82% rename from 源代码/StgSharp/Data/Encode/Encoder.cs rename to 源代码/StgSharpDebug/Data/Serialize/Define.cs index b1bc0634..1e8949c7 100644 --- a/源代码/StgSharp/Data/Encode/Encoder.cs +++ b/源代码/StgSharpDebug/Data/Serialize/Define.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="Encoder.cs" +// file="Define.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -28,28 +28,19 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- -using StgSharp.Data; - using System; -using System.Collections; using System.Collections.Generic; using System.Text; namespace StgSharp.Data { - public static class Encode + + /// + /// A class contains a sets of methods to serialize several types + /// + public static partial class Serializer { - public static void Freeze( - Dictionary> indexDict - ) - where T : struct - { - foreach (var key in indexDict) - { - key.Value.Freeze(); - } - } } } diff --git a/源代码/StgSharpDebug/Data/Serialize/ISSDSerializable.cs b/源代码/StgSharpDebug/Data/Serialize/ISSDSerializable.cs new file mode 100644 index 00000000..d75367a4 --- /dev/null +++ b/源代码/StgSharpDebug/Data/Serialize/ISSDSerializable.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Data +{ + + public interface ISSDSerializable + { + public SerializableTypeCode SSDTypeCode { get; } + + public byte[] GetBytes(); + + internal void FromBytes(byte[] stream); + } + + public enum SerializableTypeCode + { + Unknown = 0, + IndexTable = 1, + PixelImage = 2, + VectorImage = 3, + Audio = 4, + Shader = 5, + Text = 6, + RawData = 7, + VirtualFolder = int.MaxValue, + } + + public static partial class Serializer + { + public static byte[] Serialize(ISSDSerializable serializableObject) + { + return serializableObject.GetBytes(); + } + + public static T Deserialize(byte[] stream)where T : ISSDSerializable + { + T serializableObject = (T)Activator.CreateInstance(); + serializableObject.FromBytes(stream); + return serializableObject; + } + + public static string GetNameTail(SerializableTypeCode typeCode) + { + switch (typeCode) + { + case SerializableTypeCode.IndexTable: + return "_idt"; + case SerializableTypeCode.PixelImage: + return "_pim"; + case SerializableTypeCode.VectorImage: + return "_vim"; + case SerializableTypeCode.Audio: + return "_wav"; + case SerializableTypeCode.Shader: + return "_gls"; + case SerializableTypeCode.Text: + return "_txt"; + case SerializableTypeCode.RawData: + return "_raw"; + case SerializableTypeCode.VirtualFolder: + return "_fod"; + default: + throw new ArgumentException("Unknown file type"); + } + } + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Entities b/源代码/StgSharpDebug/Entities deleted file mode 120000 index 9f4f68d8..00000000 --- a/源代码/StgSharpDebug/Entities +++ /dev/null @@ -1 +0,0 @@ -D:/NitloadIndustry/研究项目/1-Flagship/TH2020/ProjectFile/源代码/StgSharp/Entities \ No newline at end of file diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Define/ExpressionHandler.cs b/源代码/StgSharpDebug/Entities/BehaviorArgs.cs similarity index 88% rename from 源代码/StgSharp/Geometries/PlainGeometry/Define/ExpressionHandler.cs rename to 源代码/StgSharpDebug/Entities/BehaviorArgs.cs index 6d474910..692aa406 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Define/ExpressionHandler.cs +++ b/源代码/StgSharpDebug/Entities/BehaviorArgs.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="ExpressionHandler.cs" +// file="BehaviorArgs.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -28,12 +28,10 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- -namespace StgSharp.Geometries +namespace StgSharp.Entities { - public delegate float ExpressionHandler - ( - Counter tickCounter, - float beginRange, - float endRange - ); + public abstract class BehaviorArgs + { + + } } diff --git a/源代码/StgSharpDebug/Entities/EliteEnemy.cs b/源代码/StgSharpDebug/Entities/EliteEnemy.cs new file mode 100644 index 00000000..fd0988bc --- /dev/null +++ b/源代码/StgSharpDebug/Entities/EliteEnemy.cs @@ -0,0 +1,72 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="EliteEnemy.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + + +using System; +using System.Collections.Generic; + +namespace StgSharp.Entities +{ + public class EliteEnemy : IEntity + { + + internal Launcher _awardLauncher; + internal LinkedList> _commonBulletLauncher; + internal Launcher _dieBulletLauncher; + public bool _selectalbe; + + public Launcher AwardLauncher { get; set; } + public LinkedList> CommonBulletLauncher { get; set; } + public Launcher DieBulletLauncher { get; set; } + + public virtual void OnRender() + { + new NotImplementedException(); + } + + public override void OnRenderFrame() + { + this.OnUpdate(); + foreach (Launcher launcher in CommonBulletLauncher) + { + launcher.Launch(); + } + this.OnRender(); + } + + public virtual void OnUpdate() + { + new NotImplementedException(); + } + + + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Entities/Enemy.cs b/源代码/StgSharpDebug/Entities/Enemy.cs new file mode 100644 index 00000000..503cd257 --- /dev/null +++ b/源代码/StgSharpDebug/Entities/Enemy.cs @@ -0,0 +1,54 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Enemy.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + + +namespace StgSharp.Entities +{ + public class Enemy : IEntity + { + + internal Launcher _awardLauncher; + internal Launcher _commonBulletLauncher; + internal Launcher _dieBulletLauncher; + public bool _selectalbe; + + public Launcher AwardLauncher { get; set; } + public Launcher CommonBulletLauncher { get; set; } + public Launcher DieBulletLauncher { get; set; } + + public override void OnRenderFrame() + { + CommonBulletLauncher.Launch(); + } + + + } +} diff --git a/源代码/StgSharp/Geometries/PlainGeometry/ExpressionHandler.cs b/源代码/StgSharpDebug/Entities/EntityPartical.cs similarity index 88% rename from 源代码/StgSharp/Geometries/PlainGeometry/ExpressionHandler.cs rename to 源代码/StgSharpDebug/Entities/EntityPartical.cs index 6d474910..552832a1 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/ExpressionHandler.cs +++ b/源代码/StgSharpDebug/Entities/EntityPartical.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="ExpressionHandler.cs" +// file="EntityPartical.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -28,12 +28,10 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- -namespace StgSharp.Geometries +namespace StgSharp.Entities { - public delegate float ExpressionHandler - ( - Counter tickCounter, - float beginRange, - float endRange - ); + public abstract class EntityPartical : IEntity + { + + } } diff --git a/源代码/StgSharpDebug/Entities/IEntity.cs b/源代码/StgSharpDebug/Entities/IEntity.cs new file mode 100644 index 00000000..651c8067 --- /dev/null +++ b/源代码/StgSharpDebug/Entities/IEntity.cs @@ -0,0 +1,91 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="IEntity.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Geometries; +using StgSharp.Math; + +using System; +using System.Collections.Generic; + +namespace StgSharp +{ + public abstract class IEntity + { + + protected uint _bornTick; + internal Point _basePoint; + internal LinkedList _collisionBox; + internal Sensor _collisionSensor; + internal Func _movHandler; + internal Point _pos; + internal Point _position; + internal string _texture; + + public LinkedList CollisionBox + { + get => _collisionBox; + set => _collisionBox = value; + } + + /// + /// A sensor used for checking out if a bullet hit a player or something else + /// + public Sensor CollisionSensor + { + get => _collisionSensor; + set => _collisionSensor = value; + } + + /// + /// A 2D vector presenting the position of an enemy entity, position can also be visited by X, Y + /// + public vec2d Location { get; } + + public string TextureGL { get; set; } + + /// + /// X position of an enenmy entity + /// + public float X { get; set; } + + /// + /// Y position of an enemy entity + /// + public float Y { get; set; } + + public abstract void OnRenderFrame(); + + public void SetLocation(Point p) + { + _pos = p; + } + + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Entities/Launcher.cs b/源代码/StgSharpDebug/Entities/Launcher.cs new file mode 100644 index 00000000..e2e9f958 --- /dev/null +++ b/源代码/StgSharpDebug/Entities/Launcher.cs @@ -0,0 +1,62 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Launcher.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Entities; +using StgSharp.Math; + +namespace StgSharp +{ + public class Launcher where T : IEntity + { + + internal EntityPartical _bulletSample; //发射的子弹类型 + /* + *用于发射其他的实体,主要是子弹 和 掉落物 + */ + + internal vec2d _center; //发射器的参考位置,运动轨迹的方程应当基于这个参考点构建 + internal Counter _internalParameter; //发射器的内部计时器 + internal uint[] launchtick; //发射子弹的内部计时 + + public EntityPartical Bullet + { + get => _bulletSample; + set => _bulletSample = value; + } + + internal virtual void Launch() + { + + } + + + + } +} diff --git a/源代码/StgSharp/Control/TimelineBlock.cs b/源代码/StgSharpDebug/Entities/Partical.cs similarity index 77% rename from 源代码/StgSharp/Control/TimelineBlock.cs rename to 源代码/StgSharpDebug/Entities/Partical.cs index 305c98d3..b4609948 100644 --- a/源代码/StgSharp/Control/TimelineBlock.cs +++ b/源代码/StgSharpDebug/Entities/Partical.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="TimelineBlock.cs" +// file="Partical.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -28,24 +28,17 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- -namespace StgSharp.Controlling +using System; + +namespace StgSharp { - public abstract class TimelineBlock + public class Partical : IEntity { - public abstract bool isComplete + public override void OnRenderFrame() { - get; + throw new NotImplementedException(); } - public abstract bool GetShouldComplete(); - - /* - A virtual method api to define what should program do - in a framecycle, an int value is required to express - the result of the cycle, that if there is any error in the cycle - */ - public abstract int OnUpdating(); - } } diff --git a/源代码/StgSharpDebug/Entities/Player.cs b/源代码/StgSharpDebug/Entities/Player.cs new file mode 100644 index 00000000..dae08276 --- /dev/null +++ b/源代码/StgSharpDebug/Entities/Player.cs @@ -0,0 +1,43 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Player.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +namespace StgSharp +{ + public abstract class Player : IEntity + { + + internal float _velocity; + + public float Velocity => _velocity; + + + + } +} diff --git a/源代码/StgSharpDebug/Environment/ErrorDefine.cs b/源代码/StgSharpDebug/Environment/ErrorDefine.cs new file mode 100644 index 00000000..2523eeb1 --- /dev/null +++ b/源代码/StgSharpDebug/Environment/ErrorDefine.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp +{ + public class UniformEmptyReferenceException : Exception + { + public UniformEmptyReferenceException(string program, string name): + base($"Location -1 returned when trying to find uniform {name} in shader program {program}") + { + + } + } +} diff --git a/源代码/StgSharpDebug/Environment/GlobalSetting.cs b/源代码/StgSharpDebug/Environment/GlobalSetting.cs index 6bc466e4..1fc69aa6 100644 --- a/源代码/StgSharpDebug/Environment/GlobalSetting.cs +++ b/源代码/StgSharpDebug/Environment/GlobalSetting.cs @@ -31,7 +31,9 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; using System.Runtime.CompilerServices; +using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; @@ -40,7 +42,28 @@ namespace StgSharp public static unsafe partial class StgSharp { + static byte[] _currentHash; + private static bool _inited; + internal const int ssdSegmentLength = 16; + + public static byte[] CurrentAssemblyHash + { + get + { + if (_currentHash == null) + { + string route = Assembly.GetExecutingAssembly().Location; + string time = DateTime.UtcNow.ToString(); + using (SHA256 sh = SHA256.Create()) + { + byte[] bytes = Encoding.UTF8.GetBytes(route); + _currentHash = sh.ComputeHash(bytes); + } + } + return _currentHash; + } + } /// /// Init an instance of OpenGL program, @@ -76,5 +99,5 @@ namespace StgSharp } - } + }//------------------------end of class------------------------// } \ No newline at end of file diff --git a/源代码/StgSharpDebug/Environment/Monitors.cs b/源代码/StgSharpDebug/Environment/Monitors.cs new file mode 100644 index 00000000..32eb723e --- /dev/null +++ b/源代码/StgSharpDebug/Environment/Monitors.cs @@ -0,0 +1,42 @@ +using StgSharp.Graphics; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp +{ + public static partial class StgSharp + { + private unsafe static IntPtr[] monitorsArray; + + public static unsafe IntPtr[] MonitorsHandleArray + { + get + { + if (monitorsArray == null) + { + int count = 0; + IntPtr* arrayhandle = InternalIO.glfwGetMonitors(&count); + monitorsArray = new IntPtr[count]; + Marshal.Copy((IntPtr)arrayhandle,monitorsArray,0,count); + Marshal.FreeHGlobal((IntPtr)arrayhandle); + } + return monitorsArray; + } + } + + public static IntPtr DefaultMonitor + { + get + { + return MonitorsHandleArray[0]; + } + } + } + + +} diff --git a/源代码/StgSharpDebug/Environment/Platform.cs b/源代码/StgSharpDebug/Environment/Platform.cs index c2923034..c575b062 100644 --- a/源代码/StgSharpDebug/Environment/Platform.cs +++ b/源代码/StgSharpDebug/Environment/Platform.cs @@ -64,6 +64,8 @@ namespace StgSharp VK } + + public static partial class StgSharp { @@ -83,6 +85,29 @@ namespace StgSharp mainTimeProvider = new StgSharpTime(); MainTimeProvider.StartProvidingTime(); InternalIO.glfwInit(); + InternalIO.InternalAppendLog("\n\n\n"); + InternalIO.InternalWriteLog( + $"Program {Assembly.GetEntryAssembly()!.FullName} Started.", + LogType.Info); + } + + public static void LogError(Exception ex) + { + InternalIO.InternalWriteLog(ex.Message, LogType.Error); + } + + public static void LogWarning(string log) + { + InternalIO.InternalWriteLog(log, LogType.Warning); + } + public static void LogWarning(Exception notVerySeriesException) + { + InternalIO.InternalWriteLog(notVerySeriesException.Message, LogType.Warning); + } + + public static void LogInfo(string log) + { + InternalIO.InternalWriteLog(log, LogType.Info); } public static void Mark(bool needConsole) @@ -97,6 +122,7 @@ namespace StgSharp public static void Terminate() { MainTimeProvider.Terminate(); + InternalIO.glfwTerminate(); } public static void Track( @@ -129,7 +155,7 @@ namespace StgSharp } /// - /// Write a log message to log file, and mark the level of this message. + /// 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. diff --git a/源代码/StgSharpDebug/Environment/TimeProvider.cs b/源代码/StgSharpDebug/Environment/TimeProvider.cs index c5155c0b..4c116c12 100644 --- a/源代码/StgSharpDebug/Environment/TimeProvider.cs +++ b/源代码/StgSharpDebug/Environment/TimeProvider.cs @@ -28,7 +28,7 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- -using StgSharpDebug.Logic; +using StgSharp.Logic; using System; using System.Collections.Generic; diff --git a/源代码/StgSharpDebug/Environment/globalKeyStat.cs b/源代码/StgSharpDebug/Environment/globalKeyStat.cs new file mode 100644 index 00000000..e7318c70 --- /dev/null +++ b/源代码/StgSharpDebug/Environment/globalKeyStat.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp +{ + + public static partial class StgSharp + { + private static ConcurrentDictionary keyListener + = new ConcurrentDictionary(); + + public static KeyStatus CheckKey(KeyboardKey key) + { + return keyListener.GetOrAdd((int)key, KeyStatus.RELEASE); + } + + + } +} diff --git a/源代码/StgSharpDebug/Geometries b/源代码/StgSharpDebug/Geometries deleted file mode 120000 index 6add1032..00000000 --- a/源代码/StgSharpDebug/Geometries +++ /dev/null @@ -1 +0,0 @@ -D:/NitloadIndustry/研究项目/1-Flagship/TH2020/ProjectFile/源代码/StgSharp/Geometries \ No newline at end of file diff --git a/源代码/StgSharp/Geometries/Coordination/ICoord.cs b/源代码/StgSharpDebug/Geometries/Coordination/CoordinationBase.cs similarity index 55% rename from 源代码/StgSharp/Geometries/Coordination/ICoord.cs rename to 源代码/StgSharpDebug/Geometries/Coordination/CoordinationBase.cs index 2d11639b..8dd7fd80 100644 --- a/源代码/StgSharp/Geometries/Coordination/ICoord.cs +++ b/源代码/StgSharpDebug/Geometries/Coordination/CoordinationBase.cs @@ -8,43 +8,39 @@ using System.Threading.Tasks; namespace StgSharp.Geometries { - public abstract class ICoord + public abstract class CoordinationBase { + private CoordinationBase localCoordination; private Matrix44 coordMat; - private Matrix44 origin; + private bool globalCoordAvailable; - public ICoord() + + public CoordinationBase( + CoordinationBase localCoordination) { + this.localCoordination = localCoordination; + coordMat = new Matrix44(); } - //A matrix can convert vertex to global coord. - public Matrix44 GlobalCoordTransformation + public virtual Point LocalOrigin { - get - { - return coordMat * origin; - } + get => new Point( coordMat.colum3.XYZ); + internal set => coordMat.colum3.XYZ = value.Coord; } - public vec3d Origin - { - get => origin.colum3.XYZ; - internal set => origin.colum3.XYZ = value; - } - - public vec3d X_axis + public virtual vec3d LocalX { get => coordMat.colum0.XYZ; internal set => coordMat.colum0.XYZ = value; } - public vec3d Y_axis + public virtual vec3d LocalY { get => coordMat.colum1.XYZ; internal set => coordMat.colum1.XYZ = value; } - public vec3d Z_axis + public virtual vec3d LocalZ { get => coordMat.colum2.XYZ; set => coordMat.colum2.XYZ = value; diff --git a/源代码/StgSharpDebug/Geometries/Coordination/PlainCoordinate.cs b/源代码/StgSharpDebug/Geometries/Coordination/PlainCoordinate.cs new file mode 100644 index 00000000..6fd6cba5 --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/Coordination/PlainCoordinate.cs @@ -0,0 +1,66 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="PlainCoordinate.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Net.Http.Headers; +using System.Text; + +namespace StgSharp.Geometries +{ + public class PlainCoordinate : CoordinationBase + { + public PlainCoordinate( + CoordinationBase local, + Point origin, + vec3d xAxis, + vec3d yAxis + ) : base(local) + { + CoordMat = Matrix44.Unit; + + CoordMat.colum0 = new vec4d(xAxis, 0); + CoordMat.colum1 = new vec4d(yAxis, 0); + CoordMat.colum2 = new vec4d(Linear.Normalize(Vec3d.Cross(xAxis, yAxis)), 0); + + LocalOrigin = origin; + } + + private static PlainCoordinate statndardPlainCoordination = new PlainCoordinate( + null, new Point(0,0,0), + new vec3d(1,0,0), + new vec3d(0, 1, 0) + ); + + public static PlainCoordinate StandardPlainCoordination => statndardPlainCoordination; + } +} diff --git a/源代码/StgSharp/Geometries/SpaceGeometry/SpaceCoordinate.cs b/源代码/StgSharpDebug/Geometries/Coordination/SpaceCoordinate.cs similarity index 86% rename from 源代码/StgSharp/Geometries/SpaceGeometry/SpaceCoordinate.cs rename to 源代码/StgSharpDebug/Geometries/Coordination/SpaceCoordinate.cs index 9da396b8..5f3940f2 100644 --- a/源代码/StgSharp/Geometries/SpaceGeometry/SpaceCoordinate.cs +++ b/源代码/StgSharpDebug/Geometries/Coordination/SpaceCoordinate.cs @@ -28,15 +28,21 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- +using StgSharp.Math; + using System; using System.Collections.Generic; using System.Text; namespace StgSharp.Geometries { - public class SpaceCoordinate + public class SpaceCoordinate : CoordinationBase { - - + public SpaceCoordinate( + CoordinationBase localCoordination, Point origin, + vec3d xAxis, vec3d yAxis, vec3d zAxis + ) : base(localCoordination) + { + } } } diff --git a/源代码/StgSharpDebug/Geometries/Coordination/StreamLocalCoordinate.cs b/源代码/StgSharpDebug/Geometries/Coordination/StreamLocalCoordinate.cs new file mode 100644 index 00000000..e813320e --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/Coordination/StreamLocalCoordinate.cs @@ -0,0 +1,16 @@ +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Geometries +{ + /* + public class StreamLocalCoordinate : CoordinationBase + { + } + /**/ +} diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Define/GemoryException.cs b/源代码/StgSharpDebug/Geometries/GemoryException.cs similarity index 100% rename from 源代码/StgSharp/Geometries/PlainGeometry/Define/GemoryException.cs rename to 源代码/StgSharpDebug/Geometries/GemoryException.cs diff --git a/源代码/StgSharpDebug/Geometries/GeometryOperation/GeometryOperation.cs b/源代码/StgSharpDebug/Geometries/GeometryOperation/GeometryOperation.cs new file mode 100644 index 00000000..469a9b19 --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/GeometryOperation/GeometryOperation.cs @@ -0,0 +1,97 @@ +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Geometries +{ + public delegate vec3d GeometryMotionDelegate(TimeSpanProvider timeSource, out float rotation); + + public class GeometryMotion + { + private bool isIncrementMode; + private bool sourceIsStatic; + private TimeSpanProvider time; + private GeometryMotionDelegate movement; + private IntPtr handle; + + public static GeometryMotion DefaultMotion + { + get + { + return new GeometryMotion + ( + true, + null, + null + ); + } + } + + private static vec3d defaultMotion(TimeSpanProvider provider, out float rotation) + { + rotation = 0; + return Vec3d.Zero; + } + + public unsafe GeometryMotion( + bool isIncreament, + TimeSpanProvider timeSource, + GeometryMotionDelegate motionDelegate + ) + { + isIncrementMode = isIncreament; + time = timeSource; + if (motionDelegate == null) + { + handle = (IntPtr)(delegate*)&defaultMotion; + movement = defaultMotion; + } + else if (motionDelegate.Method.IsStatic) + { + sourceIsStatic = true; + handle = Marshal.GetFunctionPointerForDelegate(motionDelegate); + movement = motionDelegate; + } + else + { + movement = motionDelegate; + } + sourceIsStatic = false; + } + + public bool IsIncrement + { + get => isIncrementMode; + + } + + public unsafe void RunMotion(ref vec3d coord, ref float rotation) + { + float rot = 0; + vec3d vec; + if (sourceIsStatic) + { + vec = ((delegate*)handle)(time, out rot); + } + else + { + vec = movement(time, out rot); + } + + if (isIncrementMode) + { + coord += vec; + rotation += rot; + } + else + { + coord = vec.XYZ; + rotation = rot; + } + } + }//------------------------------- End of Class ------------------------------- +} diff --git a/源代码/StgSharp/Geometries/GeometryOperation/Angle.cs b/源代码/StgSharpDebug/Geometries/GeometryScaler/Angle.cs similarity index 100% rename from 源代码/StgSharp/Geometries/GeometryOperation/Angle.cs rename to 源代码/StgSharpDebug/Geometries/GeometryScaler/Angle.cs index 58b37b01..1a5d94fc 100644 --- a/源代码/StgSharp/Geometries/GeometryOperation/Angle.cs +++ b/源代码/StgSharpDebug/Geometries/GeometryScaler/Angle.cs @@ -104,12 +104,6 @@ namespace StgSharp.Math return new Radius(left._radius - Right._radius); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float operator /(Radius left, Radius right) - { - return left._radius / right._radius; - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Radius operator +(Radius left, Radius Right) { @@ -128,6 +122,12 @@ namespace StgSharp.Math return new Radius(left._radius / right); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float operator /(Radius left, Radius right) + { + return left._radius / right._radius; + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool operator ==(Radius left, Radius right) { diff --git a/源代码/StgSharpDebug/Geometries/IGeometry.cs b/源代码/StgSharpDebug/Geometries/IGeometry.cs new file mode 100644 index 00000000..89722d85 --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/IGeometry.cs @@ -0,0 +1,70 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="IGeometry.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Geometries +{ + public interface IGeometry + { + public CoordinationBase Coordination { get; } + + public Point this[int index] + { + get; + set; + } + + public int VertexCount + { + get; + } + +#pragma warning disable CA1819 + public vec4d[] VertexStream +#pragma warning restore CA1819 + { + get; + } + + public ReadOnlySpan VertexIndices + { + get; + } + + } +} diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Define/IInstancing.cs b/源代码/StgSharpDebug/Geometries/IInstancing.cs similarity index 64% rename from 源代码/StgSharp/Geometries/PlainGeometry/Define/IInstancing.cs rename to 源代码/StgSharpDebug/Geometries/IInstancing.cs index efe58f6d..9ee9fc76 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Define/IInstancing.cs +++ b/源代码/StgSharpDebug/Geometries/IInstancing.cs @@ -40,28 +40,28 @@ using System.Threading.Tasks; namespace StgSharp.Geometries { - public interface IInstancing where T : IInstancing + public interface IInstancing { public int BufferId { get; - set; + internal set; } public vec3d CenterPositionGlobal { get; - set; + internal set; } public vec3d Coord { - get { return GlobalBuffer.CoordList[BufferId].XYZ; } - set { GlobalBuffer.CoordList[BufferId] = new vec4d( value.vec); } + get { return GlobalBuffer.CoordAndRotationList[BufferId].XYZ; } + set { GlobalBuffer.CoordAndRotationList[BufferId] = new vec4d(value.vec); } } - public PlainInstancingBuffer GlobalBuffer + public IInstancingBuffer GlobalBuffer { get; internal set; @@ -69,12 +69,12 @@ namespace StgSharp.Geometries public float Rotation { - get { return GlobalBuffer.CoordList[BufferId].W; } + get { return GlobalBuffer.CoordAndRotationList[BufferId].W; } set { - vec4d temp = GlobalBuffer.CoordList[BufferId]; + vec4d temp = GlobalBuffer.CoordAndRotationList[BufferId]; temp.W = value; - GlobalBuffer.CoordList[BufferId] = temp; + GlobalBuffer.CoordAndRotationList[BufferId] = temp; } } @@ -91,49 +91,11 @@ namespace StgSharp.Geometries public void Move() { - (vec3d coord , float rotation) =(Coord, Rotation); + (vec3d coord, float rotation) = (Coord, Rotation); Motion.RunMotion(ref coord, ref rotation); - (Coord,Rotation) = (coord, rotation); + (Coord, Rotation) = (coord, rotation); } } - public class ParticleOnPlain : IInstancing - { - - public ParticleOnPlain(PlainInstancingBuffer buffer) - { - if (buffer == null) - { - throw new ArgumentNullException(paramName: nameof(buffer)); - } - GlobalBuffer = buffer; - BufferId = buffer.CreateInstanceID(); - buffer.InstanceList.Add(this); - } - - public int BufferId - { - get; - set; - } - - public PlainInstancingBuffer GlobalBuffer - { - get; - set; - } - public GeometryMotion Motion - { - get; - set; - } - - vec3d IInstancing.CenterPositionGlobal - { - get; - set; - } - - } } diff --git a/源代码/StgSharpDebug/Geometries/IInstancingBuffer.cs b/源代码/StgSharpDebug/Geometries/IInstancingBuffer.cs new file mode 100644 index 00000000..4959a050 --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/IInstancingBuffer.cs @@ -0,0 +1,27 @@ +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Geometries +{ + public interface IInstancingBuffer + { + + internal IGeometry TypicalShape { get; } + + internal List InstanceList { get; } + + internal List CoordAndRotationList { get; } + + internal List ScalingList { get; } + + public Span CoordAndRotationSpan { get; } + + public Span ScalingSpan { get; } + + + } + +} diff --git a/源代码/StgSharpDebug/Geometries/PlainGeometry/Cordinate.cs b/源代码/StgSharpDebug/Geometries/PlainGeometry/Cordinate.cs new file mode 100644 index 00000000..215abcca --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/PlainGeometry/Cordinate.cs @@ -0,0 +1,89 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Cordinate.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Geometries +{ + [StructLayout(LayoutKind.Sequential)] + public struct PartialPlainCoordinate + { + + internal Matrix32 axis; + + /// + /// The origin of this coordinate. + /// + public vec3d origin; + + public PartialPlainCoordinate + ( + vec3d origin, + vec3d horiziontial, + vec3d vertical + ) + { + this.origin = origin; + axis = new Matrix32(); +#if NET5_0_OR_GREATER + Unsafe.SkipInit(out axis.mat); +#endif + axis.colum0 = horiziontial; + axis.colum1 = vertical; + } + + /// + /// The horizontial axis of the coordinate. + /// Point to the right direction. + /// + public vec3d axis_H => axis.colum0; + + /// + /// The vertical axis of the coordinate. + /// Point to the top direction. + /// + public vec3d axis_V => axis.colum1; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public vec3d GetRealLocate(vec2d raletiveLocation) + { + return origin + axis.VerticalVecMultiply(raletiveLocation); + } + + } +} diff --git a/源代码/StgSharp/Geometries/PlainGeometry/GeometryOperation.cs b/源代码/StgSharpDebug/Geometries/PlainGeometry/Define/GeometryOperation.cs similarity index 85% rename from 源代码/StgSharp/Geometries/PlainGeometry/GeometryOperation.cs rename to 源代码/StgSharpDebug/Geometries/PlainGeometry/Define/GeometryOperation.cs index f3c7f385..be3cb33a 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/GeometryOperation.cs +++ b/源代码/StgSharpDebug/Geometries/PlainGeometry/Define/GeometryOperation.cs @@ -30,19 +30,15 @@ //----------------------------------------------------------------------- using StgSharp.Math; +using System.Runtime.CompilerServices; + namespace StgSharp.Geometries { - /// - /// Caculate the movement of a point. - /// - /// The game tick represent time passed by - /// A 3d vector representing movement - public delegate vec3d GetLocationHandler(int tick); public static unsafe class GeometryOperation { - - public static vec3d DefualtMotion(int tick) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static vec3d DefaultMotion(int tick) { return default(vec3d); } diff --git a/源代码/StgSharpDebug/Geometries/PlainGeometry/Define/IPlainEntity.cs b/源代码/StgSharpDebug/Geometries/PlainGeometry/Define/IPlainEntity.cs new file mode 100644 index 00000000..176bd2b7 --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/PlainGeometry/Define/IPlainEntity.cs @@ -0,0 +1,42 @@ +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Geometries +{ + + public interface IPlainEntity + { + public vec2d CenterPosition { get; set; } + + public bool CollideWith(IPlainEntity entity); + } + + + + public class PlainEntity:IPlainEntity + { + private PlainGeometry _shape; + + vec2d IPlainEntity.CenterPosition + { + get => _shape.Coordination.LocalOrigin.Coord.XY; + set => throw new InvalidOperationException(); + } + + public PlainEntity(PlainGeometry shape) + { + _shape = shape; + } + + bool IPlainEntity.CollideWith(IPlainEntity entity) + { + throw new NotImplementedException(); + } + } + +} diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Point.cs b/源代码/StgSharpDebug/Geometries/PlainGeometry/Define/ParticleOnPlain.cs similarity index 58% rename from 源代码/StgSharp/Geometries/PlainGeometry/Point.cs rename to 源代码/StgSharpDebug/Geometries/PlainGeometry/Define/ParticleOnPlain.cs index 49b7f5a8..ab52aa15 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Point.cs +++ b/源代码/StgSharpDebug/Geometries/PlainGeometry/Define/ParticleOnPlain.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="Point.cs" +// file="IInstancing.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -31,77 +31,62 @@ using StgSharp.Math; using System; +using System.Collections.Generic; +using System.Linq; using System.Numerics; -using System.Runtime.InteropServices; -using System.Threading; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading.Tasks; namespace StgSharp.Geometries { - public unsafe class Point + public class ParticleOnPlain : IInstancing, IPlainEntity { - internal readonly bool isVertex; - internal vec3d position; - - internal Point(vec3d p) + public ParticleOnPlain(PlainInstancingBuffer buffer) { - position = p; + if (buffer == null) + { + throw new ArgumentNullException(paramName: nameof(buffer)); + } + GlobalBuffer = buffer; + BufferId = buffer.CreateInstanceID(); + ((IInstancingBuffer)buffer).InstanceList.Add(this); } - internal Point(Vector4 vector) + public int BufferId { - position = new vec3d(vector); + get; + set; } - public Point() { } - - public Point(float x, float y, float z) + public IInstancingBuffer GlobalBuffer { - position = new vec3d(x, y, z); + get; + set; + } + public GeometryMotion Motion + { + get; + set; + } + + vec3d IInstancing.CenterPositionGlobal + { + get; + set; + } + + vec2d IPlainEntity.CenterPosition + { + get => GlobalBuffer.CoordAndRotationList[BufferId].XY; + set => throw new NotImplementedException(); } - public bool IsVertex => isVertex; - - public vec3d Position - { - get => position; - set => position = value; - } - - public float X - { - get => position.X; - set => position.X = value; - } - - public float Y - { - get => position.Y; - set => position.Y = value; - } - - public float Z - { - get => position.Z; - set => position.Z = value; - } - - public bool IsInGeometry(PlainGeometry geo) + bool IPlainEntity.CollideWith(IPlainEntity entity) { throw new NotImplementedException(); } - - - /// - /// Update the coordinate of the point. If this is a moving point, - /// (Points on sides or surface if other geometry items) - /// please do not define any motion here, codes will be ignored by program - /// - /// Time passes since the program begin, counted by frames - public virtual void Update(uint tick) { } - - - } } diff --git a/源代码/StgSharp/Control/TimeLine.cs b/源代码/StgSharpDebug/Geometries/PlainGeometry/Define/PlainGeometry.cs similarity index 65% rename from 源代码/StgSharp/Control/TimeLine.cs rename to 源代码/StgSharpDebug/Geometries/PlainGeometry/Define/PlainGeometry.cs index a36f5ed8..2db38c65 100644 --- a/源代码/StgSharp/Control/TimeLine.cs +++ b/源代码/StgSharpDebug/Geometries/PlainGeometry/Define/PlainGeometry.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="TimeLine.cs" +// file="PlainGeometry.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -28,48 +28,45 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- -using StgSharp.Entities; using StgSharp.Graphics; +using StgSharp.Math; using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Threading; +using System.ComponentModel; -namespace StgSharp.Controlling +namespace StgSharp.Geometries { - internal static partial class TimeLine + /// + /// Plain geometry only contains straight sides. + /// + public abstract class PlainGeometry : IGeometry { + protected vec4d[] vertexMat; + internal CoordinationBase coordinate; - private static bool isPaused = false; - private static bool renderChainStarted; - - internal static TimelineBlock currentOperation; - internal static Queue
formList = new Queue(); - - public static TimelineBlock CurrentOperation + internal PlainGeometry(CoordinationBase coordination) { - get => currentOperation; - set - { - if ((currentOperation == default) || - currentOperation.isComplete) - { - currentOperation = value; - } - } + coordinate = coordination; + } + + public Point this[int index] + { + get => new Point(vertexMat[index]); + set => vertexMat[index].vec = value.coordVec; } - internal static bool RenderStarted => renderChainStarted; + public int VertexCount => this.vertexMat.Length; + public abstract ReadOnlySpan VertexIndices { get; } - internal static void RenderAll() - { - renderChainStarted = true; - } +#pragma warning disable CA1819 + public vec4d[] VertexStream => vertexMat; + + public CoordinationBase Coordination => this.coordinate; +#pragma warning restore CA1819 } -} +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Geometries/PlainGeometry/Define/PlainInstancingBuffer.cs b/源代码/StgSharpDebug/Geometries/PlainGeometry/Define/PlainInstancingBuffer.cs new file mode 100644 index 00000000..c1e4871a --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/PlainGeometry/Define/PlainInstancingBuffer.cs @@ -0,0 +1,222 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="PlainInstancingBuffer.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Math; + +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Numerics; +using System.Reflection; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace StgSharp.Geometries +{ + public class PlainInstancingBuffer : + IDisposable,IEnumerable, IInstancingBuffer + where T : + IInstancing + { + + private CoordinatePlain globalCorrdinnate; + private List coordList; + private List instanceList; + private List scalingList; + private Mutex mutex; + private bool disposedValue; + + #region field of mem opt + + vec4d[] coordArray; + float[] scaleArray; + + #endregion + + public PlainInstancingBuffer() + { + coordList = new List(capacity: 100); + instanceList = new List(capacity:100); + scalingList = new List(capacity: 100); + coordArray = Array.Empty(); + scaleArray = Array.Empty(); + mutex = new Mutex(); + } + + public List InstanceList + { + get => instanceList; + } + + public List CoordAndRotationList + { + get => coordList; + } + + public List ScalingList + { + get => scalingList; + } + + public Span CoordAndRotationSpan + { + get + { + if (coordArray.Length != coordList.Capacity) + { + FieldInfo fieldInfo = typeof(List). + GetField("_items", BindingFlags.NonPublic | BindingFlags.Instance); + if (fieldInfo == null) + { +#pragma warning disable CA1065 +#pragma warning disable CA2201 + throw new NullReferenceException(); +#pragma warning restore CA2201 +#pragma warning restore CA1065 + } + coordArray = (vec4d[])fieldInfo.GetValue(coordList); + } + return new Span(coordArray, 0, coordList.Count); + } + } + + public Span ScalingSpan + { + get + { + if (scaleArray.Length != coordList.Capacity) + { + FieldInfo fieldInfo = typeof(List). + GetField("_items", BindingFlags.NonPublic | BindingFlags.Instance); + if (fieldInfo == null) + { +#pragma warning disable CA1065 +#pragma warning disable CA2201 + throw new NullReferenceException(); +#pragma warning restore CA2201 +#pragma warning restore CA1065 + } + scaleArray = (float[])fieldInfo.GetValue(scalingList); + } + return new Span(scaleArray, 0, coordList.Count); + } + } + + IGeometry IInstancingBuffer.TypicalShape => throw new NotImplementedException(); + + public int CreateInstanceID() + { + mutex.WaitOne(); + int ret = instanceList.Count; + coordList.Add(new vec4d()); + scalingList.Add(0); + mutex.ReleaseMutex(); + return ret; + } + + public void Remove(T instance) + { + mutex.WaitOne(); + if (instance.GlobalBuffer != this) + { + throw new ArgumentException( + message:"instance does not belong to current Particle Buffer", + paramName: nameof(instance)); + } + int index = instance.BufferId; + IInstancing temp = instanceList[instanceList.Count - 1]; + instanceList[instance.BufferId] = temp; + temp.BufferId = instance.BufferId; + + coordList[instance.BufferId] = coordList[coordList.Count - 1]; + scalingList[instance.BufferId] = scalingList[scalingList.Count - 1]; + + instanceList.RemoveAt(instanceList.Count - 1); + coordList.RemoveAt(coordList.Count - 1); + scalingList.RemoveAt(scalingList.Count - 1); + mutex.ReleaseMutex(); + } + + public void UpdateAllParticles() + { + foreach (var particle in instanceList) + { + particle.Move(); + } + } + + protected virtual void Dispose(bool disposing) + { + if (!disposedValue) + { + if (disposing) + { + mutex.Dispose(); + } + + coordList.Clear(); + instanceList.Clear(); + scalingList.Clear(); + disposedValue = true; + } + } + + // ~PlainInstancingBuffer() + // { + // Dispose(disposing: false); + // } + + public void Dispose() + { + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + + public IEnumerator GetEnumerator() + { + foreach (var item in instanceList) + { + yield return (T)item; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var item in instanceList) + { + yield return (T)item; + } + } + } +} diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Arc.cs b/源代码/StgSharpDebug/Geometries/PlainGeometry/Parallelogram.cs similarity index 54% rename from 源代码/StgSharp/Geometries/PlainGeometry/Arc.cs rename to 源代码/StgSharpDebug/Geometries/PlainGeometry/Parallelogram.cs index 6de412cd..cd623745 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Arc.cs +++ b/源代码/StgSharpDebug/Geometries/PlainGeometry/Parallelogram.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="Arc.cs" +// file="Parallelogram.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -28,59 +28,62 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- + using StgSharp.Math; using System; namespace StgSharp.Geometries { - /// - /// Part of a circle. All points on a arc has the same distance to their center. - /// - public class Arc : PlainGeometry + public class Parallelogram : Polygon4 { - internal Func movBeginOperation = GeometryOperation.DefaultMotion; - internal Func movCenterOperation = GeometryOperation.DefaultMotion; - internal Func movEndOperation = GeometryOperation.DefaultMotion; + internal readonly Func movCenterOperation = + new Func(GeometryOperation.DefaultMotion); - internal Point beginPoint; internal Point center; - internal Point endPoint; - internal override int[] Indices => throw new NotImplementedException(); - - public override Line[] GetAllSides() + public Parallelogram( + float v0x, float v0y, + float v1x, float v1y, + float v2x, float v2y, + float v3x, float v3y + ) : base( + v0x, v0y, v1x, v1y, + v2x, v2y, v3x, v3y + ) { - throw new NotImplementedException(); +#if DEBUG + if ( + this[0].Coord + this[2].Coord != + this[1].Coord + this[3].Coord + ) + { + InternalIO.InternalWriteLog("Init of geometry item failed, because four vertices cannot form a rectangle.", LogType.Warning); + } +#endif } - public override Plain GetPlain() + public Parallelogram( + PlainCoordinate coordination, + float v0x, float v0y, + float v1x, float v1y, + float v2x, float v2y, + float v3x, float v3y + ) : base(coordination, + v0x, v0y, v1x, v1y, + v2x, v2y, v3x, v3y + ) { - return new Plain(this.center, this.beginPoint, this.endPoint); - } - - public virtual vec3d MovBegin(int tick) - { - return movBeginOperation.Invoke(tick); - } - - public virtual vec3d MoveCenter(int tick) - { - return movCenterOperation.Invoke(tick); - } - - public virtual vec3d MovEnd(int tick) - { - return movEndOperation.Invoke(tick); - } - - internal override void UpdateCoordinate(int tick) - { - tick = time; - center.Position = this.coordinate.Origin + MoveCenter(tick); - beginPoint.Position = this.coordinate.Origin + MovBegin(tick); - endPoint.Position = this.coordinate.Origin + MovEnd(tick); +#if DEBUG + if ( + this[0].Coord + this[2].Coord != + this[1].Coord + this[3].Coord + ) + { + InternalIO.InternalWriteLog("Init of geometry item failed, because four vertices cannot form a rectangle.", LogType.Warning); + } +#endif } } diff --git a/源代码/StgSharpDebug/Geometries/PlainGeometry/Plain.cs b/源代码/StgSharpDebug/Geometries/PlainGeometry/Plain.cs new file mode 100644 index 00000000..4eccfc4b --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/PlainGeometry/Plain.cs @@ -0,0 +1,94 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Plain.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Math; + +using System.Numerics; + +namespace StgSharp.Geometries +{ + public unsafe class Plain + { + + internal readonly float d = -1; + internal vec3d origin; + + internal vec3d plainParameter; + internal vec3d vec1; + internal vec3d vec2; + + internal Plain(Vector4 origin, Vector4 p1, Vector4 p2) + { + this.origin = new vec3d(origin); + + vec1 = new vec3d(p1 - origin); + vec2 = new vec3d(p2 - origin); + } + + public Plain(vec3d o, vec3d v1, vec3d v2) + { + this.origin = o; + this.vec1 = v1 - (v2 * (v1.Y / v2.Y)); //计算平面在xz平面上的方向投影 + this.vec2 = v2 - (vec1 * (v2.X / v1.X)); //计算平面在yz平面上的方向投影 + + //|origin|-k1*|vec1|-k2*|vec2|计算plainParameter.Z; + plainParameter.Z = origin.Z - (vec1.Z * (origin.X / vec1.X)) - (vec2.Z * (origin.Y / vec2.Y)); + //根据plainParameter.Z和对应的方向矢量计算plainParameter.X和plainParameter.Y + plainParameter.X = vec1.X * (vec1.Z / plainParameter.Z); + plainParameter.Y = vec2.Y * (vec2.Z / plainParameter.Z); + + plainParameter.X = 1 / plainParameter.X; + plainParameter.Y = 1 / plainParameter.Y; + plainParameter.Z = 1 / plainParameter.Z; + } + + public Plain(Point p1, Point p2, Point p3) + { + vec3d origin = p1.Coord; + vec3d v1 = p2.Coord - origin; + vec3d v2 = p3.Coord - origin; + + + vec1 = v1 - (v2 * (v1.Y / v2.Y)); //计算平面在xz平面上的方向投影 + vec2 = v2 - (vec1 * (v2.X / v1.X)); //计算平面在yz平面上的方向投影 + + //|origin|-k1*|vec1|-k2*|vec2|计算plainParameter.Z; + plainParameter.Z = origin.Z - (vec1.Z * (origin.X / vec1.X)) - (vec2.Z * (origin.Y / vec2.Y)); + //根据plainParameter.Z和对应的方向矢量计算plainParameter.X和plainParameter.Y + plainParameter.X = vec1.X * (vec1.Z / plainParameter.Z); + plainParameter.Y = vec2.Y * (vec2.Z / plainParameter.Z); + + plainParameter.X = 1 / plainParameter.X; + plainParameter.Y = 1 / plainParameter.Y; + plainParameter.Z = 1 / plainParameter.Z; + } + + } +} diff --git a/源代码/StgSharpDebug/Geometries/PlainGeometry/Polygon4.cs b/源代码/StgSharpDebug/Geometries/PlainGeometry/Polygon4.cs new file mode 100644 index 00000000..a6fe9b11 --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/PlainGeometry/Polygon4.cs @@ -0,0 +1,122 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Polygon4.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + +using StgSharp.Math; + +using System; +using System.Numerics; + +namespace StgSharp.Geometries +{ + public class Polygon4 : PlainGeometry + { + protected static int[] Indices = [0, 1, 2, 0, 2, 3]; + + internal Polygon4():base(PlainCoordinate.StandardPlainCoordination) + { + vertexMat = new vec4d[4]; + } + + internal Polygon4(vec4d[] rawCoord): + base(PlainCoordinate.StandardPlainCoordination) + { + if (rawCoord.Length != 4) + { + throw new ArgumentOutOfRangeException(nameof(rawCoord)); + } + vertexMat = rawCoord; + } + + public Polygon4( + Point topLeft, + Point topRight, + Point bottomRight, + Point bottomLeft + ):base(PlainCoordinate.StandardPlainCoordination) + { + this[0] = topLeft; + this[1] = topRight; + this[2] = bottomRight; + this[3] = bottomLeft; + + } + + public Polygon4( + float v0x, float v0y, + float v1x, float v1y, + float v2x, float v2y, + float v3x, float v3y + ):base(PlainCoordinate.StandardPlainCoordination) + { + vertexMat = new vec4d[4]; + + this[0] = new Point(v0x, v0y, 0); + this[1] = new Point(v1x, v1y, 0); + this[2] = new Point(v2x, v2y, 0); + this[3] = new Point(v3x, v3y, 0); + } + + + public Polygon4(CoordinationBase coordinate, + PlainCoordinate coordination, + Point topLeft, + Point topRight, + Point bottomRight, + Point bottomLeft + ) : base(coordinate) + { + this[0] = topLeft; + this[1] = topRight; + this[2] = bottomRight; + this[3] = bottomLeft; + + } + + public Polygon4( + PlainCoordinate coordination, + float v0x, float v0y, + float v1x, float v1y, + float v2x, float v2y, + float v3x, float v3y + ) : base(coordination) + { + vertexMat = new vec4d[4]; + + this[0] = new Point(v0x, v0y, 0); + this[1] = new Point(v1x, v1y, 0); + this[2] = new Point(v2x, v2y, 0); + this[3] = new Point(v3x, v3y, 0); + } + + public override ReadOnlySpan VertexIndices => Indices; + + } +} diff --git a/源代码/StgSharpDebug/Geometries/PlainGeometry/Polygon5.cs b/源代码/StgSharpDebug/Geometries/PlainGeometry/Polygon5.cs new file mode 100644 index 00000000..4bc1aa0a --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/PlainGeometry/Polygon5.cs @@ -0,0 +1,84 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Polygon5.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + +using StgSharp.Math; + +using System; +using System.Numerics; + +namespace StgSharp.Geometries +{ + public unsafe class Polygon5 : PlainGeometry + { + + public unsafe Polygon5():base(PlainCoordinate.StandardPlainCoordination) + { + vertexMat = new vec4d[5]; + } + + public Polygon5( + float v0x, float v0y, + float v1x, float v1y, + float v2x, float v2y, + float v3x, float v3y, + float v4x, float v4y + ):base(PlainCoordinate.StandardPlainCoordination) + { + vertexMat = new vec4d[5]; + this[0] = new Point(v0x, v0y, 0); + this[1] = new Point(v1x, v1y, 0); + this[2] = new Point(v2x, v2y, 0); + this[3] = new Point(v3x, v3y, 0); + this[4] = new Point(v4x, v4y, 0); + } + + public Polygon5( + PlainCoordinate coordination, + float v0x, float v0y, + float v1x, float v1y, + float v2x, float v2y, + float v3x, float v3y, + float v4x, float v4y + ):base(coordination) + { + vertexMat = new vec4d[5]; + this[0] = new Point(v0x, v0y, 0); + this[1] = new Point(v1x, v1y, 0); + this[2] = new Point(v2x, v2y, 0); + this[3] = new Point(v3x, v3y, 0); + this[4] = new Point(v4x, v4y, 0); + } + + internal static int[] Indices = [ 0, 1, 2, 0, 2, 3, 0, 3, 4 ]; + + public override ReadOnlySpan VertexIndices => Indices; + } +} diff --git a/源代码/StgSharpDebug/Geometries/PlainGeometry/Polygon6.cs b/源代码/StgSharpDebug/Geometries/PlainGeometry/Polygon6.cs new file mode 100644 index 00000000..0c388d03 --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/PlainGeometry/Polygon6.cs @@ -0,0 +1,71 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Polygon6.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + +using StgSharp.Math; + +using System; +using System.Numerics; + +namespace StgSharp.Geometries +{ + public class Polygon6 : PlainGeometry + { + public Polygon6():base(PlainCoordinate.StandardPlainCoordination) + { + vertexMat = new vec4d[6]; + } + + public Polygon6( + PlainCoordinate coordination, + vec2d vert0, + vec2d vert1, + vec2d vert2, + vec2d vert3, + vec2d vert4, + vec2d vert5, + vec2d vert6 + ) : base(coordination) + { + vertexMat = new vec4d[6]; + vertexMat[0].vec = vert0.vec; + vertexMat[1].vec = vert1.vec; + vertexMat[2].vec = vert2.vec; + vertexMat[3].vec = vert3.vec; + vertexMat[4].vec = vert4.vec; + vertexMat[5].vec = vert5.vec; + vertexMat[6].vec = vert6.vec; + } + + internal static int[] Indices = [ 0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5 ]; + + public override ReadOnlySpan VertexIndices => Indices; + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Geometries/PlainGeometry/Rectangle.cs b/源代码/StgSharpDebug/Geometries/PlainGeometry/Rectangle.cs new file mode 100644 index 00000000..f60c139a --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/PlainGeometry/Rectangle.cs @@ -0,0 +1,99 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Rectangle.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Math; + +using System.Numerics; + +namespace StgSharp.Geometries +{ + public class Rectangle : Parallelogram + { + + public Rectangle( + float v0x, float v0y, + float v1x, float v1y, + float v2x, float v2y, + float v3x, float v3y + ) : base( + v0x, v0y, + v1x, v1y, + v2x, v2y, + v3x, v3y + ) + { +#if DEBUG + vec2d side0 = (this[0].Coord - this[1].Coord).XY; + vec2d side1 = (this[2].Coord - this[1].Coord).XY; + if (side0.Cross(side1) == 0) + { + throw new ArgumentException(); + } +#endif + } + + + public Rectangle( + PlainCoordinate coordination, + float v0x, float v0y, + float v1x, float v1y, + float v2x, float v2y, + float v3x, float v3y + ) : base(coordination, + v0x, v0y, + v1x, v1y, + v2x, v2y, + v3x, v3y + ) + { +#if DEBUG + vec2d side0 = (this[0].Coord - this[1].Coord).XY; + vec2d side1 = (this[2].Coord - this[1].Coord).XY; + if (side0.Cross(side1) == 0) + { + throw new ArgumentException(); + } +#endif + } + + /// + /// Calculate movement to center + /// + /// Current time tick + /// + public virtual vec3d MovCenter(uint tick) + { + return default(vec3d); + } + + + + } +} diff --git a/源代码/StgSharp/Logic/Control.cs b/源代码/StgSharpDebug/Geometries/PlainGeometry/Square.cs similarity index 77% rename from 源代码/StgSharp/Logic/Control.cs rename to 源代码/StgSharpDebug/Geometries/PlainGeometry/Square.cs index 051d46db..e97fc2c3 100644 --- a/源代码/StgSharp/Logic/Control.cs +++ b/源代码/StgSharpDebug/Geometries/PlainGeometry/Square.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="Control.cs" +// file="Square.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -28,31 +28,35 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- -using StgSharp.Entities; -using StgSharp.Geometries; using StgSharp.Math; -namespace StgSharp +using System.Numerics; + +namespace StgSharp.Geometries { - public partial class Control + + /// + /// A square + /// + public class Square : Rectangle { - internal Line bottomBoader; - internal Line leftBoader; - internal Line rightBoader; - internal Line topBoader; - - public Line BottomBoarder => bottomBoader; - - public Line LeftBoarder => leftBoader; - public Line RightBoarder => rightBoader; - public Line TopBoarder => topBoader; - - - private void initContainers() + public Square( + float v0x, float v0y, + float v1x, float v1y, + float v2x, float v2y, + float v3x, float v3y) + : base(v0x, v0y, + v1x, v1y, + v2x, v2y, + v3x, v3y) { + if (true) + { + + } } - } -} + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Geometries/PlainGeometry/Triangle.cs b/源代码/StgSharpDebug/Geometries/PlainGeometry/Triangle.cs new file mode 100644 index 00000000..0c97f57f --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/PlainGeometry/Triangle.cs @@ -0,0 +1,98 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Triangle.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + +using StgSharp.Graphics; +using StgSharp.Math; + +using System; +using System.Numerics; + +namespace StgSharp.Geometries +{ + + + public unsafe class Triangle : PlainGeometry + { + + public Triangle():base(PlainCoordinate.StandardPlainCoordination) + { + vertexMat = new vec4d[3]; + } + + public Triangle( + Point vertex01, + Point vertex02, + Point vertex03 + ) : base(PlainCoordinate.StandardPlainCoordination) + { + this[0] = vertex01; + this[1] = vertex02; + this[2] = vertex03; + } + + public Triangle( + float v0x, float v0y, + float v1x, float v1y, + float v2x, float v2y + ) : base(PlainCoordinate.StandardPlainCoordination) + { + this[0] = new Point(v0x, v0y, 0); + this[1] = new Point(v1x, v1y, 0); + this[2] = new Point(v2x, v2y, 0); + } + + public Triangle(PlainCoordinate coordination, + Point vertex01, + Point vertex02, + Point vertex03 + ) : base(coordination) + { + this[0] = vertex01; + this[1] = vertex02; + this[2] = vertex03; + } + + public Triangle(PlainCoordinate coordination, + float v0x, float v0y, + float v1x, float v1y, + float v2x, float v2y + ) : base(coordination) + { + this[0] = new Point(v0x, v0y, 0); + this[1] = new Point(v1x, v1y, 0); + this[2] = new Point(v2x, v2y, 0); + } + internal static int[] Indices = [ 0, 1, 2 ]; + + public override ReadOnlySpan VertexIndices => Indices; + + } +} diff --git a/源代码/StgSharpDebug/Geometries/Point.cs b/源代码/StgSharpDebug/Geometries/Point.cs new file mode 100644 index 00000000..f5ca51ac --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/Point.cs @@ -0,0 +1,43 @@ +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Geometries +{ + [StructLayout(LayoutKind.Explicit, Size = 16)] + public struct Point + { + [FieldOffset(0)] private vec3d coord; + [FieldOffset(0)] internal Vector4 coordVec; + + public Point(float x, float y, float z) + { + coordVec = new Vector4(x,y,z,1); + } + + public Point(vec3d coord) + { + Coord = coord; + coordVec.W = 1; + } + + internal Point(vec4d vector) + { + coordVec = vector.vec; + coordVec.W = 1; + } + + public vec3d Coord + { + get => coord; + set { coord = value; coordVec.W = 1; } + } + + + + } +} diff --git a/源代码/StgSharpDebug/Geometries/SpaceGeometry/Class1.cs b/源代码/StgSharpDebug/Geometries/SpaceGeometry/Class1.cs new file mode 100644 index 00000000..26a650a2 --- /dev/null +++ b/源代码/StgSharpDebug/Geometries/SpaceGeometry/Class1.cs @@ -0,0 +1,40 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Class1.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Geometries.SpaceGeometry +{ + internal class Class1 + { + } +} diff --git a/源代码/StgSharpDebug/Graphics b/源代码/StgSharpDebug/Graphics deleted file mode 120000 index 29baab03..00000000 --- a/源代码/StgSharpDebug/Graphics +++ /dev/null @@ -1 +0,0 @@ -D:/NitloadIndustry/研究项目/1-Flagship/TH2020/ProjectFile/源代码/StgSharp/Graphics \ No newline at end of file diff --git a/源代码/StgSharpDebug/Graphics/CPUanimation/AnimationBuilder.cs b/源代码/StgSharpDebug/Graphics/CPUanimation/AnimationBuilder.cs new file mode 100644 index 00000000..c48bb089 --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/CPUanimation/AnimationBuilder.cs @@ -0,0 +1,88 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="AnimationBuilder.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Geometries; + +using System; +using System.Collections.Generic; +using System.Net; +using System.Text; + +namespace StgSharp.Graphics +{ + public delegate Image BuildAnimationDelegate(float time, out Polygon4 texutreFrame); + + public sealed class AnimationBuilder: IImageProvider + { + + private Image cache; + private Polygon4 textureFrame; + private TimeFunction time; + + public AnimationBuilder( + BuildAnimationDelegate builderFunc, + TimeFunction timeline + ) + { + textureFrame = new Polygon4(); + time = timeline; + BuilderFunc = builderFunc; + cache = BuilderFunc(time.Calculate(), out textureFrame); + } + + public Polygon4 TextureFrame { get => textureFrame; } + + public BuildAnimationDelegate BuilderFunc { get; set; } + + public bool IsComplete + { + get => time.IsComplete; + } + + public Image GetAnimationFrame() + { + if (!time.IsComplete) + { + cache = BuilderFunc(time.Calculate(),out textureFrame); + } + return cache; + } + + public void reset() + { + time.Reset(); + } + + Image IImageProvider.ProvideImage() + { + return GetAnimationFrame(); + } + } +} diff --git a/源代码/StgSharpDebug/Graphics/CPUanimation/IImageProvider.cs b/源代码/StgSharpDebug/Graphics/CPUanimation/IImageProvider.cs new file mode 100644 index 00000000..88bd1420 --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/CPUanimation/IImageProvider.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Graphics +{ + public interface IImageProvider + { + Image ProvideImage(); + + } +} diff --git a/源代码/StgSharpDebug/Graphics/Define/StructDefine.cs b/源代码/StgSharpDebug/Graphics/Define/StructDefine.cs new file mode 100644 index 00000000..11ef25cc --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/Define/StructDefine.cs @@ -0,0 +1,961 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="StructDefine.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Graphics.GL; + +using System; +using System.Runtime.InteropServices; + +/**/ + +namespace StgSharp.Graphics +{ + //rename types in style of GLFW + + using GLFWbool = Boolean; + + //strucs defined in GLFW3.h + + #region GLFW3 struct + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWcontext + { + + private int client; + private IntPtr destroy; + private delegate* extensionSupported; + private GLFWbool forward, debug, noerror; + + //PFNGLGETINTEGERVPROC GetIntegerv; + private IntPtr GetIntegerv; + private delegate*, void> getProcAddress; + + //PFNGLGETSTRINGPROC GetString; + private IntPtr GetString; + + //PFNGLGETSTRINGIPROC GetStringi; + private IntPtr GetStringi; + private int major, minor, revision; + + /* + void (* makeCurrent) (glfwWindow*); + void (* swapBuffers) (glfwWindow*); + void (* swapInterval) (int); + int (* extensionSupported) (const byte*); + GLFWglproc(*getProcAddress)(const byte*); + void (* destroy) (glfwWindow*); + */ + + private delegate* makeCurrent; + private int profile; + private int release; + private int robustness; + private int source; + private delegate* swapBuffer; + private delegate* swapInterval; + + internal struct egl + { + + private void* client; + + /* + EGLConfig config; + EGLContext handle; + EGLSurface surface; + */ + private void* config; + private void* handle; + private void* surface; + + } + + internal struct osmesa + { + + private void* buffer; + + //OSMesaContext handle; + private void* handle; + private int height; + + private int width; + + } + + // This is defined in platform.h + //GLFW_PLATFORM_CONTEXT_STATE + } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct glfwVideomode + { + + /*! The refresh rate, in Hz, of the video mode. + */ + private int refreshRate; + /*! The bit depth of the blue channel of the video mode. + */ + public int blueBits; + /*! The bit depth of the green channel of the video mode. + */ + public int greenBits; + /*! The height, in screen coordinates, of the video mode. + */ + public int height; + /*! The bit depth of the red channel of the video mode. + */ + public int redBits; + + /*! The width, in screen coordinates, of the video mode. + */ + public int width; + + } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct glfwGammaramp + { + + /*! An array of value describing the response of the blue channel. + */ + private ushort* blue; + /*! An array of value describing the response of the green channel. + */ + private ushort* green; + + /*! An array of value describing the response of the red channel. + */ + private ushort* red; + /*! The number of elements in each array. + */ + private uint size; + + } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWimage + { + + /*! The height, in pixels, of this image. + */ + private int height; + /*! The width, in pixels, of this image. + */ + private int width; + /*! The pixel data of this image, arranged left-to-right, top-to-bottom. + */ + private byte* pixels; + + + } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWgamepadstate + { + + /*! The states of each [gamepad axis](@ref gamepad_axes), in the range -1.0 + * to 1.0 inclusive. + */ + public fixed float axes[6]; + + /*! The states of each [gamepad button](@ref gamepad_buttons), `GLFW_PRESS` + * or `GLFW_RELEASE`. + */ + public fixed byte buttons[15]; + + } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWallocator + { + + //GLFWallocatefun allocate; + private IntPtr allocate; + + //GLFWdeallocatefun deallocate; + private IntPtr deallocate; + + //GLFWreallocatefun reallocate; + private IntPtr reallocate; + + private void* user; + + } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct glfwMonitor + { + + private fixed byte name[128]; + private IntPtr userPointer; + + private int width, height; + + private glfwWindow* window; + + private glfwVideomode* modes; + private int modeCount; + private glfwVideomode currentMode; + + private glfwGammaramp originalRamp; + private glfwGammaramp currentRamp; + + public glfwMonitor() + { } + + public unsafe string Name + { + get + { + fixed (byte* cptr = name) + { + return Marshal.PtrToStringAnsi((IntPtr)cptr); + } + } + } + } + + [StructLayout(LayoutKind.Sequential)] + unsafe struct glfwWindow + { + glfwWindow* next; + + // Window settings and state + int resizable; + int decorated; + int autoIconify; + int floating; + int focusOnShow; + int mousePassthrough; + int shouldClose; + void* userPointer; + int doublebuffer; + // glfwVideomode videoMode; // 根据GLFWvidmode的定义转换 + IntPtr monitor; // _GLFWmonitor* monitor; + IntPtr cursor; // _GLFWcursor* cursor; + + int minwidth, minheight; + int maxwidth, maxheight; + int numer, denom; + + int stickyKeys; + int stickyMouseButtons; + int lockKeyMods; + int cursorMode; + public fixed byte mouseButtons[GLconst.GLFW_MOUSE_BUTTON_LAST + 1]; + public fixed byte keys[GLconst.GLFW_KEY_LAST + 1]; + + // Virtual cursor position when cursor is disabled + double virtualCursorPosX, virtualCursorPosY; + bool rawMouseMotion; + + // _GLFWcontext context; // 根据_GLFWcontext的定义转换 + + // Callbacks are represented as IntPtr since we don't need the actual function pointers in C# + internal struct Callbacks + { + internal IntPtr pos; + internal IntPtr size; + internal IntPtr close; + internal IntPtr refresh; + internal IntPtr focus; + internal IntPtr iconify; + internal IntPtr maximize; + internal IntPtr fbsize; + internal IntPtr scale; + internal IntPtr mouseButton; + internal IntPtr cursorPos; + internal IntPtr cursorEnter; + internal IntPtr scroll; + internal IntPtr key; + internal IntPtr character; + internal IntPtr charmods; + internal IntPtr drop; + } + Callbacks callbacks; + + // GLFW_PLATFORM_WINDOW_STATE platformWindowState; +} + + + [StructLayout(LayoutKind.Sequential)] + public struct GLFWwindowCallback + { + + } + + [StructLayout(LayoutKind.Sequential)] + public struct GLFWcursor + { + + //GLFWcursor* next; + private IntPtr next; + + // This is defined in platform.h + // not completed in tranformation + // GLFW_PLATFORM_CURSOR_STATE; + } + + /* + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWerror + { + //GLFWerror* next; + IntPtr next; + int code; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)GLconst.GLFW_MESSAGE_SIZE)] + byte[] description = new byte[GLconst.GLFW_MESSAGE_SIZE]; + + public GLFWerror() + { + } + } + */ + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWinitconfig + { + + private int angleType; + + private GLFWbool hatButtons; + private int platformID; + + //PFN_vkGetInstanceProcAddr vulkanLoader; + private IntPtr vulkanLoader; + + } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWwndconfig + { + + private GLFWbool autoIconify; + private GLFWbool centerCursor; + private GLFWbool decorated; + private GLFWbool floating; + private GLFWbool focused; + private GLFWbool focusOnShow; + private int height; + private GLFWbool maximized; + private GLFWbool mousePassthrough; + private GLFWbool resizable; + private GLFWbool scaleToMonitor; + private byte* title; + private GLFWbool visible; + private int width; + + private int xpos; + private int ypos; + + internal Ns ns = new Ns(); + + internal Win32 win32 = new Win32(); + + internal Wl wl = new Wl(); + + internal X11 x11 = new X11(); + + public GLFWwndconfig() + { + } + + internal struct Ns + { + + private GLFWbool retina = false; + public fixed byte frameName[256]; + + public Ns() + { + } + + } + + internal struct X11 + { + + public fixed byte className[256]; + public fixed byte instanceName[256]; + + public X11() + { + } + + } + + internal struct Win32 + { + + private GLFWbool keymenu; + + } + + internal struct Wl + { + + public fixed byte appId[256]; + + public Wl() + { + } + + } + + } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWctxconfig + { + + private int client; + private GLFWbool debug; + private GLFWbool forward; + private int major; + private int minor; + private GLFWbool noerror; + private int profile; + private int release; + private int robustness; + + //glfwWindow* share; + private IntPtr share; + private int source; + + internal Nsgl nsgl = new Nsgl(); + + public GLFWctxconfig() + { + } + + internal struct Nsgl + { + + private GLFWbool offline; + + } + + } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWfbconfig + { + + private int accumAlphaBits; + private int accumBlueBits; + private int accumGreenBits; + private int accumRedBits; + private int alphaBits; + private int auxBuffers; + private int blueBits; + private int depthBits; + private GLFWbool doublebuffer; + private int greenBits; + private uintptr_t handle; + + private int redBits; + private int samples; + private GLFWbool sRGB; + private int stencilBits; + private GLFWbool stereo; + private GLFWbool transparent; + + } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct GLFWlibrary + { + + private GLFWallocator allocator; + private GLFWls contextSlot; + + //GLFWcursor* cursorListHead; + private IntPtr cursorListHead; + + //GLFWerror* errorListHead; + private IntPtr errorListHead; + private GLFWmutex errorLock; + + private GLFWls errorSlot; + + private GLFWbool initialized; + + [MarshalAs(UnmanagedType.ByValArray, SizeConst = GLconst.GLFW_JOYSTICK_LAST + 1)] + private GLFWjoystick[] joysticks = new GLFWjoystick[GLconst.GLFW_JOYSTICK_LAST + 1]; + + private GLFWbool joysticksInitialized; + + private int mappingCount; + + //GLFWmapping* mappings; + private IntPtr mappings; + + private int monitorCount; + + //GLFWmonitor** monitors; + private IntPtr monitors; + + private GLFWplatform platform; + + //glfwWindow* windowListHead; + private IntPtr windowListHead; + + internal Callbacks callbacks = new Callbacks(); + + internal Egl egl = new Egl(); + + internal Hints hints = new Hints(); + + internal Osmesa osmesa = new Osmesa(); + + public GLFWlibrary() + { + } + + internal unsafe struct Hints + { + + private GLFWctxconfig context; + private GLFWfbconfig framebuffer; + + private GLFWinitconfig init; + private int refreshRate; + private GLFWwndconfig window; + + } + + internal unsafe struct timer + { + + private ulong offset; + // This is defined in platform.h + + //not transformed function defination + //GLFW_PLATFORM_LIBRARY_TIMER_STATE + } + + internal unsafe struct Egl + { + + internal bool ANGLE_platform_angle; + internal bool ANGLE_platform_angle_d3d; + internal bool ANGLE_platform_angle_metal; + internal bool ANGLE_platform_angle_opengl; + internal bool ANGLE_platform_angle_vulkan; + internal IntPtr BindAPI; + internal IntPtr CreateContext; + internal IntPtr CreatePlatformWindowSurfaceEXT; + internal IntPtr CreateWindowSurface; + internal IntPtr DestroyContext; + internal IntPtr DestroySurface; + internal void* display; + internal bool EXT_client_extensions; + internal bool EXT_platform_base; + internal bool EXT_platform_wayland; + internal bool EXT_platform_x11; + internal bool EXT_present_opaque; + + internal IntPtr GetConfigAttrib; + internal IntPtr GetConfigs; + internal IntPtr GetDisplay; + internal IntPtr GetError; + + internal IntPtr GetPlatformDisplayEXT; + internal IntPtr GetProcAddress; + + internal void* handle; + internal IntPtr Initialize; + internal bool KHR_colorSpace; + internal bool KHR_context_flush_control; + + internal bool KHR_create_context; + internal bool KHR_create_context_no_error; + internal bool KHR_get_all_proc_addresses; + internal int major, minor; + internal IntPtr MakeCurrent; + + internal int platform; + internal bool prefix; + internal IntPtr QueryString; + internal IntPtr SwapBuffers; + internal IntPtr SwapInterval; + internal IntPtr Terminate; + + } + + internal unsafe struct Osmesa + { + + private IntPtr CreateContextAttribs; + + private IntPtr CreateContextExt; + private IntPtr DestroyContext; + private IntPtr GetColorBuffer; + private IntPtr GetDepthBuffer; + private IntPtr GetProcAddress; + + private void* handle; + private IntPtr MakeCurrent; + + } + + internal unsafe struct vk + { + + private GLFWbool available; + private GLFWbool EXT_metal_surface; + private fixed ulong extensions[2]; + private IntPtr GetInstanceProcAddr; + private void* handle; + private GLFWbool KHR_surface; + private GLFWbool KHR_wayland_surface; + private GLFWbool KHR_win32_surface; + private GLFWbool KHR_xcb_surface; + private GLFWbool KHR_xlib_surface; + private GLFWbool MVK_macos_surface; + + public vk() + { + } + + } + + internal unsafe struct Callbacks + { + + private IntPtr joystick; + + private IntPtr monitor; + + } + + } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWmapelement + { + + private sbyte axisOffset; + private sbyte axisScale; + private byte index; + + private byte type; + + } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWmapping + { + + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] + private GLFWmapelement[] axes = new GLFWmapelement[6]; + + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)] + private GLFWmapelement[] buttons = new GLFWmapelement[15]; + private fixed byte guid[33]; + + private fixed byte name[128]; + + public GLFWmapping() + { } + + } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWjoystick + { + + private GLFWbool allocated; + private float* axes; + private int axisCount; + private int buttonCount; + private byte* buttons; + private GLFWbool connected; + private fixed byte guid[33]; + private int hatCount; + private byte* hats; + + //GLFWmapping* mapping; + private IntPtr mapping; + private fixed byte name[128]; + private void* userPointer; + + // This is defined in platform.h + // not completed in transforming + // GLFW_PLATFORM_JOYSTICK_STATE; + + public GLFWjoystick() + { } + + } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWls + { + // This is defined in platform.h + + //GLFW_PLATFORM_TLS_STATE + } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWplatform + { + + // init + //GLFWbool(*init)(void); + private IntPtr init; + + private int platformID; + + //void (* terminate) (void); + private IntPtr terminate; + internal IntPtr createCursor; + internal IntPtr createStandardCursor; + + // window + internal IntPtr createWindow; + internal IntPtr destroyCursor; + + internal IntPtr destroyWindow; + internal IntPtr focusWindow; + internal IntPtr framebufferTransparent; + + // monitor + internal IntPtr freeMonitor; + internal IntPtr getClipboardString; + + internal IntPtr getEGLNativeDisplay; + internal IntPtr getEGLNativeWindow; + + // EGL + //EGLenum(*getEGLPlatform)(EGLint**); + //EGLNativeDisplayType(*getEGLNativeDisplay)(void); + //EGLNativeWindowType(*getEGLNativeWindow)(glfwWindow*); + internal IntPtr getEGLPlatform; + internal IntPtr getFramebufferSize; + internal IntPtr getGammaRamp; + internal IntPtr getKeyScancode; + internal IntPtr getMappingName; + internal IntPtr getMonitorContentScale; + + internal IntPtr getMonitorPos; + internal IntPtr getMonitorWorkarea; + + // vulkan + //void (* getRequiredInstanceExtensions) (byte**); + //GLFWbool(*getPhysicalDevicePresentationSupport)(VkInstance, VkPhysicalDevice, uint32_t); + //VkResult(*createWindowSurface)(VkInstance, glfwWindow*,const VkAllocationCallbacks*, VkSurfaceKHR*); + internal IntPtr getRequiredInstanceExtensions; + internal IntPtr getScancodeName; + internal IntPtr getVideoMode; + internal IntPtr getVideoModes; + internal IntPtr getWindowContentScale; + internal IntPtr getWindowFrameSize; + internal IntPtr getWindowOpacity; + internal IntPtr getWindowPos; + internal IntPtr getWindowSize; + internal IntPtr GLFWwindow; + internal IntPtr hideWindow; + internal IntPtr iconifyWindow; + internal IntPtr initJoysticks; + internal IntPtr maximizeWindow; + internal IntPtr pollEvents; + internal IntPtr pollJoystick; + internal IntPtr postEmptyEvent; + internal IntPtr rawMouseMotionSupported; + internal IntPtr requestWindowAttention; + internal IntPtr restoreWindow; + internal IntPtr setClipboardString; + internal IntPtr setCursor; + internal IntPtr setCursorMode; + + #region input + /* void (* getCursorPos) (glfwWindow*, double*, double*); + void (* setCursorPos) (glfwWindow*, double, double); + void (* setCursorMode) (glfwWindow*, int); + void (* setRawMouseMotion) (glfwWindow*, GLFWbool); + GLFWbool(*rawMouseMotionSupported)(void); + GLFWbool(*createCursor)(GLFWcursor*,const GLFWimage*,int,int); + GLFWbool(*createStandardCursor)(GLFWcursor*, int); + void (* destroyCursor) (GLFWcursor*); + void (* setCursor) (glfwWindow*, GLFWcursor*); + const byte* (*getScancodeName)(int); + int (* getKeyScancode) (int); + void (* setClipboardString) (const byte*); + const byte* (*getClipboardString)(void); + GLFWbool(*initJoysticks)(void); + void (* terminateJoysticks) (void); + GLFWbool(*pollJoystick)(GLFWjoystick*, int); + const byte* (*getMappingName)(void); + void (* updateGamepadGUID) (byte*); + // monitor + void (* freeMonitor) (GLFWmonitor*); + void (* getMonitorPos) (GLFWmonitor*, int*, int*); + void (* getMonitorContentScale) (GLFWmonitor*, float*, float*); + void (* getMonitorWorkarea) (GLFWmonitor*, int*, int*, int*, int*); + glfwVideomode* (* getVideoModes) (GLFWmonitor*, int*); + void (* getVideoMode) (GLFWmonitor*, glfwVideomode*); + GLFWbool(*getGammaRamp)(GLFWmonitor*, glfwGammaramp*); + void (* setGammaRamp) (GLFWmonitor*,const glfwGammaramp*); + // window + GLFWbool(*createWindow)(glfwWindow*,const GLFWwndconfig*,const GLFWctxconfig*,const GLFWfbconfig*); + void (* destroyWindow) (glfwWindow*); + void (* setWindowTitle) (glfwWindow*,const byte*); + void (* setWindowIcon) (glfwWindow*, int,const GLFWimage*); + void (* getWindowPos) (glfwWindow*, int*, int*); + void (* setWindowPos) (glfwWindow*, int, int); + void (* getWindowSize) (glfwWindow*, int*, int*); + void (* setWindowSize) (glfwWindow*, int, int); + void (* setWindowSizeLimits) (glfwWindow*, int, int, int, int); + void (* setWindowAspectRatio) (glfwWindow*, int, int); + void (* getFramebufferSize) (glfwWindow*, int*, int*); + void (* getWindowFrameSize) (glfwWindow*, int*, int*, int*, int*); + void (* getWindowContentScale) (glfwWindow*, float*, float*); + void (* iconifyWindow) (glfwWindow*); + void (* restoreWindow) (glfwWindow*); + void (* maximizeWindow) (glfwWindow*); + void (* showWindow) (glfwWindow*); + void (* hideWindow) (glfwWindow*); + void (* requestWindowAttention) (glfwWindow*); + void (* focusWindow) (glfwWindow*); + void (* setWindowMonitor) (glfwWindow*, GLFWmonitor*, int, int, int, int, int); + GLFWbool(*windowFocused)(glfwWindow*); + GLFWbool(*windowIconified)(glfwWindow*); + GLFWbool(*windowVisible)(glfwWindow*); + GLFWbool(*windowMaximized)(glfwWindow*); + GLFWbool(*windowHovered)(glfwWindow*); + GLFWbool(*framebufferTransparent)(glfwWindow*); + float (* getWindowOpacity) (glfwWindow*); + void (* setWindowResizable) (glfwWindow*, GLFWbool); + void (* setWindowDecorated) (glfwWindow*, GLFWbool); + void (* setWindowFloating) (glfwWindow*, GLFWbool); + void (* setWindowOpacity) (glfwWindow*, float); + void (* setWindowMousePassthrough) (glfwWindow*, GLFWbool); + void (* pollEvents) (void); + void (* waitEvents) (void); + void (* waitEventsTimeout) (double); + void (* postEmptyEvent) (void); + */ + #endregion + + internal IntPtr setCursorPos; + internal IntPtr setGammaRamp; + internal IntPtr setRawMouseMotion; + internal IntPtr setWindowAspectRatio; + internal IntPtr setWindowDecorated; + internal IntPtr setWindowFloating; + internal IntPtr setWindowIcon; + internal IntPtr setWindowMonitor; + internal IntPtr setWindowMousePassthrough; + internal IntPtr setWindowOpacity; + internal IntPtr setWindowPos; + internal IntPtr setWindowResizable; + internal IntPtr setWindowSize; + internal IntPtr setWindowSizeLimits; + internal IntPtr setWindowTitle; + internal IntPtr showWindow; + internal IntPtr terminateJoysticks; + internal IntPtr updateGamepadGUID; + + internal IntPtr VkPhysicalDevice; + internal IntPtr waitEvents; + internal IntPtr waitEventsTimeout; + internal IntPtr windowFocused; + internal IntPtr windowHovered; + internal IntPtr windowIconified; + internal IntPtr windowMaximized; + internal IntPtr windowVisible; + + } + + [StructLayout(LayoutKind.Sequential)] + public unsafe struct GLFWmutex + { + // This is defined in platform.h + //GLFW_PLATFORM_MUTEX_STATE + } + + //public unsafe struct VkAllocationCallbacks { } + + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct VkExtensionProperties + { + + private fixed byte extensionName[256]; + private uint specVersion; + + public VkExtensionProperties() + { + } + + } + + /* + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct GLFWerror + { + IntPtr next; + int code; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] + byte[] description = new byte[1024]; + + public GLFWerror() + { + } + } + */ + + [StructLayout(LayoutKind.Explicit, Size = 16)] + public struct uintptr_t + { + + [FieldOffset(0)] + private long part1; + + [FieldOffset(8)] + private long part2; + + } + + #endregion GLFW3 struct + + #region glad struct + + [StructLayout(LayoutKind.Sequential)] + internal struct GLsync + { + } + + #endregion glad struct +} + +/**/ \ No newline at end of file diff --git a/源代码/StgSharpDebug/Graphics/Define/glApiDefine.cs b/源代码/StgSharpDebug/Graphics/Define/glApiDefine.cs new file mode 100644 index 00000000..42b7b163 --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/Define/glApiDefine.cs @@ -0,0 +1,70 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="glApiDefine.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +/* + * This file is created to link functions in OpenGL to version in C# + * The name of delegates and organization to init all these delegates + * are refferd from GLAD1 in agreement of MIT license generated from + * https://glad.dav1d.de/ + */ + + +using StgSharp.Math; + +using System; +using System.Numerics; +using System.Runtime.InteropServices; + +namespace StgSharp.Graphics +{ + #region StgSharpDele + + public unsafe delegate void FrameBufferSizeHandler(IntPtr window, uint width, uint height); + + #endregion + + /// + /// Function handler to load an opengl function by searching its name. + /// + /// the name of the Opengl function + /// An intptr value representing the pointer to the function + public delegate IntPtr glLoader(string name); + + #region glDEBUG + + internal unsafe delegate void GLDEBUGPROC(int source, int type, uint id, int severity, int length, sbyte* message, void* userParam); + internal unsafe delegate void GLDEBUGPROCARB(int source, int type, uint id, int severity, int length, sbyte* message, void* userParam); + internal unsafe delegate void GLDEBUGPROCKHR(int source, int type, uint id, int severity, int length, sbyte* message, void* userParam); + internal unsafe delegate void GLDEBUGPROCAMD(uint id, int category, int severity, int length, sbyte* message, void* userParam); + + #endregion + + +} diff --git a/源代码/StgSharpDebug/Graphics/Define/glConst.cs b/源代码/StgSharpDebug/Graphics/Define/glConst.cs new file mode 100644 index 00000000..af825ad9 --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/Define/glConst.cs @@ -0,0 +1,4870 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="glConst.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Drawing; + +namespace StgSharp.Graphics.GL +{ + //rename types in style of GLconst + + public static unsafe class GLconst + { + + #region glfw + + public const int GLFW_VERSION_MAJOR = 3; + public const int GLFW_VERSION_MINOR = 3; + public const int GLFW_VERSION_REVISION = 8; + public const int GLFW_TRUE = 1; + public const int GLFW_FALSE = 0; + public const int GLFW_RELEASE = 0; + public const int GLFW_PRESS = 1; + public const int GLFW_REPEAT = 2; + public const int GLFW_HAT_CENTERED = 0; + public const int GLFW_HAT_UP = 1; + public const int GLFW_HAT_RIGHT = 2; + public const int GLFW_HAT_DOWN = 4; + public const int GLFW_HAT_LEFT = 8; + public const int GLFW_HAT_RIGHT_UP = GLFW_HAT_RIGHT | GLFW_HAT_UP; + public const int GLFW_HAT_RIGHT_DOWN = GLFW_HAT_RIGHT | GLFW_HAT_DOWN; + public const int GLFW_HAT_LEFT_UP = GLFW_HAT_LEFT | GLFW_HAT_UP; + public const int GLFW_HAT_LEFT_DOWN = GLFW_HAT_LEFT | GLFW_HAT_DOWN; + public const int GLFW_KEY_UNKNOWN = -1; + public const int GLFW_KEY_SPACE = 32; + public const int GLFW_KEY_APOSTROPHE = 39; + public const int GLFW_KEY_COMMA = 44; + public const int GLFW_KEY_MINUS = 45; + public const int GLFW_KEY_PERIOD = 46; + public const int GLFW_KEY_SLASH = 47; + public const int GLFW_KEY_0 = 48; + public const int GLFW_KEY_1 = 49; + public const int GLFW_KEY_2 = 50; + public const int GLFW_KEY_3 = 51; + public const int GLFW_KEY_4 = 52; + public const int GLFW_KEY_5 = 53; + public const int GLFW_KEY_6 = 54; + public const int GLFW_KEY_7 = 55; + public const int GLFW_KEY_8 = 56; + public const int GLFW_KEY_9 = 57; + public const int GLFW_KEY_SEMICOLON = 59; + public const int GLFW_KEY_EQUAL = 61; + public const int GLFW_KEY_A = 65; + public const int GLFW_KEY_B = 66; + public const int GLFW_KEY_C = 67; + public const int GLFW_KEY_D = 68; + public const int GLFW_KEY_E = 69; + public const int GLFW_KEY_F = 70; + public const int GLFW_KEY_G = 71; + public const int GLFW_KEY_H = 72; + public const int GLFW_KEY_I = 73; + public const int GLFW_KEY_J = 74; + public const int GLFW_KEY_K = 75; + public const int GLFW_KEY_L = 76; + public const int GLFW_KEY_M = 77; + public const int GLFW_KEY_N = 78; + public const int GLFW_KEY_O = 79; + public const int GLFW_KEY_P = 80; + public const int GLFW_KEY_Q = 81; + public const int GLFW_KEY_R = 82; + public const int GLFW_KEY_S = 83; + public const int GLFW_KEY_T = 84; + public const int GLFW_KEY_U = 85; + public const int GLFW_KEY_V = 86; + public const int GLFW_KEY_W = 87; + public const int GLFW_KEY_X = 88; + public const int GLFW_KEY_Y = 89; + public const int GLFW_KEY_Z = 90; + public const int GLFW_KEY_LEFT_BRACKET = 91; + public const int GLFW_KEY_BACKSLASH = 92; + public const int GLFW_KEY_RIGHT_BRACKET = 93; + public const int GLFW_KEY_GRAVE_ACCENT = 96; + public const int GLFW_KEY_WORLD_1 = 161; + public const int GLFW_KEY_WORLD_2 = 162; + public const int GLFW_KEY_ESCAPE = 256; + public const int GLFW_KEY_ENTER = 257; + public const int GLFW_KEY_TAB = 258; + public const int GLFW_KEY_BACKSPACE = 259; + public const int GLFW_KEY_INSERT = 260; + public const int GLFW_KEY_DELETE = 261; + public const int GLFW_KEY_RIGHT = 262; + public const int GLFW_KEY_LEFT = 263; + public const int GLFW_KEY_DOWN = 264; + public const int GLFW_KEY_UP = 265; + public const int GLFW_KEY_PAGE_UP = 266; + public const int GLFW_KEY_PAGE_DOWN = 267; + public const int GLFW_KEY_HOME = 268; + public const int GLFW_KEY_END = 269; + public const int GLFW_KEY_CAPS_LOCK = 280; + public const int GLFW_KEY_SCROLL_LOCK = 281; + public const int GLFW_KEY_NUM_LOCK = 282; + public const int GLFW_KEY_PRINT_SCREEN = 283; + public const int GLFW_KEY_PAUSE = 284; + public const int GLFW_KEY_F1 = 290; + public const int GLFW_KEY_F2 = 291; + public const int GLFW_KEY_F3 = 292; + public const int GLFW_KEY_F4 = 293; + public const int GLFW_KEY_F5 = 294; + public const int GLFW_KEY_F6 = 295; + public const int GLFW_KEY_F7 = 296; + public const int GLFW_KEY_F8 = 297; + public const int GLFW_KEY_F9 = 298; + public const int GLFW_KEY_F10 = 299; + public const int GLFW_KEY_F11 = 300; + public const int GLFW_KEY_F12 = 301; + public const int GLFW_KEY_F13 = 302; + public const int GLFW_KEY_F14 = 303; + public const int GLFW_KEY_F15 = 304; + public const int GLFW_KEY_F16 = 305; + public const int GLFW_KEY_F17 = 306; + public const int GLFW_KEY_F18 = 307; + public const int GLFW_KEY_F19 = 308; + public const int GLFW_KEY_F20 = 309; + public const int GLFW_KEY_F21 = 310; + public const int GLFW_KEY_F22 = 311; + public const int GLFW_KEY_F23 = 312; + public const int GLFW_KEY_F24 = 313; + public const int GLFW_KEY_F25 = 314; + public const int GLFW_KEY_KP_0 = 320; + public const int GLFW_KEY_KP_1 = 321; + public const int GLFW_KEY_KP_2 = 322; + public const int GLFW_KEY_KP_3 = 323; + public const int GLFW_KEY_KP_4 = 324; + public const int GLFW_KEY_KP_5 = 325; + public const int GLFW_KEY_KP_6 = 326; + public const int GLFW_KEY_KP_7 = 327; + public const int GLFW_KEY_KP_8 = 328; + public const int GLFW_KEY_KP_9 = 329; + public const int GLFW_KEY_KP_DECIMAL = 330; + public const int GLFW_KEY_KP_DIVIDE = 331; + public const int GLFW_KEY_KP_MULTIPLY = 332; + public const int GLFW_KEY_KP_SUBTRACT = 333; + public const int GLFW_KEY_KP_ADD = 334; + public const int GLFW_KEY_KP_ENTER = 335; + public const int GLFW_KEY_KP_EQUAL = 336; + public const int GLFW_KEY_LEFT_SHIFT = 340; + public const int GLFW_KEY_LEFT_CONTROL = 341; + public const int GLFW_KEY_LEFT_ALT = 342; + public const int GLFW_KEY_LEFT_SUPER = 343; + public const int GLFW_KEY_RIGHT_SHIFT = 344; + public const int GLFW_KEY_RIGHT_CONTROL = 345; + public const int GLFW_KEY_RIGHT_ALT = 346; + public const int GLFW_KEY_RIGHT_SUPER = 347; + public const int GLFW_KEY_MENU = 348; + public const int GLFW_KEY_LAST = GLFW_KEY_MENU; + public const int GLFW_MOD_SHIFT = 0x0001; + public const int GLFW_MOD_CONTROL = 0x0002; + public const int GLFW_MOD_ALT = 0x0004; + public const int GLFW_MOD_SUPER = 0x0008; + public const int GLFW_MOD_CAPS_LOCK = 0x0010; + public const int GLFW_MOD_NUM_LOCK = 0x0020; + public const int GLFW_MOUSE_BUTTON_1 = 0; + public const int GLFW_MOUSE_BUTTON_2 = 1; + public const int GLFW_MOUSE_BUTTON_3 = 2; + public const int GLFW_MOUSE_BUTTON_4 = 3; + public const int GLFW_MOUSE_BUTTON_5 = 4; + public const int GLFW_MOUSE_BUTTON_6 = 5; + public const int GLFW_MOUSE_BUTTON_7 = 6; + public const int GLFW_MOUSE_BUTTON_8 = 7; + public const int GLFW_MOUSE_BUTTON_LAST = GLFW_MOUSE_BUTTON_8; + public const int GLFW_MOUSE_BUTTON_LEFT = GLFW_MOUSE_BUTTON_1; + public const int GLFW_MOUSE_BUTTON_RIGHT = GLFW_MOUSE_BUTTON_2; + public const int GLFW_MOUSE_BUTTON_MIDDLE = GLFW_MOUSE_BUTTON_3; + public const int GLFW_JOYSTICK_1 = 0; + public const int GLFW_JOYSTICK_2 = 1; + public const int GLFW_JOYSTICK_3 = 2; + public const int GLFW_JOYSTICK_4 = 3; + public const int GLFW_JOYSTICK_5 = 4; + public const int GLFW_JOYSTICK_6 = 5; + public const int GLFW_JOYSTICK_7 = 6; + public const int GLFW_JOYSTICK_8 = 7; + public const int GLFW_JOYSTICK_9 = 8; + public const int GLFW_JOYSTICK_10 = 9; + public const int GLFW_JOYSTICK_11 = 10; + public const int GLFW_JOYSTICK_12 = 11; + public const int GLFW_JOYSTICK_13 = 12; + public const int GLFW_JOYSTICK_14 = 13; + public const int GLFW_JOYSTICK_15 = 14; + public const int GLFW_JOYSTICK_16 = 15; + public const int GLFW_JOYSTICK_LAST = GLFW_JOYSTICK_16; + public const int GLFW_GAMEPAD_BUTTON_A = 0; + public const int GLFW_GAMEPAD_BUTTON_B = 1; + public const int GLFW_GAMEPAD_BUTTON_X = 2; + public const int GLFW_GAMEPAD_BUTTON_Y = 3; + public const int GLFW_GAMEPAD_BUTTON_LEFT_BUMPER = 4; + public const int GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER = 5; + public const int GLFW_GAMEPAD_BUTTON_BACK = 6; + public const int GLFW_GAMEPAD_BUTTON_START = 7; + public const int GLFW_GAMEPAD_BUTTON_GUIDE = 8; + public const int GLFW_GAMEPAD_BUTTON_LEFT_THUMB = 9; + public const int GLFW_GAMEPAD_BUTTON_RIGHT_THUMB = 10; + public const int GLFW_GAMEPAD_BUTTON_DPAD_UP = 11; + public const int GLFW_GAMEPAD_BUTTON_DPAD_RIGHT = 12; + public const int GLFW_GAMEPAD_BUTTON_DPAD_DOWN = 13; + public const int GLFW_GAMEPAD_BUTTON_DPAD_LEFT = 14; + public const int GLFW_GAMEPAD_BUTTON_LAST = GLFW_GAMEPAD_BUTTON_DPAD_LEFT; + public const int GLFW_GAMEPAD_BUTTON_CROSS = GLFW_GAMEPAD_BUTTON_A; + public const int GLFW_GAMEPAD_BUTTON_CIRCLE = GLFW_GAMEPAD_BUTTON_B; + public const int GLFW_GAMEPAD_BUTTON_SQUARE = GLFW_GAMEPAD_BUTTON_X; + public const int GLFW_GAMEPAD_BUTTON_TRIANGLE = GLFW_GAMEPAD_BUTTON_Y; + public const int GLFW_GAMEPAD_AXIS_LEFT_X = 0; + public const int GLFW_GAMEPAD_AXIS_LEFT_Y = 1; + public const int GLFW_GAMEPAD_AXIS_RIGHT_X = 2; + public const int GLFW_GAMEPAD_AXIS_RIGHT_Y = 3; + public const int GLFW_GAMEPAD_AXIS_LEFT_TRIGGER = 4; + public const int GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER = 5; + public const int GLFW_GAMEPAD_AXIS_LAST = GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER; + public const int GLFW_NO_ERROR = 0; + public const int GLFW_NOT_INITIALIZED = 0x00010001; + public const int GLFW_NO_CURRENT_CONTEXT = 0x00010002; + public const int GLFW_INVALID_ENUM = 0x00010003; + public const int GLFW_INVALID_VALUE = 0x00010004; + public const int GLFW_OUT_OF_MEMORY = 0x00010005; + public const int GLFW_API_UNAVAILABLE = 0x00010006; + public const int GLFW_VERSION_UNAVAILABLE = 0x00010007; + public const int GLFW_PLATFORM_ERROR = 0x00010008; + public const int GLFW_FORMAT_UNAVAILABLE = 0x00010009; + public const int GLFW_NO_WINDOW_CONTEXT = 0x0001000A; + public const int GLFW_FOCUSED = 0x00020001; + public const int GLFW_ICONIFIED = 0x00020002; + public const int GLFW_RESIZABLE = 0x00020003; + public const int GLFW_VISIBLE = 0x00020004; + public const int GLFW_DECORATED = 0x00020005; + public const int GLFW_AUTO_ICONIFY = 0x00020006; + public const int GLFW_FLOATING = 0x00020007; + public const int GLFW_MAXIMIZED = 0x00020008; + public const int GLFW_CENTER_CURSOR = 0x00020009; + public const int GLFW_TRANSPARENT_FRAMEBUFFER = 0x0002000A; + public const int GLFW_HOVERED = 0x0002000B; + public const int GLFW_FOCUS_ON_SHOW = 0x0002000C; + public const int GLFW_RED_BITS = 0x00021001; + public const int GLFW_GREEN_BITS = 0x00021002; + public const int GLFW_BLUE_BITS = 0x00021003; + public const int GLFW_ALPHA_BITS = 0x00021004; + public const int GLFW_DEPTH_BITS = 0x00021005; + public const int GLFW_STENCIL_BITS = 0x00021006; + public const int GLFW_ACCUM_RED_BITS = 0x00021007; + public const int GLFW_ACCUM_GREEN_BITS = 0x00021008; + public const int GLFW_ACCUM_BLUE_BITS = 0x00021009; + public const int GLFW_ACCUM_ALPHA_BITS = 0x0002100A; + public const int GLFW_AUX_BUFFERS = 0x0002100B; + public const int GLFW_STEREO = 0x0002100C; + public const int GLFW_SAMPLES = 0x0002100D; + public const int GLFW_SRGB_CAPABLE = 0x0002100E; + public const int GLFW_REFRESH_RATE = 0x0002100F; + public const int GLFW_DOUBLEBUFFER = 0x00021010; + public const int GLFW_CLIENT_API = 0x00022001; + public const int GLFW_CONTEXT_VERSION_MAJOR = 0x00022002; + public const int GLFW_CONTEXT_VERSION_MINOR = 0x00022003; + public const int GLFW_CONTEXT_REVISION = 0x00022004; + public const int GLFW_CONTEXT_ROBUSTNESS = 0x00022005; + public const int GLFW_OPENGL_FORWARD_COMPAT = 0x00022006; + public const int GLFW_OPENGL_DEBUG_CONTEXT = 0x00022007; + public const int GLFW_OPENGL_PROFILE = 0x00022008; + public const int GLFW_CONTEXT_RELEASE_BEHAVIOR = 0x00022009; + public const int GLFW_CONTEXT_NO_ERROR = 0x0002200A; + public const int GLFW_CONTEXT_CREATION_API = 0x0002200B; + public const int GLFW_SCALE_TO_MONITOR = 0x0002200C; + public const int GLFW_COCOA_RETINA_FRAMEBUFFER = 0x00023001; + public const int GLFW_COCOA_FRAME_NAME = 0x00023002; + public const int GLFW_COCOA_GRAPHICS_SWITCHING = 0x00023003; + public const int GLFW_X11_CLASS_NAME = 0x00024001; + public const int GLFW_X11_INSTANCE_NAME = 0x00024002; + public const int GLFW_NO_API = 0; + public const int GLFW_OPENGL_API = 0x00030001; + public const int GLFW_OPENGL_ES_API = 0x00030002; + public const int GLFW_NO_ROBUSTNESS = 0; + public const int GLFW_NO_RESET_NOTIFICATION = 0x00031001; + public const int GLFW_LOSE_CONTEXT_ON_RESET = 0x00031002; + public const int GLFW_OPENGL_ANY_PROFILE = 0; + public const int GLFW_OPENGL_CORE_PROFILE = 0x00032001; + public const int GLFW_OPENGL_COMPAT_PROFILE = 0x00032002; + public const int GLFW_CURSOR = 0x00033001; + public const int GLFW_STICKY_KEYS = 0x00033002; + public const int GLFW_STICKY_MOUSE_BUTTONS = 0x00033003; + public const int GLFW_LOCK_KEY_MODS = 0x00033004; + public const int GLFW_RAW_MOUSE_MOTION = 0x00033005; + public const int GLFW_CURSOR_NORMAL = 0x00034001; + public const int GLFW_CURSOR_HIDDEN = 0x00034002; + public const int GLFW_CURSOR_DISABLED = 0x00034003; + public const int GLFW_ANY_RELEASE_BEHAVIOR = 0; + public const int GLFW_RELEASE_BEHAVIOR_FLUSH = 0x00035001; + public const int GLFW_RELEASE_BEHAVIOR_NONE = 0x00035002; + public const int GLFW_NATIVE_CONTEXT_API = 0x00036001; + public const int GLFW_EGL_CONTEXT_API = 0x00036002; + public const int GLFW_OSMESA_CONTEXT_API = 0x00036003; + public const int GLFW_ARROW_CURSOR = 0x00036001; + public const int GLFW_IBEAM_CURSOR = 0x00036002; + public const int GLFW_CROSSHAIR_CURSOR = 0x00036003; + public const int GLFW_HAND_CURSOR = 0x00036004; + public const int GLFW_HRESIZE_CURSOR = 0x00036005; + public const int GLFW_VRESIZE_CURSOR = 0x00036006; + public const int GLFW_CONNECTED = 0x00040001; + public const int GLFW_DISCONNECTED = 0x00040002; + public const int GLFW_JOYSTICK_HAT_BUTTONS = 0x00050001; + public const int GLFW_COCOA_CHDIR_RESOURCES = 0x00051001; + public const int GLFW_COCOA_MENUBAR = 0x00051002; + public const int GLFW_DONT_CARE = -1; + + #endregion + + #region glad + + + public const int _1PASS_EXT = 0x80A1; + public const int _1PASS_SGIS = 0x80A1; + public const int _2PASS_0_EXT = 0x80A2; + public const int _2PASS_0_SGIS = 0x80A2; + public const int _2PASS_1_EXT = 0x80A3; + public const int _2PASS_1_SGIS = 0x80A3; + public const int _2X_BIT_ATI = 0x00000001; + public const int _422_AVERAGE_EXT = 0x80CE; + public const int _422_EXT = 0x80CC; + public const int _422_REV_AVERAGE_EXT = 0x80CF; + public const int _422_REV_EXT = 0x80CD; + public const int _4PASS_0_EXT = 0x80A4; + public const int _4PASS_0_SGIS = 0x80A4; + public const int _4PASS_1_EXT = 0x80A5; + public const int _4PASS_1_SGIS = 0x80A5; + public const int _4PASS_2_EXT = 0x80A6; + public const int _4PASS_2_SGIS = 0x80A6; + public const int _4PASS_3_EXT = 0x80A7; + public const int _4PASS_3_SGIS = 0x80A7; + public const int _4X_BIT_ATI = 0x00000002; + public const int _8X_BIT_ATI = 0x00000004; + public const int ABGR_EXT = 0x8000; + public const int ACCUM_ADJACENT_PAIRS_NV = 0x90AD; + public const int ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9; + public const int ACTIVE_ATTRIBUTES = 0x8B89; + public const int ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A; + public const int ACTIVE_PROGRAM = 0x8259; + public const int ACTIVE_PROGRAM_EXT = 0x8B8D; + public const int ACTIVE_RESOURCES = 0x92F5; + public const int ACTIVE_STENCIL_FACE_EXT = 0x8911; + public const int ACTIVE_SUBROUTINES = 0x8DE5; + public const int ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48; + public const int ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6; + public const int ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47; + public const int ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49; + public const int ACTIVE_TEXTURE = 0x84E0; + public const int ACTIVE_TEXTURE_ARB = 0x84E0; + public const int ACTIVE_UNIFORMS = 0x8B86; + public const int ACTIVE_UNIFORM_BLOCKS = 0x8A36; + public const int ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35; + public const int ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87; + public const int ACTIVE_VARIABLES = 0x9305; + public const int ACTIVE_VARYINGS_NV = 0x8C81; + public const int ACTIVE_VARYING_MAX_LENGTH_NV = 0x8C82; + public const int ACTIVE_VERTEX_UNITS_ARB = 0x86A5; + public const int ADD_ATI = 0x8963; + public const int ADD_SIGNED_ARB = 0x8574; + public const int ADD_SIGNED_EXT = 0x8574; + public const int ADJACENT_PAIRS_NV = 0x90AE; + public const int AFFINE_2D_NV = 0x9092; + public const int AFFINE_3D_NV = 0x9094; + public const int ALIASED_LINE_WIDTH_RANGE = 0x846E; + public const int ALLOW_DRAW_FRG_HINT_PGI = 0x1A210; + public const int ALLOW_DRAW_MEM_HINT_PGI = 0x1A211; + public const int ALLOW_DRAW_OBJ_HINT_PGI = 0x1A20E; + public const int ALLOW_DRAW_WIN_HINT_PGI = 0x1A20F; + public const uint ALL_BARRIER_BITS = 0xFFFFFFFF; + public const uint ALL_BARRIER_BITS_EXT = 0xFFFFFFFF; + public const int ALL_COMPLETED_NV = 0x84F2; + public const uint ALL_PIXELS_AMD = 0xFFFFFFFF; + public const uint ALL_SHADER_BITS = 0xFFFFFFFF; + public const int ALL_STATIC_DATA_IBM = 103060; + public const int ALPHA = 0x1906; + public const int ALPHA12_EXT = 0x803D; + public const int ALPHA16F_ARB = 0x881C; + public const int ALPHA16F_EXT = 0x881C; + public const int ALPHA16I_EXT = 0x8D8A; + public const int ALPHA16UI_EXT = 0x8D78; + public const int ALPHA16_EXT = 0x803E; + public const int ALPHA16_SNORM = 0x9018; + public const int ALPHA32F_ARB = 0x8816; + public const int ALPHA32F_EXT = 0x8816; + public const int ALPHA32I_EXT = 0x8D84; + public const int ALPHA32UI_EXT = 0x8D72; + public const int ALPHA4_EXT = 0x803B; + public const int ALPHA8I_EXT = 0x8D90; + public const int ALPHA8UI_EXT = 0x8D7E; + public const int ALPHA8_EXT = 0x803C; + public const int ALPHA8_SNORM = 0x9014; + public const int ALPHA_FLOAT16_APPLE = 0x881C; + public const int ALPHA_FLOAT16_ATI = 0x881C; + public const int ALPHA_FLOAT32_APPLE = 0x8816; + public const int ALPHA_FLOAT32_ATI = 0x8816; + public const int ALPHA_INTEGER_EXT = 0x8D97; + public const int ALPHA_MAX_CLAMP_INGR = 0x8567; + public const int ALPHA_MAX_SGIX = 0x8321; + public const int ALPHA_MIN_CLAMP_INGR = 0x8563; + public const int ALPHA_MIN_SGIX = 0x8320; + public const int ALPHA_REF_COMMAND_NV = 0x000F; + public const int ALPHA_SNORM = 0x9010; + public const int ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV = 0x934D; + public const int ALPHA_TO_COVERAGE_DITHER_DISABLE_NV = 0x934F; + public const int ALPHA_TO_COVERAGE_DITHER_ENABLE_NV = 0x934E; + public const int ALPHA_TO_COVERAGE_DITHER_MODE_NV = 0x92BF; + public const int ALREADY_SIGNALED = 0x911A; + public const int ALWAYS = 0x0207; + public const int ALWAYS_FAST_HINT_PGI = 0x1A20C; + public const int ALWAYS_SOFT_HINT_PGI = 0x1A20D; + public const int AND = 0x1501; + public const int AND_INVERTED = 0x1504; + public const int AND_REVERSE = 0x1502; + public const int ANY_SAMPLES_PASSED = 0x8C2F; + public const int ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A; + public const int ARC_TO_NV = 0xFE; + public const int ARRAY_BUFFER = 0x8892; + public const int ARRAY_BUFFER_ARB = 0x8892; + public const int ARRAY_BUFFER_BINDING = 0x8894; + public const int ARRAY_BUFFER_BINDING_ARB = 0x8894; + public const int ARRAY_ELEMENT_LOCK_COUNT_EXT = 0x81A9; + public const int ARRAY_ELEMENT_LOCK_FIRST_EXT = 0x81A8; + public const int ARRAY_OBJECT_BUFFER_ATI = 0x8766; + public const int ARRAY_OBJECT_OFFSET_ATI = 0x8767; + public const int ARRAY_SIZE = 0x92FB; + public const int ARRAY_STRIDE = 0x92FE; + public const int ASYNC_DRAW_PIXELS_SGIX = 0x835D; + public const int ASYNC_HISTOGRAM_SGIX = 0x832C; + public const int ASYNC_MARKER_SGIX = 0x8329; + public const int ASYNC_READ_PIXELS_SGIX = 0x835E; + public const int ASYNC_TEX_IMAGE_SGIX = 0x835C; + public const int ATOMIC_COUNTER_BARRIER_BIT = 0x00001000; + public const int ATOMIC_COUNTER_BARRIER_BIT_EXT = 0x00001000; + public const int ATOMIC_COUNTER_BUFFER = 0x92C0; + public const int ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5; + public const int ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6; + public const int ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1; + public const int ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4; + public const int ATOMIC_COUNTER_BUFFER_INDEX = 0x9301; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 0x90ED; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV = 0x959E; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV = 0x959F; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9; + public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7; + public const int ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3; + public const int ATOMIC_COUNTER_BUFFER_START = 0x92C2; + public const int ATTACHED_MEMORY_OBJECT_NV = 0x95A4; + public const int ATTACHED_MEMORY_OFFSET_NV = 0x95A5; + public const int ATTACHED_SHADERS = 0x8B85; + public const int ATTENUATION_EXT = 0x834D; + public const int ATTRIBUTE_ADDRESS_COMMAND_NV = 0x0009; + public const int ATTRIB_ARRAY_POINTER_NV = 0x8645; + public const int ATTRIB_ARRAY_SIZE_NV = 0x8623; + public const int ATTRIB_ARRAY_STRIDE_NV = 0x8624; + public const int ATTRIB_ARRAY_TYPE_NV = 0x8625; + public const int AUTO_GENERATE_MIPMAP = 0x8295; + public const int AUX_DEPTH_STENCIL_APPLE = 0x8A14; + public const int AVERAGE_EXT = 0x8335; + public const int AVERAGE_HP = 0x8160; + public const int BACK = 0x0405; + public const int BACK_LEFT = 0x0402; + public const int BACK_NORMALS_HINT_PGI = 0x1A223; + public const int BACK_PRIMARY_COLOR_NV = 0x8C77; + public const int BACK_RIGHT = 0x0403; + public const int BACK_SECONDARY_COLOR_NV = 0x8C78; + public const int BEVEL_NV = 0x90A6; + public const int BGR = 0x80E0; + public const int BGRA = 0x80E1; + public const int BGRA8_EXT = 0x93A1; + public const int BGRA_EXT = 0x80E1; + public const int BGRA_INTEGER = 0x8D9B; + public const int BGRA_INTEGER_EXT = 0x8D9B; + public const int BGR_EXT = 0x80E0; + public const int BGR_INTEGER = 0x8D9A; + public const int BGR_INTEGER_EXT = 0x8D9A; + public const int BIAS_BIT_ATI = 0x00000008; + public const int BIAS_BY_NEGATIVE_ONE_HALF_NV = 0x8541; + public const int BINORMAL_ARRAY_EXT = 0x843A; + public const int BINORMAL_ARRAY_POINTER_EXT = 0x8443; + public const int BINORMAL_ARRAY_STRIDE_EXT = 0x8441; + public const int BINORMAL_ARRAY_TYPE_EXT = 0x8440; + public const int BLACKHOLE_RENDER_INTEL = 0x83FC; + public const int BLEND = 0x0BE2; + public const int BLEND_ADVANCED_COHERENT_KHR = 0x9285; + public const int BLEND_ADVANCED_COHERENT_NV = 0x9285; + public const int BLEND_COLOR = 0x8005; + public const int BLEND_COLOR_COMMAND_NV = 0x000B; + public const int BLEND_COLOR_EXT = 0x8005; + public const int BLEND_DST = 0x0BE0; + public const int BLEND_DST_ALPHA = 0x80CA; + public const int BLEND_DST_ALPHA_EXT = 0x80CA; + public const int BLEND_DST_RGB = 0x80C8; + public const int BLEND_DST_RGB_EXT = 0x80C8; + public const int BLEND_EQUATION = 0x8009; + public const int BLEND_EQUATION_ALPHA = 0x883D; + public const int BLEND_EQUATION_ALPHA_EXT = 0x883D; + public const int BLEND_EQUATION_EXT = 0x8009; + public const int BLEND_EQUATION_RGB = 0x8009; + public const int BLEND_EQUATION_RGB_EXT = 0x8009; + public const int BLEND_OVERLAP_NV = 0x9281; + public const int BLEND_PREMULTIPLIED_SRC_NV = 0x9280; + public const int BLEND_SRC = 0x0BE1; + public const int BLEND_SRC_ALPHA = 0x80CB; + public const int BLEND_SRC_ALPHA_EXT = 0x80CB; + public const int BLEND_SRC_RGB = 0x80C9; + public const int BLEND_SRC_RGB_EXT = 0x80C9; + public const int BLOCK_INDEX = 0x92FD; + public const int BLUE = 0x1905; + public const int BLUE_BIT_ATI = 0x00000004; + public const int BLUE_INTEGER = 0x8D96; + public const int BLUE_INTEGER_EXT = 0x8D96; + public const int BLUE_MAX_CLAMP_INGR = 0x8566; + public const int BLUE_MIN_CLAMP_INGR = 0x8562; + public const int BLUE_NV = 0x1905; + public const int BOLD_BIT_NV = 0x01; + public const int BOOL = 0x8B56; + public const int BOOL_ARB = 0x8B56; + public const int BOOL_VEC2 = 0x8B57; + public const int BOOL_VEC2_ARB = 0x8B57; + public const int BOOL_VEC3 = 0x8B58; + public const int BOOL_VEC3_ARB = 0x8B58; + public const int BOOL_VEC4 = 0x8B59; + public const int BOOL_VEC4_ARB = 0x8B59; + public const int BOUNDING_BOX_NV = 0x908D; + public const int BOUNDING_BOX_OF_BOUNDING_BOXES_NV = 0x909C; + public const int BUFFER = 0x82E0; + public const int BUFFER_ACCESS = 0x88BB; + public const int BUFFER_ACCESS_ARB = 0x88BB; + public const int BUFFER_ACCESS_FLAGS = 0x911F; + public const int BUFFER_BINDING = 0x9302; + public const int BUFFER_DATA_SIZE = 0x9303; + public const int BUFFER_FLUSHING_UNMAP_APPLE = 0x8A13; + public const int BUFFER_GPU_ADDRESS_NV = 0x8F1D; + public const int BUFFER_IMMUTABLE_STORAGE = 0x821F; + public const int BUFFER_MAPPED = 0x88BC; + public const int BUFFER_MAPPED_ARB = 0x88BC; + public const int BUFFER_MAP_LENGTH = 0x9120; + public const int BUFFER_MAP_OFFSET = 0x9121; + public const int BUFFER_MAP_POINTER = 0x88BD; + public const int BUFFER_MAP_POINTER_ARB = 0x88BD; + public const int BUFFER_OBJECT_APPLE = 0x85B3; + public const int BUFFER_OBJECT_EXT = 0x9151; + public const int BUFFER_SERIALIZED_MODIFY_APPLE = 0x8A12; + public const int BUFFER_SIZE = 0x8764; + public const int BUFFER_SIZE_ARB = 0x8764; + public const int BUFFER_STORAGE_FLAGS = 0x8220; + public const int BUFFER_UPDATE_BARRIER_BIT = 0x00000200; + public const int BUFFER_UPDATE_BARRIER_BIT_EXT = 0x00000200; + public const int BUFFER_USAGE = 0x8765; + public const int BUFFER_USAGE_ARB = 0x8765; + public const int BUFFER_VARIABLE = 0x92E5; + public const int BUMP_ENVMAP_ATI = 0x877B; + public const int BUMP_NUM_TEX_UNITS_ATI = 0x8777; + public const int BUMP_ROT_MATRIX_ATI = 0x8775; + public const int BUMP_ROT_MATRIX_SIZE_ATI = 0x8776; + public const int BUMP_TARGET_ATI = 0x877C; + public const int BUMP_TEX_UNITS_ATI = 0x8778; + public const int BYTE = 0x1400; + public const int CALLIGRAPHIC_FRAGMENT_SGIX = 0x8183; + public const int CAVEAT_SUPPORT = 0x82B8; + public const int CCW = 0x0901; + public const int CIRCULAR_CCW_ARC_TO_NV = 0xF8; + public const int CIRCULAR_CW_ARC_TO_NV = 0xFA; + public const int CIRCULAR_TANGENT_ARC_TO_NV = 0xFC; + public const int CLAMP_FRAGMENT_COLOR_ARB = 0x891B; + public const int CLAMP_READ_COLOR = 0x891C; + public const int CLAMP_READ_COLOR_ARB = 0x891C; + public const int CLAMP_TO_BORDER = 0x812D; + public const int CLAMP_TO_BORDER_ARB = 0x812D; + public const int CLAMP_TO_BORDER_SGIS = 0x812D; + public const int CLAMP_TO_EDGE = 0x812F; + public const int CLAMP_TO_EDGE_SGIS = 0x812F; + public const int CLAMP_VERTEX_COLOR_ARB = 0x891A; + public const int CLEAR = 0x1500; + public const int CLEAR_BUFFER = 0x82B4; + public const int CLEAR_TEXTURE = 0x9365; + public const int CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1; + public const int CLIENT_MAPPED_BUFFER_BARRIER_BIT = 0x00004000; + public const int CLIENT_STORAGE_BIT = 0x0200; + public const int CLIPPING_INPUT_PRIMITIVES = 0x82F6; + public const int CLIPPING_INPUT_PRIMITIVES_ARB = 0x82F6; + public const int CLIPPING_OUTPUT_PRIMITIVES = 0x82F7; + public const int CLIPPING_OUTPUT_PRIMITIVES_ARB = 0x82F7; + public const int CLIP_DEPTH_MODE = 0x935D; + public const int CLIP_DISTANCE0 = 0x3000; + public const int CLIP_DISTANCE1 = 0x3001; + public const int CLIP_DISTANCE2 = 0x3002; + public const int CLIP_DISTANCE3 = 0x3003; + public const int CLIP_DISTANCE4 = 0x3004; + public const int CLIP_DISTANCE5 = 0x3005; + public const int CLIP_DISTANCE6 = 0x3006; + public const int CLIP_DISTANCE7 = 0x3007; + public const int CLIP_DISTANCE_NV = 0x8C7A; + public const int CLIP_FAR_HINT_PGI = 0x1A221; + public const int CLIP_NEAR_HINT_PGI = 0x1A220; + public const int CLIP_ORIGIN = 0x935C; + public const int CLIP_VOLUME_CLIPPING_HINT_EXT = 0x80F0; + public const int CLOSE_PATH_NV = 0x00; + public const int CMYKA_EXT = 0x800D; + public const int CMYK_EXT = 0x800C; + public const int CND0_ATI = 0x896B; + public const int CND_ATI = 0x896A; + public const int COLOR = 0x1800; + public const int COLOR3_BIT_PGI = 0x00010000; + public const int COLOR4_BIT_PGI = 0x00020000; + public const int COLORBURN_KHR = 0x929A; + public const int COLORBURN_NV = 0x929A; + public const int COLORDODGE_KHR = 0x9299; + public const int COLORDODGE_NV = 0x9299; + public const int COLOR_ALPHA_PAIRING_ATI = 0x8975; + public const int COLOR_ARRAY_ADDRESS_NV = 0x8F23; + public const int COLOR_ARRAY_BUFFER_BINDING_ARB = 0x8898; + public const int COLOR_ARRAY_COUNT_EXT = 0x8084; + public const int COLOR_ARRAY_EXT = 0x8076; + public const int COLOR_ARRAY_LENGTH_NV = 0x8F2D; + public const int COLOR_ARRAY_LIST_IBM = 103072; + public const int COLOR_ARRAY_LIST_STRIDE_IBM = 103082; + public const int COLOR_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F7; + public const int COLOR_ARRAY_POINTER_EXT = 0x8090; + public const int COLOR_ARRAY_SIZE_EXT = 0x8081; + public const int COLOR_ARRAY_STRIDE_EXT = 0x8083; + public const int COLOR_ARRAY_TYPE_EXT = 0x8082; + public const int COLOR_ATTACHMENT0 = 0x8CE0; + public const int COLOR_ATTACHMENT0_EXT = 0x8CE0; + public const int COLOR_ATTACHMENT1 = 0x8CE1; + public const int COLOR_ATTACHMENT10 = 0x8CEA; + public const int COLOR_ATTACHMENT10_EXT = 0x8CEA; + public const int COLOR_ATTACHMENT11 = 0x8CEB; + public const int COLOR_ATTACHMENT11_EXT = 0x8CEB; + public const int COLOR_ATTACHMENT12 = 0x8CEC; + public const int COLOR_ATTACHMENT12_EXT = 0x8CEC; + public const int COLOR_ATTACHMENT13 = 0x8CED; + public const int COLOR_ATTACHMENT13_EXT = 0x8CED; + public const int COLOR_ATTACHMENT14 = 0x8CEE; + public const int COLOR_ATTACHMENT14_EXT = 0x8CEE; + public const int COLOR_ATTACHMENT15 = 0x8CEF; + public const int COLOR_ATTACHMENT15_EXT = 0x8CEF; + public const int COLOR_ATTACHMENT16 = 0x8CF0; + public const int COLOR_ATTACHMENT17 = 0x8CF1; + public const int COLOR_ATTACHMENT18 = 0x8CF2; + public const int COLOR_ATTACHMENT19 = 0x8CF3; + public const int COLOR_ATTACHMENT1_EXT = 0x8CE1; + public const int COLOR_ATTACHMENT2 = 0x8CE2; + public const int COLOR_ATTACHMENT20 = 0x8CF4; + public const int COLOR_ATTACHMENT21 = 0x8CF5; + public const int COLOR_ATTACHMENT22 = 0x8CF6; + public const int COLOR_ATTACHMENT23 = 0x8CF7; + public const int COLOR_ATTACHMENT24 = 0x8CF8; + public const int COLOR_ATTACHMENT25 = 0x8CF9; + public const int COLOR_ATTACHMENT26 = 0x8CFA; + public const int COLOR_ATTACHMENT27 = 0x8CFB; + public const int COLOR_ATTACHMENT28 = 0x8CFC; + public const int COLOR_ATTACHMENT29 = 0x8CFD; + public const int COLOR_ATTACHMENT2_EXT = 0x8CE2; + public const int COLOR_ATTACHMENT3 = 0x8CE3; + public const int COLOR_ATTACHMENT30 = 0x8CFE; + public const int COLOR_ATTACHMENT31 = 0x8CFF; + public const int COLOR_ATTACHMENT3_EXT = 0x8CE3; + public const int COLOR_ATTACHMENT4 = 0x8CE4; + public const int COLOR_ATTACHMENT4_EXT = 0x8CE4; + public const int COLOR_ATTACHMENT5 = 0x8CE5; + public const int COLOR_ATTACHMENT5_EXT = 0x8CE5; + public const int COLOR_ATTACHMENT6 = 0x8CE6; + public const int COLOR_ATTACHMENT6_EXT = 0x8CE6; + public const int COLOR_ATTACHMENT7 = 0x8CE7; + public const int COLOR_ATTACHMENT7_EXT = 0x8CE7; + public const int COLOR_ATTACHMENT8 = 0x8CE8; + public const int COLOR_ATTACHMENT8_EXT = 0x8CE8; + public const int COLOR_ATTACHMENT9 = 0x8CE9; + public const int COLOR_ATTACHMENT9_EXT = 0x8CE9; + public const int COLOR_BUFFER_BIT = 0x00004000; + public const int COLOR_CLEAR_UNCLAMPED_VALUE_ATI = 0x8835; + public const int COLOR_CLEAR_VALUE = 0x0C22; + public const int COLOR_COMPONENTS = 0x8283; + public const int COLOR_ENCODING = 0x8296; + public const int COLOR_FLOAT_APPLE = 0x8A0F; + public const int COLOR_INDEX12_EXT = 0x80E6; + public const int COLOR_INDEX16_EXT = 0x80E7; + public const int COLOR_INDEX1_EXT = 0x80E2; + public const int COLOR_INDEX2_EXT = 0x80E3; + public const int COLOR_INDEX4_EXT = 0x80E4; + public const int COLOR_INDEX8_EXT = 0x80E5; + public const int COLOR_LOGIC_OP = 0x0BF2; + public const int COLOR_MATRIX_SGI = 0x80B1; + public const int COLOR_MATRIX_STACK_DEPTH_SGI = 0x80B2; + public const int COLOR_RENDERABLE = 0x8286; + public const int COLOR_SAMPLES_NV = 0x8E20; + public const int COLOR_SUM_ARB = 0x8458; + public const int COLOR_SUM_CLAMP_NV = 0x854F; + public const int COLOR_SUM_EXT = 0x8458; + public const int COLOR_TABLE_ALPHA_SIZE_SGI = 0x80DD; + public const int COLOR_TABLE_BIAS_SGI = 0x80D7; + public const int COLOR_TABLE_BLUE_SIZE_SGI = 0x80DC; + public const int COLOR_TABLE_FORMAT_SGI = 0x80D8; + public const int COLOR_TABLE_GREEN_SIZE_SGI = 0x80DB; + public const int COLOR_TABLE_INTENSITY_SIZE_SGI = 0x80DF; + public const int COLOR_TABLE_LUMINANCE_SIZE_SGI = 0x80DE; + public const int COLOR_TABLE_RED_SIZE_SGI = 0x80DA; + public const int COLOR_TABLE_SCALE_SGI = 0x80D6; + public const int COLOR_TABLE_SGI = 0x80D0; + public const int COLOR_TABLE_WIDTH_SGI = 0x80D9; + public const int COLOR_WRITEMASK = 0x0C23; + public const int COMBINE4_NV = 0x8503; + public const int COMBINER0_NV = 0x8550; + public const int COMBINER1_NV = 0x8551; + public const int COMBINER2_NV = 0x8552; + public const int COMBINER3_NV = 0x8553; + public const int COMBINER4_NV = 0x8554; + public const int COMBINER5_NV = 0x8555; + public const int COMBINER6_NV = 0x8556; + public const int COMBINER7_NV = 0x8557; + public const int COMBINER_AB_DOT_PRODUCT_NV = 0x8545; + public const int COMBINER_AB_OUTPUT_NV = 0x854A; + public const int COMBINER_BIAS_NV = 0x8549; + public const int COMBINER_CD_DOT_PRODUCT_NV = 0x8546; + public const int COMBINER_CD_OUTPUT_NV = 0x854B; + public const int COMBINER_COMPONENT_USAGE_NV = 0x8544; + public const int COMBINER_INPUT_NV = 0x8542; + public const int COMBINER_MAPPING_NV = 0x8543; + public const int COMBINER_MUX_SUM_NV = 0x8547; + public const int COMBINER_SCALE_NV = 0x8548; + public const int COMBINER_SUM_OUTPUT_NV = 0x854C; + public const int COMBINE_ALPHA_ARB = 0x8572; + public const int COMBINE_ALPHA_EXT = 0x8572; + public const int COMBINE_ARB = 0x8570; + public const int COMBINE_EXT = 0x8570; + public const int COMBINE_RGB_ARB = 0x8571; + public const int COMBINE_RGB_EXT = 0x8571; + public const int COMMAND_BARRIER_BIT = 0x00000040; + public const int COMMAND_BARRIER_BIT_EXT = 0x00000040; + public const int COMPARE_REF_DEPTH_TO_TEXTURE_EXT = 0x884E; + public const int COMPARE_REF_TO_TEXTURE = 0x884E; + public const int COMPARE_R_TO_TEXTURE_ARB = 0x884E; + public const int COMPATIBLE_SUBROUTINES = 0x8E4B; + public const int COMPILE_STATUS = 0x8B81; + public const int COMPLETION_STATUS_ARB = 0x91B1; + public const int COMPLETION_STATUS_KHR = 0x91B1; + public const int COMPRESSED_ALPHA_ARB = 0x84E9; + public const int COMPRESSED_INTENSITY_ARB = 0x84EC; + public const int COMPRESSED_LUMINANCE_ALPHA_ARB = 0x84EB; + public const int COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C72; + public const int COMPRESSED_LUMINANCE_ARB = 0x84EA; + public const int COMPRESSED_LUMINANCE_LATC1_EXT = 0x8C70; + public const int COMPRESSED_R11_EAC = 0x9270; + public const int COMPRESSED_RED = 0x8225; + public const int COMPRESSED_RED_GREEN_RGTC2_EXT = 0x8DBD; + public const int COMPRESSED_RED_RGTC1 = 0x8DBB; + public const int COMPRESSED_RED_RGTC1_EXT = 0x8DBB; + public const int COMPRESSED_RG = 0x8226; + public const int COMPRESSED_RG11_EAC = 0x9272; + public const int COMPRESSED_RGB = 0x84ED; + public const int COMPRESSED_RGB8_ETC2 = 0x9274; + public const int COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276; + public const int COMPRESSED_RGBA = 0x84EE; + public const int COMPRESSED_RGBA8_ETC2_EAC = 0x9278; + public const int COMPRESSED_RGBA_ARB = 0x84EE; + public const int COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB; + public const int COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8; + public const int COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9; + public const int COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA; + public const int COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC; + public const int COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD; + public const int COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0; + public const int COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1; + public const int COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2; + public const int COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3; + public const int COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4; + public const int COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5; + public const int COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6; + public const int COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7; + public const int COMPRESSED_RGBA_BPTC_UNORM = 0x8E8C; + public const int COMPRESSED_RGBA_BPTC_UNORM_ARB = 0x8E8C; + public const int COMPRESSED_RGBA_FXT1_3DFX = 0x86B1; + public const int COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1; + public const int COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2; + public const int COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3; + public const int COMPRESSED_RGB_ARB = 0x84ED; + public const int COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E; + public const int COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB = 0x8E8E; + public const int COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F; + public const int COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB = 0x8E8F; + public const int COMPRESSED_RGB_FXT1_3DFX = 0x86B0; + public const int COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0; + public const int COMPRESSED_RG_RGTC2 = 0x8DBD; + public const int COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C73; + public const int COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT = 0x8C71; + public const int COMPRESSED_SIGNED_R11_EAC = 0x9271; + public const int COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 0x8DBE; + public const int COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC; + public const int COMPRESSED_SIGNED_RED_RGTC1_EXT = 0x8DBC; + public const int COMPRESSED_SIGNED_RG11_EAC = 0x9273; + public const int COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE; + public const int COMPRESSED_SLUMINANCE_ALPHA_EXT = 0x8C4B; + public const int COMPRESSED_SLUMINANCE_EXT = 0x8C4A; + public const int COMPRESSED_SRGB = 0x8C48; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6; + public const int COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7; + public const int COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279; + public const int COMPRESSED_SRGB8_ETC2 = 0x9275; + public const int COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277; + public const int COMPRESSED_SRGB_ALPHA = 0x8C49; + public const int COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D; + public const int COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB = 0x8E8D; + public const int COMPRESSED_SRGB_ALPHA_EXT = 0x8C49; + public const int COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D; + public const int COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E; + public const int COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F; + public const int COMPRESSED_SRGB_EXT = 0x8C48; + public const int COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C; + public const int COMPRESSED_TEXTURE_FORMATS = 0x86A3; + public const int COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3; + public const int COMPUTE_PROGRAM_NV = 0x90FB; + public const int COMPUTE_PROGRAM_PARAMETER_BUFFER_NV = 0x90FC; + public const int COMPUTE_SHADER = 0x91B9; + public const int COMPUTE_SHADER_BIT = 0x00000020; + public const int COMPUTE_SHADER_INVOCATIONS = 0x82F5; + public const int COMPUTE_SHADER_INVOCATIONS_ARB = 0x82F5; + public const int COMPUTE_SUBROUTINE = 0x92ED; + public const int COMPUTE_SUBROUTINE_UNIFORM = 0x92F3; + public const int COMPUTE_TEXTURE = 0x82A0; + public const int COMPUTE_WORK_GROUP_SIZE = 0x8267; + public const int COMP_BIT_ATI = 0x00000002; + public const int CONDITION_SATISFIED = 0x911C; + public const int CONFORMANT_NV = 0x9374; + public const int CONIC_CURVE_TO_NV = 0x1A; + public const int CONJOINT_NV = 0x9284; + public const int CONSERVATIVE_RASTERIZATION_INTEL = 0x83FE; + public const int CONSERVATIVE_RASTERIZATION_NV = 0x9346; + public const int CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV = 0x937B; + public const int CONSERVATIVE_RASTER_DILATE_NV = 0x9379; + public const int CONSERVATIVE_RASTER_DILATE_RANGE_NV = 0x937A; + public const int CONSERVATIVE_RASTER_MODE_NV = 0x954D; + public const int CONSERVATIVE_RASTER_MODE_POST_SNAP_NV = 0x954E; + public const int CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV = 0x9550; + public const int CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV = 0x954F; + public const int CONSERVE_MEMORY_HINT_PGI = 0x1A1FD; + public const int CONSTANT_ALPHA = 0x8003; + public const int CONSTANT_ALPHA_EXT = 0x8003; + public const int CONSTANT_ARB = 0x8576; + public const int CONSTANT_BORDER_HP = 0x8151; + public const int CONSTANT_COLOR = 0x8001; + public const int CONSTANT_COLOR0_NV = 0x852A; + public const int CONSTANT_COLOR1_NV = 0x852B; + public const int CONSTANT_COLOR_EXT = 0x8001; + public const int CONSTANT_EXT = 0x8576; + public const int CONST_EYE_NV = 0x86E5; + public const int CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002; + public const int CONTEXT_CORE_PROFILE_BIT = 0x00000001; + public const int CONTEXT_FLAGS = 0x821E; + public const int CONTEXT_FLAG_DEBUG_BIT = 0x00000002; + public const int CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x00000001; + public const int CONTEXT_FLAG_NO_ERROR_BIT = 0x00000008; + public const int CONTEXT_FLAG_NO_ERROR_BIT_KHR = 0x00000008; + public const int CONTEXT_FLAG_ROBUST_ACCESS_BIT = 0x00000004; + public const int CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB = 0x00000004; + public const int CONTEXT_LOST = 0x0507; + public const int CONTEXT_PROFILE_MASK = 0x9126; + public const int CONTEXT_RELEASE_BEHAVIOR = 0x82FB; + public const int CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82FC; + public const int CONTEXT_ROBUST_ACCESS = 0x90F3; + public const int CONTINUOUS_AMD = 0x9007; + public const int CONTRAST_NV = 0x92A1; + public const int CONVEX_HULL_NV = 0x908B; + public const int CONVOLUTION_1D_EXT = 0x8010; + public const int CONVOLUTION_2D_EXT = 0x8011; + public const int CONVOLUTION_BORDER_COLOR_HP = 0x8154; + public const int CONVOLUTION_BORDER_MODE_EXT = 0x8013; + public const int CONVOLUTION_FILTER_BIAS_EXT = 0x8015; + public const int CONVOLUTION_FILTER_SCALE_EXT = 0x8014; + public const int CONVOLUTION_FORMAT_EXT = 0x8017; + public const int CONVOLUTION_HEIGHT_EXT = 0x8019; + public const int CONVOLUTION_HINT_SGIX = 0x8316; + public const int CONVOLUTION_WIDTH_EXT = 0x8018; + public const int CON_0_ATI = 0x8941; + public const int CON_10_ATI = 0x894B; + public const int CON_11_ATI = 0x894C; + public const int CON_12_ATI = 0x894D; + public const int CON_13_ATI = 0x894E; + public const int CON_14_ATI = 0x894F; + public const int CON_15_ATI = 0x8950; + public const int CON_16_ATI = 0x8951; + public const int CON_17_ATI = 0x8952; + public const int CON_18_ATI = 0x8953; + public const int CON_19_ATI = 0x8954; + public const int CON_1_ATI = 0x8942; + public const int CON_20_ATI = 0x8955; + public const int CON_21_ATI = 0x8956; + public const int CON_22_ATI = 0x8957; + public const int CON_23_ATI = 0x8958; + public const int CON_24_ATI = 0x8959; + public const int CON_25_ATI = 0x895A; + public const int CON_26_ATI = 0x895B; + public const int CON_27_ATI = 0x895C; + public const int CON_28_ATI = 0x895D; + public const int CON_29_ATI = 0x895E; + public const int CON_2_ATI = 0x8943; + public const int CON_30_ATI = 0x895F; + public const int CON_31_ATI = 0x8960; + public const int CON_3_ATI = 0x8944; + public const int CON_4_ATI = 0x8945; + public const int CON_5_ATI = 0x8946; + public const int CON_6_ATI = 0x8947; + public const int CON_7_ATI = 0x8948; + public const int CON_8_ATI = 0x8949; + public const int CON_9_ATI = 0x894A; + public const int COORD_REPLACE_ARB = 0x8862; + public const int COORD_REPLACE_NV = 0x8862; + public const int COPY = 0x1503; + public const int COPY_INVERTED = 0x150C; + public const int COPY_READ_BUFFER = 0x8F36; + public const int COPY_READ_BUFFER_BINDING = 0x8F36; + public const int COPY_WRITE_BUFFER = 0x8F37; + public const int COPY_WRITE_BUFFER_BINDING = 0x8F37; + public const int COUNTER_RANGE_AMD = 0x8BC1; + public const int COUNTER_TYPE_AMD = 0x8BC0; + public const int COUNT_DOWN_NV = 0x9089; + public const int COUNT_UP_NV = 0x9088; + public const int COVERAGE_MODULATION_NV = 0x9332; + public const int COVERAGE_MODULATION_TABLE_NV = 0x9331; + public const int COVERAGE_MODULATION_TABLE_SIZE_NV = 0x9333; + public const int CUBIC_CURVE_TO_NV = 0x0C; + public const int CUBIC_EXT = 0x8334; + public const int CUBIC_HP = 0x815F; + public const int CULL_FACE = 0x0B44; + public const int CULL_FACE_MODE = 0x0B45; + public const int CULL_FRAGMENT_NV = 0x86E7; + public const int CULL_MODES_NV = 0x86E0; + public const int CULL_VERTEX_EXT = 0x81AA; + public const int CULL_VERTEX_EYE_POSITION_EXT = 0x81AB; + public const int CULL_VERTEX_IBM = 103050; + public const int CULL_VERTEX_OBJECT_POSITION_EXT = 0x81AC; + public const int CURRENT_ATTRIB_NV = 0x8626; + public const int CURRENT_BINORMAL_EXT = 0x843C; + public const int CURRENT_FOG_COORDINATE_EXT = 0x8453; + public const int CURRENT_MATRIX_ARB = 0x8641; + public const int CURRENT_MATRIX_INDEX_ARB = 0x8845; + public const int CURRENT_MATRIX_NV = 0x8641; + public const int CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640; + public const int CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640; + public const int CURRENT_OCCLUSION_QUERY_ID_NV = 0x8865; + public const int CURRENT_PALETTE_MATRIX_ARB = 0x8843; + public const int CURRENT_PROGRAM = 0x8B8D; + public const int CURRENT_QUERY = 0x8865; + public const int CURRENT_QUERY_ARB = 0x8865; + public const int CURRENT_RASTER_NORMAL_SGIX = 0x8406; + public const int CURRENT_SECONDARY_COLOR_EXT = 0x8459; + public const int CURRENT_TANGENT_EXT = 0x843B; + public const int CURRENT_TIME_NV = 0x8E28; + public const int CURRENT_VERTEX_ATTRIB = 0x8626; + public const int CURRENT_VERTEX_ATTRIB_ARB = 0x8626; + public const int CURRENT_VERTEX_EXT = 0x87E2; + public const int CURRENT_VERTEX_WEIGHT_EXT = 0x850B; + public const int CURRENT_WEIGHT_ARB = 0x86A8; + public const int CW = 0x0900; + public const int D3D12_FENCE_VALUE_EXT = 0x9595; + public const int DARKEN_KHR = 0x9297; + public const int DARKEN_NV = 0x9297; + public const int DATA_BUFFER_AMD = 0x9151; + public const int DEBUG_CALLBACK_FUNCTION = 0x8244; + public const int DEBUG_CALLBACK_FUNCTION_ARB = 0x8244; + public const int DEBUG_CALLBACK_USER_PARAM = 0x8245; + public const int DEBUG_CALLBACK_USER_PARAM_ARB = 0x8245; + public const int DEBUG_CATEGORY_API_ERROR_AMD = 0x9149; + public const int DEBUG_CATEGORY_APPLICATION_AMD = 0x914F; + public const int DEBUG_CATEGORY_DEPRECATION_AMD = 0x914B; + public const int DEBUG_CATEGORY_OTHER_AMD = 0x9150; + public const int DEBUG_CATEGORY_PERFORMANCE_AMD = 0x914D; + public const int DEBUG_CATEGORY_SHADER_COMPILER_AMD = 0x914E; + public const int DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD = 0x914C; + public const int DEBUG_CATEGORY_WINDOW_SYSTEM_AMD = 0x914A; + public const int DEBUG_GROUP_STACK_DEPTH = 0x826D; + public const int DEBUG_LOGGED_MESSAGES = 0x9145; + public const int DEBUG_LOGGED_MESSAGES_AMD = 0x9145; + public const int DEBUG_LOGGED_MESSAGES_ARB = 0x9145; + public const int DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243; + public const int DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB = 0x8243; + public const int DEBUG_OUTPUT = 0x92E0; + public const int DEBUG_OUTPUT_SYNCHRONOUS = 0x8242; + public const int DEBUG_OUTPUT_SYNCHRONOUS_ARB = 0x8242; + public const int DEBUG_SEVERITY_HIGH = 0x9146; + public const int DEBUG_SEVERITY_HIGH_AMD = 0x9146; + public const int DEBUG_SEVERITY_HIGH_ARB = 0x9146; + public const int DEBUG_SEVERITY_LOW = 0x9148; + public const int DEBUG_SEVERITY_LOW_AMD = 0x9148; + public const int DEBUG_SEVERITY_LOW_ARB = 0x9148; + public const int DEBUG_SEVERITY_MEDIUM = 0x9147; + public const int DEBUG_SEVERITY_MEDIUM_AMD = 0x9147; + public const int DEBUG_SEVERITY_MEDIUM_ARB = 0x9147; + public const int DEBUG_SEVERITY_NOTIFICATION = 0x826B; + public const int DEBUG_SOURCE_API = 0x8246; + public const int DEBUG_SOURCE_API_ARB = 0x8246; + public const int DEBUG_SOURCE_APPLICATION = 0x824A; + public const int DEBUG_SOURCE_APPLICATION_ARB = 0x824A; + public const int DEBUG_SOURCE_OTHER = 0x824B; + public const int DEBUG_SOURCE_OTHER_ARB = 0x824B; + public const int DEBUG_SOURCE_SHADER_COMPILER = 0x8248; + public const int DEBUG_SOURCE_SHADER_COMPILER_ARB = 0x8248; + public const int DEBUG_SOURCE_THIRD_PARTY = 0x8249; + public const int DEBUG_SOURCE_THIRD_PARTY_ARB = 0x8249; + public const int DEBUG_SOURCE_WINDOW_SYSTEM = 0x8247; + public const int DEBUG_SOURCE_WINDOW_SYSTEM_ARB = 0x8247; + public const int DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D; + public const int DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB = 0x824D; + public const int DEBUG_TYPE_ERROR = 0x824C; + public const int DEBUG_TYPE_ERROR_ARB = 0x824C; + public const int DEBUG_TYPE_MARKER = 0x8268; + public const int DEBUG_TYPE_OTHER = 0x8251; + public const int DEBUG_TYPE_OTHER_ARB = 0x8251; + public const int DEBUG_TYPE_PERFORMANCE = 0x8250; + public const int DEBUG_TYPE_PERFORMANCE_ARB = 0x8250; + public const int DEBUG_TYPE_POP_GROUP = 0x826A; + public const int DEBUG_TYPE_PORTABILITY = 0x824F; + public const int DEBUG_TYPE_PORTABILITY_ARB = 0x824F; + public const int DEBUG_TYPE_PUSH_GROUP = 0x8269; + public const int DEBUG_TYPE_UNDEFINED_BEHAVIOR = 0x824E; + public const int DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB = 0x824E; + public const int DECODE_EXT = 0x8A49; + public const int DECR = 0x1E03; + public const int DECR_WRAP = 0x8508; + public const int DECR_WRAP_EXT = 0x8508; + public const int DEDICATED_MEMORY_OBJECT_EXT = 0x9581; + public const int DEFORMATIONS_MASK_SGIX = 0x8196; + public const int DELETE_STATUS = 0x8B80; + public const int DEPENDENT_AR_TEXTURE_2D_NV = 0x86E9; + public const int DEPENDENT_GB_TEXTURE_2D_NV = 0x86EA; + public const int DEPENDENT_HILO_TEXTURE_2D_NV = 0x8858; + public const int DEPENDENT_RGB_TEXTURE_3D_NV = 0x8859; + public const int DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = 0x885A; + public const int DEPTH = 0x1801; + public const int DEPTH24_STENCIL8 = 0x88F0; + public const int DEPTH24_STENCIL8_EXT = 0x88F0; + public const int DEPTH32F_STENCIL8 = 0x8CAD; + public const int DEPTH32F_STENCIL8_NV = 0x8DAC; + public const int DEPTH_ATTACHMENT = 0x8D00; + public const int DEPTH_ATTACHMENT_EXT = 0x8D00; + public const int DEPTH_BOUNDS_EXT = 0x8891; + public const int DEPTH_BOUNDS_TEST_EXT = 0x8890; + public const int DEPTH_BUFFER_BIT = 0x00000100; + public const int DEPTH_BUFFER_FLOAT_MODE_NV = 0x8DAF; + public const int DEPTH_CLAMP = 0x864F; + public const int DEPTH_CLAMP_FAR_AMD = 0x901F; + public const int DEPTH_CLAMP_NEAR_AMD = 0x901E; + public const int DEPTH_CLAMP_NV = 0x864F; + public const int DEPTH_CLEAR_VALUE = 0x0B73; + public const int DEPTH_COMPONENT = 0x1902; + public const int DEPTH_COMPONENT16 = 0x81A5; + public const int DEPTH_COMPONENT16_ARB = 0x81A5; + public const int DEPTH_COMPONENT16_SGIX = 0x81A5; + public const int DEPTH_COMPONENT24 = 0x81A6; + public const int DEPTH_COMPONENT24_ARB = 0x81A6; + public const int DEPTH_COMPONENT24_SGIX = 0x81A6; + public const int DEPTH_COMPONENT32 = 0x81A7; + public const int DEPTH_COMPONENT32F = 0x8CAC; + public const int DEPTH_COMPONENT32F_NV = 0x8DAB; + public const int DEPTH_COMPONENT32_ARB = 0x81A7; + public const int DEPTH_COMPONENT32_SGIX = 0x81A7; + public const int DEPTH_COMPONENTS = 0x8284; + public const int DEPTH_FUNC = 0x0B74; + public const int DEPTH_RANGE = 0x0B70; + public const int DEPTH_RENDERABLE = 0x8287; + public const int DEPTH_SAMPLES_NV = 0x932D; + public const int DEPTH_STENCIL = 0x84F9; + public const int DEPTH_STENCIL_ATTACHMENT = 0x821A; + public const int DEPTH_STENCIL_EXT = 0x84F9; + public const int DEPTH_STENCIL_NV = 0x84F9; + public const int DEPTH_STENCIL_TEXTURE_MODE = 0x90EA; + public const int DEPTH_STENCIL_TO_BGRA_NV = 0x886F; + public const int DEPTH_STENCIL_TO_RGBA_NV = 0x886E; + public const int DEPTH_TEST = 0x0B71; + public const int DEPTH_TEXTURE_MODE_ARB = 0x884B; + public const int DEPTH_WRITEMASK = 0x0B72; + public const int DETACHED_BUFFERS_NV = 0x95AB; + public const int DETACHED_MEMORY_INCARNATION_NV = 0x95A9; + public const int DETACHED_TEXTURES_NV = 0x95AA; + public const int DETAIL_TEXTURE_2D_BINDING_SGIS = 0x8096; + public const int DETAIL_TEXTURE_2D_SGIS = 0x8095; + public const int DETAIL_TEXTURE_FUNC_POINTS_SGIS = 0x809C; + public const int DETAIL_TEXTURE_LEVEL_SGIS = 0x809A; + public const int DETAIL_TEXTURE_MODE_SGIS = 0x809B; + public const int DEVICE_LUID_EXT = 0x9599; + public const int DEVICE_NODE_MASK_EXT = 0x959A; + public const int DEVICE_UUID_EXT = 0x9597; + public const int DIFFERENCE_KHR = 0x929E; + public const int DIFFERENCE_NV = 0x929E; + public const int DISCARD_ATI = 0x8763; + public const int DISCARD_NV = 0x8530; + public const int DISCRETE_AMD = 0x9006; + public const int DISJOINT_NV = 0x9283; + public const int DISPATCH_INDIRECT_BUFFER = 0x90EE; + public const int DISPATCH_INDIRECT_BUFFER_BINDING = 0x90EF; + public const int DISTANCE_ATTENUATION_EXT = 0x8129; + public const int DISTANCE_ATTENUATION_SGIS = 0x8129; + public const int DITHER = 0x0BD0; + public const int DONT_CARE = 0x1100; + public const int DOT2_ADD_ATI = 0x896C; + public const int DOT3_ATI = 0x8966; + public const int DOT3_RGBA_ARB = 0x86AF; + public const int DOT3_RGBA_EXT = 0x8741; + public const int DOT3_RGB_ARB = 0x86AE; + public const int DOT3_RGB_EXT = 0x8740; + public const int DOT4_ATI = 0x8967; + public const int DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = 0x885D; + public const int DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV = 0x86F3; + public const int DOT_PRODUCT_DEPTH_REPLACE_NV = 0x86ED; + public const int DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = 0x86F1; + public const int DOT_PRODUCT_NV = 0x86EC; + public const int DOT_PRODUCT_PASS_THROUGH_NV = 0x885B; + public const int DOT_PRODUCT_REFLECT_CUBE_MAP_NV = 0x86F2; + public const int DOT_PRODUCT_TEXTURE_1D_NV = 0x885C; + public const int DOT_PRODUCT_TEXTURE_2D_NV = 0x86EE; + public const int DOT_PRODUCT_TEXTURE_3D_NV = 0x86EF; + public const int DOT_PRODUCT_TEXTURE_CUBE_MAP_NV = 0x86F0; + public const int DOT_PRODUCT_TEXTURE_RECTANGLE_NV = 0x864E; + public const int DOUBLE = 0x140A; + public const int DOUBLEBUFFER = 0x0C32; + public const int DOUBLE_MAT2 = 0x8F46; + public const int DOUBLE_MAT2_EXT = 0x8F46; + public const int DOUBLE_MAT2x3 = 0x8F49; + public const int DOUBLE_MAT2x3_EXT = 0x8F49; + public const int DOUBLE_MAT2x4 = 0x8F4A; + public const int DOUBLE_MAT2x4_EXT = 0x8F4A; + public const int DOUBLE_MAT3 = 0x8F47; + public const int DOUBLE_MAT3_EXT = 0x8F47; + public const int DOUBLE_MAT3x2 = 0x8F4B; + public const int DOUBLE_MAT3x2_EXT = 0x8F4B; + public const int DOUBLE_MAT3x4 = 0x8F4C; + public const int DOUBLE_MAT3x4_EXT = 0x8F4C; + public const int DOUBLE_MAT4 = 0x8F48; + public const int DOUBLE_MAT4_EXT = 0x8F48; + public const int DOUBLE_MAT4x2 = 0x8F4D; + public const int DOUBLE_MAT4x2_EXT = 0x8F4D; + public const int DOUBLE_MAT4x3 = 0x8F4E; + public const int DOUBLE_MAT4x3_EXT = 0x8F4E; + public const int DOUBLE_VEC2 = 0x8FFC; + public const int DOUBLE_VEC2_EXT = 0x8FFC; + public const int DOUBLE_VEC3 = 0x8FFD; + public const int DOUBLE_VEC3_EXT = 0x8FFD; + public const int DOUBLE_VEC4 = 0x8FFE; + public const int DOUBLE_VEC4_EXT = 0x8FFE; + public const int DRAW_ARRAYS_COMMAND_NV = 0x0003; + public const int DRAW_ARRAYS_INSTANCED_COMMAND_NV = 0x0007; + public const int DRAW_ARRAYS_STRIP_COMMAND_NV = 0x0005; + public const int DRAW_BUFFER = 0x0C01; + public const int DRAW_BUFFER0 = 0x8825; + public const int DRAW_BUFFER0_ARB = 0x8825; + public const int DRAW_BUFFER0_ATI = 0x8825; + public const int DRAW_BUFFER1 = 0x8826; + public const int DRAW_BUFFER10 = 0x882F; + public const int DRAW_BUFFER10_ARB = 0x882F; + public const int DRAW_BUFFER10_ATI = 0x882F; + public const int DRAW_BUFFER11 = 0x8830; + public const int DRAW_BUFFER11_ARB = 0x8830; + public const int DRAW_BUFFER11_ATI = 0x8830; + public const int DRAW_BUFFER12 = 0x8831; + public const int DRAW_BUFFER12_ARB = 0x8831; + public const int DRAW_BUFFER12_ATI = 0x8831; + public const int DRAW_BUFFER13 = 0x8832; + public const int DRAW_BUFFER13_ARB = 0x8832; + public const int DRAW_BUFFER13_ATI = 0x8832; + public const int DRAW_BUFFER14 = 0x8833; + public const int DRAW_BUFFER14_ARB = 0x8833; + public const int DRAW_BUFFER14_ATI = 0x8833; + public const int DRAW_BUFFER15 = 0x8834; + public const int DRAW_BUFFER15_ARB = 0x8834; + public const int DRAW_BUFFER15_ATI = 0x8834; + public const int DRAW_BUFFER1_ARB = 0x8826; + public const int DRAW_BUFFER1_ATI = 0x8826; + public const int DRAW_BUFFER2 = 0x8827; + public const int DRAW_BUFFER2_ARB = 0x8827; + public const int DRAW_BUFFER2_ATI = 0x8827; + public const int DRAW_BUFFER3 = 0x8828; + public const int DRAW_BUFFER3_ARB = 0x8828; + public const int DRAW_BUFFER3_ATI = 0x8828; + public const int DRAW_BUFFER4 = 0x8829; + public const int DRAW_BUFFER4_ARB = 0x8829; + public const int DRAW_BUFFER4_ATI = 0x8829; + public const int DRAW_BUFFER5 = 0x882A; + public const int DRAW_BUFFER5_ARB = 0x882A; + public const int DRAW_BUFFER5_ATI = 0x882A; + public const int DRAW_BUFFER6 = 0x882B; + public const int DRAW_BUFFER6_ARB = 0x882B; + public const int DRAW_BUFFER6_ATI = 0x882B; + public const int DRAW_BUFFER7 = 0x882C; + public const int DRAW_BUFFER7_ARB = 0x882C; + public const int DRAW_BUFFER7_ATI = 0x882C; + public const int DRAW_BUFFER8 = 0x882D; + public const int DRAW_BUFFER8_ARB = 0x882D; + public const int DRAW_BUFFER8_ATI = 0x882D; + public const int DRAW_BUFFER9 = 0x882E; + public const int DRAW_BUFFER9_ARB = 0x882E; + public const int DRAW_BUFFER9_ATI = 0x882E; + public const int DRAW_ELEMENTS_COMMAND_NV = 0x0002; + public const int DRAW_ELEMENTS_INSTANCED_COMMAND_NV = 0x0006; + public const int DRAW_ELEMENTS_STRIP_COMMAND_NV = 0x0004; + public const int DRAW_FRAMEBUFFER = 0x8CA9; + public const int DRAW_FRAMEBUFFER_BINDING = 0x8CA6; + public const int DRAW_FRAMEBUFFER_BINDING_EXT = 0x8CA6; + public const int DRAW_FRAMEBUFFER_EXT = 0x8CA9; + public const int DRAW_INDIRECT_ADDRESS_NV = 0x8F41; + public const int DRAW_INDIRECT_BUFFER = 0x8F3F; + public const int DRAW_INDIRECT_BUFFER_BINDING = 0x8F43; + public const int DRAW_INDIRECT_LENGTH_NV = 0x8F42; + public const int DRAW_INDIRECT_UNIFIED_NV = 0x8F40; + public const int DRAW_PIXELS_APPLE = 0x8A0A; + public const int DRIVER_UUID_EXT = 0x9598; + public const int DSDT8_MAG8_INTENSITY8_NV = 0x870B; + public const int DSDT8_MAG8_NV = 0x870A; + public const int DSDT8_NV = 0x8709; + public const int DSDT_MAG_INTENSITY_NV = 0x86DC; + public const int DSDT_MAG_NV = 0x86F6; + public const int DSDT_MAG_VIB_NV = 0x86F7; + public const int DSDT_NV = 0x86F5; + public const int DST_ALPHA = 0x0304; + public const int DST_ATOP_NV = 0x928F; + public const int DST_COLOR = 0x0306; + public const int DST_IN_NV = 0x928B; + public const int DST_NV = 0x9287; + public const int DST_OUT_NV = 0x928D; + public const int DST_OVER_NV = 0x9289; + public const int DS_BIAS_NV = 0x8716; + public const int DS_SCALE_NV = 0x8710; + public const int DT_BIAS_NV = 0x8717; + public const int DT_SCALE_NV = 0x8711; + public const int DU8DV8_ATI = 0x877A; + public const int DUAL_ALPHA12_SGIS = 0x8112; + public const int DUAL_ALPHA16_SGIS = 0x8113; + public const int DUAL_ALPHA4_SGIS = 0x8110; + public const int DUAL_ALPHA8_SGIS = 0x8111; + public const int DUAL_INTENSITY12_SGIS = 0x811A; + public const int DUAL_INTENSITY16_SGIS = 0x811B; + public const int DUAL_INTENSITY4_SGIS = 0x8118; + public const int DUAL_INTENSITY8_SGIS = 0x8119; + public const int DUAL_LUMINANCE12_SGIS = 0x8116; + public const int DUAL_LUMINANCE16_SGIS = 0x8117; + public const int DUAL_LUMINANCE4_SGIS = 0x8114; + public const int DUAL_LUMINANCE8_SGIS = 0x8115; + public const int DUAL_LUMINANCE_ALPHA4_SGIS = 0x811C; + public const int DUAL_LUMINANCE_ALPHA8_SGIS = 0x811D; + public const int DUAL_TEXTURE_SELECT_SGIS = 0x8124; + public const int DUDV_ATI = 0x8779; + public const int DUP_FIRST_CUBIC_CURVE_TO_NV = 0xF2; + public const int DUP_LAST_CUBIC_CURVE_TO_NV = 0xF4; + public const int DYNAMIC_ATI = 0x8761; + public const int DYNAMIC_COPY = 0x88EA; + public const int DYNAMIC_COPY_ARB = 0x88EA; + public const int DYNAMIC_DRAW = 0x88E8; + public const int DYNAMIC_DRAW_ARB = 0x88E8; + public const int DYNAMIC_READ = 0x88E9; + public const int DYNAMIC_READ_ARB = 0x88E9; + public const int DYNAMIC_STORAGE_BIT = 0x0100; + public const int EDGEFLAG_BIT_PGI = 0x00040000; + public const int EDGE_FLAG_ARRAY_ADDRESS_NV = 0x8F26; + public const int EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB = 0x889B; + public const int EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D; + public const int EDGE_FLAG_ARRAY_EXT = 0x8079; + public const int EDGE_FLAG_ARRAY_LENGTH_NV = 0x8F30; + public const int EDGE_FLAG_ARRAY_LIST_IBM = 103075; + public const int EDGE_FLAG_ARRAY_LIST_STRIDE_IBM = 103085; + public const int EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093; + public const int EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C; + public const int EFFECTIVE_RASTER_SAMPLES_EXT = 0x932C; + public const int EIGHTH_BIT_ATI = 0x00000020; + public const int ELEMENT_ADDRESS_COMMAND_NV = 0x0008; + public const int ELEMENT_ARRAY_ADDRESS_NV = 0x8F29; + public const int ELEMENT_ARRAY_APPLE = 0x8A0C; + public const int ELEMENT_ARRAY_ATI = 0x8768; + public const int ELEMENT_ARRAY_BARRIER_BIT = 0x00000002; + public const int ELEMENT_ARRAY_BARRIER_BIT_EXT = 0x00000002; + public const int ELEMENT_ARRAY_BUFFER = 0x8893; + public const int ELEMENT_ARRAY_BUFFER_ARB = 0x8893; + public const int ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; + public const int ELEMENT_ARRAY_BUFFER_BINDING_ARB = 0x8895; + public const int ELEMENT_ARRAY_LENGTH_NV = 0x8F33; + public const int ELEMENT_ARRAY_POINTER_APPLE = 0x8A0E; + public const int ELEMENT_ARRAY_POINTER_ATI = 0x876A; + public const int ELEMENT_ARRAY_TYPE_APPLE = 0x8A0D; + public const int ELEMENT_ARRAY_TYPE_ATI = 0x8769; + public const int ELEMENT_ARRAY_UNIFIED_NV = 0x8F1F; + public const int EMBOSS_CONSTANT_NV = 0x855E; + public const int EMBOSS_LIGHT_NV = 0x855D; + public const int EMBOSS_MAP_NV = 0x855F; + public const int EQUAL = 0x0202; + public const int EQUIV = 0x1509; + public const int EVAL_2D_NV = 0x86C0; + public const int EVAL_FRACTIONAL_TESSELLATION_NV = 0x86C5; + public const int EVAL_TRIANGULAR_2D_NV = 0x86C1; + public const int EVAL_VERTEX_ATTRIB0_NV = 0x86C6; + public const int EVAL_VERTEX_ATTRIB10_NV = 0x86D0; + public const int EVAL_VERTEX_ATTRIB11_NV = 0x86D1; + public const int EVAL_VERTEX_ATTRIB12_NV = 0x86D2; + public const int EVAL_VERTEX_ATTRIB13_NV = 0x86D3; + public const int EVAL_VERTEX_ATTRIB14_NV = 0x86D4; + public const int EVAL_VERTEX_ATTRIB15_NV = 0x86D5; + public const int EVAL_VERTEX_ATTRIB1_NV = 0x86C7; + public const int EVAL_VERTEX_ATTRIB2_NV = 0x86C8; + public const int EVAL_VERTEX_ATTRIB3_NV = 0x86C9; + public const int EVAL_VERTEX_ATTRIB4_NV = 0x86CA; + public const int EVAL_VERTEX_ATTRIB5_NV = 0x86CB; + public const int EVAL_VERTEX_ATTRIB6_NV = 0x86CC; + public const int EVAL_VERTEX_ATTRIB7_NV = 0x86CD; + public const int EVAL_VERTEX_ATTRIB8_NV = 0x86CE; + public const int EVAL_VERTEX_ATTRIB9_NV = 0x86CF; + public const int EXCLUSION_KHR = 0x92A0; + public const int EXCLUSION_NV = 0x92A0; + public const int EXCLUSIVE_EXT = 0x8F11; + public const int EXPAND_NEGATE_NV = 0x8539; + public const int EXPAND_NORMAL_NV = 0x8538; + public const int EXTENSIONS = 0x1F03; + public const int EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD = 0x9160; + public const int EYE_DISTANCE_TO_LINE_SGIS = 0x81F2; + public const int EYE_DISTANCE_TO_POINT_SGIS = 0x81F0; + public const int EYE_LINE_SGIS = 0x81F6; + public const int EYE_PLANE = 0x2502; + public const int EYE_PLANE_ABSOLUTE_NV = 0x855C; + public const int EYE_POINT_SGIS = 0x81F4; + public const int EYE_RADIAL_NV = 0x855B; + public const int E_TIMES_F_NV = 0x8531; + public const int FACTOR_MAX_AMD = 0x901D; + public const int FACTOR_MIN_AMD = 0x901C; + public const int FAILURE_NV = 0x9030; + public const int FALSE = 0; + public const int FASTEST = 0x1101; + public const int FENCE_APPLE = 0x8A0B; + public const int FENCE_CONDITION_NV = 0x84F4; + public const int FENCE_STATUS_NV = 0x84F3; + public const int FIELDS_NV = 0x8E27; + public const int FIELD_LOWER_NV = 0x9023; + public const int FIELD_UPPER_NV = 0x9022; + public const int FILE_NAME_NV = 0x9074; + public const int FILL = 0x1B02; + public const int FILL_RECTANGLE_NV = 0x933C; + public const int FILTER = 0x829A; + public const int FILTER4_SGIS = 0x8146; + public const int FIRST_TO_REST_NV = 0x90AF; + public const int FIRST_VERTEX_CONVENTION = 0x8E4D; + public const int FIRST_VERTEX_CONVENTION_EXT = 0x8E4D; + public const int FIXED = 0x140C; + public const int FIXED_OES = 0x140C; + public const int FIXED_ONLY = 0x891D; + public const int FIXED_ONLY_ARB = 0x891D; + public const int FLOAT = 0x1406; + public const int FLOAT16_MAT2_AMD = 0x91C5; + public const int FLOAT16_MAT2x3_AMD = 0x91C8; + public const int FLOAT16_MAT2x4_AMD = 0x91C9; + public const int FLOAT16_MAT3_AMD = 0x91C6; + public const int FLOAT16_MAT3x2_AMD = 0x91CA; + public const int FLOAT16_MAT3x4_AMD = 0x91CB; + public const int FLOAT16_MAT4_AMD = 0x91C7; + public const int FLOAT16_MAT4x2_AMD = 0x91CC; + public const int FLOAT16_MAT4x3_AMD = 0x91CD; + public const int FLOAT16_NV = 0x8FF8; + public const int FLOAT16_VEC2_NV = 0x8FF9; + public const int FLOAT16_VEC3_NV = 0x8FFA; + public const int FLOAT16_VEC4_NV = 0x8FFB; + public const int FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD; + public const int FLOAT_32_UNSIGNED_INT_24_8_REV_NV = 0x8DAD; + public const int FLOAT_CLEAR_COLOR_VALUE_NV = 0x888D; + public const int FLOAT_MAT2 = 0x8B5A; + public const int FLOAT_MAT2_ARB = 0x8B5A; + public const int FLOAT_MAT2x3 = 0x8B65; + public const int FLOAT_MAT2x4 = 0x8B66; + public const int FLOAT_MAT3 = 0x8B5B; + public const int FLOAT_MAT3_ARB = 0x8B5B; + public const int FLOAT_MAT3x2 = 0x8B67; + public const int FLOAT_MAT3x4 = 0x8B68; + public const int FLOAT_MAT4 = 0x8B5C; + public const int FLOAT_MAT4_ARB = 0x8B5C; + public const int FLOAT_MAT4x2 = 0x8B69; + public const int FLOAT_MAT4x3 = 0x8B6A; + public const int FLOAT_R16_NV = 0x8884; + public const int FLOAT_R32_NV = 0x8885; + public const int FLOAT_RG16_NV = 0x8886; + public const int FLOAT_RG32_NV = 0x8887; + public const int FLOAT_RGB16_NV = 0x8888; + public const int FLOAT_RGB32_NV = 0x8889; + public const int FLOAT_RGBA16_NV = 0x888A; + public const int FLOAT_RGBA32_NV = 0x888B; + public const int FLOAT_RGBA_MODE_NV = 0x888E; + public const int FLOAT_RGBA_NV = 0x8883; + public const int FLOAT_RGB_NV = 0x8882; + public const int FLOAT_RG_NV = 0x8881; + public const int FLOAT_R_NV = 0x8880; + public const int FLOAT_VEC2 = 0x8B50; + public const int FLOAT_VEC2_ARB = 0x8B50; + public const int FLOAT_VEC3 = 0x8B51; + public const int FLOAT_VEC3_ARB = 0x8B51; + public const int FLOAT_VEC4 = 0x8B52; + public const int FLOAT_VEC4_ARB = 0x8B52; + public const int FOG = 0x0B60; + public const int FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB = 0x889D; + public const int FOG_COORDINATE_ARRAY_EXT = 0x8457; + public const int FOG_COORDINATE_ARRAY_LIST_IBM = 103076; + public const int FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM = 103086; + public const int FOG_COORDINATE_ARRAY_POINTER_EXT = 0x8456; + public const int FOG_COORDINATE_ARRAY_STRIDE_EXT = 0x8455; + public const int FOG_COORDINATE_ARRAY_TYPE_EXT = 0x8454; + public const int FOG_COORDINATE_EXT = 0x8451; + public const int FOG_COORDINATE_SOURCE_EXT = 0x8450; + public const int FOG_COORD_ARRAY_ADDRESS_NV = 0x8F28; + public const int FOG_COORD_ARRAY_LENGTH_NV = 0x8F32; + public const int FOG_DISTANCE_MODE_NV = 0x855A; + public const int FOG_FUNC_POINTS_SGIS = 0x812B; + public const int FOG_FUNC_SGIS = 0x812A; + public const int FOG_OFFSET_SGIX = 0x8198; + public const int FOG_OFFSET_VALUE_SGIX = 0x8199; + public const int FOG_SPECULAR_TEXTURE_WIN = 0x80EC; + public const int FONT_ASCENDER_BIT_NV = 0x00200000; + public const int FONT_DESCENDER_BIT_NV = 0x00400000; + public const int FONT_GLYPHS_AVAILABLE_NV = 0x9368; + public const int FONT_HAS_KERNING_BIT_NV = 0x10000000; + public const int FONT_HEIGHT_BIT_NV = 0x00800000; + public const int FONT_MAX_ADVANCE_HEIGHT_BIT_NV = 0x02000000; + public const int FONT_MAX_ADVANCE_WIDTH_BIT_NV = 0x01000000; + public const int FONT_NUM_GLYPH_INDICES_BIT_NV = 0x20000000; + public const int FONT_TARGET_UNAVAILABLE_NV = 0x9369; + public const int FONT_UNAVAILABLE_NV = 0x936A; + public const int FONT_UNDERLINE_POSITION_BIT_NV = 0x04000000; + public const int FONT_UNDERLINE_THICKNESS_BIT_NV = 0x08000000; + public const int FONT_UNINTELLIGIBLE_NV = 0x936B; + public const int FONT_UNITS_PER_EM_BIT_NV = 0x00100000; + public const int FONT_X_MAX_BOUNDS_BIT_NV = 0x00040000; + public const int FONT_X_MIN_BOUNDS_BIT_NV = 0x00010000; + public const int FONT_Y_MAX_BOUNDS_BIT_NV = 0x00080000; + public const int FONT_Y_MIN_BOUNDS_BIT_NV = 0x00020000; + public const int FORCE_BLUE_TO_ONE_NV = 0x8860; + public const int FORMAT_SUBSAMPLE_244_244_OML = 0x8983; + public const int FORMAT_SUBSAMPLE_24_24_OML = 0x8982; + public const int FRACTIONAL_EVEN = 0x8E7C; + public const int FRACTIONAL_ODD = 0x8E7B; + public const int FRAGMENT_COLOR_EXT = 0x834C; + public const int FRAGMENT_COLOR_MATERIAL_FACE_SGIX = 0x8402; + public const int FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX = 0x8403; + public const int FRAGMENT_COLOR_MATERIAL_SGIX = 0x8401; + public const int FRAGMENT_COVERAGE_COLOR_NV = 0x92DE; + public const int FRAGMENT_COVERAGE_TO_COLOR_NV = 0x92DD; + public const int FRAGMENT_DEPTH_EXT = 0x8452; + public const int FRAGMENT_INPUT_NV = 0x936D; + public const int FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D; + public const int FRAGMENT_LIGHT0_SGIX = 0x840C; + public const int FRAGMENT_LIGHT1_SGIX = 0x840D; + public const int FRAGMENT_LIGHT2_SGIX = 0x840E; + public const int FRAGMENT_LIGHT3_SGIX = 0x840F; + public const int FRAGMENT_LIGHT4_SGIX = 0x8410; + public const int FRAGMENT_LIGHT5_SGIX = 0x8411; + public const int FRAGMENT_LIGHT6_SGIX = 0x8412; + public const int FRAGMENT_LIGHT7_SGIX = 0x8413; + public const int FRAGMENT_LIGHTING_SGIX = 0x8400; + public const int FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX = 0x840A; + public const int FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX = 0x8408; + public const int FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX = 0x840B; + public const int FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX = 0x8409; + public const int FRAGMENT_MATERIAL_EXT = 0x8349; + public const int FRAGMENT_NORMAL_EXT = 0x834A; + public const int FRAGMENT_PROGRAM_ARB = 0x8804; + public const int FRAGMENT_PROGRAM_BINDING_NV = 0x8873; + public const int FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV = 0x8E5D; + public const int FRAGMENT_PROGRAM_NV = 0x8870; + public const int FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA4; + public const int FRAGMENT_SHADER = 0x8B30; + public const int FRAGMENT_SHADER_ARB = 0x8B30; + public const int FRAGMENT_SHADER_ATI = 0x8920; + public const int FRAGMENT_SHADER_BIT = 0x00000002; + public const int FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B; + public const int FRAGMENT_SHADER_DERIVATIVE_HINT_ARB = 0x8B8B; + public const int FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT = 0x8A52; + public const int FRAGMENT_SHADER_INVOCATIONS = 0x82F4; + public const int FRAGMENT_SHADER_INVOCATIONS_ARB = 0x82F4; + public const int FRAGMENT_SUBROUTINE = 0x92EC; + public const int FRAGMENT_SUBROUTINE_UNIFORM = 0x92F2; + public const int FRAGMENT_TEXTURE = 0x829F; + public const int FRAMEBUFFER = 0x8D40; + public const int FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215; + public const int FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214; + public const int FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210; + public const int FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211; + public const int FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216; + public const int FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213; + public const int FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7; + public const int FRAMEBUFFER_ATTACHMENT_LAYERED_ARB = 0x8DA7; + public const int FRAMEBUFFER_ATTACHMENT_LAYERED_EXT = 0x8DA7; + public const int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1; + public const int FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT = 0x8CD1; + public const int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0; + public const int FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT = 0x8CD0; + public const int FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212; + public const int FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT = 0x8CD4; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR = 0x9632; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT = 0x8CD3; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT = 0x8CD4; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT = 0x8CD2; + public const int FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR = 0x9630; + public const int FRAMEBUFFER_BARRIER_BIT = 0x00000400; + public const int FRAMEBUFFER_BARRIER_BIT_EXT = 0x00000400; + public const int FRAMEBUFFER_BINDING = 0x8CA6; + public const int FRAMEBUFFER_BINDING_EXT = 0x8CA6; + public const int FRAMEBUFFER_BLEND = 0x828B; + public const int FRAMEBUFFER_COMPLETE = 0x8CD5; + public const int FRAMEBUFFER_COMPLETE_EXT = 0x8CD5; + public const int FRAMEBUFFER_DEFAULT = 0x8218; + public const int FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 0x9314; + public const int FRAMEBUFFER_DEFAULT_HEIGHT = 0x9311; + public const int FRAMEBUFFER_DEFAULT_LAYERS = 0x9312; + public const int FRAMEBUFFER_DEFAULT_SAMPLES = 0x9313; + public const int FRAMEBUFFER_DEFAULT_WIDTH = 0x9310; + public const int FRAMEBUFFER_EXT = 0x8D40; + public const int FRAMEBUFFER_FLIP_X_MESA = 0x8BBC; + public const int FRAMEBUFFER_FLIP_Y_MESA = 0x8BBB; + public const int FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; + public const int FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT = 0x8CD6; + public const int FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT = 0x8CD9; + public const int FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB; + public const int FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT = 0x8CDB; + public const int FRAMEBUFFER_INCOMPLETE_FORMATS_EXT = 0x8CDA; + public const int FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB = 0x8DA9; + public const int FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT = 0x8DA9; + public const int FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8; + public const int FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB = 0x8DA8; + public const int FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT = 0x8DA8; + public const int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; + public const int FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT = 0x8CD7; + public const int FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56; + public const int FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT = 0x8D56; + public const int FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC; + public const int FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT = 0x8CDC; + public const int FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR = 0x9633; + public const int FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB = 0x9342; + public const int FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV = 0x9342; + public const int FRAMEBUFFER_RENDERABLE = 0x8289; + public const int FRAMEBUFFER_RENDERABLE_LAYERED = 0x828A; + public const int FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB = 0x9343; + public const int FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV = 0x9343; + public const int FRAMEBUFFER_SRGB = 0x8DB9; + public const int FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x8DBA; + public const int FRAMEBUFFER_SRGB_EXT = 0x8DB9; + public const int FRAMEBUFFER_SWAP_XY_MESA = 0x8BBD; + public const int FRAMEBUFFER_UNDEFINED = 0x8219; + public const int FRAMEBUFFER_UNSUPPORTED = 0x8CDD; + public const int FRAMEBUFFER_UNSUPPORTED_EXT = 0x8CDD; + public const int FRAMEZOOM_FACTOR_SGIX = 0x818C; + public const int FRAMEZOOM_SGIX = 0x818B; + public const int FRAME_NV = 0x8E26; + public const int FRONT = 0x0404; + public const int FRONT_AND_BACK = 0x0408; + public const int FRONT_FACE = 0x0B46; + public const int FRONT_FACE_COMMAND_NV = 0x0012; + public const int FRONT_LEFT = 0x0400; + public const int FRONT_RIGHT = 0x0401; + public const int FULL_RANGE_EXT = 0x87E1; + public const int FULL_STIPPLE_HINT_PGI = 0x1A219; + public const int FULL_SUPPORT = 0x82B7; + public const int FUNC_ADD = 0x8006; + public const int FUNC_ADD_EXT = 0x8006; + public const int FUNC_REVERSE_SUBTRACT = 0x800B; + public const int FUNC_REVERSE_SUBTRACT_EXT = 0x800B; + public const int FUNC_SUBTRACT = 0x800A; + public const int FUNC_SUBTRACT_EXT = 0x800A; + public const int GENERATE_MIPMAP_HINT_SGIS = 0x8192; + public const int GENERATE_MIPMAP_SGIS = 0x8191; + public const int GENERIC_ATTRIB_NV = 0x8C7D; + public const int GEOMETRY_DEFORMATION_BIT_SGIX = 0x00000002; + public const int GEOMETRY_DEFORMATION_SGIX = 0x8194; + public const int GEOMETRY_INPUT_TYPE = 0x8917; + public const int GEOMETRY_INPUT_TYPE_ARB = 0x8DDB; + public const int GEOMETRY_INPUT_TYPE_EXT = 0x8DDB; + public const int GEOMETRY_OUTPUT_TYPE = 0x8918; + public const int GEOMETRY_OUTPUT_TYPE_ARB = 0x8DDC; + public const int GEOMETRY_OUTPUT_TYPE_EXT = 0x8DDC; + public const int GEOMETRY_PROGRAM_NV = 0x8C26; + public const int GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA3; + public const int GEOMETRY_SHADER = 0x8DD9; + public const int GEOMETRY_SHADER_ARB = 0x8DD9; + public const int GEOMETRY_SHADER_BIT = 0x00000004; + public const int GEOMETRY_SHADER_EXT = 0x8DD9; + public const int GEOMETRY_SHADER_INVOCATIONS = 0x887F; + public const int GEOMETRY_SHADER_PRIMITIVES_EMITTED = 0x82F3; + public const int GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB = 0x82F3; + public const int GEOMETRY_SUBROUTINE = 0x92EB; + public const int GEOMETRY_SUBROUTINE_UNIFORM = 0x92F1; + public const int GEOMETRY_TEXTURE = 0x829E; + public const int GEOMETRY_VERTICES_OUT = 0x8916; + public const int GEOMETRY_VERTICES_OUT_ARB = 0x8DDA; + public const int GEOMETRY_VERTICES_OUT_EXT = 0x8DDA; + public const int GEQUAL = 0x0206; + public const int GET_TEXTURE_IMAGE_FORMAT = 0x8291; + public const int GET_TEXTURE_IMAGE_TYPE = 0x8292; + public const int GLOBAL_ALPHA_FACTOR_SUN = 0x81DA; + public const int GLOBAL_ALPHA_SUN = 0x81D9; + public const int GLYPH_HAS_KERNING_BIT_NV = 0x100; + public const int GLYPH_HEIGHT_BIT_NV = 0x02; + public const int GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV = 0x10; + public const int GLYPH_HORIZONTAL_BEARING_X_BIT_NV = 0x04; + public const int GLYPH_HORIZONTAL_BEARING_Y_BIT_NV = 0x08; + public const int GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV = 0x80; + public const int GLYPH_VERTICAL_BEARING_X_BIT_NV = 0x20; + public const int GLYPH_VERTICAL_BEARING_Y_BIT_NV = 0x40; + public const int GLYPH_WIDTH_BIT_NV = 0x01; + public const int GPU_ADDRESS_NV = 0x8F34; + public const int GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = 0x9049; + public const int GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = 0x9047; + public const int GPU_MEMORY_INFO_EVICTED_MEMORY_NVX = 0x904B; + public const int GPU_MEMORY_INFO_EVICTION_COUNT_NVX = 0x904A; + public const int GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = 0x9048; + public const int GREATER = 0x0204; + public const int GREEN = 0x1904; + public const int GREEN_BIT_ATI = 0x00000002; + public const int GREEN_INTEGER = 0x8D95; + public const int GREEN_INTEGER_EXT = 0x8D95; + public const int GREEN_MAX_CLAMP_INGR = 0x8565; + public const int GREEN_MIN_CLAMP_INGR = 0x8561; + public const int GREEN_NV = 0x1904; + public const int GUILTY_CONTEXT_RESET = 0x8253; + public const int GUILTY_CONTEXT_RESET_ARB = 0x8253; + public const int HALF_APPLE = 0x140B; + public const int HALF_BIAS_NEGATE_NV = 0x853B; + public const int HALF_BIAS_NORMAL_NV = 0x853A; + public const int HALF_BIT_ATI = 0x00000008; + public const int HALF_FLOAT = 0x140B; + public const int HALF_FLOAT_ARB = 0x140B; + public const int HALF_FLOAT_NV = 0x140B; + public const int HANDLE_TYPE_D3D11_IMAGE_EXT = 0x958B; + public const int HANDLE_TYPE_D3D11_IMAGE_KMT_EXT = 0x958C; + public const int HANDLE_TYPE_D3D12_FENCE_EXT = 0x9594; + public const int HANDLE_TYPE_D3D12_RESOURCE_EXT = 0x958A; + public const int HANDLE_TYPE_D3D12_TILEPOOL_EXT = 0x9589; + public const int HANDLE_TYPE_OPAQUE_FD_EXT = 0x9586; + public const int HANDLE_TYPE_OPAQUE_WIN32_EXT = 0x9587; + public const int HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT = 0x9588; + public const int HARDLIGHT_KHR = 0x929B; + public const int HARDLIGHT_NV = 0x929B; + public const int HARDMIX_NV = 0x92A9; + public const int HIGH_FLOAT = 0x8DF2; + public const int HIGH_INT = 0x8DF5; + public const int HILO16_NV = 0x86F8; + public const int HILO8_NV = 0x885E; + public const int HILO_NV = 0x86F4; + public const int HISTOGRAM_ALPHA_SIZE_EXT = 0x802B; + public const int HISTOGRAM_BLUE_SIZE_EXT = 0x802A; + public const int HISTOGRAM_EXT = 0x8024; + public const int HISTOGRAM_FORMAT_EXT = 0x8027; + public const int HISTOGRAM_GREEN_SIZE_EXT = 0x8029; + public const int HISTOGRAM_LUMINANCE_SIZE_EXT = 0x802C; + public const int HISTOGRAM_RED_SIZE_EXT = 0x8028; + public const int HISTOGRAM_SINK_EXT = 0x802D; + public const int HISTOGRAM_WIDTH_EXT = 0x8026; + public const int HI_BIAS_NV = 0x8714; + public const int HI_SCALE_NV = 0x870E; + public const int HORIZONTAL_LINE_TO_NV = 0x06; + public const int HSL_COLOR_KHR = 0x92AF; + public const int HSL_COLOR_NV = 0x92AF; + public const int HSL_HUE_KHR = 0x92AD; + public const int HSL_HUE_NV = 0x92AD; + public const int HSL_LUMINOSITY_KHR = 0x92B0; + public const int HSL_LUMINOSITY_NV = 0x92B0; + public const int HSL_SATURATION_KHR = 0x92AE; + public const int HSL_SATURATION_NV = 0x92AE; + public const int IDENTITY_NV = 0x862A; + public const int IGNORE_BORDER_HP = 0x8150; + public const int IMAGE_1D = 0x904C; + public const int IMAGE_1D_ARRAY = 0x9052; + public const int IMAGE_1D_ARRAY_EXT = 0x9052; + public const int IMAGE_1D_EXT = 0x904C; + public const int IMAGE_2D = 0x904D; + public const int IMAGE_2D_ARRAY = 0x9053; + public const int IMAGE_2D_ARRAY_EXT = 0x9053; + public const int IMAGE_2D_EXT = 0x904D; + public const int IMAGE_2D_MULTISAMPLE = 0x9055; + public const int IMAGE_2D_MULTISAMPLE_ARRAY = 0x9056; + public const int IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9056; + public const int IMAGE_2D_MULTISAMPLE_EXT = 0x9055; + public const int IMAGE_2D_RECT = 0x904F; + public const int IMAGE_2D_RECT_EXT = 0x904F; + public const int IMAGE_3D = 0x904E; + public const int IMAGE_3D_EXT = 0x904E; + public const int IMAGE_BINDING_ACCESS = 0x8F3E; + public const int IMAGE_BINDING_ACCESS_EXT = 0x8F3E; + public const int IMAGE_BINDING_FORMAT = 0x906E; + public const int IMAGE_BINDING_FORMAT_EXT = 0x906E; + public const int IMAGE_BINDING_LAYER = 0x8F3D; + public const int IMAGE_BINDING_LAYERED = 0x8F3C; + public const int IMAGE_BINDING_LAYERED_EXT = 0x8F3C; + public const int IMAGE_BINDING_LAYER_EXT = 0x8F3D; + public const int IMAGE_BINDING_LEVEL = 0x8F3B; + public const int IMAGE_BINDING_LEVEL_EXT = 0x8F3B; + public const int IMAGE_BINDING_NAME = 0x8F3A; + public const int IMAGE_BINDING_NAME_EXT = 0x8F3A; + public const int IMAGE_BUFFER = 0x9051; + public const int IMAGE_BUFFER_EXT = 0x9051; + public const int IMAGE_CLASS_10_10_10_2 = 0x82C3; + public const int IMAGE_CLASS_11_11_10 = 0x82C2; + public const int IMAGE_CLASS_1_X_16 = 0x82BE; + public const int IMAGE_CLASS_1_X_32 = 0x82BB; + public const int IMAGE_CLASS_1_X_8 = 0x82C1; + public const int IMAGE_CLASS_2_X_16 = 0x82BD; + public const int IMAGE_CLASS_2_X_32 = 0x82BA; + public const int IMAGE_CLASS_2_X_8 = 0x82C0; + public const int IMAGE_CLASS_4_X_16 = 0x82BC; + public const int IMAGE_CLASS_4_X_32 = 0x82B9; + public const int IMAGE_CLASS_4_X_8 = 0x82BF; + public const int IMAGE_COMPATIBILITY_CLASS = 0x82A8; + public const int IMAGE_CUBE = 0x9050; + public const int IMAGE_CUBE_EXT = 0x9050; + public const int IMAGE_CUBE_MAP_ARRAY = 0x9054; + public const int IMAGE_CUBE_MAP_ARRAY_EXT = 0x9054; + public const int IMAGE_CUBIC_WEIGHT_HP = 0x815E; + public const int IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9; + public const int IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8; + public const int IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7; + public const int IMAGE_MAG_FILTER_HP = 0x815C; + public const int IMAGE_MIN_FILTER_HP = 0x815D; + public const int IMAGE_PIXEL_FORMAT = 0x82A9; + public const int IMAGE_PIXEL_TYPE = 0x82AA; + public const int IMAGE_ROTATE_ANGLE_HP = 0x8159; + public const int IMAGE_ROTATE_ORIGIN_X_HP = 0x815A; + public const int IMAGE_ROTATE_ORIGIN_Y_HP = 0x815B; + public const int IMAGE_SCALE_X_HP = 0x8155; + public const int IMAGE_SCALE_Y_HP = 0x8156; + public const int IMAGE_TEXEL_SIZE = 0x82A7; + public const int IMAGE_TRANSFORM_2D_HP = 0x8161; + public const int IMAGE_TRANSLATE_X_HP = 0x8157; + public const int IMAGE_TRANSLATE_Y_HP = 0x8158; + public const int IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; + public const int IMPLEMENTATION_COLOR_READ_FORMAT_OES = 0x8B9B; + public const int IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A; + public const int IMPLEMENTATION_COLOR_READ_TYPE_OES = 0x8B9A; + public const int INCLUSIVE_EXT = 0x8F10; + public const int INCR = 0x1E02; + public const int INCR_WRAP = 0x8507; + public const int INCR_WRAP_EXT = 0x8507; + public const int INDEX_ARRAY_ADDRESS_NV = 0x8F24; + public const int INDEX_ARRAY_BUFFER_BINDING_ARB = 0x8899; + public const int INDEX_ARRAY_COUNT_EXT = 0x8087; + public const int INDEX_ARRAY_EXT = 0x8077; + public const int INDEX_ARRAY_LENGTH_NV = 0x8F2E; + public const int INDEX_ARRAY_LIST_IBM = 103073; + public const int INDEX_ARRAY_LIST_STRIDE_IBM = 103083; + public const int INDEX_ARRAY_POINTER_EXT = 0x8091; + public const int INDEX_ARRAY_STRIDE_EXT = 0x8086; + public const int INDEX_ARRAY_TYPE_EXT = 0x8085; + public const int INDEX_BIT_PGI = 0x00080000; + public const int INDEX_MATERIAL_EXT = 0x81B8; + public const int INDEX_MATERIAL_FACE_EXT = 0x81BA; + public const int INDEX_MATERIAL_PARAMETER_EXT = 0x81B9; + public const int INDEX_TEST_EXT = 0x81B5; + public const int INDEX_TEST_FUNC_EXT = 0x81B6; + public const int INDEX_TEST_REF_EXT = 0x81B7; + public const int INFO_LOG_LENGTH = 0x8B84; + public const int INNOCENT_CONTEXT_RESET = 0x8254; + public const int INNOCENT_CONTEXT_RESET_ARB = 0x8254; + public const int INSTRUMENT_BUFFER_POINTER_SGIX = 0x8180; + public const int INSTRUMENT_MEASUREMENTS_SGIX = 0x8181; + public const int INT = 0x1404; + public const int INT16_NV = 0x8FE4; + public const int INT16_VEC2_NV = 0x8FE5; + public const int INT16_VEC3_NV = 0x8FE6; + public const int INT16_VEC4_NV = 0x8FE7; + public const int INT64_ARB = 0x140E; + public const int INT64_NV = 0x140E; + public const int INT64_VEC2_ARB = 0x8FE9; + public const int INT64_VEC2_NV = 0x8FE9; + public const int INT64_VEC3_ARB = 0x8FEA; + public const int INT64_VEC3_NV = 0x8FEA; + public const int INT64_VEC4_ARB = 0x8FEB; + public const int INT64_VEC4_NV = 0x8FEB; + public const int INT8_NV = 0x8FE0; + public const int INT8_VEC2_NV = 0x8FE1; + public const int INT8_VEC3_NV = 0x8FE2; + public const int INT8_VEC4_NV = 0x8FE3; + public const int INTENSITY12_EXT = 0x804C; + public const int INTENSITY16F_ARB = 0x881D; + public const int INTENSITY16I_EXT = 0x8D8B; + public const int INTENSITY16UI_EXT = 0x8D79; + public const int INTENSITY16_EXT = 0x804D; + public const int INTENSITY16_SNORM = 0x901B; + public const int INTENSITY32F_ARB = 0x8817; + public const int INTENSITY32I_EXT = 0x8D85; + public const int INTENSITY32UI_EXT = 0x8D73; + public const int INTENSITY4_EXT = 0x804A; + public const int INTENSITY8I_EXT = 0x8D91; + public const int INTENSITY8UI_EXT = 0x8D7F; + public const int INTENSITY8_EXT = 0x804B; + public const int INTENSITY8_SNORM = 0x9017; + public const int INTENSITY_EXT = 0x8049; + public const int INTENSITY_FLOAT16_APPLE = 0x881D; + public const int INTENSITY_FLOAT16_ATI = 0x881D; + public const int INTENSITY_FLOAT32_APPLE = 0x8817; + public const int INTENSITY_FLOAT32_ATI = 0x8817; + public const int INTENSITY_SNORM = 0x9013; + public const int INTERLACE_OML = 0x8980; + public const int INTERLACE_READ_INGR = 0x8568; + public const int INTERLACE_READ_OML = 0x8981; + public const int INTERLACE_SGIX = 0x8094; + public const int INTERLEAVED_ATTRIBS = 0x8C8C; + public const int INTERLEAVED_ATTRIBS_EXT = 0x8C8C; + public const int INTERLEAVED_ATTRIBS_NV = 0x8C8C; + public const int INTERNALFORMAT_ALPHA_SIZE = 0x8274; + public const int INTERNALFORMAT_ALPHA_TYPE = 0x827B; + public const int INTERNALFORMAT_BLUE_SIZE = 0x8273; + public const int INTERNALFORMAT_BLUE_TYPE = 0x827A; + public const int INTERNALFORMAT_DEPTH_SIZE = 0x8275; + public const int INTERNALFORMAT_DEPTH_TYPE = 0x827C; + public const int INTERNALFORMAT_GREEN_SIZE = 0x8272; + public const int INTERNALFORMAT_GREEN_TYPE = 0x8279; + public const int INTERNALFORMAT_PREFERRED = 0x8270; + public const int INTERNALFORMAT_RED_SIZE = 0x8271; + public const int INTERNALFORMAT_RED_TYPE = 0x8278; + public const int INTERNALFORMAT_SHARED_SIZE = 0x8277; + public const int INTERNALFORMAT_STENCIL_SIZE = 0x8276; + public const int INTERNALFORMAT_STENCIL_TYPE = 0x827D; + public const int INTERNALFORMAT_SUPPORTED = 0x826F; + public const int INTERPOLATE_ARB = 0x8575; + public const int INTERPOLATE_EXT = 0x8575; + public const int INT_2_10_10_10_REV = 0x8D9F; + public const int INT_IMAGE_1D = 0x9057; + public const int INT_IMAGE_1D_ARRAY = 0x905D; + public const int INT_IMAGE_1D_ARRAY_EXT = 0x905D; + public const int INT_IMAGE_1D_EXT = 0x9057; + public const int INT_IMAGE_2D = 0x9058; + public const int INT_IMAGE_2D_ARRAY = 0x905E; + public const int INT_IMAGE_2D_ARRAY_EXT = 0x905E; + public const int INT_IMAGE_2D_EXT = 0x9058; + public const int INT_IMAGE_2D_MULTISAMPLE = 0x9060; + public const int INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061; + public const int INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9061; + public const int INT_IMAGE_2D_MULTISAMPLE_EXT = 0x9060; + public const int INT_IMAGE_2D_RECT = 0x905A; + public const int INT_IMAGE_2D_RECT_EXT = 0x905A; + public const int INT_IMAGE_3D = 0x9059; + public const int INT_IMAGE_3D_EXT = 0x9059; + public const int INT_IMAGE_BUFFER = 0x905C; + public const int INT_IMAGE_BUFFER_EXT = 0x905C; + public const int INT_IMAGE_CUBE = 0x905B; + public const int INT_IMAGE_CUBE_EXT = 0x905B; + public const int INT_IMAGE_CUBE_MAP_ARRAY = 0x905F; + public const int INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x905F; + public const int INT_SAMPLER_1D = 0x8DC9; + public const int INT_SAMPLER_1D_ARRAY = 0x8DCE; + public const int INT_SAMPLER_1D_ARRAY_EXT = 0x8DCE; + public const int INT_SAMPLER_1D_EXT = 0x8DC9; + public const int INT_SAMPLER_2D = 0x8DCA; + public const int INT_SAMPLER_2D_ARRAY = 0x8DCF; + public const int INT_SAMPLER_2D_ARRAY_EXT = 0x8DCF; + public const int INT_SAMPLER_2D_EXT = 0x8DCA; + public const int INT_SAMPLER_2D_MULTISAMPLE = 0x9109; + public const int INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C; + public const int INT_SAMPLER_2D_RECT = 0x8DCD; + public const int INT_SAMPLER_2D_RECT_EXT = 0x8DCD; + public const int INT_SAMPLER_3D = 0x8DCB; + public const int INT_SAMPLER_3D_EXT = 0x8DCB; + public const int INT_SAMPLER_BUFFER = 0x8DD0; + public const int INT_SAMPLER_BUFFER_AMD = 0x9002; + public const int INT_SAMPLER_BUFFER_EXT = 0x8DD0; + public const int INT_SAMPLER_CUBE = 0x8DCC; + public const int INT_SAMPLER_CUBE_EXT = 0x8DCC; + public const int INT_SAMPLER_CUBE_MAP_ARRAY = 0x900E; + public const int INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900E; + public const int INT_SAMPLER_RENDERBUFFER_NV = 0x8E57; + public const int INT_VEC2 = 0x8B53; + public const int INT_VEC2_ARB = 0x8B53; + public const int INT_VEC3 = 0x8B54; + public const int INT_VEC3_ARB = 0x8B54; + public const int INT_VEC4 = 0x8B55; + public const int INT_VEC4_ARB = 0x8B55; + public const int INVALID_ENUM = 0x0500; + public const int INVALID_FRAMEBUFFER_OPERATION = 0x0506; + public const int INVALID_FRAMEBUFFER_OPERATION_EXT = 0x0506; + public const uint INVALID_INDEX = 0xFFFFFFFF; + public const int INVALID_OPERATION = 0x0502; + public const int INVALID_VALUE = 0x0501; + public const int INVARIANT_DATATYPE_EXT = 0x87EB; + public const int INVARIANT_EXT = 0x87C2; + public const int INVARIANT_VALUE_EXT = 0x87EA; + public const int INVERSE_NV = 0x862B; + public const int INVERSE_TRANSPOSE_NV = 0x862D; + public const int INVERT = 0x150A; + public const int INVERTED_SCREEN_W_REND = 0x8491; + public const int INVERT_OVG_NV = 0x92B4; + public const int INVERT_RGB_NV = 0x92A3; + public const int IR_INSTRUMENT1_SGIX = 0x817F; + public const int ISOLINES = 0x8E7A; + public const int IS_PER_PATCH = 0x92E7; + public const int IS_ROW_MAJOR = 0x9300; + public const int ITALIC_BIT_NV = 0x02; + public const int IUI_N3F_V2F_EXT = 0x81AF; + public const int IUI_N3F_V3F_EXT = 0x81B0; + public const int IUI_V2F_EXT = 0x81AD; + public const int IUI_V3F_EXT = 0x81AE; + public const int KEEP = 0x1E00; + public const int LARGE_CCW_ARC_TO_NV = 0x16; + public const int LARGE_CW_ARC_TO_NV = 0x18; + public const int LAST_VERTEX_CONVENTION = 0x8E4E; + public const int LAST_VERTEX_CONVENTION_EXT = 0x8E4E; + public const int LAST_VIDEO_CAPTURE_STATUS_NV = 0x9027; + public const int LAYER_NV = 0x8DAA; + public const int LAYER_PROVOKING_VERTEX = 0x825E; + public const int LAYOUT_COLOR_ATTACHMENT_EXT = 0x958E; + public const int LAYOUT_DEFAULT_INTEL = 0; + public const int LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT = 0x9531; + public const int LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT = 0x9530; + public const int LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT = 0x958F; + public const int LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT = 0x9590; + public const int LAYOUT_GENERAL_EXT = 0x958D; + public const int LAYOUT_LINEAR_CPU_CACHED_INTEL = 2; + public const int LAYOUT_LINEAR_INTEL = 1; + public const int LAYOUT_SHADER_READ_ONLY_EXT = 0x9591; + public const int LAYOUT_TRANSFER_DST_EXT = 0x9593; + public const int LAYOUT_TRANSFER_SRC_EXT = 0x9592; + public const int LEFT = 0x0406; + public const int LEQUAL = 0x0203; + public const int LERP_ATI = 0x8969; + public const int LESS = 0x0201; + public const int LGPU_SEPARATE_STORAGE_BIT_NVX = 0x0800; + public const int LIGHTEN_KHR = 0x9298; + public const int LIGHTEN_NV = 0x9298; + public const int LIGHT_ENV_MODE_SGIX = 0x8407; + public const int LIGHT_MODEL_COLOR_CONTROL_EXT = 0x81F8; + public const int LIGHT_MODEL_SPECULAR_VECTOR_APPLE = 0x85B0; + public const int LINE = 0x1B01; + public const int LINEAR = 0x2601; + public const int LINEARBURN_NV = 0x92A5; + public const int LINEARDODGE_NV = 0x92A4; + public const int LINEARLIGHT_NV = 0x92A7; + public const int LINEAR_CLIPMAP_LINEAR_SGIX = 0x8170; + public const int LINEAR_CLIPMAP_NEAREST_SGIX = 0x844F; + public const int LINEAR_DETAIL_ALPHA_SGIS = 0x8098; + public const int LINEAR_DETAIL_COLOR_SGIS = 0x8099; + public const int LINEAR_DETAIL_SGIS = 0x8097; + public const int LINEAR_MIPMAP_LINEAR = 0x2703; + public const int LINEAR_MIPMAP_NEAREST = 0x2701; + public const int LINEAR_SHARPEN_ALPHA_SGIS = 0x80AE; + public const int LINEAR_SHARPEN_COLOR_SGIS = 0x80AF; + public const int LINEAR_SHARPEN_SGIS = 0x80AD; + public const int LINEAR_TILING_EXT = 0x9585; + public const int LINES = 0x0001; + public const int LINES_ADJACENCY = 0x000A; + public const int LINES_ADJACENCY_ARB = 0x000A; + public const int LINES_ADJACENCY_EXT = 0x000A; + public const int LINE_LOOP = 0x0002; + public const int LINE_SMOOTH = 0x0B20; + public const int LINE_SMOOTH_HINT = 0x0C52; + public const int LINE_STRIP = 0x0003; + public const int LINE_STRIP_ADJACENCY = 0x000B; + public const int LINE_STRIP_ADJACENCY_ARB = 0x000B; + public const int LINE_STRIP_ADJACENCY_EXT = 0x000B; + public const int LINE_TO_NV = 0x04; + public const int LINE_WIDTH = 0x0B21; + public const int LINE_WIDTH_COMMAND_NV = 0x000D; + public const int LINE_WIDTH_GRANULARITY = 0x0B23; + public const int LINE_WIDTH_RANGE = 0x0B22; + public const int LINK_STATUS = 0x8B82; + public const int LIST_PRIORITY_SGIX = 0x8182; + public const int LOCAL_CONSTANT_DATATYPE_EXT = 0x87ED; + public const int LOCAL_CONSTANT_EXT = 0x87C3; + public const int LOCAL_CONSTANT_VALUE_EXT = 0x87EC; + public const int LOCAL_EXT = 0x87C4; + public const int LOCATION = 0x930E; + public const int LOCATION_COMPONENT = 0x934A; + public const int LOCATION_INDEX = 0x930F; + public const int LOGIC_OP_MODE = 0x0BF0; + public const int LOSE_CONTEXT_ON_RESET = 0x8252; + public const int LOSE_CONTEXT_ON_RESET_ARB = 0x8252; + public const int LOWER_LEFT = 0x8CA1; + public const int LOW_FLOAT = 0x8DF0; + public const int LOW_INT = 0x8DF3; + public const int LO_BIAS_NV = 0x8715; + public const int LO_SCALE_NV = 0x870F; + public const int LUID_SIZE_EXT = 8; + public const int LUMINANCE12_ALPHA12_EXT = 0x8047; + public const int LUMINANCE12_ALPHA4_EXT = 0x8046; + public const int LUMINANCE12_EXT = 0x8041; + public const int LUMINANCE16F_ARB = 0x881E; + public const int LUMINANCE16F_EXT = 0x881E; + public const int LUMINANCE16I_EXT = 0x8D8C; + public const int LUMINANCE16UI_EXT = 0x8D7A; + public const int LUMINANCE16_ALPHA16_EXT = 0x8048; + public const int LUMINANCE16_ALPHA16_SNORM = 0x901A; + public const int LUMINANCE16_EXT = 0x8042; + public const int LUMINANCE16_SNORM = 0x9019; + public const int LUMINANCE32F_ARB = 0x8818; + public const int LUMINANCE32F_EXT = 0x8818; + public const int LUMINANCE32I_EXT = 0x8D86; + public const int LUMINANCE32UI_EXT = 0x8D74; + public const int LUMINANCE4_ALPHA4_EXT = 0x8043; + public const int LUMINANCE4_EXT = 0x803F; + public const int LUMINANCE6_ALPHA2_EXT = 0x8044; + public const int LUMINANCE8I_EXT = 0x8D92; + public const int LUMINANCE8UI_EXT = 0x8D80; + public const int LUMINANCE8_ALPHA8_EXT = 0x8045; + public const int LUMINANCE8_ALPHA8_SNORM = 0x9016; + public const int LUMINANCE8_EXT = 0x8040; + public const int LUMINANCE8_SNORM = 0x9015; + public const int LUMINANCE_ALPHA16F_ARB = 0x881F; + public const int LUMINANCE_ALPHA16F_EXT = 0x881F; + public const int LUMINANCE_ALPHA16I_EXT = 0x8D8D; + public const int LUMINANCE_ALPHA16UI_EXT = 0x8D7B; + public const int LUMINANCE_ALPHA32F_ARB = 0x8819; + public const int LUMINANCE_ALPHA32F_EXT = 0x8819; + public const int LUMINANCE_ALPHA32I_EXT = 0x8D87; + public const int LUMINANCE_ALPHA32UI_EXT = 0x8D75; + public const int LUMINANCE_ALPHA8I_EXT = 0x8D93; + public const int LUMINANCE_ALPHA8UI_EXT = 0x8D81; + public const int LUMINANCE_ALPHA_FLOAT16_APPLE = 0x881F; + public const int LUMINANCE_ALPHA_FLOAT16_ATI = 0x881F; + public const int LUMINANCE_ALPHA_FLOAT32_APPLE = 0x8819; + public const int LUMINANCE_ALPHA_FLOAT32_ATI = 0x8819; + public const int LUMINANCE_ALPHA_INTEGER_EXT = 0x8D9D; + public const int LUMINANCE_ALPHA_SNORM = 0x9012; + public const int LUMINANCE_FLOAT16_APPLE = 0x881E; + public const int LUMINANCE_FLOAT16_ATI = 0x881E; + public const int LUMINANCE_FLOAT32_APPLE = 0x8818; + public const int LUMINANCE_FLOAT32_ATI = 0x8818; + public const int LUMINANCE_INTEGER_EXT = 0x8D9C; + public const int LUMINANCE_SNORM = 0x9011; + public const int MAD_ATI = 0x8968; + public const int MAGNITUDE_BIAS_NV = 0x8718; + public const int MAGNITUDE_SCALE_NV = 0x8712; + public const int MAJOR_VERSION = 0x821B; + public const int MANUAL_GENERATE_MIPMAP = 0x8294; + public const int MAP1_BINORMAL_EXT = 0x8446; + public const int MAP1_TANGENT_EXT = 0x8444; + public const int MAP1_VERTEX_ATTRIB0_4_NV = 0x8660; + public const int MAP1_VERTEX_ATTRIB10_4_NV = 0x866A; + public const int MAP1_VERTEX_ATTRIB11_4_NV = 0x866B; + public const int MAP1_VERTEX_ATTRIB12_4_NV = 0x866C; + public const int MAP1_VERTEX_ATTRIB13_4_NV = 0x866D; + public const int MAP1_VERTEX_ATTRIB14_4_NV = 0x866E; + public const int MAP1_VERTEX_ATTRIB15_4_NV = 0x866F; + public const int MAP1_VERTEX_ATTRIB1_4_NV = 0x8661; + public const int MAP1_VERTEX_ATTRIB2_4_NV = 0x8662; + public const int MAP1_VERTEX_ATTRIB3_4_NV = 0x8663; + public const int MAP1_VERTEX_ATTRIB4_4_NV = 0x8664; + public const int MAP1_VERTEX_ATTRIB5_4_NV = 0x8665; + public const int MAP1_VERTEX_ATTRIB6_4_NV = 0x8666; + public const int MAP1_VERTEX_ATTRIB7_4_NV = 0x8667; + public const int MAP1_VERTEX_ATTRIB8_4_NV = 0x8668; + public const int MAP1_VERTEX_ATTRIB9_4_NV = 0x8669; + public const int MAP2_BINORMAL_EXT = 0x8447; + public const int MAP2_TANGENT_EXT = 0x8445; + public const int MAP2_VERTEX_ATTRIB0_4_NV = 0x8670; + public const int MAP2_VERTEX_ATTRIB10_4_NV = 0x867A; + public const int MAP2_VERTEX_ATTRIB11_4_NV = 0x867B; + public const int MAP2_VERTEX_ATTRIB12_4_NV = 0x867C; + public const int MAP2_VERTEX_ATTRIB13_4_NV = 0x867D; + public const int MAP2_VERTEX_ATTRIB14_4_NV = 0x867E; + public const int MAP2_VERTEX_ATTRIB15_4_NV = 0x867F; + public const int MAP2_VERTEX_ATTRIB1_4_NV = 0x8671; + public const int MAP2_VERTEX_ATTRIB2_4_NV = 0x8672; + public const int MAP2_VERTEX_ATTRIB3_4_NV = 0x8673; + public const int MAP2_VERTEX_ATTRIB4_4_NV = 0x8674; + public const int MAP2_VERTEX_ATTRIB5_4_NV = 0x8675; + public const int MAP2_VERTEX_ATTRIB6_4_NV = 0x8676; + public const int MAP2_VERTEX_ATTRIB7_4_NV = 0x8677; + public const int MAP2_VERTEX_ATTRIB8_4_NV = 0x8678; + public const int MAP2_VERTEX_ATTRIB9_4_NV = 0x8679; + public const int MAP_ATTRIB_U_ORDER_NV = 0x86C3; + public const int MAP_ATTRIB_V_ORDER_NV = 0x86C4; + public const int MAP_COHERENT_BIT = 0x0080; + public const int MAP_FLUSH_EXPLICIT_BIT = 0x0010; + public const int MAP_INVALIDATE_BUFFER_BIT = 0x0008; + public const int MAP_INVALIDATE_RANGE_BIT = 0x0004; + public const int MAP_PERSISTENT_BIT = 0x0040; + public const int MAP_READ_BIT = 0x0001; + public const int MAP_TESSELLATION_NV = 0x86C2; + public const int MAP_UNSYNCHRONIZED_BIT = 0x0020; + public const int MAP_WRITE_BIT = 0x0002; + public const int MATERIAL_SIDE_HINT_PGI = 0x1A22C; + public const int MATRIX0_ARB = 0x88C0; + public const int MATRIX0_NV = 0x8630; + public const int MATRIX10_ARB = 0x88CA; + public const int MATRIX11_ARB = 0x88CB; + public const int MATRIX12_ARB = 0x88CC; + public const int MATRIX13_ARB = 0x88CD; + public const int MATRIX14_ARB = 0x88CE; + public const int MATRIX15_ARB = 0x88CF; + public const int MATRIX16_ARB = 0x88D0; + public const int MATRIX17_ARB = 0x88D1; + public const int MATRIX18_ARB = 0x88D2; + public const int MATRIX19_ARB = 0x88D3; + public const int MATRIX1_ARB = 0x88C1; + public const int MATRIX1_NV = 0x8631; + public const int MATRIX20_ARB = 0x88D4; + public const int MATRIX21_ARB = 0x88D5; + public const int MATRIX22_ARB = 0x88D6; + public const int MATRIX23_ARB = 0x88D7; + public const int MATRIX24_ARB = 0x88D8; + public const int MATRIX25_ARB = 0x88D9; + public const int MATRIX26_ARB = 0x88DA; + public const int MATRIX27_ARB = 0x88DB; + public const int MATRIX28_ARB = 0x88DC; + public const int MATRIX29_ARB = 0x88DD; + public const int MATRIX2_ARB = 0x88C2; + public const int MATRIX2_NV = 0x8632; + public const int MATRIX30_ARB = 0x88DE; + public const int MATRIX31_ARB = 0x88DF; + public const int MATRIX3_ARB = 0x88C3; + public const int MATRIX3_NV = 0x8633; + public const int MATRIX4_ARB = 0x88C4; + public const int MATRIX4_NV = 0x8634; + public const int MATRIX5_ARB = 0x88C5; + public const int MATRIX5_NV = 0x8635; + public const int MATRIX6_ARB = 0x88C6; + public const int MATRIX6_NV = 0x8636; + public const int MATRIX7_ARB = 0x88C7; + public const int MATRIX7_NV = 0x8637; + public const int MATRIX8_ARB = 0x88C8; + public const int MATRIX9_ARB = 0x88C9; + public const int MATRIX_EXT = 0x87C0; + public const int MATRIX_INDEX_ARRAY_ARB = 0x8844; + public const int MATRIX_INDEX_ARRAY_POINTER_ARB = 0x8849; + public const int MATRIX_INDEX_ARRAY_SIZE_ARB = 0x8846; + public const int MATRIX_INDEX_ARRAY_STRIDE_ARB = 0x8848; + public const int MATRIX_INDEX_ARRAY_TYPE_ARB = 0x8847; + public const int MATRIX_PALETTE_ARB = 0x8840; + public const int MATRIX_STRIDE = 0x92FF; + public const int MAT_AMBIENT_AND_DIFFUSE_BIT_PGI = 0x00200000; + public const int MAT_AMBIENT_BIT_PGI = 0x00100000; + public const int MAT_COLOR_INDEXES_BIT_PGI = 0x01000000; + public const int MAT_DIFFUSE_BIT_PGI = 0x00400000; + public const int MAT_EMISSION_BIT_PGI = 0x00800000; + public const int MAT_SHININESS_BIT_PGI = 0x02000000; + public const int MAT_SPECULAR_BIT_PGI = 0x04000000; + public const int MAX = 0x8008; + public const int MAX_3D_TEXTURE_SIZE = 0x8073; + public const int MAX_3D_TEXTURE_SIZE_EXT = 0x8073; + public const int MAX_4D_TEXTURE_SIZE_SGIS = 0x8138; + public const int MAX_ACTIVE_LIGHTS_SGIX = 0x8405; + public const int MAX_ARRAY_TEXTURE_LAYERS = 0x88FF; + public const int MAX_ARRAY_TEXTURE_LAYERS_EXT = 0x88FF; + public const int MAX_ASYNC_DRAW_PIXELS_SGIX = 0x8360; + public const int MAX_ASYNC_HISTOGRAM_SGIX = 0x832D; + public const int MAX_ASYNC_READ_PIXELS_SGIX = 0x8361; + public const int MAX_ASYNC_TEX_IMAGE_SGIX = 0x835F; + public const int MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC; + public const int MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8; + public const int MAX_BINDABLE_UNIFORM_SIZE_EXT = 0x8DED; + public const int MAX_CLIPMAP_DEPTH_SGIX = 0x8177; + public const int MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX = 0x8178; + public const int MAX_CLIP_DISTANCES = 0x0D32; + public const int MAX_COARSE_FRAGMENT_SAMPLES_NV = 0x955F; + public const int MAX_COLOR_ATTACHMENTS = 0x8CDF; + public const int MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF; + public const int MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD = 0x91B3; + public const int MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD = 0x91B4; + public const int MAX_COLOR_MATRIX_STACK_DEPTH_SGI = 0x80B3; + public const int MAX_COLOR_TEXTURE_SAMPLES = 0x910E; + public const int MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7; + public const int MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1; + public const int MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 0x82FA; + public const int MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 0x8266; + public const int MAX_COMBINED_DIMENSIONS = 0x8282; + public const int MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33; + public const int MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32; + public const int MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF; + public const int MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39; + public const int MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT = 0x8F39; + public const int MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV = 0x8E67; + public const int MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 0x8F39; + public const int MAX_COMBINED_SHADER_STORAGE_BLOCKS = 0x90DC; + public const int MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV = 0x8E6F; + public const int MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E; + public const int MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F; + public const int MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; + public const int MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB = 0x8B4D; + public const int MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E; + public const int MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31; + public const int MAX_COMPUTE_ATOMIC_COUNTERS = 0x8265; + public const int MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 0x8264; + public const int MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB = 0x90EB; + public const int MAX_COMPUTE_FIXED_GROUP_SIZE_ARB = 0x91BF; + public const int MAX_COMPUTE_IMAGE_UNIFORMS = 0x91BD; + public const int MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 0x90DB; + public const int MAX_COMPUTE_SHARED_MEMORY_SIZE = 0x8262; + public const int MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 0x91BC; + public const int MAX_COMPUTE_UNIFORM_BLOCKS = 0x91BB; + public const int MAX_COMPUTE_UNIFORM_COMPONENTS = 0x8263; + public const int MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB = 0x9344; + public const int MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB = 0x9345; + public const int MAX_COMPUTE_WORK_GROUP_COUNT = 0x91BE; + public const int MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 0x90EB; + public const int MAX_COMPUTE_WORK_GROUP_SIZE = 0x91BF; + public const int MAX_CONVOLUTION_HEIGHT_EXT = 0x801B; + public const int MAX_CONVOLUTION_WIDTH_EXT = 0x801A; + public const int MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; + public const int MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 0x851C; + public const int MAX_CUBE_MAP_TEXTURE_SIZE_EXT = 0x851C; + public const int MAX_CULL_DISTANCES = 0x82F9; + public const int MAX_DEBUG_GROUP_STACK_DEPTH = 0x826C; + public const int MAX_DEBUG_LOGGED_MESSAGES = 0x9144; + public const int MAX_DEBUG_LOGGED_MESSAGES_AMD = 0x9144; + public const int MAX_DEBUG_LOGGED_MESSAGES_ARB = 0x9144; + public const int MAX_DEBUG_MESSAGE_LENGTH = 0x9143; + public const int MAX_DEBUG_MESSAGE_LENGTH_AMD = 0x9143; + public const int MAX_DEBUG_MESSAGE_LENGTH_ARB = 0x9143; + public const int MAX_DEEP_3D_TEXTURE_DEPTH_NV = 0x90D1; + public const int MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV = 0x90D0; + public const int MAX_DEFORMATION_ORDER_SGIX = 0x8197; + public const int MAX_DEPTH = 0x8280; + public const int MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD = 0x91B5; + public const int MAX_DEPTH_TEXTURE_SAMPLES = 0x910F; + public const int MAX_DETACHED_BUFFERS_NV = 0x95AD; + public const int MAX_DETACHED_TEXTURES_NV = 0x95AC; + public const int MAX_DRAW_BUFFERS = 0x8824; + public const int MAX_DRAW_BUFFERS_ARB = 0x8824; + public const int MAX_DRAW_BUFFERS_ATI = 0x8824; + public const int MAX_DRAW_MESH_TASKS_COUNT_NV = 0x953D; + public const int MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC; + public const int MAX_ELEMENTS_INDICES = 0x80E9; + public const int MAX_ELEMENTS_INDICES_EXT = 0x80E9; + public const int MAX_ELEMENTS_VERTICES = 0x80E8; + public const int MAX_ELEMENTS_VERTICES_EXT = 0x80E8; + public const int MAX_ELEMENT_INDEX = 0x8D6B; + public const int MAX_EXT = 0x8008; + public const int MAX_FOG_FUNC_POINTS_SGIS = 0x812C; + public const int MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6; + public const int MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0; + public const int MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT = 0x8DE3; + public const int MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE; + public const int MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125; + public const int MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C; + public const int MAX_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5C; + public const int MAX_FRAGMENT_LIGHTS_SGIX = 0x8404; + public const int MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV = 0x8868; + public const int MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 0x90DA; + public const int MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D; + public const int MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49; + public const int MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB = 0x8B49; + public const int MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; + public const int MAX_FRAMEBUFFER_HEIGHT = 0x9316; + public const int MAX_FRAMEBUFFER_LAYERS = 0x9317; + public const int MAX_FRAMEBUFFER_SAMPLES = 0x9318; + public const int MAX_FRAMEBUFFER_WIDTH = 0x9315; + public const int MAX_FRAMEZOOM_FACTOR_SGIX = 0x818D; + public const int MAX_GENERAL_COMBINERS_NV = 0x854D; + public const int MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5; + public const int MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF; + public const int MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT = 0x8DE4; + public const int MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD; + public const int MAX_GEOMETRY_INPUT_COMPONENTS = 0x9123; + public const int MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124; + public const int MAX_GEOMETRY_OUTPUT_VERTICES = 0x8DE0; + public const int MAX_GEOMETRY_OUTPUT_VERTICES_ARB = 0x8DE0; + public const int MAX_GEOMETRY_OUTPUT_VERTICES_EXT = 0x8DE0; + public const int MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV = 0x8E5A; + public const int MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A; + public const int MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 0x90D7; + public const int MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29; + public const int MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB = 0x8C29; + public const int MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT = 0x8C29; + public const int MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1; + public const int MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB = 0x8DE1; + public const int MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT = 0x8DE1; + public const int MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C; + public const int MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF; + public const int MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB = 0x8DDF; + public const int MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT = 0x8DDF; + public const int MAX_GEOMETRY_VARYING_COMPONENTS_ARB = 0x8DDD; + public const int MAX_GEOMETRY_VARYING_COMPONENTS_EXT = 0x8DDD; + public const int MAX_HEIGHT = 0x827F; + public const int MAX_IMAGE_SAMPLES = 0x906D; + public const int MAX_IMAGE_SAMPLES_EXT = 0x906D; + public const int MAX_IMAGE_UNITS = 0x8F38; + public const int MAX_IMAGE_UNITS_EXT = 0x8F38; + public const int MAX_INTEGER_SAMPLES = 0x9110; + public const int MAX_LABEL_LENGTH = 0x82E8; + public const int MAX_LAYERS = 0x8281; + public const int MAX_LGPU_GPUS_NVX = 0x92BA; + public const int MAX_MAP_TESSELLATION_NV = 0x86D6; + public const int MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = 0x8841; + public const int MAX_MESH_ATOMIC_COUNTERS_NV = 0x8E65; + public const int MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV = 0x8E64; + public const int MAX_MESH_IMAGE_UNIFORMS_NV = 0x8E62; + public const int MAX_MESH_OUTPUT_PRIMITIVES_NV = 0x9539; + public const int MAX_MESH_OUTPUT_VERTICES_NV = 0x9538; + public const int MAX_MESH_SHADER_STORAGE_BLOCKS_NV = 0x8E66; + public const int MAX_MESH_TEXTURE_IMAGE_UNITS_NV = 0x8E61; + public const int MAX_MESH_TOTAL_MEMORY_SIZE_NV = 0x9536; + public const int MAX_MESH_UNIFORM_BLOCKS_NV = 0x8E60; + public const int MAX_MESH_UNIFORM_COMPONENTS_NV = 0x8E63; + public const int MAX_MESH_VIEWS_NV = 0x9557; + public const int MAX_MESH_WORK_GROUP_INVOCATIONS_NV = 0x95A2; + public const int MAX_MESH_WORK_GROUP_SIZE_NV = 0x953B; + public const int MAX_MULTISAMPLE_COVERAGE_MODES_NV = 0x8E11; + public const int MAX_NAME_LENGTH = 0x92F6; + public const int MAX_NUM_ACTIVE_VARIABLES = 0x92F7; + public const int MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8; + public const int MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CA; + public const int MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT = 0x87CD; + public const int MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT = 0x87CE; + public const int MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87CC; + public const int MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT = 0x87CB; + public const int MAX_PALETTE_MATRICES_ARB = 0x8842; + public const int MAX_PATCH_VERTICES = 0x8E7D; + public const int MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8337; + public const int MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F1; + public const int MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B1; + public const int MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x880B; + public const int MAX_PROGRAM_ATTRIBS_ARB = 0x88AD; + public const int MAX_PROGRAM_ATTRIB_COMPONENTS_NV = 0x8908; + public const int MAX_PROGRAM_CALL_DEPTH_NV = 0x88F5; + public const int MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5; + public const int MAX_PROGRAM_EXEC_INSTRUCTIONS_NV = 0x88F4; + public const int MAX_PROGRAM_GENERIC_ATTRIBS_NV = 0x8DA5; + public const int MAX_PROGRAM_GENERIC_RESULTS_NV = 0x8DA6; + public const int MAX_PROGRAM_IF_DEPTH_NV = 0x88F6; + public const int MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1; + public const int MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4; + public const int MAX_PROGRAM_LOOP_COUNT_NV = 0x88F8; + public const int MAX_PROGRAM_LOOP_DEPTH_NV = 0x88F7; + public const int MAX_PROGRAM_MATRICES_ARB = 0x862F; + public const int MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E; + public const int MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B3; + public const int MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x880E; + public const int MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF; + public const int MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3; + public const int MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB; + public const int MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7; + public const int MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x8810; + public const int MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F; + public const int MAX_PROGRAM_OUTPUT_VERTICES_NV = 0x8C27; + public const int MAX_PROGRAM_PARAMETERS_ARB = 0x88A9; + public const int MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV = 0x8DA0; + public const int MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV = 0x8DA1; + public const int MAX_PROGRAM_PATCH_ATTRIBS_NV = 0x86D8; + public const int MAX_PROGRAM_RESULT_COMPONENTS_NV = 0x8909; + public const int MAX_PROGRAM_SUBROUTINE_NUM_NV = 0x8F45; + public const int MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV = 0x8F44; + public const int MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5; + public const int MAX_PROGRAM_TEXEL_OFFSET = 0x8905; + public const int MAX_PROGRAM_TEXEL_OFFSET_EXT = 0x8905; + public const int MAX_PROGRAM_TEXEL_OFFSET_NV = 0x8905; + public const int MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB = 0x8F9F; + public const int MAX_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5F; + public const int MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5F; + public const int MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV = 0x8E5F; + public const int MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 0x880D; + public const int MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x880C; + public const int MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV = 0x8C28; + public const int MAX_RASTER_SAMPLES_EXT = 0x9329; + public const int MAX_RATIONAL_EVAL_ORDER_NV = 0x86D7; + public const int MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8; + public const int MAX_RECTANGLE_TEXTURE_SIZE_ARB = 0x84F8; + public const int MAX_RECTANGLE_TEXTURE_SIZE_NV = 0x84F8; + public const int MAX_RENDERBUFFER_SIZE = 0x84E8; + public const int MAX_RENDERBUFFER_SIZE_EXT = 0x84E8; + public const int MAX_SAMPLES = 0x8D57; + public const int MAX_SAMPLES_EXT = 0x8D57; + public const int MAX_SAMPLE_MASK_WORDS = 0x8E59; + public const int MAX_SAMPLE_MASK_WORDS_NV = 0x8E59; + public const int MAX_SERVER_WAIT_TIMEOUT = 0x9111; + public const int MAX_SHADER_BUFFER_ADDRESS_NV = 0x8F35; + public const int MAX_SHADER_COMPILER_THREADS_ARB = 0x91B0; + public const int MAX_SHADER_COMPILER_THREADS_KHR = 0x91B0; + public const int MAX_SHADER_STORAGE_BLOCK_SIZE = 0x90DE; + public const int MAX_SHADER_STORAGE_BUFFER_BINDINGS = 0x90DD; + public const int MAX_SHININESS_NV = 0x8504; + public const int MAX_SPARSE_3D_TEXTURE_SIZE_AMD = 0x9199; + public const int MAX_SPARSE_3D_TEXTURE_SIZE_ARB = 0x9199; + public const int MAX_SPARSE_ARRAY_TEXTURE_LAYERS = 0x919A; + public const int MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB = 0x919A; + public const int MAX_SPARSE_TEXTURE_SIZE_AMD = 0x9198; + public const int MAX_SPARSE_TEXTURE_SIZE_ARB = 0x9198; + public const int MAX_SPOT_EXPONENT_NV = 0x8505; + public const int MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV = 0x9349; + public const int MAX_SUBROUTINES = 0x8DE7; + public const int MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8; + public const int MAX_TASK_ATOMIC_COUNTERS_NV = 0x8E6D; + public const int MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV = 0x8E6C; + public const int MAX_TASK_IMAGE_UNIFORMS_NV = 0x8E6A; + public const int MAX_TASK_OUTPUT_COUNT_NV = 0x953A; + public const int MAX_TASK_SHADER_STORAGE_BLOCKS_NV = 0x8E6E; + public const int MAX_TASK_TEXTURE_IMAGE_UNITS_NV = 0x8E69; + public const int MAX_TASK_TOTAL_MEMORY_SIZE_NV = 0x9537; + public const int MAX_TASK_UNIFORM_BLOCKS_NV = 0x8E68; + public const int MAX_TASK_UNIFORM_COMPONENTS_NV = 0x8E6B; + public const int MAX_TASK_WORK_GROUP_INVOCATIONS_NV = 0x95A3; + public const int MAX_TASK_WORK_GROUP_SIZE_NV = 0x953C; + public const int MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3; + public const int MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD; + public const int MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB; + public const int MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C; + public const int MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83; + public const int MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 0x90D8; + public const int MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81; + public const int MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85; + public const int MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89; + public const int MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F; + public const int MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4; + public const int MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE; + public const int MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC; + public const int MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D; + public const int MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86; + public const int MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 0x90D9; + public const int MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82; + public const int MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A; + public const int MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80; + public const int MAX_TESS_GEN_LEVEL = 0x8E7E; + public const int MAX_TESS_PATCH_COMPONENTS = 0x8E84; + public const int MAX_TEXTURE_BUFFER_SIZE = 0x8C2B; + public const int MAX_TEXTURE_BUFFER_SIZE_ARB = 0x8C2B; + public const int MAX_TEXTURE_BUFFER_SIZE_EXT = 0x8C2B; + public const int MAX_TEXTURE_COORDS_ARB = 0x8871; + public const int MAX_TEXTURE_COORDS_NV = 0x8871; + public const int MAX_TEXTURE_IMAGE_UNITS = 0x8872; + public const int MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872; + public const int MAX_TEXTURE_IMAGE_UNITS_NV = 0x8872; + public const int MAX_TEXTURE_LOD_BIAS = 0x84FD; + public const int MAX_TEXTURE_LOD_BIAS_EXT = 0x84FD; + public const int MAX_TEXTURE_MAX_ANISOTROPY = 0x84FF; + public const int MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF; + public const int MAX_TEXTURE_SIZE = 0x0D33; + public const int MAX_TEXTURE_UNITS_ARB = 0x84E2; + public const int MAX_TIMELINE_SEMAPHORE_VALUE_DIFFERENCE_NV = 0x95B6; + public const int MAX_TRACK_MATRICES_NV = 0x862F; + public const int MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E; + public const int MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70; + public const int MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A; + public const int MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT = 0x8C8A; + public const int MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV = 0x8C8A; + public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B; + public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT = 0x8C8B; + public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = 0x8C8B; + public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80; + public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT = 0x8C80; + public const int MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV = 0x8C80; + public const int MAX_UNIFORM_BLOCK_SIZE = 0x8A30; + public const int MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F; + public const int MAX_UNIFORM_LOCATIONS = 0x826E; + public const int MAX_VARYING_COMPONENTS = 0x8B4B; + public const int MAX_VARYING_COMPONENTS_EXT = 0x8B4B; + public const int MAX_VARYING_FLOATS = 0x8B4B; + public const int MAX_VARYING_FLOATS_ARB = 0x8B4B; + public const int MAX_VARYING_VECTORS = 0x8DFC; + public const int MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV = 0x8520; + public const int MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2; + public const int MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC; + public const int MAX_VERTEX_ATTRIBS = 0x8869; + public const int MAX_VERTEX_ATTRIBS_ARB = 0x8869; + public const int MAX_VERTEX_ATTRIB_BINDINGS = 0x82DA; + public const int MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D9; + public const int MAX_VERTEX_ATTRIB_STRIDE = 0x82E5; + public const int MAX_VERTEX_BINDABLE_UNIFORMS_EXT = 0x8DE2; + public const int MAX_VERTEX_HINT_PGI = 0x1A22D; + public const int MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA; + public const int MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122; + public const int MAX_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87C5; + public const int MAX_VERTEX_SHADER_INVARIANTS_EXT = 0x87C7; + public const int MAX_VERTEX_SHADER_LOCALS_EXT = 0x87C9; + public const int MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87C8; + public const int MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0x90D6; + public const int MAX_VERTEX_SHADER_VARIANTS_EXT = 0x87C6; + public const int MAX_VERTEX_STREAMS = 0x8E71; + public const int MAX_VERTEX_STREAMS_ATI = 0x876B; + public const int MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; + public const int MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = 0x8B4C; + public const int MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B; + public const int MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A; + public const int MAX_VERTEX_UNIFORM_COMPONENTS_ARB = 0x8B4A; + public const int MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; + public const int MAX_VERTEX_UNITS_ARB = 0x86A4; + public const int MAX_VERTEX_VARYING_COMPONENTS_ARB = 0x8DDE; + public const int MAX_VERTEX_VARYING_COMPONENTS_EXT = 0x8DDE; + public const int MAX_VIEWPORTS = 0x825B; + public const int MAX_VIEWPORT_DIMS = 0x0D3A; + public const int MAX_VIEWS_OVR = 0x9631; + public const int MAX_WIDTH = 0x827E; + public const int MAX_WINDOW_RECTANGLES_EXT = 0x8F14; + public const int MEDIUM_FLOAT = 0x8DF1; + public const int MEDIUM_INT = 0x8DF4; + public const int MEMORY_ATTACHABLE_ALIGNMENT_NV = 0x95A6; + public const int MEMORY_ATTACHABLE_NV = 0x95A8; + public const int MEMORY_ATTACHABLE_SIZE_NV = 0x95A7; + public const int MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV = 0x9543; + public const int MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV = 0x92DF; + public const int MESH_OUTPUT_TYPE_NV = 0x957B; + public const int MESH_PRIMITIVES_OUT_NV = 0x957A; + public const int MESH_SHADER_BIT_NV = 0x00000040; + public const int MESH_SHADER_NV = 0x9559; + public const int MESH_SUBROUTINE_NV = 0x957C; + public const int MESH_SUBROUTINE_UNIFORM_NV = 0x957E; + public const int MESH_VERTICES_OUT_NV = 0x9579; + public const int MESH_WORK_GROUP_SIZE_NV = 0x953E; + public const int MIN = 0x8007; + public const int MINMAX_EXT = 0x802E; + public const int MINMAX_FORMAT_EXT = 0x802F; + public const int MINMAX_SINK_EXT = 0x8030; + public const int MINOR_VERSION = 0x821C; + public const int MINUS_CLAMPED_NV = 0x92B3; + public const int MINUS_NV = 0x929F; + public const int MIN_EXT = 0x8007; + public const int MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B; + public const int MIN_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5B; + public const int MIN_LOD_WARNING_AMD = 0x919C; + public const int MIN_MAP_BUFFER_ALIGNMENT = 0x90BC; + public const int MIN_PROGRAM_TEXEL_OFFSET = 0x8904; + public const int MIN_PROGRAM_TEXEL_OFFSET_EXT = 0x8904; + public const int MIN_PROGRAM_TEXEL_OFFSET_NV = 0x8904; + public const int MIN_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5E; + public const int MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5E; + public const int MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV = 0x8E5E; + public const int MIN_SAMPLE_SHADING_VALUE = 0x8C37; + public const int MIN_SAMPLE_SHADING_VALUE_ARB = 0x8C37; + public const int MIN_SPARSE_LEVEL_AMD = 0x919B; + public const int MIPMAP = 0x8293; + public const int MIRRORED_REPEAT = 0x8370; + public const int MIRRORED_REPEAT_ARB = 0x8370; + public const int MIRRORED_REPEAT_IBM = 0x8370; + public const int MIRROR_CLAMP_ATI = 0x8742; + public const int MIRROR_CLAMP_EXT = 0x8742; + public const int MIRROR_CLAMP_TO_BORDER_EXT = 0x8912; + public const int MIRROR_CLAMP_TO_EDGE = 0x8743; + public const int MIRROR_CLAMP_TO_EDGE_ATI = 0x8743; + public const int MIRROR_CLAMP_TO_EDGE_EXT = 0x8743; + public const int MITER_REVERT_NV = 0x90A7; + public const int MITER_TRUNCATE_NV = 0x90A8; + public const int MIXED_DEPTH_SAMPLES_SUPPORTED_NV = 0x932F; + public const int MIXED_STENCIL_SAMPLES_SUPPORTED_NV = 0x9330; + public const int MODELVIEW0_ARB = 0x1700; + public const int MODELVIEW0_EXT = 0x1700; + public const int MODELVIEW0_MATRIX_EXT = 0x0BA6; + public const int MODELVIEW0_STACK_DEPTH_EXT = 0x0BA3; + public const int MODELVIEW10_ARB = 0x872A; + public const int MODELVIEW11_ARB = 0x872B; + public const int MODELVIEW12_ARB = 0x872C; + public const int MODELVIEW13_ARB = 0x872D; + public const int MODELVIEW14_ARB = 0x872E; + public const int MODELVIEW15_ARB = 0x872F; + public const int MODELVIEW16_ARB = 0x8730; + public const int MODELVIEW17_ARB = 0x8731; + public const int MODELVIEW18_ARB = 0x8732; + public const int MODELVIEW19_ARB = 0x8733; + public const int MODELVIEW1_ARB = 0x850A; + public const int MODELVIEW1_EXT = 0x850A; + public const int MODELVIEW1_MATRIX_EXT = 0x8506; + public const int MODELVIEW1_STACK_DEPTH_EXT = 0x8502; + public const int MODELVIEW20_ARB = 0x8734; + public const int MODELVIEW21_ARB = 0x8735; + public const int MODELVIEW22_ARB = 0x8736; + public const int MODELVIEW23_ARB = 0x8737; + public const int MODELVIEW24_ARB = 0x8738; + public const int MODELVIEW25_ARB = 0x8739; + public const int MODELVIEW26_ARB = 0x873A; + public const int MODELVIEW27_ARB = 0x873B; + public const int MODELVIEW28_ARB = 0x873C; + public const int MODELVIEW29_ARB = 0x873D; + public const int MODELVIEW2_ARB = 0x8722; + public const int MODELVIEW30_ARB = 0x873E; + public const int MODELVIEW31_ARB = 0x873F; + public const int MODELVIEW3_ARB = 0x8723; + public const int MODELVIEW4_ARB = 0x8724; + public const int MODELVIEW5_ARB = 0x8725; + public const int MODELVIEW6_ARB = 0x8726; + public const int MODELVIEW7_ARB = 0x8727; + public const int MODELVIEW8_ARB = 0x8728; + public const int MODELVIEW9_ARB = 0x8729; + public const int MODELVIEW_PROJECTION_NV = 0x8629; + public const int MODULATE_ADD_ATI = 0x8744; + public const int MODULATE_SIGNED_ADD_ATI = 0x8745; + public const int MODULATE_SUBTRACT_ATI = 0x8746; + public const int MOVE_TO_CONTINUES_NV = 0x90B6; + public const int MOVE_TO_NV = 0x02; + public const int MOVE_TO_RESETS_NV = 0x90B5; + public const int MOV_ATI = 0x8961; + public const int MULTICAST_GPUS_NV = 0x92BA; + public const int MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9549; + public const int MULTIPLY_KHR = 0x9294; + public const int MULTIPLY_NV = 0x9294; + public const int MULTISAMPLE = 0x809D; + public const int MULTISAMPLES_NV = 0x9371; + public const int MULTISAMPLE_3DFX = 0x86B2; + public const int MULTISAMPLE_ARB = 0x809D; + public const int MULTISAMPLE_BIT_3DFX = 0x20000000; + public const int MULTISAMPLE_BIT_ARB = 0x20000000; + public const int MULTISAMPLE_BIT_EXT = 0x20000000; + public const int MULTISAMPLE_COVERAGE_MODES_NV = 0x8E12; + public const int MULTISAMPLE_EXT = 0x809D; + public const int MULTISAMPLE_FILTER_HINT_NV = 0x8534; + public const int MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB = 0x9382; + public const int MULTISAMPLE_LINE_WIDTH_RANGE_ARB = 0x9381; + public const int MULTISAMPLE_RASTERIZATION_ALLOWED_EXT = 0x932B; + public const int MULTISAMPLE_SGIS = 0x809D; + public const int MUL_ATI = 0x8964; + public const int MVP_MATRIX_EXT = 0x87E3; + public const int NAMED_STRING_LENGTH_ARB = 0x8DE9; + public const int NAMED_STRING_TYPE_ARB = 0x8DEA; + public const int NAME_LENGTH = 0x92F9; + public const int NAND = 0x150E; + public const int NATIVE_GRAPHICS_BEGIN_HINT_PGI = 0x1A203; + public const int NATIVE_GRAPHICS_END_HINT_PGI = 0x1A204; + public const int NATIVE_GRAPHICS_HANDLE_PGI = 0x1A202; + public const int NEAREST = 0x2600; + public const int NEAREST_CLIPMAP_LINEAR_SGIX = 0x844E; + public const int NEAREST_CLIPMAP_NEAREST_SGIX = 0x844D; + public const int NEAREST_MIPMAP_LINEAR = 0x2702; + public const int NEAREST_MIPMAP_NEAREST = 0x2700; + public const int NEGATE_BIT_ATI = 0x00000004; + public const int NEGATIVE_ONE_EXT = 0x87DF; + public const int NEGATIVE_ONE_TO_ONE = 0x935E; + public const int NEGATIVE_W_EXT = 0x87DC; + public const int NEGATIVE_X_EXT = 0x87D9; + public const int NEGATIVE_Y_EXT = 0x87DA; + public const int NEGATIVE_Z_EXT = 0x87DB; + public const int NEVER = 0x0200; + public const int NEXT_BUFFER_NV = -2; + public const int NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV = 0x9025; + public const int NICEST = 0x1102; + public const int NONE = 0; + public const int NOOP = 0x1505; + public const int NOP_COMMAND_NV = 0x0001; + public const int NOR = 0x1508; + public const int NORMALIZED_RANGE_EXT = 0x87E0; + public const int NORMAL_ARRAY_ADDRESS_NV = 0x8F22; + public const int NORMAL_ARRAY_BUFFER_BINDING_ARB = 0x8897; + public const int NORMAL_ARRAY_COUNT_EXT = 0x8080; + public const int NORMAL_ARRAY_EXT = 0x8075; + public const int NORMAL_ARRAY_LENGTH_NV = 0x8F2C; + public const int NORMAL_ARRAY_LIST_IBM = 103071; + public const int NORMAL_ARRAY_LIST_STRIDE_IBM = 103081; + public const int NORMAL_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F6; + public const int NORMAL_ARRAY_POINTER_EXT = 0x808F; + public const int NORMAL_ARRAY_STRIDE_EXT = 0x807F; + public const int NORMAL_ARRAY_TYPE_EXT = 0x807E; + public const int NORMAL_BIT_PGI = 0x08000000; + public const int NORMAL_MAP_ARB = 0x8511; + public const int NORMAL_MAP_EXT = 0x8511; + public const int NORMAL_MAP_NV = 0x8511; + public const int NOTEQUAL = 0x0205; + public const int NO_ERROR = 0; + public const int NO_RESET_NOTIFICATION = 0x8261; + public const int NO_RESET_NOTIFICATION_ARB = 0x8261; + public const int NUM_ACTIVE_VARIABLES = 0x9304; + public const int NUM_COMPATIBLE_SUBROUTINES = 0x8E4A; + public const int NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2; + public const int NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A2; + public const int NUM_DEVICE_UUIDS_EXT = 0x9596; + public const int NUM_EXTENSIONS = 0x821D; + public const int NUM_FILL_STREAMS_NV = 0x8E29; + public const int NUM_FRAGMENT_CONSTANTS_ATI = 0x896F; + public const int NUM_FRAGMENT_REGISTERS_ATI = 0x896E; + public const int NUM_GENERAL_COMBINERS_NV = 0x854E; + public const int NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI = 0x8973; + public const int NUM_INSTRUCTIONS_PER_PASS_ATI = 0x8971; + public const int NUM_INSTRUCTIONS_TOTAL_ATI = 0x8972; + public const int NUM_LOOPBACK_COMPONENTS_ATI = 0x8974; + public const int NUM_PASSES_ATI = 0x8970; + public const int NUM_PROGRAM_BINARY_FORMATS = 0x87FE; + public const int NUM_SAMPLE_COUNTS = 0x9380; + public const int NUM_SHADER_BINARY_FORMATS = 0x8DF9; + public const int NUM_SHADING_LANGUAGE_VERSIONS = 0x82E9; + public const int NUM_SPARSE_LEVELS_ARB = 0x91AA; + public const int NUM_SPIR_V_EXTENSIONS = 0x9554; + public const int NUM_SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B6; + public const int NUM_TILING_TYPES_EXT = 0x9582; + public const int NUM_VIDEO_CAPTURE_STREAMS_NV = 0x9024; + public const int NUM_VIRTUAL_PAGE_SIZES_ARB = 0x91A8; + public const int NUM_WINDOW_RECTANGLES_EXT = 0x8F15; + public const int OBJECT_ACTIVE_ATTRIBUTES_ARB = 0x8B89; + public const int OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB = 0x8B8A; + public const int OBJECT_ACTIVE_UNIFORMS_ARB = 0x8B86; + public const int OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB = 0x8B87; + public const int OBJECT_ATTACHED_OBJECTS_ARB = 0x8B85; + public const int OBJECT_BUFFER_SIZE_ATI = 0x8764; + public const int OBJECT_BUFFER_USAGE_ATI = 0x8765; + public const int OBJECT_COMPILE_STATUS_ARB = 0x8B81; + public const int OBJECT_DELETE_STATUS_ARB = 0x8B80; + public const int OBJECT_DISTANCE_TO_LINE_SGIS = 0x81F3; + public const int OBJECT_DISTANCE_TO_POINT_SGIS = 0x81F1; + public const int OBJECT_INFO_LOG_LENGTH_ARB = 0x8B84; + public const int OBJECT_LINE_SGIS = 0x81F7; + public const int OBJECT_LINK_STATUS_ARB = 0x8B82; + public const int OBJECT_POINT_SGIS = 0x81F5; + public const int OBJECT_SHADER_SOURCE_LENGTH_ARB = 0x8B88; + public const int OBJECT_SUBTYPE_ARB = 0x8B4F; + public const int OBJECT_TYPE = 0x9112; + public const int OBJECT_TYPE_ARB = 0x8B4E; + public const int OBJECT_VALIDATE_STATUS_ARB = 0x8B83; + public const int OCCLUSION_QUERY_EVENT_MASK_AMD = 0x874F; + public const int OCCLUSION_TEST_HP = 0x8165; + public const int OCCLUSION_TEST_RESULT_HP = 0x8166; + public const int OFFSET = 0x92FC; + public const int OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = 0x8856; + public const int OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8857; + public const int OFFSET_HILO_TEXTURE_2D_NV = 0x8854; + public const int OFFSET_HILO_TEXTURE_RECTANGLE_NV = 0x8855; + public const int OFFSET_PROJECTIVE_TEXTURE_2D_NV = 0x8850; + public const int OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = 0x8851; + public const int OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8852; + public const int OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = 0x8853; + public const int OFFSET_TEXTURE_2D_BIAS_NV = 0x86E3; + public const int OFFSET_TEXTURE_2D_MATRIX_NV = 0x86E1; + public const int OFFSET_TEXTURE_2D_NV = 0x86E8; + public const int OFFSET_TEXTURE_2D_SCALE_NV = 0x86E2; + public const int OFFSET_TEXTURE_BIAS_NV = 0x86E3; + public const int OFFSET_TEXTURE_MATRIX_NV = 0x86E1; + public const int OFFSET_TEXTURE_RECTANGLE_NV = 0x864C; + public const int OFFSET_TEXTURE_RECTANGLE_SCALE_NV = 0x864D; + public const int OFFSET_TEXTURE_SCALE_NV = 0x86E2; + public const int ONE = 1; + public const int ONE_EXT = 0x87DE; + public const int ONE_MINUS_CONSTANT_ALPHA = 0x8004; + public const int ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004; + public const int ONE_MINUS_CONSTANT_COLOR = 0x8002; + public const int ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002; + public const int ONE_MINUS_DST_ALPHA = 0x0305; + public const int ONE_MINUS_DST_COLOR = 0x0307; + public const int ONE_MINUS_SRC1_ALPHA = 0x88FB; + public const int ONE_MINUS_SRC1_COLOR = 0x88FA; + public const int ONE_MINUS_SRC_ALPHA = 0x0303; + public const int ONE_MINUS_SRC_COLOR = 0x0301; + public const int OPERAND0_ALPHA_ARB = 0x8598; + public const int OPERAND0_ALPHA_EXT = 0x8598; + public const int OPERAND0_RGB_ARB = 0x8590; + public const int OPERAND0_RGB_EXT = 0x8590; + public const int OPERAND1_ALPHA_ARB = 0x8599; + public const int OPERAND1_ALPHA_EXT = 0x8599; + public const int OPERAND1_RGB_ARB = 0x8591; + public const int OPERAND1_RGB_EXT = 0x8591; + public const int OPERAND2_ALPHA_ARB = 0x859A; + public const int OPERAND2_ALPHA_EXT = 0x859A; + public const int OPERAND2_RGB_ARB = 0x8592; + public const int OPERAND2_RGB_EXT = 0x8592; + public const int OPERAND3_ALPHA_NV = 0x859B; + public const int OPERAND3_RGB_NV = 0x8593; + public const int OPTIMAL_TILING_EXT = 0x9584; + public const int OP_ADD_EXT = 0x8787; + public const int OP_CLAMP_EXT = 0x878E; + public const int OP_CROSS_PRODUCT_EXT = 0x8797; + public const int OP_DOT3_EXT = 0x8784; + public const int OP_DOT4_EXT = 0x8785; + public const int OP_EXP_BASE_2_EXT = 0x8791; + public const int OP_FLOOR_EXT = 0x878F; + public const int OP_FRAC_EXT = 0x8789; + public const int OP_INDEX_EXT = 0x8782; + public const int OP_LOG_BASE_2_EXT = 0x8792; + public const int OP_MADD_EXT = 0x8788; + public const int OP_MAX_EXT = 0x878A; + public const int OP_MIN_EXT = 0x878B; + public const int OP_MOV_EXT = 0x8799; + public const int OP_MULTIPLY_MATRIX_EXT = 0x8798; + public const int OP_MUL_EXT = 0x8786; + public const int OP_NEGATE_EXT = 0x8783; + public const int OP_POWER_EXT = 0x8793; + public const int OP_RECIP_EXT = 0x8794; + public const int OP_RECIP_SQRT_EXT = 0x8795; + public const int OP_ROUND_EXT = 0x8790; + public const int OP_SET_GE_EXT = 0x878C; + public const int OP_SET_LT_EXT = 0x878D; + public const int OP_SUB_EXT = 0x8796; + public const int OR = 0x1507; + public const int OR_INVERTED = 0x150D; + public const int OR_REVERSE = 0x150B; + public const int OUTPUT_COLOR0_EXT = 0x879B; + public const int OUTPUT_COLOR1_EXT = 0x879C; + public const int OUTPUT_FOG_EXT = 0x87BD; + public const int OUTPUT_TEXTURE_COORD0_EXT = 0x879D; + public const int OUTPUT_TEXTURE_COORD10_EXT = 0x87A7; + public const int OUTPUT_TEXTURE_COORD11_EXT = 0x87A8; + public const int OUTPUT_TEXTURE_COORD12_EXT = 0x87A9; + public const int OUTPUT_TEXTURE_COORD13_EXT = 0x87AA; + public const int OUTPUT_TEXTURE_COORD14_EXT = 0x87AB; + public const int OUTPUT_TEXTURE_COORD15_EXT = 0x87AC; + public const int OUTPUT_TEXTURE_COORD16_EXT = 0x87AD; + public const int OUTPUT_TEXTURE_COORD17_EXT = 0x87AE; + public const int OUTPUT_TEXTURE_COORD18_EXT = 0x87AF; + public const int OUTPUT_TEXTURE_COORD19_EXT = 0x87B0; + public const int OUTPUT_TEXTURE_COORD1_EXT = 0x879E; + public const int OUTPUT_TEXTURE_COORD20_EXT = 0x87B1; + public const int OUTPUT_TEXTURE_COORD21_EXT = 0x87B2; + public const int OUTPUT_TEXTURE_COORD22_EXT = 0x87B3; + public const int OUTPUT_TEXTURE_COORD23_EXT = 0x87B4; + public const int OUTPUT_TEXTURE_COORD24_EXT = 0x87B5; + public const int OUTPUT_TEXTURE_COORD25_EXT = 0x87B6; + public const int OUTPUT_TEXTURE_COORD26_EXT = 0x87B7; + public const int OUTPUT_TEXTURE_COORD27_EXT = 0x87B8; + public const int OUTPUT_TEXTURE_COORD28_EXT = 0x87B9; + public const int OUTPUT_TEXTURE_COORD29_EXT = 0x87BA; + public const int OUTPUT_TEXTURE_COORD2_EXT = 0x879F; + public const int OUTPUT_TEXTURE_COORD30_EXT = 0x87BB; + public const int OUTPUT_TEXTURE_COORD31_EXT = 0x87BC; + public const int OUTPUT_TEXTURE_COORD3_EXT = 0x87A0; + public const int OUTPUT_TEXTURE_COORD4_EXT = 0x87A1; + public const int OUTPUT_TEXTURE_COORD5_EXT = 0x87A2; + public const int OUTPUT_TEXTURE_COORD6_EXT = 0x87A3; + public const int OUTPUT_TEXTURE_COORD7_EXT = 0x87A4; + public const int OUTPUT_TEXTURE_COORD8_EXT = 0x87A5; + public const int OUTPUT_TEXTURE_COORD9_EXT = 0x87A6; + public const int OUTPUT_VERTEX_EXT = 0x879A; + public const int OUT_OF_MEMORY = 0x0505; + public const int OVERLAY_KHR = 0x9296; + public const int OVERLAY_NV = 0x9296; + public const int PACK_ALIGNMENT = 0x0D05; + public const int PACK_CMYK_HINT_EXT = 0x800E; + public const int PACK_COMPRESSED_BLOCK_DEPTH = 0x912D; + public const int PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C; + public const int PACK_COMPRESSED_BLOCK_SIZE = 0x912E; + public const int PACK_COMPRESSED_BLOCK_WIDTH = 0x912B; + public const int PACK_IMAGE_DEPTH_SGIS = 0x8131; + public const int PACK_IMAGE_HEIGHT = 0x806C; + public const int PACK_IMAGE_HEIGHT_EXT = 0x806C; + public const int PACK_INVERT_MESA = 0x8758; + public const int PACK_LSB_FIRST = 0x0D01; + public const int PACK_RESAMPLE_OML = 0x8984; + public const int PACK_RESAMPLE_SGIX = 0x842E; + public const int PACK_ROW_BYTES_APPLE = 0x8A15; + public const int PACK_ROW_LENGTH = 0x0D02; + public const int PACK_SKIP_IMAGES = 0x806B; + public const int PACK_SKIP_IMAGES_EXT = 0x806B; + public const int PACK_SKIP_PIXELS = 0x0D04; + public const int PACK_SKIP_ROWS = 0x0D03; + public const int PACK_SKIP_VOLUMES_SGIS = 0x8130; + public const int PACK_SUBSAMPLE_RATE_SGIX = 0x85A0; + public const int PACK_SWAP_BYTES = 0x0D00; + public const int PALETTE4_R5_G6_B5_OES = 0x8B92; + public const int PALETTE4_RGB5_A1_OES = 0x8B94; + public const int PALETTE4_RGB8_OES = 0x8B90; + public const int PALETTE4_RGBA4_OES = 0x8B93; + public const int PALETTE4_RGBA8_OES = 0x8B91; + public const int PALETTE8_R5_G6_B5_OES = 0x8B97; + public const int PALETTE8_RGB5_A1_OES = 0x8B99; + public const int PALETTE8_RGB8_OES = 0x8B95; + public const int PALETTE8_RGBA4_OES = 0x8B98; + public const int PALETTE8_RGBA8_OES = 0x8B96; + public const int PARALLEL_ARRAYS_INTEL = 0x83F4; + public const int PARAMETER_BUFFER = 0x80EE; + public const int PARAMETER_BUFFER_ARB = 0x80EE; + public const int PARAMETER_BUFFER_BINDING = 0x80EF; + public const int PARAMETER_BUFFER_BINDING_ARB = 0x80EF; + public const int PARTIAL_SUCCESS_NV = 0x902E; + public const int PASS_THROUGH_NV = 0x86E6; + public const int PATCHES = 0x000E; + public const int PATCH_DEFAULT_INNER_LEVEL = 0x8E73; + public const int PATCH_DEFAULT_OUTER_LEVEL = 0x8E74; + public const int PATCH_VERTICES = 0x8E72; + public const int PATH_CLIENT_LENGTH_NV = 0x907F; + public const int PATH_COMMAND_COUNT_NV = 0x909D; + public const int PATH_COMPUTED_LENGTH_NV = 0x90A0; + public const int PATH_COORD_COUNT_NV = 0x909E; + public const int PATH_COVER_DEPTH_FUNC_NV = 0x90BF; + public const int PATH_DASH_ARRAY_COUNT_NV = 0x909F; + public const int PATH_DASH_CAPS_NV = 0x907B; + public const int PATH_DASH_OFFSET_NV = 0x907E; + public const int PATH_DASH_OFFSET_RESET_NV = 0x90B4; + public const int PATH_END_CAPS_NV = 0x9076; + public const int PATH_ERROR_POSITION_NV = 0x90AB; + public const int PATH_FILL_BOUNDING_BOX_NV = 0x90A1; + public const int PATH_FILL_COVER_MODE_NV = 0x9082; + public const int PATH_FILL_MASK_NV = 0x9081; + public const int PATH_FILL_MODE_NV = 0x9080; + public const int PATH_FORMAT_PS_NV = 0x9071; + public const int PATH_FORMAT_SVG_NV = 0x9070; + public const int PATH_GEN_COEFF_NV = 0x90B1; + public const int PATH_GEN_COMPONENTS_NV = 0x90B3; + public const int PATH_GEN_MODE_NV = 0x90B0; + public const int PATH_INITIAL_DASH_CAP_NV = 0x907C; + public const int PATH_INITIAL_END_CAP_NV = 0x9077; + public const int PATH_JOIN_STYLE_NV = 0x9079; + public const int PATH_MAX_MODELVIEW_STACK_DEPTH_NV = 0x0D36; + public const int PATH_MAX_PROJECTION_STACK_DEPTH_NV = 0x0D38; + public const int PATH_MITER_LIMIT_NV = 0x907A; + public const int PATH_MODELVIEW_MATRIX_NV = 0x0BA6; + public const int PATH_MODELVIEW_NV = 0x1700; + public const int PATH_MODELVIEW_STACK_DEPTH_NV = 0x0BA3; + public const int PATH_OBJECT_BOUNDING_BOX_NV = 0x908A; + public const int PATH_PROJECTION_MATRIX_NV = 0x0BA7; + public const int PATH_PROJECTION_NV = 0x1701; + public const int PATH_PROJECTION_STACK_DEPTH_NV = 0x0BA4; + public const int PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV = 0x90BD; + public const int PATH_STENCIL_DEPTH_OFFSET_UNITS_NV = 0x90BE; + public const int PATH_STENCIL_FUNC_NV = 0x90B7; + public const int PATH_STENCIL_REF_NV = 0x90B8; + public const int PATH_STENCIL_VALUE_MASK_NV = 0x90B9; + public const int PATH_STROKE_BOUNDING_BOX_NV = 0x90A2; + public const int PATH_STROKE_COVER_MODE_NV = 0x9083; + public const int PATH_STROKE_MASK_NV = 0x9084; + public const int PATH_STROKE_WIDTH_NV = 0x9075; + public const int PATH_TERMINAL_DASH_CAP_NV = 0x907D; + public const int PATH_TERMINAL_END_CAP_NV = 0x9078; + public const int PATH_TRANSPOSE_MODELVIEW_MATRIX_NV = 0x84E3; + public const int PATH_TRANSPOSE_PROJECTION_MATRIX_NV = 0x84E4; + public const int PERCENTAGE_AMD = 0x8BC3; + public const int PERFMON_RESULT_AMD = 0x8BC6; + public const int PERFMON_RESULT_AVAILABLE_AMD = 0x8BC4; + public const int PERFMON_RESULT_SIZE_AMD = 0x8BC5; + public const int PERFORMANCE_MONITOR_AMD = 0x9152; + public const int PERFQUERY_COUNTER_DATA_BOOL32_INTEL = 0x94FC; + public const int PERFQUERY_COUNTER_DATA_DOUBLE_INTEL = 0x94FB; + public const int PERFQUERY_COUNTER_DATA_FLOAT_INTEL = 0x94FA; + public const int PERFQUERY_COUNTER_DATA_UINT32_INTEL = 0x94F8; + public const int PERFQUERY_COUNTER_DATA_UINT64_INTEL = 0x94F9; + public const int PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL = 0x94FF; + public const int PERFQUERY_COUNTER_DURATION_NORM_INTEL = 0x94F1; + public const int PERFQUERY_COUNTER_DURATION_RAW_INTEL = 0x94F2; + public const int PERFQUERY_COUNTER_EVENT_INTEL = 0x94F0; + public const int PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL = 0x94FE; + public const int PERFQUERY_COUNTER_RAW_INTEL = 0x94F4; + public const int PERFQUERY_COUNTER_THROUGHPUT_INTEL = 0x94F3; + public const int PERFQUERY_COUNTER_TIMESTAMP_INTEL = 0x94F5; + public const int PERFQUERY_DONOT_FLUSH_INTEL = 0x83F9; + public const int PERFQUERY_FLUSH_INTEL = 0x83FA; + public const int PERFQUERY_GLOBAL_CONTEXT_INTEL = 0x00000001; + public const int PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL = 0x9500; + public const int PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL = 0x94FD; + public const int PERFQUERY_SINGLE_CONTEXT_INTEL = 0x00000000; + public const int PERFQUERY_WAIT_INTEL = 0x83FB; + public const int PERTURB_EXT = 0x85AE; + public const int PER_GPU_STORAGE_BIT_NV = 0x0800; + public const int PER_GPU_STORAGE_NV = 0x9548; + public const int PER_STAGE_CONSTANTS_NV = 0x8535; + public const int PHONG_HINT_WIN = 0x80EB; + public const int PHONG_WIN = 0x80EA; + public const int PINLIGHT_NV = 0x92A8; + public const int PIXELS_PER_SAMPLE_PATTERN_X_AMD = 0x91AE; + public const int PIXELS_PER_SAMPLE_PATTERN_Y_AMD = 0x91AF; + public const int PIXEL_BUFFER_BARRIER_BIT = 0x00000080; + public const int PIXEL_BUFFER_BARRIER_BIT_EXT = 0x00000080; + public const int PIXEL_COUNTER_BITS_NV = 0x8864; + public const int PIXEL_COUNT_AVAILABLE_NV = 0x8867; + public const int PIXEL_COUNT_NV = 0x8866; + public const int PIXEL_CUBIC_WEIGHT_EXT = 0x8333; + public const int PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS = 0x8355; + public const int PIXEL_FRAGMENT_RGB_SOURCE_SGIS = 0x8354; + public const int PIXEL_GROUP_COLOR_SGIS = 0x8356; + public const int PIXEL_MAG_FILTER_EXT = 0x8331; + public const int PIXEL_MIN_FILTER_EXT = 0x8332; + public const int PIXEL_PACK_BUFFER = 0x88EB; + public const int PIXEL_PACK_BUFFER_ARB = 0x88EB; + public const int PIXEL_PACK_BUFFER_BINDING = 0x88ED; + public const int PIXEL_PACK_BUFFER_BINDING_ARB = 0x88ED; + public const int PIXEL_PACK_BUFFER_BINDING_EXT = 0x88ED; + public const int PIXEL_PACK_BUFFER_EXT = 0x88EB; + public const int PIXEL_SUBSAMPLE_2424_SGIX = 0x85A3; + public const int PIXEL_SUBSAMPLE_4242_SGIX = 0x85A4; + public const int PIXEL_SUBSAMPLE_4444_SGIX = 0x85A2; + public const int PIXEL_TEXTURE_SGIS = 0x8353; + public const int PIXEL_TEX_GEN_MODE_SGIX = 0x832B; + public const int PIXEL_TEX_GEN_SGIX = 0x8139; + public const int PIXEL_TILE_BEST_ALIGNMENT_SGIX = 0x813E; + public const int PIXEL_TILE_CACHE_INCREMENT_SGIX = 0x813F; + public const int PIXEL_TILE_CACHE_SIZE_SGIX = 0x8145; + public const int PIXEL_TILE_GRID_DEPTH_SGIX = 0x8144; + public const int PIXEL_TILE_GRID_HEIGHT_SGIX = 0x8143; + public const int PIXEL_TILE_GRID_WIDTH_SGIX = 0x8142; + public const int PIXEL_TILE_HEIGHT_SGIX = 0x8141; + public const int PIXEL_TILE_WIDTH_SGIX = 0x8140; + public const int PIXEL_TRANSFORM_2D_EXT = 0x8330; + public const int PIXEL_TRANSFORM_2D_MATRIX_EXT = 0x8338; + public const int PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8336; + public const int PIXEL_UNPACK_BUFFER = 0x88EC; + public const int PIXEL_UNPACK_BUFFER_ARB = 0x88EC; + public const int PIXEL_UNPACK_BUFFER_BINDING = 0x88EF; + public const int PIXEL_UNPACK_BUFFER_BINDING_ARB = 0x88EF; + public const int PIXEL_UNPACK_BUFFER_BINDING_EXT = 0x88EF; + public const int PIXEL_UNPACK_BUFFER_EXT = 0x88EC; + public const int PLUS_CLAMPED_ALPHA_NV = 0x92B2; + public const int PLUS_CLAMPED_NV = 0x92B1; + public const int PLUS_DARKER_NV = 0x9292; + public const int PLUS_NV = 0x9291; + public const int PN_TRIANGLES_ATI = 0x87F0; + public const int PN_TRIANGLES_NORMAL_MODE_ATI = 0x87F3; + public const int PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI = 0x87F7; + public const int PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI = 0x87F8; + public const int PN_TRIANGLES_POINT_MODE_ATI = 0x87F2; + public const int PN_TRIANGLES_POINT_MODE_CUBIC_ATI = 0x87F6; + public const int PN_TRIANGLES_POINT_MODE_LINEAR_ATI = 0x87F5; + public const int PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F4; + public const int POINT = 0x1B00; + public const int POINTS = 0x0000; + public const int POINT_DISTANCE_ATTENUATION_ARB = 0x8129; + public const int POINT_FADE_THRESHOLD_SIZE = 0x8128; + public const int POINT_FADE_THRESHOLD_SIZE_ARB = 0x8128; + public const int POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128; + public const int POINT_FADE_THRESHOLD_SIZE_SGIS = 0x8128; + public const int POINT_SIZE = 0x0B11; + public const int POINT_SIZE_GRANULARITY = 0x0B13; + public const int POINT_SIZE_MAX_ARB = 0x8127; + public const int POINT_SIZE_MAX_EXT = 0x8127; + public const int POINT_SIZE_MAX_SGIS = 0x8127; + public const int POINT_SIZE_MIN_ARB = 0x8126; + public const int POINT_SIZE_MIN_EXT = 0x8126; + public const int POINT_SIZE_MIN_SGIS = 0x8126; + public const int POINT_SIZE_RANGE = 0x0B12; + public const int POINT_SPRITE_ARB = 0x8861; + public const int POINT_SPRITE_COORD_ORIGIN = 0x8CA0; + public const int POINT_SPRITE_NV = 0x8861; + public const int POINT_SPRITE_R_MODE_NV = 0x8863; + public const int POLYGON_MODE = 0x0B40; + public const int POLYGON_OFFSET_BIAS_EXT = 0x8039; + public const int POLYGON_OFFSET_CLAMP = 0x8E1B; + public const int POLYGON_OFFSET_CLAMP_EXT = 0x8E1B; + public const int POLYGON_OFFSET_COMMAND_NV = 0x000E; + public const int POLYGON_OFFSET_EXT = 0x8037; + public const int POLYGON_OFFSET_FACTOR = 0x8038; + public const int POLYGON_OFFSET_FACTOR_EXT = 0x8038; + public const int POLYGON_OFFSET_FILL = 0x8037; + public const int POLYGON_OFFSET_LINE = 0x2A02; + public const int POLYGON_OFFSET_POINT = 0x2A01; + public const int POLYGON_OFFSET_UNITS = 0x2A00; + public const int POLYGON_SMOOTH = 0x0B41; + public const int POLYGON_SMOOTH_HINT = 0x0C53; + public const int POST_COLOR_MATRIX_ALPHA_BIAS_SGI = 0x80BB; + public const int POST_COLOR_MATRIX_ALPHA_SCALE_SGI = 0x80B7; + public const int POST_COLOR_MATRIX_BLUE_BIAS_SGI = 0x80BA; + public const int POST_COLOR_MATRIX_BLUE_SCALE_SGI = 0x80B6; + public const int POST_COLOR_MATRIX_COLOR_TABLE_SGI = 0x80D2; + public const int POST_COLOR_MATRIX_GREEN_BIAS_SGI = 0x80B9; + public const int POST_COLOR_MATRIX_GREEN_SCALE_SGI = 0x80B5; + public const int POST_COLOR_MATRIX_RED_BIAS_SGI = 0x80B8; + public const int POST_COLOR_MATRIX_RED_SCALE_SGI = 0x80B4; + public const int POST_CONVOLUTION_ALPHA_BIAS_EXT = 0x8023; + public const int POST_CONVOLUTION_ALPHA_SCALE_EXT = 0x801F; + public const int POST_CONVOLUTION_BLUE_BIAS_EXT = 0x8022; + public const int POST_CONVOLUTION_BLUE_SCALE_EXT = 0x801E; + public const int POST_CONVOLUTION_COLOR_TABLE_SGI = 0x80D1; + public const int POST_CONVOLUTION_GREEN_BIAS_EXT = 0x8021; + public const int POST_CONVOLUTION_GREEN_SCALE_EXT = 0x801D; + public const int POST_CONVOLUTION_RED_BIAS_EXT = 0x8020; + public const int POST_CONVOLUTION_RED_SCALE_EXT = 0x801C; + public const int POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8162; + public const int POST_TEXTURE_FILTER_BIAS_RANGE_SGIX = 0x817B; + public const int POST_TEXTURE_FILTER_BIAS_SGIX = 0x8179; + public const int POST_TEXTURE_FILTER_SCALE_RANGE_SGIX = 0x817C; + public const int POST_TEXTURE_FILTER_SCALE_SGIX = 0x817A; + public const int PREFER_DOUBLEBUFFER_HINT_PGI = 0x1A1F8; + public const int PRESENT_DURATION_NV = 0x8E2B; + public const int PRESENT_TIME_NV = 0x8E2A; + public const int PRESERVE_ATI = 0x8762; + public const int PREVIOUS_ARB = 0x8578; + public const int PREVIOUS_EXT = 0x8578; + public const int PREVIOUS_TEXTURE_INPUT_NV = 0x86E4; + public const int PRIMARY_COLOR_ARB = 0x8577; + public const int PRIMARY_COLOR_EXT = 0x8577; + public const int PRIMARY_COLOR_NV = 0x852C; + public const int PRIMITIVES_GENERATED = 0x8C87; + public const int PRIMITIVES_GENERATED_EXT = 0x8C87; + public const int PRIMITIVES_GENERATED_NV = 0x8C87; + public const int PRIMITIVES_SUBMITTED = 0x82EF; + public const int PRIMITIVES_SUBMITTED_ARB = 0x82EF; + public const int PRIMITIVE_BOUNDING_BOX_ARB = 0x92BE; + public const int PRIMITIVE_ID_NV = 0x8C7C; + public const int PRIMITIVE_RESTART = 0x8F9D; + public const int PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69; + public const int PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = 0x8221; + public const int PRIMITIVE_RESTART_INDEX = 0x8F9E; + public const int PRIMITIVE_RESTART_INDEX_NV = 0x8559; + public const int PRIMITIVE_RESTART_NV = 0x8558; + public const int PROGRAM = 0x82E2; + public const int PROGRAMMABLE_SAMPLE_LOCATION_ARB = 0x9341; + public const int PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9341; + public const int PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB = 0x9340; + public const int PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV = 0x9340; + public const int PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B0; + public const int PROGRAM_ALU_INSTRUCTIONS_ARB = 0x8805; + public const int PROGRAM_ATTRIBS_ARB = 0x88AC; + public const int PROGRAM_ATTRIB_COMPONENTS_NV = 0x8906; + public const int PROGRAM_BINARY_FORMATS = 0x87FF; + public const int PROGRAM_BINARY_FORMAT_MESA = 0x875F; + public const int PROGRAM_BINARY_LENGTH = 0x8741; + public const int PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257; + public const int PROGRAM_BINDING_ARB = 0x8677; + public const int PROGRAM_ERROR_POSITION_ARB = 0x864B; + public const int PROGRAM_ERROR_POSITION_NV = 0x864B; + public const int PROGRAM_ERROR_STRING_ARB = 0x8874; + public const int PROGRAM_ERROR_STRING_NV = 0x8874; + public const int PROGRAM_FORMAT_ARB = 0x8876; + public const int PROGRAM_FORMAT_ASCII_ARB = 0x8875; + public const int PROGRAM_INPUT = 0x92E3; + public const int PROGRAM_INSTRUCTIONS_ARB = 0x88A0; + public const int PROGRAM_LENGTH_ARB = 0x8627; + public const int PROGRAM_LENGTH_NV = 0x8627; + public const int PROGRAM_MATRIX_EXT = 0x8E2D; + public const int PROGRAM_MATRIX_STACK_DEPTH_EXT = 0x8E2F; + public const int PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B2; + public const int PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x8808; + public const int PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE; + public const int PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2; + public const int PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA; + public const int PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6; + public const int PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x880A; + public const int PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x8809; + public const int PROGRAM_OBJECT_ARB = 0x8B40; + public const int PROGRAM_OBJECT_EXT = 0x8B40; + public const int PROGRAM_OUTPUT = 0x92E4; + public const int PROGRAM_PARAMETERS_ARB = 0x88A8; + public const int PROGRAM_PARAMETER_NV = 0x8644; + public const int PROGRAM_PIPELINE = 0x82E4; + public const int PROGRAM_PIPELINE_BINDING = 0x825A; + public const int PROGRAM_PIPELINE_OBJECT_EXT = 0x8A4F; + public const int PROGRAM_POINT_SIZE = 0x8642; + public const int PROGRAM_POINT_SIZE_ARB = 0x8642; + public const int PROGRAM_POINT_SIZE_EXT = 0x8642; + public const int PROGRAM_RESIDENT_NV = 0x8647; + public const int PROGRAM_RESULT_COMPONENTS_NV = 0x8907; + public const int PROGRAM_SEPARABLE = 0x8258; + public const int PROGRAM_STRING_ARB = 0x8628; + public const int PROGRAM_STRING_NV = 0x8628; + public const int PROGRAM_TARGET_NV = 0x8646; + public const int PROGRAM_TEMPORARIES_ARB = 0x88A4; + public const int PROGRAM_TEX_INDIRECTIONS_ARB = 0x8807; + public const int PROGRAM_TEX_INSTRUCTIONS_ARB = 0x8806; + public const int PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6; + public const int PROTECTED_MEMORY_OBJECT_EXT = 0x959B; + public const int PROVOKING_VERTEX = 0x8E4F; + public const int PROVOKING_VERTEX_EXT = 0x8E4F; + public const int PROXY_COLOR_TABLE_SGI = 0x80D3; + public const int PROXY_HISTOGRAM_EXT = 0x8025; + public const int PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI = 0x80D5; + public const int PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI = 0x80D4; + public const int PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8163; + public const int PROXY_TEXTURE_1D = 0x8063; + public const int PROXY_TEXTURE_1D_ARRAY = 0x8C19; + public const int PROXY_TEXTURE_1D_ARRAY_EXT = 0x8C19; + public const int PROXY_TEXTURE_1D_EXT = 0x8063; + public const int PROXY_TEXTURE_1D_STACK_MESAX = 0x875B; + public const int PROXY_TEXTURE_2D = 0x8064; + public const int PROXY_TEXTURE_2D_ARRAY = 0x8C1B; + public const int PROXY_TEXTURE_2D_ARRAY_EXT = 0x8C1B; + public const int PROXY_TEXTURE_2D_EXT = 0x8064; + public const int PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101; + public const int PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103; + public const int PROXY_TEXTURE_2D_STACK_MESAX = 0x875C; + public const int PROXY_TEXTURE_3D = 0x8070; + public const int PROXY_TEXTURE_3D_EXT = 0x8070; + public const int PROXY_TEXTURE_4D_SGIS = 0x8135; + public const int PROXY_TEXTURE_COLOR_TABLE_SGI = 0x80BD; + public const int PROXY_TEXTURE_CUBE_MAP = 0x851B; + public const int PROXY_TEXTURE_CUBE_MAP_ARB = 0x851B; + public const int PROXY_TEXTURE_CUBE_MAP_ARRAY = 0x900B; + public const int PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x900B; + public const int PROXY_TEXTURE_CUBE_MAP_EXT = 0x851B; + public const int PROXY_TEXTURE_RECTANGLE = 0x84F7; + public const int PROXY_TEXTURE_RECTANGLE_ARB = 0x84F7; + public const int PROXY_TEXTURE_RECTANGLE_NV = 0x84F7; + public const int PURGEABLE_APPLE = 0x8A1D; + public const int PURGED_CONTEXT_RESET_NV = 0x92BB; + public const int QUADRATIC_CURVE_TO_NV = 0x0A; + public const int QUADS = 0x0007; + public const int QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C; + public const int QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT = 0x8E4C; + public const int QUAD_ALPHA4_SGIS = 0x811E; + public const int QUAD_ALPHA8_SGIS = 0x811F; + public const int QUAD_INTENSITY4_SGIS = 0x8122; + public const int QUAD_INTENSITY8_SGIS = 0x8123; + public const int QUAD_LUMINANCE4_SGIS = 0x8120; + public const int QUAD_LUMINANCE8_SGIS = 0x8121; + public const int QUAD_MESH_SUN = 0x8614; + public const int QUAD_TEXTURE_SELECT_SGIS = 0x8125; + public const int QUARTER_BIT_ATI = 0x00000010; + public const int QUERY = 0x82E3; + public const uint QUERY_ALL_EVENT_BITS_AMD = 0xFFFFFFFF; + public const int QUERY_BUFFER = 0x9192; + public const int QUERY_BUFFER_AMD = 0x9192; + public const int QUERY_BUFFER_BARRIER_BIT = 0x00008000; + public const int QUERY_BUFFER_BINDING = 0x9193; + public const int QUERY_BUFFER_BINDING_AMD = 0x9193; + public const int QUERY_BY_REGION_NO_WAIT = 0x8E16; + public const int QUERY_BY_REGION_NO_WAIT_INVERTED = 0x8E1A; + public const int QUERY_BY_REGION_NO_WAIT_NV = 0x8E16; + public const int QUERY_BY_REGION_WAIT = 0x8E15; + public const int QUERY_BY_REGION_WAIT_INVERTED = 0x8E19; + public const int QUERY_BY_REGION_WAIT_NV = 0x8E15; + public const int QUERY_COUNTER_BITS = 0x8864; + public const int QUERY_COUNTER_BITS_ARB = 0x8864; + public const int QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD = 0x00000008; + public const int QUERY_DEPTH_FAIL_EVENT_BIT_AMD = 0x00000002; + public const int QUERY_DEPTH_PASS_EVENT_BIT_AMD = 0x00000001; + public const int QUERY_NO_WAIT = 0x8E14; + public const int QUERY_NO_WAIT_INVERTED = 0x8E18; + public const int QUERY_NO_WAIT_NV = 0x8E14; + public const int QUERY_OBJECT_AMD = 0x9153; + public const int QUERY_OBJECT_EXT = 0x9153; + public const int QUERY_RESOURCE_BUFFEROBJECT_NV = 0x9547; + public const int QUERY_RESOURCE_MEMTYPE_VIDMEM_NV = 0x9542; + public const int QUERY_RESOURCE_RENDERBUFFER_NV = 0x9546; + public const int QUERY_RESOURCE_SYS_RESERVED_NV = 0x9544; + public const int QUERY_RESOURCE_TEXTURE_NV = 0x9545; + public const int QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV = 0x9540; + public const int QUERY_RESULT = 0x8866; + public const int QUERY_RESULT_ARB = 0x8866; + public const int QUERY_RESULT_AVAILABLE = 0x8867; + public const int QUERY_RESULT_AVAILABLE_ARB = 0x8867; + public const int QUERY_RESULT_NO_WAIT = 0x9194; + public const int QUERY_RESULT_NO_WAIT_AMD = 0x9194; + public const int QUERY_STENCIL_FAIL_EVENT_BIT_AMD = 0x00000004; + public const int QUERY_TARGET = 0x82EA; + public const int QUERY_WAIT = 0x8E13; + public const int QUERY_WAIT_INVERTED = 0x8E17; + public const int QUERY_WAIT_NV = 0x8E13; + public const int R11F_G11F_B10F = 0x8C3A; + public const int R11F_G11F_B10F_EXT = 0x8C3A; + public const int R16 = 0x822A; + public const int R16F = 0x822D; + public const int R16F_EXT = 0x822D; + public const int R16I = 0x8233; + public const int R16UI = 0x8234; + public const int R16_SNORM = 0x8F98; + public const int R1UI_C3F_V3F_SUN = 0x85C6; + public const int R1UI_C4F_N3F_V3F_SUN = 0x85C8; + public const int R1UI_C4UB_V3F_SUN = 0x85C5; + public const int R1UI_N3F_V3F_SUN = 0x85C7; + public const int R1UI_T2F_C4F_N3F_V3F_SUN = 0x85CB; + public const int R1UI_T2F_N3F_V3F_SUN = 0x85CA; + public const int R1UI_T2F_V3F_SUN = 0x85C9; + public const int R1UI_V3F_SUN = 0x85C4; + public const int R32F = 0x822E; + public const int R32F_EXT = 0x822E; + public const int R32I = 0x8235; + public const int R32UI = 0x8236; + public const int R3_G3_B2 = 0x2A10; + public const int R8 = 0x8229; + public const int R8I = 0x8231; + public const int R8UI = 0x8232; + public const int R8_EXT = 0x8229; + public const int R8_SNORM = 0x8F94; + public const int RASTERIZER_DISCARD = 0x8C89; + public const int RASTERIZER_DISCARD_EXT = 0x8C89; + public const int RASTERIZER_DISCARD_NV = 0x8C89; + public const int RASTER_FIXED_SAMPLE_LOCATIONS_EXT = 0x932A; + public const int RASTER_MULTISAMPLE_EXT = 0x9327; + public const int RASTER_POSITION_UNCLIPPED_IBM = 0x19262; + public const int RASTER_SAMPLES_EXT = 0x9328; + public const int READ_BUFFER = 0x0C02; + public const int READ_FRAMEBUFFER = 0x8CA8; + public const int READ_FRAMEBUFFER_BINDING = 0x8CAA; + public const int READ_FRAMEBUFFER_BINDING_EXT = 0x8CAA; + public const int READ_FRAMEBUFFER_EXT = 0x8CA8; + public const int READ_ONLY = 0x88B8; + public const int READ_ONLY_ARB = 0x88B8; + public const int READ_PIXELS = 0x828C; + public const int READ_PIXELS_FORMAT = 0x828D; + public const int READ_PIXELS_TYPE = 0x828E; + public const int READ_PIXEL_DATA_RANGE_LENGTH_NV = 0x887B; + public const int READ_PIXEL_DATA_RANGE_NV = 0x8879; + public const int READ_PIXEL_DATA_RANGE_POINTER_NV = 0x887D; + public const int READ_WRITE = 0x88BA; + public const int READ_WRITE_ARB = 0x88BA; + public const int RECLAIM_MEMORY_HINT_PGI = 0x1A1FE; + public const int RECT_NV = 0xF6; + public const int RED = 0x1903; + public const int REDUCE_EXT = 0x8016; + public const int RED_BIT_ATI = 0x00000001; + public const int RED_INTEGER = 0x8D94; + public const int RED_INTEGER_EXT = 0x8D94; + public const int RED_MAX_CLAMP_INGR = 0x8564; + public const int RED_MIN_CLAMP_INGR = 0x8560; + public const int RED_NV = 0x1903; + public const int RED_SNORM = 0x8F90; + public const int REFERENCED_BY_COMPUTE_SHADER = 0x930B; + public const int REFERENCED_BY_FRAGMENT_SHADER = 0x930A; + public const int REFERENCED_BY_GEOMETRY_SHADER = 0x9309; + public const int REFERENCED_BY_MESH_SHADER_NV = 0x95A0; + public const int REFERENCED_BY_TASK_SHADER_NV = 0x95A1; + public const int REFERENCED_BY_TESS_CONTROL_SHADER = 0x9307; + public const int REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308; + public const int REFERENCED_BY_VERTEX_SHADER = 0x9306; + public const int REFERENCE_PLANE_EQUATION_SGIX = 0x817E; + public const int REFERENCE_PLANE_SGIX = 0x817D; + public const int REFLECTION_MAP_ARB = 0x8512; + public const int REFLECTION_MAP_EXT = 0x8512; + public const int REFLECTION_MAP_NV = 0x8512; + public const int REGISTER_COMBINERS_NV = 0x8522; + public const int REG_0_ATI = 0x8921; + public const int REG_10_ATI = 0x892B; + public const int REG_11_ATI = 0x892C; + public const int REG_12_ATI = 0x892D; + public const int REG_13_ATI = 0x892E; + public const int REG_14_ATI = 0x892F; + public const int REG_15_ATI = 0x8930; + public const int REG_16_ATI = 0x8931; + public const int REG_17_ATI = 0x8932; + public const int REG_18_ATI = 0x8933; + public const int REG_19_ATI = 0x8934; + public const int REG_1_ATI = 0x8922; + public const int REG_20_ATI = 0x8935; + public const int REG_21_ATI = 0x8936; + public const int REG_22_ATI = 0x8937; + public const int REG_23_ATI = 0x8938; + public const int REG_24_ATI = 0x8939; + public const int REG_25_ATI = 0x893A; + public const int REG_26_ATI = 0x893B; + public const int REG_27_ATI = 0x893C; + public const int REG_28_ATI = 0x893D; + public const int REG_29_ATI = 0x893E; + public const int REG_2_ATI = 0x8923; + public const int REG_30_ATI = 0x893F; + public const int REG_31_ATI = 0x8940; + public const int REG_3_ATI = 0x8924; + public const int REG_4_ATI = 0x8925; + public const int REG_5_ATI = 0x8926; + public const int REG_6_ATI = 0x8927; + public const int REG_7_ATI = 0x8928; + public const int REG_8_ATI = 0x8929; + public const int REG_9_ATI = 0x892A; + public const int RELATIVE_ARC_TO_NV = 0xFF; + public const int RELATIVE_CONIC_CURVE_TO_NV = 0x1B; + public const int RELATIVE_CUBIC_CURVE_TO_NV = 0x0D; + public const int RELATIVE_HORIZONTAL_LINE_TO_NV = 0x07; + public const int RELATIVE_LARGE_CCW_ARC_TO_NV = 0x17; + public const int RELATIVE_LARGE_CW_ARC_TO_NV = 0x19; + public const int RELATIVE_LINE_TO_NV = 0x05; + public const int RELATIVE_MOVE_TO_NV = 0x03; + public const int RELATIVE_QUADRATIC_CURVE_TO_NV = 0x0B; + public const int RELATIVE_RECT_NV = 0xF7; + public const int RELATIVE_ROUNDED_RECT2_NV = 0xEB; + public const int RELATIVE_ROUNDED_RECT4_NV = 0xED; + public const int RELATIVE_ROUNDED_RECT8_NV = 0xEF; + public const int RELATIVE_ROUNDED_RECT_NV = 0xE9; + public const int RELATIVE_SMALL_CCW_ARC_TO_NV = 0x13; + public const int RELATIVE_SMALL_CW_ARC_TO_NV = 0x15; + public const int RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV = 0x11; + public const int RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0F; + public const int RELATIVE_VERTICAL_LINE_TO_NV = 0x09; + public const int RELEASED_APPLE = 0x8A19; + public const int RENDERBUFFER = 0x8D41; + public const int RENDERBUFFER_ALPHA_SIZE = 0x8D53; + public const int RENDERBUFFER_ALPHA_SIZE_EXT = 0x8D53; + public const int RENDERBUFFER_BINDING = 0x8CA7; + public const int RENDERBUFFER_BINDING_EXT = 0x8CA7; + public const int RENDERBUFFER_BLUE_SIZE = 0x8D52; + public const int RENDERBUFFER_BLUE_SIZE_EXT = 0x8D52; + public const int RENDERBUFFER_COLOR_SAMPLES_NV = 0x8E10; + public const int RENDERBUFFER_COVERAGE_SAMPLES_NV = 0x8CAB; + public const int RENDERBUFFER_DEPTH_SIZE = 0x8D54; + public const int RENDERBUFFER_DEPTH_SIZE_EXT = 0x8D54; + public const int RENDERBUFFER_EXT = 0x8D41; + public const int RENDERBUFFER_FREE_MEMORY_ATI = 0x87FD; + public const int RENDERBUFFER_GREEN_SIZE = 0x8D51; + public const int RENDERBUFFER_GREEN_SIZE_EXT = 0x8D51; + public const int RENDERBUFFER_HEIGHT = 0x8D43; + public const int RENDERBUFFER_HEIGHT_EXT = 0x8D43; + public const int RENDERBUFFER_INTERNAL_FORMAT = 0x8D44; + public const int RENDERBUFFER_INTERNAL_FORMAT_EXT = 0x8D44; + public const int RENDERBUFFER_RED_SIZE = 0x8D50; + public const int RENDERBUFFER_RED_SIZE_EXT = 0x8D50; + public const int RENDERBUFFER_SAMPLES = 0x8CAB; + public const int RENDERBUFFER_SAMPLES_EXT = 0x8CAB; + public const int RENDERBUFFER_STENCIL_SIZE = 0x8D55; + public const int RENDERBUFFER_STENCIL_SIZE_EXT = 0x8D55; + public const int RENDERBUFFER_STORAGE_SAMPLES_AMD = 0x91B2; + public const int RENDERBUFFER_WIDTH = 0x8D42; + public const int RENDERBUFFER_WIDTH_EXT = 0x8D42; + public const int RENDERER = 0x1F01; + public const int RENDER_GPU_MASK_NV = 0x9558; + public const int REPEAT = 0x2901; + public const int REPLACE = 0x1E01; + public const int REPLACEMENT_CODE_ARRAY_POINTER_SUN = 0x85C3; + public const int REPLACEMENT_CODE_ARRAY_STRIDE_SUN = 0x85C2; + public const int REPLACEMENT_CODE_ARRAY_SUN = 0x85C0; + public const int REPLACEMENT_CODE_ARRAY_TYPE_SUN = 0x85C1; + public const int REPLACEMENT_CODE_SUN = 0x81D8; + public const int REPLACE_EXT = 0x8062; + public const int REPLACE_MIDDLE_SUN = 0x0002; + public const int REPLACE_OLDEST_SUN = 0x0003; + public const int REPLACE_VALUE_AMD = 0x874B; + public const int REPLICATE_BORDER_HP = 0x8153; + public const int REPRESENTATIVE_FRAGMENT_TEST_NV = 0x937F; + public const int RESAMPLE_AVERAGE_OML = 0x8988; + public const int RESAMPLE_DECIMATE_OML = 0x8989; + public const int RESAMPLE_DECIMATE_SGIX = 0x8430; + public const int RESAMPLE_REPLICATE_OML = 0x8986; + public const int RESAMPLE_REPLICATE_SGIX = 0x8433; + public const int RESAMPLE_ZERO_FILL_OML = 0x8987; + public const int RESAMPLE_ZERO_FILL_SGIX = 0x8434; + public const int RESCALE_NORMAL_EXT = 0x803A; + public const int RESET_NOTIFICATION_STRATEGY = 0x8256; + public const int RESET_NOTIFICATION_STRATEGY_ARB = 0x8256; + public const int RESTART_PATH_NV = 0xF0; + public const int RESTART_SUN = 0x0001; + public const int RETAINED_APPLE = 0x8A1B; + public const int RG = 0x8227; + public const int RG16 = 0x822C; + public const int RG16F = 0x822F; + public const int RG16F_EXT = 0x822F; + public const int RG16I = 0x8239; + public const int RG16UI = 0x823A; + public const int RG16_SNORM = 0x8F99; + public const int RG32F = 0x8230; + public const int RG32F_EXT = 0x8230; + public const int RG32I = 0x823B; + public const int RG32UI = 0x823C; + public const int RG8 = 0x822B; + public const int RG8I = 0x8237; + public const int RG8UI = 0x8238; + public const int RG8_EXT = 0x822B; + public const int RG8_SNORM = 0x8F95; + public const int RGB = 0x1907; + public const int RGB10 = 0x8052; + public const int RGB10_A2 = 0x8059; + public const int RGB10_A2UI = 0x906F; + public const int RGB10_A2_EXT = 0x8059; + public const int RGB10_EXT = 0x8052; + public const int RGB12 = 0x8053; + public const int RGB12_EXT = 0x8053; + public const int RGB16 = 0x8054; + public const int RGB16F = 0x881B; + public const int RGB16F_ARB = 0x881B; + public const int RGB16F_EXT = 0x881B; + public const int RGB16I = 0x8D89; + public const int RGB16I_EXT = 0x8D89; + public const int RGB16UI = 0x8D77; + public const int RGB16UI_EXT = 0x8D77; + public const int RGB16_EXT = 0x8054; + public const int RGB16_SNORM = 0x8F9A; + public const int RGB2_EXT = 0x804E; + public const int RGB32F = 0x8815; + public const int RGB32F_ARB = 0x8815; + public const int RGB32F_EXT = 0x8815; + public const int RGB32I = 0x8D83; + public const int RGB32I_EXT = 0x8D83; + public const int RGB32UI = 0x8D71; + public const int RGB32UI_EXT = 0x8D71; + public const int RGB4 = 0x804F; + public const int RGB4_EXT = 0x804F; + public const int RGB4_S3TC = 0x83A1; + public const int RGB5 = 0x8050; + public const int RGB565 = 0x8D62; + public const int RGB5_A1 = 0x8057; + public const int RGB5_A1_EXT = 0x8057; + public const int RGB5_EXT = 0x8050; + public const int RGB8 = 0x8051; + public const int RGB8I = 0x8D8F; + public const int RGB8I_EXT = 0x8D8F; + public const int RGB8UI = 0x8D7D; + public const int RGB8UI_EXT = 0x8D7D; + public const int RGB8_EXT = 0x8051; + public const int RGB8_SNORM = 0x8F96; + public const int RGB9_E5 = 0x8C3D; + public const int RGB9_E5_EXT = 0x8C3D; + public const int RGBA = 0x1908; + public const int RGBA12 = 0x805A; + public const int RGBA12_EXT = 0x805A; + public const int RGBA16 = 0x805B; + public const int RGBA16F = 0x881A; + public const int RGBA16F_ARB = 0x881A; + public const int RGBA16F_EXT = 0x881A; + public const int RGBA16I = 0x8D88; + public const int RGBA16I_EXT = 0x8D88; + public const int RGBA16UI = 0x8D76; + public const int RGBA16UI_EXT = 0x8D76; + public const int RGBA16_EXT = 0x805B; + public const int RGBA16_SNORM = 0x8F9B; + public const int RGBA2 = 0x8055; + public const int RGBA2_EXT = 0x8055; + public const int RGBA32F = 0x8814; + public const int RGBA32F_ARB = 0x8814; + public const int RGBA32F_EXT = 0x8814; + public const int RGBA32I = 0x8D82; + public const int RGBA32I_EXT = 0x8D82; + public const int RGBA32UI = 0x8D70; + public const int RGBA32UI_EXT = 0x8D70; + public const int RGBA4 = 0x8056; + public const int RGBA4_DXT5_S3TC = 0x83A5; + public const int RGBA4_EXT = 0x8056; + public const int RGBA4_S3TC = 0x83A3; + public const int RGBA8 = 0x8058; + public const int RGBA8I = 0x8D8E; + public const int RGBA8I_EXT = 0x8D8E; + public const int RGBA8UI = 0x8D7C; + public const int RGBA8UI_EXT = 0x8D7C; + public const int RGBA8_EXT = 0x8058; + public const int RGBA8_SNORM = 0x8F97; + public const int RGBA_DXT5_S3TC = 0x83A4; + public const int RGBA_FLOAT16_APPLE = 0x881A; + public const int RGBA_FLOAT16_ATI = 0x881A; + public const int RGBA_FLOAT32_APPLE = 0x8814; + public const int RGBA_FLOAT32_ATI = 0x8814; + public const int RGBA_FLOAT_MODE_ARB = 0x8820; + public const int RGBA_FLOAT_MODE_ATI = 0x8820; + public const int RGBA_INTEGER = 0x8D99; + public const int RGBA_INTEGER_EXT = 0x8D99; + public const int RGBA_INTEGER_MODE_EXT = 0x8D9E; + public const int RGBA_S3TC = 0x83A2; + public const int RGBA_SIGNED_COMPONENTS_EXT = 0x8C3C; + public const int RGBA_SNORM = 0x8F93; + public const int RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV = 0x86D9; + public const int RGB_422_APPLE = 0x8A1F; + public const int RGB_FLOAT16_APPLE = 0x881B; + public const int RGB_FLOAT16_ATI = 0x881B; + public const int RGB_FLOAT32_APPLE = 0x8815; + public const int RGB_FLOAT32_ATI = 0x8815; + public const int RGB_INTEGER = 0x8D98; + public const int RGB_INTEGER_EXT = 0x8D98; + public const int RGB_RAW_422_APPLE = 0x8A51; + public const int RGB_S3TC = 0x83A0; + public const int RGB_SCALE_ARB = 0x8573; + public const int RGB_SCALE_EXT = 0x8573; + public const int RGB_SNORM = 0x8F92; + public const int RG_INTEGER = 0x8228; + public const int RG_SNORM = 0x8F91; + public const int RIGHT = 0x0407; + public const int ROUNDED_RECT2_NV = 0xEA; + public const int ROUNDED_RECT4_NV = 0xEC; + public const int ROUNDED_RECT8_NV = 0xEE; + public const int ROUNDED_RECT_NV = 0xE8; + public const int ROUND_NV = 0x90A4; + public const int SAMPLER = 0x82E6; + public const int SAMPLER_1D = 0x8B5D; + public const int SAMPLER_1D_ARB = 0x8B5D; + public const int SAMPLER_1D_ARRAY = 0x8DC0; + public const int SAMPLER_1D_ARRAY_EXT = 0x8DC0; + public const int SAMPLER_1D_ARRAY_SHADOW = 0x8DC3; + public const int SAMPLER_1D_ARRAY_SHADOW_EXT = 0x8DC3; + public const int SAMPLER_1D_SHADOW = 0x8B61; + public const int SAMPLER_1D_SHADOW_ARB = 0x8B61; + public const int SAMPLER_2D = 0x8B5E; + public const int SAMPLER_2D_ARB = 0x8B5E; + public const int SAMPLER_2D_ARRAY = 0x8DC1; + public const int SAMPLER_2D_ARRAY_EXT = 0x8DC1; + public const int SAMPLER_2D_ARRAY_SHADOW = 0x8DC4; + public const int SAMPLER_2D_ARRAY_SHADOW_EXT = 0x8DC4; + public const int SAMPLER_2D_MULTISAMPLE = 0x9108; + public const int SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B; + public const int SAMPLER_2D_RECT = 0x8B63; + public const int SAMPLER_2D_RECT_ARB = 0x8B63; + public const int SAMPLER_2D_RECT_SHADOW = 0x8B64; + public const int SAMPLER_2D_RECT_SHADOW_ARB = 0x8B64; + public const int SAMPLER_2D_SHADOW = 0x8B62; + public const int SAMPLER_2D_SHADOW_ARB = 0x8B62; + public const int SAMPLER_3D = 0x8B5F; + public const int SAMPLER_3D_ARB = 0x8B5F; + public const int SAMPLER_BINDING = 0x8919; + public const int SAMPLER_BUFFER = 0x8DC2; + public const int SAMPLER_BUFFER_AMD = 0x9001; + public const int SAMPLER_BUFFER_EXT = 0x8DC2; + public const int SAMPLER_CUBE = 0x8B60; + public const int SAMPLER_CUBE_ARB = 0x8B60; + public const int SAMPLER_CUBE_MAP_ARRAY = 0x900C; + public const int SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900C; + public const int SAMPLER_CUBE_MAP_ARRAY_SHADOW = 0x900D; + public const int SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB = 0x900D; + public const int SAMPLER_CUBE_SHADOW = 0x8DC5; + public const int SAMPLER_CUBE_SHADOW_EXT = 0x8DC5; + public const int SAMPLER_OBJECT_AMD = 0x9155; + public const int SAMPLER_RENDERBUFFER_NV = 0x8E56; + public const int SAMPLES = 0x80A9; + public const int SAMPLES_3DFX = 0x86B4; + public const int SAMPLES_ARB = 0x80A9; + public const int SAMPLES_EXT = 0x80A9; + public const int SAMPLES_PASSED = 0x8914; + public const int SAMPLES_PASSED_ARB = 0x8914; + public const int SAMPLES_SGIS = 0x80A9; + public const int SAMPLE_ALPHA_TO_COVERAGE = 0x809E; + public const int SAMPLE_ALPHA_TO_COVERAGE_ARB = 0x809E; + public const int SAMPLE_ALPHA_TO_MASK_EXT = 0x809E; + public const int SAMPLE_ALPHA_TO_MASK_SGIS = 0x809E; + public const int SAMPLE_ALPHA_TO_ONE = 0x809F; + public const int SAMPLE_ALPHA_TO_ONE_ARB = 0x809F; + public const int SAMPLE_ALPHA_TO_ONE_EXT = 0x809F; + public const int SAMPLE_ALPHA_TO_ONE_SGIS = 0x809F; + public const int SAMPLE_BUFFERS = 0x80A8; + public const int SAMPLE_BUFFERS_3DFX = 0x86B3; + public const int SAMPLE_BUFFERS_ARB = 0x80A8; + public const int SAMPLE_BUFFERS_EXT = 0x80A8; + public const int SAMPLE_BUFFERS_SGIS = 0x80A8; + public const int SAMPLE_COVERAGE = 0x80A0; + public const int SAMPLE_COVERAGE_ARB = 0x80A0; + public const int SAMPLE_COVERAGE_INVERT = 0x80AB; + public const int SAMPLE_COVERAGE_INVERT_ARB = 0x80AB; + public const int SAMPLE_COVERAGE_VALUE = 0x80AA; + public const int SAMPLE_COVERAGE_VALUE_ARB = 0x80AA; + public const int SAMPLE_LOCATION_ARB = 0x8E50; + public const int SAMPLE_LOCATION_NV = 0x8E50; + public const int SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB = 0x933F; + public const int SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV = 0x933F; + public const int SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB = 0x933E; + public const int SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV = 0x933E; + public const int SAMPLE_LOCATION_SUBPIXEL_BITS_ARB = 0x933D; + public const int SAMPLE_LOCATION_SUBPIXEL_BITS_NV = 0x933D; + public const int SAMPLE_MASK = 0x8E51; + public const int SAMPLE_MASK_EXT = 0x80A0; + public const int SAMPLE_MASK_INVERT_EXT = 0x80AB; + public const int SAMPLE_MASK_INVERT_SGIS = 0x80AB; + public const int SAMPLE_MASK_NV = 0x8E51; + public const int SAMPLE_MASK_SGIS = 0x80A0; + public const int SAMPLE_MASK_VALUE = 0x8E52; + public const int SAMPLE_MASK_VALUE_EXT = 0x80AA; + public const int SAMPLE_MASK_VALUE_NV = 0x8E52; + public const int SAMPLE_MASK_VALUE_SGIS = 0x80AA; + public const int SAMPLE_PATTERN_EXT = 0x80AC; + public const int SAMPLE_PATTERN_SGIS = 0x80AC; + public const int SAMPLE_POSITION = 0x8E50; + public const int SAMPLE_POSITION_NV = 0x8E50; + public const int SAMPLE_SHADING = 0x8C36; + public const int SAMPLE_SHADING_ARB = 0x8C36; + public const int SATURATE_BIT_ATI = 0x00000040; + public const int SCALAR_EXT = 0x87BE; + public const int SCALEBIAS_HINT_SGIX = 0x8322; + public const int SCALED_RESOLVE_FASTEST_EXT = 0x90BA; + public const int SCALED_RESOLVE_NICEST_EXT = 0x90BB; + public const int SCALE_BY_FOUR_NV = 0x853F; + public const int SCALE_BY_ONE_HALF_NV = 0x8540; + public const int SCALE_BY_TWO_NV = 0x853E; + public const int SCISSOR_BOX = 0x0C10; + public const int SCISSOR_BOX_EXCLUSIVE_NV = 0x9556; + public const int SCISSOR_COMMAND_NV = 0x0011; + public const int SCISSOR_TEST = 0x0C11; + public const int SCISSOR_TEST_EXCLUSIVE_NV = 0x9555; + public const int SCREEN_COORDINATES_REND = 0x8490; + public const int SCREEN_KHR = 0x9295; + public const int SCREEN_NV = 0x9295; + public const int SECONDARY_COLOR_ARRAY_ADDRESS_NV = 0x8F27; + public const int SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x889C; + public const int SECONDARY_COLOR_ARRAY_EXT = 0x845E; + public const int SECONDARY_COLOR_ARRAY_LENGTH_NV = 0x8F31; + public const int SECONDARY_COLOR_ARRAY_LIST_IBM = 103077; + public const int SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM = 103087; + public const int SECONDARY_COLOR_ARRAY_POINTER_EXT = 0x845D; + public const int SECONDARY_COLOR_ARRAY_SIZE_EXT = 0x845A; + public const int SECONDARY_COLOR_ARRAY_STRIDE_EXT = 0x845C; + public const int SECONDARY_COLOR_ARRAY_TYPE_EXT = 0x845B; + public const int SECONDARY_COLOR_NV = 0x852D; + public const int SECONDARY_INTERPOLATOR_ATI = 0x896D; + public const int SEMAPHORE_TYPE_BINARY_NV = 0x95B4; + public const int SEMAPHORE_TYPE_NV = 0x95B3; + public const int SEMAPHORE_TYPE_TIMELINE_NV = 0x95B5; + public const int SEPARABLE_2D_EXT = 0x8012; + public const int SEPARATE_ATTRIBS = 0x8C8D; + public const int SEPARATE_ATTRIBS_EXT = 0x8C8D; + public const int SEPARATE_ATTRIBS_NV = 0x8C8D; + public const int SEPARATE_SPECULAR_COLOR_EXT = 0x81FA; + public const int SET = 0x150F; + public const int SET_AMD = 0x874A; + public const int SHADER = 0x82E1; + public const int SHADER_BINARY_FORMATS = 0x8DF8; + public const int SHADER_BINARY_FORMAT_SPIR_V = 0x9551; + public const int SHADER_BINARY_FORMAT_SPIR_V_ARB = 0x9551; + public const int SHADER_COMPILER = 0x8DFA; + public const int SHADER_CONSISTENT_NV = 0x86DD; + public const int SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV = 0x00000010; + public const int SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020; + public const int SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT = 0x00000020; + public const int SHADER_IMAGE_ATOMIC = 0x82A6; + public const int SHADER_IMAGE_LOAD = 0x82A4; + public const int SHADER_IMAGE_STORE = 0x82A5; + public const int SHADER_INCLUDE_ARB = 0x8DAE; + public const int SHADER_OBJECT_ARB = 0x8B48; + public const int SHADER_OBJECT_EXT = 0x8B48; + public const int SHADER_OPERATION_NV = 0x86DF; + public const int SHADER_SOURCE_LENGTH = 0x8B88; + public const int SHADER_STORAGE_BARRIER_BIT = 0x00002000; + public const int SHADER_STORAGE_BLOCK = 0x92E6; + public const int SHADER_STORAGE_BUFFER = 0x90D2; + public const int SHADER_STORAGE_BUFFER_BINDING = 0x90D3; + public const int SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 0x90DF; + public const int SHADER_STORAGE_BUFFER_SIZE = 0x90D5; + public const int SHADER_STORAGE_BUFFER_START = 0x90D4; + public const int SHADER_TYPE = 0x8B4F; + public const int SHADING_LANGUAGE_VERSION = 0x8B8C; + public const int SHADING_LANGUAGE_VERSION_ARB = 0x8B8C; + public const int SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV = 0x956F; + public const int SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV = 0x9566; + public const int SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV = 0x9567; + public const int SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV = 0x9568; + public const int SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV = 0x9569; + public const int SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV = 0x956A; + public const int SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV = 0x956B; + public const int SHADING_RATE_1_INVOCATION_PER_PIXEL_NV = 0x9565; + public const int SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV = 0x956C; + public const int SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV = 0x956D; + public const int SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV = 0x956E; + public const int SHADING_RATE_IMAGE_BINDING_NV = 0x955B; + public const int SHADING_RATE_IMAGE_NV = 0x9563; + public const int SHADING_RATE_IMAGE_PALETTE_COUNT_NV = 0x95B2; + public const int SHADING_RATE_IMAGE_PALETTE_SIZE_NV = 0x955E; + public const int SHADING_RATE_IMAGE_PER_PRIMITIVE_NV = 0x95B1; + public const int SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV = 0x955D; + public const int SHADING_RATE_IMAGE_TEXEL_WIDTH_NV = 0x955C; + public const int SHADING_RATE_NO_INVOCATIONS_NV = 0x9564; + public const int SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV = 0x95AE; + public const int SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV = 0x95AF; + public const int SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV = 0x95B0; + public const int SHADOW_AMBIENT_SGIX = 0x80BF; + public const int SHADOW_ATTENUATION_EXT = 0x834E; + public const int SHARED_EDGE_NV = 0xC0; + public const int SHARED_TEXTURE_PALETTE_EXT = 0x81FB; + public const int SHARPEN_TEXTURE_FUNC_POINTS_SGIS = 0x80B0; + public const int SHORT = 0x1402; + public const int SIGNALED = 0x9119; + public const int SIGNED_ALPHA8_NV = 0x8706; + public const int SIGNED_ALPHA_NV = 0x8705; + public const int SIGNED_HILO16_NV = 0x86FA; + public const int SIGNED_HILO8_NV = 0x885F; + public const int SIGNED_HILO_NV = 0x86F9; + public const int SIGNED_IDENTITY_NV = 0x853C; + public const int SIGNED_INTENSITY8_NV = 0x8708; + public const int SIGNED_INTENSITY_NV = 0x8707; + public const int SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704; + public const int SIGNED_LUMINANCE8_NV = 0x8702; + public const int SIGNED_LUMINANCE_ALPHA_NV = 0x8703; + public const int SIGNED_LUMINANCE_NV = 0x8701; + public const int SIGNED_NEGATE_NV = 0x853D; + public const int SIGNED_NORMALIZED = 0x8F9C; + public const int SIGNED_RGB8_NV = 0x86FF; + public const int SIGNED_RGB8_UNSIGNED_ALPHA8_NV = 0x870D; + public const int SIGNED_RGBA8_NV = 0x86FC; + public const int SIGNED_RGBA_NV = 0x86FB; + public const int SIGNED_RGB_NV = 0x86FE; + public const int SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C; + public const int SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 0x82AC; + public const int SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 0x82AE; + public const int SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 0x82AD; + public const int SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 0x82AF; + public const int SINGLE_COLOR_EXT = 0x81F9; + public const int SKIP_COMPONENTS1_NV = -6; + public const int SKIP_COMPONENTS2_NV = -5; + public const int SKIP_COMPONENTS3_NV = -4; + public const int SKIP_COMPONENTS4_NV = -3; + public const int SKIP_DECODE_EXT = 0x8A4A; + public const int SKIP_MISSING_GLYPH_NV = 0x90A9; + public const int SLICE_ACCUM_SUN = 0x85CC; + public const int SLUMINANCE8_ALPHA8_EXT = 0x8C45; + public const int SLUMINANCE8_EXT = 0x8C47; + public const int SLUMINANCE_ALPHA_EXT = 0x8C44; + public const int SLUMINANCE_EXT = 0x8C46; + public const int SMALL_CCW_ARC_TO_NV = 0x12; + public const int SMALL_CW_ARC_TO_NV = 0x14; + public const int SMOOTH_CUBIC_CURVE_TO_NV = 0x10; + public const int SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23; + public const int SMOOTH_LINE_WIDTH_RANGE = 0x0B22; + public const int SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13; + public const int SMOOTH_POINT_SIZE_RANGE = 0x0B12; + public const int SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0E; + public const int SM_COUNT_NV = 0x933B; + public const int SOFTLIGHT_KHR = 0x929C; + public const int SOFTLIGHT_NV = 0x929C; + public const int SOURCE0_ALPHA_ARB = 0x8588; + public const int SOURCE0_ALPHA_EXT = 0x8588; + public const int SOURCE0_RGB_ARB = 0x8580; + public const int SOURCE0_RGB_EXT = 0x8580; + public const int SOURCE1_ALPHA = 0x8589; + public const int SOURCE1_ALPHA_ARB = 0x8589; + public const int SOURCE1_ALPHA_EXT = 0x8589; + public const int SOURCE1_RGB_ARB = 0x8581; + public const int SOURCE1_RGB_EXT = 0x8581; + public const int SOURCE2_ALPHA_ARB = 0x858A; + public const int SOURCE2_ALPHA_EXT = 0x858A; + public const int SOURCE2_RGB_ARB = 0x8582; + public const int SOURCE2_RGB_EXT = 0x8582; + public const int SOURCE3_ALPHA_NV = 0x858B; + public const int SOURCE3_RGB_NV = 0x8583; + public const int SPARE0_NV = 0x852E; + public const int SPARE0_PLUS_SECONDARY_COLOR_NV = 0x8532; + public const int SPARE1_NV = 0x852F; + public const int SPARSE_BUFFER_PAGE_SIZE_ARB = 0x82F8; + public const int SPARSE_STORAGE_BIT_ARB = 0x0400; + public const int SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB = 0x91A9; + public const int SPIR_V_BINARY = 0x9552; + public const int SPIR_V_BINARY_ARB = 0x9552; + public const int SPIR_V_EXTENSIONS = 0x9553; + public const int SPRITE_AXIAL_SGIX = 0x814C; + public const int SPRITE_AXIS_SGIX = 0x814A; + public const int SPRITE_EYE_ALIGNED_SGIX = 0x814E; + public const int SPRITE_MODE_SGIX = 0x8149; + public const int SPRITE_OBJECT_ALIGNED_SGIX = 0x814D; + public const int SPRITE_SGIX = 0x8148; + public const int SPRITE_TRANSLATION_SGIX = 0x814B; + public const int SQUARE_NV = 0x90A3; + public const int SR8_EXT = 0x8FBD; + public const int SRC1_ALPHA = 0x8589; + public const int SRC1_COLOR = 0x88F9; + public const int SRC_ALPHA = 0x0302; + public const int SRC_ALPHA_SATURATE = 0x0308; + public const int SRC_ATOP_NV = 0x928E; + public const int SRC_COLOR = 0x0300; + public const int SRC_IN_NV = 0x928A; + public const int SRC_NV = 0x9286; + public const int SRC_OUT_NV = 0x928C; + public const int SRC_OVER_NV = 0x9288; + public const int SRG8_EXT = 0x8FBE; + public const int SRGB = 0x8C40; + public const int SRGB8 = 0x8C41; + public const int SRGB8_ALPHA8 = 0x8C43; + public const int SRGB8_ALPHA8_EXT = 0x8C43; + public const int SRGB8_EXT = 0x8C41; + public const int SRGB_ALPHA = 0x8C42; + public const int SRGB_ALPHA_EXT = 0x8C42; + public const int SRGB_DECODE_ARB = 0x8299; + public const int SRGB_EXT = 0x8C40; + public const int SRGB_READ = 0x8297; + public const int SRGB_WRITE = 0x8298; + public const int STACK_OVERFLOW = 0x0503; + public const int STACK_UNDERFLOW = 0x0504; + public const int STANDARD_FONT_FORMAT_NV = 0x936C; + public const int STANDARD_FONT_NAME_NV = 0x9072; + public const int STATIC_ATI = 0x8760; + public const int STATIC_COPY = 0x88E6; + public const int STATIC_COPY_ARB = 0x88E6; + public const int STATIC_DRAW = 0x88E4; + public const int STATIC_DRAW_ARB = 0x88E4; + public const int STATIC_READ = 0x88E5; + public const int STATIC_READ_ARB = 0x88E5; + public const int STATIC_VERTEX_ARRAY_IBM = 103061; + public const int STENCIL = 0x1802; + public const int STENCIL_ATTACHMENT = 0x8D20; + public const int STENCIL_ATTACHMENT_EXT = 0x8D20; + public const int STENCIL_BACK_FAIL = 0x8801; + public const int STENCIL_BACK_FAIL_ATI = 0x8801; + public const int STENCIL_BACK_FUNC = 0x8800; + public const int STENCIL_BACK_FUNC_ATI = 0x8800; + public const int STENCIL_BACK_OP_VALUE_AMD = 0x874D; + public const int STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; + public const int STENCIL_BACK_PASS_DEPTH_FAIL_ATI = 0x8802; + public const int STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; + public const int STENCIL_BACK_PASS_DEPTH_PASS_ATI = 0x8803; + public const int STENCIL_BACK_REF = 0x8CA3; + public const int STENCIL_BACK_VALUE_MASK = 0x8CA4; + public const int STENCIL_BACK_WRITEMASK = 0x8CA5; + public const int STENCIL_BUFFER_BIT = 0x00000400; + public const int STENCIL_CLEAR_TAG_VALUE_EXT = 0x88F3; + public const int STENCIL_CLEAR_VALUE = 0x0B91; + public const int STENCIL_COMPONENTS = 0x8285; + public const int STENCIL_FAIL = 0x0B94; + public const int STENCIL_FUNC = 0x0B92; + public const int STENCIL_INDEX = 0x1901; + public const int STENCIL_INDEX1 = 0x8D46; + public const int STENCIL_INDEX16 = 0x8D49; + public const int STENCIL_INDEX16_EXT = 0x8D49; + public const int STENCIL_INDEX1_EXT = 0x8D46; + public const int STENCIL_INDEX4 = 0x8D47; + public const int STENCIL_INDEX4_EXT = 0x8D47; + public const int STENCIL_INDEX8 = 0x8D48; + public const int STENCIL_INDEX8_EXT = 0x8D48; + public const int STENCIL_OP_VALUE_AMD = 0x874C; + public const int STENCIL_PASS_DEPTH_FAIL = 0x0B95; + public const int STENCIL_PASS_DEPTH_PASS = 0x0B96; + public const int STENCIL_REF = 0x0B97; + public const int STENCIL_REF_COMMAND_NV = 0x000C; + public const int STENCIL_RENDERABLE = 0x8288; + public const int STENCIL_SAMPLES_NV = 0x932E; + public const int STENCIL_TAG_BITS_EXT = 0x88F2; + public const int STENCIL_TEST = 0x0B90; + public const int STENCIL_TEST_TWO_SIDE_EXT = 0x8910; + public const int STENCIL_VALUE_MASK = 0x0B93; + public const int STENCIL_WRITEMASK = 0x0B98; + public const int STEREO = 0x0C33; + public const int STORAGE_CACHED_APPLE = 0x85BE; + public const int STORAGE_CLIENT_APPLE = 0x85B4; + public const int STORAGE_PRIVATE_APPLE = 0x85BD; + public const int STORAGE_SHARED_APPLE = 0x85BF; + public const int STREAM_COPY = 0x88E2; + public const int STREAM_COPY_ARB = 0x88E2; + public const int STREAM_DRAW = 0x88E0; + public const int STREAM_DRAW_ARB = 0x88E0; + public const int STREAM_RASTERIZATION_AMD = 0x91A0; + public const int STREAM_READ = 0x88E1; + public const int STREAM_READ_ARB = 0x88E1; + public const int STRICT_DEPTHFUNC_HINT_PGI = 0x1A216; + public const int STRICT_LIGHTING_HINT_PGI = 0x1A217; + public const int STRICT_SCISSOR_HINT_PGI = 0x1A218; + public const int SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR = 0x00000004; + public const int SUBGROUP_FEATURE_BALLOT_BIT_KHR = 0x00000008; + public const int SUBGROUP_FEATURE_BASIC_BIT_KHR = 0x00000001; + public const int SUBGROUP_FEATURE_CLUSTERED_BIT_KHR = 0x00000040; + public const int SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0x00000100; + public const int SUBGROUP_FEATURE_QUAD_BIT_KHR = 0x00000080; + public const int SUBGROUP_FEATURE_SHUFFLE_BIT_KHR = 0x00000010; + public const int SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR = 0x00000020; + public const int SUBGROUP_FEATURE_VOTE_BIT_KHR = 0x00000002; + public const int SUBGROUP_QUAD_ALL_STAGES_KHR = 0x9535; + public const int SUBGROUP_SIZE_KHR = 0x9532; + public const int SUBGROUP_SUPPORTED_FEATURES_KHR = 0x9534; + public const int SUBGROUP_SUPPORTED_STAGES_KHR = 0x9533; + public const int SUBPIXEL_BITS = 0x0D50; + public const int SUBPIXEL_PRECISION_BIAS_X_BITS_NV = 0x9347; + public const int SUBPIXEL_PRECISION_BIAS_Y_BITS_NV = 0x9348; + public const int SUBSAMPLE_DISTANCE_AMD = 0x883F; + public const int SUBTRACT_ARB = 0x84E7; + public const int SUB_ATI = 0x8965; + public const int SUCCESS_NV = 0x902F; + public const int SUPERSAMPLE_SCALE_X_NV = 0x9372; + public const int SUPERSAMPLE_SCALE_Y_NV = 0x9373; + public const int SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B7; + public const int SURFACE_MAPPED_NV = 0x8700; + public const int SURFACE_REGISTERED_NV = 0x86FD; + public const int SURFACE_STATE_NV = 0x86EB; + public const int SWIZZLE_STQ_ATI = 0x8977; + public const int SWIZZLE_STQ_DQ_ATI = 0x8979; + public const int SWIZZLE_STRQ_ATI = 0x897A; + public const int SWIZZLE_STRQ_DQ_ATI = 0x897B; + public const int SWIZZLE_STR_ATI = 0x8976; + public const int SWIZZLE_STR_DR_ATI = 0x8978; + public const int SYNC_CL_EVENT_ARB = 0x8240; + public const int SYNC_CL_EVENT_COMPLETE_ARB = 0x8241; + public const int SYNC_CONDITION = 0x9113; + public const int SYNC_FENCE = 0x9116; + public const int SYNC_FLAGS = 0x9115; + public const int SYNC_FLUSH_COMMANDS_BIT = 0x00000001; + public const int SYNC_GPU_COMMANDS_COMPLETE = 0x9117; + public const int SYNC_STATUS = 0x9114; + public const int SYNC_X11_FENCE_EXT = 0x90E1; + public const int SYSTEM_FONT_NAME_NV = 0x9073; + public const int T2F_IUI_N3F_V2F_EXT = 0x81B3; + public const int T2F_IUI_N3F_V3F_EXT = 0x81B4; + public const int T2F_IUI_V2F_EXT = 0x81B1; + public const int T2F_IUI_V3F_EXT = 0x81B2; + public const int TABLE_TOO_LARGE_EXT = 0x8031; + public const int TANGENT_ARRAY_EXT = 0x8439; + public const int TANGENT_ARRAY_POINTER_EXT = 0x8442; + public const int TANGENT_ARRAY_STRIDE_EXT = 0x843F; + public const int TANGENT_ARRAY_TYPE_EXT = 0x843E; + public const int TASK_SHADER_BIT_NV = 0x00000080; + public const int TASK_SHADER_NV = 0x955A; + public const int TASK_SUBROUTINE_NV = 0x957D; + public const int TASK_SUBROUTINE_UNIFORM_NV = 0x957F; + public const int TASK_WORK_GROUP_SIZE_NV = 0x953F; + public const int TERMINATE_SEQUENCE_COMMAND_NV = 0x0000; + public const int TESSELLATION_FACTOR_AMD = 0x9005; + public const int TESSELLATION_MODE_AMD = 0x9004; + public const int TESS_CONTROL_OUTPUT_VERTICES = 0x8E75; + public const int TESS_CONTROL_PROGRAM_NV = 0x891E; + public const int TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV = 0x8C74; + public const int TESS_CONTROL_SHADER = 0x8E88; + public const int TESS_CONTROL_SHADER_BIT = 0x00000008; + public const int TESS_CONTROL_SHADER_PATCHES = 0x82F1; + public const int TESS_CONTROL_SHADER_PATCHES_ARB = 0x82F1; + public const int TESS_CONTROL_SUBROUTINE = 0x92E9; + public const int TESS_CONTROL_SUBROUTINE_UNIFORM = 0x92EF; + public const int TESS_CONTROL_TEXTURE = 0x829C; + public const int TESS_EVALUATION_PROGRAM_NV = 0x891F; + public const int TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV = 0x8C75; + public const int TESS_EVALUATION_SHADER = 0x8E87; + public const int TESS_EVALUATION_SHADER_BIT = 0x00000010; + public const int TESS_EVALUATION_SHADER_INVOCATIONS = 0x82F2; + public const int TESS_EVALUATION_SHADER_INVOCATIONS_ARB = 0x82F2; + public const int TESS_EVALUATION_SUBROUTINE = 0x92EA; + public const int TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0; + public const int TESS_EVALUATION_TEXTURE = 0x829D; + public const int TESS_GEN_MODE = 0x8E76; + public const int TESS_GEN_POINT_MODE = 0x8E79; + public const int TESS_GEN_SPACING = 0x8E77; + public const int TESS_GEN_VERTEX_ORDER = 0x8E78; + public const int TEXCOORD1_BIT_PGI = 0x10000000; + public const int TEXCOORD2_BIT_PGI = 0x20000000; + public const int TEXCOORD3_BIT_PGI = 0x40000000; + public const uint TEXCOORD4_BIT_PGI = 0x80000000; + public const int TEXTURE = 0x1702; + public const int TEXTURE0 = 0x84C0; + public const int TEXTURE0_ARB = 0x84C0; + public const int TEXTURE1 = 0x84C1; + public const int TEXTURE10 = 0x84CA; + public const int TEXTURE10_ARB = 0x84CA; + public const int TEXTURE11 = 0x84CB; + public const int TEXTURE11_ARB = 0x84CB; + public const int TEXTURE12 = 0x84CC; + public const int TEXTURE12_ARB = 0x84CC; + public const int TEXTURE13 = 0x84CD; + public const int TEXTURE13_ARB = 0x84CD; + public const int TEXTURE14 = 0x84CE; + public const int TEXTURE14_ARB = 0x84CE; + public const int TEXTURE15 = 0x84CF; + public const int TEXTURE15_ARB = 0x84CF; + public const int TEXTURE16 = 0x84D0; + public const int TEXTURE16_ARB = 0x84D0; + public const int TEXTURE17 = 0x84D1; + public const int TEXTURE17_ARB = 0x84D1; + public const int TEXTURE18 = 0x84D2; + public const int TEXTURE18_ARB = 0x84D2; + public const int TEXTURE19 = 0x84D3; + public const int TEXTURE19_ARB = 0x84D3; + public const int TEXTURE1_ARB = 0x84C1; + public const int TEXTURE2 = 0x84C2; + public const int TEXTURE20 = 0x84D4; + public const int TEXTURE20_ARB = 0x84D4; + public const int TEXTURE21 = 0x84D5; + public const int TEXTURE21_ARB = 0x84D5; + public const int TEXTURE22 = 0x84D6; + public const int TEXTURE22_ARB = 0x84D6; + public const int TEXTURE23 = 0x84D7; + public const int TEXTURE23_ARB = 0x84D7; + public const int TEXTURE24 = 0x84D8; + public const int TEXTURE24_ARB = 0x84D8; + public const int TEXTURE25 = 0x84D9; + public const int TEXTURE25_ARB = 0x84D9; + public const int TEXTURE26 = 0x84DA; + public const int TEXTURE26_ARB = 0x84DA; + public const int TEXTURE27 = 0x84DB; + public const int TEXTURE27_ARB = 0x84DB; + public const int TEXTURE28 = 0x84DC; + public const int TEXTURE28_ARB = 0x84DC; + public const int TEXTURE29 = 0x84DD; + public const int TEXTURE29_ARB = 0x84DD; + public const int TEXTURE2_ARB = 0x84C2; + public const int TEXTURE3 = 0x84C3; + public const int TEXTURE30 = 0x84DE; + public const int TEXTURE30_ARB = 0x84DE; + public const int TEXTURE31 = 0x84DF; + public const int TEXTURE31_ARB = 0x84DF; + public const int TEXTURE3_ARB = 0x84C3; + public const int TEXTURE4 = 0x84C4; + public const int TEXTURE4_ARB = 0x84C4; + public const int TEXTURE5 = 0x84C5; + public const int TEXTURE5_ARB = 0x84C5; + public const int TEXTURE6 = 0x84C6; + public const int TEXTURE6_ARB = 0x84C6; + public const int TEXTURE7 = 0x84C7; + public const int TEXTURE7_ARB = 0x84C7; + public const int TEXTURE8 = 0x84C8; + public const int TEXTURE8_ARB = 0x84C8; + public const int TEXTURE9 = 0x84C9; + public const int TEXTURE9_ARB = 0x84C9; + public const int TEXTURE_1D = 0x0DE0; + public const int TEXTURE_1D_ARRAY = 0x8C18; + public const int TEXTURE_1D_ARRAY_EXT = 0x8C18; + public const int TEXTURE_1D_BINDING_EXT = 0x8068; + public const int TEXTURE_1D_STACK_BINDING_MESAX = 0x875D; + public const int TEXTURE_1D_STACK_MESAX = 0x8759; + public const int TEXTURE_2D = 0x0DE1; + public const int TEXTURE_2D_ARRAY = 0x8C1A; + public const int TEXTURE_2D_ARRAY_EXT = 0x8C1A; + public const int TEXTURE_2D_BINDING_EXT = 0x8069; + public const int TEXTURE_2D_MULTISAMPLE = 0x9100; + public const int TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102; + public const int TEXTURE_2D_STACK_BINDING_MESAX = 0x875E; + public const int TEXTURE_2D_STACK_MESAX = 0x875A; + public const int TEXTURE_3D = 0x806F; + public const int TEXTURE_3D_BINDING_EXT = 0x806A; + public const int TEXTURE_3D_EXT = 0x806F; + public const int TEXTURE_4DSIZE_SGIS = 0x8136; + public const int TEXTURE_4D_BINDING_SGIS = 0x814F; + public const int TEXTURE_4D_SGIS = 0x8134; + public const int TEXTURE_ALPHA_SIZE = 0x805F; + public const int TEXTURE_ALPHA_SIZE_EXT = 0x805F; + public const int TEXTURE_ALPHA_TYPE = 0x8C13; + public const int TEXTURE_ALPHA_TYPE_ARB = 0x8C13; + public const int TEXTURE_APPLICATION_MODE_EXT = 0x834F; + public const int TEXTURE_BASE_LEVEL = 0x813C; + public const int TEXTURE_BASE_LEVEL_SGIS = 0x813C; + public const int TEXTURE_BINDING_1D = 0x8068; + public const int TEXTURE_BINDING_1D_ARRAY = 0x8C1C; + public const int TEXTURE_BINDING_1D_ARRAY_EXT = 0x8C1C; + public const int TEXTURE_BINDING_2D = 0x8069; + public const int TEXTURE_BINDING_2D_ARRAY = 0x8C1D; + public const int TEXTURE_BINDING_2D_ARRAY_EXT = 0x8C1D; + public const int TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104; + public const int TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105; + public const int TEXTURE_BINDING_3D = 0x806A; + public const int TEXTURE_BINDING_BUFFER = 0x8C2C; + public const int TEXTURE_BINDING_BUFFER_ARB = 0x8C2C; + public const int TEXTURE_BINDING_BUFFER_EXT = 0x8C2C; + public const int TEXTURE_BINDING_CUBE_MAP = 0x8514; + public const int TEXTURE_BINDING_CUBE_MAP_ARB = 0x8514; + public const int TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A; + public const int TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB = 0x900A; + public const int TEXTURE_BINDING_CUBE_MAP_EXT = 0x8514; + public const int TEXTURE_BINDING_RECTANGLE = 0x84F6; + public const int TEXTURE_BINDING_RECTANGLE_ARB = 0x84F6; + public const int TEXTURE_BINDING_RECTANGLE_NV = 0x84F6; + public const int TEXTURE_BINDING_RENDERBUFFER_NV = 0x8E53; + public const int TEXTURE_BLUE_SIZE = 0x805E; + public const int TEXTURE_BLUE_SIZE_EXT = 0x805E; + public const int TEXTURE_BLUE_TYPE = 0x8C12; + public const int TEXTURE_BLUE_TYPE_ARB = 0x8C12; + public const int TEXTURE_BORDER_COLOR = 0x1004; + public const int TEXTURE_BORDER_VALUES_NV = 0x871A; + public const int TEXTURE_BUFFER = 0x8C2A; + public const int TEXTURE_BUFFER_ARB = 0x8C2A; + public const int TEXTURE_BUFFER_BINDING = 0x8C2A; + public const int TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D; + public const int TEXTURE_BUFFER_DATA_STORE_BINDING_ARB = 0x8C2D; + public const int TEXTURE_BUFFER_DATA_STORE_BINDING_EXT = 0x8C2D; + public const int TEXTURE_BUFFER_EXT = 0x8C2A; + public const int TEXTURE_BUFFER_FORMAT_ARB = 0x8C2E; + public const int TEXTURE_BUFFER_FORMAT_EXT = 0x8C2E; + public const int TEXTURE_BUFFER_OFFSET = 0x919D; + public const int TEXTURE_BUFFER_OFFSET_ALIGNMENT = 0x919F; + public const int TEXTURE_BUFFER_SIZE = 0x919E; + public const int TEXTURE_CLIPMAP_CENTER_SGIX = 0x8171; + public const int TEXTURE_CLIPMAP_DEPTH_SGIX = 0x8176; + public const int TEXTURE_CLIPMAP_FRAME_SGIX = 0x8172; + public const int TEXTURE_CLIPMAP_LOD_OFFSET_SGIX = 0x8175; + public const int TEXTURE_CLIPMAP_OFFSET_SGIX = 0x8173; + public const int TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX = 0x8174; + public const int TEXTURE_COLOR_SAMPLES_NV = 0x9046; + public const int TEXTURE_COLOR_TABLE_SGI = 0x80BC; + public const int TEXTURE_COLOR_WRITEMASK_SGIS = 0x81EF; + public const int TEXTURE_COMPARE_FAIL_VALUE_ARB = 0x80BF; + public const int TEXTURE_COMPARE_FUNC = 0x884D; + public const int TEXTURE_COMPARE_FUNC_ARB = 0x884D; + public const int TEXTURE_COMPARE_MODE = 0x884C; + public const int TEXTURE_COMPARE_MODE_ARB = 0x884C; + public const int TEXTURE_COMPARE_OPERATOR_SGIX = 0x819B; + public const int TEXTURE_COMPARE_SGIX = 0x819A; + public const int TEXTURE_COMPRESSED = 0x86A1; + public const int TEXTURE_COMPRESSED_ARB = 0x86A1; + public const int TEXTURE_COMPRESSED_BLOCK_HEIGHT = 0x82B2; + public const int TEXTURE_COMPRESSED_BLOCK_SIZE = 0x82B3; + public const int TEXTURE_COMPRESSED_BLOCK_WIDTH = 0x82B1; + public const int TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0; + public const int TEXTURE_COMPRESSED_IMAGE_SIZE_ARB = 0x86A0; + public const int TEXTURE_COMPRESSION_HINT = 0x84EF; + public const int TEXTURE_COMPRESSION_HINT_ARB = 0x84EF; + public const int TEXTURE_CONSTANT_DATA_SUNX = 0x81D6; + public const int TEXTURE_COORD_ARRAY_ADDRESS_NV = 0x8F25; + public const int TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB = 0x889A; + public const int TEXTURE_COORD_ARRAY_COUNT_EXT = 0x808B; + public const int TEXTURE_COORD_ARRAY_EXT = 0x8078; + public const int TEXTURE_COORD_ARRAY_LENGTH_NV = 0x8F2F; + public const int TEXTURE_COORD_ARRAY_LIST_IBM = 103074; + public const int TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM = 103084; + public const int TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F8; + public const int TEXTURE_COORD_ARRAY_POINTER_EXT = 0x8092; + public const int TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088; + public const int TEXTURE_COORD_ARRAY_STRIDE_EXT = 0x808A; + public const int TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089; + public const int TEXTURE_COORD_NV = 0x8C79; + public const int TEXTURE_COVERAGE_SAMPLES_NV = 0x9045; + public const int TEXTURE_CUBE_MAP = 0x8513; + public const int TEXTURE_CUBE_MAP_ARB = 0x8513; + public const int TEXTURE_CUBE_MAP_ARRAY = 0x9009; + public const int TEXTURE_CUBE_MAP_ARRAY_ARB = 0x9009; + public const int TEXTURE_CUBE_MAP_EXT = 0x8513; + public const int TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; + public const int TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x8516; + public const int TEXTURE_CUBE_MAP_NEGATIVE_X_EXT = 0x8516; + public const int TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; + public const int TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x8518; + public const int TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT = 0x8518; + public const int TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; + public const int TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x851A; + public const int TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT = 0x851A; + public const int TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; + public const int TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x8515; + public const int TEXTURE_CUBE_MAP_POSITIVE_X_EXT = 0x8515; + public const int TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; + public const int TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x8517; + public const int TEXTURE_CUBE_MAP_POSITIVE_Y_EXT = 0x8517; + public const int TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; + public const int TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x8519; + public const int TEXTURE_CUBE_MAP_POSITIVE_Z_EXT = 0x8519; + public const int TEXTURE_CUBE_MAP_SEAMLESS = 0x884F; + public const int TEXTURE_DEFORMATION_BIT_SGIX = 0x00000001; + public const int TEXTURE_DEFORMATION_SGIX = 0x8195; + public const int TEXTURE_DEPTH = 0x8071; + public const int TEXTURE_DEPTH_EXT = 0x8071; + public const int TEXTURE_DEPTH_SIZE = 0x884A; + public const int TEXTURE_DEPTH_SIZE_ARB = 0x884A; + public const int TEXTURE_DEPTH_TYPE = 0x8C16; + public const int TEXTURE_DEPTH_TYPE_ARB = 0x8C16; + public const int TEXTURE_DS_SIZE_NV = 0x871D; + public const int TEXTURE_DT_SIZE_NV = 0x871E; + public const int TEXTURE_ENV_BIAS_SGIX = 0x80BE; + public const int TEXTURE_FETCH_BARRIER_BIT = 0x00000008; + public const int TEXTURE_FETCH_BARRIER_BIT_EXT = 0x00000008; + public const int TEXTURE_FILTER4_SIZE_SGIS = 0x8147; + public const int TEXTURE_FILTER_CONTROL_EXT = 0x8500; + public const int TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107; + public const int TEXTURE_FLOAT_COMPONENTS_NV = 0x888C; + public const int TEXTURE_FREE_MEMORY_ATI = 0x87FC; + public const int TEXTURE_GATHER = 0x82A2; + public const int TEXTURE_GATHER_SHADOW = 0x82A3; + public const int TEXTURE_GEQUAL_R_SGIX = 0x819D; + public const int TEXTURE_GREEN_SIZE = 0x805D; + public const int TEXTURE_GREEN_SIZE_EXT = 0x805D; + public const int TEXTURE_GREEN_TYPE = 0x8C11; + public const int TEXTURE_GREEN_TYPE_ARB = 0x8C11; + public const int TEXTURE_HEIGHT = 0x1001; + public const int TEXTURE_HI_SIZE_NV = 0x871B; + public const int TEXTURE_IMAGE_FORMAT = 0x828F; + public const int TEXTURE_IMAGE_TYPE = 0x8290; + public const int TEXTURE_IMMUTABLE_FORMAT = 0x912F; + public const int TEXTURE_IMMUTABLE_FORMAT_EXT = 0x912F; + public const int TEXTURE_IMMUTABLE_LEVELS = 0x82DF; + public const int TEXTURE_INDEX_SIZE_EXT = 0x80ED; + public const int TEXTURE_INTENSITY_SIZE_EXT = 0x8061; + public const int TEXTURE_INTENSITY_TYPE_ARB = 0x8C15; + public const int TEXTURE_INTERNAL_FORMAT = 0x1003; + public const int TEXTURE_LEQUAL_R_SGIX = 0x819C; + public const int TEXTURE_LIGHTING_MODE_HP = 0x8167; + public const int TEXTURE_LIGHT_EXT = 0x8350; + public const int TEXTURE_LOD_BIAS = 0x8501; + public const int TEXTURE_LOD_BIAS_EXT = 0x8501; + public const int TEXTURE_LOD_BIAS_R_SGIX = 0x8190; + public const int TEXTURE_LOD_BIAS_S_SGIX = 0x818E; + public const int TEXTURE_LOD_BIAS_T_SGIX = 0x818F; + public const int TEXTURE_LO_SIZE_NV = 0x871C; + public const int TEXTURE_LUMINANCE_SIZE_EXT = 0x8060; + public const int TEXTURE_LUMINANCE_TYPE_ARB = 0x8C14; + public const int TEXTURE_MAG_FILTER = 0x2800; + public const int TEXTURE_MAG_SIZE_NV = 0x871F; + public const int TEXTURE_MATERIAL_FACE_EXT = 0x8351; + public const int TEXTURE_MATERIAL_PARAMETER_EXT = 0x8352; + public const int TEXTURE_MAX_ANISOTROPY = 0x84FE; + public const int TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE; + public const int TEXTURE_MAX_CLAMP_R_SGIX = 0x836B; + public const int TEXTURE_MAX_CLAMP_S_SGIX = 0x8369; + public const int TEXTURE_MAX_CLAMP_T_SGIX = 0x836A; + public const int TEXTURE_MAX_LEVEL = 0x813D; + public const int TEXTURE_MAX_LEVEL_SGIS = 0x813D; + public const int TEXTURE_MAX_LOD = 0x813B; + public const int TEXTURE_MAX_LOD_SGIS = 0x813B; + public const int TEXTURE_MEMORY_LAYOUT_INTEL = 0x83FF; + public const int TEXTURE_MIN_FILTER = 0x2801; + public const int TEXTURE_MIN_LOD = 0x813A; + public const int TEXTURE_MIN_LOD_SGIS = 0x813A; + public const int TEXTURE_MULTI_BUFFER_HINT_SGIX = 0x812E; + public const int TEXTURE_NORMAL_EXT = 0x85AF; + public const int TEXTURE_POST_SPECULAR_HP = 0x8168; + public const int TEXTURE_PRE_SPECULAR_HP = 0x8169; + public const int TEXTURE_PRIORITY_EXT = 0x8066; + public const int TEXTURE_RANGE_LENGTH_APPLE = 0x85B7; + public const int TEXTURE_RANGE_POINTER_APPLE = 0x85B8; + public const int TEXTURE_RECTANGLE = 0x84F5; + public const int TEXTURE_RECTANGLE_ARB = 0x84F5; + public const int TEXTURE_RECTANGLE_NV = 0x84F5; + public const int TEXTURE_REDUCTION_MODE_ARB = 0x9366; + public const int TEXTURE_REDUCTION_MODE_EXT = 0x9366; + public const int TEXTURE_RED_SIZE = 0x805C; + public const int TEXTURE_RED_SIZE_EXT = 0x805C; + public const int TEXTURE_RED_TYPE = 0x8C10; + public const int TEXTURE_RED_TYPE_ARB = 0x8C10; + public const int TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV = 0x8E54; + public const int TEXTURE_RENDERBUFFER_NV = 0x8E55; + public const int TEXTURE_RESIDENT_EXT = 0x8067; + public const int TEXTURE_SAMPLES = 0x9106; + public const int TEXTURE_SHADER_NV = 0x86DE; + public const int TEXTURE_SHADOW = 0x82A1; + public const int TEXTURE_SHARED_SIZE = 0x8C3F; + public const int TEXTURE_SHARED_SIZE_EXT = 0x8C3F; + public const int TEXTURE_SPARSE_ARB = 0x91A6; + public const int TEXTURE_SRGB_DECODE_EXT = 0x8A48; + public const int TEXTURE_STENCIL_SIZE = 0x88F1; + public const int TEXTURE_STENCIL_SIZE_EXT = 0x88F1; + public const int TEXTURE_STORAGE_HINT_APPLE = 0x85BC; + public const int TEXTURE_STORAGE_SPARSE_BIT_AMD = 0x00000001; + public const int TEXTURE_SWIZZLE_A = 0x8E45; + public const int TEXTURE_SWIZZLE_A_EXT = 0x8E45; + public const int TEXTURE_SWIZZLE_B = 0x8E44; + public const int TEXTURE_SWIZZLE_B_EXT = 0x8E44; + public const int TEXTURE_SWIZZLE_G = 0x8E43; + public const int TEXTURE_SWIZZLE_G_EXT = 0x8E43; + public const int TEXTURE_SWIZZLE_R = 0x8E42; + public const int TEXTURE_SWIZZLE_RGBA = 0x8E46; + public const int TEXTURE_SWIZZLE_RGBA_EXT = 0x8E46; + public const int TEXTURE_SWIZZLE_R_EXT = 0x8E42; + public const int TEXTURE_TARGET = 0x1006; + public const int TEXTURE_TILING_EXT = 0x9580; + public const int TEXTURE_TOO_LARGE_EXT = 0x8065; + public const int TEXTURE_UNSIGNED_REMAP_MODE_NV = 0x888F; + public const int TEXTURE_UPDATE_BARRIER_BIT = 0x00000100; + public const int TEXTURE_UPDATE_BARRIER_BIT_EXT = 0x00000100; + public const int TEXTURE_VIEW = 0x82B5; + public const int TEXTURE_VIEW_MIN_LAYER = 0x82DD; + public const int TEXTURE_VIEW_MIN_LEVEL = 0x82DB; + public const int TEXTURE_VIEW_NUM_LAYERS = 0x82DE; + public const int TEXTURE_VIEW_NUM_LEVELS = 0x82DC; + public const int TEXTURE_WIDTH = 0x1000; + public const int TEXTURE_WRAP_Q_SGIS = 0x8137; + public const int TEXTURE_WRAP_R = 0x8072; + public const int TEXTURE_WRAP_R_EXT = 0x8072; + public const int TEXTURE_WRAP_S = 0x2802; + public const int TEXTURE_WRAP_T = 0x2803; + public const int TEXT_FRAGMENT_SHADER_ATI = 0x8200; + public const int TILE_RASTER_ORDER_FIXED_MESA = 0x8BB8; + public const int TILE_RASTER_ORDER_INCREASING_X_MESA = 0x8BB9; + public const int TILE_RASTER_ORDER_INCREASING_Y_MESA = 0x8BBA; + public const int TILING_TYPES_EXT = 0x9583; + public const int TIMELINE_SEMAPHORE_VALUE_NV = 0x9595; + public const int TIMEOUT_EXPIRED = 0x911B; + public const ulong TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFF; + public const int TIMESTAMP = 0x8E28; + public const int TIME_ELAPSED = 0x88BF; + public const int TIME_ELAPSED_EXT = 0x88BF; + public const int TOP_LEVEL_ARRAY_SIZE = 0x930C; + public const int TOP_LEVEL_ARRAY_STRIDE = 0x930D; + public const int TRACK_MATRIX_NV = 0x8648; + public const int TRACK_MATRIX_TRANSFORM_NV = 0x8649; + public const int TRANSFORM_FEEDBACK = 0x8E22; + public const int TRANSFORM_FEEDBACK_ACTIVE = 0x8E24; + public const int TRANSFORM_FEEDBACK_ATTRIBS_NV = 0x8C7E; + public const int TRANSFORM_FEEDBACK_BARRIER_BIT = 0x00000800; + public const int TRANSFORM_FEEDBACK_BARRIER_BIT_EXT = 0x00000800; + public const int TRANSFORM_FEEDBACK_BINDING = 0x8E25; + public const int TRANSFORM_FEEDBACK_BINDING_NV = 0x8E25; + public const int TRANSFORM_FEEDBACK_BUFFER = 0x8C8E; + public const int TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24; + public const int TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV = 0x8E24; + public const int TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F; + public const int TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT = 0x8C8F; + public const int TRANSFORM_FEEDBACK_BUFFER_BINDING_NV = 0x8C8F; + public const int TRANSFORM_FEEDBACK_BUFFER_EXT = 0x8C8E; + public const int TRANSFORM_FEEDBACK_BUFFER_INDEX = 0x934B; + public const int TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F; + public const int TRANSFORM_FEEDBACK_BUFFER_MODE_EXT = 0x8C7F; + public const int TRANSFORM_FEEDBACK_BUFFER_MODE_NV = 0x8C7F; + public const int TRANSFORM_FEEDBACK_BUFFER_NV = 0x8C8E; + public const int TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23; + public const int TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV = 0x8E23; + public const int TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85; + public const int TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT = 0x8C85; + public const int TRANSFORM_FEEDBACK_BUFFER_SIZE_NV = 0x8C85; + public const int TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84; + public const int TRANSFORM_FEEDBACK_BUFFER_START_EXT = 0x8C84; + public const int TRANSFORM_FEEDBACK_BUFFER_START_NV = 0x8C84; + public const int TRANSFORM_FEEDBACK_BUFFER_STRIDE = 0x934C; + public const int TRANSFORM_FEEDBACK_NV = 0x8E22; + public const int TRANSFORM_FEEDBACK_OVERFLOW = 0x82EC; + public const int TRANSFORM_FEEDBACK_OVERFLOW_ARB = 0x82EC; + public const int TRANSFORM_FEEDBACK_PAUSED = 0x8E23; + public const int TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88; + public const int TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT = 0x8C88; + public const int TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV = 0x8C88; + public const int TRANSFORM_FEEDBACK_RECORD_NV = 0x8C86; + public const int TRANSFORM_FEEDBACK_STREAM_OVERFLOW = 0x82ED; + public const int TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB = 0x82ED; + public const int TRANSFORM_FEEDBACK_VARYING = 0x92F4; + public const int TRANSFORM_FEEDBACK_VARYINGS = 0x8C83; + public const int TRANSFORM_FEEDBACK_VARYINGS_EXT = 0x8C83; + public const int TRANSFORM_FEEDBACK_VARYINGS_NV = 0x8C83; + public const int TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76; + public const int TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT = 0x8C76; + public const int TRANSFORM_HINT_APPLE = 0x85B1; + public const int TRANSLATE_2D_NV = 0x9090; + public const int TRANSLATE_3D_NV = 0x9091; + public const int TRANSLATE_X_NV = 0x908E; + public const int TRANSLATE_Y_NV = 0x908F; + public const int TRANSPOSE_AFFINE_2D_NV = 0x9096; + public const int TRANSPOSE_AFFINE_3D_NV = 0x9098; + public const int TRANSPOSE_COLOR_MATRIX_ARB = 0x84E6; + public const int TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7; + public const int TRANSPOSE_MODELVIEW_MATRIX_ARB = 0x84E3; + public const int TRANSPOSE_NV = 0x862C; + public const int TRANSPOSE_PROGRAM_MATRIX_EXT = 0x8E2E; + public const int TRANSPOSE_PROJECTION_MATRIX_ARB = 0x84E4; + public const int TRANSPOSE_TEXTURE_MATRIX_ARB = 0x84E5; + public const int TRIANGLES = 0x0004; + public const int TRIANGLES_ADJACENCY = 0x000C; + public const int TRIANGLES_ADJACENCY_ARB = 0x000C; + public const int TRIANGLES_ADJACENCY_EXT = 0x000C; + public const int TRIANGLE_FAN = 0x0006; + public const int TRIANGLE_LIST_SUN = 0x81D7; + public const int TRIANGLE_MESH_SUN = 0x8615; + public const int TRIANGLE_STRIP = 0x0005; + public const int TRIANGLE_STRIP_ADJACENCY = 0x000D; + public const int TRIANGLE_STRIP_ADJACENCY_ARB = 0x000D; + public const int TRIANGLE_STRIP_ADJACENCY_EXT = 0x000D; + public const int TRIANGULAR_NV = 0x90A5; + public const int TRUE = 1; + public const int TYPE = 0x92FA; + public const int UNCORRELATED_NV = 0x9282; + public const int UNDEFINED_APPLE = 0x8A1C; + public const int UNDEFINED_VERTEX = 0x8260; + public const int UNIFORM = 0x92E1; + public const int UNIFORM_ADDRESS_COMMAND_NV = 0x000A; + public const int UNIFORM_ARRAY_STRIDE = 0x8A3C; + public const int UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA; + public const int UNIFORM_BARRIER_BIT = 0x00000004; + public const int UNIFORM_BARRIER_BIT_EXT = 0x00000004; + public const int UNIFORM_BLOCK = 0x92E2; + public const int UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42; + public const int UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43; + public const int UNIFORM_BLOCK_BINDING = 0x8A3F; + public const int UNIFORM_BLOCK_DATA_SIZE = 0x8A40; + public const int UNIFORM_BLOCK_INDEX = 0x8A3A; + public const int UNIFORM_BLOCK_NAME_LENGTH = 0x8A41; + public const int UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 0x90EC; + public const int UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46; + public const int UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45; + public const int UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV = 0x959C; + public const int UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV = 0x959D; + public const int UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0; + public const int UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1; + public const int UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44; + public const int UNIFORM_BUFFER = 0x8A11; + public const int UNIFORM_BUFFER_ADDRESS_NV = 0x936F; + public const int UNIFORM_BUFFER_BINDING = 0x8A28; + public const int UNIFORM_BUFFER_BINDING_EXT = 0x8DEF; + public const int UNIFORM_BUFFER_EXT = 0x8DEE; + public const int UNIFORM_BUFFER_LENGTH_NV = 0x9370; + public const int UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34; + public const int UNIFORM_BUFFER_SIZE = 0x8A2A; + public const int UNIFORM_BUFFER_START = 0x8A29; + public const int UNIFORM_BUFFER_UNIFIED_NV = 0x936E; + public const int UNIFORM_IS_ROW_MAJOR = 0x8A3E; + public const int UNIFORM_MATRIX_STRIDE = 0x8A3D; + public const int UNIFORM_NAME_LENGTH = 0x8A39; + public const int UNIFORM_OFFSET = 0x8A3B; + public const int UNIFORM_SIZE = 0x8A38; + public const int UNIFORM_TYPE = 0x8A37; + public const int UNKNOWN_CONTEXT_RESET = 0x8255; + public const int UNKNOWN_CONTEXT_RESET_ARB = 0x8255; + public const int UNPACK_ALIGNMENT = 0x0CF5; + public const int UNPACK_CLIENT_STORAGE_APPLE = 0x85B2; + public const int UNPACK_CMYK_HINT_EXT = 0x800F; + public const int UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129; + public const int UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128; + public const int UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A; + public const int UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127; + public const int UNPACK_CONSTANT_DATA_SUNX = 0x81D5; + public const int UNPACK_IMAGE_DEPTH_SGIS = 0x8133; + public const int UNPACK_IMAGE_HEIGHT = 0x806E; + public const int UNPACK_IMAGE_HEIGHT_EXT = 0x806E; + public const int UNPACK_LSB_FIRST = 0x0CF1; + public const int UNPACK_RESAMPLE_OML = 0x8985; + public const int UNPACK_RESAMPLE_SGIX = 0x842F; + public const int UNPACK_ROW_BYTES_APPLE = 0x8A16; + public const int UNPACK_ROW_LENGTH = 0x0CF2; + public const int UNPACK_SKIP_IMAGES = 0x806D; + public const int UNPACK_SKIP_IMAGES_EXT = 0x806D; + public const int UNPACK_SKIP_PIXELS = 0x0CF4; + public const int UNPACK_SKIP_ROWS = 0x0CF3; + public const int UNPACK_SKIP_VOLUMES_SGIS = 0x8132; + public const int UNPACK_SUBSAMPLE_RATE_SGIX = 0x85A1; + public const int UNPACK_SWAP_BYTES = 0x0CF0; + public const int UNSIGNALED = 0x9118; + public const int UNSIGNED_BYTE = 0x1401; + public const int UNSIGNED_BYTE_2_3_3_REV = 0x8362; + public const int UNSIGNED_BYTE_3_3_2 = 0x8032; + public const int UNSIGNED_BYTE_3_3_2_EXT = 0x8032; + public const int UNSIGNED_IDENTITY_NV = 0x8536; + public const int UNSIGNED_INT = 0x1405; + public const int UNSIGNED_INT16_NV = 0x8FF0; + public const int UNSIGNED_INT16_VEC2_NV = 0x8FF1; + public const int UNSIGNED_INT16_VEC3_NV = 0x8FF2; + public const int UNSIGNED_INT16_VEC4_NV = 0x8FF3; + public const int UNSIGNED_INT64_AMD = 0x8BC2; + public const int UNSIGNED_INT64_ARB = 0x140F; + public const int UNSIGNED_INT64_NV = 0x140F; + public const int UNSIGNED_INT64_VEC2_ARB = 0x8FF5; + public const int UNSIGNED_INT64_VEC2_NV = 0x8FF5; + public const int UNSIGNED_INT64_VEC3_ARB = 0x8FF6; + public const int UNSIGNED_INT64_VEC3_NV = 0x8FF6; + public const int UNSIGNED_INT64_VEC4_ARB = 0x8FF7; + public const int UNSIGNED_INT64_VEC4_NV = 0x8FF7; + public const int UNSIGNED_INT8_NV = 0x8FEC; + public const int UNSIGNED_INT8_VEC2_NV = 0x8FED; + public const int UNSIGNED_INT8_VEC3_NV = 0x8FEE; + public const int UNSIGNED_INT8_VEC4_NV = 0x8FEF; + public const int UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B; + public const int UNSIGNED_INT_10F_11F_11F_REV_EXT = 0x8C3B; + public const int UNSIGNED_INT_10_10_10_2 = 0x8036; + public const int UNSIGNED_INT_10_10_10_2_EXT = 0x8036; + public const int UNSIGNED_INT_24_8 = 0x84FA; + public const int UNSIGNED_INT_24_8_EXT = 0x84FA; + public const int UNSIGNED_INT_24_8_NV = 0x84FA; + public const int UNSIGNED_INT_2_10_10_10_REV = 0x8368; + public const int UNSIGNED_INT_5_9_9_9_REV = 0x8C3E; + public const int UNSIGNED_INT_5_9_9_9_REV_EXT = 0x8C3E; + public const int UNSIGNED_INT_8_8_8_8 = 0x8035; + public const int UNSIGNED_INT_8_8_8_8_EXT = 0x8035; + public const int UNSIGNED_INT_8_8_8_8_REV = 0x8367; + public const int UNSIGNED_INT_8_8_S8_S8_REV_NV = 0x86DB; + public const int UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB; + public const int UNSIGNED_INT_IMAGE_1D = 0x9062; + public const int UNSIGNED_INT_IMAGE_1D_ARRAY = 0x9068; + public const int UNSIGNED_INT_IMAGE_1D_ARRAY_EXT = 0x9068; + public const int UNSIGNED_INT_IMAGE_1D_EXT = 0x9062; + public const int UNSIGNED_INT_IMAGE_2D = 0x9063; + public const int UNSIGNED_INT_IMAGE_2D_ARRAY = 0x9069; + public const int UNSIGNED_INT_IMAGE_2D_ARRAY_EXT = 0x9069; + public const int UNSIGNED_INT_IMAGE_2D_EXT = 0x9063; + public const int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B; + public const int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C; + public const int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x906C; + public const int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x906B; + public const int UNSIGNED_INT_IMAGE_2D_RECT = 0x9065; + public const int UNSIGNED_INT_IMAGE_2D_RECT_EXT = 0x9065; + public const int UNSIGNED_INT_IMAGE_3D = 0x9064; + public const int UNSIGNED_INT_IMAGE_3D_EXT = 0x9064; + public const int UNSIGNED_INT_IMAGE_BUFFER = 0x9067; + public const int UNSIGNED_INT_IMAGE_BUFFER_EXT = 0x9067; + public const int UNSIGNED_INT_IMAGE_CUBE = 0x9066; + public const int UNSIGNED_INT_IMAGE_CUBE_EXT = 0x9066; + public const int UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A; + public const int UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x906A; + public const int UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA; + public const int UNSIGNED_INT_SAMPLER_1D = 0x8DD1; + public const int UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6; + public const int UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT = 0x8DD6; + public const int UNSIGNED_INT_SAMPLER_1D_EXT = 0x8DD1; + public const int UNSIGNED_INT_SAMPLER_2D = 0x8DD2; + public const int UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7; + public const int UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT = 0x8DD7; + public const int UNSIGNED_INT_SAMPLER_2D_EXT = 0x8DD2; + public const int UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A; + public const int UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D; + public const int UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5; + public const int UNSIGNED_INT_SAMPLER_2D_RECT_EXT = 0x8DD5; + public const int UNSIGNED_INT_SAMPLER_3D = 0x8DD3; + public const int UNSIGNED_INT_SAMPLER_3D_EXT = 0x8DD3; + public const int UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8; + public const int UNSIGNED_INT_SAMPLER_BUFFER_AMD = 0x9003; + public const int UNSIGNED_INT_SAMPLER_BUFFER_EXT = 0x8DD8; + public const int UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4; + public const int UNSIGNED_INT_SAMPLER_CUBE_EXT = 0x8DD4; + public const int UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900F; + public const int UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900F; + public const int UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV = 0x8E58; + public const int UNSIGNED_INT_VEC2 = 0x8DC6; + public const int UNSIGNED_INT_VEC2_EXT = 0x8DC6; + public const int UNSIGNED_INT_VEC3 = 0x8DC7; + public const int UNSIGNED_INT_VEC3_EXT = 0x8DC7; + public const int UNSIGNED_INT_VEC4 = 0x8DC8; + public const int UNSIGNED_INT_VEC4_EXT = 0x8DC8; + public const int UNSIGNED_INVERT_NV = 0x8537; + public const int UNSIGNED_NORMALIZED = 0x8C17; + public const int UNSIGNED_NORMALIZED_ARB = 0x8C17; + public const int UNSIGNED_SHORT = 0x1403; + public const int UNSIGNED_SHORT_1_5_5_5_REV = 0x8366; + public const int UNSIGNED_SHORT_4_4_4_4 = 0x8033; + public const int UNSIGNED_SHORT_4_4_4_4_EXT = 0x8033; + public const int UNSIGNED_SHORT_4_4_4_4_REV = 0x8365; + public const int UNSIGNED_SHORT_5_5_5_1 = 0x8034; + public const int UNSIGNED_SHORT_5_5_5_1_EXT = 0x8034; + public const int UNSIGNED_SHORT_5_6_5 = 0x8363; + public const int UNSIGNED_SHORT_5_6_5_REV = 0x8364; + public const int UNSIGNED_SHORT_8_8_APPLE = 0x85BA; + public const int UNSIGNED_SHORT_8_8_MESA = 0x85BA; + public const int UNSIGNED_SHORT_8_8_REV_APPLE = 0x85BB; + public const int UNSIGNED_SHORT_8_8_REV_MESA = 0x85BB; + public const int UPLOAD_GPU_MASK_NVX = 0x954A; + public const int UPPER_LEFT = 0x8CA2; + public const int USE_MISSING_GLYPH_NV = 0x90AA; + public const int UTF16_NV = 0x909B; + public const int UTF8_NV = 0x909A; + public const int UUID_SIZE_EXT = 16; + public const int VALIDATE_STATUS = 0x8B83; + public const int VARIABLE_A_NV = 0x8523; + public const int VARIABLE_B_NV = 0x8524; + public const int VARIABLE_C_NV = 0x8525; + public const int VARIABLE_D_NV = 0x8526; + public const int VARIABLE_E_NV = 0x8527; + public const int VARIABLE_F_NV = 0x8528; + public const int VARIABLE_G_NV = 0x8529; + public const int VARIANT_ARRAY_EXT = 0x87E8; + public const int VARIANT_ARRAY_POINTER_EXT = 0x87E9; + public const int VARIANT_ARRAY_STRIDE_EXT = 0x87E6; + public const int VARIANT_ARRAY_TYPE_EXT = 0x87E7; + public const int VARIANT_DATATYPE_EXT = 0x87E5; + public const int VARIANT_EXT = 0x87C1; + public const int VARIANT_VALUE_EXT = 0x87E4; + public const int VBO_FREE_MEMORY_ATI = 0x87FB; + public const int VECTOR_EXT = 0x87BF; + public const int VENDOR = 0x1F00; + public const int VERSION = 0x1F02; + public const int VERTEX23_BIT_PGI = 0x00000004; + public const int VERTEX4_BIT_PGI = 0x00000008; + public const int VERTEX_ARRAY = 0x8074; + public const int VERTEX_ARRAY_ADDRESS_NV = 0x8F21; + public const int VERTEX_ARRAY_BINDING = 0x85B5; + public const int VERTEX_ARRAY_BINDING_APPLE = 0x85B5; + public const int VERTEX_ARRAY_BUFFER_BINDING_ARB = 0x8896; + public const int VERTEX_ARRAY_COUNT_EXT = 0x807D; + public const int VERTEX_ARRAY_EXT = 0x8074; + public const int VERTEX_ARRAY_LENGTH_NV = 0x8F2B; + public const int VERTEX_ARRAY_LIST_IBM = 103070; + public const int VERTEX_ARRAY_LIST_STRIDE_IBM = 103080; + public const int VERTEX_ARRAY_OBJECT_AMD = 0x9154; + public const int VERTEX_ARRAY_OBJECT_EXT = 0x9154; + public const int VERTEX_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F5; + public const int VERTEX_ARRAY_POINTER_EXT = 0x808E; + public const int VERTEX_ARRAY_RANGE_APPLE = 0x851D; + public const int VERTEX_ARRAY_RANGE_LENGTH_APPLE = 0x851E; + public const int VERTEX_ARRAY_RANGE_LENGTH_NV = 0x851E; + public const int VERTEX_ARRAY_RANGE_NV = 0x851D; + public const int VERTEX_ARRAY_RANGE_POINTER_APPLE = 0x8521; + public const int VERTEX_ARRAY_RANGE_POINTER_NV = 0x8521; + public const int VERTEX_ARRAY_RANGE_VALID_NV = 0x851F; + public const int VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV = 0x8533; + public const int VERTEX_ARRAY_SIZE_EXT = 0x807A; + public const int VERTEX_ARRAY_STORAGE_HINT_APPLE = 0x851F; + public const int VERTEX_ARRAY_STRIDE_EXT = 0x807C; + public const int VERTEX_ARRAY_TYPE_EXT = 0x807B; + public const int VERTEX_ATTRIB_ARRAY0_NV = 0x8650; + public const int VERTEX_ATTRIB_ARRAY10_NV = 0x865A; + public const int VERTEX_ATTRIB_ARRAY11_NV = 0x865B; + public const int VERTEX_ATTRIB_ARRAY12_NV = 0x865C; + public const int VERTEX_ATTRIB_ARRAY13_NV = 0x865D; + public const int VERTEX_ATTRIB_ARRAY14_NV = 0x865E; + public const int VERTEX_ATTRIB_ARRAY15_NV = 0x865F; + public const int VERTEX_ATTRIB_ARRAY1_NV = 0x8651; + public const int VERTEX_ATTRIB_ARRAY2_NV = 0x8652; + public const int VERTEX_ATTRIB_ARRAY3_NV = 0x8653; + public const int VERTEX_ATTRIB_ARRAY4_NV = 0x8654; + public const int VERTEX_ATTRIB_ARRAY5_NV = 0x8655; + public const int VERTEX_ATTRIB_ARRAY6_NV = 0x8656; + public const int VERTEX_ATTRIB_ARRAY7_NV = 0x8657; + public const int VERTEX_ATTRIB_ARRAY8_NV = 0x8658; + public const int VERTEX_ATTRIB_ARRAY9_NV = 0x8659; + public const int VERTEX_ATTRIB_ARRAY_ADDRESS_NV = 0x8F20; + public const int VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001; + public const int VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT = 0x00000001; + public const int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; + public const int VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB = 0x889F; + public const int VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE; + public const int VERTEX_ATTRIB_ARRAY_DIVISOR_ARB = 0x88FE; + public const int VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; + public const int VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622; + public const int VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD; + public const int VERTEX_ATTRIB_ARRAY_INTEGER_EXT = 0x88FD; + public const int VERTEX_ATTRIB_ARRAY_INTEGER_NV = 0x88FD; + public const int VERTEX_ATTRIB_ARRAY_LENGTH_NV = 0x8F2A; + public const int VERTEX_ATTRIB_ARRAY_LONG = 0x874E; + public const int VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; + public const int VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A; + public const int VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; + public const int VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645; + public const int VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; + public const int VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623; + public const int VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; + public const int VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624; + public const int VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; + public const int VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625; + public const int VERTEX_ATTRIB_ARRAY_UNIFIED_NV = 0x8F1E; + public const int VERTEX_ATTRIB_BINDING = 0x82D4; + public const int VERTEX_ATTRIB_MAP1_APPLE = 0x8A00; + public const int VERTEX_ATTRIB_MAP1_COEFF_APPLE = 0x8A03; + public const int VERTEX_ATTRIB_MAP1_DOMAIN_APPLE = 0x8A05; + public const int VERTEX_ATTRIB_MAP1_ORDER_APPLE = 0x8A04; + public const int VERTEX_ATTRIB_MAP1_SIZE_APPLE = 0x8A02; + public const int VERTEX_ATTRIB_MAP2_APPLE = 0x8A01; + public const int VERTEX_ATTRIB_MAP2_COEFF_APPLE = 0x8A07; + public const int VERTEX_ATTRIB_MAP2_DOMAIN_APPLE = 0x8A09; + public const int VERTEX_ATTRIB_MAP2_ORDER_APPLE = 0x8A08; + public const int VERTEX_ATTRIB_MAP2_SIZE_APPLE = 0x8A06; + public const int VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D5; + public const int VERTEX_BINDING_BUFFER = 0x8F4F; + public const int VERTEX_BINDING_DIVISOR = 0x82D6; + public const int VERTEX_BINDING_OFFSET = 0x82D7; + public const int VERTEX_BINDING_STRIDE = 0x82D8; + public const int VERTEX_BLEND_ARB = 0x86A7; + public const int VERTEX_CONSISTENT_HINT_PGI = 0x1A22B; + public const int VERTEX_DATA_HINT_PGI = 0x1A22A; + public const int VERTEX_ELEMENT_SWIZZLE_AMD = 0x91A4; + public const int VERTEX_ID_NV = 0x8C7B; + public const int VERTEX_ID_SWIZZLE_AMD = 0x91A5; + public const int VERTEX_PRECLIP_HINT_SGIX = 0x83EF; + public const int VERTEX_PRECLIP_SGIX = 0x83EE; + public const int VERTEX_PROGRAM_ARB = 0x8620; + public const int VERTEX_PROGRAM_BINDING_NV = 0x864A; + public const int VERTEX_PROGRAM_NV = 0x8620; + public const int VERTEX_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA2; + public const int VERTEX_PROGRAM_POINT_SIZE = 0x8642; + public const int VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642; + public const int VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642; + public const int VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643; + public const int VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643; + public const int VERTEX_SHADER = 0x8B31; + public const int VERTEX_SHADER_ARB = 0x8B31; + public const int VERTEX_SHADER_BINDING_EXT = 0x8781; + public const int VERTEX_SHADER_BIT = 0x00000001; + public const int VERTEX_SHADER_EXT = 0x8780; + public const int VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CF; + public const int VERTEX_SHADER_INVARIANTS_EXT = 0x87D1; + public const int VERTEX_SHADER_INVOCATIONS = 0x82F0; + public const int VERTEX_SHADER_INVOCATIONS_ARB = 0x82F0; + public const int VERTEX_SHADER_LOCALS_EXT = 0x87D3; + public const int VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87D2; + public const int VERTEX_SHADER_OPTIMIZED_EXT = 0x87D4; + public const int VERTEX_SHADER_VARIANTS_EXT = 0x87D0; + public const int VERTEX_SOURCE_ATI = 0x8774; + public const int VERTEX_STATE_PROGRAM_NV = 0x8621; + public const int VERTEX_STREAM0_ATI = 0x876C; + public const int VERTEX_STREAM1_ATI = 0x876D; + public const int VERTEX_STREAM2_ATI = 0x876E; + public const int VERTEX_STREAM3_ATI = 0x876F; + public const int VERTEX_STREAM4_ATI = 0x8770; + public const int VERTEX_STREAM5_ATI = 0x8771; + public const int VERTEX_STREAM6_ATI = 0x8772; + public const int VERTEX_STREAM7_ATI = 0x8773; + public const int VERTEX_SUBROUTINE = 0x92E8; + public const int VERTEX_SUBROUTINE_UNIFORM = 0x92EE; + public const int VERTEX_TEXTURE = 0x829B; + public const int VERTEX_WEIGHTING_EXT = 0x8509; + public const int VERTEX_WEIGHT_ARRAY_EXT = 0x850C; + public const int VERTEX_WEIGHT_ARRAY_POINTER_EXT = 0x8510; + public const int VERTEX_WEIGHT_ARRAY_SIZE_EXT = 0x850D; + public const int VERTEX_WEIGHT_ARRAY_STRIDE_EXT = 0x850F; + public const int VERTEX_WEIGHT_ARRAY_TYPE_EXT = 0x850E; + public const int VERTICAL_LINE_TO_NV = 0x08; + public const int VERTICES_SUBMITTED = 0x82EE; + public const int VERTICES_SUBMITTED_ARB = 0x82EE; + public const int VIBRANCE_BIAS_NV = 0x8719; + public const int VIBRANCE_SCALE_NV = 0x8713; + public const int VIDEO_BUFFER_BINDING_NV = 0x9021; + public const int VIDEO_BUFFER_INTERNAL_FORMAT_NV = 0x902D; + public const int VIDEO_BUFFER_NV = 0x9020; + public const int VIDEO_BUFFER_PITCH_NV = 0x9028; + public const int VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV = 0x903B; + public const int VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV = 0x903A; + public const int VIDEO_CAPTURE_FRAME_HEIGHT_NV = 0x9039; + public const int VIDEO_CAPTURE_FRAME_WIDTH_NV = 0x9038; + public const int VIDEO_CAPTURE_SURFACE_ORIGIN_NV = 0x903C; + public const int VIDEO_CAPTURE_TO_422_SUPPORTED_NV = 0x9026; + public const int VIDEO_COLOR_CONVERSION_MATRIX_NV = 0x9029; + public const int VIDEO_COLOR_CONVERSION_MAX_NV = 0x902A; + public const int VIDEO_COLOR_CONVERSION_MIN_NV = 0x902B; + public const int VIDEO_COLOR_CONVERSION_OFFSET_NV = 0x902C; + public const int VIEWPORT = 0x0BA2; + public const int VIEWPORT_BOUNDS_RANGE = 0x825D; + public const int VIEWPORT_COMMAND_NV = 0x0010; + public const int VIEWPORT_INDEX_PROVOKING_VERTEX = 0x825F; + public const int VIEWPORT_POSITION_W_SCALE_NV = 0x937C; + public const int VIEWPORT_POSITION_W_SCALE_X_COEFF_NV = 0x937D; + public const int VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV = 0x937E; + public const int VIEWPORT_SUBPIXEL_BITS = 0x825C; + public const int VIEWPORT_SWIZZLE_NEGATIVE_W_NV = 0x9357; + public const int VIEWPORT_SWIZZLE_NEGATIVE_X_NV = 0x9351; + public const int VIEWPORT_SWIZZLE_NEGATIVE_Y_NV = 0x9353; + public const int VIEWPORT_SWIZZLE_NEGATIVE_Z_NV = 0x9355; + public const int VIEWPORT_SWIZZLE_POSITIVE_W_NV = 0x9356; + public const int VIEWPORT_SWIZZLE_POSITIVE_X_NV = 0x9350; + public const int VIEWPORT_SWIZZLE_POSITIVE_Y_NV = 0x9352; + public const int VIEWPORT_SWIZZLE_POSITIVE_Z_NV = 0x9354; + public const int VIEWPORT_SWIZZLE_W_NV = 0x935B; + public const int VIEWPORT_SWIZZLE_X_NV = 0x9358; + public const int VIEWPORT_SWIZZLE_Y_NV = 0x9359; + public const int VIEWPORT_SWIZZLE_Z_NV = 0x935A; + public const int VIEW_CLASS_128_BITS = 0x82C4; + public const int VIEW_CLASS_16_BITS = 0x82CA; + public const int VIEW_CLASS_24_BITS = 0x82C9; + public const int VIEW_CLASS_32_BITS = 0x82C8; + public const int VIEW_CLASS_48_BITS = 0x82C7; + public const int VIEW_CLASS_64_BITS = 0x82C6; + public const int VIEW_CLASS_8_BITS = 0x82CB; + public const int VIEW_CLASS_96_BITS = 0x82C5; + public const int VIEW_CLASS_ASTC_10x10_RGBA = 0x9393; + public const int VIEW_CLASS_ASTC_10x5_RGBA = 0x9390; + public const int VIEW_CLASS_ASTC_10x6_RGBA = 0x9391; + public const int VIEW_CLASS_ASTC_10x8_RGBA = 0x9392; + public const int VIEW_CLASS_ASTC_12x10_RGBA = 0x9394; + public const int VIEW_CLASS_ASTC_12x12_RGBA = 0x9395; + public const int VIEW_CLASS_ASTC_4x4_RGBA = 0x9388; + public const int VIEW_CLASS_ASTC_5x4_RGBA = 0x9389; + public const int VIEW_CLASS_ASTC_5x5_RGBA = 0x938A; + public const int VIEW_CLASS_ASTC_6x5_RGBA = 0x938B; + public const int VIEW_CLASS_ASTC_6x6_RGBA = 0x938C; + public const int VIEW_CLASS_ASTC_8x5_RGBA = 0x938D; + public const int VIEW_CLASS_ASTC_8x6_RGBA = 0x938E; + public const int VIEW_CLASS_ASTC_8x8_RGBA = 0x938F; + public const int VIEW_CLASS_BPTC_FLOAT = 0x82D3; + public const int VIEW_CLASS_BPTC_UNORM = 0x82D2; + public const int VIEW_CLASS_EAC_R11 = 0x9383; + public const int VIEW_CLASS_EAC_RG11 = 0x9384; + public const int VIEW_CLASS_ETC2_EAC_RGBA = 0x9387; + public const int VIEW_CLASS_ETC2_RGB = 0x9385; + public const int VIEW_CLASS_ETC2_RGBA = 0x9386; + public const int VIEW_CLASS_RGTC1_RED = 0x82D0; + public const int VIEW_CLASS_RGTC2_RG = 0x82D1; + public const int VIEW_CLASS_S3TC_DXT1_RGB = 0x82CC; + public const int VIEW_CLASS_S3TC_DXT1_RGBA = 0x82CD; + public const int VIEW_CLASS_S3TC_DXT3_RGBA = 0x82CE; + public const int VIEW_CLASS_S3TC_DXT5_RGBA = 0x82CF; + public const int VIEW_COMPATIBILITY_CLASS = 0x82B6; + public const int VIRTUAL_PAGE_SIZE_INDEX_ARB = 0x91A7; + public const int VIRTUAL_PAGE_SIZE_X_AMD = 0x9195; + public const int VIRTUAL_PAGE_SIZE_X_ARB = 0x9195; + public const int VIRTUAL_PAGE_SIZE_Y_AMD = 0x9196; + public const int VIRTUAL_PAGE_SIZE_Y_ARB = 0x9196; + public const int VIRTUAL_PAGE_SIZE_Z_AMD = 0x9197; + public const int VIRTUAL_PAGE_SIZE_Z_ARB = 0x9197; + public const int VIVIDLIGHT_NV = 0x92A6; + public const int VOLATILE_APPLE = 0x8A1A; + public const int WAIT_FAILED = 0x911D; + public const int WARPS_PER_SM_NV = 0x933A; + public const int WARP_SIZE_NV = 0x9339; + public const int WEIGHTED_AVERAGE_ARB = 0x9367; + public const int WEIGHTED_AVERAGE_EXT = 0x9367; + public const int WEIGHT_ARRAY_ARB = 0x86AD; + public const int WEIGHT_ARRAY_BUFFER_BINDING_ARB = 0x889E; + public const int WEIGHT_ARRAY_POINTER_ARB = 0x86AC; + public const int WEIGHT_ARRAY_SIZE_ARB = 0x86AB; + public const int WEIGHT_ARRAY_STRIDE_ARB = 0x86AA; + public const int WEIGHT_ARRAY_TYPE_ARB = 0x86A9; + public const int WEIGHT_SUM_UNITY_ARB = 0x86A6; + public const int WIDE_LINE_HINT_PGI = 0x1A222; + public const int WINDOW_RECTANGLE_EXT = 0x8F12; + public const int WINDOW_RECTANGLE_MODE_EXT = 0x8F13; + public const int WRAP_BORDER_SUN = 0x81D4; + public const int WRITE_DISCARD_NV = 0x88BE; + public const int WRITE_ONLY = 0x88B9; + public const int WRITE_ONLY_ARB = 0x88B9; + public const int WRITE_PIXEL_DATA_RANGE_LENGTH_NV = 0x887A; + public const int WRITE_PIXEL_DATA_RANGE_NV = 0x8878; + public const int WRITE_PIXEL_DATA_RANGE_POINTER_NV = 0x887C; + public const int W_EXT = 0x87D8; + public const int XOR = 0x1506; + public const int XOR_NV = 0x1506; + public const int X_EXT = 0x87D5; + public const int YCBAYCR8A_4224_NV = 0x9032; + public const int YCBCR_422_APPLE = 0x85B9; + public const int YCBCR_MESA = 0x8757; + public const int YCBYCR8_422_NV = 0x9031; + public const int YCRCBA_SGIX = 0x8319; + public const int YCRCB_422_SGIX = 0x81BB; + public const int YCRCB_444_SGIX = 0x81BC; + public const int YCRCB_SGIX = 0x8318; + public const int Y_EXT = 0x87D6; + public const int Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV = 0x9036; + public const int Z4Y12Z4CB12Z4CR12_444_NV = 0x9037; + public const int Z4Y12Z4CB12Z4Y12Z4CR12_422_NV = 0x9035; + public const int Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV = 0x9034; + public const int Z6Y10Z6CB10Z6Y10Z6CR10_422_NV = 0x9033; + public const int ZERO = 0; + public const int ZERO_EXT = 0x87DD; + public const int ZERO_TO_ONE = 0x935F; + public const int Z_EXT = 0x87D7; + + + + + + #endregion + + } + + public static class glAttachment + { + private static int colorRange = + glFunc.GetMaskInteger((uint)GLconst.MAX_COLOR_ATTACHMENTS); + + public static uint Color(int i) + { +#if DEBUG + if (i>colorRange||i<0) + { + throw new ArgumentOutOfRangeException(); + } +#endif + return (uint)(GLconst.COLOR_ATTACHMENT0 + i); + } + + public const uint Depth = GLconst.DEPTH_ATTACHMENT; + public const uint Stencil = GLconst.STENCIL_ATTACHMENT; + public const uint DepthAndStencil = GLconst.DEPTH_STENCIL_ATTACHMENT; + } +} diff --git a/源代码/StgSharpDebug/Graphics/Define/glEnum.cs b/源代码/StgSharpDebug/Graphics/Define/glEnum.cs new file mode 100644 index 00000000..f4005866 --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/Define/glEnum.cs @@ -0,0 +1,210 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="glEnum.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + + +namespace StgSharp.Graphics.GL +{ + public enum ImageChannelLayout + { + UByte = GLconst.UNSIGNED_BYTE, + Byte = GLconst.BYTE, + UShort = GLconst.UNSIGNED_SHORT, + Short = GLconst.SHORT, + UInt = GLconst.UNSIGNED_INT, + Int = GLconst.INT, + Float = GLconst.FLOAT, + UByte332 = 0x8032, // GL_UNSIGNED_BYTE_3_3_2 + UByte233Rev = 0x8362, // GL_UNSIGNED_BYTE_2_3_3_REV + UShort565 = 0x8363, // GL_UNSIGNED_SHORT_5_6_5 + UShort565Rev = 0x8364, // GL_UNSIGNED_SHORT_5_6_5_REV + UShort4444 = 0x8033, // GL_UNSIGNED_SHORT_4_4_4_4 + UShort4444Rev = 0x8034, // GL_UNSIGNED_SHORT_4_4_4_4_REV + UShort5551 = 0x8035, // GL_UNSIGNED_SHORT_5_5_5_1 + UShort1555Rev = 0x8366, // GL_UNSIGNED_SHORT_1_5_5_5_REV + UInt8888 = 0x8035, // GL_UNSIGNED_INT_8_8_8_8 + UInt8888Rev = 0x8367, // GL_UNSIGNED_INT_8_8_8_8_REV + UInt1010102 = 0x8036, // GL_UNSIGNED_INT_10_10_10_2 + UInt2101010Rev = 0x8368 // GL_UNSIGNED_INT_2_10_10_10_REV + } + + + internal enum VkStructureType : uint + { + VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000, + VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000, + VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000, + VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, + VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000, + VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT = 1000217000, + VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF + } + + public enum FrameBufferChannel + { + STENCIL_INDEX = GLconst.STENCIL_INDEX, + DEPTH_COMPONENT = GLconst.DEPTH_COMPONENT, + DEPTH_STENCIL = GLconst.DEPTH_STENCIL, + RED = GLconst.RED, + GREEN = GLconst.GREEN, + BLUE = GLconst.BLUE, + RGB = GLconst.RGB, + BGR = GLconst.BGR, + RGBA = GLconst.RGBA, + BGRA = GLconst.BGRA + } + + + public enum Texture2DTarget + { + Texture2D = GLconst.TEXTURE_2D, + ProxyTexture2D = GLconst.PROXY_TEXTURE_2D, + Texture1DArray = GLconst.TEXTURE_1D_ARRAY, + ProxyTexture1DArray = GLconst.PROXY_TEXTURE_1D_ARRAY, + TextureRectangle = GLconst.TEXTURE_RECTANGLE, + ProxyTextureRectangle = GLconst.PROXY_TEXTURE_RECTANGLE, + TextureCubeMapPositiveX = GLconst.TEXTURE_CUBE_MAP_POSITIVE_X, + TextureCubeMapNegativeX = GLconst.TEXTURE_CUBE_MAP_NEGATIVE_X, + TextureCubeMapPositiveY = GLconst.TEXTURE_CUBE_MAP_POSITIVE_Y, + TextureCubeMapNegativeY = GLconst.TEXTURE_CUBE_MAP_NEGATIVE_Y, + TextureCubeMapPositiveZ = GLconst.TEXTURE_CUBE_MAP_POSITIVE_Z, + TextureCubeMapNegativeZ = GLconst.TEXTURE_CUBE_MAP_NEGATIVE_Z, + ProxyTextureCubeMap = GLconst.PROXY_TEXTURE_CUBE_MAP + } + + public enum RenderBufferInternalFormat : uint + { + RGBA8 = GLconst.RGBA8, + Depth24_Stencil8 = GLconst.DEPTH24_STENCIL8, + } + + public enum GLOperation : uint + { + StencilTest = GLconst.STENCIL_TEST, + } + + internal enum VkResult + { + VK_SUCCESS = 0, + VK_NOT_READY = 1, + VK_TIMEOUT = 2, + VK_EVENT_SET = 3, + VK_EVENT_RESET = 4, + VK_INCOMPLETE = 5, + VK_ERROR_OUT_OF_HOST_MEMORY = -1, + VK_ERROR_OUT_OF_DEVICE_MEMORY = -2, + VK_ERROR_INITIALIZATION_FAILED = -3, + VK_ERROR_DEVICE_LOST = -4, + VK_ERROR_MEMORY_MAP_FAILED = -5, + VK_ERROR_LAYER_NOT_PRESENT = -6, + VK_ERROR_EXTENSION_NOT_PRESENT = -7, + VK_ERROR_FEATURE_NOT_PRESENT = -8, + VK_ERROR_INCOMPATIBLE_DRIVER = -9, + VK_ERROR_TOO_MANY_OBJECTS = -10, + VK_ERROR_FORMAT_NOT_SUPPORTED = -11, + VK_ERROR_SURFACE_LOST_KHR = -1000000000, + VK_SUBOPTIMAL_KHR = 1000001003, + VK_ERROR_OUT_OF_DATE_KHR = -1000001004, + VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = -1000003001, + VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001, + VK_ERROR_VALIDATION_FAILED_EXT = -1000011001, + VK_RESULT_MAX_ENUM = 0x7FFFFFFF + } + +#pragma warning disable CA1008 + public enum ShaderType : int +#pragma warning restore CA1008 + { + Fragment = GLconst.FRAGMENT_SHADER, + Vertex = GLconst.VERTEX_SHADER, + Compute = GLconst.COMPUTE_SHADER, + Geometry = GLconst.GEOMETRY_SHADER, + } + +#pragma warning disable CA1008 // 枚举应具有零值 + public enum BufferType : int +#pragma warning restore CA1008 // 枚举应具有零值 + { + ArrayBuffer = GLconst.ARRAY_BUFFER, + ElementArrayBuffer = GLconst.ELEMENT_ARRAY_BUFFER, + AtomicCounterBuffer = GLconst.ATOMIC_COUNTER_BUFFER, + COPY_READ_BUFFER = GLconst.COPY_READ_BUFFER, + COPY_WRITE_BUFFER = GLconst.COPY_WRITE_BUFFER, + DISPATCH_INDIRECT_BUFFER = GLconst.DISPATCH_INDIRECT_BUFFER, + DRAW_INDIRECT_BUFFER = GLconst.DRAW_INDIRECT_BUFFER, + PIXEL_PACK_BUFFER = GLconst.PIXEL_PACK_BUFFER, + PIXEL_UNPACK_BUFFER = GLconst.PIXEL_UNPACK_BUFFER, + QUERY_BUFFER = GLconst.QUERY_BUFFER, + SHADER_STORAGE_BUFFER = GLconst.SHADER_STORAGE_BUFFER, + TEXTURE_BUFFER = GLconst.TEXTURE_BUFFER, + TRANSFORM_FEEDBACK_BUFFER = GLconst.TRANSFORM_FEEDBACK_BUFFER, + UNIFORM_BUFFER = GLconst.UNIFORM_BUFFER, + } + +#pragma warning disable CA1008 // 枚举应具有零值 + public enum BufferUsage : int +#pragma warning restore CA1008 // 枚举应具有零值 + { + StreamDraw = 0x88E0, + StreamRead = 0x88E1, + StreamCopy = 0x88E2, + StaticDraw = 0x88E4, + StaticRead = 0x88E5, + StaticCopy = 0x88E6, + DynamicDraw = 0x88E8, + DynamicRead = 0x88E9, + DynamicCopy = 0x88EA + } + + + public enum MaskBufferBit + { + COLOR = GLconst.COLOR_BUFFER_BIT, + DEPTH = GLconst.DEPTH_BUFFER_BIT, + STENCIL = GLconst.STENCIL_BUFFER_BIT, + } + + public enum GeometryType : uint + { + POINTS = 0x0000, + LINES = 0x0001, + LINE_LOOP = 0x0002, + LINE_STRIP = 0x0003, + TRIANGLES = 0x0004, + TRIANGLE_STRIP = 0x0005, + TRIANGLE_FAN = 0x0006 + } + + public enum TextureFiltering + { + Nearest = 0x2600, + Linear = 0x2601 + } +} diff --git a/源代码/StgSharpDebug/Graphics/Define/glType.cs b/源代码/StgSharpDebug/Graphics/Define/glType.cs new file mode 100644 index 00000000..1b8f5e21 --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/Define/glType.cs @@ -0,0 +1,117 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="glType.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Geometries; + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.InteropServices; +using System.Text; + + +namespace StgSharp.Graphics +{ + + public delegate IntPtr GLfuncLoader(string name); + + internal delegate void GLVULKANPROCNV(); + + public unsafe struct GLhandleARB + { + + dynamic value; + + public unsafe GLhandleARB(dynamic value) + { + if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + if (value.GetType().Name != "Uint32") + { + goto errorlog; + } + this.value = value; + } + else + { + if (value.GetType().Name != "IntPtr") + { + goto errorlog; + } + this.value = value; + } + + errorlog: + { + InternalIO.InternalWriteLog( + $"{value.GetType().Name} does not match definination of GLhandlARB on OS {Environment.OSVersion.Platform} ", + LogType.Error); + } + + } + + public static implicit operator uint(GLhandleARB value) + { + return (uint)value; + } + + + + } + + #region GLFW_dele + + internal unsafe delegate void GLFWwindowsizefun(glfwWindow* window, int width, int height); + internal unsafe delegate void GLFWwindowrefreshfun(glfwWindow* window); + internal unsafe delegate void GLFWwindowposfun(glfwWindow* window, int xpos, int ypos); + internal unsafe delegate void GLFWwindowmaximizefun(glfwWindow* window, int maximized); + internal unsafe delegate void GLFWwindowiconifyfun(glfwWindow* window, int iconified); + internal unsafe delegate void GLFWwindowfocusfun(glfwWindow* window, int focused); + internal unsafe delegate void GLFWwindowcontentscalefun(glfwWindow* window, float xscale, float yscale); + internal unsafe delegate void GLFWwindowclosefun(glfwWindow* window); + internal unsafe delegate void GLFWvkproc(); + internal unsafe delegate void GLFWscrollfun(glfwWindow* window, double xoffset, double yoffset); + internal unsafe delegate void GLFWmousebuttonfun(glfwWindow* window, int button, int action, int mods); + internal unsafe delegate void GLFWmonitorfun(glfwMonitor* monitor, int monitorevent); + internal unsafe delegate void GLFWkeyfun(glfwWindow* window, int key, int scancode, int action, int mods); + internal unsafe delegate void GLFWjoystickfun(int jid, int keyevent); + public unsafe delegate void GLFWglproc(); + internal unsafe delegate void FramebuffersizeHandler(IntPtr window, int width, int height); //window is the pointer to a glfwWindow instance + internal unsafe delegate void GLFWerrorfun(int error_code, sbyte* description); + internal unsafe delegate void GLFWdropfun(glfwWindow* window, int path_count, sbyte*[] paths); + internal unsafe delegate void GLFWcursorposfun(glfwWindow* window, double xpos, double ypos); + internal unsafe delegate void GLFWcursorenterfun(glfwWindow* window, int entered); + internal unsafe delegate void GLFWcharmodsfun(glfwWindow* window, uint codepoint, int mods); + internal unsafe delegate void GLFWcharfun(glfwWindow* window, uint codepoint); + + #endregion + + +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Graphics/GL/Buffer/BufferObjectBase.cs b/源代码/StgSharpDebug/Graphics/GL/Buffer/BufferObjectBase.cs new file mode 100644 index 00000000..ecbc4ca4 --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/GL/Buffer/BufferObjectBase.cs @@ -0,0 +1,80 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="BufferObjectBase.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics.GL +{ + /// + /// Interface of all kinds OpenGL buffer objects + /// + public abstract class BufferObjectBase : IDisposable + { + protected RenderStream binding; + protected glHandleSet _bufferHandle; + + /// + /// Get the only handle to one of the Object instance + /// + /// + /// + public glHandle this[int index] => _bufferHandle[index]; + + /// + /// Bind a buffer instance to OpenGL + /// + /// Index of handle of the object in this instance to be bind + public abstract void Bind(int index); + + public void Dispose() + { + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + + /// + public override string ToString() + { + return $"This is a {GetType().FullName}, containing {_bufferHandle.length} buffer handles: {_bufferHandle.ToString()}."; + } + + protected abstract void Dispose(bool disposing); + + ~BufferObjectBase() + { + Dispose(disposing: false); + } + + } +} diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Circle.cs b/源代码/StgSharpDebug/Graphics/GL/Buffer/EBO.cs similarity index 54% rename from 源代码/StgSharp/Geometries/PlainGeometry/Circle.cs rename to 源代码/StgSharpDebug/Graphics/GL/Buffer/EBO.cs index 6c2863a2..0ba15f64 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Circle.cs +++ b/源代码/StgSharpDebug/Graphics/GL/Buffer/EBO.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="Circle.cs" +// file="EBO.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -31,58 +31,54 @@ using StgSharp.Math; using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; -namespace StgSharp.Geometries +namespace StgSharp.Graphics.GL { /// - /// A collection of all point on the same plain and has the same distance to a point + /// A collection of handle to Element Buffer Object in OpenglFunc. + /// Each value indexed from instance of this class this + /// is the only handle to one Element Buffer Object. /// - public class Circle : PlainGeometry + public unsafe class ElementBuffer : BufferObjectBase { - internal Point center; - internal Func movBeginOperation = GeometryOperation.DefaultMotion; - internal Func movCenterOperation = GeometryOperation.DefaultMotion; - internal Func movEndOperation = GeometryOperation.DefaultMotion; - internal Point pointOnCircle; - internal Point pointOnPlain; - - - internal override int[] Indices => throw new NotImplementedException(); - - public override Line[] GetAllSides() + internal ElementBuffer(int n, glRenderStream binding) { - throw new NotImplementedException(); + this.binding = binding; + _bufferHandle = glFunc.GenBuffers(n); } - public override Plain GetPlain() + public override sealed void Bind(int index) { - return new Plain(center, pointOnCircle, pointOnPlain); + glFunc.BindBuffer(BufferType.ElementArrayBuffer, _bufferHandle[index]); } - public virtual vec3d MoveCenter(int tick) + public void SetValue(int index, T[] bufferArray, BufferUsage usage) + where T : struct, IConvertible { - return movCenterOperation.Invoke(tick); + glFunc.BindBuffer(BufferType.ElementArrayBuffer, _bufferHandle[index]); + glFunc.SetBufferData(BufferType.ElementArrayBuffer, bufferArray, usage); } - public virtual vec3d UpdatePlain(int tick) + public void SetValue(int index, ReadOnlySpan bufferSpan, BufferUsage usage) + where T : struct, IConvertible { - return movEndOperation.Invoke(tick); + glFunc.BindBuffer(BufferType.ElementArrayBuffer, _bufferHandle[index]); + glFunc.SetBufferData(BufferType.ElementArrayBuffer, bufferSpan, usage); } - public virtual vec3d UpdateRadius(int tick) + protected override sealed void Dispose(bool disposing) { - return movBeginOperation.Invoke(tick); - } - - - internal override void UpdateCoordinate(int tick) - { - tick = time; - center.Position = this.coordinate.Origin + MoveCenter(tick); - pointOnCircle.Position = this.coordinate.Origin + UpdateRadius(tick); - pointOnPlain.Position = this.coordinate.Origin + UpdatePlain(tick); + if (disposing) + { + glFunc.DeleteBuffers(_bufferHandle); + _bufferHandle.Release(); + } } } -} +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Graphics/GL/Buffer/FBO.cs b/源代码/StgSharpDebug/Graphics/GL/Buffer/FBO.cs new file mode 100644 index 00000000..3e5cd70f --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/GL/Buffer/FBO.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics.GL +{ +#pragma warning disable CA1008 +#pragma warning disable CA1028 + public enum FrameBufferTarget:uint +#pragma warning restore CA1028 +#pragma warning restore CA1008 + { + Read = GLconst.READ_FRAMEBUFFER, + All = GLconst.FRAMEBUFFER, + Draw = GLconst.DRAW_FRAMEBUFFER, + } + + public class FrameBuffer : BufferObjectBase + { + internal unsafe FrameBuffer(int count, glRenderStream contextBinding) + { + binding = contextBinding; + _bufferHandle = new glHandleSet(count); + ((GLcontext*)binding.ContextHandle)->glGenFramebuffers((uint)count,_bufferHandle.handle); + } + + /// + /// Bind the frame buffer object with name frame buffer to the frame buffer target specified by target. + /// will be set as default target. + /// + /// Index of object to be binded in handle set + public unsafe override void Bind(int index) + { + glFunc.BindFrameBuffer(FrameBufferTarget.All,_bufferHandle[index]); + } + + public static void BindNull() + { + glFunc.BindFrameBuffer(FrameBufferTarget.All,glHandle.Zero); + } + + /// + /// Bind the frame buffer object with name frame buffer to the frame buffer target specified by target. + /// Target of this frame buffer should be set manually. + /// + /// The frame buffer target of the binding operation. + /// Index of object to be binded in handle set + public unsafe void Bind(FrameBufferTarget target, int index) + { + ((GLcontext*)binding.ContextHandle)->glBindFramebuffer((uint)target, _bufferHandle[index].Value); + } + + protected override void Dispose(bool disposing) + { + throw new NotImplementedException(); + } + } +} diff --git a/源代码/StgSharpDebug/Graphics/GL/Buffer/RBO.cs b/源代码/StgSharpDebug/Graphics/GL/Buffer/RBO.cs new file mode 100644 index 00000000..07604119 --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/GL/Buffer/RBO.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Security.Principal; +using System.Text; + + +namespace StgSharp.Graphics.GL +{ + + + + public class RenderBuffer : BufferObjectBase + { + public RenderBuffer(int count, glRenderStream binding) + { + this.binding = binding; + _bufferHandle = glFunc.GenRenderBuffer(count); + } + + public override void Bind(int index) + { + glFunc.BindRenderBuffer(this[index]); + } + + protected override void Dispose(bool disposing) + { + throw new NotImplementedException(); + } + + public void Store(RenderBufferInternalFormat format, (int width,int height) size) + { + if (size.width > binding.Width || size.height>binding.Height) + { + StgSharp.LogWarning("FrameBuffer is larger than current canvas binding"); + } + } + } +} diff --git a/源代码/StgSharp/Graphics/GL/Buffer/texture.cs b/源代码/StgSharpDebug/Graphics/GL/Buffer/TextureGL.cs similarity index 59% rename from 源代码/StgSharp/Graphics/GL/Buffer/texture.cs rename to 源代码/StgSharpDebug/Graphics/GL/Buffer/TextureGL.cs index 8763e448..680d99d8 100644 --- a/源代码/StgSharp/Graphics/GL/Buffer/texture.cs +++ b/源代码/StgSharpDebug/Graphics/GL/Buffer/TextureGL.cs @@ -38,9 +38,9 @@ using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; -namespace StgSharp.Graphics +namespace StgSharp.Graphics.GL { - public unsafe class Texture + public unsafe class TextureGL { internal static bool[] unitActivated = new bool[16]; @@ -48,61 +48,43 @@ namespace StgSharp.Graphics internal glHandleSet _textureHandle; internal Image[] sourceList; - internal Texture(int n, glRenderStream binding) + public glHandle this[int index] + { + get => _textureHandle[index]; + } + + internal TextureGL(int n, glRenderStream binding) { sourceList = new Image[n]; this.binding = binding.ContextHandle; - _textureHandle = GL.GenTextures(n); + _textureHandle = glFunc.GenTextures(n); } - public void Activate(TextureUnit unit) + public static void Activate(TextureUnit unit) { - GL.ActiveTexture((uint)unit); + glFunc.ActiveTexture((uint)unit); } public void Bind2D(int index) { - GL.BindTexture(GLconst.TEXTURE_2D, _textureHandle[index]); + glFunc.BindTexture(GLconst.TEXTURE_2D, _textureHandle[index]); } /// /// - /// /// - /// - public unsafe void LoadTexture(int index, string name, ImageLoader loader) + /// + public unsafe void LoadTexture(int index, Image i) { - ImageInfo info = default; - InternalIO.InternalLoadImage(name, &info, loader); - sourceList[index] = new Image(info); - if (sourceList[index].info.pixelPtr != IntPtr.Zero) - { - uint channel; - switch (sourceList[index].info.channel) - { - case 1: - channel = GLconst.RED; break; - case 2: - channel = GLconst.RG; break; - case 3: - channel = GLconst.RGB; break; - case 4: - channel = GLconst.RGBA; break; - default: - channel = 0; - break; - } - GL.TextureImage2d( - GLconst.TEXTURE_2D, 0, channel, - (uint)sourceList[index].Width, (uint)sourceList[index].Height, - channel, GLconst.UNSIGNED_BYTE, - sourceList[index].pixelArrayHandle - ); - } - else - { - InternalIO.InternalWriteLog($"Failed to load image file of \"{name}\".", LogType.Error); - } + sourceList[index] = i; + glArrayHandle handle = sourceList[index].GetArrayHandle(); + glFunc.TextureImage2d( + Texture2DTarget.Texture2D, 0, (uint)i.Channel, + (uint)sourceList[index].Width, (uint)sourceList[index].Height, + (uint)i.Channel, ImageChannelLayout.Byte, + pixelArrayHandle: handle + ); + handle.Release(); } @@ -111,15 +93,15 @@ namespace StgSharp.Graphics public void Set2dFilterProperty( Filter onMinify, Filter onMagnify) { - GL.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_MIN_FILTER, (int)onMinify); - GL.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_MAG_FILTER, (int)onMagnify); + glFunc.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_MIN_FILTER, (int)onMinify); + glFunc.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_MAG_FILTER, (int)onMagnify); } public void Set2dWrapProperty( Wrap onHorizontial, Wrap onVertical) { - GL.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_WRAP_S, (int)onHorizontial); - GL.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_WRAP_T, (int)onVertical); + glFunc.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_WRAP_S, (int)onHorizontial); + glFunc.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_WRAP_T, (int)onVertical); } #endregion texture setting @@ -127,17 +109,21 @@ namespace StgSharp.Graphics } +#pragma warning disable CA1008 public enum Filter +#pragma warning restore CA1008 { Nearest = GLconst.NEAREST, Linear = GLconst.LINEAR, - Nearest_LinearMipmap = GLconst.NEAREST_MIPMAP_LINEAR, - Linear_LinearMipmap = GLconst.LINEAR_MIPMAP_LINEAR, - Nearest_NearestMipmap = GLconst.NEAREST_MIPMAP_NEAREST, - Linear_NearestMipmap = GLconst.LINEAR_MIPMAP_NEAREST, + NearestLinearMipmap = GLconst.NEAREST_MIPMAP_LINEAR, + LinearLinearMipmap = GLconst.LINEAR_MIPMAP_LINEAR, + NearestNearestMipmap = GLconst.NEAREST_MIPMAP_NEAREST, + LinearNearestMipmap = GLconst.LINEAR_MIPMAP_NEAREST, } +#pragma warning disable CA1008 public enum TextureUnit +#pragma warning restore CA1008 { Unit0 = GLconst.TEXTURE0, Unit1 = GLconst.TEXTURE1, @@ -157,7 +143,9 @@ namespace StgSharp.Graphics Unit15 = GLconst.TEXTURE15, } +#pragma warning disable CA1008 public enum Wrap +#pragma warning restore CA1008 { Repeat = GLconst.REPEAT, MirroredRepeat = GLconst.MIRRORED_REPEAT, diff --git a/源代码/StgSharpDebug/Graphics/GL/Buffer/VAO.cs b/源代码/StgSharpDebug/Graphics/GL/Buffer/VAO.cs new file mode 100644 index 00000000..6af1862f --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/GL/Buffer/VAO.cs @@ -0,0 +1,80 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="VAO.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + + +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Text; + +namespace StgSharp.Graphics.GL +{ + public unsafe class VertexArray : BufferObjectBase + { + + internal VertexArray(int n, glRenderStream binding) + { + this.binding = binding; + _bufferHandle = glFunc.GenVertexArrays(n); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override sealed void Bind(int index) + { + glFunc.BindVertexArray(_bufferHandle[index]); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void BindNull() + { + glFunc.BindVertexArray(glHandle.Zero); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void SetVertexAttribute(uint index, int vertexLength, TypeCode dataType, bool isNomalized, uint stride, int pointer) + { + glFunc.SetVertexAttribute( + index, vertexLength, dataType, + isNomalized, + stride, pointer); + } + + protected override sealed void Dispose(bool disposing) + { + if (disposing) + { + glFunc.DeleteVertexArrays(_bufferHandle); + _bufferHandle.Release(); + } + } + + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Graphics/GL/Buffer/VBO.cs b/源代码/StgSharpDebug/Graphics/GL/Buffer/VBO.cs new file mode 100644 index 00000000..27c3d774 --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/GL/Buffer/VBO.cs @@ -0,0 +1,155 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="VBO.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Graphics.GL; +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Net.Security; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Graphics.GL +{ + public unsafe class VertexBuffer : BufferObjectBase + { + + internal VertexBuffer(int n, glRenderStream binding) + { + this.binding = binding; + _bufferHandle = glFunc.GenBuffers(n); + } + + public override sealed void Bind(int index) + { + glFunc.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); + } + + /// + /// Set data to current vertex buffer object + /// + /// Type of bufferData + /// Index to find certain VBO in this instance + /// Data to write in + /// How OpenGL use these data, defined by + public void WriteMatrixData(int index, T bufferData, BufferUsage usage) + where T : struct, IMat + { + glFunc.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); + glFunc.SetBufferData(BufferType.ArrayBuffer, bufferData, usage); + } + + /// + /// Set data to current vertex buffer object + /// + /// Type of bufferData + /// Index to find certain VBO in this instance + /// Data to write in + /// How OpenGL use these data, defined by + public void WriteScalerData(int index, T[] bufferArray, BufferUsage usage) + where T : struct, +#if NET8_0_OR_GREATER + INumber +#else + IConvertible +#endif + { + glFunc.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); + glFunc.SetBufferData(BufferType.ArrayBuffer, bufferArray, usage); + } + + /// + /// Set data to current vertex buffer object + /// + /// Type of bufferData + /// Index to find certain VBO in this instance + /// A of data to write in + /// How OpenGL use these data, defined by + public void WriteScalerData(int index, ReadOnlySpan scalerSpan, BufferUsage usage) + where T : struct, +#if NET8_0_OR_GREATER + INumber +#else + IConvertible +#endif + { + glFunc.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); + glFunc.SetBufferData(BufferType.ArrayBuffer, scalerSpan, usage); + } + + /// + /// Set data to current vertex buffer object + /// + /// Type of bufferData + /// Index to find certain VBO in this instance + /// A of data to write in + /// How OpenGL use these data, defined by + public void WriteVectorData(int index, ReadOnlySpan vectorSpan, BufferUsage usage) where T : struct, IVector + { + glFunc.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); + glFunc.SetBufferVectorData(BufferType.ArrayBuffer, vectorSpan, usage); + } + + /// + /// Set data to current vertex buffer object + /// + /// Type of bufferData + /// Index to find certain VBO in this instance + /// A array of data to write in + /// How OpenGL use these data, defined by + public void WriteVectorData(int index, T[] vectorArray, BufferUsage usage) where T : struct, IVector + { + glFunc.BindBuffer(BufferType.ArrayBuffer, _bufferHandle[index]); + glFunc.SetBufferVectorData(BufferType.ArrayBuffer, vectorArray, usage); + } + + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Unbind() + { + glFunc.BindBuffer(BufferType.ArrayBuffer, glHandle.Zero); + } + + protected override sealed void Dispose(bool disposing) + { + if (disposing) + { + glFunc.DeleteBuffers(_bufferHandle); + _bufferHandle.Release(); + } + } + + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Graphics/GL/GLhandle.cs b/源代码/StgSharpDebug/Graphics/GL/GLhandle.cs new file mode 100644 index 00000000..449ac9f7 --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/GL/GLhandle.cs @@ -0,0 +1,362 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="GLhandle.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Data.Common; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Versioning; +using System.Security.AccessControl; +using System.Security.Cryptography; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics +{ + /// + /// A handle to an OpenGL object, + /// must be indexed from a . + /// Direct call will cause + /// + public unsafe class glHandle: IDisposable + { + private static uint* zeroHandle = (uint*)Marshal.AllocHGlobal(Marshal.SizeOf()); + + internal uint* source; + internal uint* valuePtr; + + private glHandle(IntPtr handle) + { + this.valuePtr = (uint*)handle; + source = (uint*)0; + } + + private glHandle(uint value) + { + source = (uint*)0; + valuePtr = (uint*)Marshal.AllocHGlobal(sizeof(uint)); + *valuePtr = value; + } + + internal glHandle(uint* val, glHandleSet set) + { + source = set!=null ? set!.handle:(uint*)0; + valuePtr = val; + } + + [Obsolete("Cannot init instance of this type", true)] + public glHandle() + { + } + + public IntPtr Handle + { + get=> (IntPtr)valuePtr; + } + + public bool IsIsolated + { + get => source == (uint*)0; + } + + public uint Value + { + get => *valuePtr; + set => *valuePtr = value; + } + + public static glHandle ZeroHandle => FromPtr(IntPtr.Zero); + + public static glHandle Zero => Alloc(0); + + public static glHandle Alloc(uint value) + { + return new glHandle(value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static glHandle FromPtr(IntPtr p) + { + return new glHandle(p); + } + + ~glHandle() + { + if (valuePtr != zeroHandle && IsIsolated) + { + Marshal.FreeHGlobal((IntPtr)valuePtr); + } + } + + protected virtual void Dispose(bool disposing) + { + if (IsIsolated) + { + GCHandle.FromIntPtr((IntPtr)valuePtr).Free(); + if (disposing) + { + } + + } + } + + // + // ~glHandle() + // { + // Dispose(disposing: false); + // } + + public void Dispose() + { + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + } + + public unsafe class glSHandle + { + private static int* zeroHandle = (int*)Marshal.AllocHGlobal(Marshal.SizeOf()); + + internal int* source; + internal int* valuePtr; + + private glSHandle(IntPtr handle) + { + this.valuePtr = (int*)handle; + source = (int*)0; + } + + private glSHandle(int value) + { + source = (int*)0; + valuePtr = (int*)Marshal.AllocHGlobal(sizeof(int)); + *valuePtr = value; + } + + internal glSHandle(int* val, glHandleSet set) + { + source = set != null ? (int*)set!.handle : (int*)0; + valuePtr = val; + } + + + [Obsolete("Cannot init instance of this type", true)] + public glSHandle() + { + } + + public IntPtr Handle + { + get => (IntPtr)valuePtr; + } + + public bool IsIsolated + { + get => source == (uint*)0; + } + + public int Value + { + get => *valuePtr; + set => *valuePtr = value; + } + + public static glSHandle Zero => Alloc(0); + + public static glSHandle Alloc(int value) + { + return new glSHandle(value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static glSHandle FromPtr(IntPtr p) + { + return new glSHandle(p); + } + + ~glSHandle() + { + if (valuePtr != zeroHandle && IsIsolated) + { + Marshal.FreeHGlobal((IntPtr)valuePtr); + } + } + + } + + public unsafe class glArrayHandle + { + internal readonly Array a; + internal GCHandle handle; + private bool disposedValue; + + internal glArrayHandle(Array array) + { + this.a = array; + handle = GCHandle.Alloc(array, GCHandleType.Pinned); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public IntPtr AddressOfArray() + { + if (handle != default) + { + return handle.AddrOfPinnedObject(); + } + else + { + throw new InvalidOperationException(); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static glArrayHandle Alloc(T[] array) where T : struct + { + return new glArrayHandle(array); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static glArrayHandle CopyAlloc(T[] array) where T : struct + { + Array copy = new T[array.Length]; + array.CopyTo(copy, 0); + return new glArrayHandle(copy); + } + + public void Release() + { + handle.Free(); + handle = default; + } + } + + /// + /// A handle to an OpenGL object. + /// + public unsafe class glHandleSet + { + + private readonly uint[] _value; + internal uint* handle; + internal int length; + + public glHandleSet(int count) + { + _value = new uint[count]; + length = count; + handle = (uint*)GCHandle.Alloc(_value, GCHandleType.Pinned).AddrOfPinnedObject(); + } + + public IntPtr Handle + { + get => (IntPtr)handle; + } + + public glHandle this[int index] + { + get + { + if (index > length) + { + throw new IndexOutOfRangeException(); + } + return new glHandle(handle + index, this); + } + } + + public glSHandle this[uint index] + { + get + { + if (index > length) + { + throw new IndexOutOfRangeException(); + } + return new glSHandle(((int*)handle) + index, this); + } + } + + 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 void Pin() + { + if (_value == null) + { + return; + } + handle = (uint*)GCHandle.Alloc(_value, GCHandleType.Pinned).AddrOfPinnedObject(); + } + + /// + /// Release all resource in this handle. + /// This will release all resource in this . + /// This will be not usable. + /// + public void Release() + { + if (_value == null) + { + return; + } + else + { + GCHandle.FromIntPtr((IntPtr)handle).Free(); + handle = (uint*)IntPtr.Zero; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetValue(int index, uint value) + { + _value[index] = value; + } + + ~glHandleSet() + { + + } + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Graphics/GL/GLpack.cs b/源代码/StgSharpDebug/Graphics/GL/GLpack.cs new file mode 100644 index 00000000..9aa985df --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/GL/GLpack.cs @@ -0,0 +1,622 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="GLpack.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Graphics; +using StgSharp.Logic; +using StgSharp.Math; + +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp +{ + internal static unsafe partial class InternalIO + { + + [DllImport(SSC_libName, EntryPoint = "glCheckShaderStat", + CallingConvention = CallingConvention.Cdecl)] +#pragma warning disable CA5392 + internal static extern int glCheckShaderStatus(ref GLcontext context, uint shaderHandle, int key, ref IntPtr logPtr); +#pragma warning restore CA5392 + + + } +} +namespace StgSharp.Graphics.GL +{ + internal static unsafe partial class glFunc + { + + private static GLcontext* context; + + public static IntPtr CurrentContextHandle + { + get { return (IntPtr)context; } + set { context = (GLcontext*)value; } + } + + private static ref GLcontext Context + { + get + { +#if DEBUG + if ((IntPtr)context==IntPtr.Zero) + { + throw new NullReferenceException(); + } +#endif + return ref (*context); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void ActiveTexture(uint type) + { + Context.glActiveTexture(type); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void AttachShader(glHandle program, glHandle shader) + { + Context.glAttachShader(program.Value, shader.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void BindBuffer(BufferType bufferType, glHandle handle) + { + Context.glBindBuffer((uint)bufferType, handle.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void GetTextureImage(Texture2DTarget target, int level, ImageChannel channel, ImageChannelLayout channelLayout, ref T[] dataStream)where T: struct, +#if NET8_0_OR_GREATER + INumber +#else + IConvertible +#endif + + { +#pragma warning disable CS8500 + fixed (T* tptr = dataStream) + { + Context.glGetTexImage((uint)target, level, (uint)channel, (uint)channelLayout, tptr); + } +#pragma warning restore CS8500 + } + + /// + /// Bind a frame buffer to a frame buffer target + /// Same function as glBindFramebuffer. + /// + /// The frame buffer target of the binding operation. + /// The handle of the frame buffer object to bind. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void BindFrameBuffer(FrameBufferTarget target, glHandle handle) + { + Context.glBindFramebuffer((uint)target, handle.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void BindRenderBuffer(glHandle handle) + { + Context.glBindRenderbuffer(GLconst.RENDERBUFFER, handle.Value); + } + + + public static void WaitAccomplishment() + { + Context.glFinish(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void BindTexture(uint type, glHandle texture) + { + Context.glBindTexture(type, texture.Value); + } + + public static unsafe int GetMaskInteger(uint statusCode) + { + int ret = 0; + Context.glGetIntegerv(statusCode,&ret); + return ret; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void BindVertexArray(glHandle handle) + { + Context.glBindVertexArray(handle.Value); + } + + public static void RereadImage( + this Image i, (int X, int Y) beginPosition, FrameBufferChannel format, ImageChannelLayout dataType) + { + glArrayHandle handle = i.GetArrayHandle(); + Context.glReadPixels( + beginPosition.X, beginPosition.Y, i.Width, i.Height, (uint)format, (uint)dataType, (byte*)handle.AddressOfArray() + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void FrameBufferTexture2d(FrameBufferTarget target, uint attachment, Texture2DTarget texTarget,glHandle textureHandle ,int level) + { + Context.glFramebufferTexture2D( + (uint)target, attachment, (uint)texTarget,textureHandle.Value, level + ); + } + + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void ReadPixels( + (int X, int Y) beginPosition, (int width, int height) size, FrameBufferChannel format, ImageChannelLayout dataType, ref byte[] stream + ) + { + fixed (byte* bptr = stream) + { + Context.glReadPixels( + beginPosition.X, beginPosition.Y, + size.width, size.height, (uint)format, (uint)dataType, bptr); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Clear(MaskBufferBit mask) + { + Context.glClear((uint)mask); + } + + public static void CombineFrameBufferRenderBuffer(glHandle fboHandle, glHandle rboHandle) + { + Context.glFramebufferRenderbuffer(GLconst.FRAMEBUFFER,fboHandle.Value,GLconst.RENDERBUFFER, rboHandle.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void ClearColor(float R, float G, float B, float A) + { + Context.glClearColor(R, G, B, A); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void ClearGraphicError() + { + while (Context.glGetError() != 0) { } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void CompileShader(glHandle shaderhandle) + { + Context.glCompileShader(shaderhandle.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe glHandle CreateGraphicProgram() + { + return glHandle.Alloc(Context.glCreateProgram()); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static glHandle CreateProgram() + { + return glHandle.Alloc(Context.glCreateProgram()); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe glHandleSet CreateProgram(int count) + { + glHandleSet h = new glHandleSet(count); + for (int i = 0; i < count; i++) + { + h.SetValue(i, Context.glCreateProgram()); + } + return h; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static glHandleSet CreateShaderSet(int count, ShaderType type) + { + glHandleSet ret = new glHandleSet(count); + uint t = (uint)type; + for (int i = 0; i < count; i++) + { + uint id = Context.glCreateShader(t); + if (id == 0) + { + uint error = Context.glGetError(); + InternalIO.InternalWriteLog($"Failed in creating shader: {error}", LogType.Error); + throw new Exception(); + } + ret.SetValue(i, id); + } + return ret; + } + + + + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void DeleteBuffer(glHandle handle) + { + Context.glDeleteBuffers(1, (uint*)handle.Handle); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void DeleteBuffers(glHandleSet handle) + { + Context.glDeleteBuffers(handle.length, (uint*)handle.Handle); + handle.Release(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void DeleteVertexArrays(glHandleSet arrays) + { + Context.glDeleteVertexArrays(arrays.length, (uint*)arrays.Handle); + arrays.Release(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void DrawElements(GeometryType mode, uint count, TypeCode type, IntPtr ptr) + { + uint a; + switch (type) + { + case TypeCode.UInt32: + a = GLconst.UNSIGNED_INT; + break; + + case TypeCode.UInt16: + a = GLconst.UNSIGNED_SHORT; + break; + + case TypeCode.Byte: + a = GLconst.UNSIGNED_BYTE; + break; + + default: + InternalIO.InternalWriteLog( + $"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are supported."}", + LogType.Error); + return; + } + Context.glDrawElements((uint)mode, count, a, (void*)ptr); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void DrawElementsInstanced( + GeometryType mode, uint count, TypeCode type, IntPtr ptr, uint amount + ) + { + uint a; + switch (type) + { + case TypeCode.UInt32: + a = GLconst.UNSIGNED_INT; + break; + + case TypeCode.UInt16: + a = GLconst.UNSIGNED_SHORT; + break; + + case TypeCode.Byte: + a = GLconst.UNSIGNED_BYTE; + break; + + default: + InternalIO.InternalWriteLog( + $"{$"Parameter error in parameter {nameof(type)} method DrawElements. "}{$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are supported."}", + LogType.Error); + return; + } + Context.glDrawElementsInstanced((uint)mode, count, a, (void*)ptr, amount); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Enable(GLOperation operation) + { + Context.glEnable((uint)operation); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe glHandleSet GenBuffers(int count) + { + glHandleSet h = new glHandleSet(count); + Context.glGenBuffers(count, (uint*)h.Handle); + return h; + } + + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe glHandleSet GenRenderBuffer(int count) + { + glHandleSet h = new glHandleSet(count); + Context.glGenRenderbuffers(count, (uint*)h.Handle); + return h; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe glHandleSet GenTextures(int count) + { + glHandleSet h = new glHandleSet(count); + Context.glGenTextures(count, (uint*)h.Handle); + return h; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void SetRenderBufferStorage(RenderBufferInternalFormat internalFormat ,(int width, int height) size) + { + Context.glRenderbufferStorage( + GLconst.RENDERBUFFER, (uint)internalFormat,size.width,size.height + ); + } + + + public static unsafe glHandleSet GenVertexArrays(int count) + { + glHandleSet h = new glHandleSet(count); + Context.glGenVertexArrays(count, (uint*)h.Handle); + return h; + } + + public static string GetShaderStatus(Shader s, int index, int key) + { + IntPtr sptr = IntPtr.Zero; + if (InternalIO.glCheckShaderStatus(ref Context, s.handle[index].Value, key, ref sptr) == 0) + { + return Marshal.PtrToStringAnsi(sptr); + } + return string.Empty; + } + + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe glSHandle GetUniformLocation(glHandle program, string name) + { + byte[] code = Encoding.UTF8.GetBytes(name); + fixed (byte* ptr = code) + { + int ret = Context.glGetUniformLocation(program.Value, ptr); +#if DEBUG + if (ret == (int)(GLconst.INVALID_OPERATION) || + ret == (int)(GLconst.INVALID_VALUE)) + { + throw new InvalidOperationException(); + } + if (ret == -1 ) + { + throw new UniformEmptyReferenceException(nameof(program), name); + } +#endif + return glSHandle.Alloc(ret); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void LoadShaderSource(glHandle shaderHandle, byte[] codeStream) + { + fixed (byte* streamPtr = codeStream) + { + Context.glShaderSource(shaderHandle.Value, 1, &streamPtr, (void*)0); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void SetBufferData(BufferType bufferType, T bufferData, BufferUsage usage) + where T : struct + { + int size = Marshal.SizeOf(); +#pragma warning disable CS8500 + T* p = &bufferData; +#pragma warning restore CS8500 + Context.glBufferData( + (uint)bufferType, + (IntPtr)size, + (IntPtr)p, + (uint)usage); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void SetBufferData(BufferType bufferType, T[] bufferArray, BufferUsage usage) + where T : struct, +#if NET8_0_OR_GREATER + INumber +#else + IConvertible +#endif + { + int size = bufferArray.Length * Marshal.SizeOf(typeof(T)); + if (bufferArray == null) + { + return; + } +#pragma warning disable CS8500 + fixed (void* bufferPtr = bufferArray) +#pragma warning restore CS8500 + { + Context.glBufferData( + (uint)bufferType, + (IntPtr)size, + (IntPtr)bufferPtr, + (uint)usage); + } + } + + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void SetBufferData(BufferType bufferType, ReadOnlySpan bufferArray, BufferUsage usage) + where T : struct, +#if NET8_0_OR_GREATER + INumber +#else + IConvertible +#endif + { + int size = bufferArray.Length * Marshal.SizeOf(typeof(T)); + if (bufferArray == null) + { + return; + } +#pragma warning disable CS8500 + fixed (void* bufferPtr = bufferArray) +#pragma warning restore CS8500 + { + Context.glBufferData( + (uint)bufferType, + (IntPtr)size, + (IntPtr)bufferPtr, + (uint)usage); + } + } + + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void SetBufferData(BufferType bufferType, Span bufferArray, BufferUsage usage) + where T : struct, +#if NET8_0_OR_GREATER + INumber +#else + IConvertible +#endif + { + int size = bufferArray.Length * Marshal.SizeOf(typeof(T)); + if (bufferArray == null) + { + return; + } + +#pragma warning disable CS8500 + fixed (void* bufferPtr = &bufferArray.GetPinnableReference()) +#pragma warning restore CS8500 + { + Context.glBufferData( + (uint)bufferType, + (IntPtr)size, + (IntPtr)bufferPtr, + (uint)usage); + } + } + + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void SetBufferVectorData(BufferType bufferType, ReadOnlySpan bufferArray, BufferUsage usage) + where T : struct, IVector + { + int size = bufferArray.Length * Marshal.SizeOf(typeof(T)); + if (bufferArray == null) + { + return; + } +#pragma warning disable CS8500 + fixed (void* bufferPtr = &bufferArray.GetPinnableReference()) +#pragma warning restore CS8500 + { + Context.glBufferData( + (uint)bufferType, + (IntPtr)size, + (IntPtr)bufferPtr, + (uint)usage); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void SetBufferVectorData(BufferType bufferType, T[] bufferArray, BufferUsage usage) + where T : struct, IVector + { + int size = bufferArray.Length * Marshal.SizeOf(typeof(T)); + if (bufferArray == null) + { + return; + } +#pragma warning disable CS8500 + fixed (void* bufferPtr = bufferArray) +#pragma warning restore CS8500 + { + Context.glBufferData( + (uint)bufferType, + (IntPtr)size, + (IntPtr)bufferPtr, + (uint)usage); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void SetVertexAttribute(uint index, int size, TypeCode t, bool normalized, uint stride, int pointer) + { + uint type = InternalIO.GLtype[t]; + Context.glVertexAttribPointer(index, size, type, normalized ? 1 : 0, stride, (void*)pointer); + Context.glEnableVertexAttribArray(index); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void TextureImage2d(Texture2DTarget target, int level, uint internalformat, uint width, uint height, + uint format, ImageChannelLayout type, glHandle pixels) + { + Context.glTexImage2D( + (uint)target, level, internalformat, width, height, 0, format, (uint)type, pixels.valuePtr + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void TextureImage2d(Texture2DTarget target, int level, uint internalformat, uint width, uint height, + uint format, ImageChannelLayout type, glArrayHandle pixelArrayHandle) + { + Context.glTexImage2D( + (uint)target, level, internalformat, width, height, 0, format, (uint)type, (void*)pixelArrayHandle.handle.AddrOfPinnedObject() + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void TextureParameter(int target, uint pname, int param) + { + Context.glTexParameteri((uint)target, pname, param); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void UseProgram(glHandle program) + { + Context.glUseProgram(program.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void VertexAttributeDivisor(uint layoutIndex, uint divisor) + { + Context.glVertexAttribDivisor(layoutIndex, divisor); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Viewport(int x, int y, uint width, uint height) + { + Context.glViewport(x, y, width, height); + } + + } +} + diff --git a/源代码/StgSharpDebug/Graphics/GL/GLresourceGenrator.cs b/源代码/StgSharpDebug/Graphics/GL/GLresourceGenrator.cs new file mode 100644 index 00000000..9eab57dd --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/GL/GLresourceGenrator.cs @@ -0,0 +1,102 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="GLresourceGenrator.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics.GL +{ + public partial class glRenderStream + { + + /// + /// Create a set of . + /// + /// Amount of EBO to be created. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected ElementBuffer CreateElementBuffer(int count) + { + return new ElementBuffer(count, this); + } + + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected RenderBuffer CreateRenderBuffer(int count) + { + return new RenderBuffer(count, this); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected FrameBuffer CreateFrameBuffer(int count) + { + return new FrameBuffer(count, this); + } + + /// + /// Create a sets of + /// + /// Amount of textures to be created. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected TextureGL CreateTexture(int count) + { + return new TextureGL(count, this); + } + + /// + /// Create a set of . + /// + /// Amount of VAO to be created. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected VertexArray CreateVertexArray(int count) + { + return new VertexArray(count, this); + } + + /// + /// Create a set of . + /// + /// Amount of Object to be created. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected VertexBuffer CreateVertexBuffer(int count) + { + return new VertexBuffer(count, this); + } + + + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Graphics/GL/ShaderEdit/IglConvertable.cs b/源代码/StgSharpDebug/Graphics/GL/ShaderEdit/IglConvertable.cs new file mode 100644 index 00000000..55c678dc --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/GL/ShaderEdit/IglConvertable.cs @@ -0,0 +1,35 @@ +using StgSharp.Graphics.GL; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics.ShaderEdit +{ + public interface IglConvertable + { + /// + /// + /// + public void SetAllUniforms(); + + /// + /// + /// + public void GainAllUniforms(ShaderProgram source, params string[] uniformName); + + /// + /// + /// + public void DisplayGLtypeDefinition(); + + /// + /// + /// + /// + public ShaderStruct GetConvertedGLtype(); + + } +} diff --git a/源代码/StgSharpDebug/Graphics/GL/ShaderEdit/Shader.cs b/源代码/StgSharpDebug/Graphics/GL/ShaderEdit/Shader.cs new file mode 100644 index 00000000..39b6a020 --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/GL/ShaderEdit/Shader.cs @@ -0,0 +1,264 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Shader.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp; +using StgSharp.Data; + +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Xml.Linq; + +namespace StgSharp.Graphics.GL +{ + public abstract partial class glRenderStream : RenderStream + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected sealed override Shader CreateShaderSegment(ShaderType type, int count) + { + return new Shader( glFunc.CreateShaderSet(count, type), type); + } + /// + /// Create an instance of program + /// + /// New instance of instance. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected sealed override ShaderProgram CreateShaderProgram() + { + return new ShaderProgram(this); + } + } + + public class Shader : ISSDSerializable + { + + private readonly IntPtr context; + internal readonly glHandleSet handle; + public readonly ShaderType type; + + public SerializableTypeCode SSDTypeCode => SerializableTypeCode.Shader; + + internal unsafe Shader(glHandleSet handle, ShaderType usage) + { + this.handle = handle; + context = glFunc.CurrentContextHandle; + type = usage; + } + + /// + /// Attach one shader code to a shader program. + /// + /// Shader program to attach + /// Index of shader code in current shader code set. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void AttachTo(int index, ShaderProgram target) + { + glFunc.AttachShader(target.handle, handle[index]); + } + + public static byte[] FromCodeFile(string fileRoute) + { + string str = File.ReadAllText(fileRoute); + if (string.IsNullOrEmpty(str)) + { + throw new InvalidOperationException($"Cannot load and GLSL code from {fileRoute}"); + } + return Encoding.UTF8.GetBytes(str); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void Compile(int index, byte[] codeStream) + { + if (codeStream == null) + { + throw new ArgumentNullException(nameof(codeStream)); + } + glFunc.LoadShaderSource(handle[index], codeStream); + glFunc.CompileShader(handle[index]); + CheckStatus(index,ShaderStatus.CompileStatus); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void Compile(int index, string codeStream) + { + if (codeStream == null) + { + throw new ArgumentNullException(nameof(codeStream)); + } + glFunc.LoadShaderSource(handle[index],Encoding.ASCII.GetBytes( codeStream)); + glFunc.CompileShader(handle[index]); + CheckStatus(index, ShaderStatus.CompileStatus); + } + + public override string ToString() + { + return $"This is a {type} shader, its shader handles are {handle.ToString()}."; + } + + public byte[] GetBytes() + { + return Array.Empty(); + } + + public void CheckStatus(int index, ShaderStatus status) + { + string log = glFunc.GetShaderStatus(this,index, (int)status); + if (!string.IsNullOrEmpty(log)) + { + throw new Exception($"Shader Error \t{status}\n" + log); + } + } + + public byte[] GetBytes(out int length) + { + throw new NotImplementedException(); + } + + public void FromBytes(byte[] stream) + { + throw new NotImplementedException(); + } + } + + public enum ShaderStatus : int + { + CompileStatus = GLconst.COMPILE_STATUS, + } + + public class ShaderProgram + { + private readonly IntPtr binding; + internal readonly glHandle handle; + + /// + /// Init a program with no shader attached. + /// + internal unsafe ShaderProgram(glRenderStream binding) + { + this.binding = binding.ContextHandle; + handle = glFunc.CreateProgram(); + } + + /// + /// Get a uniform form current shader, + /// the value type of the uniform should be provided. + /// + /// ContextName of the Uniform in shader code + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe Uniform GetUniform(string name) where T : struct + { + return new Uniform(this, name, binding); + } + + /// + /// Get a uniform form current shader, + /// the value type of the uniform should be provided. + /// + /// ContextName of the Uniform in shader code + /// + public unsafe Uniform GetUniform(string name) + where T : struct + where U : struct + { + return new Uniform(this, name, binding); + } + + /// + /// Get a uniform form current shader, + /// the value type of the uniform should be provided. + /// + /// ContextName of the Uniform in shader code + /// + public unsafe Uniform GetUniform(string name) + where T : struct + where U : struct + where V : struct + { + return new Uniform(this, name); + } + /// + /// Get a uniform form current shader, + /// the value type of the uniform should be provided. + /// + /// ContextName of the Uniform in shader code + /// + public unsafe Uniform GetUniform(string name) + where T : struct + where U : struct + where V : struct + where W : struct + { + return new Uniform(this, name); + } + + /// + /// Link the shader to current context. + /// + public unsafe void Link() + { + if (InternalIO.InternalLinkShaderProgram((GLcontext*)this.binding, handle.Value) == 0) + { + IntPtr logPtr = InternalIO.InternalReadSSCLog(); + try + { + byte[] logByte = new byte[512]; + Marshal.Copy(logPtr, logByte, 0, 512); + string log = Encoding.UTF8.GetString(logByte); + log = log.Replace("\0", string.Empty); + InternalIO.InternalWriteLog(log, LogType.Error); + } + catch (Exception ex) + { + InternalIO.InternalWriteLog(ex.Message, LogType.Error); + } + } + } + + /// + /// Let the current context use this shader. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void Use() + { + glFunc.UseProgram(handle); + } + + ~ShaderProgram() + { + //handle.Dispose(); + } + + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Graphics/GL/ShaderEdit/Uniform.cs b/源代码/StgSharpDebug/Graphics/GL/ShaderEdit/Uniform.cs new file mode 100644 index 00000000..84ae1faa --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/GL/ShaderEdit/Uniform.cs @@ -0,0 +1,257 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Uniform.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Graphics; +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Graphics.GL +{ + public class Uniform + { + protected IntPtr binding; + internal glSHandle id; + + + public glSHandle Handle + { + get => id; + } + } + + public sealed class Uniform : Uniform + where T : struct + { + + internal unsafe Uniform(glSHandle id) + { + this.id = id; + } + + internal unsafe Uniform( + ShaderProgram program, string name, glRenderStream binding) + { + this.binding = binding.ContextHandle; + id = glFunc.GetUniformLocation(program.handle, name); + } + + internal unsafe Uniform( + ShaderProgram program, string name, IntPtr binding) + { + this.binding = binding; + id = glFunc.GetUniformLocation(program.handle, name); + } + + internal Uniform() + { + + } + + internal static Uniform FromHandle(glSHandle handle) + { + return new Uniform() { id = handle }; + } + + } + + public sealed class Uniform: Uniform + where T : struct + where U : struct + { + + internal unsafe Uniform(glSHandle id) + { + this.id = id; + } + + internal unsafe Uniform( + ShaderProgram program, string name, glRenderStream binding) + { + this.binding = binding.ContextHandle; + id = glFunc.GetUniformLocation(program.handle, name); + } + + internal unsafe Uniform( + ShaderProgram program, string name, IntPtr binding) + { + this.binding = binding; + id = glFunc.GetUniformLocation(program.handle, name); + } + + internal Uniform() + { + + } + + internal static Uniform FromHandle(glSHandle handle) + { + return new Uniform() { id = handle }; + } + + } + + public sealed class Uniform:Uniform + where T : struct + where U : struct + where V : struct + { + + internal unsafe Uniform(glSHandle id) + { + this.id = id; + } + + internal unsafe Uniform( + ShaderProgram program, string name) + { + this.binding = glFunc.CurrentContextHandle; + id = glFunc.GetUniformLocation(program.handle, name); + } + + public unsafe Uniform(ShaderProgram program, string name, glRenderStream binding) + { + this.binding = binding.ContextHandle; + id = glFunc.GetUniformLocation(program.handle, name); + } + + internal Uniform() + { + + } + + internal static Uniform FromHandle(glSHandle handle) + { + return new Uniform() { id = handle }; + } + + } + + public sealed class Uniform:Uniform + where T : struct + where U : struct + where V : struct + where W : struct + { + + + internal unsafe Uniform(glSHandle id) + { + this.id = id; + } + + internal unsafe Uniform(ShaderProgram program, string name, glRenderStream binding) + { + this.binding = binding.ContextHandle; + id = glFunc.GetUniformLocation(program.handle, name); + } + + internal unsafe Uniform( + ShaderProgram program, string name) + { + this.binding = glFunc.CurrentContextHandle; + id = glFunc.GetUniformLocation(program.handle, name); + } + + internal Uniform() + { + + } + + internal static Uniform FromHandle(glSHandle handle) + { + return new Uniform() { id = handle }; + } + + } + + internal static partial class glFunc + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe static void SetUniformValue + (Uniform uniform, Matrix44 mat) + { + Matrix44 temp = mat; + Context.glUniformMatrix4fv(uniform.id.Value, 1, false, (float*)&temp); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe static void SetUniformValue(Uniform uniform, vec4d vec) + { + vec4d temp = vec; + Context.glUniform1fv(uniform.id.Value , 4, &temp); + } + + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe static void SetUniformValue(Uniform uniform, vec4d vec) + { + vec4d temp = vec; + Context.glUniform1fv(uniform.id.Value , 4, &temp); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void SetUniformValue(Uniform uniform, float v0) + { + Context.glUniform1f(uniform.id.Value , v0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void SetUniformValue(Uniform uniform, int i0) + { + Context.glUniform1i(uniform.id.Value , i0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void SetUniformValue(Uniform uniform, float v0, float v1) + { + Context.glUniform2f(uniform.id.Value , v0, v1); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void SetUniformValue(Uniform uniform, float v0, float v1, float v2) + { + Context.glUniform3f(uniform.id.Value , v0, v1, v2); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe void SetUniformValue(Uniform uniform, float v0, float v1, float v2, float v3) + { + Context.glUniform4f(uniform.id.Value , v0, v1, v2, v3); + } + + } + +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Graphics/GL/glApiManager.cs b/源代码/StgSharpDebug/Graphics/GL/glApiManager.cs new file mode 100644 index 00000000..041968dd --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/GL/glApiManager.cs @@ -0,0 +1,1967 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="glApiManager.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Graphics.GL +{ + public static partial class glManager + { + + private const int glExtension = 0x1f03; + private const int glVersion = 0x1f02; + + private static readonly string[] glBranch = + new string[] { + "OpenGL ES-CM ", + "OpenGL ES-CL ", + "OpenGL ES ", + "OpenGL SC " + }; + + private static string glExtensionList; + + /// + /// Load all supported OpenGL APIs and bind them to given context. + /// + /// The used as current OpenGL context + public static unsafe void LoadGLapi(this ViewPort vp) + { + GLcontext* context = (GLcontext*)vp.GraphicHandle; + delegate* loader = &InternalIO.glfwGetProcAddress; +#pragma warning disable CS8909 + if (context->glGetString != (delegate*)IntPtr.Zero) +#pragma warning restore CS8909 + { + return; + } + IntPtr proc = loader("glGetString"); + if (proc == IntPtr.Zero) + { +#if DEBUG + Console.WriteLine("Cannot load glFunc."); +#endif + throw new Exception("Cannot load gl"); + } + context->glGetString = (delegate*)proc; + + string coreVersion; + if (context->glGetString(glVersion) == IntPtr.Zero) + { + InternalIO.InternalWriteLog("Failed to call glGetString", LogType.Error); + } + coreVersion = Marshal.PtrToStringAnsi(context->glGetString(glVersion)); + + foreach (string branch in glBranch) + { + if (coreVersion.Contains(branch)) + { + coreVersion.Replace(branch, string.Empty); + } + } + string[] versionSep = coreVersion!.Split('.'); + int majorVersion = int.Parse(versionSep[0]); + int minorVersion = int.Parse(versionSep[1]); + CheckCoreVersion(majorVersion, minorVersion); + + try + { + #region load_core_gl + + LoadGLcore10(context, loader); + LoadGLcore11(context, loader); + LoadGLcore12(context, loader); + LoadGLcore13(context, loader); + LoadGLcore14(context, loader); + LoadGLcore15(context, loader); + LoadGLcore20(context, loader); + LoadGLcore21(context, loader); + LoadGLcore30(context, loader); + LoadGLcore31(context, loader); + LoadGLcore32(context, loader); + LoadGLcore33(context, loader); + LoadGLcore40(context, loader); + LoadGLcore41(context, loader); + LoadGLcore42(context, loader); + LoadGLcore43(context, loader); + LoadGLcore44(context, loader); + LoadGLcore45(context, loader); + LoadGLcore46(context, loader); + + #endregion load_core_gl + } + catch (Exception ex) + { + if (ex.Message != "Final Version") + { + throw; + } + } + + IntPtr strPtr = context->glGetString(glExtension); + string extension; + if (strPtr == IntPtr.Zero) + { + InternalIO.InternalWriteLog("No supported OpenGL extensions are found.", LogType.Info); + return; + } + else + { + extension = Marshal.PtrToStringAnsi(strPtr); + } + + List extensions = + extension.Split(" ").ToList(); + + #region checkGLextensions + + if (extensions.Contains("gl_4DFX_multisample")) { _4DFX_multisample = true; extensions.Remove("gl_4DFX_multisample"); } + if (extensions.Contains("gl_3DFX_tbuffer")) { _3DFX_tbuffer = true; extensions.Remove("gl_3DFX_tbuffer"); } + if (extensions.Contains("gl_3DFX_texture_compression_FXT1")) { _3DFX_texture_compression_FXT1 = true; extensions.Remove("gl_3DFX_texture_compression_FXT1"); } + if (extensions.Contains("gl_AMD_blend_minmax_factor")) { AMD_blend_minmax_factor = true; extensions.Remove("glAMD_blend_minmax_factor"); } + if (extensions.Contains("gl_AMD_conservative_depth")) { AMD_conservative_depth = true; extensions.Remove("glAMD_conservative_depth"); } + if (extensions.Contains("gl_AMD_debug_output")) { AMD_debug_output = true; extensions.Remove("glAMD_debug_output"); } + if (extensions.Contains("gl_AMD_depth_clamp_separate")) { AMD_depth_clamp_separate = true; extensions.Remove("glAMD_depth_clamp_separate"); } + if (extensions.Contains("gl_AMD_draw_buffers_blend")) { AMD_draw_buffers_blend = true; extensions.Remove("glAMD_draw_buffers_blend"); } + if (extensions.Contains("gl_AMD_framebuffer_multisample_advanced")) { AMD_framebuffer_multisample_advanced = true; extensions.Remove("glAMD_framebuffer_multisample_advanced"); } + if (extensions.Contains("gl_AMD_framebuffer_sample_positions")) { AMD_framebuffer_sample_positions = true; extensions.Remove("glAMD_framebuffer_sample_positions"); } + if (extensions.Contains("gl_AMD_gcn_shader")) { AMD_gcn_shader = true; extensions.Remove("glAMD_gcn_shader"); } + if (extensions.Contains("gl_AMD_gpu_shader_half_float")) { AMD_gpu_shader_half_float = true; extensions.Remove("glAMD_gpu_shader_half_float"); } + if (extensions.Contains("gl_AMD_gpu_shader_int16")) { AMD_gpu_shader_int16 = true; extensions.Remove("glAMD_gpu_shader_int16"); } + if (extensions.Contains("gl_AMD_gpu_shader_int64")) { AMD_gpu_shader_int64 = true; extensions.Remove("glAMD_gpu_shader_int64"); } + if (extensions.Contains("gl_AMD_interleaved_elements")) { AMD_interleaved_elements = true; extensions.Remove("glAMD_interleaved_elements"); } + if (extensions.Contains("gl_AMD_multi_draw_indirect")) { AMD_multi_draw_indirect = true; extensions.Remove("glAMD_multi_draw_indirect"); } + if (extensions.Contains("gl_AMD_name_gen_delete")) { AMD_name_gen_delete = true; extensions.Remove("glAMD_name_gen_delete"); } + if (extensions.Contains("gl_AMD_occlusion_query_event")) { AMD_occlusion_query_event = true; extensions.Remove("glAMD_occlusion_query_event"); } + if (extensions.Contains("gl_AMD_performance_monitor")) { AMD_performance_monitor = true; extensions.Remove("glAMD_performance_monitor"); } + if (extensions.Contains("gl_AMD_pinned_memory")) { AMD_pinned_memory = true; extensions.Remove("glAMD_pinned_memory"); } + if (extensions.Contains("gl_AMD_query_buffer_object")) { AMD_query_buffer_object = true; extensions.Remove("glAMD_query_buffer_object"); } + if (extensions.Contains("gl_AMD_sample_positions")) { AMD_sample_positions = true; extensions.Remove("glAMD_sample_positions"); } + if (extensions.Contains("gl_AMD_seamless_cubemap_per_texture")) { AMD_seamless_cubemap_per_texture = true; extensions.Remove("glAMD_seamless_cubemap_per_texture"); } + if (extensions.Contains("gl_AMD_shader_atomic_counter_ops")) { AMD_shader_atomic_counter_ops = true; extensions.Remove("glAMD_shader_atomic_counter_ops"); } + if (extensions.Contains("gl_AMD_shader_ballot")) { AMD_shader_ballot = true; extensions.Remove("glAMD_shader_ballot"); } + if (extensions.Contains("gl_AMD_shader_explicit_vertex_parameter")) { AMD_shader_explicit_vertex_parameter = true; extensions.Remove("glAMD_shader_explicit_vertex_parameter"); } + if (extensions.Contains("gl_AMD_shader_gpu_shader_half_float_fetch")) { AMD_shader_gpu_shader_half_float_fetch = true; extensions.Remove("glAMD_shader_gpu_shader_half_float_fetch"); } + if (extensions.Contains("gl_AMD_shader_image_load_store_lod")) { AMD_shader_image_load_store_lod = true; extensions.Remove("glAMD_shader_image_load_store_lod"); } + if (extensions.Contains("gl_AMD_shader_stencil_export")) { AMD_shader_stencil_export = true; extensions.Remove("glAMD_shader_stencil_export"); } + if (extensions.Contains("gl_AMD_shader_trinary_minmax")) { AMD_shader_trinary_minmax = true; extensions.Remove("glAMD_shader_trinary_minmax"); } + if (extensions.Contains("gl_AMD_sparse_texture")) { AMD_sparse_texture = true; extensions.Remove("glAMD_sparse_texture"); } + if (extensions.Contains("gl_AMD_stencil_operation_extended")) { AMD_stencil_operation_extended = true; extensions.Remove("glAMD_stencil_operation_extended"); } + if (extensions.Contains("gl_AMD_texture_gather_bias_lod")) { AMD_texture_gather_bias_lod = true; extensions.Remove("glAMD_texture_gather_bias_lod"); } + if (extensions.Contains("gl_AMD_texture_texture4")) { AMD_texture_texture4 = true; extensions.Remove("glAMD_texture_texture4"); } + if (extensions.Contains("gl_AMD_transform_feedback3_lines_triangles")) { AMD_transform_feedback3_lines_triangles = true; extensions.Remove("glAMD_transform_feedback3_lines_triangles"); } + if (extensions.Contains("gl_AMD_transform_feedback4")) { AMD_transform_feedback4 = true; extensions.Remove("glAMD_transform_feedback4"); } + if (extensions.Contains("gl_AMD_vertex_shader_layer")) { AMD_vertex_shader_layer = true; extensions.Remove("glAMD_vertex_shader_layer"); } + if (extensions.Contains("gl_AMD_vertex_shader_tessellator")) { AMD_vertex_shader_tessellator = true; extensions.Remove("glAMD_vertex_shader_tessellator"); } + if (extensions.Contains("gl_AMD_vertex_shader_viewport_index")) { AMD_vertex_shader_viewport_index = true; extensions.Remove("glAMD_vertex_shader_viewport_index"); } + if (extensions.Contains("gl_APPLE_aux_depth_stencil")) { APPLE_aux_depth_stencil = true; extensions.Remove("glAPPLE_aux_depth_stencil"); } + if (extensions.Contains("gl_APPLE_client_storage")) { APPLE_client_storage = true; extensions.Remove("glAPPLE_client_storage"); } + if (extensions.Contains("gl_APPLE_element_array")) { APPLE_element_array = true; extensions.Remove("glAPPLE_element_array"); } + if (extensions.Contains("gl_APPLE_fence")) { APPLE_fence = true; extensions.Remove("glAPPLE_fence"); } + if (extensions.Contains("gl_APPLE_float_pixels")) { APPLE_float_pixels = true; extensions.Remove("glAPPLE_float_pixels"); } + if (extensions.Contains("gl_APPLE_flush_buffer_range")) { APPLE_flush_buffer_range = true; extensions.Remove("glAPPLE_flush_buffer_range"); } + if (extensions.Contains("gl_APPLE_object_purgeable")) { APPLE_object_purgeable = true; extensions.Remove("glAPPLE_object_purgeable"); } + if (extensions.Contains("gl_APPLE_rgb_422")) { APPLE_rgb_422 = true; extensions.Remove("glAPPLE_rgb_422"); } + if (extensions.Contains("gl_APPLE_row_bytes")) { APPLE_row_bytes = true; extensions.Remove("glAPPLE_row_bytes"); } + if (extensions.Contains("gl_APPLE_specular_vector")) { APPLE_specular_vector = true; extensions.Remove("glAPPLE_specular_vector"); } + if (extensions.Contains("gl_APPLE_texture_range")) { APPLE_texture_range = true; extensions.Remove("glAPPLE_texture_range"); } + if (extensions.Contains("gl_APPLE_transform_hint")) { APPLE_transform_hint = true; extensions.Remove("glAPPLE_transform_hint"); } + if (extensions.Contains("gl_APPLE_vertex_array_object")) { APPLE_vertex_array_object = true; extensions.Remove("glAPPLE_vertex_array_object"); } + if (extensions.Contains("gl_APPLE_vertex_array_range")) { APPLE_vertex_array_range = true; extensions.Remove("glAPPLE_vertex_array_range"); } + if (extensions.Contains("gl_APPLE_vertex_program_evaluators")) { APPLE_vertex_program_evaluators = true; extensions.Remove("glAPPLE_vertex_program_evaluators"); } + if (extensions.Contains("gl_APPLE_ycbcr_422")) { APPLE_ycbcr_422 = true; extensions.Remove("glAPPLE_ycbcr_422"); } + if (extensions.Contains("gl_ARB_ES2_compatibility")) { ARB_ES2_compatibility = true; extensions.Remove("glARB_ES2_compatibility"); } + if (extensions.Contains("gl_ARB_ES3_1_compatibility")) { ARB_ES3_1_compatibility = true; extensions.Remove("glARB_ES3_1_compatibility"); } + if (extensions.Contains("gl_ARB_ES3_2_compatibility")) { ARB_ES3_2_compatibility = true; extensions.Remove("glARB_ES3_2_compatibility"); } + if (extensions.Contains("gl_ARB_ES3_compatibility")) { ARB_ES3_compatibility = true; extensions.Remove("glARB_ES3_compatibility"); } + if (extensions.Contains("gl_ARB_arrays_of_arrays")) { ARB_arrays_of_arrays = true; extensions.Remove("glARB_arrays_of_arrays"); } + if (extensions.Contains("gl_ARB_base_instance")) { ARB_base_instance = true; extensions.Remove("glARB_base_instance"); } + if (extensions.Contains("gl_ARB_bindless_texture")) { ARB_bindless_texture = true; extensions.Remove("glARB_bindless_texture"); } + if (extensions.Contains("gl_ARB_blend_func_extended")) { ARB_blend_func_extended = true; extensions.Remove("glARB_blend_func_extended"); } + if (extensions.Contains("gl_ARB_buffer_storage")) { ARB_buffer_storage = true; extensions.Remove("glARB_buffer_storage"); } + if (extensions.Contains("gl_ARB_cl_event")) { ARB_cl_event = true; extensions.Remove("glARB_cl_event"); } + if (extensions.Contains("gl_ARB_clear_buffer_object")) { ARB_clear_buffer_object = true; extensions.Remove("glARB_clear_buffer_object"); } + if (extensions.Contains("gl_ARB_clear_texture")) { ARB_clear_texture = true; extensions.Remove("glARB_clear_texture"); } + if (extensions.Contains("gl_ARB_clip_control")) { ARB_clip_control = true; extensions.Remove("glARB_clip_control"); } + if (extensions.Contains("gl_ARB_color_buffer_float")) { ARB_color_buffer_float = true; extensions.Remove("glARB_color_buffer_float"); } + if (extensions.Contains("gl_ARB_compatibility")) { ARB_compatibility = true; extensions.Remove("glARB_compatibility"); } + if (extensions.Contains("gl_ARB_compressed_texture_pixel_storage")) { ARB_compressed_texture_pixel_storage = true; extensions.Remove("glARB_compressed_texture_pixel_storage"); } + if (extensions.Contains("gl_ARB_compute_shader")) { ARB_compute_shader = true; extensions.Remove("glARB_compute_shader"); } + if (extensions.Contains("gl_ARB_compute_variable_group_size")) { ARB_compute_variable_group_size = true; extensions.Remove("glARB_compute_variable_group_size"); } + if (extensions.Contains("gl_ARB_conditional_render_inverted")) { ARB_conditional_render_inverted = true; extensions.Remove("glARB_conditional_render_inverted"); } + if (extensions.Contains("gl_ARB_conservative_depth")) { ARB_conservative_depth = true; extensions.Remove("glARB_conservative_depth"); } + if (extensions.Contains("gl_ARB_copy_buffer")) { ARB_copy_buffer = true; extensions.Remove("glARB_copy_buffer"); } + if (extensions.Contains("gl_ARB_copy_image")) { ARB_copy_image = true; extensions.Remove("glARB_copy_image"); } + if (extensions.Contains("gl_ARB_cull_distance")) { ARB_cull_distance = true; extensions.Remove("glARB_cull_distance"); } + if (extensions.Contains("gl_ARB_debug_output")) { ARB_debug_output = true; extensions.Remove("glARB_debug_output"); } + if (extensions.Contains("gl_ARB_depth_buffer_float")) { ARB_depth_buffer_float = true; extensions.Remove("glARB_depth_buffer_float"); } + if (extensions.Contains("gl_ARB_depth_clamp")) { ARB_depth_clamp = true; extensions.Remove("glARB_depth_clamp"); } + if (extensions.Contains("gl_ARB_depth_texture")) { ARB_depth_texture = true; extensions.Remove("glARB_depth_texture"); } + if (extensions.Contains("gl_ARB_derivative_control")) { ARB_derivative_control = true; extensions.Remove("glARB_derivative_control"); } + if (extensions.Contains("gl_ARB_direct_state_access")) { ARB_direct_state_access = true; extensions.Remove("glARB_direct_state_access"); } + if (extensions.Contains("gl_ARB_draw_buffers")) { ARB_draw_buffers = true; extensions.Remove("glARB_draw_buffers"); } + if (extensions.Contains("gl_ARB_draw_buffers_blend")) { ARB_draw_buffers_blend = true; extensions.Remove("glARB_draw_buffers_blend"); } + if (extensions.Contains("gl_ARB_draw_elements_base_vertex")) { ARB_draw_elements_base_vertex = true; extensions.Remove("glARB_draw_elements_base_vertex"); } + if (extensions.Contains("gl_ARB_draw_indirect")) { ARB_draw_indirect = true; extensions.Remove("glARB_draw_indirect"); } + if (extensions.Contains("gl_ARB_draw_instanced")) { ARB_draw_instanced = true; extensions.Remove("glARB_draw_instanced"); } + if (extensions.Contains("gl_ARB_enhanced_layouts")) { ARB_enhanced_layouts = true; extensions.Remove("glARB_enhanced_layouts"); } + if (extensions.Contains("gl_ARB_explicit_attrib_location")) { ARB_explicit_attrib_location = true; extensions.Remove("glARB_explicit_attrib_location"); } + if (extensions.Contains("gl_ARB_explicit_uniform_location")) { ARB_explicit_uniform_location = true; extensions.Remove("glARB_explicit_uniform_location"); } + if (extensions.Contains("gl_ARB_fragment_coord_conventions")) { ARB_fragment_coord_conventions = true; extensions.Remove("glARB_fragment_coord_conventions"); } + if (extensions.Contains("gl_ARB_fragment_layer_viewport")) { ARB_fragment_layer_viewport = true; extensions.Remove("glARB_fragment_layer_viewport"); } + if (extensions.Contains("gl_ARB_fragment_program")) { ARB_fragment_program = true; extensions.Remove("glARB_fragment_program"); } + if (extensions.Contains("gl_ARB_fragment_program_shadow")) { ARB_fragment_program_shadow = true; extensions.Remove("glARB_fragment_program_shadow"); } + if (extensions.Contains("gl_ARB_fragment_shader")) { ARB_fragment_shader = true; extensions.Remove("glARB_fragment_shader"); } + if (extensions.Contains("gl_ARB_fragment_shader_interlock")) { ARB_fragment_shader_interlock = true; extensions.Remove("glARB_fragment_shader_interlock"); } + if (extensions.Contains("gl_ARB_framebuffer_no_attachments")) { ARB_framebuffer_no_attachments = true; extensions.Remove("glARB_framebuffer_no_attachments"); } + if (extensions.Contains("gl_ARB_framebuffer_object")) { ARB_framebuffer_object = true; extensions.Remove("glARB_framebuffer_object"); } + if (extensions.Contains("gl_ARB_framebuffer_sRGB")) { ARB_framebuffer_sRGB = true; extensions.Remove("glARB_framebuffer_sRGB"); } + if (extensions.Contains("gl_ARB_geometry_shader4")) { ARB_geometry_shader4 = true; extensions.Remove("glARB_geometry_shader4"); } + if (extensions.Contains("gl_ARB_get_program_binary")) { ARB_get_program_binary = true; extensions.Remove("glARB_get_program_binary"); } + if (extensions.Contains("gl_ARB_get_texture_sub_image")) { ARB_get_texture_sub_image = true; extensions.Remove("glARB_get_texture_sub_image"); } + if (extensions.Contains("gl_ARB_gl_spirv")) { ARB_gl_spirv = true; extensions.Remove("glARB_gl_spirv"); } + if (extensions.Contains("gl_ARB_gpu_shader5")) { ARB_gpu_shader5 = true; extensions.Remove("glARB_gpu_shader5"); } + if (extensions.Contains("gl_ARB_gpu_shader_fp64")) { ARB_gpu_shader_fp64 = true; extensions.Remove("glARB_gpu_shader_fp64"); } + if (extensions.Contains("gl_ARB_gpu_shader_int64")) { ARB_gpu_shader_int64 = true; extensions.Remove("glARB_gpu_shader_int64"); } + if (extensions.Contains("gl_ARB_half_float_pixel")) { ARB_half_float_pixel = true; extensions.Remove("glARB_half_float_pixel"); } + if (extensions.Contains("gl_ARB_half_float_vertex")) { ARB_half_float_vertex = true; extensions.Remove("glARB_half_float_vertex"); } + if (extensions.Contains("gl_ARB_imaging")) { ARB_imaging = true; extensions.Remove("glARB_imaging"); } + if (extensions.Contains("gl_ARB_indirect_parameters")) { ARB_indirect_parameters = true; extensions.Remove("glARB_indirect_parameters"); } + if (extensions.Contains("gl_ARB_instanced_arrays")) { ARB_instanced_arrays = true; extensions.Remove("glARB_instanced_arrays"); } + if (extensions.Contains("gl_ARB_internalformat_query")) { ARB_internalformat_query = true; extensions.Remove("glARB_internalformat_query"); } + if (extensions.Contains("gl_ARB_internalformat_query2")) { ARB_internalformat_query2 = true; extensions.Remove("glARB_internalformat_query2"); } + if (extensions.Contains("gl_ARB_invalidate_subdata")) { ARB_invalidate_subdata = true; extensions.Remove("glARB_invalidate_subdata"); } + if (extensions.Contains("gl_ARB_map_buffer_alignment")) { ARB_map_buffer_alignment = true; extensions.Remove("glARB_map_buffer_alignment"); } + if (extensions.Contains("gl_ARB_map_buffer_range")) { ARB_map_buffer_range = true; extensions.Remove("glARB_map_buffer_range"); } + if (extensions.Contains("gl_ARB_matrix_palette")) { ARB_matrix_palette = true; extensions.Remove("glARB_matrix_palette"); } + if (extensions.Contains("gl_ARB_multi_bind")) { ARB_multi_bind = true; extensions.Remove("glARB_multi_bind"); } + if (extensions.Contains("gl_ARB_multi_draw_indirect")) { ARB_multi_draw_indirect = true; extensions.Remove("glARB_multi_draw_indirect"); } + if (extensions.Contains("gl_ARB_multisample")) { ARB_multisample = true; extensions.Remove("glARB_multisample"); } + if (extensions.Contains("gl_ARB_multitexture")) { ARB_multitexture = true; extensions.Remove("glARB_multitexture"); } + if (extensions.Contains("gl_ARB_occlusion_query")) { ARB_occlusion_query = true; extensions.Remove("glARB_occlusion_query"); } + if (extensions.Contains("gl_ARB_occlusion_query2")) { ARB_occlusion_query2 = true; extensions.Remove("glARB_occlusion_query2"); } + if (extensions.Contains("gl_ARB_parallel_shader_compile")) { ARB_parallel_shader_compile = true; extensions.Remove("glARB_parallel_shader_compile"); } + if (extensions.Contains("gl_ARB_pipeline_statistics_query")) { ARB_pipeline_statistics_query = true; extensions.Remove("glARB_pipeline_statistics_query"); } + if (extensions.Contains("gl_ARB_pixel_buffer_object")) { ARB_pixel_buffer_object = true; extensions.Remove("glARB_pixel_buffer_object"); } + if (extensions.Contains("gl_ARB_point_parameters")) { ARB_point_parameters = true; extensions.Remove("glARB_point_parameters"); } + if (extensions.Contains("gl_ARB_point_sprite")) { ARB_point_sprite = true; extensions.Remove("glARB_point_sprite"); } + if (extensions.Contains("gl_ARB_polygon_offset_clamp")) { ARB_polygon_offset_clamp = true; extensions.Remove("glARB_polygon_offset_clamp"); } + if (extensions.Contains("gl_ARB_post_depth_coverage")) { ARB_post_depth_coverage = true; extensions.Remove("glARB_post_depth_coverage"); } + if (extensions.Contains("gl_ARB_program_interface_query")) { ARB_program_interface_query = true; extensions.Remove("glARB_program_interface_query"); } + if (extensions.Contains("gl_ARB_provoking_vertex")) { ARB_provoking_vertex = true; extensions.Remove("glARB_provoking_vertex"); } + if (extensions.Contains("gl_ARB_query_buffer_object")) { ARB_query_buffer_object = true; extensions.Remove("glARB_query_buffer_object"); } + if (extensions.Contains("gl_ARB_robust_buffer_access_behavior")) { ARB_robust_buffer_access_behavior = true; extensions.Remove("glARB_robust_buffer_access_behavior"); } + if (extensions.Contains("gl_ARB_robustness")) { ARB_robustness = true; extensions.Remove("glARB_robustness"); } + if (extensions.Contains("gl_ARB_robustness_isolation")) { ARB_robustness_isolation = true; extensions.Remove("glARB_robustness_isolation"); } + if (extensions.Contains("gl_ARB_sample_locations")) { ARB_sample_locations = true; extensions.Remove("glARB_sample_locations"); } + if (extensions.Contains("gl_ARB_sample_shading")) { ARB_sample_shading = true; extensions.Remove("glARB_sample_shading"); } + if (extensions.Contains("gl_ARB_sampler_objects")) { ARB_sampler_objects = true; extensions.Remove("glARB_sampler_objects"); } + if (extensions.Contains("gl_ARB_seamless_cube_map")) { ARB_seamless_cube_map = true; extensions.Remove("glARB_seamless_cube_map"); } + if (extensions.Contains("gl_ARB_seamless_cubemap_per_texture")) { ARB_seamless_cubemap_per_texture = true; extensions.Remove("glARB_seamless_cubemap_per_texture"); } + if (extensions.Contains("gl_ARB_separate_shader_objects")) { ARB_separate_shader_objects = true; extensions.Remove("glARB_separate_shader_objects"); } + if (extensions.Contains("gl_ARB_shader_atomic_counter_ops")) { ARB_shader_atomic_counter_ops = true; extensions.Remove("glARB_shader_atomic_counter_ops"); } + if (extensions.Contains("gl_ARB_shader_atomic_counters")) { ARB_shader_atomic_counters = true; extensions.Remove("glARB_shader_atomic_counters"); } + if (extensions.Contains("gl_ARB_shader_ballot")) { ARB_shader_ballot = true; extensions.Remove("glARB_shader_ballot"); } + if (extensions.Contains("gl_ARB_shader_bit_encoding")) { ARB_shader_bit_encoding = true; extensions.Remove("glARB_shader_bit_encoding"); } + if (extensions.Contains("gl_ARB_shader_clock")) { ARB_shader_clock = true; extensions.Remove("glARB_shader_clock"); } + if (extensions.Contains("gl_ARB_shader_draw_parameters")) { ARB_shader_draw_parameters = true; extensions.Remove("glARB_shader_draw_parameters"); } + if (extensions.Contains("gl_ARB_shader_group_vote")) { ARB_shader_group_vote = true; extensions.Remove("glARB_shader_group_vote"); } + if (extensions.Contains("gl_ARB_shader_image_load_store")) { ARB_shader_image_load_store = true; extensions.Remove("glARB_shader_image_load_store"); } + if (extensions.Contains("gl_ARB_shader_image_size")) { ARB_shader_image_size = true; extensions.Remove("glARB_shader_image_size"); } + if (extensions.Contains("gl_ARB_shader_objects")) { ARB_shader_objects = true; extensions.Remove("glARB_shader_objects"); } + if (extensions.Contains("gl_ARB_shader_precision")) { ARB_shader_precision = true; extensions.Remove("glARB_shader_precision"); } + if (extensions.Contains("gl_ARB_shader_stencil_export")) { ARB_shader_stencil_export = true; extensions.Remove("glARB_shader_stencil_export"); } + if (extensions.Contains("gl_ARB_shader_storage_buffer_object")) { ARB_shader_storage_buffer_object = true; extensions.Remove("glARB_shader_storage_buffer_object"); } + if (extensions.Contains("gl_ARB_shader_subroutine")) { ARB_shader_subroutine = true; extensions.Remove("glARB_shader_subroutine"); } + if (extensions.Contains("gl_ARB_shader_texture_image_samples")) { ARB_shader_texture_image_samples = true; extensions.Remove("glARB_shader_texture_image_samples"); } + if (extensions.Contains("gl_ARB_shader_texture_lod")) { ARB_shader_texture_lod = true; extensions.Remove("glARB_shader_texture_lod"); } + if (extensions.Contains("gl_ARB_shader_viewport_layer_array")) { ARB_shader_viewport_layer_array = true; extensions.Remove("glARB_shader_viewport_layer_array"); } + if (extensions.Contains("gl_ARB_shading_language_100")) { ARB_shading_language_100 = true; extensions.Remove("glARB_shading_language_100"); } + if (extensions.Contains("gl_ARB_shading_language_420pack")) { ARB_shading_language_420pack = true; extensions.Remove("glARB_shading_language_420pack"); } + if (extensions.Contains("gl_ARB_shading_language_include")) { ARB_shading_language_include = true; extensions.Remove("glARB_shading_language_include"); } + if (extensions.Contains("gl_ARB_shading_language_packing")) { ARB_shading_language_packing = true; extensions.Remove("glARB_shading_language_packing"); } + if (extensions.Contains("gl_ARB_shadow")) { ARB_shadow = true; extensions.Remove("glARB_shadow"); } + if (extensions.Contains("gl_ARB_shadow_ambient")) { ARB_shadow_ambient = true; extensions.Remove("glARB_shadow_ambient"); } + if (extensions.Contains("gl_ARB_sparse_buffer")) { ARB_sparse_buffer = true; extensions.Remove("glARB_sparse_buffer"); } + if (extensions.Contains("gl_ARB_sparse_texture")) { ARB_sparse_texture = true; extensions.Remove("glARB_sparse_texture"); } + if (extensions.Contains("gl_ARB_sparse_texture2")) { ARB_sparse_texture2 = true; extensions.Remove("glARB_sparse_texture2"); } + if (extensions.Contains("gl_ARB_sparse_texture_clamp")) { ARB_sparse_texture_clamp = true; extensions.Remove("glARB_sparse_texture_clamp"); } + if (extensions.Contains("gl_ARB_spirv_extensions")) { ARB_spirv_extensions = true; extensions.Remove("glARB_spirv_extensions"); } + if (extensions.Contains("gl_ARB_stencil_texturing")) { ARB_stencil_texturing = true; extensions.Remove("glARB_stencil_texturing"); } + if (extensions.Contains("gl_ARB_sync")) { ARB_sync = true; extensions.Remove("glARB_sync"); } + if (extensions.Contains("gl_ARB_tessellation_shader")) { ARB_tessellation_shader = true; extensions.Remove("glARB_tessellation_shader"); } + if (extensions.Contains("gl_ARB_texture_barrier")) { ARB_texture_barrier = true; extensions.Remove("glARB_texture_barrier"); } + if (extensions.Contains("gl_ARB_texture_border_clamp")) { ARB_texture_border_clamp = true; extensions.Remove("glARB_texture_border_clamp"); } + if (extensions.Contains("gl_ARB_texture_buffer_object")) { ARB_texture_buffer_object = true; extensions.Remove("glARB_texture_buffer_object"); } + if (extensions.Contains("gl_ARB_texture_buffer_object_rgb32")) { ARB_texture_buffer_object_rgb32 = true; extensions.Remove("glARB_texture_buffer_object_rgb32"); } + if (extensions.Contains("gl_ARB_texture_buffer_range")) { ARB_texture_buffer_range = true; extensions.Remove("glARB_texture_buffer_range"); } + if (extensions.Contains("gl_ARB_texture_compression")) { ARB_texture_compression = true; extensions.Remove("glARB_texture_compression"); } + if (extensions.Contains("gl_ARB_texture_compression_bptc")) { ARB_texture_compression_bptc = true; extensions.Remove("glARB_texture_compression_bptc"); } + if (extensions.Contains("gl_ARB_texture_compression_rgtc")) { ARB_texture_compression_rgtc = true; extensions.Remove("glARB_texture_compression_rgtc"); } + if (extensions.Contains("gl_ARB_texture_cube_map")) { ARB_texture_cube_map = true; extensions.Remove("glARB_texture_cube_map"); } + if (extensions.Contains("gl_ARB_texture_cube_map_array")) { ARB_texture_cube_map_array = true; extensions.Remove("glARB_texture_cube_map_array"); } + if (extensions.Contains("gl_ARB_texture_env_add")) { ARB_texture_env_add = true; extensions.Remove("glARB_texture_env_add"); } + if (extensions.Contains("gl_ARB_texture_env_combine")) { ARB_texture_env_combine = true; extensions.Remove("glARB_texture_env_combine"); } + if (extensions.Contains("gl_ARB_texture_env_crossbar")) { ARB_texture_env_crossbar = true; extensions.Remove("glARB_texture_env_crossbar"); } + if (extensions.Contains("gl_ARB_texture_env_dot3")) { ARB_texture_env_dot3 = true; extensions.Remove("glARB_texture_env_dot3"); } + if (extensions.Contains("gl_ARB_texture_filter_anisotropic")) { ARB_texture_filter_anisotropic = true; extensions.Remove("glARB_texture_filter_anisotropic"); } + if (extensions.Contains("gl_ARB_texture_filter_minmax")) { ARB_texture_filter_minmax = true; extensions.Remove("glARB_texture_filter_minmax"); } + if (extensions.Contains("gl_ARB_texture_float")) { ARB_texture_float = true; extensions.Remove("glARB_texture_float"); } + if (extensions.Contains("gl_ARB_texture_gather")) { ARB_texture_gather = true; extensions.Remove("glARB_texture_gather"); } + if (extensions.Contains("gl_ARB_texture_mirror_clamp_to_edge")) { ARB_texture_mirror_clamp_to_edge = true; extensions.Remove("glARB_texture_mirror_clamp_to_edge"); } + if (extensions.Contains("gl_ARB_texture_mirrored_repeat")) { ARB_texture_mirrored_repeat = true; extensions.Remove("glARB_texture_mirrored_repeat"); } + if (extensions.Contains("gl_ARB_texture_multisample")) { ARB_texture_multisample = true; extensions.Remove("glARB_texture_multisample"); } + if (extensions.Contains("gl_ARB_texture_non_power_of_two")) { ARB_texture_non_power_of_two = true; extensions.Remove("glARB_texture_non_power_of_two"); } + if (extensions.Contains("gl_ARB_texture_query_levels")) { ARB_texture_query_levels = true; extensions.Remove("glARB_texture_query_levels"); } + if (extensions.Contains("gl_ARB_texture_query_lod")) { ARB_texture_query_lod = true; extensions.Remove("glARB_texture_query_lod"); } + if (extensions.Contains("gl_ARB_texture_rectangle")) { ARB_texture_rectangle = true; extensions.Remove("glARB_texture_rectangle"); } + if (extensions.Contains("gl_ARB_texture_rg")) { ARB_texture_rg = true; extensions.Remove("glARB_texture_rg"); } + if (extensions.Contains("gl_ARB_texture_rgb10_a2ui")) { ARB_texture_rgb10_a2ui = true; extensions.Remove("glARB_texture_rgb10_a2ui"); } + if (extensions.Contains("gl_ARB_texture_stencil8")) { ARB_texture_stencil8 = true; extensions.Remove("glARB_texture_stencil8"); } + if (extensions.Contains("gl_ARB_texture_storage")) { ARB_texture_storage = true; extensions.Remove("glARB_texture_storage"); } + if (extensions.Contains("gl_ARB_texture_storage_multisample")) { ARB_texture_storage_multisample = true; extensions.Remove("glARB_texture_storage_multisample"); } + if (extensions.Contains("gl_ARB_texture_swizzle")) { ARB_texture_swizzle = true; extensions.Remove("glARB_texture_swizzle"); } + if (extensions.Contains("gl_ARB_texture_view")) { ARB_texture_view = true; extensions.Remove("glARB_texture_view"); } + if (extensions.Contains("gl_ARB_timer_query")) { ARB_timer_query = true; extensions.Remove("glARB_timer_query"); } + if (extensions.Contains("gl_ARB_transform_feedback2")) { ARB_transform_feedback2 = true; extensions.Remove("glARB_transform_feedback2"); } + if (extensions.Contains("gl_ARB_transform_feedback3")) { ARB_transform_feedback3 = true; extensions.Remove("glARB_transform_feedback3"); } + if (extensions.Contains("gl_ARB_transform_feedback_instanced")) { ARB_transform_feedback_instanced = true; extensions.Remove("glARB_transform_feedback_instanced"); } + if (extensions.Contains("gl_ARB_transform_feedback_overflow_query")) { ARB_transform_feedback_overflow_query = true; extensions.Remove("glARB_transform_feedback_overflow_query"); } + if (extensions.Contains("gl_ARB_transpose_matrix")) { ARB_transpose_matrix = true; extensions.Remove("glARB_transpose_matrix"); } + if (extensions.Contains("gl_ARB_uniform_buffer_object")) { ARB_uniform_buffer_object = true; extensions.Remove("glARB_uniform_buffer_object"); } + if (extensions.Contains("gl_ARB_vertex_array_bgra")) { ARB_vertex_array_bgra = true; extensions.Remove("glARB_vertex_array_bgra"); } + if (extensions.Contains("gl_ARB_vertex_array_object")) { ARB_vertex_array_object = true; extensions.Remove("glARB_vertex_array_object"); } + if (extensions.Contains("gl_ARB_vertex_attrib_64bit")) { ARB_vertex_attrib_64bit = true; extensions.Remove("glARB_vertex_attrib_64bit"); } + if (extensions.Contains("gl_ARB_vertex_attrib_binding")) { ARB_vertex_attrib_binding = true; extensions.Remove("glARB_vertex_attrib_binding"); } + if (extensions.Contains("gl_ARB_vertex_blend")) { ARB_vertex_blend = true; extensions.Remove("glARB_vertex_blend"); } + if (extensions.Contains("gl_ARB_vertex_buffer_object")) { ARB_vertex_buffer_object = true; extensions.Remove("glARB_vertex_buffer_object"); } + if (extensions.Contains("gl_ARB_vertex_program")) { ARB_vertex_program = true; extensions.Remove("glARB_vertex_program"); } + if (extensions.Contains("gl_ARB_vertex_shader")) { ARB_vertex_shader = true; extensions.Remove("glARB_vertex_shader"); } + if (extensions.Contains("gl_ARB_vertex_type_10f_11f_11f_rev")) { ARB_vertex_type_10f_11f_11f_rev = true; extensions.Remove("glARB_vertex_type_10f_11f_11f_rev"); } + if (extensions.Contains("gl_ARB_vertex_type_2_10_10_10_rev")) { ARB_vertex_type_2_10_10_10_rev = true; extensions.Remove("glARB_vertex_type_2_10_10_10_rev"); } + if (extensions.Contains("gl_ARB_viewport_array")) { ARB_viewport_array = true; extensions.Remove("glARB_viewport_array"); } + if (extensions.Contains("gl_ARB_window_pos")) { ARB_window_pos = true; extensions.Remove("glARB_window_pos"); } + if (extensions.Contains("gl_ATI_draw_buffers")) { ATI_draw_buffers = true; extensions.Remove("glATI_draw_buffers"); } + if (extensions.Contains("gl_ATI_element_array")) { ATI_element_array = true; extensions.Remove("glATI_element_array"); } + if (extensions.Contains("gl_ATI_envmap_bumpmap")) { ATI_envmap_bumpmap = true; extensions.Remove("glATI_envmap_bumpmap"); } + if (extensions.Contains("gl_ATI_fragment_shader")) { ATI_fragment_shader = true; extensions.Remove("glATI_fragment_shader"); } + if (extensions.Contains("gl_ATI_map_object_buffer")) { ATI_map_object_buffer = true; extensions.Remove("glATI_map_object_buffer"); } + if (extensions.Contains("gl_ATI_meminfo")) { ATI_meminfo = true; extensions.Remove("glATI_meminfo"); } + if (extensions.Contains("gl_ATI_pixel_format_float")) { ATI_pixel_format_float = true; extensions.Remove("glATI_pixel_format_float"); } + if (extensions.Contains("gl_ATI_pn_triangles")) { ATI_pn_triangles = true; extensions.Remove("glATI_pn_triangles"); } + if (extensions.Contains("gl_ATI_separate_stencil")) { ATI_separate_stencil = true; extensions.Remove("glATI_separate_stencil"); } + if (extensions.Contains("gl_ATI_text_fragment_shader")) { ATI_text_fragment_shader = true; extensions.Remove("glATI_text_fragment_shader"); } + if (extensions.Contains("gl_ATI_texture_env_combine3")) { ATI_texture_env_combine3 = true; extensions.Remove("glATI_texture_env_combine3"); } + if (extensions.Contains("gl_ATI_texture_float")) { ATI_texture_float = true; extensions.Remove("glATI_texture_float"); } + if (extensions.Contains("gl_ATI_texture_mirror_once")) { ATI_texture_mirror_once = true; extensions.Remove("glATI_texture_mirror_once"); } + if (extensions.Contains("gl_ATI_vertex_array_object")) { ATI_vertex_array_object = true; extensions.Remove("glATI_vertex_array_object"); } + if (extensions.Contains("gl_ATI_vertex_attrib_array_object")) { ATI_vertex_attrib_array_object = true; extensions.Remove("glATI_vertex_attrib_array_object"); } + if (extensions.Contains("gl_ATI_vertex_streams")) { ATI_vertex_streams = true; extensions.Remove("glATI_vertex_streams"); } + if (extensions.Contains("gl_EXT_422_pixels")) { EXT_422_pixels = true; extensions.Remove("glEXT_422_pixels"); } + if (extensions.Contains("gl_EXT_EGL_image_storage")) { EXT_EGL_image_storage = true; extensions.Remove("glEXT_EGL_image_storage"); } + if (extensions.Contains("gl_EXT_EGL_sync")) { EXT_EGL_sync = true; extensions.Remove("glEXT_EGL_sync"); } + if (extensions.Contains("gl_EXT_abgr")) { EXT_abgr = true; extensions.Remove("glEXT_abgr"); } + if (extensions.Contains("gl_EXT_bgra")) { EXT_bgra = true; extensions.Remove("glEXT_bgra"); } + if (extensions.Contains("gl_EXT_bindable_uniform")) { EXT_bindable_uniform = true; extensions.Remove("glEXT_bindable_uniform"); } + if (extensions.Contains("gl_EXT_blend_color")) { EXT_blend_color = true; extensions.Remove("glEXT_blend_color"); } + if (extensions.Contains("gl_EXT_blend_equation_separate")) { EXT_blend_equation_separate = true; extensions.Remove("glEXT_blend_equation_separate"); } + if (extensions.Contains("gl_EXT_blend_func_separate")) { EXT_blend_func_separate = true; extensions.Remove("glEXT_blend_func_separate"); } + if (extensions.Contains("gl_EXT_blend_logic_op")) { EXT_blend_logic_op = true; extensions.Remove("glEXT_blend_logic_op"); } + if (extensions.Contains("gl_EXT_blend_minmax")) { EXT_blend_minmax = true; extensions.Remove("glEXT_blend_minmax"); } + if (extensions.Contains("gl_EXT_blend_subtract")) { EXT_blend_subtract = true; extensions.Remove("glEXT_blend_subtract"); } + if (extensions.Contains("gl_EXT_clip_volume_hint")) { EXT_clip_volume_hint = true; extensions.Remove("glEXT_clip_volume_hint"); } + if (extensions.Contains("gl_EXT_cmyka")) { EXT_cmyka = true; extensions.Remove("glEXT_cmyka"); } + if (extensions.Contains("gl_EXT_color_subtable")) { EXT_color_subtable = true; extensions.Remove("glEXT_color_subtable"); } + if (extensions.Contains("gl_EXT_compiled_vertex_array")) { EXT_compiled_vertex_array = true; extensions.Remove("glEXT_compiled_vertex_array"); } + if (extensions.Contains("gl_EXT_convolution")) { EXT_convolution = true; extensions.Remove("glEXT_convolution"); } + if (extensions.Contains("gl_EXT_coordinate_frame")) { EXT_coordinate_frame = true; extensions.Remove("glEXT_coordinate_frame"); } + if (extensions.Contains("gl_EXT_copy_texture")) { EXT_copy_texture = true; extensions.Remove("glEXT_copy_texture"); } + if (extensions.Contains("gl_EXT_cull_vertex")) { EXT_cull_vertex = true; extensions.Remove("glEXT_cull_vertex"); } + if (extensions.Contains("gl_EXT_debug_label")) { EXT_debug_label = true; extensions.Remove("glEXT_debug_label"); } + if (extensions.Contains("gl_EXT_debug_marker")) { EXT_debug_marker = true; extensions.Remove("glEXT_debug_marker"); } + if (extensions.Contains("gl_EXT_depth_bounds_test")) { EXT_depth_bounds_test = true; extensions.Remove("glEXT_depth_bounds_test"); } + if (extensions.Contains("gl_EXT_direct_state_access")) { EXT_direct_state_access = true; extensions.Remove("glEXT_direct_state_access"); } + if (extensions.Contains("gl_EXT_draw_buffers2")) { EXT_draw_buffers2 = true; extensions.Remove("glEXT_draw_buffers2"); } + if (extensions.Contains("gl_EXT_draw_instanced")) { EXT_draw_instanced = true; extensions.Remove("glEXT_draw_instanced"); } + if (extensions.Contains("gl_EXT_draw_range_elements")) { EXT_draw_range_elements = true; extensions.Remove("glEXT_draw_range_elements"); } + if (extensions.Contains("gl_EXT_external_buffer")) { EXT_external_buffer = true; extensions.Remove("glEXT_external_buffer"); } + if (extensions.Contains("gl_EXT_fog_coord")) { EXT_fog_coord = true; extensions.Remove("glEXT_fog_coord"); } + if (extensions.Contains("gl_EXT_framebuffer_blit")) { EXT_framebuffer_blit = true; extensions.Remove("glEXT_framebuffer_blit"); } + if (extensions.Contains("gl_EXT_framebuffer_blit_layers")) { EXT_framebuffer_blit_layers = true; extensions.Remove("glEXT_framebuffer_blit_layers"); } + if (extensions.Contains("gl_EXT_framebuffer_multisample")) { EXT_framebuffer_multisample = true; extensions.Remove("glEXT_framebuffer_multisample"); } + if (extensions.Contains("gl_EXT_framebuffer_multisample_blit_scaled")) { EXT_framebuffer_multisample_blit_scaled = true; extensions.Remove("glEXT_framebuffer_multisample_blit_scaled"); } + if (extensions.Contains("gl_EXT_framebuffer_object")) { EXT_framebuffer_object = true; extensions.Remove("glEXT_framebuffer_object"); } + if (extensions.Contains("gl_EXT_framebuffer_sRGB")) { EXT_framebuffer_sRGB = true; extensions.Remove("glEXT_framebuffer_sRGB"); } + if (extensions.Contains("gl_EXT_geometry_shader4")) { EXT_geometry_shader4 = true; extensions.Remove("glEXT_geometry_shader4"); } + if (extensions.Contains("gl_EXT_gpu_program_parameters")) { EXT_gpu_program_parameters = true; extensions.Remove("glEXT_gpu_program_parameters"); } + if (extensions.Contains("gl_EXT_gpu_shader4")) { EXT_gpu_shader4 = true; extensions.Remove("glEXT_gpu_shader4"); } + if (extensions.Contains("gl_EXT_histogram")) { EXT_histogram = true; extensions.Remove("glEXT_histogram"); } + if (extensions.Contains("gl_EXT_index_array_formats")) { EXT_index_array_formats = true; extensions.Remove("glEXT_index_array_formats"); } + if (extensions.Contains("gl_EXT_index_func")) { EXT_index_func = true; extensions.Remove("glEXT_index_func"); } + if (extensions.Contains("gl_EXT_index_material")) { EXT_index_material = true; extensions.Remove("glEXT_index_material"); } + if (extensions.Contains("gl_EXT_index_texture")) { EXT_index_texture = true; extensions.Remove("glEXT_index_texture"); } + if (extensions.Contains("gl_EXT_light_texture")) { EXT_light_texture = true; extensions.Remove("glEXT_light_texture"); } + if (extensions.Contains("gl_EXT_memory_object")) { EXT_memory_object = true; extensions.Remove("glEXT_memory_object"); } + if (extensions.Contains("gl_EXT_memory_object_fd")) { EXT_memory_object_fd = true; extensions.Remove("glEXT_memory_object_fd"); } + if (extensions.Contains("gl_EXT_memory_object_win32")) { EXT_memory_object_win32 = true; extensions.Remove("glEXT_memory_object_win32"); } + if (extensions.Contains("gl_EXT_misc_attribute")) { EXT_misc_attribute = true; extensions.Remove("glEXT_misc_attribute"); } + if (extensions.Contains("gl_EXT_multi_draw_arrays")) { EXT_multi_draw_arrays = true; extensions.Remove("glEXT_multi_draw_arrays"); } + if (extensions.Contains("gl_EXT_multisample")) { EXT_multisample = true; extensions.Remove("glEXT_multisample"); } + if (extensions.Contains("gl_EXT_multiview_tessellation_geometry_shader")) { EXT_multiview_tessellation_geometry_shader = true; extensions.Remove("glEXT_multiview_tessellation_geometry_shader"); } + if (extensions.Contains("gl_EXT_multiview_texture_multisample")) { EXT_multiview_texture_multisample = true; extensions.Remove("glEXT_multiview_texture_multisample"); } + if (extensions.Contains("gl_EXT_multiview_timer_query")) { EXT_multiview_timer_query = true; extensions.Remove("glEXT_multiview_timer_query"); } + if (extensions.Contains("gl_EXT_packed_depth_stencil")) { EXT_packed_depth_stencil = true; extensions.Remove("glEXT_packed_depth_stencil"); } + if (extensions.Contains("gl_EXT_packed_float")) { EXT_packed_float = true; extensions.Remove("glEXT_packed_float"); } + if (extensions.Contains("gl_EXT_packed_pixels")) { EXT_packed_pixels = true; extensions.Remove("glEXT_packed_pixels"); } + if (extensions.Contains("gl_EXT_paletted_texture")) { EXT_paletted_texture = true; extensions.Remove("glEXT_paletted_texture"); } + if (extensions.Contains("gl_EXT_pixel_buffer_object")) { EXT_pixel_buffer_object = true; extensions.Remove("glEXT_pixel_buffer_object"); } + if (extensions.Contains("gl_EXT_pixel_transform")) { EXT_pixel_transform = true; extensions.Remove("glEXT_pixel_transform"); } + if (extensions.Contains("gl_EXT_pixel_transform_color_table")) { EXT_pixel_transform_color_table = true; extensions.Remove("glEXT_pixel_transform_color_table"); } + if (extensions.Contains("gl_EXT_point_parameters")) { EXT_point_parameters = true; extensions.Remove("glEXT_point_parameters"); } + if (extensions.Contains("gl_EXT_polygon_offset")) { EXT_polygon_offset = true; extensions.Remove("glEXT_polygon_offset"); } + if (extensions.Contains("gl_EXT_polygon_offset_clamp")) { EXT_polygon_offset_clamp = true; extensions.Remove("glEXT_polygon_offset_clamp"); } + if (extensions.Contains("gl_EXT_post_depth_coverage")) { EXT_post_depth_coverage = true; extensions.Remove("glEXT_post_depth_coverage"); } + if (extensions.Contains("gl_EXT_provoking_vertex")) { EXT_provoking_vertex = true; extensions.Remove("glEXT_provoking_vertex"); } + if (extensions.Contains("gl_EXT_raster_multisample")) { EXT_raster_multisample = true; extensions.Remove("glEXT_raster_multisample"); } + if (extensions.Contains("gl_EXT_rescale_normal")) { EXT_rescale_normal = true; extensions.Remove("glEXT_rescale_normal"); } + if (extensions.Contains("gl_EXT_secondary_color")) { EXT_secondary_color = true; extensions.Remove("glEXT_secondary_color"); } + if (extensions.Contains("gl_EXT_semaphore")) { EXT_semaphore = true; extensions.Remove("glEXT_semaphore"); } + if (extensions.Contains("gl_EXT_semaphore_fd")) { EXT_semaphore_fd = true; extensions.Remove("glEXT_semaphore_fd"); } + if (extensions.Contains("gl_EXT_semaphore_win32")) { EXT_semaphore_win32 = true; extensions.Remove("glEXT_semaphore_win32"); } + if (extensions.Contains("gl_EXT_separate_shader_objects")) { EXT_separate_shader_objects = true; extensions.Remove("glEXT_separate_shader_objects"); } + if (extensions.Contains("gl_EXT_separate_specular_color")) { EXT_separate_specular_color = true; extensions.Remove("glEXT_separate_specular_color"); } + if (extensions.Contains("gl_EXT_shader_framebuffer_fetch")) { EXT_shader_framebuffer_fetch = true; extensions.Remove("glEXT_shader_framebuffer_fetch"); } + if (extensions.Contains("gl_EXT_shader_framebuffer_fetch_non_coherent")) { EXT_shader_framebuffer_fetch_non_coherent = true; extensions.Remove("glEXT_shader_framebuffer_fetch_non_coherent"); } + if (extensions.Contains("gl_EXT_shader_image_load_formatted")) { EXT_shader_image_load_formatted = true; extensions.Remove("glEXT_shader_image_load_formatted"); } + if (extensions.Contains("gl_EXT_shader_image_load_store")) { EXT_shader_image_load_store = true; extensions.Remove("glEXT_shader_image_load_store"); } + if (extensions.Contains("gl_EXT_shader_integer_mix")) { EXT_shader_integer_mix = true; extensions.Remove("glEXT_shader_integer_mix"); } + if (extensions.Contains("gl_EXT_shader_samples_identical")) { EXT_shader_samples_identical = true; extensions.Remove("glEXT_shader_samples_identical"); } + if (extensions.Contains("gl_EXT_shadow_funcs")) { EXT_shadow_funcs = true; extensions.Remove("glEXT_shadow_funcs"); } + if (extensions.Contains("gl_EXT_shared_texture_palette")) { EXT_shared_texture_palette = true; extensions.Remove("glEXT_shared_texture_palette"); } + if (extensions.Contains("gl_EXT_sparse_texture2")) { EXT_sparse_texture2 = true; extensions.Remove("glEXT_sparse_texture2"); } + if (extensions.Contains("gl_EXT_stencil_clear_tag")) { EXT_stencil_clear_tag = true; extensions.Remove("glEXT_stencil_clear_tag"); } + if (extensions.Contains("gl_EXT_stencil_two_side")) { EXT_stencil_two_side = true; extensions.Remove("glEXT_stencil_two_side"); } + if (extensions.Contains("gl_EXT_stencil_wrap")) { EXT_stencil_wrap = true; extensions.Remove("glEXT_stencil_wrap"); } + if (extensions.Contains("gl_EXT_subtexture")) { EXT_subtexture = true; extensions.Remove("glEXT_subtexture"); } + if (extensions.Contains("gl_EXT_texture")) { EXT_texture = true; extensions.Remove("glEXT_texture"); } + if (extensions.Contains("gl_EXT_texture3D")) { EXT_texture3D = true; extensions.Remove("glEXT_texture3D"); } + if (extensions.Contains("gl_EXT_texture_array")) { EXT_texture_array = true; extensions.Remove("glEXT_texture_array"); } + if (extensions.Contains("gl_EXT_texture_buffer_object")) { EXT_texture_buffer_object = true; extensions.Remove("glEXT_texture_buffer_object"); } + if (extensions.Contains("gl_EXT_texture_compression_latc")) { EXT_texture_compression_latc = true; extensions.Remove("glEXT_texture_compression_latc"); } + if (extensions.Contains("gl_EXT_texture_compression_rgtc")) { EXT_texture_compression_rgtc = true; extensions.Remove("glEXT_texture_compression_rgtc"); } + if (extensions.Contains("gl_EXT_texture_compression_s3tc")) { EXT_texture_compression_s3tc = true; extensions.Remove("glEXT_texture_compression_s3tc"); } + if (extensions.Contains("gl_EXT_texture_cube_map")) { EXT_texture_cube_map = true; extensions.Remove("glEXT_texture_cube_map"); } + if (extensions.Contains("gl_EXT_texture_env_add")) { EXT_texture_env_add = true; extensions.Remove("glEXT_texture_env_add"); } + if (extensions.Contains("gl_EXT_texture_env_combine")) { EXT_texture_env_combine = true; extensions.Remove("glEXT_texture_env_combine"); } + if (extensions.Contains("gl_EXT_texture_env_dot3")) { EXT_texture_env_dot3 = true; extensions.Remove("glEXT_texture_env_dot3"); } + if (extensions.Contains("gl_EXT_texture_filter_anisotropic")) { EXT_texture_filter_anisotropic = true; extensions.Remove("glEXT_texture_filter_anisotropic"); } + if (extensions.Contains("gl_EXT_texture_filter_minmax")) { EXT_texture_filter_minmax = true; extensions.Remove("glEXT_texture_filter_minmax"); } + if (extensions.Contains("gl_EXT_texture_integer")) { EXT_texture_integer = true; extensions.Remove("glEXT_texture_integer"); } + if (extensions.Contains("gl_EXT_texture_lod_bias")) { EXT_texture_lod_bias = true; extensions.Remove("glEXT_texture_lod_bias"); } + if (extensions.Contains("gl_EXT_texture_mirror_clamp")) { EXT_texture_mirror_clamp = true; extensions.Remove("glEXT_texture_mirror_clamp"); } + if (extensions.Contains("gl_EXT_texture_object")) { EXT_texture_object = true; extensions.Remove("glEXT_texture_object"); } + if (extensions.Contains("gl_EXT_texture_perturb_normal")) { EXT_texture_perturb_normal = true; extensions.Remove("glEXT_texture_perturb_normal"); } + if (extensions.Contains("gl_EXT_texture_sRGB")) { EXT_texture_sRGB = true; extensions.Remove("glEXT_texture_sRGB"); } + if (extensions.Contains("gl_EXT_texture_sRGB_R8")) { EXT_texture_sRGB_R8 = true; extensions.Remove("glEXT_texture_sRGB_R8"); } + if (extensions.Contains("gl_EXT_texture_sRGB_RG8")) { EXT_texture_sRGB_RG8 = true; extensions.Remove("glEXT_texture_sRGB_RG8"); } + if (extensions.Contains("gl_EXT_texture_sRGB_decode")) { EXT_texture_sRGB_decode = true; extensions.Remove("glEXT_texture_sRGB_decode"); } + if (extensions.Contains("gl_EXT_texture_shadow_lod")) { EXT_texture_shadow_lod = true; extensions.Remove("glEXT_texture_shadow_lod"); } + if (extensions.Contains("gl_EXT_texture_shared_exponent")) { EXT_texture_shared_exponent = true; extensions.Remove("glEXT_texture_shared_exponent"); } + if (extensions.Contains("gl_EXT_texture_snorm")) { EXT_texture_snorm = true; extensions.Remove("glEXT_texture_snorm"); } + if (extensions.Contains("gl_EXT_texture_storage")) { EXT_texture_storage = true; extensions.Remove("glEXT_texture_storage"); } + if (extensions.Contains("gl_EXT_texture_swizzle")) { EXT_texture_swizzle = true; extensions.Remove("glEXT_texture_swizzle"); } + if (extensions.Contains("gl_EXT_timer_query")) { EXT_timer_query = true; extensions.Remove("glEXT_timer_query"); } + if (extensions.Contains("gl_EXT_transform_feedback")) { EXT_transform_feedback = true; extensions.Remove("glEXT_transform_feedback"); } + if (extensions.Contains("gl_EXT_vertex_array")) { EXT_vertex_array = true; extensions.Remove("glEXT_vertex_array"); } + if (extensions.Contains("gl_EXT_vertex_array_bgra")) { EXT_vertex_array_bgra = true; extensions.Remove("glEXT_vertex_array_bgra"); } + if (extensions.Contains("gl_EXT_vertex_attrib_64bit")) { EXT_vertex_attrib_64bit = true; extensions.Remove("glEXT_vertex_attrib_64bit"); } + if (extensions.Contains("gl_EXT_vertex_shader")) { EXT_vertex_shader = true; extensions.Remove("glEXT_vertex_shader"); } + if (extensions.Contains("gl_EXT_vertex_weighting")) { EXT_vertex_weighting = true; extensions.Remove("glEXT_vertex_weighting"); } + if (extensions.Contains("gl_EXT_win32_keyed_mutex")) { EXT_win32_keyed_mutex = true; extensions.Remove("glEXT_win32_keyed_mutex"); } + if (extensions.Contains("gl_EXT_window_rectangles")) { EXT_window_rectangles = true; extensions.Remove("glEXT_window_rectangles"); } + if (extensions.Contains("gl_EXT_x11_sync_object")) { EXT_x11_sync_object = true; extensions.Remove("glEXT_x11_sync_object"); } + if (extensions.Contains("gl_GREMEDY_frame_terminator")) { GREMEDY_frame_terminator = true; extensions.Remove("glGREMEDY_frame_terminator"); } + if (extensions.Contains("gl_GREMEDY_string_marker")) { GREMEDY_string_marker = true; extensions.Remove("glGREMEDY_string_marker"); } + if (extensions.Contains("gl_HP_convolution_border_modes")) { HP_convolution_border_modes = true; extensions.Remove("glHP_convolution_border_modes"); } + if (extensions.Contains("gl_HP_image_transform")) { HP_image_transform = true; extensions.Remove("glHP_image_transform"); } + if (extensions.Contains("gl_HP_occlusion_test")) { HP_occlusion_test = true; extensions.Remove("glHP_occlusion_test"); } + if (extensions.Contains("gl_HP_texture_lighting")) { HP_texture_lighting = true; extensions.Remove("glHP_texture_lighting"); } + if (extensions.Contains("gl_IBM_cull_vertex")) { IBM_cull_vertex = true; extensions.Remove("glIBM_cull_vertex"); } + if (extensions.Contains("gl_IBM_multimode_draw_arrays")) { IBM_multimode_draw_arrays = true; extensions.Remove("glIBM_multimode_draw_arrays"); } + if (extensions.Contains("gl_IBM_rasterpos_clip")) { IBM_rasterpos_clip = true; extensions.Remove("glIBM_rasterpos_clip"); } + if (extensions.Contains("gl_IBM_static_data")) { IBM_static_data = true; extensions.Remove("glIBM_static_data"); } + if (extensions.Contains("gl_IBM_texture_mirrored_repeat")) { IBM_texture_mirrored_repeat = true; extensions.Remove("glIBM_texture_mirrored_repeat"); } + if (extensions.Contains("gl_IBM_vertex_array_lists")) { IBM_vertex_array_lists = true; extensions.Remove("glIBM_vertex_array_lists"); } + if (extensions.Contains("gl_INGR_blend_func_separate")) { INGR_blend_func_separate = true; extensions.Remove("glINGR_blend_func_separate"); } + if (extensions.Contains("gl_INGR_color_clamp")) { INGR_color_clamp = true; extensions.Remove("glINGR_color_clamp"); } + if (extensions.Contains("gl_INGR_interlace_read")) { INGR_interlace_read = true; extensions.Remove("glINGR_interlace_read"); } + if (extensions.Contains("gl_INTEL_blackhole_render")) { INTEL_blackhole_render = true; extensions.Remove("glINTEL_blackhole_render"); } + if (extensions.Contains("gl_INTEL_conservative_rasterization")) { INTEL_conservative_rasterization = true; extensions.Remove("glINTEL_conservative_rasterization"); } + if (extensions.Contains("gl_INTEL_fragment_shader_ordering")) { INTEL_fragment_shader_ordering = true; extensions.Remove("glINTEL_fragment_shader_ordering"); } + if (extensions.Contains("gl_INTEL_framebuffer_CMAA")) { INTEL_framebuffer_CMAA = true; extensions.Remove("glINTEL_framebuffer_CMAA"); } + if (extensions.Contains("gl_INTEL_map_texture")) { INTEL_map_texture = true; extensions.Remove("glINTEL_map_texture"); } + if (extensions.Contains("gl_INTEL_parallel_arrays")) { INTEL_parallel_arrays = true; extensions.Remove("glINTEL_parallel_arrays"); } + if (extensions.Contains("gl_INTEL_performance_query")) { INTEL_performance_query = true; extensions.Remove("glINTEL_performance_query"); } + if (extensions.Contains("gl_KHR_blend_equation_advanced")) { KHR_blend_equation_advanced = true; extensions.Remove("glKHR_blend_equation_advanced"); } + if (extensions.Contains("gl_KHR_blend_equation_advanced_coherent")) { KHR_blend_equation_advanced_coherent = true; extensions.Remove("glKHR_blend_equation_advanced_coherent"); } + if (extensions.Contains("gl_KHR_context_flush_control")) { KHR_context_flush_control = true; extensions.Remove("glKHR_context_flush_control"); } + if (extensions.Contains("gl_KHR_debug")) { KHR_debug = true; extensions.Remove("glKHR_debug"); } + if (extensions.Contains("gl_KHR_no_error")) { KHR_no_error = true; extensions.Remove("glKHR_no_error"); } + if (extensions.Contains("gl_KHR_parallel_shader_compile")) { KHR_parallel_shader_compile = true; extensions.Remove("glKHR_parallel_shader_compile"); } + if (extensions.Contains("gl_KHR_robust_buffer_access_behavior")) { KHR_robust_buffer_access_behavior = true; extensions.Remove("glKHR_robust_buffer_access_behavior"); } + if (extensions.Contains("gl_KHR_robustness")) { KHR_robustness = true; extensions.Remove("glKHR_robustness"); } + if (extensions.Contains("gl_KHR_shader_subgroup")) { KHR_shader_subgroup = true; extensions.Remove("glKHR_shader_subgroup"); } + if (extensions.Contains("gl_KHR_texture_compression_astc_hdr")) { KHR_texture_compression_astc_hdr = true; extensions.Remove("glKHR_texture_compression_astc_hdr"); } + if (extensions.Contains("gl_KHR_texture_compression_astc_ldr")) { KHR_texture_compression_astc_ldr = true; extensions.Remove("glKHR_texture_compression_astc_ldr"); } + if (extensions.Contains("gl_KHR_texture_compression_astc_sliced_3d")) { KHR_texture_compression_astc_sliced_3d = true; extensions.Remove("glKHR_texture_compression_astc_sliced_3d"); } + if (extensions.Contains("gl_MESAX_texture_stack")) { MESAX_texture_stack = true; extensions.Remove("glMESAX_texture_stack"); } + if (extensions.Contains("gl_MESA_framebuffer_flip_x")) { MESA_framebuffer_flip_x = true; extensions.Remove("glMESA_framebuffer_flip_x"); } + if (extensions.Contains("gl_MESA_framebuffer_flip_y")) { MESA_framebuffer_flip_y = true; extensions.Remove("glMESA_framebuffer_flip_y"); } + if (extensions.Contains("gl_MESA_framebuffer_swap_xy")) { MESA_framebuffer_swap_xy = true; extensions.Remove("glMESA_framebuffer_swap_xy"); } + if (extensions.Contains("gl_MESA_pack_invert")) { MESA_pack_invert = true; extensions.Remove("glMESA_pack_invert"); } + if (extensions.Contains("gl_MESA_program_binary_formats")) { MESA_program_binary_formats = true; extensions.Remove("glMESA_program_binary_formats"); } + if (extensions.Contains("gl_MESA_resize_buffers")) { MESA_resize_buffers = true; extensions.Remove("glMESA_resize_buffers"); } + if (extensions.Contains("gl_MESA_shader_integer_functions")) { MESA_shader_integer_functions = true; extensions.Remove("glMESA_shader_integer_functions"); } + if (extensions.Contains("gl_MESA_tile_raster_order")) { MESA_tile_raster_order = true; extensions.Remove("glMESA_tile_raster_order"); } + if (extensions.Contains("gl_MESA_window_pos")) { MESA_window_pos = true; extensions.Remove("glMESA_window_pos"); } + if (extensions.Contains("gl_MESA_ycbcr_texture")) { MESA_ycbcr_texture = true; extensions.Remove("glMESA_ycbcr_texture"); } + if (extensions.Contains("gl_NVX_blend_equation_advanced_multi_draw_buffers")) { NVX_blend_equation_advanced_multi_draw_buffers = true; extensions.Remove("glNVX_blend_equation_advanced_multi_draw_buffers"); } + if (extensions.Contains("gl_NVX_conditional_render")) { NVX_conditional_render = true; extensions.Remove("glNVX_conditional_render"); } + if (extensions.Contains("gl_NVX_gpu_memory_info")) { NVX_gpu_memory_info = true; extensions.Remove("glNVX_gpu_memory_info"); } + if (extensions.Contains("gl_NVX_gpu_multicast2")) { NVX_gpu_multicast2 = true; extensions.Remove("glNVX_gpu_multicast2"); } + if (extensions.Contains("gl_NVX_linked_gpu_multicast")) { NVX_linked_gpu_multicast = true; extensions.Remove("glNVX_linked_gpu_multicast"); } + if (extensions.Contains("gl_NVX_progress_fence")) { NVX_progress_fence = true; extensions.Remove("glNVX_progress_fence"); } + if (extensions.Contains("gl_NV_alpha_to_coverage_dither_control")) { NV_alpha_to_coverage_dither_control = true; extensions.Remove("glNV_alpha_to_coverage_dither_control"); } + if (extensions.Contains("gl_NV_bindless_multi_draw_indirect")) { NV_bindless_multi_draw_indirect = true; extensions.Remove("glNV_bindless_multi_draw_indirect"); } + if (extensions.Contains("gl_NV_bindless_multi_draw_indirect_count")) { NV_bindless_multi_draw_indirect_count = true; extensions.Remove("glNV_bindless_multi_draw_indirect_count"); } + if (extensions.Contains("gl_NV_bindless_texture")) { NV_bindless_texture = true; extensions.Remove("glNV_bindless_texture"); } + if (extensions.Contains("gl_NV_blend_equation_advanced")) { NV_blend_equation_advanced = true; extensions.Remove("glNV_blend_equation_advanced"); } + if (extensions.Contains("gl_NV_blend_equation_advanced_coherent")) { NV_blend_equation_advanced_coherent = true; extensions.Remove("glNV_blend_equation_advanced_coherent"); } + if (extensions.Contains("gl_NV_blend_minmax_factor")) { NV_blend_minmax_factor = true; extensions.Remove("glNV_blend_minmax_factor"); } + if (extensions.Contains("gl_NV_blend_square")) { NV_blend_square = true; extensions.Remove("glNV_blend_square"); } + if (extensions.Contains("gl_NV_clip_space_w_scaling")) { NV_clip_space_w_scaling = true; extensions.Remove("glNV_clip_space_w_scaling"); } + if (extensions.Contains("gl_NV_command_list")) { NV_command_list = true; extensions.Remove("glNV_command_list"); } + if (extensions.Contains("gl_NV_compute_program5")) { NV_compute_program5 = true; extensions.Remove("glNV_compute_program5"); } + if (extensions.Contains("gl_NV_compute_shader_derivatives")) { NV_compute_shader_derivatives = true; extensions.Remove("glNV_compute_shader_derivatives"); } + if (extensions.Contains("gl_NV_conditional_render")) { NV_conditional_render = true; extensions.Remove("glNV_conditional_render"); } + if (extensions.Contains("gl_NV_conservative_raster")) { NV_conservative_raster = true; extensions.Remove("glNV_conservative_raster"); } + if (extensions.Contains("gl_NV_conservative_raster_dilate")) { NV_conservative_raster_dilate = true; extensions.Remove("glNV_conservative_raster_dilate"); } + if (extensions.Contains("gl_NV_conservative_raster_pre_snap")) { NV_conservative_raster_pre_snap = true; extensions.Remove("glNV_conservative_raster_pre_snap"); } + if (extensions.Contains("gl_NV_conservative_raster_pre_snap_triangles")) { NV_conservative_raster_pre_snap_triangles = true; extensions.Remove("glNV_conservative_raster_pre_snap_triangles"); } + if (extensions.Contains("gl_NV_conservative_raster_underestimation")) { NV_conservative_raster_underestimation = true; extensions.Remove("glNV_conservative_raster_underestimation"); } + if (extensions.Contains("gl_NV_copy_depth_to_color")) { NV_copy_depth_to_color = true; extensions.Remove("glNV_copy_depth_to_color"); } + if (extensions.Contains("gl_NV_copy_image")) { NV_copy_image = true; extensions.Remove("glNV_copy_image"); } + if (extensions.Contains("gl_NV_deep_texture3D")) { NV_deep_texture3D = true; extensions.Remove("glNV_deep_texture3D"); } + if (extensions.Contains("gl_NV_depth_buffer_float")) { NV_depth_buffer_float = true; extensions.Remove("glNV_depth_buffer_float"); } + if (extensions.Contains("gl_NV_depth_clamp")) { NV_depth_clamp = true; extensions.Remove("glNV_depth_clamp"); } + if (extensions.Contains("gl_NV_draw_texture")) { NV_draw_texture = true; extensions.Remove("glNV_draw_texture"); } + if (extensions.Contains("gl_NV_draw_vulkan_image")) { NV_draw_vulkan_image = true; extensions.Remove("glNV_draw_vulkan_image"); } + if (extensions.Contains("gl_NV_evaluators")) { NV_evaluators = true; extensions.Remove("glNV_evaluators"); } + if (extensions.Contains("gl_NV_explicit_multisample")) { NV_explicit_multisample = true; extensions.Remove("glNV_explicit_multisample"); } + if (extensions.Contains("gl_NV_fence")) { NV_fence = true; extensions.Remove("glNV_fence"); } + if (extensions.Contains("gl_NV_fill_rectangle")) { NV_fill_rectangle = true; extensions.Remove("glNV_fill_rectangle"); } + if (extensions.Contains("gl_NV_float_buffer")) { NV_float_buffer = true; extensions.Remove("glNV_float_buffer"); } + if (extensions.Contains("gl_NV_fog_distance")) { NV_fog_distance = true; extensions.Remove("glNV_fog_distance"); } + if (extensions.Contains("gl_NV_fragment_coverage_to_color")) { NV_fragment_coverage_to_color = true; extensions.Remove("glNV_fragment_coverage_to_color"); } + if (extensions.Contains("gl_NV_fragment_program")) { NV_fragment_program = true; extensions.Remove("glNV_fragment_program"); } + if (extensions.Contains("gl_NV_fragment_program2")) { NV_fragment_program2 = true; extensions.Remove("glNV_fragment_program2"); } + if (extensions.Contains("gl_NV_fragment_program4")) { NV_fragment_program4 = true; extensions.Remove("glNV_fragment_program4"); } + if (extensions.Contains("gl_NV_fragment_program_option")) { NV_fragment_program_option = true; extensions.Remove("glNV_fragment_program_option"); } + if (extensions.Contains("gl_NV_fragment_shader_barycentric")) { NV_fragment_shader_barycentric = true; extensions.Remove("glNV_fragment_shader_barycentric"); } + if (extensions.Contains("gl_NV_fragment_shader_interlock")) { NV_fragment_shader_interlock = true; extensions.Remove("glNV_fragment_shader_interlock"); } + if (extensions.Contains("gl_NV_framebuffer_mixed_samples")) { NV_framebuffer_mixed_samples = true; extensions.Remove("glNV_framebuffer_mixed_samples"); } + if (extensions.Contains("gl_NV_framebuffer_multisample_coverage")) { NV_framebuffer_multisample_coverage = true; extensions.Remove("glNV_framebuffer_multisample_coverage"); } + if (extensions.Contains("gl_NV_geometry_program4")) { NV_geometry_program4 = true; extensions.Remove("glNV_geometry_program4"); } + if (extensions.Contains("gl_NV_geometry_shader4")) { NV_geometry_shader4 = true; extensions.Remove("glNV_geometry_shader4"); } + if (extensions.Contains("gl_NV_geometry_shader_passthrough")) { NV_geometry_shader_passthrough = true; extensions.Remove("glNV_geometry_shader_passthrough"); } + if (extensions.Contains("gl_NV_gpu_multicast")) { NV_gpu_multicast = true; extensions.Remove("glNV_gpu_multicast"); } + if (extensions.Contains("gl_NV_gpu_program4")) { NV_gpu_program4 = true; extensions.Remove("glNV_gpu_program4"); } + if (extensions.Contains("gl_NV_gpu_program5")) { NV_gpu_program5 = true; extensions.Remove("glNV_gpu_program5"); } + if (extensions.Contains("gl_NV_gpu_program5_mem_extended")) { NV_gpu_program5_mem_extended = true; extensions.Remove("glNV_gpu_program5_mem_extended"); } + if (extensions.Contains("gl_NV_gpu_shader5")) { NV_gpu_shader5 = true; extensions.Remove("glNV_gpu_shader5"); } + if (extensions.Contains("gl_NV_half_float")) { NV_half_float = true; extensions.Remove("glNV_half_float"); } + if (extensions.Contains("gl_NV_internalformat_sample_query")) { NV_internalformat_sample_query = true; extensions.Remove("glNV_internalformat_sample_query"); } + if (extensions.Contains("gl_NV_light_max_exponent")) { NV_light_max_exponent = true; extensions.Remove("glNV_light_max_exponent"); } + if (extensions.Contains("gl_NV_memory_attachment")) { NV_memory_attachment = true; extensions.Remove("glNV_memory_attachment"); } + if (extensions.Contains("gl_NV_memory_object_sparse")) { NV_memory_object_sparse = true; extensions.Remove("glNV_memory_object_sparse"); } + if (extensions.Contains("gl_NV_mesh_shader")) { NV_mesh_shader = true; extensions.Remove("glNV_mesh_shader"); } + if (extensions.Contains("gl_NV_multisample_coverage")) { NV_multisample_coverage = true; extensions.Remove("glNV_multisample_coverage"); } + if (extensions.Contains("gl_NV_multisample_filter_hint")) { NV_multisample_filter_hint = true; extensions.Remove("glNV_multisample_filter_hint"); } + if (extensions.Contains("gl_NV_occlusion_query")) { NV_occlusion_query = true; extensions.Remove("glNV_occlusion_query"); } + if (extensions.Contains("gl_NV_packed_depth_stencil")) { NV_packed_depth_stencil = true; extensions.Remove("glNV_packed_depth_stencil"); } + if (extensions.Contains("gl_NV_parameter_buffer_object")) { NV_parameter_buffer_object = true; extensions.Remove("glNV_parameter_buffer_object"); } + if (extensions.Contains("gl_NV_parameter_buffer_object2")) { NV_parameter_buffer_object2 = true; extensions.Remove("glNV_parameter_buffer_object2"); } + if (extensions.Contains("gl_NV_path_rendering")) { NV_path_rendering = true; extensions.Remove("glNV_path_rendering"); } + if (extensions.Contains("gl_NV_path_rendering_shared_edge")) { NV_path_rendering_shared_edge = true; extensions.Remove("glNV_path_rendering_shared_edge"); } + if (extensions.Contains("gl_NV_pixel_data_range")) { NV_pixel_data_range = true; extensions.Remove("glNV_pixel_data_range"); } + if (extensions.Contains("gl_NV_point_sprite")) { NV_point_sprite = true; extensions.Remove("glNV_point_sprite"); } + if (extensions.Contains("gl_NV_present_video")) { NV_present_video = true; extensions.Remove("glNV_present_video"); } + if (extensions.Contains("gl_NV_primitive_restart")) { NV_primitive_restart = true; extensions.Remove("glNV_primitive_restart"); } + if (extensions.Contains("gl_NV_primitive_shading_rate")) { NV_primitive_shading_rate = true; extensions.Remove("glNV_primitive_shading_rate"); } + if (extensions.Contains("gl_NV_query_resource")) { NV_query_resource = true; extensions.Remove("glNV_query_resource"); } + if (extensions.Contains("gl_NV_query_resource_tag")) { NV_query_resource_tag = true; extensions.Remove("glNV_query_resource_tag"); } + if (extensions.Contains("gl_NV_register_combiners")) { NV_register_combiners = true; extensions.Remove("glNV_register_combiners"); } + if (extensions.Contains("gl_NV_register_combiners2")) { NV_register_combiners2 = true; extensions.Remove("glNV_register_combiners2"); } + if (extensions.Contains("gl_NV_representative_fragment_test")) { NV_representative_fragment_test = true; extensions.Remove("glNV_representative_fragment_test"); } + if (extensions.Contains("gl_NV_robustness_video_memory_purge")) { NV_robustness_video_memory_purge = true; extensions.Remove("glNV_robustness_video_memory_purge"); } + if (extensions.Contains("gl_NV_sample_locations")) { NV_sample_locations = true; extensions.Remove("glNV_sample_locations"); } + if (extensions.Contains("gl_NV_sample_mask_override_coverage")) { NV_sample_mask_override_coverage = true; extensions.Remove("glNV_sample_mask_override_coverage"); } + if (extensions.Contains("gl_NV_scissor_exclusive")) { NV_scissor_exclusive = true; extensions.Remove("glNV_scissor_exclusive"); } + if (extensions.Contains("gl_NV_shader_atomic_counters")) { NV_shader_atomic_counters = true; extensions.Remove("glNV_shader_atomic_counters"); } + if (extensions.Contains("gl_NV_shader_atomic_float")) { NV_shader_atomic_float = true; extensions.Remove("glNV_shader_atomic_float"); } + if (extensions.Contains("gl_NV_shader_atomic_float64")) { NV_shader_atomic_float64 = true; extensions.Remove("glNV_shader_atomic_float64"); } + if (extensions.Contains("gl_NV_shader_atomic_fp16_vector")) { NV_shader_atomic_fp16_vector = true; extensions.Remove("glNV_shader_atomic_fp16_vector"); } + if (extensions.Contains("gl_NV_shader_atomic_int64")) { NV_shader_atomic_int64 = true; extensions.Remove("glNV_shader_atomic_int64"); } + if (extensions.Contains("gl_NV_shader_buffer_load")) { NV_shader_buffer_load = true; extensions.Remove("glNV_shader_buffer_load"); } + if (extensions.Contains("gl_NV_shader_buffer_store")) { NV_shader_buffer_store = true; extensions.Remove("glNV_shader_buffer_store"); } + if (extensions.Contains("gl_NV_shader_storage_buffer_object")) { NV_shader_storage_buffer_object = true; extensions.Remove("glNV_shader_storage_buffer_object"); } + if (extensions.Contains("gl_NV_shader_subgroup_partitioned")) { NV_shader_subgroup_partitioned = true; extensions.Remove("glNV_shader_subgroup_partitioned"); } + if (extensions.Contains("gl_NV_shader_texture_footprint")) { NV_shader_texture_footprint = true; extensions.Remove("glNV_shader_texture_footprint"); } + if (extensions.Contains("gl_NV_shader_thread_group")) { NV_shader_thread_group = true; extensions.Remove("glNV_shader_thread_group"); } + if (extensions.Contains("gl_NV_shader_thread_shuffle")) { NV_shader_thread_shuffle = true; extensions.Remove("glNV_shader_thread_shuffle"); } + if (extensions.Contains("gl_NV_shading_rate_image")) { NV_shading_rate_image = true; extensions.Remove("glNV_shading_rate_image"); } + if (extensions.Contains("gl_NV_stereo_view_rendering")) { NV_stereo_view_rendering = true; extensions.Remove("glNV_stereo_view_rendering"); } + if (extensions.Contains("gl_NV_tessellation_program5")) { NV_tessellation_program5 = true; extensions.Remove("glNV_tessellation_program5"); } + if (extensions.Contains("gl_NV_texgen_emboss")) { NV_texgen_emboss = true; extensions.Remove("glNV_texgen_emboss"); } + if (extensions.Contains("gl_NV_texgen_reflection")) { NV_texgen_reflection = true; extensions.Remove("glNV_texgen_reflection"); } + if (extensions.Contains("gl_NV_texture_barrier")) { NV_texture_barrier = true; extensions.Remove("glNV_texture_barrier"); } + if (extensions.Contains("gl_NV_texture_compression_vtc")) { NV_texture_compression_vtc = true; extensions.Remove("glNV_texture_compression_vtc"); } + if (extensions.Contains("gl_NV_texture_env_combine4")) { NV_texture_env_combine4 = true; extensions.Remove("glNV_texture_env_combine4"); } + if (extensions.Contains("gl_NV_texture_expand_normal")) { NV_texture_expand_normal = true; extensions.Remove("glNV_texture_expand_normal"); } + if (extensions.Contains("gl_NV_texture_multisample")) { NV_texture_multisample = true; extensions.Remove("glNV_texture_multisample"); } + if (extensions.Contains("gl_NV_texture_rectangle")) { NV_texture_rectangle = true; extensions.Remove("glNV_texture_rectangle"); } + if (extensions.Contains("gl_NV_texture_rectangle_compressed")) { NV_texture_rectangle_compressed = true; extensions.Remove("glNV_texture_rectangle_compressed"); } + if (extensions.Contains("gl_NV_texture_shader")) { NV_texture_shader = true; extensions.Remove("glNV_texture_shader"); } + if (extensions.Contains("gl_NV_texture_shader2")) { NV_texture_shader2 = true; extensions.Remove("glNV_texture_shader2"); } + if (extensions.Contains("gl_NV_texture_shader3")) { NV_texture_shader3 = true; extensions.Remove("glNV_texture_shader3"); } + if (extensions.Contains("gl_NV_timeline_semaphore")) { NV_timeline_semaphore = true; extensions.Remove("glNV_timeline_semaphore"); } + if (extensions.Contains("gl_NV_transform_feedback")) { NV_transform_feedback = true; extensions.Remove("glNV_transform_feedback"); } + if (extensions.Contains("gl_NV_transform_feedback2")) { NV_transform_feedback2 = true; extensions.Remove("glNV_transform_feedback2"); } + if (extensions.Contains("gl_NV_uniform_buffer_std430_layout")) { NV_uniform_buffer_std430_layout = true; extensions.Remove("glNV_uniform_buffer_std430_layout"); } + if (extensions.Contains("gl_NV_uniform_buffer_unified_memory")) { NV_uniform_buffer_unified_memory = true; extensions.Remove("glNV_uniform_buffer_unified_memory"); } + if (extensions.Contains("gl_NV_vdpau_interop")) { NV_vdpau_interop = true; extensions.Remove("glNV_vdpau_interop"); } + if (extensions.Contains("gl_NV_vdpau_interop2")) { NV_vdpau_interop2 = true; extensions.Remove("glNV_vdpau_interop2"); } + if (extensions.Contains("gl_NV_vertex_array_range")) { NV_vertex_array_range = true; extensions.Remove("glNV_vertex_array_range"); } + if (extensions.Contains("gl_NV_vertex_array_range2")) { NV_vertex_array_range2 = true; extensions.Remove("glNV_vertex_array_range2"); } + if (extensions.Contains("gl_NV_vertex_attrib_integer_64bit")) { NV_vertex_attrib_integer_64bit = true; extensions.Remove("glNV_vertex_attrib_integer_64bit"); } + if (extensions.Contains("gl_NV_vertex_buffer_unified_memory")) { NV_vertex_buffer_unified_memory = true; extensions.Remove("glNV_vertex_buffer_unified_memory"); } + if (extensions.Contains("gl_NV_vertex_program")) { NV_vertex_program = true; extensions.Remove("glNV_vertex_program"); } + if (extensions.Contains("gl_NV_vertex_program1_1")) { NV_vertex_program1_1 = true; extensions.Remove("glNV_vertex_program1_1"); } + if (extensions.Contains("gl_NV_vertex_program2")) { NV_vertex_program2 = true; extensions.Remove("glNV_vertex_program2"); } + if (extensions.Contains("gl_NV_vertex_program2_option")) { NV_vertex_program2_option = true; extensions.Remove("glNV_vertex_program2_option"); } + if (extensions.Contains("gl_NV_vertex_program3")) { NV_vertex_program3 = true; extensions.Remove("glNV_vertex_program3"); } + if (extensions.Contains("gl_NV_vertex_program4")) { NV_vertex_program4 = true; extensions.Remove("glNV_vertex_program4"); } + if (extensions.Contains("gl_NV_video_capture")) { NV_video_capture = true; extensions.Remove("glNV_video_capture"); } + if (extensions.Contains("gl_NV_viewport_array2")) { NV_viewport_array2 = true; extensions.Remove("glNV_viewport_array2"); } + if (extensions.Contains("gl_NV_viewport_swizzle")) { NV_viewport_swizzle = true; extensions.Remove("glNV_viewport_swizzle"); } + if (extensions.Contains("gl_OES_byte_coordinates")) { OES_byte_coordinates = true; extensions.Remove("glOES_byte_coordinates"); } + if (extensions.Contains("gl_OES_compressed_paletted_texture")) { OES_compressed_paletted_texture = true; extensions.Remove("glOES_compressed_paletted_texture"); } + if (extensions.Contains("gl_OES_fixed_point")) { OES_fixed_point = true; extensions.Remove("glOES_fixed_point"); } + if (extensions.Contains("gl_OES_query_matrix")) { OES_query_matrix = true; extensions.Remove("glOES_query_matrix"); } + if (extensions.Contains("gl_OES_read_format")) { OES_read_format = true; extensions.Remove("glOES_read_format"); } + if (extensions.Contains("gl_OES_single_precision")) { OES_single_precision = true; extensions.Remove("glOES_single_precision"); } + if (extensions.Contains("gl_OML_interlace")) { OML_interlace = true; extensions.Remove("glOML_interlace"); } + if (extensions.Contains("gl_OML_resample")) { OML_resample = true; extensions.Remove("glOML_resample"); } + if (extensions.Contains("gl_OML_subsample")) { OML_subsample = true; extensions.Remove("glOML_subsample"); } + if (extensions.Contains("gl_OVR_multiview")) { OVR_multiview = true; extensions.Remove("glOVR_multiview"); } + if (extensions.Contains("gl_OVR_multiview2")) { OVR_multiview2 = true; extensions.Remove("glOVR_multiview2"); } + if (extensions.Contains("gl_PGI_misc_hints")) { PGI_misc_hints = true; extensions.Remove("glPGI_misc_hints"); } + if (extensions.Contains("gl_PGI_vertex_hints")) { PGI_vertex_hints = true; extensions.Remove("glPGI_vertex_hints"); } + if (extensions.Contains("gl_REND_screen_coordinates")) { REND_screen_coordinates = true; extensions.Remove("glREND_screen_coordinates"); } + if (extensions.Contains("gl_S3_s3tc")) { S3_s3tc = true; extensions.Remove("glS3_s3tc"); } + if (extensions.Contains("gl_SGIS_detail_texture")) { SGIS_detail_texture = true; extensions.Remove("glSGIS_detail_texture"); } + if (extensions.Contains("gl_SGIS_fog_function")) { SGIS_fog_function = true; extensions.Remove("glSGIS_fog_function"); } + if (extensions.Contains("gl_SGIS_generate_mipmap")) { SGIS_generate_mipmap = true; extensions.Remove("glSGIS_generate_mipmap"); } + if (extensions.Contains("gl_SGIS_multisample")) { SGIS_multisample = true; extensions.Remove("glSGIS_multisample"); } + if (extensions.Contains("gl_SGIS_pixel_texture")) { SGIS_pixel_texture = true; extensions.Remove("glSGIS_pixel_texture"); } + if (extensions.Contains("gl_SGIS_point_line_texgen")) { SGIS_point_line_texgen = true; extensions.Remove("glSGIS_point_line_texgen"); } + if (extensions.Contains("gl_SGIS_point_parameters")) { SGIS_point_parameters = true; extensions.Remove("glSGIS_point_parameters"); } + if (extensions.Contains("gl_SGIS_sharpen_texture")) { SGIS_sharpen_texture = true; extensions.Remove("glSGIS_sharpen_texture"); } + if (extensions.Contains("gl_SGIS_texture4D")) { SGIS_texture4D = true; extensions.Remove("glSGIS_texture4D"); } + if (extensions.Contains("gl_SGIS_texture_border_clamp")) { SGIS_texture_border_clamp = true; extensions.Remove("glSGIS_texture_border_clamp"); } + if (extensions.Contains("gl_SGIS_texture_color_mask")) { SGIS_texture_color_mask = true; extensions.Remove("glSGIS_texture_color_mask"); } + if (extensions.Contains("gl_SGIS_texture_edge_clamp")) { SGIS_texture_edge_clamp = true; extensions.Remove("glSGIS_texture_edge_clamp"); } + if (extensions.Contains("gl_SGIS_texture_filter4")) { SGIS_texture_filter4 = true; extensions.Remove("glSGIS_texture_filter4"); } + if (extensions.Contains("gl_SGIS_texture_lod")) { SGIS_texture_lod = true; extensions.Remove("glSGIS_texture_lod"); } + if (extensions.Contains("gl_SGIS_texture_select")) { SGIS_texture_select = true; extensions.Remove("glSGIS_texture_select"); } + if (extensions.Contains("gl_SGIX_async")) { SGIX_async = true; extensions.Remove("glSGIX_async"); } + if (extensions.Contains("gl_SGIX_async_histogram")) { SGIX_async_histogram = true; extensions.Remove("glSGIX_async_histogram"); } + if (extensions.Contains("gl_SGIX_async_pixel")) { SGIX_async_pixel = true; extensions.Remove("glSGIX_async_pixel"); } + if (extensions.Contains("gl_SGIX_blend_alpha_minmax")) { SGIX_blend_alpha_minmax = true; extensions.Remove("glSGIX_blend_alpha_minmax"); } + if (extensions.Contains("gl_SGIX_calligraphic_fragment")) { SGIX_calligraphic_fragment = true; extensions.Remove("glSGIX_calligraphic_fragment"); } + if (extensions.Contains("gl_SGIX_clipmap")) { SGIX_clipmap = true; extensions.Remove("glSGIX_clipmap"); } + if (extensions.Contains("gl_SGIX_convolution_accuracy")) { SGIX_convolution_accuracy = true; extensions.Remove("glSGIX_convolution_accuracy"); } + if (extensions.Contains("gl_SGIX_depth_pass_instrument")) { SGIX_depth_pass_instrument = true; extensions.Remove("glSGIX_depth_pass_instrument"); } + if (extensions.Contains("gl_SGIX_depth_texture")) { SGIX_depth_texture = true; extensions.Remove("glSGIX_depth_texture"); } + if (extensions.Contains("gl_SGIX_flush_raster")) { SGIX_flush_raster = true; extensions.Remove("glSGIX_flush_raster"); } + if (extensions.Contains("gl_SGIX_fog_offset")) { SGIX_fog_offset = true; extensions.Remove("glSGIX_fog_offset"); } + if (extensions.Contains("gl_SGIX_fragment_lighting")) { SGIX_fragment_lighting = true; extensions.Remove("glSGIX_fragment_lighting"); } + if (extensions.Contains("gl_SGIX_framezoom")) { SGIX_framezoom = true; extensions.Remove("glSGIX_framezoom"); } + if (extensions.Contains("gl_SGIX_igloo_interface")) { SGIX_igloo_interface = true; extensions.Remove("glSGIX_igloo_interface"); } + if (extensions.Contains("gl_SGIX_instruments")) { SGIX_instruments = true; extensions.Remove("glSGIX_instruments"); } + if (extensions.Contains("gl_SGIX_interlace")) { SGIX_interlace = true; extensions.Remove("glSGIX_interlace"); } + if (extensions.Contains("gl_SGIX_ir_instrument1")) { SGIX_ir_instrument1 = true; extensions.Remove("glSGIX_ir_instrument1"); } + if (extensions.Contains("gl_SGIX_list_priority")) { SGIX_list_priority = true; extensions.Remove("glSGIX_list_priority"); } + if (extensions.Contains("gl_SGIX_pixel_texture")) { SGIX_pixel_texture = true; extensions.Remove("glSGIX_pixel_texture"); } + if (extensions.Contains("gl_SGIX_pixel_tiles")) { SGIX_pixel_tiles = true; extensions.Remove("glSGIX_pixel_tiles"); } + if (extensions.Contains("gl_SGIX_polynomial_ffd")) { SGIX_polynomial_ffd = true; extensions.Remove("glSGIX_polynomial_ffd"); } + if (extensions.Contains("gl_SGIX_reference_plane")) { SGIX_reference_plane = true; extensions.Remove("glSGIX_reference_plane"); } + if (extensions.Contains("gl_SGIX_resample")) { SGIX_resample = true; extensions.Remove("glSGIX_resample"); } + if (extensions.Contains("gl_SGIX_scalebias_hint")) { SGIX_scalebias_hint = true; extensions.Remove("glSGIX_scalebias_hint"); } + if (extensions.Contains("gl_SGIX_shadow")) { SGIX_shadow = true; extensions.Remove("glSGIX_shadow"); } + if (extensions.Contains("gl_SGIX_shadow_ambient")) { SGIX_shadow_ambient = true; extensions.Remove("glSGIX_shadow_ambient"); } + if (extensions.Contains("gl_SGIX_sprite")) { SGIX_sprite = true; extensions.Remove("glSGIX_sprite"); } + if (extensions.Contains("gl_SGIX_subsample")) { SGIX_subsample = true; extensions.Remove("glSGIX_subsample"); } + if (extensions.Contains("gl_SGIX_tag_sample_buffer")) { SGIX_tag_sample_buffer = true; extensions.Remove("glSGIX_tag_sample_buffer"); } + if (extensions.Contains("gl_SGIX_texture_add_env")) { SGIX_texture_add_env = true; extensions.Remove("glSGIX_texture_add_env"); } + if (extensions.Contains("gl_SGIX_texture_coordinate_clamp")) { SGIX_texture_coordinate_clamp = true; extensions.Remove("glSGIX_texture_coordinate_clamp"); } + if (extensions.Contains("gl_SGIX_texture_lod_bias")) { SGIX_texture_lod_bias = true; extensions.Remove("glSGIX_texture_lod_bias"); } + if (extensions.Contains("gl_SGIX_texture_multi_buffer")) { SGIX_texture_multi_buffer = true; extensions.Remove("glSGIX_texture_multi_buffer"); } + if (extensions.Contains("gl_SGIX_texture_scale_bias")) { SGIX_texture_scale_bias = true; extensions.Remove("glSGIX_texture_scale_bias"); } + if (extensions.Contains("gl_SGIX_vertex_preclip")) { SGIX_vertex_preclip = true; extensions.Remove("glSGIX_vertex_preclip"); } + if (extensions.Contains("gl_SGIX_ycrcb")) { SGIX_ycrcb = true; extensions.Remove("glSGIX_ycrcb"); } + if (extensions.Contains("gl_SGIX_ycrcb_subsample")) { SGIX_ycrcb_subsample = true; extensions.Remove("glSGIX_ycrcb_subsample"); } + if (extensions.Contains("gl_SGIX_ycrcba")) { SGIX_ycrcba = true; extensions.Remove("glSGIX_ycrcba"); } + if (extensions.Contains("gl_SGI_color_matrix")) { SGI_color_matrix = true; extensions.Remove("glSGI_color_matrix"); } + if (extensions.Contains("gl_SGI_color_table")) { SGI_color_table = true; extensions.Remove("glSGI_color_table"); } + if (extensions.Contains("gl_SGI_texture_color_table")) { SGI_texture_color_table = true; extensions.Remove("glSGI_texture_color_table"); } + if (extensions.Contains("gl_SUNX_constant_data")) { SUNX_constant_data = true; extensions.Remove("glSUNX_constant_data"); } + if (extensions.Contains("gl_SUN_convolution_border_modes")) { SUN_convolution_border_modes = true; extensions.Remove("glSUN_convolution_border_modes"); } + if (extensions.Contains("gl_SUN_global_alpha")) { SUN_global_alpha = true; extensions.Remove("glSUN_global_alpha"); } + if (extensions.Contains("gl_SUN_mesh_array")) { SUN_mesh_array = true; extensions.Remove("glSUN_mesh_array"); } + if (extensions.Contains("gl_SUN_slice_accum")) { SUN_slice_accum = true; extensions.Remove("glSUN_slice_accum"); } + if (extensions.Contains("gl_SUN_triangle_list")) { SUN_triangle_list = true; extensions.Remove("glSUN_triangle_list"); } + if (extensions.Contains("gl_SUN_vertex")) { SUN_vertex = true; extensions.Remove("glSUN_vertex"); } + if (extensions.Contains("gl_WIN_phong_shading")) { WIN_phong_shading = true; extensions.Remove("glWIN_phong_shading"); } + if (extensions.Contains("gl_WIN_specular_fog")) { WIN_specular_fog = true; extensions.Remove("glWIN_specular_fog"); } + + #endregion checkGLextensions + + InternalIO.InternalWriteLog("Find OpenGL extensions.", LogType.Info); + } + + /// + /// Get the function pointer of given OpenGL api name + /// + /// ContextName of the OpenGL api + /// The funtion pointer of the api in stream of + public static IntPtr LoadGLfunc(string name) + { + IntPtr ret = InternalIO.glfwGetProcAddress(name); + if (ret == default) + { + InternalIO.InternalAppendLog( + $"Cannot load OpenGL api called {name}, this api may not exist or supported."); + return ret; + } + return ret; + } + + internal static void CheckCoreVersion(int majorVersion, int minorVersion) + { + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 0))) + { + core10 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 1))) + { + core11 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 2))) + { + core12 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 3))) + { + core13 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 4))) + { + core14 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 5))) + { + core15 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 2) || ((majorVersion == 2) && (minorVersion == 0))) + { + core20 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 2) || ((majorVersion == 2) && (minorVersion == 1))) + { + core21 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 0))) + { + core30 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 1))) + { + core31 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 2))) + { + core32 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 3) || ((majorVersion == 3) && (minorVersion == 3))) + { + core33 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 0))) + { + core40 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 1))) + { + core41 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 2))) + { + core42 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 3))) + { + core43 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 4))) + { + core44 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 5))) + { + core45 = true; + } + else + { + goto log; + } + + if ((majorVersion >= 4) || ((majorVersion == 4) && (minorVersion == 6))) + { + core46 = true; + } + else + { + goto log; + } + + log: + { + InternalIO.InternalWriteLog("Find core OpenGL version.", LogType.Info); + return; + } + } + + internal static unsafe string GetExtensions(this GLcontext context) + { + if (context.glGetString == null) + { + return string.Empty; + } + return Marshal.PtrToStringAnsi( + context.glGetString(glExtension)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static T internalLoadAPI(IntPtr ptr) where T : Delegate + { + try + { + if (ptr == IntPtr.Zero) { return null; } + T func = Marshal.GetDelegateForFunctionPointer(ptr); + return func; + } + catch (Exception ex) + { + InternalIO.InternalWriteLog( + $"{$"Failed to convert the api {typeof(T).Name}.\n"}{ex.Message}", LogType.Warning); + return default; + } + } + + internal static unsafe void LoadGLcore10(GLcontext* contextPtr, delegate* load) + { + if (!core10) + { + InternalIO.InternalAppendLog("The core version 1.0 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glBlendFunc = (delegate*)load("glBlendFunc"); + contextPtr->glClear = (delegate*)load("glClear"); + contextPtr->glClearColor = (delegate*)load("glClearColor"); + contextPtr->glClearDepth = (delegate*)load("glClearDepth"); + contextPtr->glClearStencil = (delegate*)load("glClearStencil"); + contextPtr->glColorMask = (delegate*)load("glColorMask"); + contextPtr->glCullFace = (delegate*)load("glCullFace"); + contextPtr->glDepthFunc = (delegate*)load("glDepthFunc"); + contextPtr->glDepthMask = (delegate*)load("glDepthMask"); + contextPtr->glDepthRange = (delegate*)load("glDepthRange"); + contextPtr->glDisable = (delegate*)load("glDisable"); + contextPtr->glDrawBuffer = (delegate*)load("glDrawBuffer"); + contextPtr->glEnable = (delegate*)load("glEnable"); + contextPtr->glFinish = (delegate*)load("glFinish"); + contextPtr->glFlush = (delegate*)load("glFlush"); + contextPtr->glFrontFace = (delegate*)load("glFrontFace"); + contextPtr->glGetBooleanv = (delegate*)load("glGetBooleanv"); + contextPtr->glGetDoublev = (delegate*)load("glGetDoublev"); + contextPtr->glGetError = (delegate*)load("glGetError"); + contextPtr->glGetFloatv = (delegate*)load("glGetFloatv"); + contextPtr->glGetIntegerv = (delegate*)load("glGetIntegerv"); + contextPtr->glGetString = (delegate*)load("glGetString"); + contextPtr->glGetTexImage = (delegate*)load("glGetTexImage"); + contextPtr->glGetTexLevelParameterfv = (delegate*)load("glGetTexLevelParameterfv"); + contextPtr->glGetTexLevelParameteriv = (delegate*)load("glGetTexLevelParameteriv"); + contextPtr->glGetTexParameterfv = (delegate*)load("glGetTexParameterfv"); + contextPtr->glGetTexParameteriv = (delegate*)load("glGetTexParameteriv"); + contextPtr->glHint = (delegate*)load("glHint"); + contextPtr->glIsEnabled = (delegate*)load("glIsEnabled"); + contextPtr->glLineWidth = (delegate*)load("glLineWidth"); + contextPtr->glLogicOp = (delegate*)load("glLogicOp"); + contextPtr->glPixelStoref = (delegate*)load("glPixelStoref"); + contextPtr->glPixelStorei = (delegate*)load("glPixelStorei"); + contextPtr->glPointSize = (delegate*)load("glPointSize"); + contextPtr->glPolygonMode = (delegate*)load("glPolygonMode"); + contextPtr->glReadBuffer = (delegate*)load("glReadBuffer"); + contextPtr->glReadPixels = (delegate*)load("glReadPixels"); + contextPtr->glScissor = (delegate*)load("glScissor"); + contextPtr->glStencilFunc = (delegate*)load("glStencilFunc"); + contextPtr->glStencilMask = (delegate*)load("glStencilMask"); + contextPtr->glStencilOp = (delegate*)load("glStencilOp"); + contextPtr->glTexImage1D = (delegate*)load("glTexImage1D"); + contextPtr->glTexImage2D = (delegate*)load("glTexImage2D"); + contextPtr->glTexParameterf = (delegate*)load("glTexParameterf"); + contextPtr->glTexParameterfv = (delegate*)load("glTexParameterfv"); + contextPtr->glTexParameteri = (delegate*)load("glTexParameteri"); + contextPtr->glTexParameteriv = (delegate*)load("glTexParameteriv"); + contextPtr->glViewport = (delegate*)load("glViewport"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 1.0 APIs"); + } + + internal static unsafe void LoadGLcore11(GLcontext* contextPtr, delegate* load) + { + if (!core11) + { + InternalIO.InternalAppendLog("The core version 1.1 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glBindTexture = (delegate*)load("glBindTexture"); + contextPtr->glCopyTexImage1D = (delegate*)load("glCopyTexImage1D"); + contextPtr->glCopyTexImage2D = (delegate*)load("glCopyTexImage2D"); + contextPtr->glCopyTexSubImage1D = (delegate*)load("glCopyTexSubImage1D"); + contextPtr->glCopyTexSubImage2D = (delegate*)load("glCopyTexSubImage2D"); + contextPtr->glDeleteTextures = (delegate*)load("glDeleteTextures"); + contextPtr->glDrawArrays = (delegate*)load("glDrawArrays"); + contextPtr->glDrawElements = (delegate*)load("glDrawElements"); + contextPtr->glGenTextures = (delegate*)load("glGenTextures"); + contextPtr->glGetPointerv = (delegate*)load("glGetPointerv"); + contextPtr->glIsTexture = (delegate*)load("glIsTexture"); + contextPtr->glPolygonOffset = (delegate*)load("glPolygonOffset"); + contextPtr->glTexSubImage1D = (delegate*)load("glTexSubImage1D"); + contextPtr->glTexSubImage2D = (delegate*)load("glTexSubImage2D"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 1.1 APIs"); + } + + internal static unsafe void LoadGLcore12(GLcontext* contextPtr, delegate* load) + { + if (!core12) + { + InternalIO.InternalAppendLog("The core version 1.2 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glCopyTexSubImage3D = (delegate*)load("glCopyTexSubImage3D"); + contextPtr->glDrawRangeElements = (delegate*)load("glDrawRangeElements"); + contextPtr->glTexImage3D = (delegate*)load("glTexImage3D"); + contextPtr->glTexSubImage3D = (delegate*)load("glTexSubImage3D"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 1.2 APIs"); + } + + internal static unsafe void LoadGLcore13(GLcontext* contextPtr, delegate* load) + { + if (!core13) + { + InternalIO.InternalAppendLog("The core version 1.3 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glActiveTexture = (delegate*)load("glActiveTexture"); + contextPtr->glCompressedTexImage1D = (delegate*)load("glCompressedTexImage1D"); + contextPtr->glCompressedTexImage2D = (delegate*)load("glCompressedTexImage2D"); + contextPtr->glCompressedTexImage3D = (delegate*)load("glCompressedTexImage3D"); + contextPtr->glCompressedTexSubImage1D = (delegate*)load("glCompressedTexSubImage1D"); + contextPtr->glCompressedTexSubImage2D = (delegate*)load("glCompressedTexSubImage2D"); + contextPtr->glCompressedTexSubImage3D = (delegate*)load("glCompressedTexSubImage3D"); + contextPtr->glGetCompressedTexImage = (delegate*)load("glGetCompressedTexImage"); + contextPtr->glSampleCoverage = (delegate*)load("glSampleCoverage"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 1.3 APIs"); + } + + internal static unsafe void LoadGLcore14(GLcontext* contextPtr, delegate* load) + { + if (!core14) + { + InternalIO.InternalAppendLog("The core version 1.4 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glBlendColor = (delegate*)load("glBlendColor"); + contextPtr->glBlendEquation = (delegate*)load("glBlendEquation"); + contextPtr->glBlendFuncSeparate = (delegate*)load("glBlendFuncSeparate"); + contextPtr->glMultiDrawArrays = (delegate*)load("glMultiDrawArrays"); + contextPtr->glMultiDrawElements = (delegate*)load("glMultiDrawElements"); + contextPtr->glPointParameterf = (delegate*)load("glPointParameterf"); + contextPtr->glPointParameterfv = (delegate*)load("glPointParameterfv"); + contextPtr->glPointParameteri = (delegate*)load("glPointParameteri"); + contextPtr->glPointParameteriv = (delegate*)load("glPointParameteriv"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 1.4 APIs"); + } + + internal static unsafe void LoadGLcore15(GLcontext* contextPtr, delegate* load) + { + if (!core15) + { + InternalIO.InternalAppendLog("The core version 1.5 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glBeginQuery = (delegate*)load("glBeginQuery"); + contextPtr->glBindBuffer = (delegate*)load("glBindBuffer"); + contextPtr->glBufferData = (delegate*)load("glBufferData"); + contextPtr->glBufferSubData = (delegate*)load("glBufferSubData"); + contextPtr->glDeleteBuffers = (delegate*)load("glDeleteBuffers"); + contextPtr->glDeleteQueries = (delegate*)load("glDeleteQueries"); + contextPtr->glEndQuery = (delegate*)load("glEndQuery"); + contextPtr->glGenBuffers = (delegate*)load("glGenBuffers"); + contextPtr->glGenQueries = (delegate*)load("glGenQueries"); + contextPtr->glGetBufferParameteriv = (delegate*)load("glGetBufferParameteriv"); + contextPtr->glGetBufferPointerv = (delegate*)load("glGetBufferPointerv"); + contextPtr->glGetBufferSubData = (delegate*)load("glGetBufferSubData"); + contextPtr->glGetQueryObjectiv = (delegate*)load("glGetQueryObjectiv"); + contextPtr->glGetQueryObjectuiv = (delegate*)load("glGetQueryObjectuiv"); + contextPtr->glGetQueryiv = (delegate*)load("glGetQueryiv"); + contextPtr->glIsBuffer = (delegate*)load("glIsBuffer"); + contextPtr->glIsQuery = (delegate*)load("glIsQuery"); + contextPtr->glMapBuffer = (delegate*)load("glMapBuffer"); + contextPtr->glUnmapBuffer = (delegate*)load("glUnmapBuffer"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 1.5 APIs"); + } + + internal static unsafe void LoadGLcore20(GLcontext* contextPtr, delegate* load) + { + if (!core20) + { + InternalIO.InternalAppendLog("The core version 2.0 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glAttachShader = (delegate*)load("glAttachShader"); + contextPtr->glBindAttribLocation = (delegate*)load("glBindAttribLocation"); + contextPtr->glBlendEquationSeparate = (delegate*)load("glBlendEquationSeparate"); + contextPtr->glCompileShader = (delegate*)load("glCompileShader"); + contextPtr->glCreateProgram = (delegate*)load("glCreateProgram"); + contextPtr->glCreateShader = (delegate*)load("glCreateShader"); + contextPtr->glDeleteProgram = (delegate*)load("glDeleteProgram"); + contextPtr->glDeleteShader = (delegate*)load("glDeleteShader"); + contextPtr->glDetachShader = (delegate*)load("glDetachShader"); + contextPtr->glDisableVertexAttribArray = (delegate*)load("glDisableVertexAttribArray"); + contextPtr->glDrawBuffers = (delegate*)load("glDrawBuffers"); + contextPtr->glEnableVertexAttribArray = (delegate*)load("glEnableVertexAttribArray"); + contextPtr->glGetActiveAttrib = (delegate*)load("glGetActiveAttrib"); + contextPtr->glGetActiveUniform = (delegate*)load("glGetActiveUniform"); + contextPtr->glGetAttachedShaders = (delegate*)load("glGetAttachedShaders"); + contextPtr->glGetAttribLocation = (delegate*)load("glGetAttribLocation"); + contextPtr->glGetProgramInfoLog = (delegate*)load("glGetProgramInfoLog"); + contextPtr->glGetProgramiv = (delegate*)load("glGetProgramiv"); + contextPtr->glGetShaderInfoLog = (delegate*)load("glGetShaderInfoLog"); + contextPtr->glGetShaderSource = (delegate*)load("glGetShaderSource"); + contextPtr->glGetShaderiv = (delegate*)load("glGetShaderiv"); + contextPtr->glGetUniformLocation = (delegate*)load("glGetUniformLocation"); + contextPtr->glGetUniformfv = (delegate*)load("glGetUniformfv"); + contextPtr->glGetUniformiv = (delegate*)load("glGetUniformiv"); + contextPtr->glGetVertexAttribPointerv = (delegate*)load("glGetVertexAttribPointerv"); + contextPtr->glGetVertexAttribdv = (delegate*)load("glGetVertexAttribdv"); + contextPtr->glGetVertexAttribfv = (delegate*)load("glGetVertexAttribfv"); + contextPtr->glGetVertexAttribiv = (delegate*)load("glGetVertexAttribiv"); + contextPtr->glIsProgram = (delegate*)load("glIsProgram"); + contextPtr->glIsShader = (delegate*)load("glIsShader"); + contextPtr->glLinkProgram = (delegate*)load("glLinkProgram"); + contextPtr->glShaderSource = (delegate* unmanaged[Stdcall])load("glShaderSource"); + contextPtr->glStencilFuncSeparate = (delegate*)load("glStencilFuncSeparate"); + contextPtr->glStencilMaskSeparate = (delegate*)load("glStencilMaskSeparate"); + contextPtr->glStencilOpSeparate = (delegate*)load("glStencilOpSeparate"); + contextPtr->glUniform1f = (delegate*)load("glUniform1f"); + contextPtr->glUniform1fv = (delegate*)load("glUniform1fv"); + contextPtr->glUniform1i = (delegate*)load("glUniform1i"); + contextPtr->glUniform1iv = (delegate*)load("glUniform1iv"); + contextPtr->glUniform2f = (delegate*)load("glUniform2f"); + contextPtr->glUniform2fv = (delegate*)load("glUniform2fv"); + contextPtr->glUniform2i = (delegate*)load("glUniform2i"); + contextPtr->glUniform2iv = (delegate*)load("glUniform2iv"); + contextPtr->glUniform3f = (delegate*)load("glUniform3f"); + contextPtr->glUniform3fv = (delegate*)load("glUniform3fv"); + contextPtr->glUniform3i = (delegate*)load("glUniform3i"); + contextPtr->glUniform3iv = (delegate*)load("glUniform3iv"); + contextPtr->glUniform4f = (delegate*)load("glUniform4f"); + contextPtr->glUniform4fv = (delegate*)load("glUniform4fv"); + contextPtr->glUniform4i = (delegate*)load("glUniform4i"); + contextPtr->glUniform4iv = (delegate*)load("glUniform4iv"); + contextPtr->glUniformMatrix2fv = (delegate*)load("glUniformMatrix2fv"); + contextPtr->glUniformMatrix3fv = (delegate*)load("glUniformMatrix3fv"); + contextPtr->glUniformMatrix4fv = (delegate*)load("glUniformMatrix4fv"); + contextPtr->glUseProgram = (delegate*)load("glUseProgram"); + contextPtr->glValidateProgram = (delegate*)load("glValidateProgram"); + contextPtr->glVertexAttrib1d = (delegate*)load("glVertexAttrib1d"); + contextPtr->glVertexAttrib1dv = (delegate*)load("glVertexAttrib1dv"); + contextPtr->glVertexAttrib1f = (delegate*)load("glVertexAttrib1f"); + contextPtr->glVertexAttrib1fv = (delegate*)load("glVertexAttrib1fv"); + contextPtr->glVertexAttrib1s = (delegate*)load("glVertexAttrib1s"); + contextPtr->glVertexAttrib1sv = (delegate*)load("glVertexAttrib1sv"); + contextPtr->glVertexAttrib2d = (delegate*)load("glVertexAttrib2d"); + contextPtr->glVertexAttrib2dv = (delegate*)load("glVertexAttrib2dv"); + contextPtr->glVertexAttrib2f = (delegate*)load("glVertexAttrib2f"); + contextPtr->glVertexAttrib2fv = (delegate*)load("glVertexAttrib2fv"); + contextPtr->glVertexAttrib2s = (delegate*)load("glVertexAttrib2s"); + contextPtr->glVertexAttrib2sv = (delegate*)load("glVertexAttrib2sv"); + contextPtr->glVertexAttrib3d = (delegate*)load("glVertexAttrib3d"); + contextPtr->glVertexAttrib3dv = (delegate*)load("glVertexAttrib3dv"); + contextPtr->glVertexAttrib3f = (delegate*)load("glVertexAttrib3f"); + contextPtr->glVertexAttrib3fv = (delegate*)load("glVertexAttrib3fv"); + contextPtr->glVertexAttrib3s = (delegate*)load("glVertexAttrib3s"); + contextPtr->glVertexAttrib3sv = (delegate*)load("glVertexAttrib3sv"); + contextPtr->glVertexAttrib4Nbv = (delegate*)load("glVertexAttrib4Nbv"); + contextPtr->glVertexAttrib4Niv = (delegate*)load("glVertexAttrib4Niv"); + contextPtr->glVertexAttrib4Nsv = (delegate*)load("glVertexAttrib4Nsv"); + contextPtr->glVertexAttrib4Nub = (delegate*)load("glVertexAttrib4Nub"); + contextPtr->glVertexAttrib4Nubv = (delegate*)load("glVertexAttrib4Nubv"); + contextPtr->glVertexAttrib4Nuiv = (delegate*)load("glVertexAttrib4Nuiv"); + contextPtr->glVertexAttrib4Nusv = (delegate*)load("glVertexAttrib4Nusv"); + contextPtr->glVertexAttrib4bv = (delegate*)load("glVertexAttrib4bv"); + contextPtr->glVertexAttrib4d = (delegate*)load("glVertexAttrib4d"); + contextPtr->glVertexAttrib4dv = (delegate*)load("glVertexAttrib4dv"); + contextPtr->glVertexAttrib4f = (delegate*)load("glVertexAttrib4f"); + contextPtr->glVertexAttrib4fv = (delegate*)load("glVertexAttrib4fv"); + contextPtr->glVertexAttrib4iv = (delegate*)load("glVertexAttrib4iv"); + contextPtr->glVertexAttrib4s = (delegate*)load("glVertexAttrib4s"); + contextPtr->glVertexAttrib4sv = (delegate*)load("glVertexAttrib4sv"); + contextPtr->glVertexAttrib4ubv = (delegate*)load("glVertexAttrib4ubv"); + contextPtr->glVertexAttrib4uiv = (delegate*)load("glVertexAttrib4uiv"); + contextPtr->glVertexAttrib4usv = (delegate*)load("glVertexAttrib4usv"); + contextPtr->glVertexAttribPointer = (delegate*)load("glVertexAttribPointer"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 2.0 APIs"); + } + + internal static unsafe void LoadGLcore21(GLcontext* contextPtr, delegate* load) + { + if (!core21) + { + InternalIO.InternalAppendLog("The core version 2.1 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glUniformMatrix2x3fv = (delegate*)load("glUniformMatrix2x3fv"); + contextPtr->glUniformMatrix2x4fv = (delegate*)load("glUniformMatrix2x4fv"); + contextPtr->glUniformMatrix3x2fv = (delegate*)load("glUniformMatrix3x2fv"); + contextPtr->glUniformMatrix3x4fv = (delegate*)load("glUniformMatrix3x4fv"); + contextPtr->glUniformMatrix4x2fv = (delegate*)load("glUniformMatrix4x2fv"); + contextPtr->glUniformMatrix4x3fv = (delegate*)load("glUniformMatrix4x3fv"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 2.1 APIs"); + } + + internal static unsafe void LoadGLcore30(GLcontext* contextPtr, delegate* load) + { + if (!core30) + { + InternalIO.InternalAppendLog("The core version 3.0 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glBeginConditionalRender = (delegate*)load("glBeginConditionalRender"); + contextPtr->glBeginTransformFeedback = (delegate*)load("glBeginTransformFeedback"); + contextPtr->glBindBufferBase = (delegate*)load("glBindBufferBase"); + contextPtr->glBindBufferRange = (delegate*)load("glBindBufferRange"); + contextPtr->glBindFragDataLocation = (delegate*)load("glBindFragDataLocation"); + contextPtr->glBindFramebuffer = (delegate*)load("glBindFramebuffer"); + contextPtr->glBindRenderbuffer = (delegate*)load("glBindRenderbuffer"); + contextPtr->glBindVertexArray = (delegate*)load("glBindVertexArray"); + contextPtr->glBlitFramebuffer = (delegate*)load("glBlitFramebuffer"); + contextPtr->glCheckFramebufferStatus = (delegate*)load("glCheckFramebufferStatus"); + contextPtr->glClampColor = (delegate*)load("glClampColor"); + contextPtr->glClearBufferfi = (delegate*)load("glClearBufferfi"); + contextPtr->glClearBufferfv = (delegate*)load("glClearBufferfv"); + contextPtr->glClearBufferiv = (delegate*)load("glClearBufferiv"); + contextPtr->glClearBufferuiv = (delegate*)load("glClearBufferuiv"); + contextPtr->glColorMaski = (delegate*)load("glColorMaski"); + contextPtr->glDeleteFramebuffers = (delegate*)load("glDeleteFramebuffers"); + contextPtr->glDeleteRenderbuffers = (delegate*)load("glDeleteRenderbuffers"); + contextPtr->glDeleteVertexArrays = (delegate*)load("glDeleteVertexArrays"); + contextPtr->glDisablei = (delegate*)load("glDisablei"); + contextPtr->glEnablei = (delegate*)load("glEnablei"); + contextPtr->glEndConditionalRender = (delegate*)load("glEndConditionalRender"); + contextPtr->glEndTransformFeedback = (delegate*)load("glEndTransformFeedback"); + contextPtr->glFlushMappedBufferRange = (delegate*)load("glFlushMappedBufferRange"); + contextPtr->glFramebufferRenderbuffer = (delegate*)load("glFramebufferRenderbuffer"); + contextPtr->glFramebufferTexture1D = (delegate*)load("glFramebufferTexture1D"); + contextPtr->glFramebufferTexture2D = (delegate*)load("glFramebufferTexture2D"); + contextPtr->glFramebufferTexture3D = (delegate*)load("glFramebufferTexture3D"); + contextPtr->glFramebufferTextureLayer = (delegate*)load("glFramebufferTextureLayer"); + contextPtr->glGenFramebuffers = (delegate*)load("glGenFramebuffers"); + contextPtr->glGenRenderbuffers = (delegate*)load("glGenRenderbuffers"); + contextPtr->glGenVertexArrays = (delegate*)load("glGenVertexArrays"); + contextPtr->glGenerateMipmap = (delegate*)load("glGenerateMipmap"); + contextPtr->glGetBooleani_v = (delegate*)load("glGetBooleani_v"); + contextPtr->glGetFragDataLocation = (delegate*)load("glGetFragDataLocation"); + contextPtr->glGetFramebufferAttachmentParameteriv = (delegate*)load("glGetFramebufferAttachmentParameteriv"); + contextPtr->glGetIntegeri_v = (delegate*)load("glGetIntegeri_v"); + contextPtr->glGetRenderbufferParameteriv = (delegate*)load("glGetRenderbufferParameteriv"); + contextPtr->glGetStringi = (delegate*)load("glGetStringi"); + contextPtr->glGetTexParameterIiv = (delegate*)load("glGetTexParameterIiv"); + contextPtr->glGetTexParameterIuiv = (delegate*)load("glGetTexParameterIuiv"); + contextPtr->glGetTransformFeedbackVarying = (delegate*)load("glGetTransformFeedbackVarying"); + contextPtr->glGetUniformuiv = (delegate*)load("glGetUniformuiv"); + contextPtr->glGetVertexAttribIiv = (delegate*)load("glGetVertexAttribIiv"); + contextPtr->glGetVertexAttribIuiv = (delegate*)load("glGetVertexAttribIuiv"); + contextPtr->glIsEnabledi = (delegate*)load("glIsEnabledi"); + contextPtr->glIsFramebuffer = (delegate*)load("glIsFramebuffer"); + contextPtr->glIsRenderbuffer = (delegate*)load("glIsRenderbuffer"); + contextPtr->glIsVertexArray = (delegate*)load("glIsVertexArray"); + contextPtr->glMapBufferRange = (delegate*)load("glMapBufferRange"); + contextPtr->glRenderbufferStorage = (delegate*)load("glRenderbufferStorage"); + contextPtr->glRenderbufferStorageMultisample = (delegate*)load("glRenderbufferStorageMultisample"); + contextPtr->glTexParameterIiv = (delegate*)load("glTexParameterIiv"); + contextPtr->glTexParameterIuiv = (delegate*)load("glTexParameterIuiv"); + contextPtr->glTransformFeedbackVaryings = (delegate*)load("glTransformFeedbackVaryings"); + contextPtr->glUniform1ui = (delegate*)load("glUniform1ui"); + contextPtr->glUniform1uiv = (delegate*)load("glUniform1uiv"); + contextPtr->glUniform2ui = (delegate*)load("glUniform2ui"); + contextPtr->glUniform2uiv = (delegate*)load("glUniform2uiv"); + contextPtr->glUniform3ui = (delegate*)load("glUniform3ui"); + contextPtr->glUniform3uiv = (delegate*)load("glUniform3uiv"); + contextPtr->glUniform4ui = (delegate*)load("glUniform4ui"); + contextPtr->glUniform4uiv = (delegate*)load("glUniform4uiv"); + contextPtr->glVertexAttribI1i = (delegate*)load("glVertexAttribI1i"); + contextPtr->glVertexAttribI1iv = (delegate*)load("glVertexAttribI1iv"); + contextPtr->glVertexAttribI1ui = (delegate*)load("glVertexAttribI1ui"); + contextPtr->glVertexAttribI1uiv = (delegate*)load("glVertexAttribI1uiv"); + contextPtr->glVertexAttribI2i = (delegate*)load("glVertexAttribI2i"); + contextPtr->glVertexAttribI2iv = (delegate*)load("glVertexAttribI2iv"); + contextPtr->glVertexAttribI2ui = (delegate*)load("glVertexAttribI2ui"); + contextPtr->glVertexAttribI2uiv = (delegate*)load("glVertexAttribI2uiv"); + contextPtr->glVertexAttribI3i = (delegate*)load("glVertexAttribI3i"); + contextPtr->glVertexAttribI3iv = (delegate*)load("glVertexAttribI3iv"); + contextPtr->glVertexAttribI3ui = (delegate*)load("glVertexAttribI3ui"); + contextPtr->glVertexAttribI3uiv = (delegate*)load("glVertexAttribI3uiv"); + contextPtr->glVertexAttribI4bv = (delegate*)load("glVertexAttribI4bv"); + contextPtr->glVertexAttribI4i = (delegate*)load("glVertexAttribI4i"); + contextPtr->glVertexAttribI4iv = (delegate*)load("glVertexAttribI4iv"); + contextPtr->glVertexAttribI4sv = (delegate*)load("glVertexAttribI4sv"); + contextPtr->glVertexAttribI4ubv = (delegate*)load("glVertexAttribI4ubv"); + contextPtr->glVertexAttribI4ui = (delegate*)load("glVertexAttribI4ui"); + contextPtr->glVertexAttribI4uiv = (delegate*)load("glVertexAttribI4uiv"); + contextPtr->glVertexAttribI4usv = (delegate*)load("glVertexAttribI4usv"); + contextPtr->glVertexAttribIPointer = (delegate*)load("glVertexAttribIPointer"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 3.0 APIs"); + } + + internal static unsafe void LoadGLcore31(GLcontext* contextPtr, delegate* load) + { + if (!core31) + { + InternalIO.InternalAppendLog("The core version 3.1 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glBindBufferBase = (delegate*)load("glBindBufferBase"); + contextPtr->glBindBufferRange = (delegate*)load("glBindBufferRange"); + contextPtr->glCopyBufferSubData = (delegate*)load("glCopyBufferSubData"); + contextPtr->glDrawArraysInstanced = (delegate*)load("glDrawArraysInstanced"); + contextPtr->glDrawElementsInstanced = (delegate*)load("glDrawElementsInstanced"); + contextPtr->glGetActiveUniformBlockName = (delegate*)load("glGetActiveUniformBlockName"); + contextPtr->glGetActiveUniformBlockiv = (delegate*)load("glGetActiveUniformBlockiv"); + contextPtr->glGetActiveUniformName = (delegate*)load("glGetActiveUniformName"); + contextPtr->glGetActiveUniformsiv = (delegate*)load("glGetActiveUniformsiv"); + contextPtr->glGetIntegeri_v = (delegate*)load("glGetIntegeri_v"); + contextPtr->glGetUniformBlockIndex = (delegate*)load("glGetUniformBlockIndex"); + contextPtr->glGetUniformIndices = (delegate*)load("glGetUniformIndices"); + contextPtr->glPrimitiveRestartIndex = (delegate*)load("glPrimitiveRestartIndex"); + contextPtr->glTexBuffer = (delegate*)load("glTexBuffer"); + contextPtr->glUniformBlockBinding = (delegate*)load("glUniformBlockBinding"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 3.1 APIs"); + } + + internal static unsafe void LoadGLcore32(GLcontext* contextPtr, delegate* load) + { + if (!core32) + { + InternalIO.InternalAppendLog("The core version 3.2 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glClientWaitSync = (delegate*)load("glClientWaitSync"); + contextPtr->glDeleteSync = (delegate*)load("glDeleteSync"); + contextPtr->glDrawElementsBaseVertex = (delegate*)load("glDrawElementsBaseVertex"); + contextPtr->glDrawElementsInstancedBaseVertex = (delegate*)load("glDrawElementsInstancedBaseVertex"); + contextPtr->glDrawRangeElementsBaseVertex = (delegate*)load("glDrawRangeElementsBaseVertex"); + contextPtr->glFenceSync = (delegate*)load("glFenceSync"); + contextPtr->glFramebufferTexture = (delegate*)load("glFramebufferTexture"); + contextPtr->glGetBufferParameteri64v = (delegate*)load("glGetBufferParameteri64v"); + contextPtr->glGetInteger64i_v = (delegate*)load("glGetInteger64i_v"); + contextPtr->glGetInteger64v = (delegate*)load("glGetInteger64v"); + contextPtr->glGetMultisamplefv = (delegate*)load("glGetMultisamplefv"); + contextPtr->glGetSynciv = (delegate*)load("glGetSynciv"); + contextPtr->glIsSync = (delegate*)load("glIsSync"); + contextPtr->glMultiDrawElementsBaseVertex = (delegate*)load("glMultiDrawElementsBaseVertex"); + contextPtr->glProvokingVertex = (delegate*)load("glProvokingVertex"); + contextPtr->glSampleMaski = (delegate*)load("glSampleMaski"); + contextPtr->glTexImage2DMultisample = (delegate*)load("glTexImage2DMultisample"); + contextPtr->glTexImage3DMultisample = (delegate*)load("glTexImage3DMultisample"); + contextPtr->glWaitSync = (delegate*)load("glWaitSync"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 3.2 APIs"); + } + + internal static unsafe void LoadGLcore33(GLcontext* contextPtr, delegate* load) + { + if (!core33) + { + InternalIO.InternalAppendLog("The core version 3.3 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glBindFragDataLocationIndexed = (delegate*)load("glBindFragDataLocationIndexed"); + contextPtr->glBindSampler = (delegate*)load("glBindSampler"); + contextPtr->glDeleteSamplers = (delegate*)load("glDeleteSamplers"); + contextPtr->glGenSamplers = (delegate*)load("glGenSamplers"); + contextPtr->glGetFragDataIndex = (delegate*)load("glGetFragDataIndex"); + contextPtr->glGetQueryObjecti64v = (delegate*)load("glGetQueryObjecti64v"); + contextPtr->glGetQueryObjectui64v = (delegate*)load("glGetQueryObjectui64v"); + contextPtr->glGetSamplerParameterIiv = (delegate*)load("glGetSamplerParameterIiv"); + contextPtr->glGetSamplerParameterIuiv = (delegate*)load("glGetSamplerParameterIuiv"); + contextPtr->glGetSamplerParameterfv = (delegate*)load("glGetSamplerParameterfv"); + contextPtr->glGetSamplerParameteriv = (delegate*)load("glGetSamplerParameteriv"); + contextPtr->glIsSampler = (delegate*)load("glIsSampler"); + contextPtr->glQueryCounter = (delegate*)load("glQueryCounter"); + contextPtr->glSamplerParameterIiv = (delegate*)load("glSamplerParameterIiv"); + contextPtr->glSamplerParameterIuiv = (delegate*)load("glSamplerParameterIuiv"); + contextPtr->glSamplerParameterf = (delegate*)load("glSamplerParameterf"); + contextPtr->glSamplerParameterfv = (delegate*)load("glSamplerParameterfv"); + contextPtr->glSamplerParameteri = (delegate*)load("glSamplerParameteri"); + contextPtr->glSamplerParameteriv = (delegate*)load("glSamplerParameteriv"); + contextPtr->glVertexAttribDivisor = (delegate*)load("glVertexAttribDivisor"); + contextPtr->glVertexAttribP1ui = (delegate*)load("glVertexAttribP1ui"); + contextPtr->glVertexAttribP1uiv = (delegate*)load("glVertexAttribP1uiv"); + contextPtr->glVertexAttribP2ui = (delegate*)load("glVertexAttribP2ui"); + contextPtr->glVertexAttribP2uiv = (delegate*)load("glVertexAttribP2uiv"); + contextPtr->glVertexAttribP3ui = (delegate*)load("glVertexAttribP3ui"); + contextPtr->glVertexAttribP3uiv = (delegate*)load("glVertexAttribP3uiv"); + contextPtr->glVertexAttribP4ui = (delegate*)load("glVertexAttribP4ui"); + contextPtr->glVertexAttribP4uiv = (delegate*)load("glVertexAttribP4uiv"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 3.3 APIs"); + } + + internal static unsafe void LoadGLcore40(GLcontext* contextPtr, delegate* load) + { + if (!core40) + { + InternalIO.InternalAppendLog("The core version 4.0 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glBeginQueryIndexed = (delegate*)load("glBeginQueryIndexed"); + contextPtr->glBindTransformFeedback = (delegate*)load("glBindTransformFeedback"); + contextPtr->glBlendEquationSeparatei = (delegate*)load("glBlendEquationSeparatei"); + contextPtr->glBlendEquationi = (delegate*)load("glBlendEquationi"); + contextPtr->glBlendFuncSeparatei = (delegate*)load("glBlendFuncSeparatei"); + contextPtr->glBlendFunci = (delegate*)load("glBlendFunci"); + contextPtr->glDeleteTransformFeedbacks = (delegate*)load("glDeleteTransformFeedbacks"); + contextPtr->glDrawArraysIndirect = (delegate*)load("glDrawArraysIndirect"); + contextPtr->glDrawElementsIndirect = (delegate*)load("glDrawElementsIndirect"); + contextPtr->glDrawTransformFeedback = (delegate*)load("glDrawTransformFeedback"); + contextPtr->glDrawTransformFeedbackStream = (delegate*)load("glDrawTransformFeedbackStream"); + contextPtr->glEndQueryIndexed = (delegate*)load("glEndQueryIndexed"); + contextPtr->glGenTransformFeedbacks = (delegate*)load("glGenTransformFeedbacks"); + contextPtr->glGetActiveSubroutineName = (delegate*)load("glGetActiveSubroutineName"); + contextPtr->glGetActiveSubroutineUniformName = (delegate*)load("glGetActiveSubroutineUniformName"); + contextPtr->glGetActiveSubroutineUniformiv = (delegate*)load("glGetActiveSubroutineUniformiv"); + contextPtr->glGetProgramStageiv = (delegate*)load("glGetProgramStageiv"); + contextPtr->glGetQueryIndexediv = (delegate*)load("glGetQueryIndexediv"); + contextPtr->glGetSubroutineIndex = (delegate*)load("glGetSubroutineIndex"); + contextPtr->glGetSubroutineUniformLocation = (delegate*)load("glGetSubroutineUniformLocation"); + contextPtr->glGetUniformSubroutineuiv = (delegate*)load("glGetUniformSubroutineuiv"); + contextPtr->glGetUniformdv = (delegate*)load("glGetUniformdv"); + contextPtr->glIsTransformFeedback = (delegate*)load("glIsTransformFeedback"); + contextPtr->glMinSampleShading = (delegate*)load("glMinSampleShading"); + contextPtr->glPatchParameterfv = (delegate*)load("glPatchParameterfv"); + contextPtr->glPatchParameteri = (delegate*)load("glPatchParameteri"); + contextPtr->glPauseTransformFeedback = (delegate*)load("glPauseTransformFeedback"); + contextPtr->glResumeTransformFeedback = (delegate*)load("glResumeTransformFeedback"); + contextPtr->glUniform1d = (delegate*)load("glUniform1d"); + contextPtr->glUniform1dv = (delegate*)load("glUniform1dv"); + contextPtr->glUniform2d = (delegate*)load("glUniform2d"); + contextPtr->glUniform2dv = (delegate*)load("glUniform2dv"); + contextPtr->glUniform3d = (delegate*)load("glUniform3d"); + contextPtr->glUniform3dv = (delegate*)load("glUniform3dv"); + contextPtr->glUniform4d = (delegate*)load("glUniform4d"); + contextPtr->glUniform4dv = (delegate*)load("glUniform4dv"); + contextPtr->glUniformMatrix2dv = (delegate*)load("glUniformMatrix2dv"); + contextPtr->glUniformMatrix2x3dv = (delegate*)load("glUniformMatrix2x3dv"); + contextPtr->glUniformMatrix2x4dv = (delegate*)load("glUniformMatrix2x4dv"); + contextPtr->glUniformMatrix3dv = (delegate*)load("glUniformMatrix3dv"); + contextPtr->glUniformMatrix3x2dv = (delegate*)load("glUniformMatrix3x2dv"); + contextPtr->glUniformMatrix3x4dv = (delegate*)load("glUniformMatrix3x4dv"); + contextPtr->glUniformMatrix4dv = (delegate*)load("glUniformMatrix4dv"); + contextPtr->glUniformMatrix4x2dv = (delegate*)load("glUniformMatrix4x2dv"); + contextPtr->glUniformMatrix4x3dv = (delegate*)load("glUniformMatrix4x3dv"); + contextPtr->glUniformSubroutinesuiv = (delegate*)load("glUniformSubroutinesuiv"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 4.0 APIs"); + } + + internal static unsafe void LoadGLcore41(GLcontext* contextPtr, delegate* load) + { + if (!core41) + { + InternalIO.InternalAppendLog("The core version 4.1 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glActiveShaderProgram = (delegate*)load("glActiveShaderProgram"); + contextPtr->glBindProgramPipeline = (delegate*)load("glBindProgramPipeline"); + contextPtr->glClearDepthf = (delegate*)load("glClearDepthf"); + contextPtr->glCreateShaderProgramv = (delegate*)load("glCreateShaderProgramv"); + contextPtr->glDeleteProgramPipelines = (delegate*)load("glDeleteProgramPipelines"); + contextPtr->glDepthRangeArrayv = (delegate*)load("glDepthRangeArrayv"); + contextPtr->glDepthRangeIndexed = (delegate*)load("glDepthRangeIndexed"); + contextPtr->glDepthRangef = (delegate*)load("glDepthRangef"); + contextPtr->glGenProgramPipelines = (delegate*)load("glGenProgramPipelines"); + contextPtr->glGetDoublei_v = (delegate*)load("glGetDoublei_v"); + contextPtr->glGetFloati_v = (delegate*)load("glGetFloati_v"); + contextPtr->glGetProgramBinary = (delegate*)load("glGetProgramBinary"); + contextPtr->glGetProgramPipelineInfoLog = (delegate*)load("glGetProgramPipelineInfoLog"); + contextPtr->glGetProgramPipelineiv = (delegate*)load("glGetProgramPipelineiv"); + contextPtr->glGetShaderPrecisionFormat = (delegate*)load("glGetShaderPrecisionFormat"); + contextPtr->glGetVertexAttribLdv = (delegate*)load("glGetVertexAttribLdv"); + contextPtr->glIsProgramPipeline = (delegate*)load("glIsProgramPipeline"); + contextPtr->glProgramBinary = (delegate*)load("glProgramBinary"); + contextPtr->glProgramParameteri = (delegate*)load("glProgramParameteri"); + contextPtr->glProgramUniform1d = (delegate*)load("glProgramUniform1d"); + contextPtr->glProgramUniform1dv = (delegate*)load("glProgramUniform1dv"); + contextPtr->glProgramUniform1f = (delegate*)load("glProgramUniform1f"); + contextPtr->glProgramUniform1fv = (delegate*)load("glProgramUniform1fv"); + contextPtr->glProgramUniform1i = (delegate*)load("glProgramUniform1i"); + contextPtr->glProgramUniform1iv = (delegate*)load("glProgramUniform1iv"); + contextPtr->glProgramUniform1ui = (delegate*)load("glProgramUniform1ui"); + contextPtr->glProgramUniform1uiv = (delegate*)load("glProgramUniform1uiv"); + contextPtr->glProgramUniform2d = (delegate*)load("glProgramUniform2d"); + contextPtr->glProgramUniform2dv = (delegate*)load("glProgramUniform2dv"); + contextPtr->glProgramUniform2f = (delegate*)load("glProgramUniform2f"); + contextPtr->glProgramUniform2fv = (delegate*)load("glProgramUniform2fv"); + contextPtr->glProgramUniform2i = (delegate*)load("glProgramUniform2i"); + contextPtr->glProgramUniform2iv = (delegate*)load("glProgramUniform2iv"); + contextPtr->glProgramUniform2ui = (delegate*)load("glProgramUniform2ui"); + contextPtr->glProgramUniform2uiv = (delegate*)load("glProgramUniform2uiv"); + contextPtr->glProgramUniform3d = (delegate*)load("glProgramUniform3d"); + contextPtr->glProgramUniform3dv = (delegate*)load("glProgramUniform3dv"); + contextPtr->glProgramUniform3f = (delegate*)load("glProgramUniform3f"); + contextPtr->glProgramUniform3fv = (delegate*)load("glProgramUniform3fv"); + contextPtr->glProgramUniform3i = (delegate*)load("glProgramUniform3i"); + contextPtr->glProgramUniform3iv = (delegate*)load("glProgramUniform3iv"); + contextPtr->glProgramUniform3ui = (delegate*)load("glProgramUniform3ui"); + contextPtr->glProgramUniform3uiv = (delegate*)load("glProgramUniform3uiv"); + contextPtr->glProgramUniform4d = (delegate*)load("glProgramUniform4d"); + contextPtr->glProgramUniform4dv = (delegate*)load("glProgramUniform4dv"); + contextPtr->glProgramUniform4f = (delegate*)load("glProgramUniform4f"); + contextPtr->glProgramUniform4fv = (delegate*)load("glProgramUniform4fv"); + contextPtr->glProgramUniform4i = (delegate*)load("glProgramUniform4i"); + contextPtr->glProgramUniform4iv = (delegate*)load("glProgramUniform4iv"); + contextPtr->glProgramUniform4ui = (delegate*)load("glProgramUniform4ui"); + contextPtr->glProgramUniform4uiv = (delegate*)load("glProgramUniform4uiv"); + contextPtr->glProgramUniformMatrix2dv = (delegate*)load("glProgramUniformMatrix2dv"); + contextPtr->glProgramUniformMatrix2fv = (delegate*)load("glProgramUniformMatrix2fv"); + contextPtr->glProgramUniformMatrix2x3dv = (delegate*)load("glProgramUniformMatrix2x3dv"); + contextPtr->glProgramUniformMatrix2x3fv = (delegate*)load("glProgramUniformMatrix2x3fv"); + contextPtr->glProgramUniformMatrix2x4dv = (delegate*)load("glProgramUniformMatrix2x4dv"); + contextPtr->glProgramUniformMatrix2x4fv = (delegate*)load("glProgramUniformMatrix2x4fv"); + contextPtr->glProgramUniformMatrix3dv = (delegate*)load("glProgramUniformMatrix3dv"); + contextPtr->glProgramUniformMatrix3fv = (delegate*)load("glProgramUniformMatrix3fv"); + contextPtr->glProgramUniformMatrix3x2dv = (delegate*)load("glProgramUniformMatrix3x2dv"); + contextPtr->glProgramUniformMatrix3x2fv = (delegate*)load("glProgramUniformMatrix3x2fv"); + contextPtr->glProgramUniformMatrix3x4dv = (delegate*)load("glProgramUniformMatrix3x4dv"); + contextPtr->glProgramUniformMatrix3x4fv = (delegate*)load("glProgramUniformMatrix3x4fv"); + contextPtr->glProgramUniformMatrix4dv = (delegate*)load("glProgramUniformMatrix4dv"); + contextPtr->glProgramUniformMatrix4fv = (delegate*)load("glProgramUniformMatrix4fv"); + contextPtr->glProgramUniformMatrix4x2dv = (delegate*)load("glProgramUniformMatrix4x2dv"); + contextPtr->glProgramUniformMatrix4x2fv = (delegate*)load("glProgramUniformMatrix4x2fv"); + contextPtr->glProgramUniformMatrix4x3dv = (delegate*)load("glProgramUniformMatrix4x3dv"); + contextPtr->glProgramUniformMatrix4x3fv = (delegate*)load("glProgramUniformMatrix4x3fv"); + contextPtr->glReleaseShaderCompiler = (delegate*)load("glReleaseShaderCompiler"); + contextPtr->glScissorArrayv = (delegate*)load("glScissorArrayv"); + contextPtr->glScissorIndexed = (delegate*)load("glScissorIndexed"); + contextPtr->glScissorIndexedv = (delegate*)load("glScissorIndexedv"); + contextPtr->glShaderBinary = (delegate*)load("glShaderBinary"); + contextPtr->glUseProgramStages = (delegate*)load("glUseProgramStages"); + contextPtr->glValidateProgramPipeline = (delegate*)load("glValidateProgramPipeline"); + contextPtr->glVertexAttribL1d = (delegate*)load("glVertexAttribL1d"); + contextPtr->glVertexAttribL1dv = (delegate*)load("glVertexAttribL1dv"); + contextPtr->glVertexAttribL2d = (delegate*)load("glVertexAttribL2d"); + contextPtr->glVertexAttribL2dv = (delegate*)load("glVertexAttribL2dv"); + contextPtr->glVertexAttribL3d = (delegate*)load("glVertexAttribL3d"); + contextPtr->glVertexAttribL3dv = (delegate*)load("glVertexAttribL3dv"); + contextPtr->glVertexAttribL4d = (delegate*)load("glVertexAttribL4d"); + contextPtr->glVertexAttribL4dv = (delegate*)load("glVertexAttribL4dv"); + contextPtr->glVertexAttribLPointer = (delegate*)load("glVertexAttribLPointer"); + contextPtr->glViewportArrayv = (delegate*)load("glViewportArrayv"); + contextPtr->glViewportIndexedf = (delegate*)load("glViewportIndexedf"); + contextPtr->glViewportIndexedfv = (delegate*)load("glViewportIndexedfv"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 4.1 APIs"); + } + + internal static unsafe void LoadGLcore42(GLcontext* contextPtr, delegate* load) + { + if (!core42) + { + InternalIO.InternalAppendLog("The core version 4.2 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glBindImageTexture = (delegate*)load("glBindImageTexture"); + contextPtr->glDrawArraysInstancedBaseInstance = (delegate*)load("glDrawArraysInstancedBaseInstance"); + contextPtr->glDrawElementsInstancedBaseInstance = (delegate*)load("glDrawElementsInstancedBaseInstance"); + contextPtr->glDrawElementsInstancedBaseVertexBaseInstance = (delegate*)load("glDrawElementsInstancedBaseVertexBaseInstance"); + contextPtr->glDrawTransformFeedbackInstanced = (delegate*)load("glDrawTransformFeedbackInstanced"); + contextPtr->glDrawTransformFeedbackStreamInstanced = (delegate*)load("glDrawTransformFeedbackStreamInstanced"); + contextPtr->glGetActiveAtomicCounterBufferiv = (delegate*)load("glGetActiveAtomicCounterBufferiv"); + contextPtr->glGetInternalformativ = (delegate*)load("glGetInternalformativ"); + contextPtr->glMemoryBarrier = (delegate*)load("glMemoryBarrier"); + contextPtr->glTexStorage1D = (delegate*)load("glTexStorage1D"); + contextPtr->glTexStorage2D = (delegate*)load("glTexStorage2D"); + contextPtr->glTexStorage3D = (delegate*)load("glTexStorage3D"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 4.2 APIs"); + } + + internal static unsafe void LoadGLcore43(GLcontext* contextPtr, delegate* load) + { + if (!core43) + { + InternalIO.InternalAppendLog("The core version 4.3 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glBindVertexBuffer = (delegate*)load("glBindVertexBuffer"); + contextPtr->glClearBufferData = (delegate*)load("glClearBufferData"); + contextPtr->glClearBufferSubData = (delegate*)load("glClearBufferSubData"); + contextPtr->glCopyImageSubData = (delegate*)load("glCopyImageSubData"); + contextPtr->glDebugMessageCallback = (delegate*)load("glDebugMessageCallback"); + contextPtr->glDebugMessageControl = (delegate*)load("glDebugMessageControl"); + contextPtr->glDebugMessageInsert = (delegate*)load("glDebugMessageInsert"); + contextPtr->glDispatchCompute = (delegate*)load("glDispatchCompute"); + contextPtr->glDispatchComputeIndirect = (delegate*)load("glDispatchComputeIndirect"); + contextPtr->glFramebufferParameteri = (delegate*)load("glFramebufferParameteri"); + contextPtr->glGetDebugMessageLog = (delegate*)load("glGetDebugMessageLog"); + contextPtr->glGetFramebufferParameteriv = (delegate*)load("glGetFramebufferParameteriv"); + contextPtr->glGetInternalformati64v = (delegate*)load("glGetInternalformati64v"); + contextPtr->glGetObjectLabel = (delegate*)load("glGetObjectLabel"); + contextPtr->glGetObjectPtrLabel = (delegate*)load("glGetObjectPtrLabel"); + contextPtr->glGetPointerv = (delegate*)load("glGetPointerv"); + contextPtr->glGetProgramInterfaceiv = (delegate*)load("glGetProgramInterfaceiv"); + contextPtr->glGetProgramResourceIndex = (delegate*)load("glGetProgramResourceIndex"); + contextPtr->glGetProgramResourceLocation = (delegate*)load("glGetProgramResourceLocation"); + contextPtr->glGetProgramResourceLocationIndex = (delegate*)load("glGetProgramResourceLocationIndex"); + contextPtr->glGetProgramResourceName = (delegate*)load("glGetProgramResourceName"); + contextPtr->glGetProgramResourceiv = (delegate*)load("glGetProgramResourceiv"); + contextPtr->glInvalidateBufferData = (delegate*)load("glInvalidateBufferData"); + contextPtr->glInvalidateBufferSubData = (delegate*)load("glInvalidateBufferSubData"); + contextPtr->glInvalidateFramebuffer = (delegate*)load("glInvalidateFramebuffer"); + contextPtr->glInvalidateSubFramebuffer = (delegate*)load("glInvalidateSubFramebuffer"); + contextPtr->glInvalidateTexImage = (delegate*)load("glInvalidateTexImage"); + contextPtr->glInvalidateTexSubImage = (delegate*)load("glInvalidateTexSubImage"); + contextPtr->glMultiDrawArraysIndirect = (delegate*)load("glMultiDrawArraysIndirect"); + contextPtr->glMultiDrawElementsIndirect = (delegate*)load("glMultiDrawElementsIndirect"); + contextPtr->glObjectLabel = (delegate*)load("glObjectLabel"); + contextPtr->glObjectPtrLabel = (delegate*)load("glObjectPtrLabel"); + contextPtr->glPopDebugGroup = (delegate*)load("glPopDebugGroup"); + contextPtr->glPushDebugGroup = (delegate*)load("glPushDebugGroup"); + contextPtr->glShaderStorageBlockBinding = (delegate*)load("glShaderStorageBlockBinding"); + contextPtr->glTexBufferRange = (delegate*)load("glTexBufferRange"); + contextPtr->glTexStorage2DMultisample = (delegate*)load("glTexStorage2DMultisample"); + contextPtr->glTexStorage3DMultisample = (delegate*)load("glTexStorage3DMultisample"); + contextPtr->glTextureView = (delegate*)load("glTextureView"); + contextPtr->glVertexAttribBinding = (delegate*)load("glVertexAttribBinding"); + contextPtr->glVertexAttribFormat = (delegate*)load("glVertexAttribFormat"); + contextPtr->glVertexAttribIFormat = (delegate*)load("glVertexAttribIFormat"); + contextPtr->glClearBufferData = (delegate*)load("glClearBufferData"); + contextPtr->glVertexBindingDivisor = (delegate*)load("glVertexBindingDivisor"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 4.3 APIs"); + } + + internal static unsafe void LoadGLcore44(GLcontext* contextPtr, delegate* load) + { + if (!core44) + { + InternalIO.InternalAppendLog("The core version 4.4 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glBindBuffersBase = (delegate*)load("glBindBuffersBase"); + contextPtr->glBindBuffersRange = (delegate*)load("glBindBuffersRange"); + contextPtr->glBindImageTextures = (delegate*)load("glBindImageTextures"); + contextPtr->glBindSamplers = (delegate*)load("glBindSamplers"); + contextPtr->glBindTextures = (delegate*)load("glBindTextures"); + contextPtr->glBindVertexBuffers = (delegate*)load("glBindVertexBuffers"); + contextPtr->glBufferStorage = (delegate*)load("glBufferStorage"); + contextPtr->glClearTexImage = (delegate*)load("glClearTexImage"); + contextPtr->glClearTexSubImage = (delegate*)load("glClearTexSubImage"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 4.4 APIs"); + } + + internal static unsafe void LoadGLcore45(GLcontext* contextPtr, delegate* load) + { + if (!core45) + { + InternalIO.InternalAppendLog("The core version 4.5 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glBindTextureUnit = (delegate*)load("glBindTextureUnit"); + contextPtr->glBlitNamedFramebuffer = (delegate*)load("glBlitNamedFramebuffer"); + contextPtr->glCheckNamedFramebufferStatus = (delegate*)load("glCheckNamedFramebufferStatus"); + contextPtr->glClearNamedBufferData = (delegate*)load("glClearNamedBufferData"); + contextPtr->glClearNamedBufferSubData = (delegate*)load("glClearNamedBufferSubData"); + contextPtr->glClearNamedFramebufferfi = (delegate*)load("glClearNamedFramebufferfi"); + contextPtr->glClearNamedFramebufferfv = (delegate*)load("glClearNamedFramebufferfv"); + contextPtr->glClearNamedFramebufferiv = (delegate*)load("glClearNamedFramebufferiv"); + contextPtr->glClearNamedFramebufferuiv = (delegate*)load("glClearNamedFramebufferuiv"); + contextPtr->glClipControl = (delegate*)load("glClipControl"); + contextPtr->glCompressedTextureSubImage1D = (delegate*)load("glCompressedTextureSubImage1D"); + contextPtr->glCompressedTextureSubImage2D = (delegate*)load("glCompressedTextureSubImage2D"); + contextPtr->glCompressedTextureSubImage3D = (delegate*)load("glCompressedTextureSubImage3D"); + contextPtr->glCopyNamedBufferSubData = (delegate*)load("glCopyNamedBufferSubData"); + contextPtr->glCopyTextureSubImage1D = (delegate*)load("glCopyTextureSubImage1D"); + contextPtr->glCopyTextureSubImage2D = (delegate*)load("glCopyTextureSubImage2D"); + contextPtr->glCopyTextureSubImage3D = (delegate*)load("glCopyTextureSubImage3D"); + contextPtr->glCreateBuffers = (delegate*)load("glCreateBuffers"); + contextPtr->glCreateFramebuffers = (delegate*)load("glCreateFramebuffers"); + contextPtr->glCreateProgramPipelines = (delegate*)load("glCreateProgramPipelines"); + contextPtr->glCreateQueries = (delegate*)load("glCreateQueries"); + contextPtr->glCreateRenderbuffers = (delegate*)load("glCreateRenderbuffers"); + contextPtr->glCreateSamplers = (delegate*)load("glCreateSamplers"); + contextPtr->glCreateTextures = (delegate*)load("glCreateTextures"); + contextPtr->glCreateTransformFeedbacks = (delegate*)load("glCreateTransformFeedbacks"); + contextPtr->glCreateVertexArrays = (delegate*)load("glCreateVertexArrays"); + contextPtr->glDisableVertexArrayAttrib = (delegate*)load("glDisableVertexArrayAttrib"); + contextPtr->glEnableVertexArrayAttrib = (delegate*)load("glEnableVertexArrayAttrib"); + contextPtr->glFlushMappedNamedBufferRange = (delegate*)load("glFlushMappedNamedBufferRange"); + contextPtr->glGenerateTextureMipmap = (delegate*)load("glGenerateTextureMipmap"); + contextPtr->glGetCompressedTextureImage = (delegate*)load("glGetCompressedTextureImage"); + contextPtr->glGetCompressedTextureSubImage = (delegate*)load("glGetCompressedTextureSubImage"); + contextPtr->glGetGraphicsResetStatus = (delegate*)load("glGetGraphicsResetStatus"); + contextPtr->glGetNamedBufferParameteri64v = (delegate*)load("glGetNamedBufferParameteri64v"); + contextPtr->glGetNamedBufferParameteriv = (delegate*)load("glGetNamedBufferParameteriv"); + contextPtr->glGetNamedBufferPointerv = (delegate*)load("glGetNamedBufferPointerv"); + contextPtr->glGetNamedBufferSubData = (delegate*)load("glGetNamedBufferSubData"); + contextPtr->glGetNamedFramebufferAttachmentParameteriv = (delegate*)load("glGetNamedFramebufferAttachmentParameteriv"); + contextPtr->glGetNamedFramebufferParameteriv = (delegate*)load("glGetNamedFramebufferParameteriv"); + contextPtr->glGetNamedRenderbufferParameteriv = (delegate*)load("glGetNamedRenderbufferParameteriv"); + contextPtr->glGetQueryBufferObjecti64v = (delegate*)load("glGetQueryBufferObjecti64v"); + contextPtr->glGetQueryBufferObjectiv = (delegate*)load("glGetQueryBufferObjectiv"); + contextPtr->glGetQueryBufferObjectui64v = (delegate*)load("glGetQueryBufferObjectui64v"); + contextPtr->glGetQueryBufferObjectuiv = (delegate*)load("glGetQueryBufferObjectuiv"); + contextPtr->glGetTextureImage = (delegate*)load("glGetTextureImage"); + contextPtr->glGetTextureLevelParameterfv = (delegate*)load("glGetTextureLevelParameterfv"); + contextPtr->glGetTextureLevelParameteriv = (delegate*)load("glGetTextureLevelParameteriv"); + contextPtr->glGetTextureParameterIiv = (delegate*)load("glGetTextureParameterIiv"); + contextPtr->glGetTextureParameterIuiv = (delegate*)load("glGetTextureParameterIuiv"); + contextPtr->glGetTextureParameterfv = (delegate*)load("glGetTextureParameterfv"); + contextPtr->glGetTextureParameteriv = (delegate*)load("glGetTextureParameteriv"); + contextPtr->glGetTextureSubImage = (delegate*)load("glGetTextureSubImage"); + contextPtr->glGetTransformFeedbacki64_v = (delegate*)load("glGetTransformFeedbacki64_v"); + contextPtr->glGetTransformFeedbacki_v = (delegate*)load("glGetTransformFeedbacki_v"); + contextPtr->glGetTransformFeedbackiv = (delegate*)load("glGetTransformFeedbackiv"); + contextPtr->glGetVertexArrayIndexed64iv = (delegate*)load("glGetVertexArrayIndexed64iv"); + contextPtr->glGetVertexArrayIndexediv = (delegate*)load("glGetVertexArrayIndexediv"); + contextPtr->glGetVertexArrayiv = (delegate*)load("glGetVertexArrayiv"); + contextPtr->glGetnCompressedTexImage = (delegate*)load("glGetnCompressedTexImage"); + contextPtr->glGetnTexImage = (delegate*)load("glGetnTexImage"); + contextPtr->glGetnUniformdv = (delegate*)load("glGetnUniformdv"); + contextPtr->glGetnUniformfv = (delegate*)load("glGetnUniformfv"); + contextPtr->glGetnUniformiv = (delegate*)load("glGetnUniformiv"); + contextPtr->glGetnUniformuiv = (delegate*)load("glGetnUniformuiv"); + contextPtr->glInvalidateNamedFramebufferData = (delegate*)load("glInvalidateNamedFramebufferData"); + contextPtr->glInvalidateNamedFramebufferSubData = (delegate*)load("glInvalidateNamedFramebufferSubData"); + contextPtr->glMapNamedBuffer = (delegate*)load("glMapNamedBuffer"); + contextPtr->glMapNamedBufferRange = (delegate*)load("glMapNamedBufferRange"); + contextPtr->glMemoryBarrierByRegion = (delegate*)load("glMemoryBarrierByRegion"); + contextPtr->glNamedBufferData = (delegate*)load("glNamedBufferData"); + contextPtr->glNamedBufferStorage = (delegate*)load("glNamedBufferStorage"); + contextPtr->glNamedBufferSubData = (delegate*)load("glNamedBufferSubData"); + contextPtr->glNamedFramebufferDrawBuffer = (delegate*)load("glNamedFramebufferDrawBuffer"); + contextPtr->glNamedFramebufferDrawBuffers = (delegate*)load("glNamedFramebufferDrawBuffers"); + contextPtr->glNamedFramebufferParameteri = (delegate*)load("glNamedFramebufferParameteri"); + contextPtr->glNamedFramebufferReadBuffer = (delegate*)load("glNamedFramebufferReadBuffer"); + contextPtr->glNamedFramebufferRenderbuffer = (delegate*)load("glNamedFramebufferRenderbuffer"); + contextPtr->glNamedFramebufferTexture = (delegate*)load("glNamedFramebufferTexture"); + contextPtr->glNamedFramebufferTextureLayer = (delegate*)load("glNamedFramebufferTextureLayer"); + contextPtr->glNamedRenderbufferStorage = (delegate*)load("glNamedRenderbufferStorage"); + contextPtr->glNamedRenderbufferStorageMultisample = (delegate*)load("glNamedRenderbufferStorageMultisample"); + contextPtr->glReadnPixels = (delegate*)load("glReadnPixels"); + contextPtr->glTextureBarrier = (delegate*)load("glTextureBarrier"); + contextPtr->glTextureBuffer = (delegate*)load("glTextureBuffer"); + contextPtr->glTextureBufferRange = (delegate*)load("glTextureBufferRange"); + contextPtr->glTextureParameterIiv = (delegate*)load("glTextureParameterIiv"); + contextPtr->glTextureParameterIuiv = (delegate*)load("glTextureParameterIuiv"); + contextPtr->glTextureParameterf = (delegate*)load("glTextureParameterf"); + contextPtr->glTextureParameterfv = (delegate*)load("glTextureParameterfv"); + contextPtr->glTextureParameteri = (delegate*)load("glTextureParameteri"); + contextPtr->glTextureParameteriv = (delegate*)load("glTextureParameteriv"); + contextPtr->glTextureStorage1D = (delegate*)load("glTextureStorage1D"); + contextPtr->glTextureStorage2D = (delegate*)load("glTextureStorage2D"); + contextPtr->glTextureStorage2DMultisample = (delegate*)load("glTextureStorage2DMultisample"); + contextPtr->glTextureStorage3D = (delegate*)load("glTextureStorage3D"); + contextPtr->glTextureStorage3DMultisample = (delegate*)load("glTextureStorage3DMultisample"); + contextPtr->glTextureSubImage1D = (delegate*)load("glTextureSubImage1D"); + contextPtr->glTextureSubImage2D = (delegate*)load("glTextureSubImage2D"); + contextPtr->glTextureSubImage3D = (delegate*)load("glTextureSubImage3D"); + contextPtr->glTransformFeedbackBufferBase = (delegate*)load("glTransformFeedbackBufferBase"); + contextPtr->glTransformFeedbackBufferRange = (delegate*)load("glTransformFeedbackBufferRange"); + contextPtr->glUnmapNamedBuffer = (delegate*)load("glUnmapNamedBuffer"); + contextPtr->glVertexArrayAttribBinding = (delegate*)load("glVertexArrayAttribBinding"); + contextPtr->glVertexArrayAttribFormat = (delegate*)load("glVertexArrayAttribFormat"); + contextPtr->glVertexArrayAttribIFormat = (delegate*)load("glVertexArrayAttribIFormat"); + contextPtr->glVertexArrayAttribLFormat = (delegate*)load("glVertexArrayAttribLFormat"); + contextPtr->glVertexArrayBindingDivisor = (delegate*)load("glVertexArrayBindingDivisor"); + contextPtr->glVertexArrayElementBuffer = (delegate*)load("glVertexArrayElementBuffer"); + contextPtr->glVertexArrayVertexBuffer = (delegate*)load("glVertexArrayVertexBuffer"); + contextPtr->glVertexArrayVertexBuffers = (delegate*)load("glVertexArrayVertexBuffers"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 4.5 APIs"); + } + + internal static unsafe void LoadGLcore46(GLcontext* contextPtr, delegate* load) + { + if (!core46) + { + InternalIO.InternalAppendLog("The core version 4.6 is not supported."); + throw new Exception("Final Version"); + } + + #region load + + contextPtr->glMultiDrawArraysIndirectCount = (delegate*)load("glMultiDrawArraysIndirectCount"); + contextPtr->glMultiDrawElementsIndirectCount = (delegate*)load("glMultiDrawElementsIndirectCount"); + contextPtr->glPolygonOffsetClamp = (delegate*)load("glPolygonOffsetClamp"); + contextPtr->glSpecializeShader = (delegate*)load("glSpecializeShader"); + + #endregion load + + InternalIO.InternalAppendLog("Successfully load all OpenGL 4.6 APIs"); + } + + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Graphics/GL/glApiManagerConst.cs b/源代码/StgSharpDebug/Graphics/GL/glApiManagerConst.cs new file mode 100644 index 00000000..6000633a --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/GL/glApiManagerConst.cs @@ -0,0 +1,689 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="glApiManagerConst.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Graphics.GL +{ + public static partial class glManager + { + #region coreVersion + + private static bool core10 = false; + private static bool core11 = false; + private static bool core12 = false; + private static bool core13 = false; + private static bool core14 = false; + private static bool core15 = false; + private static bool core20 = false; + private static bool core21 = false; + private static bool core30 = false; + private static bool core31 = false; + private static bool core32 = false; + private static bool core33 = false; + private static bool core40 = false; + private static bool core41 = false; + private static bool core42 = false; + private static bool core43 = false; + private static bool core44 = false; + private static bool core45 = false; + private static bool core46 = false; + + #endregion + + #region extension + + private static bool _3DFX_tbuffer; + private static bool _3DFX_texture_compression_FXT1; + private static bool _4DFX_multisample; + private static bool AMD_blend_minmax_factor; + private static bool AMD_conservative_depth; + private static bool AMD_debug_output; + private static bool AMD_depth_clamp_separate; + private static bool AMD_draw_buffers_blend; + private static bool AMD_framebuffer_multisample_advanced; + private static bool AMD_framebuffer_sample_positions; + private static bool AMD_gcn_shader; + private static bool AMD_gpu_shader_half_float; + private static bool AMD_gpu_shader_int16; + private static bool AMD_gpu_shader_int64; + private static bool AMD_interleaved_elements; + private static bool AMD_multi_draw_indirect; + private static bool AMD_name_gen_delete; + private static bool AMD_occlusion_query_event; + private static bool AMD_performance_monitor; + private static bool AMD_pinned_memory; + private static bool AMD_query_buffer_object; + private static bool AMD_sample_positions; + private static bool AMD_seamless_cubemap_per_texture; + private static bool AMD_shader_atomic_counter_ops; + private static bool AMD_shader_ballot; + private static bool AMD_shader_explicit_vertex_parameter; + private static bool AMD_shader_gpu_shader_half_float_fetch; + private static bool AMD_shader_image_load_store_lod; + private static bool AMD_shader_stencil_export; + private static bool AMD_shader_trinary_minmax; + private static bool AMD_sparse_texture; + private static bool AMD_stencil_operation_extended; + private static bool AMD_texture_gather_bias_lod; + private static bool AMD_texture_texture4; + private static bool AMD_transform_feedback3_lines_triangles; + private static bool AMD_transform_feedback4; + private static bool AMD_vertex_shader_layer; + private static bool AMD_vertex_shader_tessellator; + private static bool AMD_vertex_shader_viewport_index; + private static bool APPLE_aux_depth_stencil; + private static bool APPLE_client_storage; + private static bool APPLE_element_array; + private static bool APPLE_fence; + private static bool APPLE_float_pixels; + private static bool APPLE_flush_buffer_range; + private static bool APPLE_object_purgeable; + private static bool APPLE_rgb_422; + private static bool APPLE_row_bytes; + private static bool APPLE_specular_vector; + private static bool APPLE_texture_range; + private static bool APPLE_transform_hint; + private static bool APPLE_vertex_array_object; + private static bool APPLE_vertex_array_range; + private static bool APPLE_vertex_program_evaluators; + private static bool APPLE_ycbcr_422; + private static bool ARB_arrays_of_arrays; + private static bool ARB_base_instance; + private static bool ARB_bindless_texture; + private static bool ARB_blend_func_extended; + private static bool ARB_buffer_storage; + private static bool ARB_cl_event; + private static bool ARB_clear_buffer_object; + private static bool ARB_clear_texture; + private static bool ARB_clip_control; + private static bool ARB_color_buffer_float; + private static bool ARB_compatibility; + private static bool ARB_compressed_texture_pixel_storage; + private static bool ARB_compute_shader; + private static bool ARB_compute_variable_group_size; + private static bool ARB_conditional_render_inverted; + private static bool ARB_conservative_depth; + private static bool ARB_copy_buffer; + private static bool ARB_copy_image; + private static bool ARB_cull_distance; + private static bool ARB_debug_output; + private static bool ARB_depth_buffer_float; + private static bool ARB_depth_clamp; + private static bool ARB_depth_texture; + private static bool ARB_derivative_control; + private static bool ARB_direct_state_access; + private static bool ARB_draw_buffers; + private static bool ARB_draw_buffers_blend; + private static bool ARB_draw_elements_base_vertex; + private static bool ARB_draw_indirect; + private static bool ARB_draw_instanced; + private static bool ARB_enhanced_layouts; + private static bool ARB_ES2_compatibility; + private static bool ARB_ES3_1_compatibility; + private static bool ARB_ES3_2_compatibility; + private static bool ARB_ES3_compatibility; + private static bool ARB_explicit_attrib_location; + private static bool ARB_explicit_uniform_location; + private static bool ARB_fragment_coord_conventions; + private static bool ARB_fragment_layer_viewport; + private static bool ARB_fragment_program; + private static bool ARB_fragment_program_shadow; + private static bool ARB_fragment_shader; + private static bool ARB_fragment_shader_interlock; + private static bool ARB_framebuffer_no_attachments; + private static bool ARB_framebuffer_object; + private static bool ARB_framebuffer_sRGB; + private static bool ARB_geometry_shader4; + private static bool ARB_get_program_binary; + private static bool ARB_get_texture_sub_image; + private static bool ARB_gl_spirv; + private static bool ARB_gpu_shader_fp64; + private static bool ARB_gpu_shader_int64; + private static bool ARB_gpu_shader5; + private static bool ARB_half_float_pixel; + private static bool ARB_half_float_vertex; + private static bool ARB_imaging; + private static bool ARB_indirect_parameters; + private static bool ARB_instanced_arrays; + private static bool ARB_internalformat_query; + private static bool ARB_internalformat_query2; + private static bool ARB_invalidate_subdata; + private static bool ARB_map_buffer_alignment; + private static bool ARB_map_buffer_range; + private static bool ARB_matrix_palette; + private static bool ARB_multi_bind; + private static bool ARB_multi_draw_indirect; + private static bool ARB_multisample; + private static bool ARB_multitexture; + private static bool ARB_occlusion_query; + private static bool ARB_occlusion_query2; + private static bool ARB_parallel_shader_compile; + private static bool ARB_pipeline_statistics_query; + private static bool ARB_pixel_buffer_object; + private static bool ARB_point_parameters; + private static bool ARB_point_sprite; + private static bool ARB_polygon_offset_clamp; + private static bool ARB_post_depth_coverage; + private static bool ARB_program_interface_query; + private static bool ARB_provoking_vertex; + private static bool ARB_query_buffer_object; + private static bool ARB_robust_buffer_access_behavior; + private static bool ARB_robustness; + private static bool ARB_robustness_isolation; + private static bool ARB_sample_locations; + private static bool ARB_sample_shading; + private static bool ARB_sampler_objects; + private static bool ARB_seamless_cube_map; + private static bool ARB_seamless_cubemap_per_texture; + private static bool ARB_separate_shader_objects; + private static bool ARB_shader_atomic_counter_ops; + private static bool ARB_shader_atomic_counters; + private static bool ARB_shader_ballot; + private static bool ARB_shader_bit_encoding; + private static bool ARB_shader_clock; + private static bool ARB_shader_draw_parameters; + private static bool ARB_shader_group_vote; + private static bool ARB_shader_image_load_store; + private static bool ARB_shader_image_size; + private static bool ARB_shader_objects; + private static bool ARB_shader_precision; + private static bool ARB_shader_stencil_export; + private static bool ARB_shader_storage_buffer_object; + private static bool ARB_shader_subroutine; + private static bool ARB_shader_texture_image_samples; + private static bool ARB_shader_texture_lod; + private static bool ARB_shader_viewport_layer_array; + private static bool ARB_shading_language_100; + private static bool ARB_shading_language_420pack; + private static bool ARB_shading_language_include; + private static bool ARB_shading_language_packing; + private static bool ARB_shadow; + private static bool ARB_shadow_ambient; + private static bool ARB_sparse_buffer; + private static bool ARB_sparse_texture; + private static bool ARB_sparse_texture_clamp; + private static bool ARB_sparse_texture2; + private static bool ARB_spirv_extensions; + private static bool ARB_stencil_texturing; + private static bool ARB_sync; + private static bool ARB_tessellation_shader; + private static bool ARB_texture_barrier; + private static bool ARB_texture_border_clamp; + private static bool ARB_texture_buffer_object; + private static bool ARB_texture_buffer_object_rgb32; + private static bool ARB_texture_buffer_range; + private static bool ARB_texture_compression; + private static bool ARB_texture_compression_bptc; + private static bool ARB_texture_compression_rgtc; + private static bool ARB_texture_cube_map; + private static bool ARB_texture_cube_map_array; + private static bool ARB_texture_env_add; + private static bool ARB_texture_env_combine; + private static bool ARB_texture_env_crossbar; + private static bool ARB_texture_env_dot3; + private static bool ARB_texture_filter_anisotropic; + private static bool ARB_texture_filter_minmax; + private static bool ARB_texture_float; + private static bool ARB_texture_gather; + private static bool ARB_texture_mirror_clamp_to_edge; + private static bool ARB_texture_mirrored_repeat; + private static bool ARB_texture_multisample; + private static bool ARB_texture_non_power_of_two; + private static bool ARB_texture_query_levels; + private static bool ARB_texture_query_lod; + private static bool ARB_texture_rectangle; + private static bool ARB_texture_rg; + private static bool ARB_texture_rgb10_a2ui; + private static bool ARB_texture_stencil8; + private static bool ARB_texture_storage; + private static bool ARB_texture_storage_multisample; + private static bool ARB_texture_swizzle; + private static bool ARB_texture_view; + private static bool ARB_timer_query; + private static bool ARB_transform_feedback_instanced; + private static bool ARB_transform_feedback_overflow_query; + private static bool ARB_transform_feedback2; + private static bool ARB_transform_feedback3; + private static bool ARB_transpose_matrix; + private static bool ARB_uniform_buffer_object; + private static bool ARB_vertex_array_bgra; + private static bool ARB_vertex_array_object; + private static bool ARB_vertex_attrib_64bit; + private static bool ARB_vertex_attrib_binding; + private static bool ARB_vertex_blend; + private static bool ARB_vertex_buffer_object; + private static bool ARB_vertex_program; + private static bool ARB_vertex_shader; + private static bool ARB_vertex_type_10f_11f_11f_rev; + private static bool ARB_vertex_type_2_10_10_10_rev; + private static bool ARB_viewport_array; + private static bool ARB_window_pos; + private static bool ATI_draw_buffers; + private static bool ATI_element_array; + private static bool ATI_envmap_bumpmap; + private static bool ATI_fragment_shader; + private static bool ATI_map_object_buffer; + private static bool ATI_meminfo; + private static bool ATI_pixel_format_float; + private static bool ATI_pn_triangles; + private static bool ATI_separate_stencil; + private static bool ATI_text_fragment_shader; + private static bool ATI_texture_env_combine3; + private static bool ATI_texture_float; + private static bool ATI_texture_mirror_once; + private static bool ATI_vertex_array_object; + private static bool ATI_vertex_attrib_array_object; + private static bool ATI_vertex_streams; + private static bool EXT_422_pixels; + private static bool EXT_abgr; + private static bool EXT_bgra; + private static bool EXT_bindable_uniform; + private static bool EXT_blend_color; + private static bool EXT_blend_equation_separate; + private static bool EXT_blend_func_separate; + private static bool EXT_blend_logic_op; + private static bool EXT_blend_minmax; + private static bool EXT_blend_subtract; + private static bool EXT_clip_volume_hint; + private static bool EXT_cmyka; + private static bool EXT_color_subtable; + private static bool EXT_compiled_vertex_array; + private static bool EXT_convolution; + private static bool EXT_coordinate_frame; + private static bool EXT_copy_texture; + private static bool EXT_cull_vertex; + private static bool EXT_debug_label; + private static bool EXT_debug_marker; + private static bool EXT_depth_bounds_test; + private static bool EXT_direct_state_access; + private static bool EXT_draw_buffers2; + private static bool EXT_draw_instanced; + private static bool EXT_draw_range_elements; + private static bool EXT_EGL_image_storage; + private static bool EXT_EGL_sync; + private static bool EXT_external_buffer; + private static bool EXT_fog_coord; + private static bool EXT_framebuffer_blit; + private static bool EXT_framebuffer_blit_layers; + private static bool EXT_framebuffer_multisample; + private static bool EXT_framebuffer_multisample_blit_scaled; + private static bool EXT_framebuffer_object; + private static bool EXT_framebuffer_sRGB; + private static bool EXT_geometry_shader4; + private static bool EXT_gpu_program_parameters; + private static bool EXT_gpu_shader4; + private static bool EXT_histogram; + private static bool EXT_index_array_formats; + private static bool EXT_index_func; + private static bool EXT_index_material; + private static bool EXT_index_texture; + private static bool EXT_light_texture; + private static bool EXT_memory_object; + private static bool EXT_memory_object_fd; + private static bool EXT_memory_object_win32; + private static bool EXT_misc_attribute; + private static bool EXT_multi_draw_arrays; + private static bool EXT_multisample; + private static bool EXT_multiview_tessellation_geometry_shader; + private static bool EXT_multiview_texture_multisample; + private static bool EXT_multiview_timer_query; + private static bool EXT_packed_depth_stencil; + private static bool EXT_packed_float; + private static bool EXT_packed_pixels; + private static bool EXT_paletted_texture; + private static bool EXT_pixel_buffer_object; + private static bool EXT_pixel_transform; + private static bool EXT_pixel_transform_color_table; + private static bool EXT_point_parameters; + private static bool EXT_polygon_offset; + private static bool EXT_polygon_offset_clamp; + private static bool EXT_post_depth_coverage; + private static bool EXT_provoking_vertex; + private static bool EXT_raster_multisample; + private static bool EXT_rescale_normal; + private static bool EXT_secondary_color; + private static bool EXT_semaphore; + private static bool EXT_semaphore_fd; + private static bool EXT_semaphore_win32; + private static bool EXT_separate_shader_objects; + private static bool EXT_separate_specular_color; + private static bool EXT_shader_framebuffer_fetch; + private static bool EXT_shader_framebuffer_fetch_non_coherent; + private static bool EXT_shader_image_load_formatted; + private static bool EXT_shader_image_load_store; + private static bool EXT_shader_integer_mix; + private static bool EXT_shader_samples_identical; + private static bool EXT_shadow_funcs; + private static bool EXT_shared_texture_palette; + private static bool EXT_sparse_texture2; + private static bool EXT_stencil_clear_tag; + private static bool EXT_stencil_two_side; + private static bool EXT_stencil_wrap; + private static bool EXT_subtexture; + private static bool EXT_texture; + private static bool EXT_texture_array; + private static bool EXT_texture_buffer_object; + private static bool EXT_texture_compression_latc; + private static bool EXT_texture_compression_rgtc; + private static bool EXT_texture_compression_s3tc; + private static bool EXT_texture_cube_map; + private static bool EXT_texture_env_add; + private static bool EXT_texture_env_combine; + private static bool EXT_texture_env_dot3; + private static bool EXT_texture_filter_anisotropic; + private static bool EXT_texture_filter_minmax; + private static bool EXT_texture_integer; + private static bool EXT_texture_lod_bias; + private static bool EXT_texture_mirror_clamp; + private static bool EXT_texture_object; + private static bool EXT_texture_perturb_normal; + private static bool EXT_texture_shadow_lod; + private static bool EXT_texture_shared_exponent; + private static bool EXT_texture_snorm; + private static bool EXT_texture_sRGB; + private static bool EXT_texture_sRGB_decode; + private static bool EXT_texture_sRGB_R8; + private static bool EXT_texture_sRGB_RG8; + private static bool EXT_texture_storage; + private static bool EXT_texture_swizzle; + private static bool EXT_texture3D; + private static bool EXT_timer_query; + private static bool EXT_transform_feedback; + private static bool EXT_vertex_array; + private static bool EXT_vertex_array_bgra; + private static bool EXT_vertex_attrib_64bit; + private static bool EXT_vertex_shader; + private static bool EXT_vertex_weighting; + private static bool EXT_win32_keyed_mutex; + private static bool EXT_window_rectangles; + private static bool EXT_x11_sync_object; + private static bool GREMEDY_frame_terminator; + private static bool GREMEDY_string_marker; + private static bool HP_convolution_border_modes; + private static bool HP_image_transform; + private static bool HP_occlusion_test; + private static bool HP_texture_lighting; + private static bool IBM_cull_vertex; + private static bool IBM_multimode_draw_arrays; + private static bool IBM_rasterpos_clip; + private static bool IBM_static_data; + private static bool IBM_texture_mirrored_repeat; + private static bool IBM_vertex_array_lists; + private static bool INGR_blend_func_separate; + private static bool INGR_color_clamp; + private static bool INGR_interlace_read; + private static bool INTEL_blackhole_render; + private static bool INTEL_conservative_rasterization; + private static bool INTEL_fragment_shader_ordering; + private static bool INTEL_framebuffer_CMAA; + private static bool INTEL_map_texture; + private static bool INTEL_parallel_arrays; + private static bool INTEL_performance_query; + private static bool KHR_blend_equation_advanced; + private static bool KHR_blend_equation_advanced_coherent; + private static bool KHR_context_flush_control; + private static bool KHR_debug; + private static bool KHR_no_error; + private static bool KHR_parallel_shader_compile; + private static bool KHR_robust_buffer_access_behavior; + private static bool KHR_robustness; + private static bool KHR_shader_subgroup; + private static bool KHR_texture_compression_astc_hdr; + private static bool KHR_texture_compression_astc_ldr; + private static bool KHR_texture_compression_astc_sliced_3d; + private static bool MESA_framebuffer_flip_x; + private static bool MESA_framebuffer_flip_y; + private static bool MESA_framebuffer_swap_xy; + private static bool MESA_pack_invert; + private static bool MESA_program_binary_formats; + private static bool MESA_resize_buffers; + private static bool MESA_shader_integer_functions; + private static bool MESA_tile_raster_order; + private static bool MESA_window_pos; + private static bool MESA_ycbcr_texture; + private static bool MESAX_texture_stack; + private static bool NV_alpha_to_coverage_dither_control; + private static bool NV_bindless_multi_draw_indirect; + private static bool NV_bindless_multi_draw_indirect_count; + private static bool NV_bindless_texture; + private static bool NV_blend_equation_advanced; + private static bool NV_blend_equation_advanced_coherent; + private static bool NV_blend_minmax_factor; + private static bool NV_blend_square; + private static bool NV_clip_space_w_scaling; + private static bool NV_command_list; + private static bool NV_compute_program5; + private static bool NV_compute_shader_derivatives; + private static bool NV_conditional_render; + private static bool NV_conservative_raster; + private static bool NV_conservative_raster_dilate; + private static bool NV_conservative_raster_pre_snap; + private static bool NV_conservative_raster_pre_snap_triangles; + private static bool NV_conservative_raster_underestimation; + private static bool NV_copy_depth_to_color; + private static bool NV_copy_image; + private static bool NV_deep_texture3D; + private static bool NV_depth_buffer_float; + private static bool NV_depth_clamp; + private static bool NV_draw_texture; + private static bool NV_draw_vulkan_image; + private static bool NV_evaluators; + private static bool NV_explicit_multisample; + private static bool NV_fence; + private static bool NV_fill_rectangle; + private static bool NV_float_buffer; + private static bool NV_fog_distance; + private static bool NV_fragment_coverage_to_color; + private static bool NV_fragment_program; + private static bool NV_fragment_program_option; + private static bool NV_fragment_program2; + private static bool NV_fragment_program4; + private static bool NV_fragment_shader_barycentric; + private static bool NV_fragment_shader_interlock; + private static bool NV_framebuffer_mixed_samples; + private static bool NV_framebuffer_multisample_coverage; + private static bool NV_geometry_program4; + private static bool NV_geometry_shader_passthrough; + private static bool NV_geometry_shader4; + private static bool NV_gpu_multicast; + private static bool NV_gpu_program4; + private static bool NV_gpu_program5; + private static bool NV_gpu_program5_mem_extended; + private static bool NV_gpu_shader5; + private static bool NV_half_float; + private static bool NV_internalformat_sample_query; + private static bool NV_light_max_exponent; + private static bool NV_memory_attachment; + private static bool NV_memory_object_sparse; + private static bool NV_mesh_shader; + private static bool NV_multisample_coverage; + private static bool NV_multisample_filter_hint; + private static bool NV_occlusion_query; + private static bool NV_packed_depth_stencil; + private static bool NV_parameter_buffer_object; + private static bool NV_parameter_buffer_object2; + private static bool NV_path_rendering; + private static bool NV_path_rendering_shared_edge; + private static bool NV_pixel_data_range; + private static bool NV_point_sprite; + private static bool NV_present_video; + private static bool NV_primitive_restart; + private static bool NV_primitive_shading_rate; + private static bool NV_query_resource; + private static bool NV_query_resource_tag; + private static bool NV_register_combiners; + private static bool NV_register_combiners2; + private static bool NV_representative_fragment_test; + private static bool NV_robustness_video_memory_purge; + private static bool NV_sample_locations; + private static bool NV_sample_mask_override_coverage; + private static bool NV_scissor_exclusive; + private static bool NV_shader_atomic_counters; + private static bool NV_shader_atomic_float; + private static bool NV_shader_atomic_float64; + private static bool NV_shader_atomic_fp16_vector; + private static bool NV_shader_atomic_int64; + private static bool NV_shader_buffer_load; + private static bool NV_shader_buffer_store; + private static bool NV_shader_storage_buffer_object; + private static bool NV_shader_subgroup_partitioned; + private static bool NV_shader_texture_footprint; + private static bool NV_shader_thread_group; + private static bool NV_shader_thread_shuffle; + private static bool NV_shading_rate_image; + private static bool NV_stereo_view_rendering; + private static bool NV_tessellation_program5; + private static bool NV_texgen_emboss; + private static bool NV_texgen_reflection; + private static bool NV_texture_barrier; + private static bool NV_texture_compression_vtc; + private static bool NV_texture_env_combine4; + private static bool NV_texture_expand_normal; + private static bool NV_texture_multisample; + private static bool NV_texture_rectangle; + private static bool NV_texture_rectangle_compressed; + private static bool NV_texture_shader; + private static bool NV_texture_shader2; + private static bool NV_texture_shader3; + private static bool NV_timeline_semaphore; + private static bool NV_transform_feedback; + private static bool NV_transform_feedback2; + private static bool NV_uniform_buffer_std430_layout; + private static bool NV_uniform_buffer_unified_memory; + private static bool NV_vdpau_interop; + private static bool NV_vdpau_interop2; + private static bool NV_vertex_array_range; + private static bool NV_vertex_array_range2; + private static bool NV_vertex_attrib_integer_64bit; + private static bool NV_vertex_buffer_unified_memory; + private static bool NV_vertex_program; + private static bool NV_vertex_program1_1; + private static bool NV_vertex_program2; + private static bool NV_vertex_program2_option; + private static bool NV_vertex_program3; + private static bool NV_vertex_program4; + private static bool NV_video_capture; + private static bool NV_viewport_array2; + private static bool NV_viewport_swizzle; + private static bool NVX_blend_equation_advanced_multi_draw_buffers; + private static bool NVX_conditional_render; + private static bool NVX_gpu_memory_info; + private static bool NVX_gpu_multicast2; + private static bool NVX_linked_gpu_multicast; + private static bool NVX_progress_fence; + private static bool OES_byte_coordinates; + private static bool OES_compressed_paletted_texture; + private static bool OES_fixed_point; + private static bool OES_query_matrix; + private static bool OES_read_format; + private static bool OES_single_precision; + private static bool OML_interlace; + private static bool OML_resample; + private static bool OML_subsample; + private static bool OVR_multiview; + private static bool OVR_multiview2; + private static bool PGI_misc_hints; + private static bool PGI_vertex_hints; + private static bool REND_screen_coordinates; + private static bool S3_s3tc; + private static bool SGI_color_matrix; + private static bool SGI_color_table; + private static bool SGI_texture_color_table; + private static bool SGIS_detail_texture; + private static bool SGIS_fog_function; + private static bool SGIS_generate_mipmap; + private static bool SGIS_multisample; + private static bool SGIS_pixel_texture; + private static bool SGIS_point_line_texgen; + private static bool SGIS_point_parameters; + private static bool SGIS_sharpen_texture; + private static bool SGIS_texture_border_clamp; + private static bool SGIS_texture_color_mask; + private static bool SGIS_texture_edge_clamp; + private static bool SGIS_texture_filter4; + private static bool SGIS_texture_lod; + private static bool SGIS_texture_select; + private static bool SGIS_texture4D; + private static bool SGIX_async; + private static bool SGIX_async_histogram; + private static bool SGIX_async_pixel; + private static bool SGIX_blend_alpha_minmax; + private static bool SGIX_calligraphic_fragment; + private static bool SGIX_clipmap; + private static bool SGIX_convolution_accuracy; + private static bool SGIX_depth_pass_instrument; + private static bool SGIX_depth_texture; + private static bool SGIX_flush_raster; + private static bool SGIX_fog_offset; + private static bool SGIX_fragment_lighting; + private static bool SGIX_framezoom; + private static bool SGIX_igloo_interface; + private static bool SGIX_instruments; + private static bool SGIX_interlace; + private static bool SGIX_ir_instrument1; + private static bool SGIX_list_priority; + private static bool SGIX_pixel_texture; + private static bool SGIX_pixel_tiles; + private static bool SGIX_polynomial_ffd; + private static bool SGIX_reference_plane; + private static bool SGIX_resample; + private static bool SGIX_scalebias_hint; + private static bool SGIX_shadow; + private static bool SGIX_shadow_ambient; + private static bool SGIX_sprite; + private static bool SGIX_subsample; + private static bool SGIX_tag_sample_buffer; + private static bool SGIX_texture_add_env; + private static bool SGIX_texture_coordinate_clamp; + private static bool SGIX_texture_lod_bias; + private static bool SGIX_texture_multi_buffer; + private static bool SGIX_texture_scale_bias; + private static bool SGIX_vertex_preclip; + private static bool SGIX_ycrcb; + private static bool SGIX_ycrcb_subsample; + private static bool SGIX_ycrcba; + private static bool SUN_convolution_border_modes; + private static bool SUN_global_alpha; + private static bool SUN_mesh_array; + private static bool SUN_slice_accum; + private static bool SUN_triangle_list; + private static bool SUN_vertex; + private static bool SUNX_constant_data; + private static bool WIN_phong_shading; + private static bool WIN_specular_fog; + + + #endregion + + } +} diff --git a/源代码/StgSharpDebug/Graphics/GL/glRenderStream.cs b/源代码/StgSharpDebug/Graphics/GL/glRenderStream.cs new file mode 100644 index 00000000..dac84161 --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/GL/glRenderStream.cs @@ -0,0 +1,155 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="glRenderStream.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Logic; +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics.GL +{ + + public abstract partial class glRenderStream : RenderStream + { + + protected glRenderStream(ViewPort v, (int,int,int) cube) : base(v,cube) + { + } + + + protected IntPtr glContextHandle + { + get { return ContextHandle; } + } + + /// + /// 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 (ContextHandle == default) + { + ContextHandle = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(GLcontext))); + GLcontext* contextID = (GLcontext*)ContextHandle; + contextID->glGetString = (delegate*)IntPtr.Zero; + } + if (glFunc.CurrentContextHandle != ContextHandle) + { + glFunc.CurrentContextHandle = ContextHandle; + //Console.WriteLine($"context set as {(ulong)glFunc.CurrentContextHandle}"); + InternalIO.glfwMakeContextCurrent(CanvasHandle); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override void SetSizeLimit(int minWidth, int minHeight, int maxWidth, int maxHeight) + { + InternalIO.glfwSetWindowSizeLimits(this.CanvasHandle, minWidth, minHeight, maxWidth, maxHeight); + } + + internal override sealed void InternalDraw( + in Dictionary input, + in Dictionary output) + { + MakeAsCurrentContext(); + ProcessInput(); + Main(in input, in output); + } + + internal override sealed void InternalInit() + { + MakeAsCurrentContext(); + this.Port.LoadGLapi(); + Init(); + } + + internal override sealed void InternalTerminate() + { + Deinit(); + } + + protected override sealed Uniform NativeCameraUniform(ShaderProgram source, string name) + { + NativeCamera.GainAllUniforms(source, name); + return NativeCamera.convertedUniform; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override sealed void NativeCameraViewRange(Radius fieldOfRange, vec2d offset, (float frontDepth, float backDepth) viewDepth) + { + NativeCamera.SetViewRange(fieldOfRange, this.Size, offset, viewDepth); + } + + protected override sealed void NativeCameraViewTarget(vec3d position, vec3d direction, vec3d up) + { + NativeCamera.SetViewDirection(position, direction, up); + } + + protected static void PollEvents() + { + InternalIO.glfwPollEvents(); + } + + protected void SwapBuffers() + { + InternalIO.glfwSwapBuffers(CanvasHandle); + } + + #region Key Control + + protected KeyStatus CheckKey(KeyboardKey key) + { + return InternalIO.glfwGetKey(this.CanvasHandle, (int)key); + } + + protected KeyStatus CheckKey(Mouse key) + { + return InternalIO.glfwGetKey(this.CanvasHandle, (int)key); + } + + protected KeyStatus CheckKey(Joystick key) + { + return InternalIO.glfwGetKey(this.CanvasHandle, (int)key); + } + + #endregion + + } +} diff --git a/源代码/StgSharpDebug/Graphics/Image.cs b/源代码/StgSharpDebug/Graphics/Image.cs new file mode 100644 index 00000000..bbcba961 --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/Image.cs @@ -0,0 +1,255 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Image.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Data; +using StgSharp.Graphics.GL; +using StgSharp.Math; + +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.Graphics +{ + public class Image : ISSDSerializable, IImageProvider + { + internal byte[] data; + internal ImageInfo info; + + internal Image(ImageInfo information) + { + info = information; + data = Array.Empty(); + //int length = info.width * info.height * info.channel; + } + + public ref byte[] DataStream + { + get => ref data; + } + + public unsafe Image() + { + info = new ImageInfo(); + } + + public ImageChannel Channel => info.Channel; + public int ChannelCount => info.ChannelCount; + public int Height => info.Height; + + public (int width, int height) Size + { + get => (info.Width, info.Height); + } + + public SerializableTypeCode SSDTypeCode => SerializableTypeCode.PixelImage; + public int Width => info.Width; + + public static unsafe Image FromFile(string route, ImageLoader loader) + { + Image ret = new Image(); + fixed (ImageInfo* iptr = &ret.info) + { + InternalIO.InternalLoadImage(route, iptr, loader); + } + return ret; + } + + public static Image FromMemory((int width, int height) size, int channelCount, byte[] stream) + { + ImageInfo _info = new ImageInfo + { + Height = size.height, + Width = size.width, + ChannelCount = channelCount, + StreamPtr = IntPtr.Zero + }; + Image ret = new Image(_info); + ret.data = stream; + return ret; + } + + public glArrayHandle GetArrayHandle() + { + if ((data == Array.Empty()) || (data == null)) + { + this.GetBytes(); + return new glArrayHandle(data); + } + return new glArrayHandle(data); + } + + public unsafe byte[] GetBytes() + { + if (data == null) + { + int size = Width * Height * ChannelCount; + data = new byte[size]; + int i = 0; + fixed (byte* bptr = data) + { + byte* pptr = bptr; + for (; i < size; i += 16) + { + *(M128*)(pptr + i) = *(M128*)(info.StreamPtr + i); + } + for (; i < size; i++) + { + *(pptr + i) = *(byte*)(info.StreamPtr + i); + } + } + fixed (ImageInfo* pptr = &info) + { + InternalIO.InternalUnloadImage(pptr); + } + info.StreamPtr = IntPtr.Zero; + } + return data; + } + + public void FromBytes(byte[] stream) + { + + } + + public Image ProvideImage() + { + throw new NotImplementedException(); + } + + ~Image() + { + if (info.StreamPtr != IntPtr.Zero) + { + // Marshal.FreeHGlobal(info.StreamPtr); + } + } + + } + + [StructLayout(LayoutKind.Sequential)] + internal struct ImageInfo + { + + private ImageChannel channel; + private int channelCount; + private int height; + private int width; + private IntPtr pixelPtr; + + public ImageChannel Channel + { + get => channel; + set + { + channel = value; + switch (channel) + { + case ImageChannel.SingleColor: + channelCount = 1; break; + case ImageChannel.DoubleColor: + channelCount = 2; break; + case ImageChannel.FullColor: + channelCount = 3; break; + case ImageChannel.WithAlphaChannel: + channelCount = 4; break; + default: + throw new InvalidCastException("Unknown color channel decoding setting."); + } + } + } + + public int ChannelCount + { + get => channelCount; + set + { + channelCount = value; + switch (channelCount) + { + case 1: + channel = ImageChannel.SingleColor; break; + case 2: + channel = ImageChannel.DoubleColor; break; + case 3: + channel = ImageChannel.FullColor; break; + case 4: + channel = ImageChannel.WithAlphaChannel; break; + default: + throw new InvalidCastException("Unknown color channel decoding setting."); + } + } + } + + public int Height + { + get => height; + set => height = value; + } + + public IntPtr StreamPtr + { + get => pixelPtr; + internal set => pixelPtr = value; + } + + public int StreamSize + { + get => width * height * channelCount; + } + + public int Width + { + get => width; + set => width = value; + } + + public override string ToString() + { + return $"{channel}\t{width}\t{height}\t{(ulong)StreamPtr}"; + } + + } + + public enum ImageChannel : uint + { + SingleColor = GLconst.RED, + DoubleColor = GLconst.RG, + FullColor = GLconst.RGB, + WithAlphaChannel = GLconst.RGBA, + } + + +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Graphics/PlainGeometryMesh.cs b/源代码/StgSharpDebug/Graphics/PlainGeometryMesh.cs new file mode 100644 index 00000000..3842e75c --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/PlainGeometryMesh.cs @@ -0,0 +1,57 @@ +using StgSharp.Geometries; +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace StgSharp.Graphics +{ + public class PlainGeometryMesh + { + private PlainGeometry _shape; + private Image _texture; + private vec4d[] textureCoord; + + public PlainGeometryMesh( + PlainGeometry shape, Image texture, vec4d[] texCoord + ) + { + if (shape==null) + { + throw new ArgumentNullException(nameof(shape)); + } + if (texCoord == null) + { + throw new ArgumentNullException(nameof(texCoord)); + } + + _shape = shape; + _texture = texture; + if (shape.VertexCount > texCoord.Length) + { + throw new ArgumentException(paramName: nameof(texCoord), message: "Amount of texture coordination is too less"); + } + textureCoord = texCoord; + return; + } + + public PlainGeometryMesh Resize(PlainGeometry newShape) + { + return new PlainGeometryMesh(newShape, _texture, textureCoord); + } + + public ReadOnlySpan MeshIndices => _shape.VertexIndices; + + public vec4d[] VertexArray => _shape.VertexStream; + + public Image TextureImage + { + get => _texture; + internal set => _texture = value; + } + + public vec4d[] TextureCoord => textureCoord; + } +} diff --git a/源代码/StgSharpDebug/Graphics/RenderStream.cs b/源代码/StgSharpDebug/Graphics/RenderStream.cs new file mode 100644 index 00000000..6ba1642e --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/RenderStream.cs @@ -0,0 +1,270 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="RenderStream.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Graphics.GL; +using StgSharp.Logic; +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics +{ + public abstract class RenderStream : IConvertableToBlueprintNode + { + private ViewPort primeArgs; + + private protected (int x, int y, int z) _coordStretch; + + private Camera nativeCamera; + + public ViewPort Port => primeArgs; + + internal IntPtr CanvasHandle { get => primeArgs.ViewPortID; } + + + internal IntPtr ContextHandle + { + get => primeArgs.GraphicHandle; + private protected set => primeArgs.GraphicHandle = value; + } + + private IntPtr monitor; + private IntPtr sharedCanvas; + + internal TimeSpanProvider timeProvider; + /* + protected RenderStream(View v, bool isSharing) + { + if (v == null) + { + throw new ArgumentNullException(nameof(v)); + } + if (isSharing) + { + primeArgs = v; + } + else + { + View? newArgs = args.Clone() as View; + primeArgs = newArgs; + } + + monitor = args.Monitor; + _coordStretch = args.UnitCubeSize; + NativeCamera = new Camera(); + } + /**/ + + public RenderStream(ViewPort v, (int,int,int) unitCubeSize) + { + if (v == null) + { + throw new ArgumentNullException(nameof(v)); + } + primeArgs = v; + + monitor = v!.Monitor; + _coordStretch = unitCubeSize; + NativeCamera = new Camera(); + } + + + public FrameBufferSizeHandler FrameSizeCallback + { + set + { + IntPtr handlerPtr = Marshal.GetFunctionPointerForDelegate(value); + InternalIO.glfwSetFramebufferSizeCallback(CanvasHandle, handlerPtr); + } + } + + public vec2d GlobalCoordSize => ((Width * 1.0f) / _coordStretch.x, (Height * 1.0f) / _coordStretch.y); + + public int Height + { + get => primeArgs.Height; + internal set + { + primeArgs.Height = value; + InternalIO.glfwSetWindowSize(this.CanvasHandle, Width, Height); + } + } + + public IntPtr Monitor + { + get => monitor; + internal set => monitor = value; + } + + public string Name + { + get => primeArgs.Name; + } + + public IntPtr SharedCanvas + { + get => sharedCanvas; + internal set => sharedCanvas = value; + } + + public (int width, int height) Size + { + get => (Width, Height); + internal set + { + primeArgs.Height = value.width; + primeArgs.Width = value.height; + InternalIO.glfwSetWindowSize(this.CanvasHandle, Width, Height); + } + } + + public int Width + { + get => primeArgs.Width; + internal set + { + primeArgs.Width = value; + InternalIO.glfwSetWindowSize(this.CanvasHandle, Width, Height); + } + } + + protected internal Camera NativeCamera + { + get => nativeCamera; + internal set => nativeCamera = value; + } + + protected int Frames + { + get => timeProvider.CurrentSpan; + } + + protected abstract string[] InputPortsName { get; } + protected abstract string[] OutputPortsName { get; } + + protected float TimePassed + { + get => timeProvider.CurrentSpan; + } + + protected TimeSpanProvider TimeProvider + { + get => timeProvider; + } + + /// + /// Set the size limit of current form + /// + /// Minimum width of current form + /// Minimum height of current form + /// Maximum width of current form + /// Maximum height of current form + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public abstract void SetSizeLimit(int minWidth, int minHeight, int maxWidth, int maxHeight); + + public static TTarget ShareContextWith(TSource source) + where TSource : RenderStream + where TTarget : RenderStream + { + TTarget target = Activator.CreateInstance(typeof(TTarget), source.primeArgs, source._coordStretch) as TTarget; + if (target == null) + { + throw new InvalidOperationException( + $"Failed in creating a new {typeof(TTarget).Name} instance when calling ShareContextWith." + ); + } + target.timeProvider = source.timeProvider; + target.Init(); + return target; + } + + + string[] IConvertableToBlueprintNode.InputInterfacesName => InputPortsName; + + BlueprintNodeAction IConvertableToBlueprintNode.MainExecution => InternalDraw; + + string[] IConvertableToBlueprintNode.OutputInterfacesName => OutputPortsName; + + #region native camera operation + protected abstract void NativeCameraViewRange(Radius fieldOfRange, vec2d offset, (float frontDepth, float backDepth) viewDepth); + protected abstract void NativeCameraViewTarget(vec3d position, vec3d direction, vec3d up); + /// + /// Get (T is ) uniform from a shader. + /// This uniform will be used as projection matrix of this camera. + /// Additionally, for multi-shader rendering, each shader requires a uniform, + /// so do not ignore return value of this method. + /// + /// Shader using this camera + /// ContextName of projection camera named in shader + /// + /// (T is ) representing + /// projection matrix in shader program. + /// + protected abstract Uniform NativeCameraUniform(ShaderProgram source, string name); + #endregion + + #region internal operation + internal abstract void InternalDraw( + in Dictionary input, + in Dictionary output); + internal abstract void InternalInit(); + internal abstract void InternalTerminate(); + #endregion + + #region public operation + protected abstract void Deinit(); + protected abstract void Init(); + protected abstract void Main( + in Dictionary input, + in Dictionary output); + protected abstract void ProcessInput(); + + #endregion + + #region public resource generator + + protected abstract Shader CreateShaderSegment(ShaderType type, int count); + protected abstract ShaderProgram CreateShaderProgram(); + + + + #endregion + + + } + +} diff --git a/源代码/StgSharp/Graphics/GL/ShaderEdit/ShaderGenerator.cs b/源代码/StgSharpDebug/Graphics/ShaderEdit/ShaderGenerator.cs similarity index 99% rename from 源代码/StgSharp/Graphics/GL/ShaderEdit/ShaderGenerator.cs rename to 源代码/StgSharpDebug/Graphics/ShaderEdit/ShaderGenerator.cs index 28927be2..9d0c3e59 100644 --- a/源代码/StgSharp/Graphics/GL/ShaderEdit/ShaderGenerator.cs +++ b/源代码/StgSharpDebug/Graphics/ShaderEdit/ShaderGenerator.cs @@ -29,6 +29,7 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- using StgSharp.Graphics; +using StgSharp.Graphics.GL; using StgSharp.Math; using System; diff --git a/源代码/StgSharp/Graphics/GL/ShaderEdit/ShaderStruct.cs b/源代码/StgSharpDebug/Graphics/ShaderEdit/ShaderStruct.cs similarity index 85% rename from 源代码/StgSharp/Graphics/GL/ShaderEdit/ShaderStruct.cs rename to 源代码/StgSharpDebug/Graphics/ShaderEdit/ShaderStruct.cs index bf718694..1f210006 100644 --- a/源代码/StgSharp/Graphics/GL/ShaderEdit/ShaderStruct.cs +++ b/源代码/StgSharpDebug/Graphics/ShaderEdit/ShaderStruct.cs @@ -1,4 +1,6 @@ -using System; +using StgSharp.Graphics.GL; + +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -16,15 +18,15 @@ namespace StgSharp.Graphics.ShaderEdit { internal Dictionary uniformPair; - public ShaderStruct(params (glSHandle, ShaderStructMember)[] UniformPais) + public ShaderStruct(params (glSHandle, ShaderStructMember)[] uniformPairs) { uniformPair = new Dictionary(); - if (UniformPais.Length == 0) + if (uniformPairs.Length == 0) { return; } - foreach (var item in UniformPais) + foreach (var item in uniformPairs) { uniformPair.Add(item.Item1,item.Item2); } @@ -36,7 +38,7 @@ namespace StgSharp.Graphics.ShaderEdit public unsafe void SetAllUniforms() { - GLcontext* gl = GL.api; + GLcontext* gl = (GLcontext*) glFunc.CurrentContextHandle; foreach (var uniform in uniformPair) { int id = uniform.Key.Value; @@ -59,6 +61,6 @@ namespace StgSharp.Graphics.ShaderEdit "Incorrect type \"Unknown\" defined in this self define type"); } } - } + }//------------------------------------ End of Class --------------------------------------- } } diff --git a/源代码/StgSharpDebug/Graphics/TextureImage.cs b/源代码/StgSharpDebug/Graphics/TextureImage.cs new file mode 100644 index 00000000..d5de83c7 --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/TextureImage.cs @@ -0,0 +1,32 @@ +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Text; + +namespace StgSharp.Graphics +{ + public class TextureImage : IImageProvider + { + private Image _tex; + private vec2d[] _texCoord; + + Image IImageProvider.ProvideImage() + { + return _tex; + } + + public TextureImage(Image image, vec2d[] coord) + { + _tex = image; + _texCoord = coord; + } + + public ref vec2d this[int index] + { + get => ref _texCoord[index]; + } + + } +} diff --git a/源代码/StgSharpDebug/Graphics/TexturePipeline.cs b/源代码/StgSharpDebug/Graphics/TexturePipeline.cs new file mode 100644 index 00000000..b192b887 --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/TexturePipeline.cs @@ -0,0 +1,26 @@ +using StgSharp.Logic; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Graphics +{ + public class TexturePipeline:BlueprintPipelineArgs + { + public TexturePipeline(Image i) + { + value = i; + } + + private Image value; + + public Image Value + { + get => value; + set => value = value ?? throw new ArgumentNullException(nameof(value)); + } + } +} diff --git a/源代码/StgSharp/Graphics/Form/FormThreading.cs b/源代码/StgSharpDebug/Graphics/View/FormThreading.cs similarity index 60% rename from 源代码/StgSharp/Graphics/Form/FormThreading.cs rename to 源代码/StgSharpDebug/Graphics/View/FormThreading.cs index 4823c6c8..be244df9 100644 --- a/源代码/StgSharp/Graphics/Form/FormThreading.cs +++ b/源代码/StgSharpDebug/Graphics/View/FormThreading.cs @@ -41,62 +41,9 @@ using System.Threading.Tasks; namespace StgSharp.Graphics { - public abstract partial class ViewModel + public partial class View { - private Blueprint renderLogic; - - public Blueprint RenderLogic - { - get => renderLogic; - set => renderLogic = value; - } - - /// - /// Init this form and render it on screen, and respond with operation - /// - public unsafe void Show() - { - while (!ShouldClose) - { - renderLogic.RunRepeatedly(() => ShouldClose); - frameTimeProvider.WaitNextSpan(); - Interlocked.Add(ref _frameCount, 1); - } - } - - - public T BuildMainRenderStream((int x, int y, int z) unitCubeSize) where T : RenderStream - { - RenderStreamConstructArgs args = new RenderStreamConstructArgs(); - args.UnitCubeSize = unitCubeSize; - args.Name = this.name; - args.Height = this.Height; - args.Width = this.Width; - T? ret = Activator.CreateInstance(typeof(T), args) as T; - if (ret == null) - { - throw new InvalidOperationException("Failed in building a new RenderStream when calling AsMainStreamOf"); - } - ret!.InternalInit(); - this.WindowID = ret.CanvasHandle; - ret.timeProvider = this.frameTimeProvider; - return ret; - } - - public T BuildNewRenderStream(RenderStreamConstructArgs arg, (int x, int y, int z) unitCubeSize) where T : RenderStream - { - T? ret = Activator.CreateInstance(typeof(T), arg) as T; - if (ret == null) - { - throw new InvalidOperationException("Failed in building a new RenderStream when calling AsMainStreamOf"); - } - ret!.InternalInit(); - this.WindowID = ret.CanvasHandle; - ret.timeProvider = this.frameTimeProvider; - return ret; - } - - + internal Blueprint localLogic; /* private void GatherSingleFrameAsyncThread(MethodInfo[] methods) diff --git a/源代码/StgSharpDebug/Graphics/View/View.cs b/源代码/StgSharpDebug/Graphics/View/View.cs new file mode 100644 index 00000000..7346b9ae --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/View/View.cs @@ -0,0 +1,137 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="View.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Numerics; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; + +namespace StgSharp.Graphics +{ + /// + /// + /// + public unsafe partial class View + { + + private (int w, int h) sizeCache; + private (int x, int y, int z) unitCubeSize; + + private ViewPort context; + + private ViewPortDesigner design; + + public ViewPort Port + { + get => context; + } + + public View(ViewPort vp, ViewPortDesigner design) + { + context = vp; + sizeCache = (0, 0); + unitCubeSize = (1, 1, 1); + localLogic = new Logic.Blueprint(); + this.design = design; + SelfName = string.Empty; + } + + public View(ViewPort vp, ViewPortDesigner design, (int, int, int) cubeSize) + { + context = vp; + sizeCache = (0, 0); + unitCubeSize = cubeSize; + localLogic = new Logic.Blueprint(); + } + + public bool Activated { get; internal set; } + + public int Height + { + get + { + if (context.Height != sizeCache.h) + { + sizeCache.h = context.Height; + InternalIO.glfwSetWindowSize(ViewHandle, context.Height, context.Width); + } + return sizeCache.h; + } + internal set + { + sizeCache.h = value; + context.Height = value; + InternalIO.glfwSetWindowSize(ViewHandle, context.Height, context.Width); + } + } + + public IntPtr Monitor => context.Monitor; + + public IntPtr ViewHandle => context.ViewPortID; + + public string ContextName => context.Name; + + public string SelfName { get; set; } + + public (int x, int y, int z) UnitCubeSize + { + get => unitCubeSize; + } + + public int Width + { + get + { + if (context.Width != sizeCache.w) + { + sizeCache.w = context.Width; + InternalIO.glfwSetWindowSize(ViewHandle, context.Height, context.Width); + } + return sizeCache.h; + } + internal set + { + sizeCache.w = value; + context.Width = value; + InternalIO.glfwSetWindowSize(ViewHandle, context.Height, context.Width); + } + } + + } + +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Graphics/View/ViewPort.cs b/源代码/StgSharpDebug/Graphics/View/ViewPort.cs new file mode 100644 index 00000000..3730b44c --- /dev/null +++ b/源代码/StgSharpDebug/Graphics/View/ViewPort.cs @@ -0,0 +1,46 @@ +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Threading; + +namespace StgSharp.Graphics +{ + public class ViewPort + { + public int Width { get; set; } + public int Height { get; set; } + + public string Name { get; set; } + + public IntPtr Monitor { get; internal set; } + + public IntPtr ViewPortID { get; private set; } + public IntPtr GraphicHandle { get; internal set; } + + internal ViewPort() + { + Height = 800; + Width = 600; + Name = new StackFrame(1, false). + GetMethod()!.DeclaringType!.Name; + Monitor = IntPtr.Zero; + ViewPortID = InternalIO.glfwCreateWindow(Width,Height, + Encoding.UTF8.GetBytes(Name), Monitor, IntPtr.Zero + ); + } + + public ViewPort(vec2d size,string name, IntPtr monitor) + { + Height = (int) size.Y; + Width = (int) size.X; + Name = name; + Monitor = monitor; + ViewPortID = InternalIO.glfwCreateWindow(Width, Height, + Encoding.UTF8.GetBytes(Name), Monitor, IntPtr.Zero + ); + } + } +} diff --git a/源代码/StgSharp/Graphics/GL/framework.cs b/源代码/StgSharpDebug/Graphics/framework.cs similarity index 62% rename from 源代码/StgSharp/Graphics/GL/framework.cs rename to 源代码/StgSharpDebug/Graphics/framework.cs index 89e10663..d8d0cc35 100644 --- a/源代码/StgSharp/Graphics/GL/framework.cs +++ b/源代码/StgSharpDebug/Graphics/framework.cs @@ -47,241 +47,241 @@ namespace StgSharp { #region api call - [DllImport(SSC_libname, EntryPoint = "glfwInit")] internal static extern unsafe int glfwInit(); + [DllImport(SSC_libName, EntryPoint = "glfwInit")] internal static extern unsafe int glfwInit(); - [DllImport(SSC_libname, EntryPoint = "glfwTerminate")] internal static extern unsafe void glfwTerminate(); + [DllImport(SSC_libName, EntryPoint = "glfwTerminate")] internal static extern unsafe void glfwTerminate(); - [DllImport(SSC_libname, EntryPoint = "glfwInitHint")] internal static extern unsafe void glfwInitHint(int hint, int value); + [DllImport(SSC_libName, EntryPoint = "glfwInitHint")] internal static extern unsafe void glfwInitHint(int hint, int value); - [DllImport(SSC_libname, EntryPoint = "glfwGetVersion")] internal static extern unsafe void glfwGetVersion(int* major, int* minor, int* rev); + [DllImport(SSC_libName, EntryPoint = "glfwGetVersion")] internal static extern unsafe void glfwGetVersion(int* major, int* minor, int* rev); - [DllImport(SSC_libname, EntryPoint = "glfwGetVersionString")] internal static extern unsafe byte* glfwGetVersionString(); + [DllImport(SSC_libName, EntryPoint = "glfwGetVersionString")] internal static extern unsafe byte* glfwGetVersionString(); - [DllImport(SSC_libname, EntryPoint = "glfwGetError")] internal static extern unsafe int glfwGetError(byte** description); + [DllImport(SSC_libName, EntryPoint = "glfwGetError")] internal static extern unsafe int glfwGetError(byte** description); - [DllImport(SSC_libname, EntryPoint = "glfwSetErrorCallback")] internal static extern unsafe GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetErrorCallback")] internal static extern unsafe GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback); - [DllImport(SSC_libname, EntryPoint = "glfwGetMonitors")] internal static extern unsafe IntPtr* glfwGetMonitors(int* count); + [DllImport(SSC_libName, EntryPoint = "glfwGetMonitors")] internal static extern unsafe IntPtr* glfwGetMonitors(int* count); - [DllImport(SSC_libname, EntryPoint = "glfwGetPrimaryMonitor")] internal static extern unsafe IntPtr glfwGetPrimaryMonitor(); + [DllImport(SSC_libName, EntryPoint = "glfwGetPrimaryMonitor")] internal static extern unsafe IntPtr glfwGetPrimaryMonitor(); - [DllImport(SSC_libname, EntryPoint = "glfwGetMonitorPos")] internal static extern unsafe void glfwGetMonitorPos(IntPtr monitor, int* xpos, int* ypos); + [DllImport(SSC_libName, EntryPoint = "glfwGetMonitorPos")] internal static extern unsafe void glfwGetMonitorPos(IntPtr monitor, int* xpos, int* ypos); - [DllImport(SSC_libname, EntryPoint = "glfwGetMonitorWorkarea")] internal static extern unsafe void glfwGetMonitorWorkarea(IntPtr monitor, int* xpos, int* ypos, int* width, int* height); + [DllImport(SSC_libName, EntryPoint = "glfwGetMonitorWorkarea")] internal static extern unsafe void glfwGetMonitorWorkarea(IntPtr monitor, int* xpos, int* ypos, int* width, int* height); - [DllImport(SSC_libname, EntryPoint = "glfwGetMonitorPhysicalSize")] internal static extern unsafe void glfwGetMonitorPhysicalSize(IntPtr monitor, int* widthMM, int* heightMM); + [DllImport(SSC_libName, EntryPoint = "glfwGetMonitorPhysicalSize")] internal static extern unsafe void glfwGetMonitorPhysicalSize(IntPtr monitor, int* widthMM, int* heightMM); - [DllImport(SSC_libname, EntryPoint = "glfwGetMonitorContentScale")] internal static extern unsafe void glfwGetMonitorContentScale(IntPtr monitor, float* xscale, float* yscale); + [DllImport(SSC_libName, EntryPoint = "glfwGetMonitorContentScale")] internal static extern unsafe void glfwGetMonitorContentScale(IntPtr monitor, float* xscale, float* yscale); - [DllImport(SSC_libname, EntryPoint = "glfwGetMonitorName")] internal static extern unsafe byte* glfwGetMonitorName(IntPtr monitor); + [DllImport(SSC_libName, EntryPoint = "glfwGetMonitorName")] internal static extern unsafe byte* glfwGetMonitorName(IntPtr monitor); - [DllImport(SSC_libname, EntryPoint = "glfwSetMonitorUserPointer")] internal static extern unsafe void glfwSetMonitorUserPointer(IntPtr monitor, void* pointer); + [DllImport(SSC_libName, EntryPoint = "glfwSetMonitorUserPointer")] internal static extern unsafe void glfwSetMonitorUserPointer(IntPtr monitor, void* pointer); - [DllImport(SSC_libname, EntryPoint = "glfwGetMonitorUserPointer")] internal static extern unsafe void* glfwGetMonitorUserPointer(IntPtr monitor); + [DllImport(SSC_libName, EntryPoint = "glfwGetMonitorUserPointer")] internal static extern unsafe void* glfwGetMonitorUserPointer(IntPtr monitor); - [DllImport(SSC_libname, EntryPoint = "glfwSetMonitorCallback")] internal static extern unsafe GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetMonitorCallback")] internal static extern unsafe GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback); - [DllImport(SSC_libname, EntryPoint = "glfwGetVideoModes")] internal static extern unsafe GLFWvidmode* glfwGetVideoModes(IntPtr monitor, int* count); + [DllImport(SSC_libName, EntryPoint = "glfwGetVideoModes")] internal static extern unsafe glfwVideomode* glfwGetVideoModes(IntPtr monitor, int* count); - [DllImport(SSC_libname, EntryPoint = "glfwGetVideoMode")] internal static extern unsafe GLFWvidmode* glfwGetVideoMode(IntPtr monitor); + [DllImport(SSC_libName, EntryPoint = "glfwGetVideoMode")] internal static extern unsafe glfwVideomode* glfwGetVideoMode(IntPtr monitor); - [DllImport(SSC_libname, EntryPoint = "glfwSetGamma")] internal static extern unsafe void glfwSetGamma(IntPtr monitor, float gamma); + [DllImport(SSC_libName, EntryPoint = "glfwSetGamma")] internal static extern unsafe void glfwSetGamma(IntPtr monitor, float gamma); - [DllImport(SSC_libname, EntryPoint = "glfwGetGammaRamp")] internal static extern unsafe GLFWgammaramp* glfwGetGammaRamp(IntPtr monitor); + [DllImport(SSC_libName, EntryPoint = "glfwGetGammaRamp")] internal static extern unsafe glfwGammaramp* glfwGetGammaRamp(IntPtr monitor); - [DllImport(SSC_libname, EntryPoint = "glfwSetGammaRamp")] internal static extern unsafe void glfwSetGammaRamp(IntPtr monitor, GLFWgammaramp* ramp); + [DllImport(SSC_libName, EntryPoint = "glfwSetGammaRamp")] internal static extern unsafe void glfwSetGammaRamp(IntPtr monitor, glfwGammaramp* ramp); - [DllImport(SSC_libname, EntryPoint = "glfwDefaultWindowHints")] internal static extern unsafe void glfwDefaultWindowHints(); + [DllImport(SSC_libName, EntryPoint = "glfwDefaultWindowHints")] internal static extern unsafe void glfwDefaultWindowHints(); - [DllImport(SSC_libname, EntryPoint = "glfwWindowHint")] internal static extern unsafe void glfwWindowHint(int hint, int value); + [DllImport(SSC_libName, EntryPoint = "glfwWindowHint")] internal static extern unsafe void glfwWindowHint(int hint, int value); - [DllImport(SSC_libname, EntryPoint = "glfwWindowHintString")] internal static extern unsafe void glfwWindowHintString(int hint, byte* value); + [DllImport(SSC_libName, EntryPoint = "glfwWindowHintString")] internal static extern unsafe void glfwWindowHintString(int hint, byte* value); - [DllImport(SSC_libname, EntryPoint = "glfwCreateWindow")] internal static extern unsafe IntPtr glfwCreateWindow(int width, int height, byte[] title, IntPtr monitor, IntPtr share); + [DllImport(SSC_libName, EntryPoint = "glfwCreateWindow")] internal static extern unsafe IntPtr glfwCreateWindow(int width, int height, byte[] title, IntPtr monitor, IntPtr share); - [DllImport(SSC_libname, EntryPoint = "glfwDestroyWindow")] internal static extern unsafe void glfwDestroyWindow(IntPtr window); + [DllImport(SSC_libName, EntryPoint = "glfwDestroyWindow")] internal static extern unsafe void glfwDestroyWindow(IntPtr window); - [DllImport(SSC_libname, EntryPoint = "glfwWindowShouldClose")] internal static extern unsafe int glfwWindowShouldClose(IntPtr window); + [DllImport(SSC_libName, EntryPoint = "glfwWindowShouldClose")] internal static extern unsafe int glfwWindowShouldClose(IntPtr window); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowShouldClose")] internal static extern unsafe void glfwSetWindowShouldClose(IntPtr window, int value); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowShouldClose")] internal static extern unsafe void glfwSetWindowShouldClose(IntPtr window, int value); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowTitle")] internal static extern unsafe void glfwSetWindowTitle(IntPtr window, byte* title); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowTitle")] internal static extern unsafe void glfwSetWindowTitle(IntPtr window, byte* title); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowIcon")] internal static extern unsafe void glfwSetWindowIcon(IntPtr window, int count, GLFWimage* images); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowIcon")] internal static extern unsafe void glfwSetWindowIcon(IntPtr window, int count, GLFWimage* images); - [DllImport(SSC_libname, EntryPoint = "glfwGetWindowPos")] internal static extern unsafe void glfwGetWindowPos(IntPtr window, int* xpos, int* ypos); + [DllImport(SSC_libName, EntryPoint = "glfwGetWindowPos")] internal static extern unsafe void glfwGetWindowPos(IntPtr window, int* xpos, int* ypos); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowPos")] internal static extern unsafe void glfwSetWindowPos(IntPtr window, int xpos, int ypos); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowPos")] internal static extern unsafe void glfwSetWindowPos(IntPtr window, int xpos, int ypos); - [DllImport(SSC_libname, EntryPoint = "glfwGetWindowSize")] internal static extern unsafe void glfwGetWindowSize(IntPtr window, int* width, int* height); + [DllImport(SSC_libName, EntryPoint = "glfwGetWindowSize")] internal static extern unsafe void glfwGetWindowSize(IntPtr window, int* width, int* height); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowSizeLimits")] internal static extern unsafe void glfwSetWindowSizeLimits(IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowSizeLimits")] internal static extern unsafe void glfwSetWindowSizeLimits(IntPtr window, int minwidth, int minheight, int maxwidth, int maxheight); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowAspectRatio")] internal static extern unsafe void glfwSetWindowAspectRatio(IntPtr window, int numer, int denom); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowAspectRatio")] internal static extern unsafe void glfwSetWindowAspectRatio(IntPtr window, int numer, int denom); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowSize")] internal static extern unsafe void glfwSetWindowSize(IntPtr window, int width, int height); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowSize")] internal static extern unsafe void glfwSetWindowSize(IntPtr window, int width, int height); - [DllImport(SSC_libname, EntryPoint = "glfwGetFramebufferSize")] internal static extern unsafe void glfwGetFramebufferSize(IntPtr window, int* width, int* height); + [DllImport(SSC_libName, EntryPoint = "glfwGetFramebufferSize")] internal static extern unsafe void glfwGetFramebufferSize(IntPtr window, int* width, int* height); - [DllImport(SSC_libname, EntryPoint = "glfwGetWindowFrameSize")] internal static extern unsafe void glfwGetWindowFrameSize(IntPtr window, int* left, int* top, int* right, int* bottom); + [DllImport(SSC_libName, EntryPoint = "glfwGetWindowFrameSize")] internal static extern unsafe void glfwGetWindowFrameSize(IntPtr window, int* left, int* top, int* right, int* bottom); - [DllImport(SSC_libname, EntryPoint = "glfwGetWindowContentScale")] internal static extern unsafe void glfwGetWindowContentScale(IntPtr window, float* xscale, float* yscale); + [DllImport(SSC_libName, EntryPoint = "glfwGetWindowContentScale")] internal static extern unsafe void glfwGetWindowContentScale(IntPtr window, float* xscale, float* yscale); - [DllImport(SSC_libname, EntryPoint = "glfwGetWindowOpacity")] internal static extern unsafe float glfwGetWindowOpacity(IntPtr window); + [DllImport(SSC_libName, EntryPoint = "glfwGetWindowOpacity")] internal static extern unsafe float glfwGetWindowOpacity(IntPtr window); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowOpacity")] internal static extern unsafe void glfwSetWindowOpacity(IntPtr window, float opacity); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowOpacity")] internal static extern unsafe void glfwSetWindowOpacity(IntPtr window, float opacity); - [DllImport(SSC_libname, EntryPoint = "glfwIconifyWindow")] internal static extern unsafe void glfwIconifyWindow(IntPtr window); + [DllImport(SSC_libName, EntryPoint = "glfwIconifyWindow")] internal static extern unsafe void glfwIconifyWindow(IntPtr window); - [DllImport(SSC_libname, EntryPoint = "glfwRestoreWindow")] internal static extern unsafe void glfwRestoreWindow(IntPtr window); + [DllImport(SSC_libName, EntryPoint = "glfwRestoreWindow")] internal static extern unsafe void glfwRestoreWindow(IntPtr window); - [DllImport(SSC_libname, EntryPoint = "glfwMaximizeWindow")] internal static extern unsafe void glfwMaximizeWindow(IntPtr window); + [DllImport(SSC_libName, EntryPoint = "glfwMaximizeWindow")] internal static extern unsafe void glfwMaximizeWindow(IntPtr window); - [DllImport(SSC_libname, EntryPoint = "glfwShowWindow")] internal static extern unsafe void glfwShowWindow(IntPtr window); + [DllImport(SSC_libName, EntryPoint = "glfwShowWindow")] internal static extern unsafe void glfwShowWindow(IntPtr window); - [DllImport(SSC_libname, EntryPoint = "glfwHideWindow")] internal static extern unsafe void glfwHideWindow(IntPtr window); + [DllImport(SSC_libName, EntryPoint = "glfwHideWindow")] internal static extern unsafe void glfwHideWindow(IntPtr window); - [DllImport(SSC_libname, EntryPoint = "glfwFocusWindow")] internal static extern unsafe void glfwFocusWindow(IntPtr window); + [DllImport(SSC_libName, EntryPoint = "glfwFocusWindow")] internal static extern unsafe void glfwFocusWindow(IntPtr window); - [DllImport(SSC_libname, EntryPoint = "glfwRequestWindowAttention")] internal static extern unsafe void glfwRequestWindowAttention(IntPtr window); + [DllImport(SSC_libName, EntryPoint = "glfwRequestWindowAttention")] internal static extern unsafe void glfwRequestWindowAttention(IntPtr window); - [DllImport(SSC_libname, EntryPoint = "glfwGetWindowMonitor")] internal static extern unsafe IntPtr glfwGetWindowMonitor(IntPtr window); + [DllImport(SSC_libName, EntryPoint = "glfwGetWindowMonitor")] internal static extern unsafe IntPtr glfwGetWindowMonitor(IntPtr window); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowMonitor")] internal static extern unsafe void glfwSetWindowMonitor(IntPtr window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowMonitor")] internal static extern unsafe void glfwSetWindowMonitor(IntPtr window, IntPtr monitor, int xpos, int ypos, int width, int height, int refreshRate); - [DllImport(SSC_libname, EntryPoint = "glfwGetWindowAttrib")] internal static extern unsafe int glfwGetWindowAttrib(IntPtr window, int attrib); + [DllImport(SSC_libName, EntryPoint = "glfwGetWindowAttrib")] internal static extern unsafe int glfwGetWindowAttrib(IntPtr window, int attrib); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowAttrib")] internal static extern unsafe void glfwSetWindowAttrib(IntPtr window, int attrib, int value); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowAttrib")] internal static extern unsafe void glfwSetWindowAttrib(IntPtr window, int attrib, int value); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowUserPointer")] internal static extern unsafe void glfwSetWindowUserPointer(IntPtr window, void* pointer); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowUserPointer")] internal static extern unsafe void glfwSetWindowUserPointer(IntPtr window, void* pointer); - [DllImport(SSC_libname, EntryPoint = "glfwGetWindowUserPointer")] internal static extern unsafe void* glfwGetWindowUserPointer(IntPtr window); + [DllImport(SSC_libName, EntryPoint = "glfwGetWindowUserPointer")] internal static extern unsafe void* glfwGetWindowUserPointer(IntPtr window); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowPosCallback")] internal static extern unsafe GLFWwindowposfun glfwSetWindowPosCallback(IntPtr window, GLFWwindowposfun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowPosCallback")] internal static extern unsafe GLFWwindowposfun glfwSetWindowPosCallback(IntPtr window, GLFWwindowposfun callback); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowSizeCallback")] internal static extern unsafe GLFWwindowsizefun glfwSetWindowSizeCallback(IntPtr window, GLFWwindowsizefun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowSizeCallback")] internal static extern unsafe GLFWwindowsizefun glfwSetWindowSizeCallback(IntPtr window, GLFWwindowsizefun callback); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowCloseCallback")] internal static extern unsafe GLFWwindowclosefun glfwSetWindowCloseCallback(IntPtr window, GLFWwindowclosefun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowCloseCallback")] internal static extern unsafe GLFWwindowclosefun glfwSetWindowCloseCallback(IntPtr window, GLFWwindowclosefun callback); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowRefreshCallback")] internal static extern unsafe GLFWwindowrefreshfun glfwSetWindowRefreshCallback(IntPtr window, GLFWwindowrefreshfun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowRefreshCallback")] internal static extern unsafe GLFWwindowrefreshfun glfwSetWindowRefreshCallback(IntPtr window, GLFWwindowrefreshfun callback); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowFocusCallback")] internal static extern unsafe GLFWwindowfocusfun glfwSetWindowFocusCallback(IntPtr window, GLFWwindowfocusfun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowFocusCallback")] internal static extern unsafe GLFWwindowfocusfun glfwSetWindowFocusCallback(IntPtr window, GLFWwindowfocusfun callback); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowIconifyCallback")] internal static extern unsafe GLFWwindowiconifyfun glfwSetWindowIconifyCallback(IntPtr window, GLFWwindowiconifyfun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowIconifyCallback")] internal static extern unsafe GLFWwindowiconifyfun glfwSetWindowIconifyCallback(IntPtr window, GLFWwindowiconifyfun callback); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowMaximizeCallback")] internal static extern unsafe GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(IntPtr window, GLFWwindowmaximizefun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowMaximizeCallback")] internal static extern unsafe GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(IntPtr window, GLFWwindowmaximizefun callback); - [DllImport(SSC_libname, EntryPoint = "glfwSetFramebufferSizeCallback")] internal static extern unsafe FramebuffersizeHandler glfwSetFramebufferSizeCallback(IntPtr window, IntPtr callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetFramebufferSizeCallback")] internal static extern unsafe FramebuffersizeHandler glfwSetFramebufferSizeCallback(IntPtr window, IntPtr callback); - [DllImport(SSC_libname, EntryPoint = "glfwSetWindowContentScaleCallback")] internal static extern unsafe GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(IntPtr window, GLFWwindowcontentscalefun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetWindowContentScaleCallback")] internal static extern unsafe GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(IntPtr window, GLFWwindowcontentscalefun callback); - [DllImport(SSC_libname, EntryPoint = "glfwPollEvents")] internal static extern unsafe void glfwPollEvents(); + [DllImport(SSC_libName, EntryPoint = "glfwPollEvents")] internal static extern unsafe void glfwPollEvents(); - [DllImport(SSC_libname, EntryPoint = "glfwWaitEvents")] internal static extern unsafe void glfwWaitEvents(); + [DllImport(SSC_libName, EntryPoint = "glfwWaitEvents")] internal static extern unsafe void glfwWaitEvents(); - [DllImport(SSC_libname, EntryPoint = "glfwWaitEventsTimeout")] internal static extern unsafe void glfwWaitEventsTimeout(double timeout); + [DllImport(SSC_libName, EntryPoint = "glfwWaitEventsTimeout")] internal static extern unsafe void glfwWaitEventsTimeout(double timeout); - [DllImport(SSC_libname, EntryPoint = "glfwPostEmptyEvent")] internal static extern unsafe void glfwPostEmptyEvent(); + [DllImport(SSC_libName, EntryPoint = "glfwPostEmptyEvent")] internal static extern unsafe void glfwPostEmptyEvent(); - [DllImport(SSC_libname, EntryPoint = "glfwGetInputMode")] internal static extern unsafe int glfwGetInputMode(IntPtr window, int mode); + [DllImport(SSC_libName, EntryPoint = "glfwGetInputMode")] internal static extern unsafe int glfwGetInputMode(IntPtr window, int mode); - [DllImport(SSC_libname, EntryPoint = "glfwSetInputMode")] internal static extern unsafe void glfwSetInputMode(IntPtr window, int mode, int value); + [DllImport(SSC_libName, EntryPoint = "glfwSetInputMode")] internal static extern unsafe void glfwSetInputMode(IntPtr window, int mode, int value); - [DllImport(SSC_libname, EntryPoint = "glfwRawMouseMotionSupported")] internal static extern unsafe int glfwRawMouseMotionSupported(); + [DllImport(SSC_libName, EntryPoint = "glfwRawMouseMotionSupported")] internal static extern unsafe int glfwRawMouseMotionSupported(); - [DllImport(SSC_libname, EntryPoint = "glfwGetKeyName")] internal static extern unsafe byte* glfwGetKeyName(int key, int scancode); + [DllImport(SSC_libName, EntryPoint = "glfwGetKeyName")] internal static extern unsafe byte* glfwGetKeyName(int key, int scancode); - [DllImport(SSC_libname, EntryPoint = "glfwGetKeyScancode")] internal static extern unsafe int glfwGetKeyScancode(int key); + [DllImport(SSC_libName, EntryPoint = "glfwGetKeyScancode")] internal static extern unsafe int glfwGetKeyScancode(int key); - [DllImport(SSC_libname, EntryPoint = "glfwGetKey")] internal static extern unsafe KeyStatus glfwGetKey(IntPtr window, int key); + [DllImport(SSC_libName, EntryPoint = "glfwGetKey")] internal static extern unsafe KeyStatus glfwGetKey(IntPtr window, int key); - [DllImport(SSC_libname, EntryPoint = "glfwGetMouseButton")] internal static extern unsafe int glfwGetMouseButton(IntPtr window, int button); + [DllImport(SSC_libName, EntryPoint = "glfwGetMouseButton")] internal static extern unsafe int glfwGetMouseButton(IntPtr window, int button); - [DllImport(SSC_libname, EntryPoint = "glfwGetCursorPos")] internal static extern unsafe void glfwGetCursorPos(IntPtr window, double* xpos, double* ypos); + [DllImport(SSC_libName, EntryPoint = "glfwGetCursorPos")] internal static extern unsafe void glfwGetCursorPos(IntPtr window, double* xpos, double* ypos); - [DllImport(SSC_libname, EntryPoint = "glfwSetCursorPos")] internal static extern unsafe void glfwSetCursorPos(IntPtr window, double xpos, double ypos); + [DllImport(SSC_libName, EntryPoint = "glfwSetCursorPos")] internal static extern unsafe void glfwSetCursorPos(IntPtr window, double xpos, double ypos); - [DllImport(SSC_libname, EntryPoint = "glfwCreateCursor")] internal static extern unsafe GLFWcursor* glfwCreateCursor(GLFWimage* image, int xhot, int yhot); + [DllImport(SSC_libName, EntryPoint = "glfwCreateCursor")] internal static extern unsafe GLFWcursor* glfwCreateCursor(GLFWimage* image, int xhot, int yhot); - [DllImport(SSC_libname, EntryPoint = "glfwCreateStandardCursor")] internal static extern unsafe GLFWcursor* glfwCreateStandardCursor(int shape); + [DllImport(SSC_libName, EntryPoint = "glfwCreateStandardCursor")] internal static extern unsafe GLFWcursor* glfwCreateStandardCursor(int shape); - [DllImport(SSC_libname, EntryPoint = "glfwDestroyCursor")] internal static extern unsafe void glfwDestroyCursor(GLFWcursor* cursor); + [DllImport(SSC_libName, EntryPoint = "glfwDestroyCursor")] internal static extern unsafe void glfwDestroyCursor(GLFWcursor* cursor); - [DllImport(SSC_libname, EntryPoint = "glfwSetCursor")] internal static extern unsafe void glfwSetCursor(IntPtr window, GLFWcursor* cursor); + [DllImport(SSC_libName, EntryPoint = "glfwSetCursor")] internal static extern unsafe void glfwSetCursor(IntPtr window, GLFWcursor* cursor); - [DllImport(SSC_libname, EntryPoint = "glfwSetKeyCallback")] internal static extern unsafe GLFWkeyfun glfwSetKeyCallback(IntPtr window, GLFWkeyfun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetKeyCallback")] internal static extern unsafe GLFWkeyfun glfwSetKeyCallback(IntPtr window, GLFWkeyfun callback); - [DllImport(SSC_libname, EntryPoint = "glfwSetCharCallback")] internal static extern unsafe GLFWcharfun glfwSetCharCallback(IntPtr window, GLFWcharfun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetCharCallback")] internal static extern unsafe GLFWcharfun glfwSetCharCallback(IntPtr window, GLFWcharfun callback); - [DllImport(SSC_libname, EntryPoint = "glfwSetCharModsCallback")] internal static extern unsafe GLFWcharmodsfun glfwSetCharModsCallback(IntPtr window, GLFWcharmodsfun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetCharModsCallback")] internal static extern unsafe GLFWcharmodsfun glfwSetCharModsCallback(IntPtr window, GLFWcharmodsfun callback); - [DllImport(SSC_libname, EntryPoint = "glfwSetMouseButtonCallback")] internal static extern unsafe GLFWmousebuttonfun glfwSetMouseButtonCallback(IntPtr window, GLFWmousebuttonfun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetMouseButtonCallback")] internal static extern unsafe GLFWmousebuttonfun glfwSetMouseButtonCallback(IntPtr window, GLFWmousebuttonfun callback); - [DllImport(SSC_libname, EntryPoint = "glfwSetCursorPosCallback")] internal static extern unsafe GLFWcursorposfun glfwSetCursorPosCallback(IntPtr window, GLFWcursorposfun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetCursorPosCallback")] internal static extern unsafe GLFWcursorposfun glfwSetCursorPosCallback(IntPtr window, GLFWcursorposfun callback); - [DllImport(SSC_libname, EntryPoint = "glfwSetCursorEnterCallback")] internal static extern unsafe GLFWcursorenterfun glfwSetCursorEnterCallback(IntPtr window, GLFWcursorenterfun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetCursorEnterCallback")] internal static extern unsafe GLFWcursorenterfun glfwSetCursorEnterCallback(IntPtr window, GLFWcursorenterfun callback); - [DllImport(SSC_libname, EntryPoint = "glfwSetScrollCallback")] internal static extern unsafe GLFWscrollfun glfwSetScrollCallback(IntPtr window, GLFWscrollfun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetScrollCallback")] internal static extern unsafe GLFWscrollfun glfwSetScrollCallback(IntPtr window, GLFWscrollfun callback); - [DllImport(SSC_libname, EntryPoint = "glfwSetDropCallback")] internal static extern unsafe GLFWdropfun glfwSetDropCallback(IntPtr window, GLFWdropfun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetDropCallback")] internal static extern unsafe GLFWdropfun glfwSetDropCallback(IntPtr window, GLFWdropfun callback); - [DllImport(SSC_libname, EntryPoint = "glfwJoystickPresent")] internal static extern unsafe int glfwJoystickPresent(int jid); + [DllImport(SSC_libName, EntryPoint = "glfwJoystickPresent")] internal static extern unsafe int glfwJoystickPresent(int jid); - [DllImport(SSC_libname, EntryPoint = "glfwGetJoystickAxes")] internal static extern unsafe float* glfwGetJoystickAxes(int jid, int* count); + [DllImport(SSC_libName, EntryPoint = "glfwGetJoystickAxes")] internal static extern unsafe float* glfwGetJoystickAxes(int jid, int* count); - [DllImport(SSC_libname, EntryPoint = "glfwGetJoystickButtons")] internal static extern unsafe byte* glfwGetJoystickButtons(int jid, int* count); + [DllImport(SSC_libName, EntryPoint = "glfwGetJoystickButtons")] internal static extern unsafe byte* glfwGetJoystickButtons(int jid, int* count); - [DllImport(SSC_libname, EntryPoint = "glfwGetJoystickHats")] internal static extern unsafe byte* glfwGetJoystickHats(int jid, int* count); + [DllImport(SSC_libName, EntryPoint = "glfwGetJoystickHats")] internal static extern unsafe byte* glfwGetJoystickHats(int jid, int* count); - [DllImport(SSC_libname, EntryPoint = "glfwGetJoystickName")] internal static extern unsafe byte* glfwGetJoystickName(int jid); + [DllImport(SSC_libName, EntryPoint = "glfwGetJoystickName")] internal static extern unsafe byte* glfwGetJoystickName(int jid); - [DllImport(SSC_libname, EntryPoint = "glfwGetJoystickGUID")] internal static extern unsafe byte* glfwGetJoystickGUID(int jid); + [DllImport(SSC_libName, EntryPoint = "glfwGetJoystickGUID")] internal static extern unsafe byte* glfwGetJoystickGUID(int jid); - [DllImport(SSC_libname, EntryPoint = "glfwSetJoystickUserPointer")] internal static extern unsafe void glfwSetJoystickUserPointer(int jid, void* pointer); + [DllImport(SSC_libName, EntryPoint = "glfwSetJoystickUserPointer")] internal static extern unsafe void glfwSetJoystickUserPointer(int jid, void* pointer); - [DllImport(SSC_libname, EntryPoint = "glfwGetJoystickUserPointer")] internal static extern unsafe void* glfwGetJoystickUserPointer(int jid); + [DllImport(SSC_libName, EntryPoint = "glfwGetJoystickUserPointer")] internal static extern unsafe void* glfwGetJoystickUserPointer(int jid); - [DllImport(SSC_libname, EntryPoint = "glfwJoystickIsGamepad")] internal static extern unsafe int glfwJoystickIsGamepad(int jid); + [DllImport(SSC_libName, EntryPoint = "glfwJoystickIsGamepad")] internal static extern unsafe int glfwJoystickIsGamepad(int jid); - [DllImport(SSC_libname, EntryPoint = "glfwSetJoystickCallback")] internal static extern unsafe GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback); + [DllImport(SSC_libName, EntryPoint = "glfwSetJoystickCallback")] internal static extern unsafe GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback); - [DllImport(SSC_libname, EntryPoint = "glfwUpdateGamepadMappings")] internal static extern unsafe int glfwUpdateGamepadMappings(byte* str); + [DllImport(SSC_libName, EntryPoint = "glfwUpdateGamepadMappings")] internal static extern unsafe int glfwUpdateGamepadMappings(byte* str); - [DllImport(SSC_libname, EntryPoint = "glfwGetGamepadName")] internal static extern unsafe byte* glfwGetGamepadName(int jid); + [DllImport(SSC_libName, EntryPoint = "glfwGetGamepadName")] internal static extern unsafe byte* glfwGetGamepadName(int jid); - [DllImport(SSC_libname, EntryPoint = "glfwGetGamepadState")] internal static extern unsafe int glfwGetGamepadState(int jid, GLFWgamepadstate* state); + [DllImport(SSC_libName, EntryPoint = "glfwGetGamepadState")] internal static extern unsafe int glfwGetGamepadState(int jid, GLFWgamepadstate* state); - [DllImport(SSC_libname, EntryPoint = "glfwSetClipboardString")] internal static extern unsafe void glfwSetClipboardString(IntPtr window, byte* str); + [DllImport(SSC_libName, EntryPoint = "glfwSetClipboardString")] internal static extern unsafe void glfwSetClipboardString(IntPtr window, byte* str); - [DllImport(SSC_libname, EntryPoint = "glfwGetClipboardString")] internal static extern unsafe byte* glfwGetClipboardString(IntPtr window); + [DllImport(SSC_libName, EntryPoint = "glfwGetClipboardString")] internal static extern unsafe byte* glfwGetClipboardString(IntPtr window); - [DllImport(SSC_libname, EntryPoint = "glfwGetTime")] internal static extern unsafe double glfwGetTime(); + [DllImport(SSC_libName, EntryPoint = "glfwGetTime")] internal static extern unsafe double glfwGetTime(); - [DllImport(SSC_libname, EntryPoint = "glfwSetTime")] internal static extern unsafe void glfwSetTime(double time); + [DllImport(SSC_libName, EntryPoint = "glfwSetTime")] internal static extern unsafe void glfwSetTime(double time); - [DllImport(SSC_libname, EntryPoint = "glfwGetTimerValue")] internal static extern unsafe ulong* glfwGetTimerValue(); + [DllImport(SSC_libName, EntryPoint = "glfwGetTimerValue")] internal static extern unsafe ulong* glfwGetTimerValue(); - [DllImport(SSC_libname, EntryPoint = "glfwGetTimerFrequency")] internal static extern unsafe ulong* glfwGetTimerFrequency(); + [DllImport(SSC_libName, EntryPoint = "glfwGetTimerFrequency")] internal static extern unsafe ulong* glfwGetTimerFrequency(); - [DllImport(SSC_libname, EntryPoint = "glfwMakeContextCurrent")] internal static extern unsafe void glfwMakeContextCurrent(IntPtr window); + [DllImport(SSC_libName, EntryPoint = "glfwMakeContextCurrent")] internal static extern unsafe void glfwMakeContextCurrent(IntPtr window); - [DllImport(SSC_libname, EntryPoint = "glfwGetCurrentContext")] internal static extern unsafe IntPtr glfwGetCurrentContext(); + [DllImport(SSC_libName, EntryPoint = "glfwGetCurrentContext")] internal static extern unsafe IntPtr glfwGetCurrentContext(); - [DllImport(SSC_libname, EntryPoint = "glfwSwapBuffers")] internal static extern unsafe void glfwSwapBuffers(IntPtr window); + [DllImport(SSC_libName, EntryPoint = "glfwSwapBuffers")] internal static extern unsafe void glfwSwapBuffers(IntPtr window); - [DllImport(SSC_libname, EntryPoint = "glfwSwapInterval")] internal static extern unsafe void glfwSwapInterval(int interval); + [DllImport(SSC_libName, EntryPoint = "glfwSwapInterval")] internal static extern unsafe void glfwSwapInterval(int interval); - [DllImport(SSC_libname, EntryPoint = "glfwExtensionSupported")] internal static extern unsafe int glfwExtensionSupported(byte* extension); + [DllImport(SSC_libName, EntryPoint = "glfwExtensionSupported")] internal static extern unsafe int glfwExtensionSupported(byte* extension); - [DllImport(SSC_libname, EntryPoint = "glfwGetProcAddress", CharSet = CharSet.Ansi)] internal static extern unsafe IntPtr glfwGetProcAddress(string procname); + [DllImport(SSC_libName, EntryPoint = "glfwGetProcAddress", CharSet = CharSet.Ansi)] internal static extern unsafe IntPtr glfwGetProcAddress(string procname); - [DllImport(SSC_libname, EntryPoint = "glfwVulkanSupported")] internal static extern unsafe int glfwVulkanSupported(); + [DllImport(SSC_libName, EntryPoint = "glfwVulkanSupported")] internal static extern unsafe int glfwVulkanSupported(); - [DllImport(SSC_libname, EntryPoint = "glfwGetRequiredInstanceExtensions")] internal static extern unsafe byte** glfwGetRequiredInstanceExtensions(uint* count); + [DllImport(SSC_libName, EntryPoint = "glfwGetRequiredInstanceExtensions")] internal static extern unsafe 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, GLFWwindow* window, VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); + //[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwCreateWindowSurface")] internal extern unsafe static VkResult glfwCreateWindowSurface(VkInstance instance, glfwWindow* window, VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); #endregion api call } diff --git a/源代码/StgSharpDebug/Logic b/源代码/StgSharpDebug/Logic deleted file mode 120000 index 3ca0a979..00000000 --- a/源代码/StgSharpDebug/Logic +++ /dev/null @@ -1 +0,0 @@ -D:/NitloadIndustry/研究项目/1-Flagship/TH2020/ProjectFile/源代码/StgSharp/Logic \ No newline at end of file diff --git a/源代码/StgSharpDebug/Logic/Blueprint/Blueprint.cs b/源代码/StgSharpDebug/Logic/Blueprint/Blueprint.cs new file mode 100644 index 00000000..c5f5ab78 --- /dev/null +++ b/源代码/StgSharpDebug/Logic/Blueprint/Blueprint.cs @@ -0,0 +1,254 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Blueprint.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp; +using StgSharp.Logic; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Xml.Serialization; + +namespace StgSharp.Logic +{ + public partial class Blueprint : IConvertableToBlueprintNode + { + private BeginningNode beginNode; + private Dictionary allNode; + private EndingNode endNode; + private Func terminate; + + private int currentNodeIndex; + private List allThread; + private List nativeNodeList; + private List nodeList; + + public Blueprint() + { + allNode = new Dictionary(); + allThread = new List(); + nodeList = new List(); + nativeNodeList = new List(); + terminate = () => true; + beginNode = new BeginningNode(); + endNode = new EndingNode(); + } + + public BlueprintNode BeginLayer => beginNode; + public BlueprintNode EndLayer => endNode; + + public bool IsRunning => allThread.Any(t => t.Status == TaskStatus.Running); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public (string name, BlueprintPipelineArgs arg)[] GetOutput() + { + return endNode.OutputData; + } + + public void Init(int threadCount) + { + if (threadCount > nodeList.Count) + { + InternalIO.InternalWriteLog( + "Thread setting error: amount of threads of this blueprint is larger than amount of nodes.", LogType.Warning); + threadCount = nodeList.Count; + } + if (threadCount!=0) + { + foreach (var item in allNode) + { + if (item.Value.IsNative) + { + nativeNodeList.Add(item.Value); + } + else + { + nodeList.Add(item.Value); + } + } + nativeNodeList.Sort(); + PrepareTasks(threadCount); + } + else + { + foreach (var item in allNode) + { + nodeList.Add(item.Value); + } + } + nodeList.Sort(); + } + + public void PrepareTasks(int count) + { + for (int i = 0; i < count; i++) + { + allThread.Add(new Task(IndividualTask)); + } + } + + private void IndividualTask() + { + do + { + BlueprintNode node; + while (RequestNextNode(out node)) + { + node.Run(); + } + } while (!terminate()); + } + + /// + /// Run all nodes repeatedly until it is instructed to terminate. + /// + /// Instructor to terminate all tasks. Returns if tasks should terminate + public void RunRepeatedly(Func terminateInstructor) + { + if (allThread.Count != 0) + { + MultiThreadRun(terminateInstructor); + return; + } + SingleThreadRun(terminateInstructor); + } + + private void MultiThreadRun(Func terminateInstructor) + { + if (terminate != terminateInstructor) + { + terminate = terminateInstructor; + if (allThread.Count != 0) + { + foreach (var t in allThread) + { + t.Start(); + } + } + } + beginNode.Run(); + foreach (var node in nativeNodeList) + { + node.Run(); + } + EndLayer.Run(); + } + + private void SingleThreadRun(Func terminateInstructor) + { + beginNode.Run(); + foreach (var item in nodeList) + { + item.Run(); + } + EndLayer.Run(); + } + + public void AddNativeNode(BlueprintNode node) + { + node.IsNative = true; + allNode.Add(node.Name, node); + } + + public void AddAsyncNode(BlueprintNode node) + { + node.IsNative = false; + allNode.Add(node.Name, node); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetInput(params (string name, BlueprintPipelineArgs arg)[] parameters) + { + beginNode.InputData = parameters; + } + + private bool RequestNextNode(out BlueprintNode node) + { + if (currentNodeIndex < nodeList.Count) + { + BlueprintNode ret = nodeList[currentNodeIndex]; + Interlocked.Increment(ref currentNodeIndex); + node = ret; + return true; + } + Interlocked.Exchange(ref currentNodeIndex, 0); + node = default!; + return false; + } + + string[] IConvertableToBlueprintNode.InputInterfacesName + { + get + { + return beginNode.OutputInterfaces.Select( + p => p.Key).ToArray(); + } + } + + BlueprintNodeAction IConvertableToBlueprintNode.MainExecution + { + get + { + return (in Dictionary input, + in Dictionary output) + => + { + beginNode.Run(); + foreach (var node in nativeNodeList) + { + node.Run(); + } + endNode.Run(); + }; + } + } + + string[] IConvertableToBlueprintNode.OutputInterfacesName + { + get + { + return beginNode.OutputInterfaces.Select( + p => p.Key).ToArray(); + } + } + } + + internal class NodeClearException : Exception + { + + } +} diff --git a/源代码/StgSharpDebug/Logic/Blueprint/BlueprintNode.cs b/源代码/StgSharpDebug/Logic/Blueprint/BlueprintNode.cs new file mode 100644 index 00000000..6f9c9415 --- /dev/null +++ b/源代码/StgSharpDebug/Logic/Blueprint/BlueprintNode.cs @@ -0,0 +1,316 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="BlueprintNode.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + + +using StgSharp.Entities; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace StgSharp.Logic +{ + public delegate void BlueprintNodeAction( + in Dictionary inpput, + in Dictionary output); + + + + /// + /// + /// + /// + /// Reset pipeline has risk, this operation is a direct operation to port + /// in current node, the port on the other node cannot get the change. + /// +#pragma warning disable CA1036 + public class BlueprintNode : IComparable +#pragma warning restore CA1036 + { + private BlueprintNodeAction mainOperation; + + private protected bool levelAvailable, nativeRequested; + private protected int _level; + private string name; + + private protected Dictionary _inputInterfaces; + private protected Dictionary _outputInterfaces; + + + internal BlueprintNode(string name, + BlueprintNodeAction operation, bool isNative, + string[] inputPorts, + string[] outputPorts) + { + this.levelAvailable = false; + this.name = name; + nativeRequested = isNative; + mainOperation = operation; + _inputInterfaces = new Dictionary(); + _outputInterfaces = new Dictionary(); + if (inputPorts.Length == 0 ) + { + throw new ArgumentNullException(nameof(inputPorts)); + } + if (outputPorts.Length == 0) + { + throw new ArgumentNullException(nameof(outputPorts)); + } + foreach (var portName in inputPorts) + { + _inputInterfaces.Add(portName, null); + } + foreach (var portName in outputPorts) + { + _outputInterfaces.Add(portName, null); + } + } + + + public BlueprintNode(string name, IConvertableToBlueprintNode convertable) + { + this.levelAvailable = false; + this.name = name; + _inputInterfaces = new Dictionary(); + _outputInterfaces = new Dictionary(); + mainOperation = convertable.MainExecution; + foreach (var soket in convertable.InputInterfacesName) + { + _inputInterfaces.Add(soket, null); + } + foreach (var soket in convertable.OutputInterfacesName) + { + _outputInterfaces.Add(soket, null); + } + } + + public BlueprintNode(string name, + string[] inputPorts, + string[] outputPorts + ) + { + this.levelAvailable = false; + this.name = name; + _inputInterfaces = new Dictionary(); + _outputInterfaces = new Dictionary(); + if (inputPorts.Length * outputPorts.Length == 0) + { + throw new Exception(); + } + foreach (var portName in inputPorts) + { + _inputInterfaces.Add(portName, null); + } + foreach (var portName in outputPorts) + { + _outputInterfaces.Add(portName, null); + } + } + + public bool IsNative + { + get => nativeRequested; + internal set => nativeRequested = value; + } + + public int Level + { + get + { + if (levelAvailable) + { + return _level; + } + _level = 0; + foreach (var item in _inputInterfaces) + { + if (item.Value == null) + { + continue; + } + if (_level <= item.Value.Level) + { + _level = item.Value.Level; + } + } + _level += 1; + return _level; + } + } + + public string Name => name; + + internal Dictionary InputInterfaces => _inputInterfaces; + internal Dictionary OutputInterfaces => _outputInterfaces; + + + public void AddAfter( + BlueprintNode former, + string formerOutputPortName, + string thisInputPortName) + { + this.levelAvailable = false; + BlueprintPipeline pipeline = new BlueprintPipeline(former, this); + if (former is BeginningNode bnode) + { + bnode.SetCertainOutputPort(formerOutputPortName, pipeline); + } + else + { + former.SetCertainOutputPort(formerOutputPortName, pipeline); + } + SetCertainInputPort(thisInputPortName, pipeline); + } + + + public void AddBefore( + BlueprintNode after, + string thisOutputPortName, + string afterInputPortName) + { + this.levelAvailable = false; + BlueprintPipeline pipeline = new BlueprintPipeline(this, after); + if (after is EndingNode enode) + { + enode.SetCertainInputPort(afterInputPortName, pipeline); + } + else + { + after.SetCertainInputPort(afterInputPortName, pipeline); + } + SetCertainOutputPort(thisOutputPortName, pipeline); + } + + + public void Run() + { + try + { + //Console.WriteLine(name); + BlueprintPipeline.WaitAll(_inputInterfaces); + mainOperation(in _inputInterfaces, in _outputInterfaces); + } + catch (Exception) + { + throw; + } + } + + public int CompareTo(BlueprintNode other) + { +#pragma warning disable CA1062 + return this.Level.CompareTo(other.Level); +#pragma warning restore CA1062 + } + + #region port operation + + public BlueprintPipeline GetCertainInputPort(string name) + { + BlueprintPipeline ret; + if (!_inputInterfaces.TryGetValue(name,out ret)) + { + throw new Exception($"Cannot find the interface named {name} in node {Name}."); + } + return ret; + } + + + public BlueprintPipeline GetCertainOutputPort(string name) + { + BlueprintPipeline ret; + if (!_outputInterfaces.TryGetValue(name, out ret)) + { + throw new Exception($"Cannot find the interface named {name} in node {Name}."); + } + return ret; + } + + public void SetCertainInputPort(string name, BlueprintPipeline pipeline) + { + if (!_inputInterfaces.ContainsKey(name)) + { + throw new Exception($"Cannot find the interface named {name} in node {Name}."); + } + _inputInterfaces[name] = pipeline; + } + + public void SetCertainOutputPort(string name, BlueprintPipeline pipeline) + { + if (!_outputInterfaces.ContainsKey(name)) + { + throw new Exception($"Cannot find the interface named {name} in node {Name}."); + } + _outputInterfaces[name] = pipeline; + } + + #endregion + + + }//--------------------------------- end of class ----------------------------------- + + public interface IConvertableToBlueprintNode + { + + public string[] InputInterfacesName { get; } + public BlueprintNodeAction MainExecution { get; } + public string[] OutputInterfacesName { get; } + + } + + public class BlueprintNodeRunException : Exception + { + public BlueprintNodeRunException() + { + } + + public BlueprintNodeRunException(Exception ex) : base(string.Empty, ex) + { + } + + public BlueprintNodeRunException(string message) : base(message) + { + } + + public BlueprintNodeRunException(string message, Exception innerException) : base(message, innerException) + { + } + + protected BlueprintNodeRunException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } + +} diff --git a/源代码/StgSharpDebug/Logic/Blueprint/CrossCycleProcess.cs b/源代码/StgSharpDebug/Logic/Blueprint/CrossCycleProcess.cs new file mode 100644 index 00000000..8b7725dc --- /dev/null +++ b/源代码/StgSharpDebug/Logic/Blueprint/CrossCycleProcess.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Logic +{ + /* + public class CrossCycleProcess:BlueprintNode + { + + public CrossCycleProcess(string name, Action operation) + :base() + { + + } + + } + /**/ +} diff --git a/源代码/StgSharp/Logic/BluePaintNode.cs b/源代码/StgSharpDebug/Logic/Blueprint/PipeLine.cs similarity index 53% rename from 源代码/StgSharp/Logic/BluePaintNode.cs rename to 源代码/StgSharpDebug/Logic/Blueprint/PipeLine.cs index c7014a5b..7f9aedd6 100644 --- a/源代码/StgSharp/Logic/BluePaintNode.cs +++ b/源代码/StgSharpDebug/Logic/Blueprint/PipeLine.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="BluePaintNode.cs" +// file="PipeLine.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -28,92 +28,99 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- -using StgSharpDebug.Logic; - using System; using System.Collections.Generic; using System.Linq; +using System.Numerics; +using System.Security.Authentication.ExtendedProtection; using System.Text; using System.Threading; using System.Threading.Tasks; namespace StgSharp.Logic { - public delegate void BluePaintNodeAction( - in Dictionary inpput, - in Dictionary output); - public abstract class BluePaintNode - { - private BluePaintNodeAction mainOperation; - - private BluePaint local; - - private Dictionary inputInterfaces; - private Dictionary outputInterface; - - private bool running; - - private string name; - - internal Dictionary InputInterfaces => inputInterfaces; - internal Dictionary OutputInterface => outputInterface; - - internal BluePaintNode(string name, bool isTaskSurvival) - { - this.name = name; - SurvivalTask = isTaskSurvival; - } - - - - protected BluePaintNode(string name, BluePaintNodeAction operation) - { - this.name = name; - mainOperation = operation; - } - - internal bool SurvivalTask - { - get; set; - } - - public void Run() - { - foreach (var item in inputInterfaces) - { - item.Value.WaitForStart(); - } - mainOperation(in inputInterfaces, in outputInterface); - }//--------------------------------- end of class ----------------------------- - } - - public class BluePaintPipeline + public class BlueprintPipeline { + private BlueprintNode after; + private BlueprintNode former; + private BlueprintPipelineArgs args; private SemaphoreSlim formerCompleteSemaphore; - private BluePaintPipelineArgs args; - - public BluePaintPipeline() + public BlueprintPipeline(BlueprintNode former, BlueprintNode after) { - formerCompleteSemaphore = new SemaphoreSlim(initialCount: 0,maxCount:1); + this.former = former; + this.after = after; + formerCompleteSemaphore = new SemaphoreSlim(initialCount: 0, maxCount: 1); } - public void CompleteAndWriteData(BluePaintPipelineArgs args) + public BlueprintNode After => after; + + public BlueprintNode Former => former; + + public int Level => former.Level; + + public BlueprintPipelineArgs Args { + get => args; + set => args = value; + } + + public void CompleteAndSkip() + { + //Console.WriteLine($"Complete\t{former.ContextName}\t->\t{after.ContextName}"); formerCompleteSemaphore.Release(); + } + + public void CompleteAndWriteData(BlueprintPipelineArgs args) + { this.args = args; + //Console.WriteLine($"Complete\t{former.ContextName}\t->\t{after.ContextName}"); + formerCompleteSemaphore.Release(); + } + + public static void SkipAll(Dictionary ports) + { + if (ports == null) + { + throw new ArgumentNullException(nameof(ports)); + } + foreach (var item in ports) + { + if (item.Value!=null) + { + item.Value.CompleteAndSkip(); + } + } + } + + public static void WaitAll(Dictionary ports) + { + if (ports == null) + { + throw new ArgumentNullException(nameof(ports)); + } + foreach (var item in ports) + { + if (item.Value!=null) + { + item.Value.WaitForStart(); + } + } } public void WaitForStart() { - formerCompleteSemaphore.Release(); + //Console.WriteLine($"Waiting \t{former.ContextName}\t->\t{after.ContextName}"); + formerCompleteSemaphore.Wait(); } } - public abstract class BluePaintPipelineArgs + public abstract class BlueprintPipelineArgs { + public object? Value { get; set; } + } } diff --git a/源代码/StgSharpDebug/Logic/Blueprint/RouteSwitch.cs b/源代码/StgSharpDebug/Logic/Blueprint/RouteSwitch.cs new file mode 100644 index 00000000..68bac730 --- /dev/null +++ b/源代码/StgSharpDebug/Logic/Blueprint/RouteSwitch.cs @@ -0,0 +1,182 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="RouteSwitch.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection.Emit; +using System.Security.Cryptography.X509Certificates; +using System.Text; + +namespace StgSharp.Logic +{ + public class RouteSwitch : BlueprintNode + { + private protected Dictionary openingRule)> outputDictionary; + + public RouteSwitch(string name, string inputPorts) : + base(name, [inputPorts], [string.Empty]) + { + outputDictionary = new Dictionary openingRule)>(); + } + + public new int Level + { + get + { + if (levelAvailable) + { + return _level; + } + _level = 0; + KeyValuePair item = _inputInterfaces.First(); + if (item.Value == null) + { + throw new InvalidOperationException(); + } + if (_level <= item.Value.Level) + { + _level = item.Value.Level; + } + return _level; + } + } + + public new void AddBefore( + BlueprintNode after, + string thisOutputPortName, + string afterInputPortName) + { + this.AppendNode(after, afterInputPortName, () => true); + } + + public void AppendNode(BlueprintNode node, string portName, Func openningRule) + { + if (node == null) + { + throw new ArgumentNullException(nameof(node)); + } + string indexName = $"{node.Name}.{portName}"; + BlueprintPipeline p = new BlueprintPipeline(this, node); + node.InputInterfaces[portName] = p; + outputDictionary.Add(indexName, (p, openningRule)); + } + + public new void Run() + { + try + { + BlueprintPipeline input = InputInterfaces.First().Value; + input.WaitForStart(); + foreach (KeyValuePair openingRule)> item in outputDictionary) + { + if (item.Value.openingRule()) + { + item.Value.pipeline.CompleteAndWriteData(input.Args); + } + } + } + catch (Exception) + { + throw; + } + } + + } + + + public sealed class RouteHub : BlueprintNode + { + + private Dictionary controllingFunc)> inputDictionary; + + public RouteHub(string name, string[] inputPorts, string[] outputPorts) : base(name, inputPorts, outputPorts) + { + inputDictionary = new Dictionary controllingFunc)>(); + } + + + public new int Level + { + get + { + if (levelAvailable) + { + return _level; + } + _level = 0; + foreach (KeyValuePair item in _inputInterfaces) + { + if (item.Value == null) + { + continue; + } + if (_level <= item.Value.Level) + { + _level = item.Value.Level; + } + } + return _level; + } + } + + public void PrependNode(BlueprintNode node, string portName, Func usingRule) + { + if (node == null) + { + throw new ArgumentNullException(nameof(node)); + } + string indexName = $"{node.Name}.{portName}"; + BlueprintPipeline p = new BlueprintPipeline(this, node); + node.InputInterfaces[portName] = p; + inputDictionary.Add(indexName, (p, usingRule)); + } + + public new void Run() + { + try + { + foreach (KeyValuePair controllingFunc)> item in inputDictionary) + { + item.Value.pipeline.WaitForStart(); + if (item.Value.controllingFunc()) + { + _outputInterfaces.First().Value.CompleteAndWriteData(item.Value.pipeline.Args); + } + } + } + catch (Exception) + { + throw; + } + } + + } +} diff --git a/源代码/StgSharpDebug/Logic/Blueprint/SideNode.cs b/源代码/StgSharpDebug/Logic/Blueprint/SideNode.cs new file mode 100644 index 00000000..ee87e882 --- /dev/null +++ b/源代码/StgSharpDebug/Logic/Blueprint/SideNode.cs @@ -0,0 +1,86 @@ +using StgSharp.Logic; + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Logic +{ + internal sealed class BeginningNode : BlueprintNode + { + public BeginningNode() : base(name: "BeginningNode", null, + true, ["default"], ["default"] + ) + { } + + internal (string name, BlueprintPipelineArgs arg)[] InputData + { + set + { + if (value == null) + { + return; + } + foreach (var parameter in value) + { + OutputInterfaces[parameter.name].Args = parameter.arg; + } + } + } + + public new void SetCertainOutputPort(string name, BlueprintPipeline pipeline) + { + if (_outputInterfaces.ContainsKey(name)) + { + _outputInterfaces[name] = pipeline; + } + _outputInterfaces.Add(name, pipeline); + } + + public new void Run() + { + BlueprintPipeline.SkipAll(_outputInterfaces); + } + } + + internal sealed class EndingNode : BlueprintNode + { + public EndingNode() : base(name: "EndingNode", + operation: ( + in Dictionary input, + in Dictionary output + ) => + { + }, + true, ["default"], ["default"] + ) + { } + + internal (string name, BlueprintPipelineArgs arg)[] OutputData + { + get + { + return InputInterfaces.Select( + key => (key.Key, key.Value.Args)). + ToArray(); + } + } + + public new void SetCertainInputPort(string name, BlueprintPipeline pipeline) + { + if (_inputInterfaces.ContainsKey(name)) + { + _inputInterfaces[name] = pipeline; + } + _inputInterfaces.Add(name, pipeline); + } + + public new void Run() + { + BlueprintPipeline.WaitAll(_inputInterfaces); + } + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Logic/Counter.cs b/源代码/StgSharpDebug/Logic/Counter.cs new file mode 100644 index 00000000..eadd526b --- /dev/null +++ b/源代码/StgSharpDebug/Logic/Counter.cs @@ -0,0 +1,151 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Counter.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Xml.Serialization; + +namespace StgSharp +{ + + public class Counter where T : struct, IConvertible, IFormattable, IComparable + { + + internal readonly T _defualtAddValue; + internal readonly T _defualtSubValue; + internal readonly T _defualtValue; + + internal dynamic _value; + + public Counter(T defualtValue, T defualtAddValue, T defualtSubValue) + { + var type = Type.GetTypeCode(defualtValue.GetType()); + switch (type) + { + case TypeCode.Byte: + break; + + case TypeCode.Int16: + break; + + case TypeCode.Int32: + break; + + case TypeCode.Int64: + break; + + case TypeCode.Double: + break; + + case TypeCode.Single: + break; + + case TypeCode.SByte: + break; + + case TypeCode.UInt16: + break; + + case TypeCode.UInt32: + break; + + case TypeCode.UInt64: + break; + + default: + throw new ArgumentException("Input is not number value type"); + break; + } + _value = defualtValue; + _defualtValue = defualtValue; + _defualtAddValue = defualtAddValue; + _defualtSubValue = defualtSubValue; + } + + public T Decreament => _defualtSubValue; + + public T Increament => _defualtAddValue; + + public T Span => _value - _defualtValue; + + public T Value + { + get => _value; + set => _value = value; + } + + public void Add(T value) + { + _value += value; + } + + public void QuickAdd() + { + _value += _defualtAddValue; + } + + public void QuickSub() + { + _value -= _defualtSubValue; + } + + public void Reset() + { + _value = _defualtValue; + } + + public void Sub(T value) + { + _value -= value; + } + + public override string ToString() + { + return Value.ToString(); + } + + public static Counter operator --(Counter counter) + { + counter.QuickSub(); + return counter; + } + + public static Counter operator ++(Counter counter) + { + counter.QuickAdd(); + return counter; + } + + public static implicit operator T(Counter counter) + { + return counter.Value; + } + + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Logic/Exception.cs b/源代码/StgSharpDebug/Logic/Exception.cs new file mode 100644 index 00000000..db94d36d --- /dev/null +++ b/源代码/StgSharpDebug/Logic/Exception.cs @@ -0,0 +1,41 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Exception.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Graphics; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Logic +{ +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Logic/Sensor.cs b/源代码/StgSharpDebug/Logic/Sensor.cs new file mode 100644 index 00000000..1bad6f77 --- /dev/null +++ b/源代码/StgSharpDebug/Logic/Sensor.cs @@ -0,0 +1,73 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Sensor.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Geometries; + +namespace StgSharp +{ + + public delegate bool SensorRuleHandler(PlainGeometry target, PlainGeometry boarder); + + public class Sensor + { + + internal PlainGeometry _boarder; + internal SensorRuleHandler _rule; + internal PlainGeometry _target; + + + public PlainGeometry boarder => _boarder; + + public SensorRuleHandler Rule + { + get => _rule; + set => _rule = value; + } + + public PlainGeometry target + { + get => _target; + set => _target = value; + } + + public static Sensor operator -(Sensor sensor, SensorRuleHandler rule) + { + sensor._rule -= rule; + return sensor; + } + + public static Sensor operator +(Sensor sensor, SensorRuleHandler rule) + { + sensor._rule += rule; + return sensor; + } + + } +} diff --git a/源代码/StgSharpDebug/Logic/TimeFunction.cs b/源代码/StgSharpDebug/Logic/TimeFunction.cs new file mode 100644 index 00000000..f1e9f195 --- /dev/null +++ b/源代码/StgSharpDebug/Logic/TimeFunction.cs @@ -0,0 +1,154 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="TimeFunction.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp +{ + public class TimeFunction + { + + private float _beginning, _ending; + private Func _timeRelatedCalculation; + private TimeSpanProvider _timeProvider; + + internal TimeFunction() { } + + public TimeFunction( + TimeSpanProvider timeSpanProvider, + Func timeRelatedCalculation, + float range) + { + _timeProvider = timeSpanProvider; + _timeRelatedCalculation = timeRelatedCalculation; + if (timeSpanProvider == null) + { + return; + } + _beginning = _timeProvider.CurrentSecond; + _ending = _timeProvider.CurrentSecond + range; + } + + public virtual bool IsComplete + { + get => _timeProvider.CurrentSecond > _ending; + } + + public static TimeFunction One + { + get => new TimeFunctionOne(); + } + + public Func TimeRelatedCalculation + { + get { return _timeRelatedCalculation; } + set { _timeRelatedCalculation = value; } + } + + public TimeSpanProvider TimeSpanProvider + { + get { return _timeProvider; } + set { _timeProvider = value; } + } + + public virtual float Calculate() + { + if (_timeProvider.CurrentSecond < _ending) + { + return 0; + } + return _timeRelatedCalculation(_timeProvider.CurrentSecond - _beginning); + } + + public static TimeFunction Proportional(TimeSpanProvider time, float begin, float range) + { + return new TimeFunction( + time, (float t) => t + begin, range + ); + } + + public virtual TimeFunction Renew((Func func, float range) funcPair) + { + return new TimeFunction(_timeProvider, funcPair.func, funcPair.range); + } + + public virtual TimeFunction Renew(Func func, float range) + { + return new TimeFunction(_timeProvider, func, range); + } + + public void Reset() + { + float range = _ending - _beginning; + _beginning = _timeProvider.CurrentSecond; + _ending = _beginning + range; + } + + } + + + public sealed class TimeFunctionOne : TimeFunction + { + + internal TimeFunctionOne() : base() + { + } + + public override bool IsComplete + { + get => true; + } + + public override float Calculate() + { + return 1; + } + + public override TimeFunction Renew((Func func, float range) funcPair) + { + throw new NotSupportedException(); + } + + public override TimeFunction Renew(Func func, float range) + { + throw new NotSupportedException(); + } + +#pragma warning disable CA1822 + public new void Reset() +#pragma warning restore CA1822 + { + + } + + } +} diff --git a/源代码/StgSharpDebug/Logic/TimeSourceProvider.cs b/源代码/StgSharpDebug/Logic/TimeSourceProvider.cs new file mode 100644 index 00000000..ac1213fd --- /dev/null +++ b/源代码/StgSharpDebug/Logic/TimeSourceProvider.cs @@ -0,0 +1,90 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="TimeSourceProvider.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp; + +using System; +using System.Linq; +using System.Threading; + +namespace StgSharp.Logic +{ + + + public abstract class TimeSourceProviderBase + { + + private SemaphoreSlim _addSubscriberSemaphore = new SemaphoreSlim(1, 1); + + protected SemaphoreSlim CheckSubscriberSemaphore +=> _addSubscriberSemaphore; + + public void AddSubscriber(TimeSpanProvider subscriber) + { + _addSubscriberSemaphore.Wait(); + try + { + AddSubscriberUnsynced(subscriber); + } + catch (Exception) + { + throw; + } + finally + { + _addSubscriberSemaphore.Release(); + } + } + + public void RemoveSubscriber(TimeSpanProvider subscriber) + { + _addSubscriberSemaphore.Wait(); + try + { + RemoveSubscriberUnsynced(subscriber); + } + catch (Exception) + { + throw; + } + finally + { + _addSubscriberSemaphore.Release(); + } + } + + public abstract void StartProvidingTime(); + + protected abstract void AddSubscriberUnsynced(TimeSpanProvider subscriber); + protected abstract void RemoveSubscriberUnsynced(TimeSpanProvider subscriber); + + } + +} diff --git a/源代码/StgSharpDebug/Logic/TimeSpanProvider.cs b/源代码/StgSharpDebug/Logic/TimeSpanProvider.cs new file mode 100644 index 00000000..e59d8f19 --- /dev/null +++ b/源代码/StgSharpDebug/Logic/TimeSpanProvider.cs @@ -0,0 +1,215 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="TimeSpanProvider.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Logic; + +using System; +using System.Linq; +using System.Threading; + +namespace StgSharp +{ + + /// + /// A microsecond-accuracy timer. It will refresh every a certain time span. + /// + public class TimeSpanProvider + { + + private Action _frameUpdateMissCallback = () => { }; + private Action _refreshCallback; + private bool _subscribed; + private Counter timeSpanCount = new Counter(-1, 1, 1); + private readonly int _maxSpanCount; + private long _spanBegin; + private readonly long _spanLength; + private SemaphoreSlim _refreshSemaphore = new SemaphoreSlim(0, 1); + private readonly TimeSourceProviderBase _timeSource; + + + + /// + /// Create a new and define the length of time span. Length of a single time span is defined in microseconds. + /// + /// + /// + public TimeSpanProvider(long spanMicroSeconds, TimeSourceProviderBase provider) + { + if (provider == null) + { + throw new ArgumentNullException(nameof(provider)); + } + _timeSource = provider; + _spanLength = spanMicroSeconds; + _maxSpanCount = int.MaxValue; + provider.AddSubscriber(this); + _subscribed = true; + _refreshCallback = new Action(() => { }); + } + + /// + /// Create a new and define the length of time span. + /// Length of a single time span is defined in seconds. + /// + /// + /// + public TimeSpanProvider(double spanSeconds, TimeSourceProviderBase provider) + { + if (provider == null) + { + throw new ArgumentNullException(nameof(provider)); + } + _spanLength = (long)(spanSeconds * 1000L * 1000L); + _spanBegin = -_spanLength; + _maxSpanCount = int.MaxValue; + provider.AddSubscriber(this); + _subscribed = true; + _refreshCallback = new Action(() => { }); + } + + /// + /// Create a new and define the length of time span. Length of a single time span is defined in microseconds. + /// + /// + /// + /// + public TimeSpanProvider(long spanLength, int maxSpan, TimeSourceProviderBase provider) + { + if (provider == null) + { + throw new ArgumentNullException(nameof(provider)); + } + if (maxSpan <= 0) + { + maxSpan = int.MaxValue; + } + _spanLength = spanLength; _spanBegin = -_spanLength; + provider.AddSubscriber(this); + _subscribed = true; + } + + public int CurrentSpan + { + get => timeSpanCount.Value; + } + + public float CurrentSecond + { + get => timeSpanCount.Value * SpanLengthLowPrecession; + } + + /// + /// Time source provider provided in internal framework. + /// + public static TimeSourceProviderBase DefaultProvider => StgSharpTime.OnlyInstance; + + public Action FrameUpdateMissCallback + { + get => _frameUpdateMissCallback; + set => _frameUpdateMissCallback = value; + } + + public double SpanLength + { + get => (_spanLength * 1.0) / (1000L * 1000L); + } + + public float SpanLengthLowPrecession + { + get => (_spanLength * 1.0f) / (1000 * 1000); + } + + /// + /// The method this will call every time a new time span started. + /// + public Action SpanRefreshCallback + { + get => _refreshCallback; + set => _refreshCallback = value; + } + + public void SubscribeToTimeSource(TimeSourceProviderBase serviceHandler) + { + if (serviceHandler == null) + { + throw new ArgumentNullException(nameof(serviceHandler)); + } + if (_subscribed) + { + return; + } + _subscribed = true; + serviceHandler.AddSubscriber(this); + } + + public void WaitNextSpan() + { + _refreshSemaphore.Wait(); + } + + internal bool CheckTime(long microseconds) + { + if (microseconds - _spanBegin < _spanLength) + { + return true; + } + + _spanBegin = microseconds; + timeSpanCount++; + + if (_refreshCallback != null) + { + _refreshCallback(); + } + if (_refreshSemaphore.CurrentCount == 0) + { + _refreshSemaphore.Release(); + } + else + { + if (_frameUpdateMissCallback != null) + { + _frameUpdateMissCallback(); + } + } + if (timeSpanCount > _maxSpanCount) + { + return false; + } + return true; + } + + public static implicit operator int(TimeSpanProvider provider) + { + return provider.timeSpanCount.Value; + } + + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Logic/ViewModel/ShowViewPort.cs b/源代码/StgSharpDebug/Logic/ViewModel/ShowViewPort.cs new file mode 100644 index 00000000..c7bc2c58 --- /dev/null +++ b/源代码/StgSharpDebug/Logic/ViewModel/ShowViewPort.cs @@ -0,0 +1,54 @@ +using StgSharp.Graphics; + +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; + +namespace StgSharp.Logic +{ + public abstract partial class ViewModelBase + { + public void ShowViewPort() + { + + } + + private Blueprint renderLogic; + + public Blueprint RenderLogic + { + get => renderLogic; + set => renderLogic = value; + } + + /// + /// Init this form and render it on screen, and respond with operation + /// + public unsafe void Show() + { + while(0 == InternalIO.glfwWindowShouldClose(this.context.ViewPortID)) + { + renderLogic.RunRepeatedly(() => ShouldClose); + frameTimeProvider.WaitNextSpan(); + Interlocked.Add(ref _frameCount, 1); + } + } + + public T BuildNewRenderStream(View arg, (int x, int y, int z) unitCubeSize) where T : RenderStream + { + if (arg.ContextName == this.Name) + { + + } + T? ret = Activator.CreateInstance(typeof(T), arg) as T; + if (ret == null) + { + throw new InvalidOperationException("Failed in building a new RenderStream when calling AsMainStreamOf"); + } + ret!.InternalInit(); + ret.timeProvider = this.frameTimeProvider; + return ret; + } + } +} diff --git a/源代码/StgSharpDebug/Logic/ViewModel/ViewManage.cs b/源代码/StgSharpDebug/Logic/ViewModel/ViewManage.cs new file mode 100644 index 00000000..c919b727 --- /dev/null +++ b/源代码/StgSharpDebug/Logic/ViewModel/ViewManage.cs @@ -0,0 +1,32 @@ +using StgSharp.Graphics; +using StgSharp.Graphics.GL; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Logic +{ + public partial class ViewModelBase + { + private List allView; + + public View BuildNewView( + ViewPortDesigner designer, (int x, int y, int z) unitCubeSize + ) + { + View ret = new View(this.context, designer,unitCubeSize); + allView.Add(ret); + return ret; + } + + public T BuildRenderStream(View v, (int, int, int) cube) where T : RenderStream + { + T ret = Activator.CreateInstance(typeof(T), v.Port, cube) as T ?? + throw new InvalidOperationException("Cannot build new render stream."); + ret.timeProvider = this.frameTimeProvider; + ret.InternalInit(); + return ret; + } + } +} diff --git a/源代码/StgSharp/Graphics/Form/Form.cs b/源代码/StgSharpDebug/Logic/ViewModel/ViewModel.cs similarity index 72% rename from 源代码/StgSharp/Graphics/Form/Form.cs rename to 源代码/StgSharpDebug/Logic/ViewModel/ViewModel.cs index acdf0584..9f4c5d19 100644 --- a/源代码/StgSharp/Graphics/Form/Form.cs +++ b/源代码/StgSharpDebug/Logic/ViewModel/ViewModel.cs @@ -28,45 +28,37 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- +using StgSharp.Graphics; using StgSharp.Math; using System; using System.Collections.Generic; using System.Diagnostics; -using System.Linq; using System.Numerics; -using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; using System.Threading; -namespace StgSharp.Graphics +namespace StgSharp.Logic { - /// - /// - /// - public abstract unsafe partial class ViewModel + public abstract partial class ViewModelBase { private int _frameCount; private int _frameSpeed; + private ViewPort context; - private IntPtr windowID; - - internal ViewModel sharedForm; - - internal int height; - internal int width; internal IntPtr monitor; - internal string name; internal TimeSpanProvider fpsCountProvider; internal TimeSpanProvider frameTimeProvider; internal Vector4 backgroundColor; - protected ViewModel((int width, int height) size, string name) + protected ViewModelBase(int frameSpeed) { + context = new ViewPort(); + allView = new List(); fpsCountProvider = new TimeSpanProvider(1.0, TimeSpanProvider.DefaultProvider); _frameSpeed = 0; _frameCount = 0; @@ -75,23 +67,21 @@ namespace StgSharp.Graphics { Interlocked.Exchange(ref _frameSpeed, _frameCount); Interlocked.Exchange(ref _frameCount, 0); - Console.Clear(); - Console.WriteLine(_frameSpeed); }; + long frameLength = (FrameSpeed > 0) ? ((1000L * 1000L) / FrameSpeed) : 0; frameTimeProvider = new TimeSpanProvider( - (1000L * 1000L) / 60, TimeSpanProvider.DefaultProvider + frameLength, TimeSpanProvider.DefaultProvider ); frameTimeProvider.SpanRefreshCallback = () => { }; - height = size.height; - width = size.width; - this.name = name; } - protected ViewModel() + public ViewModelBase(ViewPort vbinding, int framespeed) { + context = vbinding; + allView = new List(); fpsCountProvider = new TimeSpanProvider(1.0, TimeSpanProvider.DefaultProvider); _frameSpeed = 0; _frameCount = 0; @@ -101,20 +91,18 @@ namespace StgSharp.Graphics Interlocked.Exchange(ref _frameSpeed, _frameCount); Interlocked.Exchange(ref _frameCount, 0); }; + long frameLength = (FrameSpeed > 0) ? ((1000L * 1000L) / FrameSpeed) : 0; frameTimeProvider = new TimeSpanProvider( - (1000L * 1000L) / 60, TimeSpanProvider.DefaultProvider + frameLength, TimeSpanProvider.DefaultProvider ); frameTimeProvider.SpanRefreshCallback = () => { }; - height = 800; - width = 600; - name = new StackFrame(1, false). - GetMethod()!.DeclaringType!.Name; } public int CurrentFrameCount => frameTimeProvider.CurrentSpan; + public int FrameSpeed => _frameSpeed; /// @@ -122,21 +110,19 @@ namespace StgSharp.Graphics /// public int Height { - get => height; - set - { - height = value; - if (WindowID != IntPtr.Zero) - { - InternalIO.glfwSetWindowSize(windowID, Width, Height); - } - } + get => context.Height; + set { context.Height = value; } + } + + public string Name + { + get => context.Name; } public bool ShouldClose { - get => InternalIO.glfwWindowShouldClose(windowID) != 0; - set => InternalIO.glfwSetWindowShouldClose(windowID, value ? 1 : 0); + get => InternalIO.glfwWindowShouldClose(context.ViewPortID) != 0; + set => InternalIO.glfwSetWindowShouldClose(context.ViewPortID, value ? 1 : 0); } /// @@ -144,14 +130,14 @@ namespace StgSharp.Graphics /// public vec2d Size { - get => new vec2d(width, height); + get => new vec2d(Width, Height); set { - width = (int)value.X; - height = (int)value.Y; + Width = (int)value.X; + Height = (int)value.Y; if (WindowID != IntPtr.Zero) { - InternalIO.glfwSetWindowSize(windowID, Width, Height); + InternalIO.glfwSetWindowSize(context.ViewPortID, Width, Height); } } } @@ -161,25 +147,22 @@ namespace StgSharp.Graphics ///
public int Width { - get => width; + get => context.Width; set { - width = value; + context.Width = value; if (WindowID != IntPtr.Zero) { - InternalIO.glfwSetWindowSize(windowID, Width, Height); + InternalIO.glfwSetWindowSize(context.ViewPortID, Width, Height); } } } - public unsafe IntPtr WindowID { - get => windowID; - internal set => windowID = value; + get => context.ViewPortID; } - internal unsafe IntPtr id => windowID; #pragma warning disable CA1044 protected FrameBufferSizeHandler FrameSizeCallback @@ -187,41 +170,11 @@ namespace StgSharp.Graphics set { IntPtr handlerPtr = Marshal.GetFunctionPointerForDelegate(value); - InternalIO.glfwSetFramebufferSizeCallback(windowID, handlerPtr); + InternalIO.glfwSetFramebufferSizeCallback(context.ViewPortID, handlerPtr); } } #pragma warning restore CA1044 - #region Key Control - - protected KeyStatus CheckKey(KeyboardKey key) - { - return InternalIO.glfwGetKey(this.WindowID,(int)key); - } - - protected KeyStatus CheckKey(Mouse key) - { - return InternalIO.glfwGetKey(this.WindowID, (int)key); - } - - protected KeyStatus CheckKey(Joystick key) - { - return InternalIO.glfwGetKey(this.WindowID, (int)key); - } - - #endregion - - /// - /// Set all necessary metadata to current form instance - /// - public void SetMetadata(int width, int height, string name, IntPtr monitor, ViewModel sharedForm) - { - this.width = width; - this.height = height; - this.name = name; - this.sharedForm = sharedForm; - this.monitor = monitor; - } /// /// Resize the current form @@ -233,7 +186,7 @@ namespace StgSharp.Graphics public void SetSize(vec2d size) { this.Size = size; - InternalIO.glfwSetWindowSize(this.windowID, (int)size.X, (int)size.Y); + InternalIO.glfwSetWindowSize(this.context.ViewPortID, (int)size.X, (int)size.Y); } @@ -250,7 +203,7 @@ namespace StgSharp.Graphics public void SetSizeLimit(vec2d minSize, vec2d maxSize) { InternalIO.glfwSetWindowSizeLimits( - this.windowID, + this.context.ViewPortID, (int)minSize.X, (int)minSize.Y, (int)maxSize.X, @@ -268,10 +221,29 @@ namespace StgSharp.Graphics public void SetSizeLimit(int minWidth, int minHeight, int maxWidth, int maxHeight) { //TODO 重做form的尺寸极限控制 - InternalIO.glfwSetWindowSizeLimits(this.windowID, minWidth, minHeight, maxWidth, maxHeight); + InternalIO.glfwSetWindowSizeLimits(this.context.ViewPortID, minWidth, minHeight, maxWidth, maxHeight); } + #region Key Control + + protected KeyStatus CheckKey(KeyboardKey key) + { + return InternalIO.glfwGetKey(this.WindowID, (int)key); + } + + protected KeyStatus CheckKey(Mouse key) + { + return InternalIO.glfwGetKey(this.WindowID, (int)key); + } + + protected KeyStatus CheckKey(Joystick key) + { + return InternalIO.glfwGetKey(this.WindowID, (int)key); + } + + #endregion + + } - -} \ No newline at end of file +} diff --git a/源代码/StgSharpDebug/Math b/源代码/StgSharpDebug/Math deleted file mode 120000 index afaceb0f..00000000 --- a/源代码/StgSharpDebug/Math +++ /dev/null @@ -1 +0,0 @@ -D:/NitloadIndustry/研究项目/1-Flagship/TH2020/ProjectFile/源代码/StgSharp/Math \ No newline at end of file diff --git a/源代码/StgSharpDebug/Math/GLfixed.cs b/源代码/StgSharpDebug/Math/GLfixed.cs new file mode 100644 index 00000000..dd4984c0 --- /dev/null +++ b/源代码/StgSharpDebug/Math/GLfixed.cs @@ -0,0 +1,49 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="GLfixed.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Math +{ + [StructLayout(LayoutKind.Explicit, Size = 8)] + public struct GLfixed + { + + [FieldOffset(0)] public int All; + [FieldOffset(0)] public short Decimals; + [FieldOffset(4)] public short Inertger; + + } +} diff --git a/源代码/StgSharpDebug/Math/Graphic/Camera.cs b/源代码/StgSharpDebug/Math/Graphic/Camera.cs new file mode 100644 index 00000000..8164bbc7 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Graphic/Camera.cs @@ -0,0 +1,322 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Camera.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Graphics; +using StgSharp.Graphics.GL; +using StgSharp.Graphics.ShaderEdit; +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Graphics +{ + public sealed class Camera : IglConvertable + { + + private bool _isLookAtAvailable; + internal Matrix44 _lookAt; + internal Matrix44 _projection; + internal Matrix44 cameraAtt; + internal Matrix44 rotation; + internal Matrix44 rotationAtt; + internal Radius _pitch; + internal Radius _row; + internal Radius _yaw; + internal Uniform convertedUniform; + internal vec3d _target, up; + + + public Camera() + { + cameraAtt = Matrix44.Unit; + _target = Vec3d.Zero; + up = Vec3d.Zero; + _isLookAtAvailable = false; + _lookAt = Matrix44.Unit; + rotationAtt = Matrix44.Unit; + _projection = new Matrix44(); + } + + public Camera(vec3d position, vec3d target, vec3d up) : this() + { + rotationAtt = Matrix44.Unit; + cameraAtt = new Matrix44(); + SetViewDirection(position, target, up); + _pitch = Radius.Zero; + _row = Radius.Zero; + _yaw = Radius.Zero; + } + + public Matrix44 Projection +=> _projection; + + public Matrix44 View + { + get + { + if (_isLookAtAvailable) + { + return _lookAt; + } + Matrix44 move = Matrix44.Unit; + move.colum3.vec -= cameraAtt.colum3.vec; + _lookAt = rotationAtt.Transpose * move; + _isLookAtAvailable = true; + return _lookAt; + } + } + + public void DisplayGLtypeDefinition() + { + Console.WriteLine("uniform matrix4x4 cameraName;"); + } + + /// + /// Get all uniform related to this . + /// + /// Shader program requires this camera. + /// + /// ContextName of all related uniforms. + /// If you fallow form from + /// + /// + public unsafe void GainAllUniforms(ShaderProgram source, params string[] uniformName) + { + if (uniformName.Length != 1) + { + throw new ArgumentException(); + } + convertedUniform = source.GetUniform(uniformName[0]); + } + + public void MoveNear(float distance) + { + cameraAtt.colum3.Z -= distance; + _isLookAtAvailable = false; + } + + public void MoveRight(float distance) + { + cameraAtt.colum3.X -= distance; + _isLookAtAvailable = false; + } + + public void MoveUp(float distance) + { + cameraAtt.colum3.Y -= distance; + _isLookAtAvailable = false; + } + + + public unsafe void SetAllUniforms() + { + //Console.WriteLine(Projection * View); + glFunc.SetUniformValue(convertedUniform, Projection * View); + } + + public void SetViewDirection(vec3d position, vec3d target, vec3d up) + { + vec3d direction = position - target; + if ((position.vec == cameraAtt.colum3.vec) && (this.up == up) && (cameraAtt.colum2.vec == direction.vec)) + { + //no difference with precious value + return; + } + if (direction.GetLength() == 0) + { + //deadlock + throw new ArgumentException(); + } + if (Vec3d.IsParallel(direction, up)) + { + throw new ArgumentException(); + } + _target = direction; + this.up = up; + + _isLookAtAvailable = false; + + Linear.Orthogonalize(ref direction, ref up); + + vec3d right = Linear.Orthogonalize(Linear.Cross(up, direction)); + + cameraAtt.colum0.vec = right.vec; + cameraAtt.colum1.vec = up.vec; + cameraAtt.colum2.vec = direction.vec; + cameraAtt.colum3.vec = position.vec; + + InternalPitch(); + InternalRow(); + InternalYaw(); + + } + + public void SetViewRange(Radius fovRadius, vec2d size, vec2d offset, (float front, float back) dephRange) + { + float + distance = _target.GetLength(), + near = distance - dephRange.front, + far = distance + dephRange.back, + offsetX = offset.X, + offsetY = offset.Y, + width = Scaler.Abs(GeometryScaler.Tan(fovRadius / 2) * near * 2), + height = (width * size.Y) / size.X; + + _projection.colum0.X = (2 * near) / width; + _projection.colum1.Y = (2 * near) / height; + _projection.colum2.X = (2 * offsetX) / width; + _projection.colum2.Y = (2 * offsetY) / height; + _projection.colum2.Z = (far + near) / (near - far); + _projection.colum2.W = -1; + _projection.colum3.Z = (2 * near * far) / (near - far); + + } + + public void Test(params vec4d[] vec) + { + Console.WriteLine(View); + Console.WriteLine(Projection); + Console.WriteLine(Projection * View); + Console.WriteLine(View); + foreach (vec4d item in vec) + { + Console.Write($"{Projection * View * item};"); + } + } + + ShaderStruct IglConvertable.GetConvertedGLtype() + { + throw new NotImplementedException(); + } + + ~Camera() + { + } + + #region rotation + + public void Yaw(Radius r) + { + _yaw -= r; + //Console.WriteLine(_yaw._radius); + //Console.WriteLine(rotationAtt); + InternalYaw(); + } + + public void Pitch(Radius r) + { + _pitch -= r; + //Console.WriteLine(_pitch._radius); + //Console.WriteLine(rotationAtt); + InternalPitch(); + } + + public void Row(Radius r) + { + _row -= r; + //Console.WriteLine(_row._radius); + //Console.WriteLine(rotationAtt); + InternalRow(); + } + + internal void InternalPitch() + { + _isLookAtAvailable = false; + + Matrix32 partialCoord = new Matrix32( + cameraAtt.colum1.vec, + cameraAtt.colum2.vec + ); + float angle = _pitch._radius; + + Matrix22 rotation = new Matrix22( + Scaler.Cos(angle), -Scaler.Sin(angle), + Scaler.Sin(angle), Scaler.Cos(angle) + ); + + partialCoord *= rotation; + rotationAtt.colum1.vec = partialCoord.colum0.vec; + rotationAtt.colum2.vec = partialCoord.colum1.vec; + rotationAtt.isTransposed = false; + } + + internal void InternalRow() + { + _isLookAtAvailable = false; + + Matrix32 partialCoord = new Matrix32( + cameraAtt.colum0.vec, + cameraAtt.colum1.vec + ); + float angle = _row._radius; + + Matrix22 rotation = new Matrix22( + Scaler.Cos(angle), -Scaler.Sin(angle), + Scaler.Sin(angle), Scaler.Cos(angle) + ); + + partialCoord *= rotation; + rotationAtt.colum0.vec = partialCoord.colum0.vec; + rotationAtt.colum1.vec = partialCoord.colum1.vec; + rotationAtt.isTransposed = false; + } + + internal void InternalYaw() + { + _isLookAtAvailable = false; + + Matrix32 partialCoord = new Matrix32( + cameraAtt.colum0.vec, + cameraAtt.colum2.vec + ); + float angle = _yaw._radius; + Matrix22 rotation = new Matrix22( + Scaler.Cos(angle), -Scaler.Sin(angle), + Scaler.Sin(angle), Scaler.Cos(angle) + ); + + partialCoord *= rotation; + rotationAtt.colum0.vec = partialCoord.colum0.vec; + rotationAtt.colum2.vec = partialCoord.colum1.vec; + rotationAtt.isTransposed = false; + + } + + + #endregion + + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/Cordination.cs b/源代码/StgSharpDebug/Math/Linear/Cordination.cs new file mode 100644 index 00000000..a444628e --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/Cordination.cs @@ -0,0 +1,40 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Cordination.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +namespace StgSharp.Math +{ + + public enum CoordinatePlain + { + XY, + YZ, + XZ, + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/IVector.cs b/源代码/StgSharpDebug/Math/Linear/IVector.cs new file mode 100644 index 00000000..eb261e86 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/IVector.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Math +{ + public interface IVector + { + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/MatInterface.cs b/源代码/StgSharpDebug/Math/Linear/MatInterface.cs new file mode 100644 index 00000000..8e0ba0d3 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/MatInterface.cs @@ -0,0 +1,40 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="MatInterface.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Math +{ + public interface IMat + { + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/Matrix22.cs b/源代码/StgSharpDebug/Math/Linear/Matrix22.cs new file mode 100644 index 00000000..6f3e3d53 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/Matrix22.cs @@ -0,0 +1,188 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Matrix22.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Math +{ + [StructLayout(LayoutKind.Explicit, Size = (2 * 2 * 4 * sizeof(float)) + sizeof(bool), Pack = 16)] + public struct Matrix22 : IMat + { + + [FieldOffset(2 * 2 * 4 * sizeof(float))] + internal bool isTransposed; + + [FieldOffset(0)] + internal Mat2 mat; + [FieldOffset(2 * 4 * sizeof(float))] + internal Mat2 transpose; + + internal Matrix22( + Mat2 mat + ) + { + this.mat = mat; + } + + internal Matrix22( + Vector4 c0, + Vector4 c1 + ) + { + mat.colum0 = c0; + mat.colum1 = c1; + } + + public Matrix22( + float a00, float a01, + float a10, float a11 + ) + { + mat.colum0 = new Vector4(a00, a10, 0, 0); + mat.colum1 = new Vector4(a01, a11, 0, 0); + } + + public Matrix22 Transpose + { + get + { + InternalTranspose(); + return new Matrix22(this.transpose); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float Det() + { + return (mat.m00 * mat.m11) - (mat.m10 * mat.m01); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void InternalTranspose() + { + if (!isTransposed) + { + transpose = mat; + float cache = transpose.m10; + transpose.m10 = transpose.m01; + transpose.m01 = cache; + + isTransposed = true; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix22 operator -(Matrix22 left, Matrix22 right) + { + return new Matrix22( + left.mat.colum0 + right.mat.colum0, + left.mat.colum1 + right.mat.colum1 + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix22 operator *(Matrix22 mat, float value) + { + return new Matrix22( + mat.mat.colum0 * value, + mat.mat.colum1 * value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix22 operator *(Matrix22 left, Matrix22 right) + { + left.InternalTranspose(); + return new Matrix22( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix23 operator *(Matrix22 left, Matrix23 right) + { + left.InternalTranspose(); + return new Matrix23( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix24 operator *(Matrix22 left, Matrix24 right) + { + left.InternalTranspose(); + return new Matrix24( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + Vector4.Dot(left.transpose.colum0, right.mat.colum3), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2), + Vector4.Dot(left.transpose.colum1, right.mat.colum3) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix22 operator /(Matrix22 mat, float value) + { + return new Matrix22( + mat.mat.colum0 / value, + mat.mat.colum1 / value + ); + } + + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe Matrix22 operator +(Matrix22 left, Matrix22 right) + { + Mat2* refmat = InternalIO.add_mat2(&left.mat, &right.mat); + Matrix22 ret = new Matrix22(*refmat); + InternalIO.deinit_mat2(refmat); + return ret; + } + + + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/Matrix23.cs b/源代码/StgSharpDebug/Math/Linear/Matrix23.cs new file mode 100644 index 00000000..bb9e4cd7 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/Matrix23.cs @@ -0,0 +1,217 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Matrix23.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Math +{ + [StructLayout(LayoutKind.Explicit, Size = ((3 + 2) * 4 * sizeof(float)) + sizeof(bool), Pack = 16)] + public struct Matrix23 : IMat + { + + [FieldOffset(5 * 4 * sizeof(float))] internal bool isTransposed; + [FieldOffset(3 * 4 * sizeof(float))] internal Mat2 transpose; + + [FieldOffset(0)] internal Mat3 mat; + + internal Matrix23( + Vector4 c0, + Vector4 c1, + Vector4 c2 + ) + { + mat.colum0 = c0; + mat.colum1 = c1; + mat.colum2 = c2; + } + + public Matrix23( + float a00, float a01, float a02, + float a10, float a11, float a12 + ) + { + mat.colum0 = new Vector4(a00, a10, 0, 0); + mat.colum1 = new Vector4(a01, a11, 0, 0); + mat.colum2 = new Vector4(a02, a12, 0, 0); + } + + public unsafe float this[int rowNum, int columNum] + { + get + { + if ((rowNum > 1) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 2) || (columNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + return *(float*)pbit; + } + } + set + { + if ((rowNum > 1) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 2) || (columNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + *(float*)pbit = value; + } + isTransposed = false; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe void InternalTranspose() + { + if (!isTransposed) + { + fixed (Mat3* source = &this.mat) + { + fixed (Mat2* target = &this.transpose) + { + InternalIO.Transpose3to2_internal(source, target); + } + } + + isTransposed = true; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix23 operator -(Matrix23 left, Matrix23 right) + { + return new Matrix23( + left.mat.colum0 - right.mat.colum0, + left.mat.colum1 - right.mat.colum1, + left.mat.colum2 - right.mat.colum2 + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix23 operator *(Matrix23 mat, float value) + { + return new Matrix23( + mat.mat.colum0 * value, + mat.mat.colum1 * value, + mat.mat.colum2 * value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix22 operator *(Matrix23 left, Matrix32 right) + { + left.InternalTranspose(); + return new Matrix22( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix23 operator *(Matrix23 left, Matrix33 right) + { + left.InternalTranspose(); + return new Matrix23( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix24 operator *(Matrix23 left, Matrix34 right) + { + left.InternalTranspose(); + return new Matrix24( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + Vector4.Dot(left.transpose.colum0, right.mat.colum3), + + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + Vector4.Dot(left.transpose.colum0, right.mat.colum3) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix23 operator /(Matrix23 mat, float value) + { + return new Matrix23( + mat.mat.colum0 / value, + mat.mat.colum1 / value, + mat.mat.colum2 / value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix23 operator +(Matrix23 left, Matrix23 right) + { + return new Matrix23( + left.mat.colum0 + right.mat.colum0, + left.mat.colum1 + right.mat.colum1, + left.mat.colum2 + right.mat.colum2 + ); + } + + + + } + +} diff --git a/源代码/StgSharpDebug/Math/Linear/Matrix24.cs b/源代码/StgSharpDebug/Math/Linear/Matrix24.cs new file mode 100644 index 00000000..0c93bb23 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/Matrix24.cs @@ -0,0 +1,237 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Matrix24.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Math +{ + [StructLayout(LayoutKind.Explicit, Size = ((4 + 2) * 4 * sizeof(float)) + sizeof(bool), Pack = 16)] + public struct Matrix24 : IMat + { + + [FieldOffset(6 * 4 * sizeof(float))] internal bool isTransposed; + [FieldOffset(4 * 4 * sizeof(float))] internal Mat2 transpose; + + [FieldOffset(0)] internal Mat4 mat; + + [FieldOffset(0)] public vec2d Colum0; + [FieldOffset(16)] public vec2d Colum1; + [FieldOffset(32)] public vec2d Colum2; + [FieldOffset(48)] public vec2d Colum3; + + internal Matrix24( + Vector4 c0, + Vector4 c1, + Vector4 c2, + Vector4 c3 + ) + { + mat.colum0 = c0; + mat.colum1 = c1; + mat.colum2 = c2; + mat.colum3 = c3; + } + + + public Matrix24( + float a00, float a01, float a02, float a03, + float a10, float a11, float a12, float a13 + ) + { + mat.colum0 = new Vector4(a00, a10, 0, 0); + mat.colum1 = new Vector4(a01, a11, 0, 0); + mat.colum2 = new Vector4(a02, a12, 0, 0); + mat.colum3 = new Vector4(a03, a13, 0, 0); + } + + public unsafe float this[int rowNum, int columNum] + { + get + { + if ((rowNum > 1) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 3) || (columNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + return *(float*)pbit; + } + } + set + { + if ((rowNum > 1) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 3) || (columNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + *(float*)pbit = value; + } + isTransposed = false; + } + } + + public override string ToString() + { + InternalTranspose(); + return $"{$"[{mat.m00},{mat.m01},{mat.m02},{mat.m03}],"}{$"[{mat.m10},{mat.m11},{mat.m12},{mat.m13}]"}"; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe void InternalTranspose() + { + if (!isTransposed) + { + fixed (Mat4* source = &this.mat) + { + fixed (Mat2* target = &this.transpose) + { + InternalIO.Transpose4to2_internal(source, target); + } + } + + isTransposed = true; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix24 operator -(Matrix24 left, Matrix24 right) + { + return new Matrix24( + left.mat.colum0 - right.mat.colum0, + left.mat.colum1 - right.mat.colum1, + left.mat.colum2 - right.mat.colum2, + left.mat.colum3 - right.mat.colum3 + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix24 operator *(Matrix24 mat, float value) + { + return new Matrix24( + mat.mat.colum0 * value, + mat.mat.colum1 * value, + mat.mat.colum2 * value, + mat.mat.colum3 * value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix22 operator *(Matrix24 left, Matrix42 right) + { + left.InternalTranspose(); + return new Matrix22( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix23 operator *(Matrix24 left, Matrix43 right) + { + left.InternalTranspose(); + return new Matrix23( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix24 operator *(Matrix24 left, Matrix44 right) + { + left.InternalTranspose(); + return new Matrix24( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + Vector4.Dot(left.transpose.colum0, right.mat.colum3), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2), + Vector4.Dot(left.transpose.colum1, right.mat.colum3) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix24 operator /(Matrix24 mat, float value) + { + return new Matrix24( + mat.mat.colum0 / value, + mat.mat.colum1 / value, + mat.mat.colum2 / value, + mat.mat.colum3 / value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix24 operator +(Matrix24 left, Matrix24 right) + { + return new Matrix24( + left.mat.colum0 + right.mat.colum0, + left.mat.colum1 + right.mat.colum1, + left.mat.colum2 + right.mat.colum2, + left.mat.colum3 + right.mat.colum3 + ); + } + + + + } + + +} diff --git a/源代码/StgSharpDebug/Math/Linear/Matrix32.cs b/源代码/StgSharpDebug/Math/Linear/Matrix32.cs new file mode 100644 index 00000000..96643893 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/Matrix32.cs @@ -0,0 +1,235 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Matrix32.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Math +{ + [StructLayout(LayoutKind.Explicit, Size = (5 * 4 * sizeof(float)) + sizeof(bool), Pack = 16)] + public struct Matrix32 : IMat + { + + [FieldOffset(5 * 4 * sizeof(float))] internal bool isTransposed; + + [FieldOffset(0)] internal Mat2 mat; + [FieldOffset(2 * 4 * sizeof(float))] internal Mat3 transpose; + + [FieldOffset(0)] internal vec3d colum0; + [FieldOffset(4 * 4)] internal vec3d colum1; + + internal Matrix32( + Vector4 c0, + Vector4 c1 + ) + { + mat.colum0 = c0; + mat.colum1 = c1; + } + + + public unsafe Matrix32( + float a00, float a01, + float a10, float a11, + float a20, float a21 + ) + { +#if NET5_0_OR_GREATER + Unsafe.SkipInit(out colum0); + Unsafe.SkipInit(out colum1); + Unsafe.SkipInit(out transpose); +#endif + mat.colum0 = new Vector4(a00, a10, a20, 0); + mat.colum1 = new Vector4(a01, a11, a21, 0); + } + + public unsafe float this[int rowNum, int columNum] + { + get + { + if ((rowNum > 2) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 1) || (columNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + return *(float*)pbit; + } + } + set + { + if ((rowNum > 2) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 1) || (columNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + *(float*)pbit = value; + } + isTransposed = false; + } + } + + public vec3d VerticalVecMultiply(vec2d vec) + { + return (colum0 * vec.X) + (colum1 * vec.Y); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe void InternalTranspose() + { + if (!isTransposed) + { + fixed (Mat2* source = &this.mat) + { + fixed (Mat3* target = &this.transpose) + { + InternalIO.Transpose2to3_internal(source, target); + } + } + + isTransposed = true; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix32 operator -(Matrix32 left, Matrix32 right) + { + return new Matrix32( + left.mat.colum0 - right.mat.colum0, + left.mat.colum1 - right.mat.colum1 + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix32 operator *(Matrix32 mat, float value) + { + return new Matrix32( + mat.mat.colum0 * value, + mat.mat.colum1 * value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix32 operator *(Matrix32 left, Matrix22 right) + { + left.InternalTranspose(); + return new Matrix32( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix33 operator *(Matrix32 left, Matrix23 right) + { + left.InternalTranspose(); + return new Matrix33( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1), + Vector4.Dot(left.transpose.colum2, right.mat.colum2) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix34 operator *(Matrix32 left, Matrix24 right) + { + left.InternalTranspose(); + return new Matrix34( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + Vector4.Dot(left.transpose.colum0, right.mat.colum3), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2), + Vector4.Dot(left.transpose.colum1, right.mat.colum3), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1), + Vector4.Dot(left.transpose.colum2, right.mat.colum2), + Vector4.Dot(left.transpose.colum2, right.mat.colum3) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix32 operator /(Matrix32 mat, float value) + { + return new Matrix32( + mat.mat.colum0 / value, + mat.mat.colum1 / value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix32 operator +(Matrix32 left, Matrix32 right) + { + return new Matrix32( + left.mat.colum0 + right.mat.colum0, + left.mat.colum1 + right.mat.colum1 + ); + } + + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/Matrix33.cs b/源代码/StgSharpDebug/Math/Linear/Matrix33.cs new file mode 100644 index 00000000..fc7a548d --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/Matrix33.cs @@ -0,0 +1,250 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Matrix33.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Math +{ + [StructLayout(LayoutKind.Explicit, Size = (6 * 4 * sizeof(float)) + sizeof(bool), Pack = 16)] + public struct Matrix33 : IMat + { + + [FieldOffset(6 * 4 * sizeof(float))] internal bool isTransposed; + + [FieldOffset(0)] internal Mat3 mat; + [FieldOffset(3 * 4 * sizeof(float))] internal Mat3 transpose; + [FieldOffset(0 * 4 * sizeof(float))] public vec3d Colum0; + [FieldOffset(1 * 4 * sizeof(float))] public vec3d Colum1; + [FieldOffset(2 * 4 * sizeof(float))] public vec3d Colum2; + + internal Matrix33( + Vector4 c0, + Vector4 c1, + Vector4 c2 + ) + { + mat.colum0 = c0; + mat.colum1 = c1; + mat.colum2 = c2; + } + + public Matrix33( + float a00, float a01, float a02, + float a10, float a11, float a12, + float a20, float a21, float a22 + ) + { + mat.colum0 = new Vector4(a00, a10, a20, 0); + mat.colum1 = new Vector4(a01, a11, a21, 0); + mat.colum2 = new Vector4(a02, a12, a22, 0); + } + + public unsafe float this[int rowNum, int columNum] + { + get + { + if ((rowNum > 2) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 2) || (columNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + return *(float*)pbit; + } + } + set + { + if ((rowNum > 2) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 2) || (columNum < 0)) + { + InternalIO.InternalWriteLog( + $"Attempt to write unused space in {GetType().Name} {nameof(mat)}", + LogType.Error + ); + } + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + *(float*)pbit = value; + } + isTransposed = false; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe float Det() + { + fixed (Mat3* mat = &this.mat) + { + return InternalIO.det_mat3(mat); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe void InternalTranspose() + { + if (!isTransposed) + { + fixed (Mat3* source = &this.mat, target = &this.transpose) + { + InternalIO.Transpose3to3_internal(source, target); + } + isTransposed = true; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix33 operator -(Matrix33 left, Matrix33 right) + { + return new Matrix33( + left.mat.colum0 - right.mat.colum0, + left.mat.colum1 - right.mat.colum1, + left.mat.colum2 + right.mat.colum2 + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix33 operator *(Matrix33 mat, float value) + { + return new Matrix33( + mat.mat.colum0 * value, + mat.mat.colum1 * value, + mat.mat.colum2 * value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static vec3d operator *(Matrix33 left, vec3d right) + { + left.InternalTranspose(); + return new vec3d( + Vector4.Dot(left.transpose.colum0, right.vec), + Vector4.Dot(left.transpose.colum1, right.vec), + Vector4.Dot(left.transpose.colum2, right.vec) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix32 operator *(Matrix33 left, Matrix32 right) + { + left.InternalTranspose(); + return new Matrix32( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix33 operator *(Matrix33 left, Matrix33 right) + { + left.InternalTranspose(); + return new Matrix33( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1), + Vector4.Dot(left.transpose.colum2, right.mat.colum2) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix34 operator *(Matrix33 left, Matrix34 right) + { + left.InternalTranspose(); + return new Matrix34( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + Vector4.Dot(left.transpose.colum0, right.mat.colum3), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2), + Vector4.Dot(left.transpose.colum1, right.mat.colum3), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1), + Vector4.Dot(left.transpose.colum2, right.mat.colum2), + Vector4.Dot(left.transpose.colum2, right.mat.colum3) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix33 operator /(Matrix33 mat, float value) + { + return new Matrix33( + mat.mat.colum0 / value, + mat.mat.colum1 / value, + mat.mat.colum2 / value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix33 operator +(Matrix33 left, Matrix33 right) + { + return new Matrix33( + left.mat.colum0 + right.mat.colum0, + left.mat.colum1 + right.mat.colum1, + left.mat.colum2 + right.mat.colum2 + ); + } + + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/Matrix34.cs b/源代码/StgSharpDebug/Math/Linear/Matrix34.cs new file mode 100644 index 00000000..a2c35e7e --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/Matrix34.cs @@ -0,0 +1,248 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Matrix34.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Drawing; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Math +{ + + [StructLayout(LayoutKind.Explicit, Size = (7 * 4 * sizeof(float)) + sizeof(bool), Pack = 16)] + public struct Matrix34 : IMat + { + + [FieldOffset(7 * 4 * sizeof(float))] internal bool isTransposed; + [FieldOffset(4 * 4 * sizeof(float))] internal Mat3 transpose; + + [FieldOffset(0)] internal Mat4 mat; + + [FieldOffset(0 * 4 * sizeof(float))] public vec3d Colum0; + [FieldOffset(1 * 4 * sizeof(float))] public vec3d Colum1; + [FieldOffset(2 * 4 * sizeof(float))] public vec3d Colum2; + [FieldOffset(3 * 4 * sizeof(float))] public vec3d Colum3; + + internal Matrix34(Mat4 mat) + { + this.mat = mat; + } + + internal Matrix34( + Vector4 c0, + Vector4 c1, + Vector4 c2, + Vector4 c3 + ) + { + mat.colum0 = c0; + mat.colum1 = c1; + mat.colum2 = c2; + mat.colum3 = c3; + } + + public Matrix34( + float a00, float a01, float a02, float a03, + float a10, float a11, float a12, float a13, + float a20, float a21, float a22, float a23 + ) + { + mat.colum0 = new Vector4(a00, a10, a20, 0); + mat.colum0 = new Vector4(a01, a11, a21, 0); + mat.colum0 = new Vector4(a02, a12, a22, 0); + mat.colum0 = new Vector4(a03, a13, a23, 0); + } + + public unsafe float this[int rowNum, int columNum] + { + get + { + if ((rowNum > 2) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 3) || (columNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + return *(float*)pbit; + } + } + set + { + if ((rowNum > 2) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 3) || (columNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + *(float*)pbit = value; + } + isTransposed = false; + } + } + + internal unsafe void InternalTranspose() + { + if (!isTransposed) + { + fixed (Mat4* source = &this.mat) + { + fixed (Mat3* target = &this.transpose) + { + InternalIO.Transpose4to3_internal(source, target); + } + } + + isTransposed = true; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix34 operator -(Matrix34 left, Matrix34 right) + { + return new Matrix34( + left.mat.colum0 - right.mat.colum0, + left.mat.colum1 - right.mat.colum1, + left.mat.colum2 - right.mat.colum2, + left.mat.colum3 - right.mat.colum3 + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix34 operator *(Matrix34 mat, float value) + { + return new Matrix34( + mat.mat.colum0 * value, + mat.mat.colum1 * value, + mat.mat.colum2 * value, + mat.mat.colum3 * value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix32 operator *(Matrix34 left, Matrix42 right) + { + left.InternalTranspose(); + return new Matrix32( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix33 operator *(Matrix34 left, Matrix43 right) + { + left.InternalTranspose(); + return new Matrix33( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1), + Vector4.Dot(left.transpose.colum2, right.mat.colum2) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix34 operator *(Matrix34 left, Matrix44 right) + { + left.InternalTranspose(); + return new Matrix34( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + Vector4.Dot(left.transpose.colum0, right.mat.colum3), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2), + Vector4.Dot(left.transpose.colum1, right.mat.colum3), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1), + Vector4.Dot(left.transpose.colum2, right.mat.colum2), + Vector4.Dot(left.transpose.colum2, right.mat.colum3) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix34 operator /(Matrix34 mat, float value) + { + return new Matrix34( + mat.mat.colum0 / value, + mat.mat.colum1 / value, + mat.mat.colum2 / value, + mat.mat.colum3 / value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix34 operator +(Matrix34 left, Matrix34 right) + { + return new Matrix34( + left.mat.colum0 + right.mat.colum0, + left.mat.colum1 + right.mat.colum1, + left.mat.colum2 + right.mat.colum2, + left.mat.colum3 + right.mat.colum3 + ); + } + + + + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/Matrix42.cs b/源代码/StgSharpDebug/Math/Linear/Matrix42.cs new file mode 100644 index 00000000..bb0c16e4 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/Matrix42.cs @@ -0,0 +1,253 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Matrix42.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + + +namespace StgSharp.Math +{ + + + [StructLayout(LayoutKind.Explicit, Size = ((16 + 8) * sizeof(float)) + sizeof(bool), Pack = 16)] + public struct Matrix42 : IMat + { + + [FieldOffset((16 + 8) * sizeof(float))] internal bool isTransposed; + + [FieldOffset(0)] internal Mat2 mat; + [FieldOffset(8 * sizeof(float))] internal Mat4 transpose; + + internal Matrix42(Mat2 mat) + { + this.mat = mat; + } + + internal Matrix42( + Vector4 c0, + Vector4 c1 + ) + { + mat.colum0 = c0; + mat.colum1 = c1; + } + + + public Matrix42( + float a00, float a01, + float a10, float a11, + float a20, float a21, + float a30, float a31 + ) + { + mat.colum0 = new Vector4(a00, a10, a20, a30); + mat.colum1 = new Vector4(a01, a11, a21, a31); + } + + + + public unsafe float this[int rowNum, int columNum] + { + get + { + if ((rowNum > 3) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 1) || (columNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + return *(float*)pbit; + } + } + set + { + if ((rowNum > 3) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 1) || (columNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + *(float*)pbit = value; + } + isTransposed = false; + } + } + + public override int GetHashCode() + { + return HashCode.Combine( + mat.colum0.GetHashCode(), + mat.colum1.GetHashCode() + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe void InternalTranspose() + { + if (!isTransposed) + { + fixed (Mat2* source = &this.mat) + { + fixed (Mat4* target = &this.transpose) + { + InternalIO.Transpose2to4_internal(source, target); + } + } + + isTransposed = true; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe Matrix42 operator -(Matrix42 left, Matrix42 right) + { + return new Matrix42( + left.mat.colum0 - right.mat.colum0, + left.mat.colum0 - right.mat.colum0 + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix42 operator *(Matrix42 mat, float value) + { + return new Matrix42( + mat.mat.colum0 * value, + mat.mat.colum1 * value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix42 operator *(Matrix42 left, Matrix22 right) + { + left.InternalTranspose(); + return new Matrix42( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1), + + Vector4.Dot(left.transpose.colum3, right.mat.colum0), + Vector4.Dot(left.transpose.colum3, right.mat.colum1) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix43 operator *(Matrix42 left, Matrix23 right) + { + left.InternalTranspose(); + return new Matrix43( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1), + Vector4.Dot(left.transpose.colum2, right.mat.colum2), + + Vector4.Dot(left.transpose.colum3, right.mat.colum0), + Vector4.Dot(left.transpose.colum3, right.mat.colum1), + Vector4.Dot(left.transpose.colum3, right.mat.colum2) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix44 operator *(Matrix42 left, Matrix24 right) + { + left.InternalTranspose(); + return new Matrix44( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2), + Vector4.Dot(left.transpose.colum1, right.mat.colum2), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1), + Vector4.Dot(left.transpose.colum2, right.mat.colum2), + Vector4.Dot(left.transpose.colum2, right.mat.colum2), + + Vector4.Dot(left.transpose.colum3, right.mat.colum0), + Vector4.Dot(left.transpose.colum3, right.mat.colum1), + Vector4.Dot(left.transpose.colum3, right.mat.colum2), + Vector4.Dot(left.transpose.colum3, right.mat.colum2) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix42 operator /(Matrix42 mat, float value) + { + return new Matrix42( + mat.mat.colum0 / value, + mat.mat.colum1 / value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe Matrix42 operator +(Matrix42 left, Matrix42 right) + { + return new Matrix42( + left.mat.colum0 + right.mat.colum0, + left.mat.colum0 + right.mat.colum0 + ); + } + + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/Matrix43.cs b/源代码/StgSharpDebug/Math/Linear/Matrix43.cs new file mode 100644 index 00000000..dd530b5a --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/Matrix43.cs @@ -0,0 +1,277 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Matrix43.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Math +{ + [StructLayout(LayoutKind.Explicit, Size = (7 * 4 * sizeof(float)) + sizeof(bool), Pack = 16)] + public struct Matrix43 : IEquatable, IMat + { + + [FieldOffset(7 * 4 * sizeof(float))] + internal bool isTransposed; + + [FieldOffset(0)] + internal Mat3 mat; + + [FieldOffset(3 * 4 * sizeof(float))] + internal Mat4 transpose; + + internal Matrix43( + Vector4 c0, + Vector4 c1, + Vector4 c2 + ) + { + mat.colum0 = c0; + mat.colum1 = c1; + mat.colum2 = c2; + } + + public Matrix43( + float a00, float a01, float a02, + float a10, float a11, float a12, + float a20, float a21, float a22, + float a30, float a31, float a32 + ) + { + mat.colum0 = new Vector4(a00, a10, a20, a30); + mat.colum1 = new Vector4(a01, a11, a21, a31); + mat.colum2 = new Vector4(a02, a12, a22, a32); + } + + public unsafe float this[int rowNum, int columNum] + { + get + { + if ((rowNum > 3) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 2) || (columNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + return *(float*)pbit; + } + } + set + { + if ((rowNum > 3) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 2) || (columNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + *(float*)pbit = value; + } + isTransposed = false; + } + } + + public override bool Equals(object? obj) + { + return (obj is Matrix43 x) && Equals(x); + } + + public bool Equals(Matrix43 other) + { + return EqualityComparer.Default.Equals(mat, other.mat); + } + + public override int GetHashCode() + { + return HashCode.Combine( + mat.colum0.GetHashCode(), + mat.colum1.GetHashCode(), + mat.colum2.GetHashCode() + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe void InternalTranspose() + { + if (!isTransposed) + { + fixed (Mat3* source = &this.mat) + { + fixed (Mat4* target = &this.transpose) + { + InternalIO.Transpose3to4_internal(source, target); + } + } + + isTransposed = true; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix43 operator -(Matrix43 left, Matrix43 right) + { + return new Matrix43( + left.mat.colum0 - right.mat.colum0, + left.mat.colum1 - right.mat.colum1, + left.mat.colum2 - right.mat.colum2 + ); + } + + public static bool operator !=(Matrix43 left, Matrix43 right) + { + return !(left == right); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix43 operator *(Matrix43 mat, float value) + { + return new Matrix43( + mat.mat.colum0 * value, + mat.mat.colum1 * value, + mat.mat.colum2 * value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix42 operator *(Matrix43 left, Matrix32 right) + { + left.InternalTranspose(); + return new Matrix42( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1), + + Vector4.Dot(left.transpose.colum3, right.mat.colum0), + Vector4.Dot(left.transpose.colum3, right.mat.colum1) + + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix43 operator *(Matrix43 left, Matrix33 right) + { + left.InternalTranspose(); + return new Matrix43( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1), + Vector4.Dot(left.transpose.colum2, right.mat.colum2), + + Vector4.Dot(left.transpose.colum3, right.mat.colum0), + Vector4.Dot(left.transpose.colum3, right.mat.colum1), + Vector4.Dot(left.transpose.colum3, right.mat.colum2) + + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix44 operator *(Matrix43 left, Matrix34 right) + { + left.InternalTranspose(); + return new Matrix44( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + Vector4.Dot(left.transpose.colum0, right.mat.colum3), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2), + Vector4.Dot(left.transpose.colum1, right.mat.colum3), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1), + Vector4.Dot(left.transpose.colum2, right.mat.colum2), + Vector4.Dot(left.transpose.colum2, right.mat.colum3), + + Vector4.Dot(left.transpose.colum3, right.mat.colum0), + Vector4.Dot(left.transpose.colum3, right.mat.colum1), + Vector4.Dot(left.transpose.colum3, right.mat.colum2), + Vector4.Dot(left.transpose.colum3, right.mat.colum3) + + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix43 operator /(Matrix43 mat, float value) + { + return new Matrix43( + mat.mat.colum0 / value, + mat.mat.colum1 / value, + mat.mat.colum2 / value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix43 operator +(Matrix43 left, Matrix43 right) + { + return new Matrix43( + left.mat.colum0 + right.mat.colum0, + left.mat.colum1 + right.mat.colum1, + left.mat.colum2 + right.mat.colum2 + ); + } + + public static bool operator ==(Matrix43 left, Matrix43 right) + { + return left.Equals(right); + } + + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Math/Linear/Matrix44.cs b/源代码/StgSharpDebug/Math/Linear/Matrix44.cs new file mode 100644 index 00000000..280ef931 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/Matrix44.cs @@ -0,0 +1,351 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Matrix44.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.ComponentModel; +using System.Drawing; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + + + +namespace StgSharp.Math +{ + + + [StructLayout(LayoutKind.Explicit, Size = (2 * 16 * sizeof(float)) + sizeof(bool), Pack = 16)] + public unsafe struct Matrix44 : IEquatable, IMat + { + + [FieldOffset(2 * 64 * sizeof(float))] internal bool isTransposed; + + [FieldOffset(0)] internal Mat4 mat; + [FieldOffset(16 * sizeof(float))] internal Mat4 transpose; + [FieldOffset(0 * sizeof(float))] internal vec4d colum0; + [FieldOffset(4 * sizeof(float))] internal vec4d colum1; + [FieldOffset(8 * sizeof(float))] internal vec4d colum2; + [FieldOffset(12 * sizeof(float))] internal vec4d colum3; + + internal Matrix44(Mat4 mat) + { + this.mat = mat; + } + + internal Matrix44( + Vector4 vec0, + Vector4 vec1, + Vector4 vec2, + Vector4 vec3 + ) + { + mat.colum0 = vec0; + mat.colum1 = vec1; + mat.colum2 = vec2; + mat.colum3 = vec3; + } + + + public unsafe Matrix44( + float a00, float a01, float a02, float a03, + float a10, float a11, float a12, float a13, + float a20, float a21, float a22, float a23, + float a30, float a31, float a32, float a33 + ) + { + mat.colum0 = new Vector4(a00, a10, a20, a30); + mat.colum1 = new Vector4(a01, a11, a21, a31); + mat.colum2 = new Vector4(a02, a12, a22, a32); + mat.colum3 = new Vector4(a03, a13, a23, a33); + + } + + public unsafe float this[int rowNum, int columNum] + { + get + { +#if DEBUG + if ((rowNum > 3) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 3) || (columNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } +#endif + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + return *(float*)pbit; + } + } + set + { +#if DEBUG + if ((rowNum > 3) || (rowNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } + if ((columNum > 3) || (columNum < 0)) + { + throw new ArgumentOutOfRangeException(nameof(columNum)); + } +#endif + InternalTranspose(); + fixed (float* p = &this.transpose.m00) + { + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); + *(float*)pbit = value; + } + isTransposed = false; + } + + } + + public Matrix44 Transpose + { + get + { + InternalTranspose(); + return new Matrix44(this.transpose); + } + } + + public static Matrix44 Unit + => new Matrix44( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ); + public static Matrix44 WNegativeUnit + => new Matrix44( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, -1 + ); + + public static Matrix44 XNegativeUnit + => new Matrix44( + -1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ); + public static Matrix44 YNegativeUnit + => new Matrix44( + 1, 0, 0, 0, + 0, -1, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1 + ); + + public static Matrix44 ZNegativeUnit + => new Matrix44( + 1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, -1, 0, + 0, 0, 0, 1 + ); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe float Det() + { + InternalTranspose(); + fixed (Mat4* _this = &mat, _trans = &transpose) + { + return InternalIO.det_mat4(_this, _trans); + } + } + + public override bool Equals(object? obj) + { + return (obj is Matrix44 x) && Equals(x); + } + + public bool Equals(Matrix44 other) + { + return mat.Equals(other.mat); + } + + public override int GetHashCode() + { + return HashCode.Combine( + mat.colum0.GetHashCode(), + mat.colum1.GetHashCode(), + mat.colum2.GetHashCode(), + mat.colum3.GetHashCode() + ); + } + + public override string ToString() + { + InternalTranspose(); + return $"{transpose.colum0}{transpose.colum1}{transpose.colum2}{transpose.colum3}"; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal unsafe void InternalTranspose() + { + if (!isTransposed) + { + fixed (Mat4* source = &mat, target = &transpose) + { + InternalIO.Transpose4to4_internal(source, target); + } + + isTransposed = true; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe Matrix44 operator -(Matrix44 left, Matrix44 right) + { + return new Matrix44( + right.mat.colum0 - left.mat.colum0, + right.mat.colum1 - left.mat.colum1, + right.mat.colum2 - left.mat.colum2, + right.mat.colum3 - left.mat.colum3 + ); + } + + public static bool operator !=(Matrix44 left, Matrix44 right) + { + return !(left == right); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe Matrix44 operator *(Matrix44 mat, float value) + { + return new Matrix44( + mat.mat.colum0 * value, + mat.mat.colum1 * value, + mat.mat.colum2 * value, + mat.mat.colum3 * value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe Matrix42 operator *(Matrix44 left, Matrix42 right) + { + left.InternalTranspose(); + return new Matrix42( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1), + + Vector4.Dot(left.transpose.colum3, right.mat.colum0), + Vector4.Dot(left.transpose.colum3, right.mat.colum1) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix43 operator *(Matrix44 left, Matrix43 right) + { + left.InternalTranspose(); + return new Matrix43( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1), + Vector4.Dot(left.transpose.colum2, right.mat.colum2), + + Vector4.Dot(left.transpose.colum3, right.mat.colum0), + Vector4.Dot(left.transpose.colum3, right.mat.colum1), + Vector4.Dot(left.transpose.colum3, right.mat.colum2) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix44 operator *(Matrix44 left, Matrix44 right) + { + left.InternalTranspose(); + return new Matrix44( + Vector4.Dot(left.transpose.colum0, right.mat.colum0), + Vector4.Dot(left.transpose.colum0, right.mat.colum1), + Vector4.Dot(left.transpose.colum0, right.mat.colum2), + Vector4.Dot(left.transpose.colum0, right.mat.colum3), + + Vector4.Dot(left.transpose.colum1, right.mat.colum0), + Vector4.Dot(left.transpose.colum1, right.mat.colum1), + Vector4.Dot(left.transpose.colum1, right.mat.colum2), + Vector4.Dot(left.transpose.colum1, right.mat.colum3), + + Vector4.Dot(left.transpose.colum2, right.mat.colum0), + Vector4.Dot(left.transpose.colum2, right.mat.colum1), + Vector4.Dot(left.transpose.colum2, right.mat.colum2), + Vector4.Dot(left.transpose.colum2, right.mat.colum3), + + Vector4.Dot(left.transpose.colum3, right.mat.colum0), + Vector4.Dot(left.transpose.colum3, right.mat.colum1), + Vector4.Dot(left.transpose.colum3, right.mat.colum2), + Vector4.Dot(left.transpose.colum3, right.mat.colum3) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe Matrix44 operator +(Matrix44 left, Matrix44 right) + { + return new Matrix44( + right.mat.colum0 + left.mat.colum0, + right.mat.colum1 + left.mat.colum1, + right.mat.colum2 + left.mat.colum2, + right.mat.colum3 + left.mat.colum3 + ); + } + + public static bool operator ==(Matrix44 left, Matrix44 right) + { + return left.Equals(right); + } + + } + + + +} diff --git a/源代码/StgSharpDebug/Math/Linear/Vector.Cross.cs b/源代码/StgSharpDebug/Math/Linear/Vector.Cross.cs new file mode 100644 index 00000000..6ddd9db7 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/Vector.Cross.cs @@ -0,0 +1,51 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Vector.Cross.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +namespace StgSharp.Math +{ + public static unsafe partial class Linear + { + + public static float Cross(vec2d vec1, vec2d vec2) + { + return (vec1.X * vec2.Y) - (vec1.Y * vec2.X); + } + + public static vec3d Cross(vec3d vec1, vec3d vec2) + { + return new vec3d( + (vec1.Y * vec2.Z) - (vec1.Z * vec2.Y), + (vec1.X * vec2.Z) - (vec1.Z * vec2.X), + (vec1.X * vec2.Y) - (vec1.Y * vec2.X) + ); + } + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/Vector.GetAngle.cs b/源代码/StgSharpDebug/Math/Linear/Vector.GetAngle.cs new file mode 100644 index 00000000..7530102c --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/Vector.GetAngle.cs @@ -0,0 +1,53 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Vector.GetAngle.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +namespace StgSharp.Math +{ + public static unsafe partial class Linear + { + + public static float GetAngle(vec2d vec1, vec2d vec2) + { + return Scaler.ACos(1 + //vec1.multiple(vec2) + / (vec1.GetLength() * vec2.GetLength()) + ); + } + + public static float GetAngle(vec3d vec1, vec3d vec2) + { + return Scaler.ACos( + (vec1 * vec2) + / (vec1.GetLength() * vec2.GetLength()) + ); + } + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/Vector.GetLength.cs b/源代码/StgSharpDebug/Math/Linear/Vector.GetLength.cs new file mode 100644 index 00000000..6c8fa9d2 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/Vector.GetLength.cs @@ -0,0 +1,47 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Vector.GetLength.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +namespace StgSharp.Math +{ + public static unsafe partial class Linear + { + + public static float GetLength(this vec3d vec) + { + return Scaler.Sqrt(vec.Dot(vec)); + } + + public static float GetLength(this vec2d vec) + { + return Scaler.Sqrt(vec.Dot(vec)); + } + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/Vector.Normalize.cs b/源代码/StgSharpDebug/Math/Linear/Vector.Normalize.cs new file mode 100644 index 00000000..101e51b4 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/Vector.Normalize.cs @@ -0,0 +1,55 @@ +using StgSharp.Data; +using StgSharp.Math; + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Math +{ + public static partial class Linear + { + public static unsafe void Normalize(ref vec4d source, ref vec4d target) + { + Vector4 s = source.vec; + Vector4 t = target.vec; + + s = Vector4.Normalize(s); + + float dotProduct = Vector4.Dot(s, t); + Vector4 projection = Vector4.Multiply(s, t); + + t -= projection; + + source.vec = s; + target.vec = t; + } + + public static unsafe void Normalize(ref vec3d source, ref vec3d target) + { + Vector3 s = source.v; + Vector3 t = target.v; + + s = Vector3.Normalize(s); + Vector3 projection = Vector3.Dot(t, s) / Vector3.Dot(s, s) * s; + t -= projection; + t = Vector3.Normalize(t); + + source.v = s; + target.v = t; + } + + public static vec4d Normalize(vec4d vec) + { + return new vec4d() { vec = Vector4.Normalize(vec.vec) }; + } + public static vec3d Normalize(vec3d vec) + { + return new vec3d() { vec = Vector4.Normalize(vec.vec) }; + } + } +} diff --git a/源代码/StgSharp/Data/Encode/CodeCounter.cs b/源代码/StgSharpDebug/Math/Linear/Vector.Orthogonalize.cs similarity index 51% rename from 源代码/StgSharp/Data/Encode/CodeCounter.cs rename to 源代码/StgSharpDebug/Math/Linear/Vector.Orthogonalize.cs index df343fc4..a6c7cce7 100644 --- a/源代码/StgSharp/Data/Encode/CodeCounter.cs +++ b/源代码/StgSharpDebug/Math/Linear/Vector.Orthogonalize.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="CodeCounter.cs" +// file="Vector.Orthogonalize.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -29,71 +29,77 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- using StgSharp.Data; +using StgSharp.Math; using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Numerics; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; +using System.Threading.Tasks; -namespace StgSharp.Data +namespace StgSharp { - public static class CodeSeparator + + internal static partial class InternalIO { - public static List<(T, ulong)> CountCodeFrequency(T[] rawArray) where T : struct + [DllImport(SSC_libName, EntryPoint = "normalize", + CallingConvention = CallingConvention.Cdecl)] + internal static extern unsafe void Normalize(M128* source, M128* target); + + } + +} + +namespace StgSharp.Math +{ + public static partial class Linear + { + + public static vec4d Orthogonalize(vec4d vec) { - Dictionary frequencyCollection = new Dictionary(); - - foreach (var item in rawArray) - { - if (frequencyCollection.ContainsKey(item)) - { - frequencyCollection[item] += 1; - } - else - { - frequencyCollection.Add(item, 1); - } - } - - return frequencyCollection.OrderByDescending(pair => pair.Value) - .Select(pair => (pair.Key, pair.Value)).ToList(); + return new vec4d { vec = Vector4.Normalize(vec.vec) }; } - public static unsafe T[] SeparateCode(string filePath) where T : struct + public static vec3d Orthogonalize(vec3d vec) { - byte[] allByte = File.ReadAllBytes(filePath); - List rawList = new List(); + return new vec3d { vec = Vector4.Normalize(vec.vec) }; + } + public static unsafe void Orthogonalize(ref vec4d source, ref vec4d target) + { + Vector4 s = source.vec; + Vector4 t = target.vec; - fixed (byte* allBytePtr = allByte) - { - for (int i = 0; i < allByte.Length; i += Marshal.SizeOf()) - { - T t = new T(); - t = *(T*)(allBytePtr + i); - rawList.Add(t); - } - } - return rawList.ToArray(); + s = Vector4.Normalize(s); + + float dotProduct = Vector4.Dot(s, t); + Vector4 projection = Vector4.Multiply(s, t); + + t -= projection; + + source.vec = s; + target.vec = t; } - public static unsafe T[] SeparateCode(byte[] stream) where T : struct + /// + /// Orthogonalize two s, let their length be 1 + /// and perpendicular to each other. + /// + /// + /// + public static unsafe void Orthogonalize(ref vec3d source, ref vec3d target) { - List rawList = new List(); + Vector3 s = source.v; + Vector3 t = target.v; - fixed (byte* allBytePtr = stream) - { - for (int i = 0; i < stream.Length; i += Marshal.SizeOf()) - { - T t = new T(); - t = *(T*)(allBytePtr + i); - rawList.Add(t); - } - } - return rawList.ToArray(); + s = Vector3.Normalize(s); + Vector3 projection = (Vector3.Dot(t, s) / Vector3.Dot(s, s)) * s; + t -= projection; + t = Vector3.Normalize(t); + + source.v = s; + target.v = t; } } diff --git a/源代码/StgSharpDebug/Math/Linear/mat2.cs b/源代码/StgSharpDebug/Math/Linear/mat2.cs new file mode 100644 index 00000000..4d934884 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/mat2.cs @@ -0,0 +1,144 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="mat2.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Math; + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp +{ + internal static unsafe partial class InternalIO + { + + #region add + + [DllImport(InternalIO.SSC_libName, EntryPoint = "add_Mat2", + CallingConvention = CallingConvention.Cdecl)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static extern Mat2* add_mat2(Mat2* left, Mat2* right); + + + #endregion + + #region deinit mat2 + + [DllImport(InternalIO.SSC_libName, EntryPoint = "deinit_mat2", + CallingConvention = CallingConvention.Cdecl)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static extern unsafe void deinit_mat2(Mat2* mat); + + #endregion + + #region sub + + [DllImport(InternalIO.SSC_libName, EntryPoint = "sub_mat2", + CallingConvention = CallingConvention.Cdecl)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static extern unsafe Mat2* sub_mat2(Mat2* left, Mat2* right); + + #endregion + + + #region transpose + + + [DllImport(InternalIO.SSC_libName, EntryPoint = "transpose2to4", + CallingConvention = CallingConvention.Cdecl)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static extern unsafe void Transpose2to4_internal(Mat2* source, Mat4* target); + + [DllImport(InternalIO.SSC_libName, EntryPoint = "transpose2to3", + CallingConvention = CallingConvention.Cdecl)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static extern unsafe void Transpose2to3_internal(Mat2* source, Mat3* target); + + #endregion + + + } +} + +namespace StgSharp.Math +{ + [StructLayout(LayoutKind.Explicit, Size = 12 * sizeof(float), Pack = 16)] + internal struct Mat2 : IEquatable + { + + [FieldOffset(0 * sizeof(float))] internal float m00; + [FieldOffset(4 * sizeof(float))] internal float m01; + [FieldOffset(1 * sizeof(float))] internal float m10; + [FieldOffset(5 * sizeof(float))] internal float m11; + [FieldOffset(2 * sizeof(float))] internal float m20; + [FieldOffset(6 * sizeof(float))] internal float m21; + [FieldOffset(3 * sizeof(float))] internal float m30; + [FieldOffset(7 * sizeof(float))] internal float m31; + + [FieldOffset(0)] internal Vector4 colum0; + [FieldOffset(4 * sizeof(float))] internal Vector4 colum1; + + internal Mat2( + Vector4 c0, + Vector4 c1 + ) + { + colum0 = c0; + colum1 = c1; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool Equals(object? obj) + { + return (obj is Mat2 mat) && Equals(mat); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(Mat2 other) + { + return colum0.Equals(other.colum0) && + colum1.Equals(other.colum1); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Mat2 left, Mat2 right) + { + return !(left == right); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Mat2 left, Mat2 right) + { + return left.Equals(right); + } + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/mat3.cs b/源代码/StgSharpDebug/Math/Linear/mat3.cs new file mode 100644 index 00000000..f22b352e --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/mat3.cs @@ -0,0 +1,126 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="mat3.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Math; + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp +{ + internal static unsafe partial class InternalIO + { + + #region det + + [DllImport(InternalIO.SSC_libName, EntryPoint = "det_mat3", + CallingConvention = CallingConvention.Cdecl)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static extern unsafe float det_mat3(Mat3* mat); + + #endregion + + + #region transpose + + [DllImport(SSC_libName, EntryPoint = "transpose3to4", + CallingConvention = CallingConvention.Cdecl)] + internal static extern unsafe void Transpose3to4_internal(Mat3* source, Mat4* target); + + [DllImport(SSC_libName, EntryPoint = "transpose3to3", + CallingConvention = CallingConvention.Cdecl)] + internal static extern unsafe void Transpose3to3_internal(Mat3* source, Mat3* target); + + [DllImport(SSC_libName, EntryPoint = "transpose3to2", + CallingConvention = CallingConvention.Cdecl)] + internal static extern unsafe void Transpose3to2_internal(Mat3* source, Mat2* target); + + #endregion + + + } + +} + + +namespace StgSharp.Math +{ + [StructLayout(LayoutKind.Explicit, Size = 12 * sizeof(float), Pack = 16)] + public struct Mat3 : IEquatable, IMat + { + + [FieldOffset(0 * sizeof(float))] internal float m00; + + [FieldOffset(4 * sizeof(float))] internal float m01; + + [FieldOffset(8 * sizeof(float))] internal float m02; + [FieldOffset(1 * sizeof(float))] internal float m10; + [FieldOffset(5 * sizeof(float))] internal float m11; + [FieldOffset(9 * sizeof(float))] internal float m12; + [FieldOffset(2 * sizeof(float))] internal float m20; + [FieldOffset(6 * sizeof(float))] internal float m21; + [FieldOffset(10 * sizeof(float))] internal float m22; + [FieldOffset(3 * sizeof(float))] internal float m30; + [FieldOffset(7 * sizeof(float))] internal float m31; + [FieldOffset(11 * sizeof(float))] internal float m32; + + [FieldOffset(0)] internal Vector4 colum0; + [FieldOffset(4 * sizeof(float))] internal Vector4 colum1; + [FieldOffset(8 * sizeof(float))] internal Vector4 colum2; + + public override bool Equals(object? obj) + { + return (obj is Mat3 mat) && Equals(mat); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(Mat3 other) + { + return colum0.Equals(other.colum0) && + colum1.Equals(other.colum1) && + colum2.Equals(other.colum2); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Mat3 left, Mat3 right) + { + return !(left == right); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Mat3 left, Mat3 right) + { + return left.Equals(right); + } + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/mat4.cs b/源代码/StgSharpDebug/Math/Linear/mat4.cs new file mode 100644 index 00000000..1421e45f --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/mat4.cs @@ -0,0 +1,159 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="mat4.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp; +using StgSharp.Math; + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp +{ + internal static unsafe partial class InternalIO + { + + #region deinit_mat4 + + + [DllImport(SSC_libName, EntryPoint = "deinit_mat4", + CallingConvention = CallingConvention.Cdecl)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static extern void deinit_mat4(Mat4* mat); + + #endregion + + #region det + + [DllImport(SSC_libName, EntryPoint = "det_mat4", + CallingConvention = CallingConvention.Cdecl)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static extern unsafe float det_mat4(Mat4* matPtr, Mat4* transpose); + + #endregion + + + #region transpose + + [DllImport(SSC_libName, EntryPoint = "transpose4to4", + CallingConvention = CallingConvention.Cdecl)] + internal static extern unsafe void Transpose4to4_internal(Mat4* source, Mat4* target); + + [DllImport(SSC_libName, EntryPoint = "transpose4to3", + CallingConvention = CallingConvention.Cdecl)] + internal static extern unsafe void Transpose4to3_internal(Mat4* source, Mat3* target); + + [DllImport(SSC_libName, EntryPoint = "transpose4to2", + CallingConvention = CallingConvention.Cdecl)] + internal static extern unsafe void Transpose4to2_internal(Mat4* source, Mat2* target); + + + #endregion + + + + } +} +namespace StgSharp.Math +{ + + + [StructLayout(LayoutKind.Explicit, Size = 16 * sizeof(float))] + public struct Mat4 : IEquatable, IMat + { + + [FieldOffset(0)] internal Vector4 colum0; + [FieldOffset(16)] internal Vector4 colum1; + [FieldOffset(32)] internal Vector4 colum2; + [FieldOffset(48)] internal Vector4 colum3; + + [FieldOffset(0)] public float m00; + + [FieldOffset(16)] public float m01; + + [FieldOffset(32)] public float m02; + + [FieldOffset(48)] public float m03; + [FieldOffset(4)] public float m10; + [FieldOffset(20)] public float m11; + [FieldOffset(36)] public float m12; + [FieldOffset(52)] public float m13; + [FieldOffset(8)] public float m20; + [FieldOffset(24)] public float m21; + [FieldOffset(40)] public float m22; + [FieldOffset(56)] public float m23; + [FieldOffset(12)] public float m30; + [FieldOffset(28)] public float m31; + [FieldOffset(44)] public float m32; + [FieldOffset(60)] public float m33; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal Mat4( + Vector4 colum0, + Vector4 colum1, + Vector4 colum2, + Vector4 colum3 + ) + { + this.colum0 = colum0; + this.colum1 = colum1; + this.colum2 = colum2; + this.colum3 = colum3; + } + + public override bool Equals(object? obj) + { + return (obj is Mat4 mat) && Equals(mat); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(Mat4 other) + { + return colum0.Equals(other.colum0) && + colum1.Equals(other.colum1) && + colum2.Equals(other.colum2) && + colum3.Equals(other.colum3); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Mat4 left, Mat4 right) + { + return !(left == right); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Mat4 left, Mat4 right) + { + return left.Equals(right); + } + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/mat5.cs b/源代码/StgSharpDebug/Math/Linear/mat5.cs new file mode 100644 index 00000000..4b31461e --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/mat5.cs @@ -0,0 +1,50 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="mat5.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Math +{ + [StructLayout(LayoutKind.Explicit, Size = 5 * 4 * sizeof(float))] + public struct mat5 : IMat + { + + [FieldOffset(0 * 4 * sizeof(float))] internal Vector4 vec0; + [FieldOffset(1 * 4 * sizeof(float))] internal Vector4 vec1; + [FieldOffset(2 * 4 * sizeof(float))] internal Vector4 vec2; + [FieldOffset(3 * 4 * sizeof(float))] internal Vector4 vec3; + [FieldOffset(4 * 4 * sizeof(float))] internal Vector4 vec4; + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/mat6.cs b/源代码/StgSharpDebug/Math/Linear/mat6.cs new file mode 100644 index 00000000..e9d26830 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/mat6.cs @@ -0,0 +1,51 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="mat6.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Numerics; +using System.Runtime.InteropServices; +using System.Text; + +namespace StgSharp.Math +{ + [StructLayout(LayoutKind.Sequential)] + public struct mat6 : IMat + { + + internal Vector4 vec0; + internal Vector4 vec1; + internal Vector4 vec2; + internal Vector4 vec3; + internal Vector4 vec4; + internal Vector4 vec5; + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/vec2d.cs b/源代码/StgSharpDebug/Math/Linear/vec2d.cs new file mode 100644 index 00000000..c0842b81 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/vec2d.cs @@ -0,0 +1,138 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="vec2d.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Math +{ + /// + /// A two dimension vector defined by two elements. + /// Vec2Ds in StgSharp are default used as colum vector. + /// + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] + public struct vec2d:IVector + { + + [FieldOffset(0)] internal unsafe fixed float num[2]; + + [FieldOffset(0)] + internal Vector2 v; + + [FieldOffset(0)] + internal Vector4 vec; + + [FieldOffset(0)] + public float X; + [FieldOffset(4)] + public float Y; + + internal vec2d(Vector2 vec) + { + v = vec; + } + internal vec2d(Vector4 vec) + { + this.vec = vec; + } + + public vec2d(float x, float y) + { + v = new Vector2(x, y); + } + + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float Cross(vec2d right) + { + return (X * right.Y) - (Y * right.X); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float Dot(vec2d vec) + { + return Vector2.Dot(v, vec.v); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static vec2d operator -(vec2d left, vec2d right) + { + return new vec2d(left.v - right.v); + } + + public static bool operator !=(vec2d left, vec2d right) + { + return !(left == right); + } + + public static vec2d operator *(vec2d vec, float value) + { + return new vec2d(vec.v * value); + } + + public static vec2d operator /(vec2d vec, float value) + { + return new vec2d(vec.v / value); + } + public static vec2d operator *(float value, vec2d vec) + { + return new vec2d(vec.v * value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static vec2d operator +(vec2d left, vec2d right) + { + return new vec2d(left.v + right.v); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(vec2d left, vec2d right) + { + return left.v == right.v; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static implicit operator vec2d((float, float) tuple) + { + return new vec2d(tuple.Item1, tuple.Item2); + } + + } + + public static class Vec2d + { + + public static vec2d Unit => new vec2d(1, 1); + + public static vec2d Zero => new vec2d(0, 0); + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/vec3d.cs b/源代码/StgSharpDebug/Math/Linear/vec3d.cs new file mode 100644 index 00000000..0913f400 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/vec3d.cs @@ -0,0 +1,239 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="vec3d.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + +using StgSharp.Data; + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.AccessControl; + +namespace StgSharp.Math +{ + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] + public struct vec3d : IEquatable, IVector + { + + [FieldOffset(0)] internal unsafe fixed float num[3]; + [FieldOffset(0)] + internal M128 reg; + + [FieldOffset(0)] + internal Vector3 v; + + [FieldOffset(0)] + internal Vector4 vec; + + [FieldOffset(0)] public float X; + [FieldOffset(4)] public float Y; + [FieldOffset(8)] public float Z; + + internal vec3d(Vector4 vector) + { + vec = vector; + } + + internal vec3d(Vector3 vector) + { + v = vector; + } + + public vec3d(vec2d xy, float z) + { + vec = xy.vec; + Z = z; + } + + public vec3d( + float x, float y, float z) + { +#if NET5_0_OR_GREATER + Unsafe.SkipInit(out vec); +#endif + v = new Vector3(x, y, z); + } + + public vec3d XYZ + { + get { return new vec3d(v); } + } + + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float Dot(vec3d right) + { + return Vector3.Dot(v, right.v); + } + + public bool Equals(vec3d other) + { + return this.vec == other.vec; + } + + public override bool Equals(object obj) + { + if (obj is vec3d) + { + return this == (vec3d)obj; + } + else + { + return false; + } + } + + public override unsafe int GetHashCode() + { + fixed (float* add = &X) + { + return HashCode.Combine(X, Y, Z, (ulong)add); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float GetMaxValue() + { + float ret = X; + ret = (ret > Y) ? ret : Y; + ret = (ret > Z) ? ret : Z; + return ret; + } + + public override string ToString() + { + return $"[{X},{Y},{Z}]"; + } + + public string ToString(string sample) + { + return $"[{X.ToString(sample)},{Y.ToString(sample)},{Z.ToString(sample)}]"; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public vec3d Zero() + { + return new vec3d(0, 0, 0); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static vec3d operator -(vec3d vec) + { + return new vec3d(-vec.vec); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static vec3d operator -(vec3d left, vec3d right) + { + return new vec3d(left.v - right.v); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(vec3d left, vec3d right) + { + return left.v != right.v; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static vec3d operator *(vec3d vec, float value) + { + return new vec3d(vec.v * value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float operator *(vec3d left, vec3d right) + { + return Vector3.Dot(left.v, right.v); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static vec3d operator /(vec3d vec, float value) + { + return new vec3d(vec.v / value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static vec3d operator +(vec3d left, vec3d right) + { + return new vec3d(left.vec + right.vec); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(vec3d left, vec3d right) + { + return left.v == right.v; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe implicit operator vec3d((float, float, float) tuple) + { + vec3d v = *(vec3d*)&tuple; + v.vec.W = 0.0f; + return v; + } + + public unsafe vec2d XY + { + get => new vec2d(this.vec); + set + { + fixed (Vector3* vptr = &v) + { + *(Vector2*)vptr = value.v; + } + } + } + + } + + public static class Vec3d + { + + public static vec3d One => new vec3d(1, 1, 1); + public static vec3d UnitX => new vec3d(1, 0, 0); + public static vec3d UnitY => new vec3d(0, 1, 0); + + public static vec3d UnitZ => new vec3d(0, 0, 1); + public static vec3d Zero => new vec3d(0, 0, 0); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static vec3d Cross(vec3d left, vec3d right) + { + return Linear.Cross(left, right); + } + + public static bool IsParallel(vec3d left, vec3d right) + { + return Cross(left, right) == Zero; + } + + } +} diff --git a/源代码/StgSharpDebug/Math/Linear/vec4d.cs b/源代码/StgSharpDebug/Math/Linear/vec4d.cs new file mode 100644 index 00000000..256d19e0 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Linear/vec4d.cs @@ -0,0 +1,179 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Vec4d.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + +using StgSharp.Data; +using StgSharp.Math; + +using System; +using System.Data.Common; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace StgSharp.Math +{ + public static class Vec4d + { + + public static vec4d One + { + get => new vec4d(Vector4.One); + } + public static vec4d Zero + { + get => new vec4d(Vector4.Zero); + } + + } + + [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] + public struct vec4d : IEquatable, IVector + { + + [FieldOffset(0)] internal unsafe fixed float num[4]; + + [FieldOffset(0)] internal M128 reg; + + [FieldOffset(0)] internal Vector4 vec; + [FieldOffset(12)] public float W; + + [FieldOffset(0)] public float X; + [FieldOffset(4)] public float Y; + [FieldOffset(8)] public float Z; + + internal vec4d(Vector4 v) + { + vec = v; + } + + public vec4d(vec3d v, float w) + { + vec = v.vec; + W = w; + } + + public vec4d(float x, float y, float z, float w) + { + vec = new Vector4(x, y, z, w); + } + + public unsafe vec3d XYZ + { + get => new vec3d(vec); + set + { + float w = W; + vec = value.vec; + W = w; + } + } + public unsafe vec2d XY + { + get => new vec2d(vec); + set + { + X = value.X; + Y = value.Y; + } + } + + public override bool Equals(object obj) + { + return (obj is vec4d v) ? (v == this) : false; + } + + public override int GetHashCode() + { + return vec.GetHashCode(); + } + + public override string ToString() + { + return vec.ToString(); + } + + public static bool operator !=(vec4d left, vec4d right) + { + return !(left == right); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static vec4d operator *(Matrix44 mat, vec4d vec) + { + mat.InternalTranspose(); + return new vec4d( + Vector4.Dot(mat.transpose.colum0, vec.vec), + Vector4.Dot(mat.transpose.colum1, vec.vec), + Vector4.Dot(mat.transpose.colum2, vec.vec), + Vector4.Dot(mat.transpose.colum3, vec.vec) + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static vec4d operator +(vec4d left, vec4d right) + { + return new vec4d(left.vec + right.vec); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static vec4d operator -(vec4d left, vec4d right) + { + return new vec4d(left.vec - right.vec); + } + + public static bool operator ==(vec4d left, vec4d right) + { + return left.vec == right.vec; + } + + public static implicit operator M128(vec4d vec) + { + return vec.reg; + } + + bool IEquatable.Equals(vec4d other) + { + return vec == other.vec; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static vec4d Subtract(vec4d left, vec4d right) + { + return left - right; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static vec4d Add(vec4d left, vec4d right) + { + return left + right; + } + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Math/Scalar/ACos.cs b/源代码/StgSharpDebug/Math/Scalar/ACos.cs new file mode 100644 index 00000000..dcbd5983 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Scalar/ACos.cs @@ -0,0 +1,110 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="ACos.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Runtime.CompilerServices; + +namespace StgSharp.Math +{ + public static unsafe partial class Scaler + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe float ACos(float x) + { + return MathF.Acos(x); + + /* + int sign = 1; + float y; + + if (x < 0) + { + sign = -1; + y = -x; + } + else + { + y = x; + } + + if (x > 1) + { + throw new ArgumentException(); + } + + float r, s, u, v = 0.0f; + bool transform = (y >= 0.5f); + + if (transform) + { + r = 0.5f * (1.0f - y); + s = Scaler.Sqrt(r); + y = s; + } + else + { + r = y * y; + } + u = r * (0.184161606965100694821398249421F + + (-0.0565298683201845211985026327361F + + (-0.0133819288943925804214011424456F - + 0.00396137437848476485201154797087F * r) * r) * r) / + (1.10496961524520294485512696706F - + 0.836411276854206731913362287293F * r); + /* + + if (transform) + { + float c, s1, p, q; + uint us; + + us = *(uint*)&s; + uint uss = us & 0xffff0000; + s1 = *(float*)&uss; + + c = (r - s1 * s1) / (s + s1); + p = 2.0F * s * u - (piby2_tail - 2.0F * c); + q = hpiby2_head - 2.0F * s1; + v = hpiby2_head - (p - q); + } + else + { + v = y + y * u; + } + + v = sign * v; + + return piby2 - v; + */ + } + + } +} diff --git a/源代码/StgSharpDebug/Math/Scalar/ASin.cs b/源代码/StgSharpDebug/Math/Scalar/ASin.cs new file mode 100644 index 00000000..535ee61f --- /dev/null +++ b/源代码/StgSharpDebug/Math/Scalar/ASin.cs @@ -0,0 +1,118 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="ASin.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; + + +namespace StgSharp.Math +{ + public static unsafe partial class Scaler + { + + private const float + piby2_tail = 7.5497894159e-08f, /* 0x33a22168 */ + hpiby2_head = 7.8539812565e-01f, /* 0x3f490fda */ + piby2 = 1.5707963705e+00f; /* 0x3fc90fdb */ + + + /// + /// Reurns the value of ArcSin(x) + /// + /// The sine value of the angle + /// + /// + public static float ASin(float x) + { + return MathF.Asin(x); + /* + int sign = 1; + float y; + + if (x < 0) + { + sign = -1; + y = -x; + } + else + { + y = x; + } + + if (x > 1) + { + throw new ArgumentException(); + } + + float r, s, u, v = 0.0f; + bool transform = (y >= 0.5f); + + if (transform) + { + r = 0.5f * (1.0f - y); + s = Scaler.Sqrt(r); + y = s; + } + else + { + r = y * y; + } + u = r * (0.184161606965100694821398249421F + + (-0.0565298683201845211985026327361F + + (-0.0133819288943925804214011424456F - + 0.00396137437848476485201154797087F * r) * r) * r) / + (1.10496961524520294485512696706F - + 0.836411276854206731913362287293F * r); + /* + + if (transform) + { + float c, s1, p, q; + uint us; + + us = *(uint*)&s; + uint uss = us & 0xffff0000; + s1 = *(float*)&uss; + + c = (r - s1 * s1) / (s + s1); + p = 2.0F * s * u - (piby2_tail - 2.0F * c); + q = hpiby2_head - 2.0F * s1; + v = hpiby2_head - (p - q); + } + else + { + v = y + y * u; + }/* + + return sign * v; + */ + } + + } +} diff --git a/源代码/StgSharpDebug/Math/Scalar/ATan.cs b/源代码/StgSharpDebug/Math/Scalar/ATan.cs new file mode 100644 index 00000000..0939826e --- /dev/null +++ b/源代码/StgSharpDebug/Math/Scalar/ATan.cs @@ -0,0 +1,119 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="ATan.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Runtime.CompilerServices; + +namespace StgSharp.Math +{ + public static unsafe partial class Scaler + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe float ATan(float x) + { + return MathF.Atan(x); + /* + float sign = 1, angle = 0; + if (x < 0) + { + sign = -1; + x = -x; + } + uint xBit = *(uint*)&x; + int xExp = (int)(xBit >> 23) - 127; + if (xExp >= 26) + { + return 1; + } + if (xExp <= -15) + { + return x; + } + if (xExp >= 0) + { + x = (x - 1) / (x + 1); + angle = 0.7853981634f; + } + + float v = 0.7853981634f * x + x * (1 - x) * (0.2447f + 0.0663f * x); + v += angle; + v *= sign; + + return v; + + + } + + + public static unsafe float ATan(float x, float y) + { + + + float z = y / x; + + float sign = 1, angle = 0, angle2 = 0; + if (x < 0) + { + angle = -3.1415926535f; + } + if (z < 0) + { + sign = -1; + z = -z; + } + uint zBit = *(uint*)&z; + int zExp = (int)(zBit >> 23) - 127; + if (zExp >= 26) + { + return 1; + } + if (zExp <= -15) + { + return z; + } + if (zExp >= 0) + { + z = (z - 1) / (z + 1); + angle2 = 0.7853981634f; + } + + float v = 0.7853981634f * z + z * (1 - z) * (0.2447f + 0.0663f * z); + v *= 57.29577951f; + v += angle2; + v += angle; + v *= sign; + + return v; + */ + } + + } +} diff --git a/源代码/StgSharp/Data/Encode/EncodStream.cs b/源代码/StgSharpDebug/Math/Scalar/BasicOps.cs similarity index 61% rename from 源代码/StgSharp/Data/Encode/EncodStream.cs rename to 源代码/StgSharpDebug/Math/Scalar/BasicOps.cs index 7e99739e..ad0c66ac 100644 --- a/源代码/StgSharp/Data/Encode/EncodStream.cs +++ b/源代码/StgSharpDebug/Math/Scalar/BasicOps.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="EncodStream.cs" +// file="BasicOps.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -28,55 +28,45 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- -using StgSharp.Data; - using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; +using System.Globalization; +using System.Runtime.CompilerServices; -namespace StgSharp.Data +namespace StgSharp.Math { - public class EncodeStream + public static unsafe partial class Scaler { - byte[] buffer; - BitArray bufferArray; - byte count; - List data; - - public EncodeStream() + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe float Abs(float x) { - count = 0; - buffer = new byte[1]; - data = new List(); - bufferArray = new BitArray(8, true); + uint* a = (uint*)&x; + *a &= 0b_0111_1111_1111_1111_1111_1111_1111_1111; + return *(float*)a; } - public List EncodeData -=> data; - - public int Length => data.Count; - - public string Output => Encoding.UTF8.GetString(data.ToArray()); - - public void WriteBits(HuffmanKey key) where T : struct + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe int Abs(int x) { - BitArray bit = key.GetBitArray(); - for (int i = 0; i < bit.Count; i++) + uint* a = (uint*)&x; + *a &= 0b_0111_1111_1111_1111_1111_1111_1111_1111; + return *(int*)a; + } + + internal static string GetListSeparator(IFormatProvider formatProvider) + { + if (formatProvider is CultureInfo cultureInfo) { - if (count == 8) - { - bufferArray.CopyTo(buffer, 0); - data.Add(buffer[0]); - count = 0; - } - bufferArray[count] = bit[i]; - count++; + return cultureInfo.TextInfo.ListSeparator; } + + if (formatProvider?.GetFormat(typeof(TextInfo)) is TextInfo textInfo) + { + return textInfo.ListSeparator; + } + + return CultureInfo.CurrentCulture.TextInfo.ListSeparator; } } - - -} +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Math/Scalar/Compare.cs b/源代码/StgSharpDebug/Math/Scalar/Compare.cs new file mode 100644 index 00000000..4644403c --- /dev/null +++ b/源代码/StgSharpDebug/Math/Scalar/Compare.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Math +{ + public static partial class Scaler + { + public static float MaxOf(params float[] stream) + { + float ret = stream[0]; + foreach (var num in stream) + { + if (ret < num) + { + ret = num; + } + } + return ret; + } + public static float MinOf(params float[] stream) + { + float ret = stream[0]; + foreach (var num in stream) + { + if (ret > num) + { + ret = num; + } + } + return ret; + } + + + + } +} diff --git a/源代码/StgSharpDebug/Math/Scalar/Cos.cs b/源代码/StgSharpDebug/Math/Scalar/Cos.cs new file mode 100644 index 00000000..8cb3224e --- /dev/null +++ b/源代码/StgSharpDebug/Math/Scalar/Cos.cs @@ -0,0 +1,60 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Cos.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Runtime.CompilerServices; + +namespace StgSharp.Math +{ + public static partial class Scaler + { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Cos(float x) + { + /* + float refer = x / 360.0f; + refer -= (int)refer; + + refer *= 40; + int a = (int)refer; //大分度,查表 + refer -= a; //小分度,拟合 + + float refer2 = refer * refer; + + + return ((-sinData[a]) * ((0.1570796327f * refer) - (6.459640975e-4f * refer * refer2))) + + (cosData[a] * ((1 - (0.0123370055f * refer2)) + (2.536695709e-5f * refer2 * refer2))); + */ + return MathF.Cos(x); + } + + } +} diff --git a/源代码/StgSharpDebug/Math/Scalar/Ctor.cs b/源代码/StgSharpDebug/Math/Scalar/Ctor.cs new file mode 100644 index 00000000..d9c239f1 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Scalar/Ctor.cs @@ -0,0 +1,56 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Ctor.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Runtime.InteropServices; + +namespace StgSharp.Math +{ + public unsafe delegate float ScalarCalcHandler(float* x); + + public static unsafe partial class Scaler + { + + const uint MEM_COMMIT = 0x1000; + const uint MEM_RELEASE = 0x8000; + const uint MEM_RESERVE = 0x2000; + const uint PAGE_EXECUTE_READWRITE = 0x40; + + static Scaler() + { + } + + [DllImport("Kernel32.dll", EntryPoint = "VirtualAlloc")] + private static extern IntPtr VirtualAlloc(IntPtr address, int size, uint allocType, uint protect); + [DllImport("Kernel32.dll", EntryPoint = "VirtualFree")] + private static extern bool VirtualFree(IntPtr address, int size, uint freeType); + + } +} diff --git a/源代码/StgSharpDebug/Math/Scalar/Exp.cs b/源代码/StgSharpDebug/Math/Scalar/Exp.cs new file mode 100644 index 00000000..7934cc44 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Scalar/Exp.cs @@ -0,0 +1,108 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Exp.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +namespace StgSharp.Math +{ + public static unsafe partial class Scaler + { + + public const float E = 2.718281828f; + + /// + /// Get the value of E ^ x; + /// + /// + /// + public static unsafe float Exp(float x) + { + if (x == 1) + { + return E; + } + if (x == 0) + { + return 1; + } + + bool sign = false; + if (x < 0) + { + sign = true; + x = -x; + } + + float z = x, t; + if (x < 0.5f) + { + t = 1.0f + (x * ( + 1.0f + (x * ( + 0.5f + (x * ( + 0.1666666667f + (x * ( + 0.0416666666667f + (x * + 8.333333333e-3f))))))))); + } + else + { + /* + * define z = n * 2 ^ m + * n is between 0 and 0.5 + */ + uint zBit = *(uint*)&z; + uint zBitAbs = zBit & 0b_0111_1111_1111_1111_1111_1111_1111_1111; + uint uintm = zBitAbs >> 23; + int m = (*(int*)&uintm) - 126; + + + uint nBit = (zBitAbs & 0b_0000_0000_0111_1111_1111_1111_1111_1111) + + 0b_0011_1111_0000_0000_0000_0000_0000_0000; + float n = (*(float*)&nBit) - 1; + + t = 2.718281828f + (n * ( + 2.718281828f + (n * ( + 1.359140914f + (n * ( + 0.4530469714f + (n * ( + 0.1132617429f + (n * + 0.02265234857f))))))))); + + for (int i = 0; i < m; i++) + { + t = t * t; + } + } + + if (sign) + { + t = 1 / t; + } + return t; + } + + } +} diff --git a/源代码/StgSharpDebug/Math/Scalar/Function.cs b/源代码/StgSharpDebug/Math/Scalar/Function.cs new file mode 100644 index 00000000..af8aa838 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Scalar/Function.cs @@ -0,0 +1,38 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Function.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +namespace StgSharp.Math +{ + public class Function + { + + + } +} diff --git a/源代码/StgSharpDebug/Math/Scalar/Log.cs b/源代码/StgSharpDebug/Math/Scalar/Log.cs new file mode 100644 index 00000000..2c288265 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Scalar/Log.cs @@ -0,0 +1,96 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Log.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; + +namespace StgSharp.Math +{ + public static partial class Scaler + { + + private static readonly float[] logArray = + { + 0f, 0.00995033085316809f, 0.0198026272961797f, 0.0295588022415444f, 0.0392207131532813f, 0.048790164169432f, 0.0582689081239758f, 0.0676586484738149f, 0.0769610411361284f, 0.0861776962410524f, + 0.0953101798043249f, 0.104360015324243f, 0.113328685307003f, 0.122217632724249f, 0.131028262406404f, 0.139761942375159f, 0.148420005118273f, 0.157003748809665f, 0.165514438477573f, 0.173953307123438f, + 0.182321556793955f, 0.19062035960865f, 0.198850858745165f, 0.207014169384326f, 0.215111379616945f, 0.22314355131421f, 0.231111720963387f, 0.2390169004705f, 0.246860077931526f, 0.254642218373581f, + 0.262364264467491f, 0.27002713721306f, 0.27763173659828f, 0.285178942233662f, 0.29266961396282f, 0.300104592450338f, 0.307484699747961f, 0.314810739840034f, 0.322083499169113f, 0.3293037471426f, + 0.336472236621213f, 0.343589704390077f, 0.350656871613169f, 0.357674444271816f, 0.364643113587909f, 0.371563556432483f, 0.378436435720245f, 0.385262400790645f, 0.392042087776024f, 0.398776119957368f, + 0.405465108108164f, 0.412109650826833f, 0.418710334858185f, 0.425267735404344f, 0.431782416425538f, 0.438254930931155f, 0.444685821261446f, 0.451075619360217f, 0.457424847038875f, 0.46373401623214f, + 0.470003629245736f, 0.476234178996372f, 0.482426149244293f, 0.488580014818671f, 0.494696241836107f, 0.500775287912489f, 0.506817602368452f, 0.512823626428664f, 0.518793793415168f, 0.524728528934982f, + 0.53062825106217f, 0.536493370514568f, 0.542324290825362f, 0.548121408509688f, 0.553885113226438f, 0.559615787935423f, 0.56531380905006f, 0.570979546585738f, 0.576613364303994f, 0.582215619852664f, + 0.587786664902119f, 0.593326845277734f, 0.598836501088704f, 0.60431596685333f, 0.609765571620894f, 0.615185639090233f, 0.62057648772511f, 0.625938430866495f, 0.631271776841858f, 0.636576829071551f, + 0.641853886172395f, 0.647103242058538f, 0.65232518603969f, 0.657520002916794f, 0.662687973075237f, 0.667829372575655f, 0.672944473242426f, 0.678033542749897f, 0.683096844706444f, 0.688134638736401f, + }; + + /// + /// + /// + /// + /// + /// Returns the value of ln(x). + /// + public static unsafe float Log(float x) + { + if (x < 0) + { + throw new ArgumentOutOfRangeException(); + } + uint input = *(uint*)&x; + + int f = (int)input; + f >>= 23; + f -= 127; + input <<= 9; + input >>= 9; + input += 0b_0011_1111_1000_0000_0000_0000_0000_0000; + float result = *(float*)&input; + uint order = ((uint)(result * 100)) - 100; + + float cache = (result / (1f + (0.01f * order))) - 1; + result = (cache * (-0.25f)) + 0.3333333333333f; + result = (result * cache) - 0.5f; + result = (result * cache) + 1.0f; + result *= cache; + + return + (f * 0.6931471806f) + + result + + logArray[order]; + } + + + public static float Log(float x, float y) + { + return Log(x) / Log(y); + } + + + } +} diff --git a/源代码/StgSharpDebug/Math/Scalar/Pow.cs b/源代码/StgSharpDebug/Math/Scalar/Pow.cs new file mode 100644 index 00000000..496f378e --- /dev/null +++ b/源代码/StgSharpDebug/Math/Scalar/Pow.cs @@ -0,0 +1,123 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Pow.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +namespace StgSharp.Math +{ + public static unsafe partial class Scaler + { + + /// + /// calculate the value of x^y + /// + /// + /// + /// Returns the value of x^y + public static unsafe float Pow(float x, float y) + { + /* + * x^y = E ^ ( log( x ) * y ) + * Now define z = | log(x) * y | = m * n + * and m is an integer, and 0.5 < |n| < 1 + * then E ^ z = ( E ^ n ) ^ m + * + * + * As a float number can be expressed in (1+e)*(2^f) + * n = (1+e)/2 + * m = 2 ^ (f + 1) + * + */ + float z, t; + if ((x == 1) || (y == 0)) + { + return 1; + } + if ((x == 1) && (y == 0)) + { + return float.PositiveInfinity; + } + if ((x == 0) && (y != 0)) + { + return 0; + } + + z = Scaler.Log(x) * y; + + bool sign = false; + if (z < 0) + { + sign = true; + z = -z; + } + + if (z < 0.5f) + { + t = 1.0f + (z * ( + 1.0f + (z * ( + 0.5f + (z * ( + 0.1666666667f + (z * ( + 0.0416666666667f + (z * + 8.333333333e-3f))))))))); + } + else + { + uint zBit = *(uint*)&z; + uint zBitAbs = zBit & 0b_0111_1111_1111_1111_1111_1111_1111_1111; + uint uintm = zBitAbs >> 23; + int m = (*(int*)&uintm) - 126; + + + uint nBit = (zBitAbs & 0b_0000_0000_0111_1111_1111_1111_1111_1111) + + 0b_0011_1111_0000_0000_0000_0000_0000_0000; + float n = (*(float*)&nBit) - 1; + + t = 2.718281828f + (n * ( + 2.718281828f + (n * ( + 1.359140914f + (n * ( + 0.4530469714f + (n * ( + 0.1132617429f + (n * + 0.02265234857f))))))))); + + for (int i = 0; i < m; i++) + { + t = t * t; + } + + + } + if (sign) + { + t = 1 / t; + } + + return t; + } + + } +} diff --git a/源代码/StgSharpDebug/Math/Scalar/Random.cs b/源代码/StgSharpDebug/Math/Scalar/Random.cs new file mode 100644 index 00000000..5567870d --- /dev/null +++ b/源代码/StgSharpDebug/Math/Scalar/Random.cs @@ -0,0 +1,135 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Random.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + +using StgSharp.Math.HighPrecession; + +using System; +using System.Collections.Generic; +using System.Data; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Security.Cryptography; +using System.Text; + +namespace StgSharp.Math +{ + public static unsafe partial class Scaler + { + + private static byte[] randomSeed; + + /// + /// returns a random float number between 0 and 1. + /// + /// + public static unsafe float LowProceisionRandom() + { + float seed = currentSeed; + + float sample = Scaler.Pow(Scaler.SeedSqrt(seed), 2); + float sample2 = (sample - seed) / seed; + sample2 = Scaler.Abs(sample2); + + if (sample == 1) + { + sample = sample2; + } + + currentSeed = sample; + sample2 *= 1000000; + + float result = sample2 - ((int)sample2); + if (result == 0) + { + currentSeed = sample2 + 0.1f; + result = Scaler.LowProceisionRandom(); + } + return result; + + } + + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T Random() where T : struct, IConvertible +#if NET8_0_OR_GREATER + ,INumber +#endif + { + if (randomSeed == null) + { + randomSeed = new byte[64]; + string originSeed = + ($"{((Assembly.GetEntryAssembly() == null) ? (Assembly.GetAssembly(typeof(StgSharp))!) : + Assembly.GetEntryAssembly())}") + + ($"{DateTime.UtcNow.ToString("o")}"); + using (SHA256 sha = SHA256.Create()) + { + randomSeed = sha.ComputeHash(Encoding.UTF8.GetBytes(originSeed)); + } + } + using (SHA256 sha = SHA256.Create()) + { + randomSeed = sha.ComputeHash(randomSeed); + } + fixed (byte* bptr = randomSeed) + { + return *(T*)bptr; + } + } + + /// + /// Generates a random seed in int value. + /// + /// + public static unsafe int RandomSeed() + { + float seedValue1 = LowProceisionRandom(); + float seedValue2 = LowProceisionRandom(); + uint seedValueBits = *(uint*)&seedValue1; + + float seedValue = seedValueBits * seedValue2; + + return *(int*)&seedValue; + } + + internal static float currentSeed +#if DEBUG + = 0.5f; +#else + = Abs(System.DateTime.UtcNow.GetHashCode()); +#endif + + + } +} diff --git a/源代码/StgSharp/Math/Linear/Vector.VectorTransform.cs b/源代码/StgSharpDebug/Math/Scalar/SignOf.cs similarity index 67% rename from 源代码/StgSharp/Math/Linear/Vector.VectorTransform.cs rename to 源代码/StgSharpDebug/Math/Scalar/SignOf.cs index 03fb0ab9..083a8ace 100644 --- a/源代码/StgSharp/Math/Linear/Vector.VectorTransform.cs +++ b/源代码/StgSharpDebug/Math/Scalar/SignOf.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="Vector.VectorTransform.cs" +// file="SignOf.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -28,45 +28,44 @@ // //----------------------------------------------------------------------- //----------------------------------------------------------------------- -using System.Numerics; +using System; +using System.Collections.Generic; +using System.Linq; using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; namespace StgSharp.Math { - public static unsafe partial class VectorCalc + public static unsafe partial class Scaler { - public static vec2d To2D(vec3d vec, CoordinatePlain plain) - { - switch (plain) - { - case CoordinatePlain.XY: - return new vec2d(vec.X, vec.Y); - break; - case CoordinatePlain.YZ: - return new vec2d(vec.Y, vec.Z); - break; - case CoordinatePlain.XZ: - return new vec2d(vec.X, vec.Z); - break; - default: - return default(vec2d); - break; - } - } - public static vec3d To3D(vec2d vec) - { - return new vec3d(vec.X, vec.Y, 0.0f); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static vec3d To3D(Vector4 vector) + public static unsafe int SignOf(float x) { - return new vec3d(vector); + if (x == 0) + { + return 0; + } + if (x > 0) + { + return 1; + } + return -1; + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe int SignOf(int x) + { + if (x == 0) + { + return 0; + } + if (x > 0) + { + return 1; + } + return -1; } } - - - } diff --git a/源代码/StgSharpDebug/Math/Scalar/Sin.cs b/源代码/StgSharpDebug/Math/Scalar/Sin.cs new file mode 100644 index 00000000..f37e769d --- /dev/null +++ b/源代码/StgSharpDebug/Math/Scalar/Sin.cs @@ -0,0 +1,91 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Sin.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Net.NetworkInformation; +using System.Runtime.CompilerServices; + +namespace StgSharp.Math +{ + public static partial class Scaler + { + + public const float Pi = 3.1415926f; + + private static readonly float[] cosData = + { + 1f, 0.987688341014302f, 0.951056517951169f, 0.891006527837756f, 0.809017000674805f, + 0.707106790659974f, 0.587785265298989f, 0.453990516451646f, 0.309017014761716f, 0.156434488858737f, + 2.67948965850537E-08f, -0.156434435928723f, -0.309016963794794f, -0.453990468702791f, -0.587785221943935f, + -0.707106752766267f, -0.809016969175515f, -0.891006503508499f, -0.951056501391011f, -0.98768833263101f, + -0.999999999999999f, -0.987688349397591f, -0.951056534511324f, -0.891006552167012f, -0.809017032174094f, + -0.707106828553679f, -0.587785308654041f, -0.4539905642005f, -0.309017065728638f, -0.156434541788751f, + -8.03846893110719E-08f, 0.156434382998709f, 0.309016912827872f, 0.453990420953934f, 0.58778517858888f, + 0.707106714872559f, 0.809016937676222f, 0.891006479179238f, 0.951056484830851f, 0.987688324247716f, + + + }; + + private static readonly float[] sinData = + { + 0f, 0.15643446239373f, 0.309016989278255f, 0.453990492577218f, 0.587785243621462f, + 0.707106771713121f, 0.80901698492516f, 0.891006515673128f, 0.951056509671091f, 0.987688336822657f, + 1f, 0.987688345205947f, 0.951056526231247f, 0.891006540002384f, 0.80901701642445f, + 0.707106809606826f, 0.587785286976515f, 0.453990540326073f, 0.309017040245177f, 0.156434515323744f, + 5.35897931701074E-08f, -0.156434409463716f, -0.309016938311333f, -0.453990444828362f, -0.587785200266408f, + -0.707106733819413f, -0.809016953425868f, -0.891006491343869f, -0.951056493110931f, -0.987688328439363f, + -0.999999999999997f, -0.987688353589235f, -0.951056542791401f, -0.891006564331638f, -0.809017047923737f, + -0.70710684750053f, -0.587785330331566f, -0.453990588074927f, -0.309017091212098f, -0.156434568253757f, + + + }; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe float Sin(float x) + { + /* + float refer = x / 360.0f; + refer -= (int)refer; + + refer *= 40; + int a = (int)refer; //大分度,查表 + refer -= a; //小分度,拟合 + + float refer2 = refer * refer; + + + return (sinData[a] * ((1 - (0.0123370055f * refer2)) + (2.536695709e-5f * refer2 * refer2))) + + (cosData[a] * ((0.1570796327f * refer) - (6.459640975e-4f * refer * refer2))); + */ + return MathF.Sin(x); + } + + } +} diff --git a/源代码/StgSharpDebug/Math/Scalar/Sqrt.cs b/源代码/StgSharpDebug/Math/Scalar/Sqrt.cs new file mode 100644 index 00000000..e281655e --- /dev/null +++ b/源代码/StgSharpDebug/Math/Scalar/Sqrt.cs @@ -0,0 +1,111 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Sqrt.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Runtime.CompilerServices; + +namespace StgSharp.Math +{ + public static partial class Scaler + { + + public static unsafe float SeedSqrt(float x) + { + /* + * 本方法采用分别对指数和小数处理的方法计算平方根 + * 将指数除以2即可获得结果的指数 + * (补充:指数最低位被加到小数位中以抵消一个多余的2 ^ 1的影响) + * 小数部分则统一乘以2 ^ 16后由y = Sqrt(x)在1.5 * 2 ^ 16处的切线近似 + * 为简化操作,提高计算速度,切线左界被移动到远点 + * 在进一步简化操作后,计算精度达到0.5%,速度约为.Net库函数的3倍 + */ + + if (x < 0) + { + throw new ArgumentOutOfRangeException("Input is smaller than zero!"); + } + if (x == 0) + { + return 0; + } + /* + * 提取指数位并减半 + * 由于平方根仅对正数有效 + * 故不考虑正负号 + */ + + if (x < 0) + { + throw new ArgumentOutOfRangeException(); + } + if (x <= 1e-12) + { + return 0; + } + + //提取指数位并减去指数位中的127 + //由于平方根仅对正数有效 + //故不考虑正负号 + uint a = *(uint*)&x; + uint f = a; + f >>= 23; + f /= 2; + f += 64; + + //提取小数位 + //由于平方根仅对正数有效 + //故不考虑正负号 + + a -= 0b_0011_1111_0000_0000_0000_0000_0000_0000; + uint e = a << 8; + e >>= 8; + + //线性近似 + e *= 0b_1101_0001; + e >>= 24; + e += 0b_0000_0000_0001_0000_1010_1000_1110_0010; + + //还原指数 + f <<= 23; + e += f; + + float result = *(float*)&e; + result = (result + (x / result)) / 2; + return (result + (x / result)) / 2; + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Sqrt(float x) + { + return MathF.Sqrt(x); + /**/ + } + + } +} diff --git a/源代码/StgSharpDebug/Math/Scalar/Tan.cs b/源代码/StgSharpDebug/Math/Scalar/Tan.cs new file mode 100644 index 00000000..687727b0 --- /dev/null +++ b/源代码/StgSharpDebug/Math/Scalar/Tan.cs @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Tan.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +namespace StgSharp.Math +{ + public static partial class Scaler + { + + public static float Tan(float x) + { + float refer = x / 360.0f; + refer -= (int)refer; + + refer *= 40; + int a = (int)refer; //大分度,查表 + refer -= a; //小分度,拟合 + + float refer2 = refer * refer; + + float sin = (0.1570796327f * refer) - (6.459640975e-4f * refer * refer2); + float cos = (1 - (0.0123370055f * refer2)) + (2.536695709e-5f * refer2 * refer2); + + return ((sinData[a] * cos) + (cosData[a] * sin)) + / ((cosData[a] * cos) - (sinData[a] * sin)); + } + + } +} diff --git a/源代码/StgSharp/Geometries/PlainGeometry/GemoryException.cs b/源代码/StgSharpDebug/Math/glClampf.cs similarity index 62% rename from 源代码/StgSharp/Geometries/PlainGeometry/GemoryException.cs rename to 源代码/StgSharpDebug/Math/glClampf.cs index cea81165..dbe60314 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/GemoryException.cs +++ b/源代码/StgSharpDebug/Math/glClampf.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="GemoryException.cs" +// file="glClampf.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -29,49 +29,64 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- using System; -using System.Runtime.Serialization; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; -namespace StgSharp.Geometries +namespace StgSharp.Math { - public unsafe class ToUpperDimensionException : Exception + /// + /// OpenGL numeric type. + /// An IEEE-754 floating-point value, clamped to the range [0,1]. + /// + [StructLayout(LayoutKind.Sequential)] + public struct GLclampf { - protected ToUpperDimensionException(SerializationInfo info, StreamingContext context) : base(info, context) - { - } - public ToUpperDimensionException() + public float value; + + public GLclampf(float a) { + value = a; } - public ToUpperDimensionException(string message) : base(message) + public static explicit operator float(GLclampf v) { + return v.value; } - public ToUpperDimensionException(string message, Exception innerException) : base(message, innerException) + public static explicit operator GLclampf(float v) { + return new GLclampf(v); } } /// - /// 当几何体调用了过多的CalcVec方法时,产生UnusedVertexException异常 + /// OpenGL numeric type. + /// An IEEE-754 double precision floating-point value, clamped to the range [0,1]. /// - public class UnusedVertexException : Exception + [StructLayout(LayoutKind.Sequential)] + public struct GLclampd { - protected UnusedVertexException(SerializationInfo info, StreamingContext context) : base(info, context) - { - } - public UnusedVertexException() + public double value; + + public GLclampd(double a) { + value = a; } - public UnusedVertexException(string message) : base(message) + public static explicit operator double(GLclampd v) { + return v.value; } - public UnusedVertexException(string message, Exception innerException) : base(message, innerException) + public static explicit operator GLclampd(double v) { + return new GLclampd(v); } } diff --git a/源代码/StgSharpDebug/Math/glHalfNV.cs b/源代码/StgSharpDebug/Math/glHalfNV.cs new file mode 100644 index 00000000..e75b0eea --- /dev/null +++ b/源代码/StgSharpDebug/Math/glHalfNV.cs @@ -0,0 +1,63 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="glHalfNV.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Math +{ + + [StructLayout(LayoutKind.Explicit, Size = 16)] + public struct GLhalfNV + { + + [FieldOffset(0)] public short binary; + + public GLhalfNV(short bin) + { + binary = bin; + } + + public static explicit operator GLhalfNV(short x) + { + return new GLhalfNV(x); + } + + public static explicit operator short(GLhalfNV x) + { + return x.binary; + } + + } +} diff --git a/源代码/StgSharpDebug/Program.cs b/源代码/StgSharpDebug/Program.cs deleted file mode 100644 index 401faccd..00000000 --- a/源代码/StgSharpDebug/Program.cs +++ /dev/null @@ -1,233 +0,0 @@ -//using StgSharp.Environment.Win32; -using StgSharp.Geometries; -using StgSharp.Graphics; -using StgSharp.Math; - -using System; -using System.Runtime.CompilerServices; - -namespace StgSharp -{ - public class StgSharpDemoForm : Form - { - private Uniform color; - private ElementBuffer ebo; - private Uniform ourTexture; - private Uniform ourTexture2; - private ShaderProgram shader; - private Texture texture; - private VertexArray vao; - private VertexBuffer vbo; - private Camera camera; - - protected override unsafe void ProcessInput() - { - if (InternalIO.glfwGetKey(WindowID, (int)KeyboardKey.ESCAPE) - == KeyStatus.PRESS) - { - InternalIO.glfwSetWindowShouldClose(WindowID, 1); - } - } - - protected override void DeInit() - { - /**/ - vao.Dispose(); - vbo.Dispose(); - ebo.Dispose(); - /**/ - - } - - protected override void Init() - { - InternalIO.InternalWriteLog("\n\n\n", "Program start", LogType.Info); - - SetMetadata(800, 800, "Hello, STG#!", IntPtr.Zero, null); - MakeAsCurrentContext(); - this.LoadGLapi(); - SetSizeLimit(800, 800, 800, 800); - - - FrameBufferSizeCallback = - (IntPtr id, uint width, uint height) => - { - GL.Viewport(0, 0, width, height); - }; - - shader = CreateShaderProgram(); - var vertex = CreateShader(ShaderType.Vertex, 1); - var fragment = CreateShader(ShaderType.Fragment, 1); - vertex.Compile(0, File.ReadAllText("Shader\\vertex.vert")); - vertex.AttachTo(0, shader); - fragment.Compile(0, File.ReadAllText("Shader\\fragment.frag")); - fragment.AttachTo(0, shader); - shader.Link(); - Triangle tri = new Triangle( - -0.5f, -0.3f, 0.0f, - 0.5f, -0.5f, 0.0f, - 0.0f, 0.5f, 0.0f - ); - Rectangle rec = new Rectangle( - -0.3f, 0.3f, 130.0f, - 0.3f, 0.3f, 130.0f, - 0.3f, -0.3f, 130.0f, - -0.3f, -0.3f, 130.0f - ); - Polygon5 polygon = new Polygon5( - -0.4f, 0.5f, 0.0f, - 0.5f, 0.5f, 0.0f, - 0.6f, -0.5f, 0.0f, - 0, -1, 0, - -0.7f, -0.5f, 0.0f - ); - vao = CreateVertexArray(1); - vbo = CreateVertexBuffer(2); - ebo = CreateElementBuffer(1); - texture = CreateTexture(2); - float[] texCoord = { - 0.0f, 0.0f, - 1.0f, 0.0f, - 1.0f, 1.0f, - 0.0f, 1.0f }; - GL.BindVertexArray(vao[0]); - ebo.SetValue(0, rec.Indices, BufferUsage.STATIC_DRAW); - vbo.SetValue(0, rec.VertexBuffer, BufferUsage.STATIC_DRAW); - GL.SetVertexAttribute(0, 3, TypeCode.Single, false, 4 * sizeof(float), 0); - vbo.SetValueArray(1, texCoord, BufferUsage.STATIC_DRAW); - GL.SetVertexAttribute(2, 2, TypeCode.Single, false, 2 * sizeof(float), 0); - /**/ - GL.BindBuffer(BufferType.ARRAY_BUFFER, glHandle.Zero); - vao.BindNull(); - /**/ - texture.Bind2D(0); - texture.Set2dWrapProperty(Wrap.Repeat, Wrap.Repeat); - texture.Set2dFilterProperty(Filter.Nearest, Filter.Nearest); - texture.LoadTexture(0, "Shader\\Image1.png", null); - - texture.Bind2D(1); - texture.Set2dWrapProperty(Wrap.Repeat, Wrap.Repeat); - texture.Set2dFilterProperty(Filter.Nearest, Filter.Nearest); - texture.LoadTexture(1, "Shader\\awesomeface.png", null); - - shader.Use(); - /**/ - color = shader.GetUniform("color"); - ourTexture = shader.GetUniform("ourTexture"); - GL.SetValue(ourTexture, 0); - ourTexture2 = shader.GetUniform("ourTexture2"); - GL.SetValue(ourTexture2, 1); - /**/ - - camera = new Camera( - new vec3d(0,0,200), - new vec3d(0,0,100), - new vec3d(0,1,0) - ); - camera.SetViewRange(new Degree(5),Size,(0,0),(50f,50f)); - camera.GainAllUniforms(shader, "camera"); - camera.Test(); - } - - protected override void Main() - { - float movement = 0.005f; - GL.ClearColor(0.333f, 0.555f, 0.555f, 1.0f); - - GL.Clear(MaskBufferBit.COLOR | MaskBufferBit.DEPTH); - - /**/ - vao.Bind(0); - shader.Use(); - /**/ - /**/ - texture.Activate(TextureUnit.Unit0); - texture.Bind2D(0); - texture.Activate(TextureUnit.Unit1); - texture.Bind2D(1); - /**/ - - /**/ - float time = CurrentFrameCount / 60.0f; - - if (InternalIO.glfwGetKey(this.WindowID,GLconst.GLFW_KEY_UP) == KeyStatus.PRESS) - { - camera.Pitch(new Radius(movement)); - } - else if (InternalIO.glfwGetKey(this.WindowID, GLconst.GLFW_KEY_DOWN) == KeyStatus.PRESS) - { - camera.Pitch(new Radius(-movement)); - } - - if (InternalIO.glfwGetKey(WindowID, GLconst.GLFW_KEY_LEFT) == KeyStatus.PRESS) - { - camera.Yaw(new Radius(-movement)); - } - else if (InternalIO.glfwGetKey(WindowID, GLconst.GLFW_KEY_RIGHT) == KeyStatus.PRESS) - { - camera.Yaw(new Radius(movement)); - } - - GL.SetValue(color, - 0.5f + MathF.Cos(time), - 0.5f + MathF.Sin(time * 0.66667f + (2 * Scaler.Pi / 3)), - 0.5f + MathF.Sin(time * 0.33333f + (Scaler.Pi / 3)), - time - ); - - camera.SetAllUniforms(); - /**/ - - GL.DrawElements(GepmetryType.TRIANGLES, 6, TypeCode.UInt32, IntPtr.Zero); - - //vao.BindNull(); - /**/ - } - - - - [MultiFrameActivity()] - public void Beep() - { - if (CurrentFrameCount%60==0) - { - Console.Beep(); - } - } - - - - //[RenderActivity(RenderPriority.Pre_1)] - public void NoOp() - { - int a = 1; - } - } - - internal static class Program - { - internal static unsafe void Main(string[] args) - { - try - { - //StgSharp.TryCreatWindow(); - - /**/ - StgSharp.Init(); - StgSharp.InitGL(4, 6); - StgSharp.GlobalSetting.VSyncActivated = false; - StgSharpDemoForm demoForm = new StgSharpDemoForm(); - demoForm.Show(); - StgSharp.Terminate(); - /**/ - - } - catch (Exception ex) - { - InternalIO.InternalWriteLog( - ex.Message + "\n" + ex.StackTrace, - LogType.Error); - } - } - } -} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Shader/fragment.frag b/源代码/StgSharpDebug/Shader/fragment.frag deleted file mode 100644 index 6f8c1558..00000000 --- a/源代码/StgSharpDebug/Shader/fragment.frag +++ /dev/null @@ -1,17 +0,0 @@ -#version 330 core - -in vec2 TexCoord; - -out vec4 FragColor; - -uniform vec4 color; -uniform sampler2D ourTexture; -uniform sampler2D ourTexture2; - -void main() -{ - vec4 tex1 = texture(ourTexture, TexCoord); - vec4 tex2 = texture(ourTexture2,TexCoord); - FragColor = mix(tex1 * vec4( color.xyz, 1.0), tex2, 0.2) /* *vec4( TexColor,1.0) /**/; -} - diff --git a/源代码/StgSharpDebug/Shader/vertex.vert b/源代码/StgSharpDebug/Shader/vertex.vert deleted file mode 100644 index a3a23d5e..00000000 --- a/源代码/StgSharpDebug/Shader/vertex.vert +++ /dev/null @@ -1,22 +0,0 @@ -#version 330 core - -layout(location = 0) in vec3 aPos; -layout(location = 1) in vec3 aColor; -layout(location = 2) in vec2 aTextCoord; - -out vec2 TexCoord; - -uniform mat4x4 camera; - -void main() -{ - - TexCoord = aTextCoord; - vec4 temp = vec4(aPos.xyz,1.0); - gl_Position = /**/ camera * /**/ temp; -} - -//struct - - - diff --git a/源代码/StgSharpDebug/Stg/Bullet.cs b/源代码/StgSharpDebug/Stg/Bullet.cs new file mode 100644 index 00000000..ea082de0 --- /dev/null +++ b/源代码/StgSharpDebug/Stg/Bullet.cs @@ -0,0 +1,98 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Bullet.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the ¡°Software¡±), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED ¡°AS IS¡±, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- + +using StgSharp.Geometries; +using StgSharp.Math; + +using System; + +namespace StgSharp.Gaming +{ + public abstract class Bullet : IInstancing, IPlainEntity + { + protected Bullet + ( + PlainInstancingBuffer buffer, + GeometryMotion movement, + vec2d beginPosition, + float angle, + float scale + ) + { + if (buffer == null) + { + throw new ArgumentNullException(nameof(buffer)); + } + GlobalBuffer = buffer; + BufferId = buffer.CreateInstanceID(); + ((IInstancing)this).Scale = scale; + ((IInstancing)this).Coord = new vec3d( beginPosition,0); + ((IInstancing)this).Rotation = angle; + Motion = movement; + } + + public int BufferId + { + get; + set; + } + + public vec2d CenterPosition + { + get; + set; + } + + public IInstancingBuffer GlobalBuffer + { + get; + set; + } + + public GeometryMotion Motion + { + get; + set; + } + + vec3d IInstancing.CenterPositionGlobal + { + get; + set; + } + + public bool CollideWith(IPlainEntity entity) + { + throw new System.NotImplementedException(); + } + + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Stg/CollisionTexture.cs b/源代码/StgSharpDebug/Stg/CollisionTexture.cs new file mode 100644 index 00000000..e16c5c7d --- /dev/null +++ b/源代码/StgSharpDebug/Stg/CollisionTexture.cs @@ -0,0 +1,217 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="CollisionTexture.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Data; +using StgSharp.Geometries; +using StgSharp.Graphics; +using StgSharp.Graphics.GL; +using StgSharp.Logic; +using StgSharp.Math; + +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Linq; +using System.Resources; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Stg +{ + public class CollisionTextureInput : BlueprintPipelineArgs + { + +#pragma warning disable CS8618 + public CollisionTextureInput() +#pragma warning restore CS8618 + { + } + + public new List Value + { + get; set; + } + + } + + public class OneDimensionalCollisionTexture2D : glRenderStream + { + + private const string inputName = "InstanceBufferList"; + private const string outputName = "CollisionTextureOutput"; + + private FrameBuffer fbo; + + ShaderProgram generatingShader; + + VertexArray vao; + VertexBuffer vbo; + ElementBuffer ebo; + + public OneDimensionalCollisionTexture2D(ViewPort args) : base(args,(1,1,1)) + { + throw new InvalidOperationException( + $"Collision TextureGL unit cannot share context with other render stream or set as mainstream of a form," + + $"and cannot be inited by {typeof(ViewPort).Name} as well." + ); + } + +#pragma warning disable CS8618 + public OneDimensionalCollisionTexture2D(Radius angleStride, string name) : +#pragma warning restore CS8618 + base( new ViewPort() + { + Height = 1, + Width = (int)((new Radius(Scaler.Pi)) / angleStride), + Name = name, + },(1, 1, 1)) + { + InternalInit(); + } + + protected override string[] InputPortsName => + [ + inputName, + ]; + + protected override string[] OutputPortsName => + [ + outputName, + ]; + + + protected override void Deinit() + { + throw new NotImplementedException(); + } + + protected override void Init() + { + generatingShader = CreateShaderProgram(); + + Shader vertexShader = CreateShaderSegment(ShaderType.Vertex, 1); + Shader fragmentShader = CreateShaderSegment(ShaderType.Fragment, 1); + + vertexShader.Compile(0, InternalIO.CollisionTextureVertexShader); + fragmentShader.Compile(0, InternalIO.CollisionTextureFragmentShader); + vertexShader.AttachTo(0, generatingShader); + fragmentShader.AttachTo(0, generatingShader); + + generatingShader.Link(); + generatingShader.Use(); + + vbo = CreateVertexBuffer(3); + vao = CreateVertexArray(1); + ebo = CreateElementBuffer(1); + + + fbo = CreateFrameBuffer(1); + RenderBuffer rbo = CreateRenderBuffer(1); + glFunc.SetRenderBufferStorage( + RenderBufferInternalFormat.Depth24_Stencil8, this.Size); + + + t = CreateTexture(1); + t.Bind2D(0); + glFunc.TextureImage2d(Texture2DTarget.Texture2D, 0, (int)ImageChannel.WithAlphaChannel, + (uint)Width, (uint)Height, (int)ImageChannel.WithAlphaChannel, ImageChannelLayout.Byte, glHandle.ZeroHandle); + + t.Set2dWrapProperty(Wrap.Repeat, Wrap.Repeat); + t.Set2dFilterProperty(Filter.Nearest, Filter.Nearest); + + glFunc.FrameBufferTexture2d(FrameBufferTarget.All, glAttachment.Color(0), + Texture2DTarget.Texture2D, t[0], 0); + + glFunc.CombineFrameBufferRenderBuffer(fbo[0], rbo[0]); + + textureOutput = new float[this.Width]; + } + + TextureGL t; + float[] textureOutput; + + protected override void Main( + in Dictionary input, + in Dictionary output) + { + if (input == null) + { + throw new InvalidOperationException($"Unknown operation lead to null ref of {nameof(input)}"); + } + if (input[inputName].Args is not CollisionTextureInput inpipeline || inpipeline.Value == null || inpipeline.Value.Count == 0) + { + throw new InvalidOperationException(); + } + List bufferList = inpipeline.Value; + + fbo.Bind(0); + glFunc.ClearColor(0, 0, 0, 1); + glFunc.Clear(MaskBufferBit.DEPTH|MaskBufferBit.COLOR); + generatingShader.Use(); + vao.Bind(0); + + foreach (IInstancingBuffer item in bufferList) + { + IGeometry g = item.TypicalShape; + + if (!(g is PlainGeometry)) + { + throw new InvalidOperationException("The current particle buffer contains non-planar geometry,"); + } + + ebo.Bind(0); + ebo.SetValue(0,g.VertexIndices,BufferUsage.StreamDraw); + + vbo.WriteVectorData(0,item.CoordAndRotationSpan,BufferUsage.StreamDraw); + VertexArray.SetVertexAttribute(1,3,TypeCode.Single,false, 4 * sizeof(float), 0); + VertexArray.SetVertexAttribute(2,1, TypeCode.Single,false,4*sizeof(float), 3 * sizeof(float)); + + vbo.WriteScalerData(2, item.ScalingSpan, BufferUsage.StreamDraw); + VertexArray.SetVertexAttribute(3, 1, TypeCode.Single, false, sizeof(float), 0); + + vbo.WriteVectorData(1,g.VertexStream,BufferUsage.StreamDraw); + VertexArray.SetVertexAttribute(0,3,TypeCode.Single,false,4*sizeof(float),0); + + glFunc.DrawElementsInstanced(GeometryType.TRIANGLES,(uint)g.VertexIndices.Length / 3, + TypeCode.UInt32,IntPtr.Zero,(uint)item.ScalingSpan.Length); + } + + t.Bind2D(0); + glFunc.GetTextureImage(Texture2DTarget.Texture2D,0,ImageChannel.SingleColor,ImageChannelLayout.Float,ref textureOutput); + VertexArray.BindNull(); + } + + protected override void ProcessInput() + { + throw new NotImplementedException(); + } + + } +} diff --git a/源代码/StgSharpDebug/Stg/TimeLine.cs b/源代码/StgSharpDebug/Stg/TimeLine.cs new file mode 100644 index 00000000..ed3ce54c --- /dev/null +++ b/源代码/StgSharpDebug/Stg/TimeLine.cs @@ -0,0 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Stg +{ + public class TimeLine + { + } +} diff --git a/源代码/StgSharpDebug/Stg/Touhou/TouhouBuilder.cs b/源代码/StgSharpDebug/Stg/Touhou/TouhouBuilder.cs new file mode 100644 index 00000000..7efd902b --- /dev/null +++ b/源代码/StgSharpDebug/Stg/Touhou/TouhouBuilder.cs @@ -0,0 +1,26 @@ +using StgSharp.Graphics; +using StgSharp.Touhou; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Stg.Touhou +{ + public static class TouhouBuilder + { + + + /* + public static View BuildTouhouWorld() + { + + TouhouForm form = new TouhouForm(); + + + return form; + } + /**/ + + } +} diff --git a/源代码/StgSharpDebug/Stg/Touhou/TouhouWindow.cs b/源代码/StgSharpDebug/Stg/Touhou/TouhouWindow.cs new file mode 100644 index 00000000..06b3cc6c --- /dev/null +++ b/源代码/StgSharpDebug/Stg/Touhou/TouhouWindow.cs @@ -0,0 +1,10 @@ +using StgSharp.Graphics; + +using System; +using System.Collections.Generic; +using System.Text; + +namespace StgSharp.Touhou +{ + +} diff --git a/源代码/StgSharpDebug/obj/project.nuget.cache b/源代码/StgSharpDebug/obj/project.nuget.cache index 44f99a3b..30c04eae 100644 --- a/源代码/StgSharpDebug/obj/project.nuget.cache +++ b/源代码/StgSharpDebug/obj/project.nuget.cache @@ -1,6 +1,6 @@ { "version": 2, - "dgSpecHash": "dsFK7NNBPCkRkP8zO/2zvEfmT3I9aKXPUHQK73Z9/feuEPXh3qEoKO6v5cSAIdbzPAfpvP8H9lkVx3M3ZJgESg==", + "dgSpecHash": "9FrwccujQMysIE1gNhytdC81aY+4t5P0bRlhT44Frq6mSp7hWqvElh1aPDvEG8vfHp6rpYnbuArWrHy1JPbb8g==", "success": true, "projectFilePath": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\源代码\\StgSharpDebug\\StgSharpDebug.csproj", "expectedPackageFiles": [ diff --git a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.AssemblyInfoInputs.cache b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.AssemblyInfoInputs.cache index 5f101138..2bf918df 100644 --- a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.AssemblyInfoInputs.cache +++ b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.AssemblyInfoInputs.cache @@ -1 +1 @@ -078ad1de8316ac39cc24c9015ddc6ea463215f431658ec068a6783dbac5eadd6 +f21c4c1ccfd63860c2c75134277b4faedc528ed01118d9d20ba5ed0a9701f7eb diff --git a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.csproj.CoreCompileInputs.cache b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.csproj.CoreCompileInputs.cache index 64dd8bd6..e09f32da 100644 --- a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.csproj.CoreCompileInputs.cache +++ b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -8a770e7e64a1828f478ce21dee393946f2ed012dee01f75199360879a335f8ce +b028bb001e6a3eaa550ee1bb9783af776f1bb601c648f8bbe4d5912177f7a58e diff --git a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.dll b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.dll index c8c14000..6ea9c0f6 100644 Binary files a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.dll and b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.dll differ diff --git a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.pdb b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.pdb index 31d4904a..59749b6c 100644 Binary files a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.pdb and b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.pdb differ diff --git a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.xml b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.xml index 6ea62cd1..1ca3ac39 100644 --- a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.xml +++ b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.xml @@ -4,7 +4,12 @@ StgSharpDebug - + + + + + + Get the status of a certain key on the keyboard. @@ -14,43 +19,132 @@ - Function handler to load an opengl function by serching its name. + Function handler to load an opengl function by searching its name. the name of the Opengl function An intptr value representing the pointer to the function - + + + Interface of all kinds OpenGL buffer objects + + + + + Get the only handle to one of the Object instance + + + + + + + Bind a buffer instance to OpenGL + + Index of handle of the object in this instance to be bind + + + + + + + A collection of handle to Element Buffer Object in OpenglFunc. + Each value indexed from instance of this class this + is the only handle to one Element Buffer Object. + + + + + Bind the frame buffer object with name frame buffer to the frame buffer target specified by target. + will be set as default target. + + Index of object to be binded in handle set + + + + Bind the frame buffer object with name frame buffer to the frame buffer target specified by target. + Target of this frame buffer should be set manually. + + The frame buffer target of the binding operation. + Index of object to be binded in handle set + + + + + + + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + Data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + Data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + A of data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + A of data to write in + How OpenGL use these data, defined by + + + + Set data to current vertex buffer object + + Type of bufferData + Index to find certain VBO in this instance + A array of data to write in + How OpenGL use these data, defined by + + - + - Height of this form, represent in + Load all supported OpenGL APIs and bind them to given context. + The used as current OpenGL context - + - Width of this form, represent in + Get the function pointer of given OpenGL api name + ContextName of the OpenGL api + The funtion pointer of the api in stream of - + - Width of this form, represent in + Bind a frame buffer to a frame buffer target + Same function as glBindFramebuffer. + The frame buffer target of the binding operation. + The handle of the frame buffer object to bind. - - - Necessary operation to init graphic elements this form. - - OpenGL library binded to current form. - - - - Behaviour of current form when in a frame cycle. - - - + 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. @@ -59,227 +153,93 @@ Something goes wrong and StgSharp fails in creating a new OpenGL context. - + - Set all necessary metadata to current form instance - - - - - Resize the current form - - - A (width,height) representing the new size of current form - - - - - Resize the current form - - New width of the window - New height of the window - - - - 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) - - - - - Set the size limit of current form - - Minimum width of current form - Minimum height of current form - Maximum width of current form - Maximum height of current form - - - - Init this form and render it on screen, and respond with operation - - - - - Create a set of . + Create a set of . Amount of EBO to be created. - + - Create a sets of + Create a sets of - Amount of textures to be crated. + Amount of textures to be created. - + - Create a set of . + Create a set of . - Amount of VAO to be crated. + Amount of VAO to be created. - + - Create aset of . + Create a set of . Amount of Object to be created. - + - Create an instance of program + Create an instance of program - New instance of instance. + New instance of instance. - + - Mark that a method in a - should be called when rendering. + Attach one shader code to a shader program. + + Shader program to attach + Index of shader code in current shader code set. + + + + Init a program with no shader attached. - + - Priority level of a render activity. + Get a uniform form current shader, + the value type of the uniform should be provided. - - - - One level higher than . - - - - - Two level higher than . - - - - - Three level higher than . - - - - - One level lower than . - - - - - Two level lower than . - - - - - Three level lower than . - - - - - Highest priority, in , it is . - - - - - Default priority, usually is in this priority. - - - - - Lowest priority, in , it is . - - - - - Interface of all kinds OpenGL buffer objects - - - - - Get the only handle to one of the Object instance - - + ContextName of the Uniform in shader code - + - Bind a buffer instance to OpenGL + Get a uniform form current shader, + the value type of the uniform should be provided. - Index of handle of the object in this instance to be bind + ContextName of the Uniform in shader code + - - - - + - A collection of handle to Element Buffer Object in OpenGL. - Each value indexed from instance of this class this - is the only handle to one Element Buffer Object. + Get a uniform form current shader, + the value type of the uniform should be provided. + + ContextName of the Uniform in shader code + + + + + Get a uniform form current shader, + the value type of the uniform should be provided. + + ContextName of the Uniform in shader code + + + + + Link the shader to current context. - + - Bind the frame buffer object with name frame buffer to the frame buffer target specified by target. - will be set as default target. + Let the current context use this shader. - Index of object to be binded in handle set - - - - Bind the frame buffer object with name frame buffer to the frame buffer target specified by target. - Target of this frame buffer should be set manually. - - The frame buffer target of the binding operation. - Index of object to be binded in handle set - - - - - - - - - - - Set data to current vertex buffer object - - Type of bufferData - Index to find certain VBO in this instance - Data to write in - How OpenGL use these data, defined by - - - - Set data to current vertex buffer object - - Type of bufferData - Index to find certain VBO in this instance - A array of data to write in - How OpenGL use these data, defined by - - - - - - - - - Load all aupportable OpenGL APIs and bind them to given context. - - The used as current OpenGL context - A delegate to get address of OprnGL api - - - - Get the function pointer of given OpenGL api name - - Name of the OpenGL api - The funtion pointer of the api in form of @@ -300,20 +260,12 @@ This will be not usable. - - - Bind a frame buffer to a frame buffer target - Same function as glBindFramebuffer. - - The frame buffer target of the binding operation. - The handle of the frame buffer object to bind. - - + @@ -329,79 +281,39 @@ - + - Attach one shader code to a shader program. + Set the size limit of current form - Shader program to attach - Index of shader code in current shader code set. + Minimum width of current form + Minimum height of current form + Maximum width of current form + Maximum height of current form - + - Init a program with no shader attached. + Get (T is ) uniform from a shader. + This uniform will be used as projection matrix of this camera. + Additionally, for multi-shader rendering, each shader requires a uniform, + so do not ignore return value of this method. + Shader using this camera + ContextName of projection camera named in shader + + (T is ) representing + projection matrix in shader program. + - + - Get a uniform form current shader, - the value type of the uniform should be provided. - - Name of the Uniform in shader code - - - - - Get a uniform form current shader, - the value type of the uniform should be provided. - - Name of the Uniform in shader code - - - - - Get a uniform form current shader, - the value type of the uniform should be provided. - - Name of the Uniform in shader code - - - - - Get a uniform form current shader, - the value type of the uniform should be provided. - - Name of the Uniform in shader code - - - - - Link the shader to current context. - - - - - Let the current context use this shader. - - - - - A sensor used for cheking out if a bullet hit a player or something else - - - - - A 2D vector presenting the position of an enemy entity, position can also be visited by X, Y - - - - - X position of an enenmy entity - - - - - Y position of an enemy entity + Get all uniform related to this . + Shader program requires this camera. + + ContextName of all related uniforms. + If you fallow form from + + @@ -418,7 +330,7 @@ - Write a log message to log file, and mark the level of this message. + 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. @@ -438,9 +350,17 @@ A two dimension vector defined by two elements. - Vec2Ds in StgSharp are defaultly usaed as colum vector. + Vec2Ds in StgSharp are default used as colum vector. + + + Orthogonalize two s, let their length be 1 + and perpendicular to each other. + + + + Reurns the value of ArcSin(x) @@ -479,7 +399,7 @@ - + @@ -491,14 +411,41 @@ - + - Part of a circle. All points on a arc has the same distance to their center. + A class contains a sets of methods to serialize several types - + - A collection of all point on the same plain and has the same distance to a point + An independent storage area, used as the only folder type in root folder. + Contains several files reference as virtual disc. + Data is actually stored in s in certain RAID mode. + + + + + A sensor used for checking out if a bullet hit a player or something else + + + + + A 2D vector presenting the position of an enemy entity, position can also be visited by X, Y + + + + + X position of an enenmy entity + + + + + Y position of an enemy entity + + + + + 当几何体调用了过多的CalcVec方法时,产生UnusedVertexException异常 @@ -518,86 +465,16 @@ Point to the top direction. - - - 当几何体调用了过多的CalcVec方法时,产生UnusedVertexException异常 - - - - - Caculate the movement of a point. - - The game tick represent time passed by - A 3d vector representing movement - - - - Move begin side of a line. - It is recommended to override this function rather than - loading an with same function. - - Time passed since current line was created. - - - - Move end side of a line. - It is recommended to override this function rather than - loading an with same function. - - Time passed since current line was created. - - - - - Move the third vertix. this is a useless method for Parallelograms. - - Current time tick - - Geometry overdefined - - - - Move the third vertix. This method is useless for Parallelograms. - - Current time tick - - Geometry overdefined - - 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。 + Plain geometry only contains straight sides. - - - Tick time this geometry eas crested - - - - - Get all sides of this . - - A array contains all straight s of current geometry item. - - - - Get a flat cincide with current geometry. - - - - - - Update the coordinate of the point. If this is a moving point, - (Points on sides or surface if other geometry items) - please do not define any motion here, codes will be ignored by program - - Time passes since the program begin, counted by frames - - 计算中心点相对于参考原点的位移 + Calculate movement to center - 当前游戏刻 + Current time tick @@ -605,80 +482,95 @@ A square
- + - A linear data structure with dynamic length. - It contains a of , - each is twice longer than the former one. + Run all nodes repeatedly until it is instructed to terminate. - + Instructor to terminate all tasks. Returns if tasks should terminate - + - Init a with a certain amount of elements prepared. + - Amount of elements to be prepared. + + Reset pipeline has risk, this operation is a direct operation to port + in current node, the port on the other node cannot get the change. + - + - Create a new instance of , - and fill the begining ones of elemtns as given instance. - - Amount of beginning elements to be filled - - - - - Length of this + Init this form and render it on screen, and respond with operation - + - A pair of value + Height of this form, represent in - + - The first value. + Width of this form, represent in - + - The second value. + Width of this form, represent in - + - A value. - The lower byte is , - and higher byte is . + Resize the current form + + A (width,height) representing the new size of current form + + + + + Set the size limit of current form + + + Minimum size of current form. In form of a of (width,height) + + + Maximum size of current form. In form of a of (width,height) + + + + + Set the size limit of current form + + Minimum width of current form + Minimum height of current form + Maximum width of current form + Maximum height of current form A microsecond-accuracy timer. It will refresh every a certain time span. - + Create a new and define the length of time span. Length of a single time span is defined in microseconds. - + - + Create a new and define the length of time span. Length of a single time span is defined in seconds. - + - + Create a new and define the length of time span. Length of a single time span is defined in microseconds. + @@ -691,17 +583,6 @@ The method this will call every time a new time span started. - - - Get all uniform related to this . - - Shader program requires this camera. - - Name of all related uniforms. - If you fallow form from - - - The COLORREF value is used to specify an RGB color. diff --git a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/apphost.exe b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/apphost.exe index ddc40aa9..ebad299e 100644 Binary files a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/apphost.exe and b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/apphost.exe differ diff --git a/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.AssemblyInfoInputs.cache b/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.AssemblyInfoInputs.cache index 4cfd50b9..793f78ca 100644 --- a/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.AssemblyInfoInputs.cache +++ b/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.AssemblyInfoInputs.cache @@ -1 +1 @@ -2f6a0800ff20fe2b264d1add4cff4743ee7d04c6f1fc2068d67a1a1e8933e7d5 +b372b53c8d2ed9b53466d99a78c92f27bde5e6dfd76c487cb45dff5fd6851063 diff --git a/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.csproj.AssemblyReference.cache b/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.csproj.AssemblyReference.cache index 049b47bd..eb994780 100644 Binary files a/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.csproj.AssemblyReference.cache and b/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.csproj.AssemblyReference.cache differ diff --git a/源代码/StgsharpEnvDebug/obj/project.nuget.cache b/源代码/StgsharpEnvDebug/obj/project.nuget.cache index ffa2b6ae..e5c586e6 100644 --- a/源代码/StgsharpEnvDebug/obj/project.nuget.cache +++ b/源代码/StgsharpEnvDebug/obj/project.nuget.cache @@ -1,6 +1,6 @@ { "version": 2, - "dgSpecHash": "zEYMUBJvCZswSqbLyDwuhiz9oqInSYJECQYmkaiSaxVvKwM56bsrbwY5P6cacyodmDi1Wl43S7M8zUxnirtMMA==", + "dgSpecHash": "w06sTHTi7vpH9QczpWZsp6zqu8RM3caQjBZNwmIWqsEwJi/vuYYJviXuJHwkUp+NAbMCNId4km0VBU+EIyQ+kw==", "success": true, "projectFilePath": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\源代码\\StgsharpEnvDebug\\StgsharpEnvDebug.csproj", "expectedPackageFiles": [