diff --git a/源代码/.cr/personal/Editor/IntelliRush.xml b/源代码/.cr/personal/Editor/IntelliRush.xml new file mode 100644 index 00000000..e241e096 --- /dev/null +++ b/源代码/.cr/personal/Editor/IntelliRush.xml @@ -0,0 +1,7 @@ + + + + True + + + \ No newline at end of file diff --git a/源代码/.cr/personal/Editor/Right Margin Line/Right Margin Line.xml b/源代码/.cr/personal/Editor/Right Margin Line/Right Margin Line.xml new file mode 100644 index 00000000..8432cfbd --- /dev/null +++ b/源代码/.cr/personal/Editor/Right Margin Line/Right Margin Line.xml @@ -0,0 +1,6 @@ + + + + True + + \ No newline at end of file diff --git a/源代码/.cr/personal/Editor/Spell checker.xml b/源代码/.cr/personal/Editor/Spell checker.xml new file mode 100644 index 00000000..b61e1ba3 --- /dev/null +++ b/源代码/.cr/personal/Editor/Spell checker.xml @@ -0,0 +1,6 @@ + + + + XmlComments|Comments|Strings|VerbatimStrings|PublicIdentifiers|InternalIdentifiers|ProtectedInternalIdentifiers|ProtectedIdentifiers + + \ No newline at end of file diff --git a/源代码/.cr/personal/FavoritesList/List.xml b/源代码/.cr/personal/FavoritesList/List.xml new file mode 100644 index 00000000..a60e5ed6 --- /dev/null +++ b/源代码/.cr/personal/FavoritesList/List.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/源代码/.cr/personal/IDE/BuildEngine.xml b/源代码/.cr/personal/IDE/BuildEngine.xml new file mode 100644 index 00000000..a1af350d --- /dev/null +++ b/源代码/.cr/personal/IDE/BuildEngine.xml @@ -0,0 +1,6 @@ + + + + True + + \ No newline at end of file diff --git a/源代码/.cr/personal/IDE/Shortcuts.xml b/源代码/.cr/personal/IDE/Shortcuts.xml new file mode 100644 index 00000000..5e9c7e1f --- /dev/null +++ b/源代码/.cr/personal/IDE/Shortcuts.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + False + + + + + False + + + + + + + + + + + + + + + + + + + + + + + + False + + + + + + + + + + + + + + \ No newline at end of file diff --git a/源代码/.editorconfig b/源代码/.editorconfig new file mode 100644 index 00000000..36d44d5b --- /dev/null +++ b/源代码/.editorconfig @@ -0,0 +1,4 @@ +[*.cs] + +# CS1591: 缺少对公共可见类型或成员的 XML 注释 +dotnet_diagnostic.CS1591.severity = suggestion diff --git a/源代码/.vs/ProjectEvaluation/stgsharpdevelop.metadata.v7.bin b/源代码/.vs/ProjectEvaluation/stgsharpdevelop.metadata.v7.bin index 7fb02967..88519cd8 100644 Binary files a/源代码/.vs/ProjectEvaluation/stgsharpdevelop.metadata.v7.bin and b/源代码/.vs/ProjectEvaluation/stgsharpdevelop.metadata.v7.bin differ diff --git a/源代码/.vs/ProjectEvaluation/stgsharpdevelop.projects.v7.bin b/源代码/.vs/ProjectEvaluation/stgsharpdevelop.projects.v7.bin index 06222dfd..b623158c 100644 Binary files a/源代码/.vs/ProjectEvaluation/stgsharpdevelop.projects.v7.bin and b/源代码/.vs/ProjectEvaluation/stgsharpdevelop.projects.v7.bin differ diff --git a/源代码/.vs/StgSharpDevelop/DesignTimeBuild/.dtbcache.v2 b/源代码/.vs/StgSharpDevelop/DesignTimeBuild/.dtbcache.v2 index 7b86134b..99982bfb 100644 Binary files a/源代码/.vs/StgSharpDevelop/DesignTimeBuild/.dtbcache.v2 and b/源代码/.vs/StgSharpDevelop/DesignTimeBuild/.dtbcache.v2 differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/09069d7f-7f16-452b-84e9-3a13cf970a8e.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/09069d7f-7f16-452b-84e9-3a13cf970a8e.vsidx deleted file mode 100644 index f6e97c8c..00000000 Binary files a/源代码/.vs/StgSharpDevelop/FileContentIndex/09069d7f-7f16-452b-84e9-3a13cf970a8e.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/0ab1c2df-05fd-47ab-b1e4-79628e887da7.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/0ab1c2df-05fd-47ab-b1e4-79628e887da7.vsidx new file mode 100644 index 00000000..5c6eca77 Binary files /dev/null and b/源代码/.vs/StgSharpDevelop/FileContentIndex/0ab1c2df-05fd-47ab-b1e4-79628e887da7.vsidx differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/6c45ea8e-a098-4cf8-8e75-bf0e74647276.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/6c45ea8e-a098-4cf8-8e75-bf0e74647276.vsidx deleted file mode 100644 index 0eb1c7af..00000000 Binary files a/源代码/.vs/StgSharpDevelop/FileContentIndex/6c45ea8e-a098-4cf8-8e75-bf0e74647276.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/83c2f949-8544-427e-ba5a-09ce40b09d56.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/83c2f949-8544-427e-ba5a-09ce40b09d56.vsidx new file mode 100644 index 00000000..ea8a07d0 Binary files /dev/null and b/源代码/.vs/StgSharpDevelop/FileContentIndex/83c2f949-8544-427e-ba5a-09ce40b09d56.vsidx differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/9cdd8f50-0d97-4030-95a6-e612c325b178.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/9cdd8f50-0d97-4030-95a6-e612c325b178.vsidx new file mode 100644 index 00000000..d7433c3b Binary files /dev/null and b/源代码/.vs/StgSharpDevelop/FileContentIndex/9cdd8f50-0d97-4030-95a6-e612c325b178.vsidx differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/a49eb6fd-d54c-4b17-b102-b8607989b4d0.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/a49eb6fd-d54c-4b17-b102-b8607989b4d0.vsidx new file mode 100644 index 00000000..bf26d37e Binary files /dev/null and b/源代码/.vs/StgSharpDevelop/FileContentIndex/a49eb6fd-d54c-4b17-b102-b8607989b4d0.vsidx differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/bf0b30db-7608-4cee-8f55-056fc3588a2c.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/bf0b30db-7608-4cee-8f55-056fc3588a2c.vsidx deleted file mode 100644 index 94d7308d..00000000 Binary files a/源代码/.vs/StgSharpDevelop/FileContentIndex/bf0b30db-7608-4cee-8f55-056fc3588a2c.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/51d7446f-8848-4ad2-bed3-000e8dab3b06.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/e726aba4-d707-436c-8fb2-d0b058b97219.vsidx similarity index 95% rename from 源代码/.vs/StgSharpDevelop/FileContentIndex/51d7446f-8848-4ad2-bed3-000e8dab3b06.vsidx rename to 源代码/.vs/StgSharpDevelop/FileContentIndex/e726aba4-d707-436c-8fb2-d0b058b97219.vsidx index 26f7cc4d..fa2ba37d 100644 Binary files a/源代码/.vs/StgSharpDevelop/FileContentIndex/51d7446f-8848-4ad2-bed3-000e8dab3b06.vsidx and b/源代码/.vs/StgSharpDevelop/FileContentIndex/e726aba4-d707-436c-8fb2-d0b058b97219.vsidx differ diff --git a/源代码/.vs/StgSharpDevelop/FileContentIndex/fd125b75-6cd5-487b-9cf7-7a4781a5f170.vsidx b/源代码/.vs/StgSharpDevelop/FileContentIndex/fd125b75-6cd5-487b-9cf7-7a4781a5f170.vsidx deleted file mode 100644 index 91023679..00000000 Binary files a/源代码/.vs/StgSharpDevelop/FileContentIndex/fd125b75-6cd5-487b-9cf7-7a4781a5f170.vsidx and /dev/null differ diff --git a/源代码/.vs/StgSharpDevelop/v17/.futdcache.v2 b/源代码/.vs/StgSharpDevelop/v17/.futdcache.v2 index fa232058..03a8baf6 100644 Binary files a/源代码/.vs/StgSharpDevelop/v17/.futdcache.v2 and b/源代码/.vs/StgSharpDevelop/v17/.futdcache.v2 differ diff --git a/源代码/.vs/StgSharpDevelop/v17/.suo b/源代码/.vs/StgSharpDevelop/v17/.suo index c802910b..427cf245 100644 Binary files a/源代码/.vs/StgSharpDevelop/v17/.suo and b/源代码/.vs/StgSharpDevelop/v17/.suo differ diff --git a/源代码/.vs/StgSharpDevelop/v17/Browse.VC.db b/源代码/.vs/StgSharpDevelop/v17/Browse.VC.db index 2aeee63f..ecc6e7fe 100644 Binary files a/源代码/.vs/StgSharpDevelop/v17/Browse.VC.db and b/源代码/.vs/StgSharpDevelop/v17/Browse.VC.db differ diff --git a/源代码/.vs/StgSharpDevelop/v17/DocumentLayout.json b/源代码/.vs/StgSharpDevelop/v17/DocumentLayout.json index 83756917..479fa289 100644 --- a/源代码/.vs/StgSharpDevelop/v17/DocumentLayout.json +++ b/源代码/.vs/StgSharpDevelop/v17/DocumentLayout.json @@ -3,13 +3,105 @@ "WorkspaceRootPath": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\", "Documents": [ { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\environment\\timeprovaider.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\environment\\timeprovaider.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\form.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\form.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\frameasynctask.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\frameasynctask.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}|StgSharp\\StgSharp.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharp\\graphics\\gl\\shaderedit\\uniform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}|StgSharp\\StgSharp.csproj|solutionrelative:stgsharp\\graphics\\gl\\shaderedit\\uniform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}|StgSharp\\StgSharp.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharp\\graphics\\gl\\glonrender.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}|StgSharp\\StgSharp.csproj|solutionrelative:stgsharp\\graphics\\gl\\glonrender.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}|StgSharp\\StgSharp.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharp\\logic\\timesourceprovider.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}|StgSharp\\StgSharp.csproj|solutionrelative:stgsharp\\logic\\timesourceprovider.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}|StgSharp\\StgSharp.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharp\\environment\\timeprovider.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}|StgSharp\\StgSharp.csproj|solutionrelative:stgsharp\\environment\\timeprovider.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}|StgSharp\\StgSharp.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharp\\graphics\\frameasynctask.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}|StgSharp\\StgSharp.csproj|solutionrelative:stgsharp\\graphics\\frameasynctask.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\environment\\timeprovider.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\environment\\timeprovider.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\logic\\timesourceprovider.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\logic\\timesourceprovider.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\gl\\glonupdateinternal.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\gl\\glonupdateinternal.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\geometries\\plaingeometry\\plaingeometry.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\geometries\\plaingeometry\\plaingeometry.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\logic\\timespanprovider.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\logic\\timespanprovider.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, { "AbsoluteMoniker": "D:0:0:{20CBFF26-6746-402E-992C-7B643E9423EB}|StgSharpC\\StgSharpC.vcxproj|D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpC\\StgSharpC.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{20CBFF26-6746-402E-992C-7B643E9423EB}|StgSharpC\\StgSharpC.vcxproj|solutionrelative:StgSharpC\\StgSharpC.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\shader\\fragment.frag||{8B382828-6202-11D1-8870-0000F87579D2}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\shader\\fragment.frag||{8B382828-6202-11D1-8870-0000F87579D2}" + }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\shader\\vertex.vert||{8B382828-6202-11D1-8870-0000F87579D2}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\shader\\vertex.vert||{8B382828-6202-11D1-8870-0000F87579D2}" + }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\define\\structdefine.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\define\\structdefine.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}|StgSharp\\StgSharp.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharp\\graphics\\define\\structdefine.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}|StgSharp\\StgSharp.csproj|solutionrelative:stgsharp\\graphics\\define\\structdefine.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}|StgSharp\\StgSharp.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharp\\graphics\\form.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{3EAF2EE6-FA9E-4F57-951F-7E6F8125DFBF}|StgSharp\\StgSharp.csproj|solutionrelative:stgsharp\\graphics\\form.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\environment\\globalsetting.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\environment\\globalsetting.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\gl\\glonupdate.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\gl\\glonupdate.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\gl\\glonrender.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\gl\\glonrender.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\control\\get.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\control\\get.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\iglfunc.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\iglfunc.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\gl\\framework.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\gl\\framework.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, { "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\logic\\counter.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\logic\\counter.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -18,30 +110,10 @@ "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\environment\\platform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\environment\\platform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\environment\\globalsetting.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\environment\\globalsetting.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\form.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\form.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\gl\\glresourcegenrator.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\gl\\glresourcegenrator.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\iglfunc.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\iglfunc.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\framethread.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\framethread.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\gl\\glapimanagerconst.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\gl\\glapimanagerconst.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -50,26 +122,10 @@ "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\gl\\glapimanager.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\gl\\glapimanager.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\geometries\\plaingeometry\\plaingeometry.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\geometries\\plaingeometry\\plaingeometry.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\geometries\\plaingeometry\\polygon6.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\geometries\\plaingeometry\\polygon6.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\logic\\exception.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\logic\\exception.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\gl\\glonrender.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\gl\\glonrender.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\gl\\glonupdate.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\gl\\glonupdate.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\gl\\shaderedit\\uniform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\gl\\shaderedit\\uniform.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -94,14 +150,6 @@ "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\control\\timeline.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\control\\timeline.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\gl\\glonupdateinternal.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\gl\\glonupdateinternal.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\define\\structdefine.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\define\\structdefine.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\logic\\glparamqueue.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\logic\\glparamqueue.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -118,10 +166,6 @@ "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\logic\\logicvalue.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\logic\\logicvalue.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\gl\\framework.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\gl\\framework.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\gl\\buffer\\vbo.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\gl\\buffer\\vbo.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -150,10 +194,6 @@ "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\math\\linear\\mat2.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\math\\linear\\mat2.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\shader\\fragment.frag||{8B382828-6202-11D1-8870-0000F87579D2}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\shader\\fragment.frag||{8B382828-6202-11D1-8870-0000F87579D2}" - }, { "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\define\\gltype.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\define\\gltype.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -198,10 +238,6 @@ "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\graphics\\gl\\buffer\\bufferobjectbase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\graphics\\gl\\buffer\\bufferobjectbase.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\shader\\vertex.vert||{8B382828-6202-11D1-8870-0000F87579D2}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\shader\\vertex.vert||{8B382828-6202-11D1-8870-0000F87579D2}" - }, { "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\MSBuild\\Microsoft\\VC\\v170\\Microsoft.CppCommon.targets||{FA3CD31E-987B-443A-9B81-186104E8DAC1}|" }, @@ -217,10 +253,6 @@ "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\math\\linear\\vec3d.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\math\\linear\\vec3d.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpdebug\\control\\get.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{610B992B-BB34-49C3-9993-676C595FC12E}|StgSharpDebug\\StgSharpDebug.csproj|solutionrelative:stgsharpdebug\\control\\get.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{000EFD45-7F4D-47DB-8F3C-CD26612F0EAB}|StgsharpEnvDebug\\StgsharpEnvDebug.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u6E90\u4EE3\u7801\\stgsharpenvdebug\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{000EFD45-7F4D-47DB-8F3C-CD26612F0EAB}|StgsharpEnvDebug\\StgsharpEnvDebug.csproj|solutionrelative:stgsharpenvdebug\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -244,11 +276,128 @@ "DocumentGroups": [ { "DockedWidth": 197, - "SelectedChildIndex": 4, + "SelectedChildIndex": 25, "Children": [ { "$type": "Document", - "DocumentIndex": 1, + "DocumentIndex": 3, + "Title": "GLonRender.cs", + "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharp\\Graphics\\GL\\GLonRender.cs", + "RelativeDocumentMoniker": "StgSharp\\Graphics\\GL\\GLonRender.cs", + "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharp\\Graphics\\GL\\GLonRender.cs", + "RelativeToolTip": "StgSharp\\Graphics\\GL\\GLonRender.cs", + "ViewState": "AQIAACIBAAAAAAAAAAASwDEBAAAlAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-03-18T18:26:12.379Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 2, + "Title": "Uniform.cs", + "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharp\\Graphics\\GL\\ShaderEdit\\Uniform.cs", + "RelativeDocumentMoniker": "StgSharp\\Graphics\\GL\\ShaderEdit\\Uniform.cs", + "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharp\\Graphics\\GL\\ShaderEdit\\Uniform.cs", + "RelativeToolTip": "StgSharp\\Graphics\\GL\\ShaderEdit\\Uniform.cs", + "ViewState": "AQIAAAoBAAAAAAAAAAASwB0BAAA6AAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-03-18T18:25:24.623Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 5, + "Title": "TimeProvider.cs", + "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharp\\Environment\\TimeProvider.cs", + "RelativeDocumentMoniker": "StgSharp\\Environment\\TimeProvider.cs", + "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharp\\Environment\\TimeProvider.cs", + "RelativeToolTip": "StgSharp\\Environment\\TimeProvider.cs", + "ViewState": "AQIAACAAAAAAAAAAAAASwDYAAAAZAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-03-18T18:15:54.111Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 4, + "Title": "TimeSourceProvider.cs", + "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharp\\Logic\\TimeSourceProvider.cs", + "RelativeDocumentMoniker": "StgSharp\\Logic\\TimeSourceProvider.cs", + "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharp\\Logic\\TimeSourceProvider.cs", + "RelativeToolTip": "StgSharp\\Logic\\TimeSourceProvider.cs", + "ViewState": "AQIAAAAAAAAAAAAAAAAAACEAAAAAAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-03-18T18:15:53.091Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 6, + "Title": "FrameAsyncTask.cs", + "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharp\\Graphics\\FrameAsyncTask.cs", + "RelativeDocumentMoniker": "StgSharp\\Graphics\\FrameAsyncTask.cs", + "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharp\\Graphics\\FrameAsyncTask.cs", + "RelativeToolTip": "StgSharp\\Graphics\\FrameAsyncTask.cs", + "ViewState": "AQIAADUAAAAAAAAAAAASwOoBAAASAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-03-18T18:15:24.736Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 9, + "Title": "TimeSourceProvider.cs", + "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Logic\\TimeSourceProvider.cs", + "RelativeDocumentMoniker": "StgSharpDebug\\Logic\\TimeSourceProvider.cs", + "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Logic\\TimeSourceProvider.cs", + "RelativeToolTip": "StgSharpDebug\\Logic\\TimeSourceProvider.cs", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAB4AAAABAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-03-18T16:55:59.265Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 17, + "Title": "StructDefine.cs", + "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharp\\Graphics\\Define\\StructDefine.cs", + "RelativeDocumentMoniker": "StgSharp\\Graphics\\Define\\StructDefine.cs", + "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharp\\Graphics\\Define\\StructDefine.cs", + "RelativeToolTip": "StgSharp\\Graphics\\Define\\StructDefine.cs", + "ViewState": "AQIAADQBAAAAAAAAAAA1wFEBAAAAAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-03-17T18:51:58.985Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 18, + "Title": "Form.cs", + "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharp\\Graphics\\Form.cs", + "RelativeDocumentMoniker": "StgSharp\\Graphics\\Form.cs", + "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharp\\Graphics\\Form.cs", + "RelativeToolTip": "StgSharp\\Graphics\\Form.cs", + "ViewState": "AQIAAGIAAAAAAAAAAAAswHcAAABGAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-03-16T20:44:42.395Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 12, + "Title": "TimeSpanProvider.cs", + "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Logic\\TimeSpanProvider.cs", + "RelativeDocumentMoniker": "StgSharpDebug\\Logic\\TimeSpanProvider.cs", + "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Logic\\TimeSpanProvider.cs", + "RelativeToolTip": "StgSharpDebug\\Logic\\TimeSpanProvider.cs", + "ViewState": "AQIAAE8AAAAAAAAAAAAWwFkAAAAAAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-03-16T08:04:49.945Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 13, "Title": "StgSharpC.c", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpC\\StgSharpC.c", "RelativeDocumentMoniker": "StgSharpC\\StgSharpC.c", @@ -261,98 +410,83 @@ }, { "$type": "Document", - "DocumentIndex": 5, + "DocumentIndex": 19, "Title": "GlobalSetting.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Environment\\GlobalSetting.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Environment\\GlobalSetting.cs", "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Environment\\GlobalSetting.cs", "RelativeToolTip": "StgSharpDebug\\Environment\\GlobalSetting.cs", - "ViewState": "AQIAABMAAAAAAAAAAAAYwCUAAAA/AAAA", + "ViewState": "AQIAABcAAAAAAAAAAAAEwCYAAAArAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-03-15T17:27:18.553Z", - "EditorCaption": "" + "WhenOpened": "2024-03-15T17:27:18.553Z" }, { "$type": "Document", - "DocumentIndex": 13, - "Title": "Polygon6.cs", - "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Geometries\\PlainGeometry\\Polygon6.cs", - "RelativeDocumentMoniker": "StgSharpDebug\\Geometries\\PlainGeometry\\Polygon6.cs", - "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Geometries\\PlainGeometry\\Polygon6.cs", - "RelativeToolTip": "StgSharpDebug\\Geometries\\PlainGeometry\\Polygon6.cs", - "ViewState": "AQIAAF8AAAAAAAAAAAAAAGMAAAAwAAAA", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-03-15T08:37:38.479Z", - "EditorCaption": "" - }, - { - "$type": "Document", - "DocumentIndex": 12, + "DocumentIndex": 11, "Title": "PlainGeometry.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Geometries\\PlainGeometry\\PlainGeometry.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Geometries\\PlainGeometry\\PlainGeometry.cs", "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Geometries\\PlainGeometry\\PlainGeometry.cs", "RelativeToolTip": "StgSharpDebug\\Geometries\\PlainGeometry\\PlainGeometry.cs", - "ViewState": "AQIAABEAAAAAAAAAAAAIwBwAAAAfAAAA", + "ViewState": "AQIAACIAAAAAAAAAAAASwDEAAAAAAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-03-15T08:36:45.931Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 0, - "Title": "TimeProvaider.cs", - "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Environment\\TimeProvaider.cs", - "RelativeDocumentMoniker": "StgSharpDebug\\Environment\\TimeProvaider.cs", - "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Environment\\TimeProvaider.cs", - "RelativeToolTip": "StgSharpDebug\\Environment\\TimeProvaider.cs", - "ViewState": "AQIAAAkAAAAAAAAAAAAIwCAAAAARAAAA", + "DocumentIndex": 8, + "Title": "TimeProvider.cs", + "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Environment\\TimeProvider.cs", + "RelativeDocumentMoniker": "StgSharpDebug\\Environment\\TimeProvider.cs", + "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Environment\\TimeProvider.cs", + "RelativeToolTip": "StgSharpDebug\\Environment\\TimeProvider.cs", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAB4AAAABAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-03-14T14:42:25.658Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 2, + "DocumentIndex": 25, "Title": "Counter.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Logic\\Counter.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Logic\\Counter.cs", "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Logic\\Counter.cs", "RelativeToolTip": "StgSharpDebug\\Logic\\Counter.cs", - "ViewState": "AQIAABUAAAAAAAAAAAAywBcAAAANAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAAQAAAABAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-03-13T11:44:45.872Z", - "EditorCaption": "" + "WhenOpened": "2024-03-13T11:44:45.872Z" }, { "$type": "Document", - "DocumentIndex": 9, - "Title": "FrameThread.cs", - "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\FrameThread.cs", - "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\FrameThread.cs", - "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\FrameThread.cs", - "RelativeToolTip": "StgSharpDebug\\Graphics\\FrameThread.cs", - "ViewState": "AQIAAAAAAAAAAAAAAAAAABgAAABRAAAA", + "DocumentIndex": 1, + "Title": "FrameAsyncTask.cs", + "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\FrameAsyncTask.cs", + "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\FrameAsyncTask.cs", + "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\FrameAsyncTask.cs", + "RelativeToolTip": "StgSharpDebug\\Graphics\\FrameAsyncTask.cs", + "ViewState": "AQIAADMAAAAAAAAAAAAAAOcBAAAWAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-03-12T03:06:36.197Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 4, + "DocumentIndex": 7, "Title": "Program.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Program.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Program.cs", "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Program.cs", "RelativeToolTip": "StgSharpDebug\\Program.cs", - "ViewState": "AQIAALAAAAAAAAAAAAAIwMIAAAAgAAAA", + "ViewState": "AQIAAKwAAAAAAAAAAAAUwLkAAAAgAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-03-05T18:42:51.911Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 18, + "DocumentIndex": 32, "Title": "ShaderGenerator.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\ShaderEdit\\ShaderGenerator.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\ShaderEdit\\ShaderGenerator.cs", @@ -360,25 +494,23 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\ShaderEdit\\ShaderGenerator.cs", "ViewState": "AQIAABYAAAAAAAAAAAA1wEEAAAAjAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-03-01T06:34:11.258Z", - "EditorCaption": "" + "WhenOpened": "2024-03-01T06:34:11.258Z" }, { "$type": "Document", - "DocumentIndex": 24, + "DocumentIndex": 16, "Title": "StructDefine.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\Define\\StructDefine.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\Define\\StructDefine.cs", "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\Define\\StructDefine.cs", "RelativeToolTip": "StgSharpDebug\\Graphics\\Define\\StructDefine.cs", - "ViewState": "AQIAAMMAAAAAAAAAAAAkwNwAAAArAAAA", + "ViewState": "AQIAAO0AAAAAAAAAAAA+wPkAAAAIAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-28T03:02:42.079Z", - "EditorCaption": "" + "WhenOpened": "2024-02-28T03:02:42.079Z" }, { "$type": "Document", - "DocumentIndex": 26, + "DocumentIndex": 38, "Title": "M128.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Math\\Linear\\M128.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Math\\Linear\\M128.cs", @@ -386,12 +518,11 @@ "RelativeToolTip": "StgSharpDebug\\Math\\Linear\\M128.cs", "ViewState": "AQIAABAAAAAAAAAAAAAIwBwAAAAIAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-27T01:42:02.193Z", - "EditorCaption": "" + "WhenOpened": "2024-02-27T01:42:02.193Z" }, { "$type": "Document", - "DocumentIndex": 43, + "DocumentIndex": 53, "Title": "StgSharpDebug.csproj", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\StgSharpDebug.csproj", "RelativeDocumentMoniker": "StgSharpDebug\\StgSharpDebug.csproj", @@ -399,12 +530,11 @@ "RelativeToolTip": "StgSharpDebug\\StgSharpDebug.csproj", "ViewState": "AQIAADcAAAAAAAAAAADwv04AAAAUAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000758|", - "WhenOpened": "2024-02-12T14:04:12.273Z", - "EditorCaption": "" + "WhenOpened": "2024-02-12T14:04:12.273Z" }, { "$type": "Document", - "DocumentIndex": 46, + "DocumentIndex": 56, "Title": "Random.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Math\\Scalar\\Random.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Math\\Scalar\\Random.cs", @@ -412,12 +542,11 @@ "RelativeToolTip": "StgSharpDebug\\Math\\Scalar\\Random.cs", "ViewState": "AQIAAAMAAAAAAAAAAAAawA0AAAATAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-12T14:03:56.158Z", - "EditorCaption": "" + "WhenOpened": "2024-02-12T14:03:56.158Z" }, { "$type": "Document", - "DocumentIndex": 19, + "DocumentIndex": 33, "Title": "InternalIO.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Control\\IO\\InternalIO.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Control\\IO\\InternalIO.cs", @@ -425,12 +554,11 @@ "RelativeToolTip": "StgSharpDebug\\Control\\IO\\InternalIO.cs", "ViewState": "AQIAAAAAAAAAAAAAAAAAAHcAAAAJAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-08T04:11:57.61Z", - "EditorCaption": "" + "WhenOpened": "2024-02-08T04:11:57.61Z" }, { "$type": "Document", - "DocumentIndex": 20, + "DocumentIndex": 34, "Title": "GLIO.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Control\\IO\\GLIO.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Control\\IO\\GLIO.cs", @@ -438,12 +566,11 @@ "RelativeToolTip": "StgSharpDebug\\Control\\IO\\GLIO.cs", "ViewState": "AQIAAA4AAAAAAAAAAIAwwBoAAAAAAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-05T06:25:54.982Z", - "EditorCaption": "" + "WhenOpened": "2024-02-05T06:25:54.982Z" }, { "$type": "Document", - "DocumentIndex": 11, + "DocumentIndex": 29, "Title": "glApiManager.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\glApiManager.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\glApiManager.cs", @@ -451,12 +578,11 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\glApiManager.cs", "ViewState": "AQIAACgAAAAAAAAAAAAowCkAAAANAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-04T13:45:43.229Z", - "EditorCaption": "" + "WhenOpened": "2024-02-04T13:45:43.229Z" }, { "$type": "Document", - "DocumentIndex": 21, + "DocumentIndex": 35, "Title": "NativeMethods.txt", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\NativeMethods.txt", "RelativeDocumentMoniker": "StgSharpDebug\\NativeMethods.txt", @@ -464,38 +590,36 @@ "RelativeToolTip": "StgSharpDebug\\NativeMethods.txt", "ViewState": "AQIAAAAAAAAAAAAAAAAAABcAAAALAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003109|", - "WhenOpened": "2024-02-13T03:37:35.339Z", - "EditorCaption": "" + "WhenOpened": "2024-02-13T03:37:35.339Z" }, { "$type": "Document", - "DocumentIndex": 6, + "DocumentIndex": 0, "Title": "Form.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\Form.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\Form.cs", "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\Form.cs", "RelativeToolTip": "StgSharpDebug\\Graphics\\Form.cs", - "ViewState": "AQIAAF8AAAAAAAAAAAAAACsBAAAjAAAA", + "ViewState": "AQIAACIBAAAAAAAAAAASwDEBAABMAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2023-12-04T10:47:53.872Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 15, + "DocumentIndex": 21, "Title": "GLonRender.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\GLonRender.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\GLonRender.cs", "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\GLonRender.cs", "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\GLonRender.cs", - "ViewState": "AQIAAB8AAAAAAAAAAAAIwCwAAAAwAAAA", + "ViewState": "AQIAAPMAAAAAAAAAAAAlwAIBAAA7AAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2023-12-07T17:34:38.441Z", - "EditorCaption": "" + "WhenOpened": "2023-12-07T17:34:38.441Z" }, { "$type": "Document", - "DocumentIndex": 3, + "DocumentIndex": 26, "Title": "Platform.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Environment\\Platform.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Environment\\Platform.cs", @@ -503,25 +627,23 @@ "RelativeToolTip": "StgSharpDebug\\Environment\\Platform.cs", "ViewState": "AQIAADIAAAAAAAAAAAAuwEQAAAAAAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-11T11:50:29.668Z", - "EditorCaption": "" + "WhenOpened": "2024-02-11T11:50:29.668Z" }, { "$type": "Document", - "DocumentIndex": 29, + "DocumentIndex": 24, "Title": "framework.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\framework.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\framework.cs", "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\framework.cs", "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\framework.cs", - "ViewState": "AQIAAPoAAAAAAAAAAAAqwP8AAAAbAAAA", + "ViewState": "AQIAADsAAAAAAAAAAAAvwEcAAACMAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-08T00:19:37.453Z", - "EditorCaption": "" + "WhenOpened": "2024-02-08T00:19:37.453Z" }, { "$type": "Document", - "DocumentIndex": 10, + "DocumentIndex": 28, "Title": "glApiManagerConst.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\glApiManagerConst.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\glApiManagerConst.cs", @@ -529,24 +651,22 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\glApiManagerConst.cs", "ViewState": "AQIAAAAAAAAAAAAAAAAAAB8AAAAAAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-10T15:30:36.701Z", - "EditorCaption": "" + "WhenOpened": "2024-02-10T15:30:36.701Z" }, { "$type": "Document", - "DocumentIndex": 42, + "DocumentIndex": 52, "Title": "StgSharpDebug", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\StgSharpDebug.csproj", "RelativeDocumentMoniker": "StgSharpDebug\\StgSharpDebug.csproj", "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\StgSharpDebug.csproj", "RelativeToolTip": "StgSharpDebug\\StgSharpDebug.csproj", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000758|", - "WhenOpened": "2024-02-10T05:25:02.324Z", - "EditorCaption": "" + "WhenOpened": "2024-02-10T05:25:02.324Z" }, { "$type": "Document", - "DocumentIndex": 44, + "DocumentIndex": 54, "Title": "Windows.Win32.PInvoke.USER32.dll.g.cs", "DocumentMoniker": "C:\\Users\\Nitlo\\AppData\\Local\\Temp\\VSGeneratedDocuments\\2c3332ae-ceb8-c175-356d-4c8856697af4\\Windows.Win32.PInvoke.USER32.dll.g.cs", "ToolTip": "Windows.Win32.PInvoke.USER32.dll.g.cs [\u7531 Microsoft.Windows.CsWin32.SourceGenerator \u751F\u6210]", @@ -556,7 +676,7 @@ }, { "$type": "Document", - "DocumentIndex": 48, + "DocumentIndex": 58, "Title": "Windows.Win32.PInvoke.Gdi32.g.cs", "DocumentMoniker": "C:\\Users\\Nitlo\\AppData\\Local\\Temp\\VSGeneratedDocuments\\79ac1c40-7151-2ce1-597a-25095d944cf9\\Windows.Win32.PInvoke.Gdi32.g.cs", "ToolTip": "Windows.Win32.PInvoke.Gdi32.g.cs [\u7531 Microsoft.Windows.CsWin32.SourceGenerator \u751F\u6210]", @@ -566,7 +686,7 @@ }, { "$type": "Document", - "DocumentIndex": 47, + "DocumentIndex": 57, "Title": "Windows.Win32.PInvoke.OPENGL32.g.cs", "DocumentMoniker": "C:\\Users\\Nitlo\\AppData\\Local\\Temp\\VSGeneratedDocuments\\0c87b10d-89a1-0d65-5307-332433f23145\\Windows.Win32.PInvoke.OPENGL32.g.cs", "ToolTip": "Windows.Win32.PInvoke.OPENGL32.g.cs [\u7531 Microsoft.Windows.CsWin32.SourceGenerator \u751F\u6210]", @@ -576,31 +696,30 @@ }, { "$type": "Document", - "DocumentIndex": 45, + "DocumentIndex": 55, "Title": "readme.txt", "DocumentMoniker": "C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.windows.cswin32\\0.3.49-beta\\readme.txt", "ToolTip": "C:\\Users\\Nitlo\\.nuget\\packages\\microsoft.windows.cswin32\\0.3.49-beta\\readme.txt", "ViewState": "AQIAAAAAAAAAAAAAAABLwBMAAAAUAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003109|", - "WhenOpened": "2024-02-12T12:22:30.658Z", - "EditorCaption": "" + "WhenOpened": "2024-02-12T12:22:30.658Z" }, { "$type": "Document", - "DocumentIndex": 23, + "DocumentIndex": 10, "Title": "GLonUpdateInternal.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\GLonUpdateInternal.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\GLonUpdateInternal.cs", "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\GLonUpdateInternal.cs", "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\GLonUpdateInternal.cs", - "ViewState": "AQIAACYAAAAAAAAAAAAIwC4AAABvAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAB4AAAAAAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2024-02-11T02:33:08.008Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 28, + "DocumentIndex": 40, "Title": "LogicValue.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Logic\\LogicValue.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Logic\\LogicValue.cs", @@ -608,23 +727,21 @@ "RelativeToolTip": "StgSharpDebug\\Logic\\LogicValue.cs", "ViewState": "AQIAAAkAAAAAAAAAAAAuwCIAAAAqAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2023-12-13T16:57:53.49Z", - "EditorCaption": "" + "WhenOpened": "2023-12-13T16:57:53.49Z" }, { "$type": "Document", - "DocumentIndex": 51, + "DocumentIndex": 60, "Title": "Microsoft.CppCommon.targets", "DocumentMoniker": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\MSBuild\\Microsoft\\VC\\v170\\Microsoft.CppCommon.targets", "ToolTip": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\MSBuild\\Microsoft\\VC\\v170\\Microsoft.CppCommon.targets", "ViewState": "AQIAAOUCAAAAAAAAAAAkwPICAAAEAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003801|", - "WhenOpened": "2024-02-10T06:07:55.215Z", - "EditorCaption": "" + "WhenOpened": "2024-02-10T06:07:55.215Z" }, { "$type": "Document", - "DocumentIndex": 52, + "DocumentIndex": 61, "Title": "Rectangle.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Geometries\\PlainGeometry\\Rectangle.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Geometries\\PlainGeometry\\Rectangle.cs", @@ -632,25 +749,23 @@ "RelativeToolTip": "StgSharpDebug\\Geometries\\PlainGeometry\\Rectangle.cs", "ViewState": "AQIAAAAAAAAAAAAAAAAAAAYAAAAFAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-10T05:15:53.266Z", - "EditorCaption": "" + "WhenOpened": "2024-02-10T05:15:53.266Z" }, { "$type": "Document", - "DocumentIndex": 55, + "DocumentIndex": 22, "Title": "Get.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Control\\Get.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Control\\Get.cs", "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Control\\Get.cs", "RelativeToolTip": "StgSharpDebug\\Control\\Get.cs", - "ViewState": "AQIAAAAAAAAAAAAAAAAAAAgAAAAFAAAA", + "ViewState": "AQIAAAQAAAAAAAAAAAAlwBEAAAAwAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-08T14:36:53.196Z", - "EditorCaption": "" + "WhenOpened": "2024-02-08T14:36:53.196Z" }, { "$type": "Document", - "DocumentIndex": 17, + "DocumentIndex": 31, "Title": "Uniform.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\ShaderEdit\\Uniform.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\ShaderEdit\\Uniform.cs", @@ -658,12 +773,11 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\ShaderEdit\\Uniform.cs", "ViewState": "AQIAAE4AAAAAAAAAAAA+wKoAAABEAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-08T08:59:32.195Z", - "EditorCaption": "" + "WhenOpened": "2024-02-08T08:59:32.195Z" }, { "$type": "Document", - "DocumentIndex": 36, + "DocumentIndex": 47, "Title": "mat2.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Math\\Linear\\mat2.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Math\\Linear\\mat2.cs", @@ -671,12 +785,11 @@ "RelativeToolTip": "StgSharpDebug\\Math\\Linear\\mat2.cs", "ViewState": "AQIAAAAAAAAAAAAAAAAAAAgAAAApAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-08T04:13:54.587Z", - "EditorCaption": "" + "WhenOpened": "2024-02-08T04:13:54.587Z" }, { "$type": "Document", - "DocumentIndex": 38, + "DocumentIndex": 48, "Title": "glType.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\Define\\glType.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\Define\\glType.cs", @@ -684,12 +797,11 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\Define\\glType.cs", "ViewState": "AQIAAAMAAAAAAAAAAABbwAYAAAAAAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-08T04:13:40.54Z", - "EditorCaption": "" + "WhenOpened": "2024-02-08T04:13:40.54Z" }, { "$type": "Document", - "DocumentIndex": 39, + "DocumentIndex": 49, "Title": "glEnum.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\Define\\glEnum.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\Define\\glEnum.cs", @@ -697,12 +809,11 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\Define\\glEnum.cs", "ViewState": "AQIAAAAAAAAAAAAAAAAAAC8AAAAeAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-07T10:37:25.565Z", - "EditorCaption": "" + "WhenOpened": "2024-02-07T10:37:25.565Z" }, { "$type": "Document", - "DocumentIndex": 27, + "DocumentIndex": 39, "Title": "GLhandle.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\GLhandle.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\GLhandle.cs", @@ -710,12 +821,11 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\GLhandle.cs", "ViewState": "AQIAAH8AAAAAAAAAAAAQwIwAAAASAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-05T06:13:02.944Z", - "EditorCaption": "" + "WhenOpened": "2024-02-05T06:13:02.944Z" }, { "$type": "Document", - "DocumentIndex": 25, + "DocumentIndex": 37, "Title": "glParamQueue.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Logic\\glParamQueue.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Logic\\glParamQueue.cs", @@ -723,25 +833,23 @@ "RelativeToolTip": "StgSharpDebug\\Logic\\glParamQueue.cs", "ViewState": "AQIAAKUBAAAAAAAAAABLwLIBAAAMAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-04T05:55:57.109Z", - "EditorCaption": "" + "WhenOpened": "2024-02-04T05:55:57.109Z" }, { "$type": "Document", - "DocumentIndex": 8, + "DocumentIndex": 23, "Title": "IglFunc.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\IglFunc.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\IglFunc.cs", "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\IglFunc.cs", "RelativeToolTip": "StgSharpDebug\\Graphics\\IglFunc.cs", - "ViewState": "AQIAACABAAAAAAAAAAAowC8BAAAFAAAA", + "ViewState": "AQIAACMBAAAAAAAAAAAewC4BAAAsAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-01-30T01:57:38.516Z", - "EditorCaption": "" + "WhenOpened": "2024-01-30T01:57:38.516Z" }, { "$type": "Document", - "DocumentIndex": 34, + "DocumentIndex": 45, "Title": "glApiDefine.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\Define\\glApiDefine.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\Define\\glApiDefine.cs", @@ -749,12 +857,11 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\Define\\glApiDefine.cs", "ViewState": "AQIAAAkAAAAAAAAAAABLwJUAAAA2AAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-01-02T11:48:20.593Z", - "EditorCaption": "" + "WhenOpened": "2024-01-02T11:48:20.593Z" }, { "$type": "Document", - "DocumentIndex": 35, + "DocumentIndex": 46, "Title": "Shader.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\ShaderEdit\\Shader.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\ShaderEdit\\Shader.cs", @@ -762,25 +869,23 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\ShaderEdit\\Shader.cs", "ViewState": "AQIAAEIAAAAAAAAAAADwv1IAAAAfAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2023-12-07T17:49:49.555Z", - "EditorCaption": "" + "WhenOpened": "2023-12-07T17:49:49.555Z" }, { "$type": "Document", - "DocumentIndex": 16, + "DocumentIndex": 20, "Title": "GLonUpdate.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\GLonUpdate.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\GLonUpdate.cs", "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\GLonUpdate.cs", "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\GLonUpdate.cs", - "ViewState": "AQIAAGMBAAAAAAAAAAAowHsBAAA1AAAA", + "ViewState": "AQIAAAsAAAAAAAAAAAAawBUAAAAvAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-01-30T05:17:49.423Z", - "EditorCaption": "" + "WhenOpened": "2024-01-30T05:17:49.423Z" }, { "$type": "Document", - "DocumentIndex": 7, + "DocumentIndex": 27, "Title": "GLresourceGenrator.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\GLresourceGenrator.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\GLresourceGenrator.cs", @@ -788,12 +893,11 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\GLresourceGenrator.cs", "ViewState": "AQIAAAAAAAAAAAAAAAAuwBYAAAAAAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-02-03T01:26:23.297Z", - "EditorCaption": "" + "WhenOpened": "2024-02-03T01:26:23.297Z" }, { "$type": "Document", - "DocumentIndex": 30, + "DocumentIndex": 41, "Title": "VBO.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\Buffer\\VBO.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\Buffer\\VBO.cs", @@ -801,12 +905,11 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\Buffer\\VBO.cs", "ViewState": "AQIAABUAAAAAAAAAAAAcwCAAAABdAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2023-12-07T18:49:42.332Z", - "EditorCaption": "" + "WhenOpened": "2023-12-07T18:49:42.332Z" }, { "$type": "Document", - "DocumentIndex": 31, + "DocumentIndex": 42, "Title": "VAO.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\Buffer\\VAO.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\Buffer\\VAO.cs", @@ -814,12 +917,11 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\Buffer\\VAO.cs", "ViewState": "AQIAABcAAAAAAAAAAAAowCkAAAAoAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2023-12-10T18:54:07.607Z", - "EditorCaption": "" + "WhenOpened": "2023-12-10T18:54:07.607Z" }, { "$type": "Document", - "DocumentIndex": 40, + "DocumentIndex": 50, "Title": "Vec4d.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Math\\Linear\\Vec4d.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Math\\Linear\\Vec4d.cs", @@ -827,12 +929,11 @@ "RelativeToolTip": "StgSharpDebug\\Math\\Linear\\Vec4d.cs", "ViewState": "AQIAAAAAAAAAAAAAAAAcwA4AAAAiAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-01-31T14:10:03.253Z", - "EditorCaption": "" + "WhenOpened": "2024-01-31T14:10:03.253Z" }, { "$type": "Document", - "DocumentIndex": 33, + "DocumentIndex": 44, "Title": "texture.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\Buffer\\texture.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\Buffer\\texture.cs", @@ -840,12 +941,11 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\Buffer\\texture.cs", "ViewState": "AQIAAEMAAAAAAAAAAAAuwFEAAAABAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2023-11-17T07:06:58.925Z", - "EditorCaption": "" + "WhenOpened": "2023-11-17T07:06:58.925Z" }, { "$type": "Document", - "DocumentIndex": 49, + "DocumentIndex": 59, "Title": "BufferObjectBase.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\Buffer\\BufferObjectBase.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\Buffer\\BufferObjectBase.cs", @@ -853,12 +953,11 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\Buffer\\BufferObjectBase.cs", "ViewState": "AQIAAA8AAAAAAAAAAABbwCAAAAAIAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2023-12-10T18:51:58.659Z", - "EditorCaption": "" + "WhenOpened": "2023-12-10T18:51:58.659Z" }, { "$type": "Document", - "DocumentIndex": 32, + "DocumentIndex": 43, "Title": "EBO.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\GL\\Buffer\\EBO.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\GL\\Buffer\\EBO.cs", @@ -866,12 +965,11 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\GL\\Buffer\\EBO.cs", "ViewState": "AQIAABIAAAAAAAAAAAAcwB4AAAAJAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2023-12-03T14:56:37.242Z", - "EditorCaption": "" + "WhenOpened": "2023-12-03T14:56:37.242Z" }, { "$type": "Document", - "DocumentIndex": 41, + "DocumentIndex": 51, "Title": "Image.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Graphics\\Image.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Graphics\\Image.cs", @@ -879,12 +977,11 @@ "RelativeToolTip": "StgSharpDebug\\Graphics\\Image.cs", "ViewState": "AQIAAB0AAAAAAAAAAADwvykAAAAAAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2024-01-02T17:26:46.263Z", - "EditorCaption": "" + "WhenOpened": "2024-01-02T17:26:46.263Z" }, { "$type": "Document", - "DocumentIndex": 50, + "DocumentIndex": 15, "Title": "vertex.vert", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Shader\\vertex.vert", "RelativeDocumentMoniker": "StgSharpDebug\\Shader\\vertex.vert", @@ -892,25 +989,23 @@ "RelativeToolTip": "StgSharpDebug\\Shader\\vertex.vert", "ViewState": "AQIAAAAAAAAAAAAAAAAAAAkAAAARAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|", - "WhenOpened": "2023-10-19T05:37:18.693Z", - "EditorCaption": "" + "WhenOpened": "2023-10-19T05:37:18.693Z" }, { "$type": "Document", - "DocumentIndex": 37, + "DocumentIndex": 14, "Title": "fragment.frag", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Shader\\fragment.frag", "RelativeDocumentMoniker": "StgSharpDebug\\Shader\\fragment.frag", "ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Shader\\fragment.frag", "RelativeToolTip": "StgSharpDebug\\Shader\\fragment.frag", - "ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAA4AAAA7AAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|", - "WhenOpened": "2024-01-02T14:37:10.227Z", - "EditorCaption": "" + "WhenOpened": "2024-01-02T14:37:10.227Z" }, { "$type": "Document", - "DocumentIndex": 58, + "DocumentIndex": 66, "Title": "List.cs", "DocumentMoniker": "C:\\Users\\Nitlo\\AppData\\Local\\SourceServer\\a49b3a21a68db01290f63b8f22e4a9e58546e0a62fe2ff69b472e6b354d1bcea\\src\\libraries\\System.Private.CoreLib\\src\\System\\Collections\\Generic\\List.cs", "ToolTip": "C:\\Users\\Nitlo\\AppData\\Local\\SourceServer\\a49b3a21a68db01290f63b8f22e4a9e58546e0a62fe2ff69b472e6b354d1bcea\\src\\libraries\\System.Private.CoreLib\\src\\System\\Collections\\Generic\\List.cs", @@ -919,7 +1014,7 @@ }, { "$type": "Document", - "DocumentIndex": 56, + "DocumentIndex": 64, "Title": "Program.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgsharpEnvDebug\\Program.cs", "RelativeDocumentMoniker": "StgsharpEnvDebug\\Program.cs", @@ -927,12 +1022,11 @@ "RelativeToolTip": "StgsharpEnvDebug\\Program.cs", "ViewState": "AQIAAAAAAAAAAAAAAABLwBMAAAAAAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2023-12-20T18:58:34.322Z", - "EditorCaption": "" + "WhenOpened": "2023-12-20T18:58:34.322Z" }, { "$type": "Document", - "DocumentIndex": 14, + "DocumentIndex": 30, "Title": "Exception.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Logic\\Exception.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Logic\\Exception.cs", @@ -940,12 +1034,11 @@ "RelativeToolTip": "StgSharpDebug\\Logic\\Exception.cs", "ViewState": "AQIAAAkAAAAAAAAAAAAowBwAAAAIAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2023-12-13T17:30:55.097Z", - "EditorCaption": "" + "WhenOpened": "2023-12-13T17:30:55.097Z" }, { "$type": "Document", - "DocumentIndex": 22, + "DocumentIndex": 36, "Title": "TimeLine.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Control\\TimeLine.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Control\\TimeLine.cs", @@ -953,12 +1046,11 @@ "RelativeToolTip": "StgSharpDebug\\Control\\TimeLine.cs", "ViewState": "AQIAAAAAAAAAAAAAAAAAAAoAAAAFAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2023-12-05T17:00:44.024Z", - "EditorCaption": "" + "WhenOpened": "2023-12-05T17:00:44.024Z" }, { "$type": "Document", - "DocumentIndex": 57, + "DocumentIndex": 65, "Title": "Enemy.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Entities\\Enemy.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Entities\\Enemy.cs", @@ -966,12 +1058,11 @@ "RelativeToolTip": "StgSharpDebug\\Entities\\Enemy.cs", "ViewState": "AQIAAAcAAAAAAAAAAAAQwBMAAAAkAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2023-12-06T02:46:25.244Z", - "EditorCaption": "" + "WhenOpened": "2023-12-06T02:46:25.244Z" }, { "$type": "Document", - "DocumentIndex": 53, + "DocumentIndex": 62, "Title": "vec2d.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Math\\Linear\\vec2d.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Math\\Linear\\vec2d.cs", @@ -979,12 +1070,11 @@ "RelativeToolTip": "StgSharpDebug\\Math\\Linear\\vec2d.cs", "ViewState": "AQIAACYAAAAAAAAAAMBewEQAAAAkAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2023-11-26T07:25:28.66Z", - "EditorCaption": "" + "WhenOpened": "2023-11-26T07:25:28.66Z" }, { "$type": "Document", - "DocumentIndex": 59, + "DocumentIndex": 67, "Title": "Cordinate.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Geometries\\PlainGeometry\\Cordinate.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Geometries\\PlainGeometry\\Cordinate.cs", @@ -992,12 +1082,11 @@ "RelativeToolTip": "StgSharpDebug\\Geometries\\PlainGeometry\\Cordinate.cs", "ViewState": "AQIAAAYAAAAAAAAAAAAkwDkAAAAZAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2023-11-16T16:30:35.425Z", - "EditorCaption": "" + "WhenOpened": "2023-11-16T16:30:35.425Z" }, { "$type": "Document", - "DocumentIndex": 54, + "DocumentIndex": 63, "Title": "vec3d.cs", "DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u6E90\u4EE3\u7801\\StgSharpDebug\\Math\\Linear\\vec3d.cs", "RelativeDocumentMoniker": "StgSharpDebug\\Math\\Linear\\vec3d.cs", @@ -1005,8 +1094,7 @@ "RelativeToolTip": "StgSharpDebug\\Math\\Linear\\vec3d.cs", "ViewState": "AQIAAEgAAAAAAAAAAAAawHkAAABTAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2023-11-16T08:16:14.34Z", - "EditorCaption": "" + "WhenOpened": "2023-11-16T08:16:14.34Z" } ] } diff --git a/源代码/.vs/StgSharpDevelop/v17/fileList.bin b/源代码/.vs/StgSharpDevelop/v17/fileList.bin index d6ea12f2..cae873fd 100644 Binary files a/源代码/.vs/StgSharpDevelop/v17/fileList.bin and b/源代码/.vs/StgSharpDevelop/v17/fileList.bin differ diff --git a/源代码/.vs/StgSharpDevelop/v17/ipch/AutoPCH/8b0ae67cdca71063/DLLMAIN.ipch b/源代码/.vs/StgSharpDevelop/v17/ipch/AutoPCH/8b0ae67cdca71063/DLLMAIN.ipch new file mode 100644 index 00000000..ec674f12 Binary files /dev/null and b/源代码/.vs/StgSharpDevelop/v17/ipch/AutoPCH/8b0ae67cdca71063/DLLMAIN.ipch differ diff --git a/源代码/.vs/StgSharpDevelop/v17/ipch/AutoPCH/ec51e8eba5f6a893/STGSHARPC.ipch b/源代码/.vs/StgSharpDevelop/v17/ipch/AutoPCH/ec51e8eba5f6a893/STGSHARPC.ipch index 155a9e0f..0b275e2c 100644 Binary files a/源代码/.vs/StgSharpDevelop/v17/ipch/AutoPCH/ec51e8eba5f6a893/STGSHARPC.ipch and b/源代码/.vs/StgSharpDevelop/v17/ipch/AutoPCH/ec51e8eba5f6a893/STGSHARPC.ipch differ diff --git a/源代码/BenchMark/obj/Debug/net6.0/BenchMark.AssemblyInfo.cs b/源代码/BenchMark/obj/Debug/net6.0/BenchMark.AssemblyInfo.cs index 8ab715b7..7a570f91 100644 --- a/源代码/BenchMark/obj/Debug/net6.0/BenchMark.AssemblyInfo.cs +++ b/源代码/BenchMark/obj/Debug/net6.0/BenchMark.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("BenchMark")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1f2fca4c8fe323daf9751677ccfdf0f7b04a9be8")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+15bf989285b01c5617b5f5612667e0da6a2b1781")] [assembly: System.Reflection.AssemblyProductAttribute("BenchMark")] [assembly: System.Reflection.AssemblyTitleAttribute("BenchMark")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/源代码/BenchMark/obj/Debug/net6.0/BenchMark.AssemblyInfoInputs.cache b/源代码/BenchMark/obj/Debug/net6.0/BenchMark.AssemblyInfoInputs.cache index e6026c67..6e0be317 100644 --- a/源代码/BenchMark/obj/Debug/net6.0/BenchMark.AssemblyInfoInputs.cache +++ b/源代码/BenchMark/obj/Debug/net6.0/BenchMark.AssemblyInfoInputs.cache @@ -1 +1 @@ -1b559b7de794dd65a77a826f372c4869f4f694564820837fdd05922d644b8624 +60748d6834d1deac3b68f29467e8af995e7f1690974ec71ee229ce37c30422b0 diff --git a/源代码/Output/x64/Debug/net6.0/SS_errorlog.log b/源代码/Output/x64/Debug/net6.0/SS_errorlog.log index 4a391a18..e53b201d 100644 --- a/源代码/Output/x64/Debug/net6.0/SS_errorlog.log +++ b/源代码/Output/x64/Debug/net6.0/SS_errorlog.log @@ -835,3 +835,293 @@ Successfully load all OpenGL 4.5 APIs Successfully load all OpenGL 4.6 APIs Info @ 2024-03-10T19:08:56.2960606+08:00 No supported OpenGL extensions are found. + + + + +Info @ 2024-03-17T04:45:55.3954687+08:00 +Program start +Info @ 2024-03-17T04:45:55.6735067+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-03-17T04:45:55.6937329+08:00 +No supported OpenGL extensions are found. + + + + +Info @ 2024-03-17T04:47:21.7670457+08:00 +Program start +Info @ 2024-03-17T04:47:22.0119777+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-03-17T04:47:22.0296646+08:00 +No supported OpenGL extensions are found. + + + + +Info @ 2024-03-17T04:47:42.0853362+08:00 +Program start +Info @ 2024-03-17T04:47:42.3080473+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-03-17T04:47:42.3265901+08:00 +No supported OpenGL extensions are found. + + + + +Info @ 2024-03-17T15:58:11.5959143+08:00 +Program start +Info @ 2024-03-17T15:58:12.0461885+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-03-17T15:58:12.0727471+08:00 +No supported OpenGL extensions are found. + + + + +Info @ 2024-03-17T15:58:37.5771520+08:00 +Program start +Info @ 2024-03-17T15:58:38.0455835+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-03-17T15:58:38.0805927+08:00 +No supported OpenGL extensions are found. + + + + +Info @ 2024-03-18T03:20:05.6386752+08:00 +Program start +Info @ 2024-03-18T03:20:05.8480991+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-03-18T03:20:05.8716535+08:00 +No supported OpenGL extensions are found. + + + + +Info @ 2024-03-18T03:20:29.6227810+08:00 +Program start +Info @ 2024-03-18T03:20:29.8383555+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-03-18T03:20:29.8580492+08:00 +No supported OpenGL extensions are found. + + + + +Info @ 2024-03-18T03:21:01.4396770+08:00 +Program start +Info @ 2024-03-18T03:21:01.6593394+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-03-18T03:21:01.6754045+08:00 +No supported OpenGL extensions are found. + + + + +Info @ 2024-03-18T03:24:20.1623397+08:00 +Program start +Info @ 2024-03-18T03:24:20.3852138+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-03-18T03:24:20.4025580+08:00 +No supported OpenGL extensions are found. + + + + +Info @ 2024-03-18T23:22:58.5141260+08:00 +Program start +Info @ 2024-03-18T23:22:58.7359661+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-03-18T23:22:58.7529805+08:00 +No supported OpenGL extensions are found. diff --git a/源代码/Output/x64/Debug/net6.0/Shader/fragment.frag b/源代码/Output/x64/Debug/net6.0/Shader/fragment.frag index ca2f7bc0..53635067 100644 --- a/源代码/Output/x64/Debug/net6.0/Shader/fragment.frag +++ b/源代码/Output/x64/Debug/net6.0/Shader/fragment.frag @@ -12,6 +12,6 @@ void main() { vec4 tex1 = texture(ourTexture, TexCoord); vec4 tex2 = texture(ourTexture2,TexCoord); - FragColor = mix(tex1,tex2,0.2) /**/ *vec4( TexColor,1.0) /**/; + FragColor = mix(tex1 * vec4( TexColor,1.0),tex2,0.2) /* *vec4( TexColor,1.0) /**/; } diff --git a/源代码/Output/x64/Debug/net6.0/StgSharpC.dll b/源代码/Output/x64/Debug/net6.0/StgSharpC.dll index 2404217d..a032ac23 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 fd6c7e36..d2f43b9a 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 73158cd1..4c0f4435 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 8d9fa635..4a24e1a4 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 ed95f6eb..3551421f 100644 --- a/源代码/Output/x64/Debug/net6.0/StgSharpDebug.xml +++ b/源代码/Output/x64/Debug/net6.0/StgSharpDebug.xml @@ -26,7 +26,8 @@ - OpenGL package used by current form context. + OpenGL package binded to current form context. + A OpenGL context is only binded to current form. @@ -51,24 +52,18 @@ - 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. + 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. + + Something goes wrong and StgSharp fails in creating a new OpenGL context. + Set all necessary metadata to current form instance - - - Resize the current form - - New width of the window - New height of the window - Resize the current form @@ -77,14 +72,12 @@ A (width,height) representing the new size of current form - + - Set the size limit of current form + Resize the current form - Minimum width of current form - Minimum height of current form - Maximum width of curent form - Maximum height of current form + New width of the window + New height of the window @@ -97,6 +90,15 @@ 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 curent form + Maximum height of current form + Necessary operation to init this form. @@ -105,8 +107,7 @@ - Behaviour of current form when in a render cycle. - When this form + Behaviour of current form when in a render cycle. When this form @@ -119,7 +120,7 @@ Get OpenGL library of this form's context. - A package contains all opengl APIs + A package contains all opengl APIs @@ -163,23 +164,6 @@ New instance of instance. - - - A timer counting frames after its construction. - - - - - Frames after this timer created. - - - - - Convert a into uint value. - this will get total frames since the timer was created. - - to be converted - Interface of all kinds OpenGL buffer onjects @@ -611,21 +595,20 @@ Y position of an enemy entity - + + + Init an instance of OpenGL program, + This method should be called before any other StgSharp api. + + + Version of current StgSharp platform. Main version represent in hundred's digit, and sub version represent in ten's digit. - - - Init an instance of OpenGL program, - This method should be called before other - graphic methods, after LoadGL method. - - - + Write a log message to log file, and mark the level of this message. @@ -709,11 +692,6 @@ 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。 - - - Tick time this geometry eas crested - - Get all sides of this . @@ -726,6 +704,11 @@ + + + Tick time this geometry eas crested + + Update the coordinate of the point. If this is a moving point, @@ -795,6 +778,27 @@ The second value. + + + 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. + + + + + + Time source provider provided in internal framework. + + + + + The method this will call every time a new time span started. + + OpenGL numeric type. diff --git a/源代码/StgSharp/Control/Get.cs b/源代码/StgSharp/Control/Get.cs index 87f3eee7..70f1655e 100644 --- a/源代码/StgSharp/Control/Get.cs +++ b/源代码/StgSharp/Control/Get.cs @@ -1,4 +1,34 @@ -using StgSharp.Controlling; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Get.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.Controlling; using StgSharp.Graphics; using StgSharp.Logic; using StgSharp.Math; @@ -7,6 +37,7 @@ namespace StgSharp { public static unsafe partial class Operation { + /// /// Get the status of a certain key on the keyboard. /// @@ -15,7 +46,7 @@ namespace StgSharp /// public static KeyStatus GetKeyStatus(Form form, Key key) { - return InternalIO.glfwGetKey(form.windowID, (int)key); + return InternalIO.glfwGetKey(form.id, (int)key); } } diff --git a/源代码/StgSharp/Control/IO/GLIO.cs b/源代码/StgSharp/Control/IO/GLIO.cs index 604c78bc..5bcdc92d 100644 --- a/源代码/StgSharp/Control/IO/GLIO.cs +++ b/源代码/StgSharp/Control/IO/GLIO.cs @@ -1,4 +1,34 @@ -using StgSharp.Controlling; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="GLIO.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.Controlling; using StgSharp.Graphics; using StgSharp.Math; diff --git a/源代码/StgSharp/Control/IO/InternalIO.cs b/源代码/StgSharp/Control/IO/InternalIO.cs index a0afa9da..4750905a 100644 --- a/源代码/StgSharp/Control/IO/InternalIO.cs +++ b/源代码/StgSharp/Control/IO/InternalIO.cs @@ -1,11 +1,42 @@ -using StgSharp.Geometries; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="InternalIO.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.Graphics; -using System.Threading; + using System; using System.Collections.Generic; using System.IO; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Threading; #if Windows @@ -24,10 +55,6 @@ namespace StgSharp internal static unsafe partial class InternalIO { - internal static Dictionary GLtype = - new Dictionary(); - - internal static IntPtr SSClibPtr = IntPtr.Zero; internal const string SS_errorlog = "SS_errorlog.log"; @@ -35,9 +62,16 @@ namespace StgSharp internal const string SSC_libname = "StgSharpC"; + internal static Dictionary GLtype = + new Dictionary(); + + internal static SemaphoreSlim logSyncSemaphore = new SemaphoreSlim(1, 1); + internal static readonly GCHandle ssc_logHandle = GCHandle.Alloc(new byte[512], GCHandleType.Pinned); + internal static IntPtr SSClibPtr = IntPtr.Zero; + static InternalIO() { GLtype.Add(TypeCode.Single, GLconst.FLOAT); @@ -49,6 +83,20 @@ namespace StgSharp GLtype.Add(TypeCode.Byte, GLconst.UNSIGNED_BYTE); } + internal static void InternalAppendLog(string log) + { + if (!File.Exists(SS_errorlog)) + { + FileStream stream = File.Create(SS_errorlog); + stream.Close(); + } + + using (StreamWriter logStream = File.AppendText(SS_errorlog)) + { + logStream.WriteLine(log); + } + } + [Obsolete("Not completed", true)] internal static IntPtr InternalLoadProc(IntPtr lib, string name) where T : Delegate { @@ -68,8 +116,9 @@ namespace StgSharp } } - internal static void InternalAppendLog(string log) + internal static void InternalWriteLog(string logLine, LogType logType) { + logSyncSemaphore.Wait(); if (!File.Exists(SS_errorlog)) { FileStream stream = File.Create(SS_errorlog); @@ -78,12 +127,12 @@ namespace StgSharp using (StreamWriter logStream = File.AppendText(SS_errorlog)) { - logStream.WriteLine(log); + logStream.WriteLine($"{logType}\t@\t{DateTime.Now.ToString("o")}"); + logStream.WriteLine(logLine); } + logSyncSemaphore.Release(1); } - internal static SemaphoreSlim logSyncSemaphore = new SemaphoreSlim(1, 1); - internal static void InternalWriteLog(string beforeTime, string logLine, LogType logType) { logSyncSemaphore.Wait(); @@ -102,21 +151,5 @@ namespace StgSharp logSyncSemaphore.Release(1); } - internal static void InternalWriteLog(string logLine, LogType logType) - { - logSyncSemaphore.Wait(); - if (!File.Exists(SS_errorlog)) - { - FileStream stream = File.Create(SS_errorlog); - stream.Close(); - } - - using (StreamWriter logStream = File.AppendText(SS_errorlog)) - { - logStream.WriteLine($"{logType}\t@\t{DateTime.Now.ToString("o")}"); - logStream.WriteLine(logLine); - } - logSyncSemaphore.Release(1); - } } } \ No newline at end of file diff --git a/源代码/StgSharp/Control/KeyControl.cs b/源代码/StgSharp/Control/KeyControl.cs index 5c3a100d..1620f93f 100644 --- a/源代码/StgSharp/Control/KeyControl.cs +++ b/源代码/StgSharp/Control/KeyControl.cs @@ -1,133 +1,163 @@ -namespace StgSharp +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="KeyControl.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 static partial class Operation { public enum Key : int { - UNKNOWN = -1, - SPACE = 32, - APOSTROPHE = 39/*'*/, - COMMA = 44/*,*/, - MINUS = 45/*-*/, - PERIOD = 46/*.*/, - SLASH = 47/*/*/, - ZERO = 48, - ONE = 49, - TWO = 50, - THREE = 51, - FOUR = 52, - FIVE = 53, - SIX = 54, - SEVEN = 55, - EIGHT = 56, - NINE = 57, - SEMICOLON = 59/*,*/, - EQUAL = 61/*=*/, - A = 65, - B = 66, - C = 67, - D = 68, - E = 69, - F = 70, - G = 71, - H = 72, - I = 73, - J = 74, - K = 75, - L = 76, - M = 77, - N = 78, - O = 79, - P = 80, - Q = 81, - R = 82, - S = 83, - T = 84, - U = 85, - V = 86, - W = 87, - X = 88, - Y = 89, - Z = 90, - LEFT_BRACKET = 91/*[*/, - BACKSLASH = 92/*\*/, - RIGHT_BRACKET = 93/*]*/, - GRAVE_ACCENT = 96/*`*/, - WORLD_1 = 161/*non-US#1*/, - WORLD_2 = 162/*non-US#2*/, - ESCAPE = 256, - ENTER = 257, - TAB = 258, - BACKSPACE = 259, - INSERT = 260, - DELETE = 261, - RIGHT = 262, - LEFT = 263, - DOWN = 264, - UP = 265, - PAGE_UP = 266, - PAGE_DOWN = 267, - HOME = 268, - END = 269, - CAPS_LOCK = 280, - SCROLL_LOCK = 281, - NUM_LOCK = 282, - PRINT_SCREEN = 283, - PAUSE = 284, - F1 = 290, - F2 = 291, - F3 = 292, - F4 = 293, - F5 = 294, - F6 = 295, - F7 = 296, - F8 = 297, - F9 = 298, - F10 = 299, - F11 = 300, - F12 = 301, - F13 = 302, - F14 = 303, - F15 = 304, - F16 = 305, - F17 = 306, - F18 = 307, - F19 = 308, - F20 = 309, - F21 = 310, - F22 = 311, - F23 = 312, - F24 = 313, - F25 = 314, - KP_0 = 320, - KP_1 = 321, - KP_2 = 322, - KP_3 = 323, - KP_4 = 324, - KP_5 = 325, - KP_6 = 326, - KP_7 = 327, - KP_8 = 328, - KP_9 = 329, - KP_DECIMAL = 330, - KP_DIVIDE = 331, - KP_MULTIPLY = 332, - KP_SUBTRACT = 333, - KP_ADD = 334, - KP_ENTER = 335, - KP_EQUAL = 336, - LEFT_SHIFT = 340, - LEFT_CONTROL = 341, - LEFT_ALT = 342, - LEFT_SUPER = 343, - RIGHT_SHIFT = 344, - RIGHT_CONTROL = 345, - RIGHT_ALT = 346, - RIGHT_SUPER = 347, - MENU = 348 + UNKNOWN = -1, + SPACE = 32, + APOSTROPHE = 39/*'*/, + COMMA = 44/*,*/, + MINUS = 45/*-*/, + PERIOD = 46/*.*/, + SLASH = 47/*/*/, + ZERO = 48, + ONE = 49, + TWO = 50, + THREE = 51, + FOUR = 52, + FIVE = 53, + SIX = 54, + SEVEN = 55, + EIGHT = 56, + NINE = 57, + SEMICOLON = 59/*,*/, + EQUAL = 61/*=*/, + A = 65, + B = 66, + C = 67, + D = 68, + E = 69, + F = 70, + G = 71, + H = 72, + I = 73, + J = 74, + K = 75, + L = 76, + M = 77, + N = 78, + O = 79, + P = 80, + Q = 81, + R = 82, + S = 83, + T = 84, + U = 85, + V = 86, + W = 87, + X = 88, + Y = 89, + Z = 90, + LEFT_BRACKET = 91/*[*/, + BACKSLASH = 92/*\*/, + RIGHT_BRACKET = 93/*]*/, + GRAVE_ACCENT = 96/*`*/, + WORLD_1 = 161/*non-US#1*/, + WORLD_2 = 162/*non-US#2*/, + ESCAPE = 256, + ENTER = 257, + TAB = 258, + BACKSPACE = 259, + INSERT = 260, + DELETE = 261, + RIGHT = 262, + LEFT = 263, + DOWN = 264, + UP = 265, + PAGE_UP = 266, + PAGE_DOWN = 267, + HOME = 268, + END = 269, + CAPS_LOCK = 280, + SCROLL_LOCK = 281, + NUM_LOCK = 282, + PRINT_SCREEN = 283, + PAUSE = 284, + F1 = 290, + F2 = 291, + F3 = 292, + F4 = 293, + F5 = 294, + F6 = 295, + F7 = 296, + F8 = 297, + F9 = 298, + F10 = 299, + F11 = 300, + F12 = 301, + F13 = 302, + F14 = 303, + F15 = 304, + F16 = 305, + F17 = 306, + F18 = 307, + F19 = 308, + F20 = 309, + F21 = 310, + F22 = 311, + F23 = 312, + F24 = 313, + F25 = 314, + KP_0 = 320, + KP_1 = 321, + KP_2 = 322, + KP_3 = 323, + KP_4 = 324, + KP_5 = 325, + KP_6 = 326, + KP_7 = 327, + KP_8 = 328, + KP_9 = 329, + KP_DECIMAL = 330, + KP_DIVIDE = 331, + KP_MULTIPLY = 332, + KP_SUBTRACT = 333, + KP_ADD = 334, + KP_ENTER = 335, + KP_EQUAL = 336, + LEFT_SHIFT = 340, + LEFT_CONTROL = 341, + LEFT_ALT = 342, + LEFT_SUPER = 343, + RIGHT_SHIFT = 344, + RIGHT_CONTROL = 345, + RIGHT_ALT = 346, + RIGHT_SUPER = 347, + MENU = 348 } - public enum Joystick:int + public enum Joystick : int { JOYSTICK_1 = 0, JOYSTICK_2 = 1, @@ -164,7 +194,7 @@ BUTTON_MIDDLE = BUTTON_3 } - + } public enum KeyStatus : int diff --git a/源代码/StgSharp/Control/TimeLine.cs b/源代码/StgSharp/Control/TimeLine.cs index df19811d..a36f5ed8 100644 --- a/源代码/StgSharp/Control/TimeLine.cs +++ b/源代码/StgSharp/Control/TimeLine.cs @@ -1,5 +1,36 @@ -using StgSharp.Entities; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="TimeLine.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.Graphics; + using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -9,24 +40,19 @@ namespace StgSharp.Controlling { internal static partial class TimeLine { - internal static Queue
formList = new Queue(); + + private static bool isPaused = false; private static bool renderChainStarted; internal static TimelineBlock currentOperation; - private static bool isPaused = false; - - - internal static bool RenderStarted - { - get { return renderChainStarted; } - } + internal static Queue formList = new Queue(); public static TimelineBlock CurrentOperation { - get { return currentOperation; } + get => currentOperation; set { - if (currentOperation == default || + if ((currentOperation == default) || currentOperation.isComplete) { currentOperation = value; @@ -35,6 +61,9 @@ namespace StgSharp.Controlling } + internal static bool RenderStarted => renderChainStarted; + + internal static void RenderAll() { renderChainStarted = true; diff --git a/源代码/StgSharp/Control/TimelineBlock.cs b/源代码/StgSharp/Control/TimelineBlock.cs index 02c0127e..305c98d3 100644 --- a/源代码/StgSharp/Control/TimelineBlock.cs +++ b/源代码/StgSharp/Control/TimelineBlock.cs @@ -1,4 +1,34 @@ -namespace StgSharp.Controlling +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="TimelineBlock.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.Controlling { public abstract class TimelineBlock { @@ -8,12 +38,14 @@ get; } + 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(); - public abstract bool GetShouldComplete(); + } } diff --git a/源代码/StgSharp/Entities/BehaviorArgs.cs b/源代码/StgSharp/Entities/BehaviorArgs.cs index 1c84e97c..692aa406 100644 --- a/源代码/StgSharp/Entities/BehaviorArgs.cs +++ b/源代码/StgSharp/Entities/BehaviorArgs.cs @@ -1,4 +1,34 @@ -namespace StgSharp.Entities +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="BehaviorArgs.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 abstract class BehaviorArgs { diff --git a/源代码/StgSharp/Entities/EliteEnemy.cs b/源代码/StgSharp/Entities/EliteEnemy.cs index 07a729e1..255140c3 100644 --- a/源代码/StgSharp/Entities/EliteEnemy.cs +++ b/源代码/StgSharp/Entities/EliteEnemy.cs @@ -1,4 +1,34 @@ -using StgSharp.Controlling; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 StgSharp.Controlling; using System; using System.Collections.Generic; @@ -7,20 +37,19 @@ namespace StgSharp.Entities { public class EliteEnemy : IEntity { - public bool _selectalbe; 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; } - internal void InternalDieOperation(Control home) + public virtual void OnRender() { - _dieBulletLauncher.Launch(); - _awardLauncher.Launch(); + new NotImplementedException(); } public override void OnRenderFrame() @@ -33,8 +62,16 @@ namespace StgSharp.Entities this.OnRender(); } - public virtual void OnRender() => new NotImplementedException(); + public virtual void OnUpdate() + { + new NotImplementedException(); + } + + internal void InternalDieOperation(Control home) + { + _dieBulletLauncher.Launch(); + _awardLauncher.Launch(); + } - public virtual void OnUpdate() => new NotImplementedException(); } } \ No newline at end of file diff --git a/源代码/StgSharp/Entities/Enemy.cs b/源代码/StgSharp/Entities/Enemy.cs index 16694531..2cbfa718 100644 --- a/源代码/StgSharp/Entities/Enemy.cs +++ b/源代码/StgSharp/Entities/Enemy.cs @@ -1,28 +1,59 @@ -using StgSharp.Controlling; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using StgSharp.Controlling; namespace StgSharp.Entities { public class Enemy : IEntity { - public bool _selectalbe; 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(); + } + internal void InternalDieOperation(Control home) { _dieBulletLauncher.Launch(); _awardLauncher.Launch(); } - public override void OnRenderFrame() - { - CommonBulletLauncher.Launch(); - } } } diff --git a/源代码/StgSharp/Entities/EntityPartical.cs b/源代码/StgSharp/Entities/EntityPartical.cs index ffa97a80..552832a1 100644 --- a/源代码/StgSharp/Entities/EntityPartical.cs +++ b/源代码/StgSharp/Entities/EntityPartical.cs @@ -1,4 +1,34 @@ -namespace StgSharp.Entities +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="EntityPartical.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 abstract class EntityPartical : IEntity { diff --git a/源代码/StgSharp/Entities/IEntity.cs b/源代码/StgSharp/Entities/IEntity.cs index 731c75ac..e908b5b0 100644 --- a/源代码/StgSharp/Entities/IEntity.cs +++ b/源代码/StgSharp/Entities/IEntity.cs @@ -1,4 +1,34 @@ -using StgSharp.Geometries; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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.Collections.Generic; @@ -7,19 +37,20 @@ namespace StgSharp { public abstract class IEntity { - internal Point _pos; + + protected uint _bornTick; + internal Point _basePoint; internal LinkedList _collisionBox; internal Sensor _collisionSensor; - internal string _texture; - internal Point _position; - internal Point _basePoint; internal GetLocationHandler _movHandler; - protected uint _bornTick; + internal Point _pos; + internal Point _position; + internal string _texture; public LinkedList CollisionBox { - get { return _collisionBox; } - set { _collisionBox = value; } + get => _collisionBox; + set => _collisionBox = value; } /// @@ -27,17 +58,17 @@ namespace StgSharp /// public Sensor CollisionSensor { - get { return _collisionSensor; } - set { _collisionSensor = value; } + get => _collisionSensor; + set => _collisionSensor = value; } - public string Texture { get; set; } - /// /// A 2D vector presenting the position of an enemy entity, position can also be visited by X, Y /// public Vec2d Location { get; } + public string Texture { get; set; } + /// /// X position of an enenmy entity /// @@ -48,11 +79,12 @@ namespace StgSharp ///
public float Y { get; set; } + public abstract void OnRenderFrame(); + public void SetLocation(Point p) { _pos = p; } - public abstract void OnRenderFrame(); } } \ No newline at end of file diff --git a/源代码/StgSharp/Entities/Launcher.cs b/源代码/StgSharp/Entities/Launcher.cs index fbe45115..a41fb1fb 100644 --- a/源代码/StgSharp/Entities/Launcher.cs +++ b/源代码/StgSharp/Entities/Launcher.cs @@ -1,23 +1,54 @@ -using StgSharp.Entities; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 EntityPartical _bulletSample; //发射的子弹类型 internal uint[] launchtick; //发射子弹的内部计时 public EntityPartical Bullet { - get { return _bulletSample; } - set { _bulletSample = value; } + get => _bulletSample; + set => _bulletSample = value; } internal virtual void Launch() diff --git a/源代码/StgSharp/Entities/Partical.cs b/源代码/StgSharp/Entities/Partical.cs index 909b00c8..b4609948 100644 --- a/源代码/StgSharp/Entities/Partical.cs +++ b/源代码/StgSharp/Entities/Partical.cs @@ -1,12 +1,44 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Partical.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 { public class Partical : IEntity { + public override void OnRenderFrame() { throw new NotImplementedException(); } + } } diff --git a/源代码/StgSharp/Entities/Player.cs b/源代码/StgSharp/Entities/Player.cs index 21ab8aa4..dae08276 100644 --- a/源代码/StgSharp/Entities/Player.cs +++ b/源代码/StgSharp/Entities/Player.cs @@ -1,13 +1,41 @@ -namespace StgSharp +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 - { - get { return _velocity; } - } + public float Velocity => _velocity; diff --git a/源代码/StgSharp/Environment/GlobalSetting.cs b/源代码/StgSharp/Environment/GlobalSetting.cs index 1e2c72c6..c90ae68f 100644 --- a/源代码/StgSharp/Environment/GlobalSetting.cs +++ b/源代码/StgSharp/Environment/GlobalSetting.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="GlobalSetting.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; @@ -9,6 +39,7 @@ namespace StgSharp { public static unsafe partial class StgSharp { + /// /// Init an instance of OpenGL program, /// This method should be called before any other StgSharp api. @@ -28,17 +59,20 @@ namespace StgSharp public static class GlobalSetting { + private static bool vSyncActivated; public static bool VSyncActivated { - get { return vsyncActivated; } + get => vsyncActivated; set { InternalIO.glfwSwapInterval(value ? 1 : 0); vsyncActivated = value; } } + } + } } \ No newline at end of file diff --git a/源代码/StgSharp/Environment/Platform.cs b/源代码/StgSharp/Environment/Platform.cs index 7f62a86b..0f47df8f 100644 --- a/源代码/StgSharp/Environment/Platform.cs +++ b/源代码/StgSharp/Environment/Platform.cs @@ -1,4 +1,34 @@ -// using StgSharp.Envitronment; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Platform.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.Envitronment; // using StgSharp.Envitronment.Win32; // using StgSharp.Graphics; // using StgSharp.Math; @@ -36,9 +66,17 @@ namespace StgSharp public static partial class StgSharp { - internal static GraphicAPI API = default; - private static bool vsyncActivated; + + /// + /// Version of current StgSharp platform. + /// Main version represent in hundred's digit, + /// and sub version represent in ten's digit. + /// + public const long version = 430; + private static uint markCount = 0; + private static bool vsyncActivated; + internal static GraphicAPI API = default; public static void Mark(bool needConsole) { @@ -49,12 +87,34 @@ namespace StgSharp } } - /// - /// Version of current StgSharp platform. - /// Main version represent in hundred's digit, - /// and sub version represent in ten's digit. - /// - public const long version = 430; + public static void Track( + object target, + string message, + bool isConsole, + [CallerFilePath] string filePath = "", + [CallerMemberName] string callerName = "", + [CallerLineNumber] int lineNumber = 0 + ) + { + Type t = target.GetType(); + string log = $"Tracked object: {nameof(target)}\t\tType:{t.Name}\n"; + FieldInfo[] fieldInfo = t.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); + log += "|\tFieldName\t|\tFieldType\t|\tFieldValue\t|\n"; + foreach (FieldInfo field in fieldInfo) + { + log += $"|{field.Name}\t\t|{field.FieldType}\t\t|{field.GetValue(target)}\t\t|\n"; + } + log += $"Tracking at:\n{filePath}\t{callerName}\tline {lineNumber}\n"; + log += $"Additional information:\n{message}\n"; + if (isConsole) + { + Console.WriteLine(log); + } + else + { + InternalIO.InternalWriteLog(log, LogType.Info); + } + } /// /// Write a log message to log file, and mark the level of this message. @@ -99,33 +159,5 @@ namespace StgSharp } } - public static void Track( - object target, - string message, - bool isConsole, - [CallerFilePath] string filePath = "", - [CallerMemberName] string callerName = "", - [CallerLineNumber] int lineNumber = 0 - ) - { - Type t = target.GetType(); - string log = $"Tracked object: {nameof(target)}\t\tType:{t.Name}\n"; - FieldInfo[] fieldInfo = t.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); - log += "|\tFieldName\t|\tFieldType\t|\tFieldValue\t|\n"; - foreach (FieldInfo field in fieldInfo) - { - log += $"|{field.Name}\t\t|{field.FieldType}\t\t|{field.GetValue(target)}\t\t|\n"; - } - log += $"Tracking at:\n{filePath}\t{callerName}\tline {lineNumber}\n"; - log += $"Additional information:\n{message}\n"; - if (isConsole) - { - Console.WriteLine(log); - } - else - { - InternalIO.InternalWriteLog(log, LogType.Info); - } - } } } \ No newline at end of file diff --git a/源代码/StgSharp/Environment/TimeProvaider.cs b/源代码/StgSharp/Environment/TimeProvaider.cs deleted file mode 100644 index d7e4b0d9..00000000 --- a/源代码/StgSharp/Environment/TimeProvaider.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace StgSharp -{ - public static partial class StgSharp - { - private static Stopwatch mainProvider = new Stopwatch(); - private static List subscriberList = new List(); - private static Thread timeProvideThread; - private static long accuracy; - - private static void ProvideTime() - { - long totalMS, previousFrameMS = 0, - internalFrequncy = Stopwatch.Frequency; - lock (mainProvider) - { - mainProvider.Restart(); - } - while (mainProvider.IsRunning) - { - totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L)); - foreach (TimeProvider subscriber in subscriberList) - { - subscriber.CheckTime(totalMS); - } - } - } - - [MethodImpl(MethodImplOptions.NoOptimization)] - public static void TimerActivate(int maxFrameUpdateSensitiveTimeProviderCount) - { - if (!mainProvider.IsRunning) - { - mainProvider.Start(); - //speed test - long totalMS, previousSecondMS = 0, - internalFrequncy = Stopwatch.Frequency; - for (int i = 0; i < 100; i++) - { - totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L)); - for (int t = 0; t < 10; t++) - { - if (totalMS < 1000) - { - subscriberList.Add(new TimeProvider(100L)); - } - } - } - mainProvider.Stop(); - subscriberList.Clear(); - totalMS = (mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L))) / 100L; - accuracy = totalMS * 2 / 3; - mainProvider.Reset(); - timeProvideThread = new Thread(new ThreadStart(ProvideTime)); - timeProvideThread.Start(); - } - } - - public static void SubscribeTimeProvider(TimeProvider provider) - { - } - - public static void TimerDeactivate() - { - lock (mainProvider) - { - mainProvider.Stop(); - } - } - } -} \ No newline at end of file diff --git a/源代码/StgSharp/Environment/TimeProvider.cs b/源代码/StgSharp/Environment/TimeProvider.cs new file mode 100644 index 00000000..f40ebefc --- /dev/null +++ b/源代码/StgSharp/Environment/TimeProvider.cs @@ -0,0 +1,129 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="TimeProvider.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.Diagnostics; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Threading; + +namespace StgSharp +{ + public partial class StgSharp + { + + internal static StgSharpTime mainTimeProvider; + + } + + public sealed class StgSharpTime : TimeSourceProviderBase + { + + private static long accuracy; + private static Stopwatch mainProvider = new Stopwatch(); + private static List subscriberList = new List(); + private static Thread timeProvideThread; + + internal StgSharpTime() + { + } + + public static StgSharpTime OnlyInstance +=> StgSharp.mainTimeProvider; + + public override sealed void StartProvidingTime() + { + if (mainProvider.IsRunning) + { + return; + } + mainProvider.Start(); + //speed test + long totalMS, internalFrequncy = Stopwatch.Frequency; + for (int i = 0; i < 100; i++) + { + totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L)); + for (int t = 0; t < 10; t++) + { + if (totalMS < 1000) + { + subscriberList.Add(new TimeSpanProvider(100L, TimeSpanProvider.DefaultProvider)); + } + } + } + mainProvider.Stop(); + subscriberList.Clear(); + totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L)) / 100L; + accuracy = (totalMS * 2) / 3; + mainProvider.Reset(); + timeProvideThread = new Thread(new ThreadStart(ProvideTime)); + timeProvideThread.Start(); + } + + [MethodImpl(MethodImplOptions.NoOptimization)] + public static void TimerActivate(int maxFrameUpdateSensitiveTimeProviderCount) + { + } + + protected override sealed void AddSubscriberUnsynced(TimeSpanProvider subscriber) + { + subscriberList.Add(subscriber); + } + + protected override sealed void RemoveSubscriberUnsynced(TimeSpanProvider subscriber) + { + subscriberList.Remove(subscriber); + } + + private void ProvideTime() + { + long totalMS, internalFrequncy = Stopwatch.Frequency; + lock (mainProvider) + { + mainProvider.Restart(); + } + while (mainProvider.IsRunning) + { + totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L)); + foreach (TimeSpanProvider subscriber in subscriberList) + { + if (subscriber.CheckTime(totalMS)) + { + + }; + } + } + } + + } +} \ No newline at end of file diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Arc.cs b/源代码/StgSharp/Geometries/PlainGeometry/Arc.cs index 5ea1daaa..6dc3c388 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Arc.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/Arc.cs @@ -1,4 +1,35 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Arc.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; namespace StgSharp.Geometries @@ -8,20 +39,40 @@ namespace StgSharp.Geometries /// public class Arc : PlainGeometry { - internal Point center; + internal Point beginPoint; + internal Point center; internal Point endPoint; - internal GetLocationHandler movCenterOperation = new GetLocationHandler(GeometryOperation.DefualtMotion); internal GetLocationHandler movBeginOperation = new GetLocationHandler(GeometryOperation.DefualtMotion); + internal GetLocationHandler movCenterOperation = new GetLocationHandler(GeometryOperation.DefualtMotion); internal GetLocationHandler movEndOperation = new GetLocationHandler(GeometryOperation.DefualtMotion); internal override int[] Indices => throw new NotImplementedException(); - public virtual vec3d MoveCenter(uint tick) => movCenterOperation.Invoke(tick); + public override Line[] GetAllSides() + { + throw new NotImplementedException(); + } - public virtual vec3d MovBegin(uint tick) => movBeginOperation.Invoke(tick); + public override Plain GetPlain() + { + return new Plain(this.center, this.beginPoint, this.endPoint); + } - public virtual vec3d MovEnd(uint tick) => movEndOperation.Invoke(tick); + public virtual vec3d MovBegin(uint tick) + { + return movBeginOperation.Invoke(tick); + } + + public virtual vec3d MoveCenter(uint tick) + { + return movCenterOperation.Invoke(tick); + } + + public virtual vec3d MovEnd(uint tick) + { + return movEndOperation.Invoke(tick); + } internal override void UpdateCoordinate(uint tick) { @@ -31,12 +82,5 @@ namespace StgSharp.Geometries endPoint.Position = this.coordinate.origin + MovEnd(tick); } - public override Line[] GetAllSides() => throw new NotImplementedException(); - - public override Plain GetPlain() - { - return new Plain(this.center, this.beginPoint, this.endPoint); - } - } } diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Circle.cs b/源代码/StgSharp/Geometries/PlainGeometry/Circle.cs index 9fc681b2..be9740c8 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Circle.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/Circle.cs @@ -1,4 +1,35 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Circle.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; namespace StgSharp.Geometries @@ -8,27 +39,42 @@ namespace StgSharp.Geometries /// public class Circle : PlainGeometry { + internal Point center; + internal GetLocationHandler movBeginOperation = new GetLocationHandler(GeometryOperation.DefualtMotion); + internal GetLocationHandler movCenterOperation = new GetLocationHandler(GeometryOperation.DefualtMotion); + internal GetLocationHandler movEndOperation = new GetLocationHandler(GeometryOperation.DefualtMotion); internal Point pointOnCircle; internal Point pointOnPlain; - internal GetLocationHandler movCenterOperation = new GetLocationHandler(GeometryOperation.DefualtMotion); - internal GetLocationHandler movBeginOperation = new GetLocationHandler(GeometryOperation.DefualtMotion); - internal GetLocationHandler movEndOperation = new GetLocationHandler(GeometryOperation.DefualtMotion); internal override int[] Indices => throw new NotImplementedException(); - public virtual vec3d MoveCenter(uint tick) => movCenterOperation.Invoke(tick); - - public virtual vec3d UpdateRadius(uint tick) => movBeginOperation.Invoke(tick); - - public virtual vec3d UpdatePlain(uint tick) => movEndOperation.Invoke(tick); + public override Line[] GetAllSides() + { + throw new NotImplementedException(); + } public override Plain GetPlain() { return new Plain(center, pointOnCircle, pointOnPlain); } + public virtual vec3d MoveCenter(uint tick) + { + return movCenterOperation.Invoke(tick); + } + + public virtual vec3d UpdatePlain(uint tick) + { + return movEndOperation.Invoke(tick); + } + + public virtual vec3d UpdateRadius(uint tick) + { + return movBeginOperation.Invoke(tick); + } + internal override void UpdateCoordinate(uint tick) { @@ -38,9 +84,5 @@ namespace StgSharp.Geometries pointOnPlain.Position = this.coordinate.origin + UpdatePlain(tick); } - public override Line[] GetAllSides() - { - throw new NotImplementedException(); - } } } diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Cordinate.cs b/源代码/StgSharp/Geometries/PlainGeometry/Cordinate.cs index 8a92f82b..71af9db3 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Cordinate.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/Cordinate.cs @@ -1,4 +1,35 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -12,30 +43,13 @@ namespace StgSharp.Geometries [StructLayout(LayoutKind.Sequential)] public struct PartialPlainCoordinate { + /// /// The origin of this coordinate. /// public vec3d origin; internal Matrix3x2 axis; - /// - /// The horizontial axis of the coordinate. - /// Point to the right direction. - /// - public vec3d axis_H - { - get { return axis.colum0; } - } - - /// - /// The vertical axis of the coordinate. - /// Point to the top direction. - /// - public vec3d axis_V - { - get { return axis.colum1; } - } - public PartialPlainCoordinate ( vec3d origin, @@ -52,6 +66,18 @@ namespace StgSharp.Geometries 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) { diff --git a/源代码/StgSharp/Geometries/PlainGeometry/ExpressionHandler.cs b/源代码/StgSharp/Geometries/PlainGeometry/ExpressionHandler.cs index d1dbc4bd..6d474910 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/ExpressionHandler.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/ExpressionHandler.cs @@ -1,4 +1,34 @@ -namespace StgSharp.Geometries +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="ExpressionHandler.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.Geometries { public delegate float ExpressionHandler ( diff --git a/源代码/StgSharp/Geometries/PlainGeometry/GemoryException.cs b/源代码/StgSharp/Geometries/PlainGeometry/GemoryException.cs index 06fc6c28..cea81165 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/GemoryException.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/GemoryException.cs @@ -1,10 +1,44 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="GemoryException.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.Serialization; namespace StgSharp.Geometries { public unsafe class ToUpperDimensionException : Exception { + + protected ToUpperDimensionException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } public ToUpperDimensionException() { } @@ -17,9 +51,6 @@ namespace StgSharp.Geometries { } - protected ToUpperDimensionException(SerializationInfo info, StreamingContext context) : base(info, context) - { - } } /// @@ -27,6 +58,10 @@ namespace StgSharp.Geometries /// public class UnusedVertexException : Exception { + + protected UnusedVertexException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } public UnusedVertexException() { } @@ -39,8 +74,5 @@ namespace StgSharp.Geometries { } - protected UnusedVertexException(SerializationInfo info, StreamingContext context) : base(info, context) - { - } } } diff --git a/源代码/StgSharp/Geometries/PlainGeometry/GeometryOperation.cs b/源代码/StgSharp/Geometries/PlainGeometry/GeometryOperation.cs index 104830a2..ce44d3a0 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/GeometryOperation.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/GeometryOperation.cs @@ -1,4 +1,34 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="GeometryOperation.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; namespace StgSharp.Geometries { @@ -11,10 +41,12 @@ namespace StgSharp.Geometries public static unsafe class GeometryOperation { + public static vec3d DefualtMotion(uint tick) { return default(vec3d); } + } } diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Line.cs b/源代码/StgSharp/Geometries/PlainGeometry/Line.cs index e69f38ca..7617f3df 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Line.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/Line.cs @@ -1,4 +1,35 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -6,24 +37,13 @@ namespace StgSharp.Geometries { public class Line : PlainGeometry { + internal Point basePoint; internal Point beginPoint; internal Point endPoint; internal GetLocationHandler movBegin; internal GetLocationHandler movEnd; - - internal override int[] Indices - { - get { throw new Exception(); } - } - - public Line(Point begin, Point end) - { - this.beginPoint = begin; - this.endPoint = end; - } - internal Line(Vector4 begin, Vector4 end) { beginPoint = new Point(begin); @@ -32,31 +52,15 @@ namespace StgSharp.Geometries public Line() { } - /// - /// 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(uint tick) - => movBegin.Invoke(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(uint tick) - => movEnd.Invoke(time); - - internal override void UpdateCoordinate(uint tick) + public Line(Point begin, Point end) { - beginPoint.Position = coordinate.origin + MoveBeginPoint(time); - endPoint.Position = coordinate.origin + MoveEndPoint(time); + this.beginPoint = begin; + this.endPoint = end; } + + internal override int[] Indices => throw new Exception(); + public override Line[] GetAllSides() { throw new NotImplementedException(); @@ -66,5 +70,35 @@ namespace StgSharp.Geometries { 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(uint tick) + { + return movBegin.Invoke(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(uint tick) + { + return movEnd.Invoke(time); + } + + internal override void UpdateCoordinate(uint tick) + { + beginPoint.Position = coordinate.origin + MoveBeginPoint(time); + endPoint.Position = coordinate.origin + MoveEndPoint(time); + } + } } diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Parallelogram.cs b/源代码/StgSharp/Geometries/PlainGeometry/Parallelogram.cs index ff984b61..c1fc129e 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Parallelogram.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/Parallelogram.cs @@ -1,19 +1,46 @@ -using StgSharp.Controlling; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Parallelogram.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.Controlling; using StgSharp.Math; namespace StgSharp.Geometries { public class Parallelogram : Polygon4 { + internal Point center; internal readonly GetLocationHandler movCenterOperation = new GetLocationHandler(GeometryOperation.DefualtMotion); - public GetLocationHandler MovCenterOperation { get { return movCenterOperation; } } - public GetLocationHandler MovVertex01Operation { get { return moveVertex0Operation; } } - public GetLocationHandler MovVertex02Operation { get { return moveVertex1Operation; } } - public Parallelogram( float v0x, float v0y, float v0z, float v1x, float v1y, float v1z, @@ -35,6 +62,10 @@ namespace StgSharp.Geometries } } + public GetLocationHandler MovCenterOperation => movCenterOperation; + public GetLocationHandler MovVertex01Operation => moveVertex0Operation; + public GetLocationHandler MovVertex02Operation => moveVertex1Operation; + public virtual vec3d MovCenter(uint tick) { return movCenterOperation.Invoke(tick); @@ -46,7 +77,7 @@ namespace StgSharp.Geometries /// Current time tick /// /// Geometry overdefined - public sealed override vec3d MoveVertex2(uint tick) + public override sealed vec3d MoveVertex2(uint tick) { throw new UnusedVertexException(); } @@ -57,12 +88,12 @@ namespace StgSharp.Geometries /// Current time tick /// /// Geometry overdefined - public sealed override vec3d MoveVertex3(uint tick) + public override sealed vec3d MoveVertex3(uint tick) { throw new UnusedVertexException(); } - internal sealed override void UpdateCoordinate(uint tick) + internal override sealed void UpdateCoordinate(uint tick) { } diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Plain.cs b/源代码/StgSharp/Geometries/PlainGeometry/Plain.cs index 51575b98..687fcc0f 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Plain.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/Plain.cs @@ -1,16 +1,48 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 vec1; - internal vec3d vec2; internal vec3d plainParameter; - internal readonly float d = -1; + internal vec3d vec1; + internal vec3d vec2; internal Plain(Vector4 origin, Vector4 p1, Vector4 p2) { @@ -23,11 +55,11 @@ namespace StgSharp.Geometries 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平面上的方向投影 + 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 = 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); @@ -44,11 +76,11 @@ namespace StgSharp.Geometries vec3d v2 = p3.Position - origin; - vec1 = v1 - v2 * (v1.Y / v2.Y); //计算平面在xz平面上的方向投影 - vec2 = v2 - vec1 * (v2.X / v1.X); //计算平面在yz平面上的方向投影 + 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 = 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); diff --git a/源代码/StgSharp/Geometries/PlainGeometry/PlainGeometry.cs b/源代码/StgSharp/Geometries/PlainGeometry/PlainGeometry.cs index 1abdcac8..9a82a8fb 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/PlainGeometry.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/PlainGeometry.cs @@ -1,4 +1,34 @@ -using StgSharp.Graphics; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; namespace StgSharp.Geometries @@ -8,34 +38,25 @@ namespace StgSharp.Geometries ///
public abstract class PlainGeometry { - protected TimeProvider time; + + protected TimeSpanProvider time; internal PartialPlainCoordinate coordinate; internal Matrix2x4 textureFrame; - public PartialPlainCoordinate ReferenceCoordinate + public PlainGeometry() { - get => this.coordinate; } /// /// Tick time this geometry eas crested /// - ///
public uint BornTime => time; + public PartialPlainCoordinate ReferenceCoordinate => this.coordinate; + internal abstract int[] Indices { get; } - public PlainGeometry(Form form) - { - time = new TimeProvider(form); - } - - public PlainGeometry() - { } - - internal abstract void UpdateCoordinate(uint tick); - /// /// Get all sides of this . /// @@ -48,6 +69,9 @@ namespace StgSharp.Geometries /// public abstract Plain GetPlain(); + + internal abstract void UpdateCoordinate(uint tick); + //public abstract Rectangle GetRenderFrame(); } } \ No newline at end of file diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Point.cs b/源代码/StgSharp/Geometries/PlainGeometry/Point.cs index 3052a69c..f6e66565 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Point.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/Point.cs @@ -1,4 +1,35 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Point.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.InteropServices; @@ -8,10 +39,9 @@ namespace StgSharp.Geometries { public unsafe class Point { - internal vec3d position; - internal readonly bool isVertex; - public Point() { } + internal readonly bool isVertex; + internal vec3d position; internal Point(vec3d p) { @@ -23,47 +53,40 @@ namespace StgSharp.Geometries position = new vec3d(vector); } + public Point() { } + public Point(float x, float y, float z) { position = new vec3d(x, y, z); } + + public bool IsVertex => isVertex; + public vec3d Position { - get { return position; } - set { position = value; } + get => position; + set => position = value; } public float X { - get { return position.X; } - set { position.X = value; } + get => position.X; + set => position.X = value; } public float Y { - get { return position.Y; } - set { position.Y = value; } + get => position.Y; + set => position.Y = value; } public float Z { - get { return position.Z; } - set { position.Z = value; } + get => position.Z; + set => position.Z = value; } - - public bool IsVertex => isVertex; - - - /// - /// 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) { } - public bool IsInGeometry(PlainGeometry geo) { throw new NotImplementedException(); @@ -75,6 +98,15 @@ namespace StgSharp.Geometries } + /// + /// 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/Geometries/PlainGeometry/Polygon4.cs b/源代码/StgSharp/Geometries/PlainGeometry/Polygon4.cs index 8a97199b..8028047c 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Polygon4.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/Polygon4.cs @@ -1,11 +1,43 @@ -using StgSharp.Controlling; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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.Controlling; using StgSharp.Math; + using System.Numerics; namespace StgSharp.Geometries { public class Polygon4 : PlainGeometry { + internal readonly GetLocationHandler moveVertex0Operation = new GetLocationHandler(GeometryOperation.DefualtMotion); internal readonly GetLocationHandler moveVertex1Operation = new GetLocationHandler(GeometryOperation.DefualtMotion); internal readonly GetLocationHandler moveVertex2Operation = new GetLocationHandler(GeometryOperation.DefualtMotion); @@ -61,50 +93,39 @@ namespace StgSharp.Geometries vertexMat.mat.colum3 = new Vector4(v3x, v3y, v3z, 0); } - public GetLocationHandler MovVertex0Operaion { get { return moveVertex0Operation; } } - public GetLocationHandler MovVertex1Operaion { get { return moveVertex1Operation; } } - public GetLocationHandler MovVertex2Operaion { get { return moveVertex2Operation; } } - public GetLocationHandler MovVertex3Operaion { get { return moveVertex3Operation; } } - - - - internal sealed override int[] Indices - { - get - { - return new int[6] { - 0,1,2, - 0,2,3}; - } - } - - public Mat4 VertexBuffer - { - get { return vertexMat.mat; } - } + public GetLocationHandler MovVertex0Operaion => moveVertex0Operation; + public GetLocationHandler MovVertex1Operaion => moveVertex1Operation; + public GetLocationHandler MovVertex2Operaion => moveVertex2Operation; + public GetLocationHandler MovVertex3Operaion => moveVertex3Operation; public Point Vertex0 { get => new Point(vertexMat.mat.colum0); - set { vertexMat.mat.colum0 = value.position.vec; } + set => vertexMat.mat.colum0 = value.position.vec; } public Point Vertex1 { get => new Point(vertexMat.mat.colum1); - set { vertexMat.mat.colum1 = value.position.vec; } + set => vertexMat.mat.colum1 = value.position.vec; } public Point Vertex2 { get => new Point(vertexMat.mat.colum2); - set { vertexMat.mat.colum1 = value.position.vec; } + set => vertexMat.mat.colum1 = value.position.vec; } + public Mat4 VertexBuffer => vertexMat.mat; + + + + internal override sealed int[] Indices => new int[6] { 0, 1, 2, 0, 2, 3 }; + internal Point Vertex3 { get => new Point(vertexMat.mat.colum3); - set { vertexMat.mat.colum1 = value.position.vec; } + set => vertexMat.mat.colum1 = value.position.vec; } @@ -131,21 +152,30 @@ namespace StgSharp.Geometries } public virtual vec3d MoveVertex0(uint tick) - => moveVertex0Operation(tick); + { + return moveVertex0Operation(tick); + } public virtual vec3d MoveVertex1(uint tick) - => moveVertex1Operation(tick); + { + return moveVertex1Operation(tick); + } public virtual vec3d MoveVertex2(uint tick) - => moveVertex2Operation(tick); + { + return moveVertex2Operation(tick); + } public virtual vec3d MoveVertex3(uint tick) - => moveVertex3Operation(tick); + { + return moveVertex3Operation(tick); + } internal override void UpdateCoordinate(uint tick) { } + } } diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Polygon5.cs b/源代码/StgSharp/Geometries/PlainGeometry/Polygon5.cs index f5df3e16..b0b684f7 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Polygon5.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/Polygon5.cs @@ -1,12 +1,44 @@ -using StgSharp.Controlling; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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.Controlling; using StgSharp.Math; using StgSharp.Math.Linear; + using System.Numerics; namespace StgSharp.Geometries { public unsafe class Polygon5 : PlainGeometry { + internal Point _refOrigin; internal GetLocationHandler movP01Operation = default; internal GetLocationHandler movP02Operation = default; @@ -35,57 +67,46 @@ namespace StgSharp.Geometries } - public GetLocationHandler MovP01Operation { get => movP01Operation; } - public GetLocationHandler MovP02Operation { get => movP02Operation; } - public GetLocationHandler MovP03Operation { get => movP03Operation; } - public GetLocationHandler MovP04Operation { get => movP04Operation; } - public GetLocationHandler MovP05Operation { get => movP05Operation; } - - public mat5 VertexBuffer - { - get { return vertexMat; } - } + public GetLocationHandler MovP01Operation => movP01Operation; + public GetLocationHandler MovP02Operation => movP02Operation; + public GetLocationHandler MovP03Operation => movP03Operation; + public GetLocationHandler MovP04Operation => movP04Operation; + public GetLocationHandler MovP05Operation => movP05Operation; public Point Vertex0 { get => new Point(vertexMat.vec0); - set { vertexMat.vec0 = value.position.vec; } + set => vertexMat.vec0 = value.position.vec; } public Point Vertex1 { get => new Point(vertexMat.vec1); - set { vertexMat.vec1 = value.position.vec; } + set => vertexMat.vec1 = value.position.vec; } public Point Vertex2 { get => new Point(vertexMat.vec2); - set { vertexMat.vec2 = value.position.vec; } + set => vertexMat.vec2 = value.position.vec; } public Point Vertex3 { get => new Point(vertexMat.vec3); - set { vertexMat.vec3 = value.position.vec; } + set => vertexMat.vec3 = value.position.vec; } public Point Vertex4 { get => new Point(vertexMat.vec4); - set { vertexMat.vec4 = value.position.vec; } + set => vertexMat.vec4 = value.position.vec; } - internal override int[] Indices - { - get - { - return new int[9]{ - 0,1,2, - 0,2,3, - 0,3,4}; - } - } + public mat5 VertexBuffer => vertexMat; + + internal override int[] Indices => new int[9] { 0, 1, 2, 0, 2, 3, 0, 3, 4 }; + public override Line[] GetAllSides() { return new Line[5] @@ -103,15 +124,30 @@ namespace StgSharp.Geometries return new Plain(Vertex0, Vertex1, Vertex2); } - public virtual vec3d movVertex01(uint tick) => movP01Operation.Invoke(time); + public virtual vec3d movVertex01(uint tick) + { + return movP01Operation.Invoke(time); + } - public virtual vec3d movVertex02(uint tick) => movP02Operation.Invoke(time); + public virtual vec3d movVertex02(uint tick) + { + return movP02Operation.Invoke(time); + } - public virtual vec3d movVertex03(uint tick) => movP03Operation.Invoke(time); + public virtual vec3d movVertex03(uint tick) + { + return movP03Operation.Invoke(time); + } - public virtual vec3d movVertex04(uint tick) => movP04Operation.Invoke(time); + public virtual vec3d movVertex04(uint tick) + { + return movP04Operation.Invoke(time); + } - public virtual vec3d movVertex05(uint tick) => movP05Operation.Invoke(time); + public virtual vec3d movVertex05(uint tick) + { + return movP05Operation.Invoke(time); + } internal override void UpdateCoordinate(uint tick) @@ -123,5 +159,6 @@ namespace StgSharp.Geometries vertexMat.vec3 = (coordinate.origin + movVertex04(nowTick)).vec; vertexMat.vec4 = (coordinate.origin + movVertex05(nowTick)).vec; } + } } diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Polygon6.cs b/源代码/StgSharp/Geometries/PlainGeometry/Polygon6.cs index bf61c719..926c3fd0 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Polygon6.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/Polygon6.cs @@ -1,4 +1,34 @@ -using StgSharp.Controlling; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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.Controlling; using StgSharp.Math; using StgSharp.Math.Linear; @@ -8,6 +38,7 @@ namespace StgSharp.Geometries { public class Polygon6 : PlainGeometry { + internal Point _refOrigin; internal GetLocationHandler movVertex0Operation; internal GetLocationHandler movVertex1Operation; @@ -17,61 +48,51 @@ namespace StgSharp.Geometries internal GetLocationHandler movVertex5Operation; internal mat6 vertexMat; - public GetLocationHandler MovVertex0Operation { get => movVertex0Operation; } - public GetLocationHandler MovVertex1Operation { get => movVertex1Operation; } - public GetLocationHandler MovVertex2Operation { get => movVertex2Operation; } - public GetLocationHandler MovVertex3Operation { get => movVertex3Operation; } - public GetLocationHandler MovVertex4Operation { get => movVertex4Operation; } - public GetLocationHandler MovVertex5Operation { get => movVertex5Operation; } - - internal override int[] Indices - { - get - { - return new int[12] { - 0,1,2, - 0,2,3, - 0,3,4, - 0,4,5}; - } - } + public GetLocationHandler MovVertex0Operation => movVertex0Operation; + public GetLocationHandler MovVertex1Operation => movVertex1Operation; + public GetLocationHandler MovVertex2Operation => movVertex2Operation; + public GetLocationHandler MovVertex3Operation => movVertex3Operation; + public GetLocationHandler MovVertex4Operation => movVertex4Operation; + public GetLocationHandler MovVertex5Operation => movVertex5Operation; public Point Vertex0 { get => new Point(vertexMat.vec0); - set { vertexMat.vec0 = value.position.vec; } + set => vertexMat.vec0 = value.position.vec; } public Point Vertex1 { get => new Point(vertexMat.vec1); - set { vertexMat.vec1 = value.position.vec; } + set => vertexMat.vec1 = value.position.vec; } public Point Vertex2 { get => new Point(vertexMat.vec2); - set { vertexMat.vec2 = value.position.vec; } + set => vertexMat.vec2 = value.position.vec; } public Point Vertex3 { get => new Point(vertexMat.vec3); - set { vertexMat.vec3 = value.position.vec; } + set => vertexMat.vec3 = value.position.vec; } public Point Vertex4 { get => new Point(vertexMat.vec4); - set { vertexMat.vec4 = value.position.vec; } + set => vertexMat.vec4 = value.position.vec; } public Point Vertex5 { get => new Point(vertexMat.vec5); - set { vertexMat.vec5 = value.position.vec; } + set => vertexMat.vec5 = value.position.vec; } + internal override int[] Indices => new int[12] { 0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5 }; + public override Line[] GetAllSides() { return new Line[6] @@ -131,5 +152,6 @@ namespace StgSharp.Geometries vertexMat.vec4 = origin + movVertex4(nowTick).vec; vertexMat.vec5 = origin + movVertex5(nowTick).vec; } + } } \ No newline at end of file diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Rectangle.cs b/源代码/StgSharp/Geometries/PlainGeometry/Rectangle.cs index 064648b7..e812738d 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Rectangle.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/Rectangle.cs @@ -1,10 +1,42 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 v0z, float v1x, float v1y, float v1z, @@ -30,7 +62,10 @@ namespace StgSharp.Geometries /// /// 当前游戏刻 /// - public virtual vec3d MovCenter(uint tick) => default(vec3d); + public virtual vec3d MovCenter(uint tick) + { + return default(vec3d); + } diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Square.cs b/源代码/StgSharp/Geometries/PlainGeometry/Square.cs index c8b11ff7..d65975f1 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Square.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/Square.cs @@ -1,4 +1,35 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Square.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 @@ -9,6 +40,7 @@ namespace StgSharp.Geometries /// public class Square : Rectangle { + public Square( float v0x, float v0y, float v0z, float v1x, float v1y, float v1z, @@ -21,7 +53,7 @@ namespace StgSharp.Geometries { } - public sealed override vec3d MoveVertex1(uint tick) + public override sealed vec3d MoveVertex1(uint tick) { return default; } diff --git a/源代码/StgSharp/Geometries/PlainGeometry/Triangle.cs b/源代码/StgSharp/Geometries/PlainGeometry/Triangle.cs index a3571829..071ecc2e 100644 --- a/源代码/StgSharp/Geometries/PlainGeometry/Triangle.cs +++ b/源代码/StgSharp/Geometries/PlainGeometry/Triangle.cs @@ -1,5 +1,36 @@ -using StgSharp.Controlling; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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.Controlling; using StgSharp.Math; + using System.Numerics; namespace StgSharp.Geometries @@ -46,15 +77,9 @@ namespace StgSharp.Geometries public GetLocationHandler MovVertex02Operation => this.movVertex02Opearion; public GetLocationHandler MovVertex03Operation => this.movVertex03Opearion; - public Mat3 VertexBuffer - { - get { return vertexMat.mat; } - } + public Mat3 VertexBuffer => vertexMat.mat; - internal sealed override int[] Indices - { - get { return new int[3] { 0, 1, 2 }; } - } + internal override sealed int[] Indices => new int[3] { 0, 1, 2 }; public override Line[] GetAllSides() { @@ -73,18 +98,28 @@ namespace StgSharp.Geometries return new Plain(this.vertexMat.mat.colum0, this.vertexMat.mat.colum1, this.vertexMat.mat.colum2); } - public virtual vec3d MovVertex01(uint tick) => movVertex01Opearion.Invoke(tick); + public virtual vec3d MovVertex01(uint tick) + { + return movVertex01Opearion.Invoke(tick); + } - public virtual vec3d MovVertex02(uint tick) => movVertex02Opearion.Invoke(tick); + public virtual vec3d MovVertex02(uint tick) + { + return movVertex02Opearion.Invoke(tick); + } - public virtual vec3d MovVertex03(uint tick) => movVertex03Opearion.Invoke(tick); + public virtual vec3d MovVertex03(uint tick) + { + return movVertex03Opearion.Invoke(tick); + } - internal sealed override void UpdateCoordinate(uint tick) + internal override sealed void UpdateCoordinate(uint tick) { tick = time; vertexMat.mat.colum0 = coordinate.origin.vec + MovVertex01(time).vec; vertexMat.mat.colum1 = coordinate.origin.vec + MovVertex02(time).vec; vertexMat.mat.colum2 = coordinate.origin.vec + MovVertex03(time).vec; } + } } diff --git a/源代码/StgSharp/Geometries/SpaceGeometry/Class1.cs b/源代码/StgSharp/Geometries/SpaceGeometry/Class1.cs index 01ae741d..26a650a2 100644 --- a/源代码/StgSharp/Geometries/SpaceGeometry/Class1.cs +++ b/源代码/StgSharp/Geometries/SpaceGeometry/Class1.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; diff --git a/源代码/StgSharp/Graphics/Define/StructDefine.cs b/源代码/StgSharp/Graphics/Define/StructDefine.cs index 7d313b47..41c8ebb2 100644 --- a/源代码/StgSharp/Graphics/Define/StructDefine.cs +++ b/源代码/StgSharp/Graphics/Define/StructDefine.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 System; using System.Runtime.InteropServices; /**/ @@ -16,6 +46,7 @@ namespace StgSharp.Graphics [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWcontext { + private int client; private int source; private int major, minor, revision; @@ -51,6 +82,7 @@ namespace StgSharp.Graphics internal struct egl { + /* EGLConfig config; EGLContext handle; @@ -60,16 +92,19 @@ namespace StgSharp.Graphics private void* handle; private void* surface; private void* client; + } internal struct osmesa { + //OSMesaContext handle; private void* handle; private int width; private int height; private void* buffer; + } // This is defined in platform.h @@ -79,6 +114,7 @@ namespace StgSharp.Graphics [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWvidmode { + /*! The width, in screen coordinates, of the video mode. */ public int width; @@ -97,11 +133,13 @@ namespace StgSharp.Graphics /*! The refresh rate, in Hz, of the video mode. */ private int refreshRate; + } [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWgammaramp { + /*! An array of value describing the response of the red channel. */ private ushort* red; @@ -114,11 +152,13 @@ namespace StgSharp.Graphics /*! The number of elements in each array. */ private uint size; + } [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWimage { + /*! The width, in pixels, of this image. */ private int width; @@ -128,11 +168,13 @@ namespace StgSharp.Graphics /*! 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 button](@ref gamepad_buttons), `GLFW_PRESS` * or `GLFW_RELEASE`. */ @@ -141,11 +183,13 @@ namespace StgSharp.Graphics * to 1.0 inclusive. */ public fixed float axes[6]; + } [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWallocator { + //GLFWallocatefun allocate; private IntPtr allocate; @@ -156,11 +200,13 @@ namespace StgSharp.Graphics private IntPtr deallocate; private void* user; + } [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWmonitor { + private byte[] name = new byte[128]; private void* userPointer; @@ -185,53 +231,116 @@ namespace StgSharp.Graphics public GLFWmonitor() { } + } [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWwindow { + //struct GLFWwindow* next in GLFW - public IntPtr next = IntPtr.Zero; + public GLFWwindow* next; - public bool resizable = false; - public bool decorated = false; - public bool autoIconify = false; - public bool floating = false; - public bool focusOnShow = false; - public bool mousePassthrough = false; - public bool shouldClose = false; - public void* userPointer = (void*)0; - public bool doublebuffer = false; - public GLFWvidmode videoMode = default; - public IntPtr monitor = IntPtr.Zero; //public GLFWmonitor* monitor; - public GLFWcursor* cursor = (GLFWcursor*)0; + private int resizable; + private int decorated; + private int autoIconify; + private int floating; + private int focusOnShow; + private int mousePassthrough; + internal int shouldClose; + private void* userPointer = (void*)0; + private bool doubleBuffer; + private GLFWvidmode videoMode = default; + private IntPtr monitor = IntPtr.Zero; //public GLFWmonitor* monitor; + private GLFWcursor* cursor = (GLFWcursor*)0; - public int minwidth = 0, minheight = 0; - public int maxwidth = 0, maxheight = 0; - public int numer = 0, denom = 0; - - public bool stickyKeys = false; - public bool stickyMouseButtons = false; - public bool lockKeyMods = false; - public int cursorMode = 0; - public fixed byte mouseButtons[8]; - public fixed byte keys[349]; + private int minWidth = 0, minHeight = 0; + private int maxWidth = 0, maxHeight = 0; + private int numer = 0, denom = 0; + private int stickyKeys; + private int stickyMouseButtons; + private int lockKeyMods; + private int cursorMode = 0; + private fixed byte mouseButtons[8]; + private fixed byte keys[349]; // Virtual cursor position when cursor is disabled public double virtualCursorPosX = 0, virtualCursorPosY = 0; - - public bool rawMouseMotion = false; + private int rawMouseMotion; public GLFWcontext context = default; + private fixed long callBacks[17]; + public GLFWwindow() { } + + public bool AutoIconify + { + get => autoIconify != 0; + set => autoIconify = value ? 1 : 0; + } + public bool Decorated + { + get => decorated != 0; + set => decorated = value ? 1 : 0; + } + public bool Floating + { + get => floating != 0; + set => floating = value ? 1 : 0; + } + public bool FocusOnShow + { + get => focusOnShow != 0; + set => focusOnShow = value ? 1 : 0; + } + public bool LockKeyMods + { + get => lockKeyMods != 0; + set => lockKeyMods = value ? 1 : 0; + } + public bool MousePassThrough + { + get => mousePassthrough != 0; + set => mousePassthrough = value ? 1 : 0; + } + public bool RawMouseMotion { get => rawMouseMotion != 0; set => rawMouseMotion = value ? 1 : 0; } + public bool Resizable + { + get => resizable != 0; + set => resizable = value ? 1 : 0; + } + public bool ShouldClose + { + get => shouldClose != 0; + set => shouldClose = value ? 1 : 0; + } + + public bool StickyKey + { + get => stickyKeys != 0; + set => stickyKeys = value ? 1 : 0; + } + public bool StickyMouseButtons + { + get => stickyMouseButtons != 0; + set => stickyMouseButtons = value ? 1 : 0; + } + + } + + [StructLayout(LayoutKind.Sequential)] + public struct GLFWwindowCallback + { + } [StructLayout(LayoutKind.Sequential)] public struct GLFWcursor { + //GLFWcursor* next; private IntPtr next; @@ -259,6 +368,7 @@ namespace StgSharp.Graphics [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWinitconfig { + private GLFWbool hatButtons; private int angleType; private int platformID; @@ -266,26 +376,12 @@ namespace StgSharp.Graphics //PFN_vkGetInstanceProcAddr vulkanLoader; private IntPtr vulkanLoader; - private struct ns - { - private GLFWbool menubar; - private GLFWbool chdir; - } - - private struct x11 - { - private GLFWbool xcbVulkanSurface; - } - - private struct wl - { - private int libdecorMode; - } } [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWwndconfig { + private int xpos; private int ypos; private int width; @@ -303,56 +399,66 @@ namespace StgSharp.Graphics private GLFWbool mousePassthrough; private GLFWbool scaleToMonitor; - internal struct Ns - { - private GLFWbool retina = false; - public fixed byte frameName[256]; - - public Ns() - { - } - } - internal Ns ns = new Ns(); - internal struct X11 - { - public fixed byte className[256]; - public fixed byte instanceName[256]; - - public X11() - { - } - } - internal X11 x11 = new X11(); - internal struct Win32 - { - private GLFWbool keymenu; - } - internal Win32 win32 = new Win32(); - internal struct Wl - { - public fixed byte appId[256]; - - public Wl() - { - } - } - internal Wl wl = new Wl(); 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 int source; private int major; @@ -367,21 +473,25 @@ namespace StgSharp.Graphics //GLFWwindow* share; private IntPtr share; - internal struct Nsgl - { - private GLFWbool offline; - } - internal Nsgl nsgl = new Nsgl(); public GLFWctxconfig() { } + + internal struct Nsgl + { + + private GLFWbool offline; + + } + } [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWfbconfig { + private int redBits; private int greenBits; private int blueBits; @@ -399,25 +509,18 @@ namespace StgSharp.Graphics private GLFWbool doublebuffer; private GLFWbool transparent; private uintptr_t handle; + } [StructLayout(LayoutKind.Sequential)] internal unsafe struct GLFWlibrary { + private GLFWbool initialized; private GLFWallocator allocator; private GLFWplatform platform; - internal unsafe struct Hints - { - private GLFWinitconfig init; - private GLFWfbconfig framebuffer; - private GLFWwndconfig window; - private GLFWctxconfig context; - private int refreshRate; - } - internal Hints hints = new Hints(); //GLFWerror* errorListHead; @@ -448,8 +551,30 @@ namespace StgSharp.Graphics private GLFWls contextSlot; private GLFWmutex errorLock; + internal Egl egl = new Egl(); + + internal Osmesa osmesa = new Osmesa(); + + internal Callbacks callbacks = new Callbacks(); + + public GLFWlibrary() + { + } + + internal unsafe struct Hints + { + + private GLFWinitconfig init; + private GLFWfbconfig framebuffer; + private GLFWwndconfig window; + private GLFWctxconfig context; + private int refreshRate; + + } + internal unsafe struct timer { + private ulong offset; // This is defined in platform.h @@ -459,6 +584,7 @@ namespace StgSharp.Graphics internal unsafe struct Egl { + internal int platform; internal void* display; internal int major, minor; @@ -466,7 +592,7 @@ namespace StgSharp.Graphics internal bool KHR_create_context; internal bool KHR_create_context_no_error; - internal bool KHR_colorspace; + internal bool KHR_colorSpace; internal bool KHR_get_all_proc_addresses; internal bool KHR_context_flush_control; internal bool EXT_client_extensions; @@ -501,12 +627,12 @@ namespace StgSharp.Graphics internal IntPtr GetPlatformDisplayEXT; internal IntPtr CreatePlatformWindowSurfaceEXT; - } - internal Egl egl = new Egl(); + } internal unsafe struct Osmesa { + private void* handle; private IntPtr CreateContextExt; @@ -516,12 +642,12 @@ namespace StgSharp.Graphics private IntPtr GetColorBuffer; private IntPtr GetDepthBuffer; private IntPtr GetProcAddress; - } - internal Osmesa osmesa = new Osmesa(); + } internal unsafe struct vk { + private GLFWbool available; private void* handle; private fixed ulong extensions[2]; @@ -537,33 +663,34 @@ namespace StgSharp.Graphics public vk() { } + } internal unsafe struct Callbacks { + private IntPtr monitor; private IntPtr joystick; + } - internal Callbacks callbacks = new Callbacks(); - - public GLFWlibrary() - { - } } [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWmapelement { + private byte type; private byte index; private sbyte axisScale; private sbyte axisOffset; + } [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWmapping { + private fixed byte name[128]; private fixed byte guid[33]; @@ -575,11 +702,13 @@ namespace StgSharp.Graphics public GLFWmapping() { } + } [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWjoystick { + private GLFWbool allocated; private GLFWbool connected; private float* axes; @@ -601,6 +730,7 @@ namespace StgSharp.Graphics public GLFWjoystick() { } + } [StructLayout(LayoutKind.Sequential)] @@ -614,6 +744,7 @@ namespace StgSharp.Graphics [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWplatform { + private int platformID; // init @@ -623,73 +754,75 @@ namespace StgSharp.Graphics //void (* terminate) (void); private IntPtr terminate; - // input + #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*); - GLFWvidmode* (* getVideoModes) (GLFWmonitor*, int*); - void (* getVideoMode) (GLFWmonitor*, GLFWvidmode*); - GLFWbool(*getGammaRamp)(GLFWmonitor*, GLFWgammaramp*); - void (* setGammaRamp) (GLFWmonitor*,const GLFWgammaramp*); + 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*); + GLFWvidmode* (* getVideoModes) (GLFWmonitor*, int*); + void (* getVideoMode) (GLFWmonitor*, GLFWvidmode*); + 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 (* 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); + 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 setCursorMode; internal IntPtr setRawMouseMotion; @@ -776,6 +909,7 @@ namespace StgSharp.Graphics internal IntPtr VkPhysicalDevice; internal IntPtr GLFWwindow; + } [StructLayout(LayoutKind.Sequential)] @@ -790,12 +924,14 @@ namespace StgSharp.Graphics [StructLayout(LayoutKind.Sequential)] internal unsafe struct VkExtensionProperties { + private fixed byte extensionName[256]; private uint specVersion; public VkExtensionProperties() { } + } /* @@ -816,11 +952,13 @@ namespace StgSharp.Graphics [StructLayout(LayoutKind.Explicit, Size = 16)] public struct uintptr_t { + [FieldOffset(0)] private long part1; [FieldOffset(8)] private long part2; + } #endregion GLFW3 struct diff --git a/源代码/StgSharp/Graphics/Define/glApiDefine.cs b/源代码/StgSharp/Graphics/Define/glApiDefine.cs index 58c4ee34..4e1c5c31 100644 --- a/源代码/StgSharp/Graphics/Define/glApiDefine.cs +++ b/源代码/StgSharp/Graphics/Define/glApiDefine.cs @@ -1,4 +1,34 @@ -/* +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 @@ -7,12 +37,19 @@ 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 serching its name. /// @@ -143,12 +180,6 @@ namespace StgSharp.Graphics //[UnmanagedFunctionPointer(callingConvention: CallingConvention.Cdecl, CharSet = CharSet.Ansi)] internal unsafe delegate VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window, VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); - #endregion - - #region StgSharpDele - - public unsafe delegate void FrameBufferSizeHandler(IntPtr window, uint width, uint height); - #endregion #region glDEBUG diff --git a/源代码/StgSharp/Graphics/Define/glConst.cs b/源代码/StgSharp/Graphics/Define/glConst.cs index dc7445ab..4220656f 100644 --- a/源代码/StgSharp/Graphics/Define/glConst.cs +++ b/源代码/StgSharp/Graphics/Define/glConst.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; namespace StgSharp.Graphics { @@ -22,10 +52,10 @@ namespace StgSharp.Graphics internal const int GLFW_HAT_RIGHT = 2; internal const int GLFW_HAT_DOWN = 4; internal const int GLFW_HAT_LEFT = 8; - internal const int GLFW_HAT_RIGHT_UP = (GLFW_HAT_RIGHT | GLFW_HAT_UP); - internal const int GLFW_HAT_RIGHT_DOWN = (GLFW_HAT_RIGHT | GLFW_HAT_DOWN); - internal const int GLFW_HAT_LEFT_UP = (GLFW_HAT_LEFT | GLFW_HAT_UP); - internal const int GLFW_HAT_LEFT_DOWN = (GLFW_HAT_LEFT | GLFW_HAT_DOWN); + internal const int GLFW_HAT_RIGHT_UP = GLFW_HAT_RIGHT | GLFW_HAT_UP; + internal const int GLFW_HAT_RIGHT_DOWN = GLFW_HAT_RIGHT | GLFW_HAT_DOWN; + internal const int GLFW_HAT_LEFT_UP = GLFW_HAT_LEFT | GLFW_HAT_UP; + internal const int GLFW_HAT_LEFT_DOWN = GLFW_HAT_LEFT | GLFW_HAT_DOWN; internal const int GLFW_KEY_UNKNOWN = -1; internal const int GLFW_KEY_SPACE = 32; internal const int GLFW_KEY_APOSTROPHE = 39; diff --git a/源代码/StgSharp/Graphics/Define/glEnum.cs b/源代码/StgSharp/Graphics/Define/glEnum.cs index 8df4cfff..39c7a0f2 100644 --- a/源代码/StgSharp/Graphics/Define/glEnum.cs +++ b/源代码/StgSharp/Graphics/Define/glEnum.cs @@ -1,4 +1,34 @@ -namespace StgSharp.Graphics +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 { internal enum VkStructureType : uint { diff --git a/源代码/StgSharp/Graphics/Define/glType.cs b/源代码/StgSharp/Graphics/Define/glType.cs index b55f3108..c7824910 100644 --- a/源代码/StgSharp/Graphics/Define/glType.cs +++ b/源代码/StgSharp/Graphics/Define/glType.cs @@ -1,4 +1,35 @@ -using StgSharp.Geometries; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -9,35 +40,10 @@ using System.Text; namespace StgSharp.Graphics { + public delegate IntPtr GLfuncLoader(string name); + internal delegate void GLVULKANPROCNV(); - #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 - public unsafe struct GLhandleARB { @@ -80,6 +86,32 @@ namespace StgSharp.Graphics } - public delegate IntPtr GLfuncLoader(string name); + #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/源代码/StgSharp/Graphics/Form.cs b/源代码/StgSharp/Graphics/Form.cs index ba6230b8..50f23e6e 100644 --- a/源代码/StgSharp/Graphics/Form.cs +++ b/源代码/StgSharp/Graphics/Form.cs @@ -1,20 +1,41 @@ -using StgSharp; -using StgSharp.Controlling; -using StgSharp.Logic; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Form.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.Concurrent; using System.Collections.Generic; -using System.Diagnostics; -using System.IO; using System.Linq; using System.Numerics; -using System.Reflection; -using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using System.Security.Principal; using System.Text; using System.Threading; @@ -23,52 +44,45 @@ namespace StgSharp.Graphics /// /// /// - public abstract partial class Form + public abstract unsafe partial class Form { #region metadata - internal LinkedList allControl; internal Vector4 backgroundColor; internal IglFunc gl; - internal unsafe IntPtr graphicContextID; + internal IntPtr graphicContextID; internal int height; internal IntPtr monitor; internal string name; internal Form sharedForm; internal int width; - internal IntPtr windowID; - - protected readonly TimeProvider FrameTimeFrocider; + private GLFWwindow* windowID; + internal TimeSpanProvider frameTimeProvider; #endregion metadata - #region form thread setting - - private bool isSingleThread = true; - - #endregion form thread setting - #region glapicount - private int missingAPIcount = 0; private int problemAPIcount = 0; - #endregion glapicount + #region form main + + + #region form thread setting + private bool isSingleThread = true; + #endregion form thread setting + - private int _shouldClose = 0; protected Form() { } /// - /// OpenGL package used by current form context. + /// OpenGL package binded to current form context. + /// A OpenGL context is only binded to current form. /// - public IglFunc GL - { - get => gl; - internal set => gl = value; - } + public IglFunc GL => gl; /// /// Height of this form, represent in @@ -82,24 +96,13 @@ namespace StgSharp.Graphics /// /// Representing /// - public bool IsDoubleRendering - { - get { return isSingleThread; } - } + public bool IsDoubleRendering => isSingleThread; public bool ShouldClose { - get - { - Interlocked.Exchange(ref _shouldClose, InternalIO.glfwWindowShouldClose(windowID)); - return 0 != _shouldClose; - } + get => InternalIO.glfwWindowShouldClose(windowID) != 0; - set - { - InternalIO.glfwSetWindowShouldClose(windowID, value ? 1 : 0); - Interlocked.Exchange(ref _shouldClose, value ? 1 : 0); - } + set => InternalIO.glfwSetWindowShouldClose(windowID, value ? 1 : 0); } /// @@ -107,7 +110,7 @@ namespace StgSharp.Graphics /// public Vec2d Size { - get { return new Vec2d(width, height); } + get => new Vec2d(width, height); set { width = (int)value.X; @@ -124,10 +127,9 @@ namespace StgSharp.Graphics set => width = value; } - internal bool IsSingleThread - { - get { return isSingleThread; } - } + public unsafe IntPtr WindowID => (IntPtr)windowID; + + internal unsafe GLFWwindow* id => windowID; protected FrameBufferSizeHandler FrameBufferSizeCallback { @@ -138,12 +140,15 @@ namespace StgSharp.Graphics } } + internal bool IsSingleThread => isSingleThread; + /// - /// 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. + /// 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. + /// + /// Something goes wrong and StgSharp fails in creating a new OpenGL context. + /// public unsafe void MakeAsCurrentContext() { if (windowID == default) @@ -152,21 +157,19 @@ namespace StgSharp.Graphics byte[] tittleBytes = Encoding.UTF8.GetBytes(name); if (sharedForm == null) { - windowPtr = InternalIO.glfwCreateWindow( - width, height, tittleBytes, monitor, IntPtr.Zero); + windowPtr = InternalIO.glfwCreateWindow(width, height, tittleBytes, monitor, (GLFWwindow*)IntPtr.Zero); } else { - windowPtr = InternalIO.glfwCreateWindow( - width, height, tittleBytes, monitor, sharedForm.windowID); + windowPtr = InternalIO.glfwCreateWindow(width, height, tittleBytes, monitor, sharedForm.windowID); } - if ((long)windowPtr == -1 || (long)windowPtr == -2) + if (((long)windowPtr == -1) || ((long)windowPtr == -2)) { throw new Exception("Cannot create window instance!"); } else { - windowID = windowPtr; + windowID = (GLFWwindow*)windowPtr; } graphicContextID = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(GLcontext))); @@ -191,18 +194,6 @@ namespace StgSharp.Graphics this.monitor = monitor; } - /// - /// Resize the current form - /// - /// New width of the window - /// New height of the window - public void SetSize(int width, int height) - { - this.Width = width; - this.Height = height; - InternalIO.glfwSetWindowSize(this.windowID, width, height); - } - /// /// Resize the current form /// @@ -217,18 +208,15 @@ namespace StgSharp.Graphics } /// - /// Set the size limit of current form + /// Resize the current form /// - /// Minimum width of current form - /// Minimum height of current form - /// Maximum width of curent form - /// Maximum height of current form - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetSizeLimit(int minWidth, int minHeight, int maxWidth, int maxHeight) + /// New width of the window + /// New height of the window + public void SetSize(int width, int height) { - InternalIO.glfwSetWindowSizeLimits( - this.windowID, - minWidth, minHeight, maxWidth, maxHeight); + this.Width = width; + this.Height = height; + InternalIO.glfwSetWindowSize(this.windowID, width, height); } /// @@ -245,19 +233,26 @@ namespace StgSharp.Graphics { InternalIO.glfwSetWindowSizeLimits( this.windowID, - (int)minSize.X, (int)minSize.Y, (int)maxSize.X, (int)maxSize.Y); + (int)minSize.X, + (int)minSize.Y, + (int)maxSize.X, + (int)maxSize.Y); } - unsafe ~Form() - { - Marshal.FreeHGlobal(graphicContextID); - } + /// + /// Set the size limit of current form + /// + /// Minimum width of current form + /// Minimum height of current form + /// Maximum width of curent form + /// Maximum height of current form + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetSizeLimit(int minWidth, int minHeight, int maxWidth, int maxHeight) + { InternalIO.glfwSetWindowSizeLimits(this.windowID, minWidth, minHeight, maxWidth, maxHeight); } - #region form main + unsafe ~Form() { Marshal.FreeHGlobal(graphicContextID); } - private static unsafe delegate* pollEventPtr = &InternalIO.glfwPollEvents; - private static unsafe delegate* swapBufferPtr = &InternalSwapBuffers; public abstract void Deinit(params object[] args); @@ -268,22 +263,14 @@ namespace StgSharp.Graphics public abstract void Init(params object[] args); /// - /// Behaviour of current form when in a render cycle. - /// When this form + /// Behaviour of current form when in a render cycle. When this form /// /// public abstract void Main(params object[] args); public unsafe void PollEvents() { - if (isSingleThread) - { - InternalIO.glfwPollEvents(); - } - else - { - gl.frameworkHandleEnqueue((IntPtr)pollEventPtr); - } + InternalIO.glfwPollEvents(); } /// @@ -303,61 +290,49 @@ namespace StgSharp.Graphics { Main(args); SwapBuffers(); + PollEvents(); } } else { GLonUpdate update = new GLonUpdate((GLcontext*)graphicContextID); - FrameThread renderThread = new FrameThread(update); - FrameThread updateThread = new FrameThread(update); - renderThread.SetNext(updateThread); - updateThread.SetNext(renderThread); + FrameAsyncTask renderTask = new FrameAsyncTask(update); + FrameAsyncTask updateTask = new FrameAsyncTask(update); gl = update; - int a = 0; while (!ShouldClose) { + renderTask.StartAsync(); + updateTask.StartAsync(); + FrameAsyncTask.CombineAsync(renderTask, updateTask); + SwapBuffers(); + PollEvents(); } //TODO 对逻辑线程和渲染线程进行同步,两种gl模式包需要改名字 } } } - internal static unsafe void InternalSwapBuffers() + internal static unsafe void InternalSwapBuffers(FrameOperationBuffer operationBuffer, GLcontext* context) { - IntPtr winHandle = default; - InternalIO.glfwSwapBuffers(winHandle); + IntPtr window = default; + operationBuffer.TryDequeue(out window); + InternalIO.glfwSwapBuffers((GLFWwindow*)window); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void InternalDeinit(params object[] args) - { - Deinit(args); - } + internal void InternalDeinit(params object[] args) { Deinit(args); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void InternalInit(params object[] args) - { - Init(args); - } - internal unsafe void SwapBuffers() { - if (isSingleThread) - { - InternalIO.glfwSwapBuffers(windowID); - } - else - { - M128 m = new M128(); - m.Write(0, (ulong)windowID); - gl.frameworkHandleEnqueue((IntPtr)swapBufferPtr, m); - } + InternalIO.glfwSwapBuffers(windowID); } /// /// Get OpenGL library of this form's context. /// - /// A package contains all opengl APIs + /// A package contains all opengl APIs protected IglFunc GetGL() { if (StgSharp.API == GraphicAPI.GL) @@ -366,7 +341,9 @@ namespace StgSharp.Graphics } else { - InternalIO.InternalWriteLog("Attempt to get OpenGL API package in other graphic envitronment.", LogType.Error); + InternalIO.InternalWriteLog( + "Attempt to get OpenGL API package in other graphic envitronment.", + LogType.Error); throw new InvalidOperationException("Attempt to get OpenGL API package in other graphic envitronment."); } } @@ -396,7 +373,8 @@ namespace StgSharp.Graphics throw new ArgumentException("Amount of threads should be bigger than 0"); } } - #endregion form main + + } } \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/FrameThread.cs b/源代码/StgSharp/Graphics/FrameAsyncTask.cs similarity index 82% rename from 源代码/StgSharp/Graphics/FrameThread.cs rename to 源代码/StgSharp/Graphics/FrameAsyncTask.cs index a0652029..a9a0e019 100644 --- a/源代码/StgSharp/Graphics/FrameThread.cs +++ b/源代码/StgSharp/Graphics/FrameAsyncTask.cs @@ -1,11 +1,39 @@ -using StgSharp.Logic; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="FrameAsyncTask.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.Runtime.CompilerServices; +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; @@ -14,9 +42,10 @@ namespace StgSharp.Graphics { internal sealed class FrameOperationBuffer { - private readonly unsafe GLcontext* currentContext; + private IntPtr _func; private ConcurrentQueue _funcQueue; + private readonly unsafe GLcontext* currentContext; public unsafe bool CallNext() { @@ -451,50 +480,52 @@ namespace StgSharp.Graphics /**/ #endregion gl param queue + } - internal sealed class FrameThread + //TODO 任务组绑定机制有问题,现在一次只能绑定两个 + //TODO 目前还不能加载任何任务 + //TODO 任务的启动逻辑需要重构 + + internal class FrameAsyncTask { - private Thread _thread; - private FrameOperationBuffer renderBuffer; - private SemaphoreSlim renderCompleteSemaphore = new SemaphoreSlim(1, 1); - private SemaphoreSlim renderStartSemaphore; - private bool shouldTerminate; - private FrameOperationBuffer updateBuffer; - internal FrameThread(GLonUpdate gl) + private SemaphoreSlim _refrshSemaphore; + private SemaphoreSlim _frameCompleteSemaphore; + private Task _task; + private FrameOperationBuffer opBuffer = new FrameOperationBuffer(); + + internal FrameAsyncTask(GLonUpdate gl) { - updateBuffer = gl.ActivatedOperationBuffer; - _thread = new Thread(new ThreadStart(PrivateMain)); } - public bool IsRunning + public static void ExchangeBuffer(FrameAsyncTask task0, FrameAsyncTask task1) { - get { return _thread.IsAlive; } + FrameOperationBuffer cache = task0.opBuffer; + task0.opBuffer = task1.opBuffer; + task1.opBuffer = cache; } - public void Start() + public async Task StartAsync() { - _thread.Start(); + _task.Start(); + await _task; } - public void Terminate() + public static SemaphoreSlim CombineAsync(FrameAsyncTask task0, FrameAsyncTask task1) { - shouldTerminate = true; + SemaphoreSlim refresh = new SemaphoreSlim(2); + task0._refrshSemaphore = refresh; + task1._refrshSemaphore = refresh; + return refresh; + } + public static SemaphoreSlim AsyncWait(FrameAsyncTask task0, FrameAsyncTask task1) + { + SemaphoreSlim refresh = new SemaphoreSlim(2); + task0._refrshSemaphore = refresh; + task1._refrshSemaphore = refresh; + return refresh; } - private void PrivateMain() - { - renderStartSemaphore.Wait(); - while (shouldTerminate && renderBuffer.CallNext()) - { } - renderCompleteSemaphore.Release(); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetNext(FrameThread thread) - { - renderStartSemaphore = thread.renderCompleteSemaphore; - } } } \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/GL/Buffer/BufferObjectBase.cs b/源代码/StgSharp/Graphics/GL/Buffer/BufferObjectBase.cs index 18f5c18e..5184df94 100644 --- a/源代码/StgSharp/Graphics/GL/Buffer/BufferObjectBase.cs +++ b/源代码/StgSharp/Graphics/GL/Buffer/BufferObjectBase.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -11,6 +41,7 @@ namespace StgSharp.Graphics /// public abstract class BufferObjectBase : IDisposable { + protected glHandleSet _bufferHandle; protected IglFunc GL; @@ -19,10 +50,7 @@ namespace StgSharp.Graphics /// /// /// - public glHandle this[int index] - { - get { return _bufferHandle[index]; } - } + public glHandle this[int index] => _bufferHandle[index]; /// /// Bind a buffer instance to OpenGL @@ -30,6 +58,12 @@ namespace StgSharp.Graphics /// 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() { @@ -43,10 +77,5 @@ namespace StgSharp.Graphics Dispose(disposing: false); } - public void Dispose() - { - Dispose(disposing: true); - GC.SuppressFinalize(this); - } } } diff --git a/源代码/StgSharp/Graphics/GL/Buffer/EBO.cs b/源代码/StgSharp/Graphics/GL/Buffer/EBO.cs index da5828ca..727941b2 100644 --- a/源代码/StgSharp/Graphics/GL/Buffer/EBO.cs +++ b/源代码/StgSharp/Graphics/GL/Buffer/EBO.cs @@ -1,4 +1,34 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="EBO.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; @@ -15,6 +45,7 @@ namespace StgSharp.Graphics /// public unsafe class ElementBuffer : BufferObjectBase { + internal ElementBuffer(int n, IglFunc gl) { GL = gl; @@ -41,5 +72,6 @@ namespace StgSharp.Graphics _bufferHandle.Release(); } } + } } \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/GL/Buffer/VAO.cs b/源代码/StgSharp/Graphics/GL/Buffer/VAO.cs index f52fe76c..b83d11db 100644 --- a/源代码/StgSharp/Graphics/GL/Buffer/VAO.cs +++ b/源代码/StgSharp/Graphics/GL/Buffer/VAO.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -7,6 +37,7 @@ namespace StgSharp.Graphics { public unsafe class VertexArray : BufferObjectBase { + internal VertexArray(int n, IglFunc gl) { GL = gl; @@ -42,5 +73,6 @@ namespace StgSharp.Graphics _bufferHandle.Release(); } } + } } \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/GL/Buffer/VBO.cs b/源代码/StgSharp/Graphics/GL/Buffer/VBO.cs index d82636b6..9749e38a 100644 --- a/源代码/StgSharp/Graphics/GL/Buffer/VBO.cs +++ b/源代码/StgSharp/Graphics/GL/Buffer/VBO.cs @@ -1,4 +1,34 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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.Math; using System; using System.Collections.Generic; @@ -12,6 +42,7 @@ namespace StgSharp.Graphics { public unsafe class VertexBuffer : BufferObjectBase { + internal VertexBuffer(int n, IglFunc glFunc) { GL = glFunc; @@ -72,5 +103,6 @@ namespace StgSharp.Graphics _bufferHandle.Release(); } } + } } \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/GL/Buffer/texture.cs b/源代码/StgSharp/Graphics/GL/Buffer/texture.cs index 7c705812..26157577 100644 --- a/源代码/StgSharp/Graphics/GL/Buffer/texture.cs +++ b/源代码/StgSharp/Graphics/GL/Buffer/texture.cs @@ -1,4 +1,34 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="texture.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; @@ -12,10 +42,11 @@ namespace StgSharp.Graphics { public unsafe class Texture { + internal static bool[] unitActivated = new bool[16]; + private IglFunc GL; internal glHandleSet _textureHandle; internal Image[] sourceList; - private IglFunc GL; internal Texture(int n, IglFunc gl) { @@ -96,6 +127,7 @@ namespace StgSharp.Graphics } #endregion texture setting + } public enum Filter diff --git a/源代码/StgSharp/Graphics/GL/GLhandle.cs b/源代码/StgSharp/Graphics/GL/GLhandle.cs index 69b3790d..4e15c23a 100644 --- a/源代码/StgSharp/Graphics/GL/GLhandle.cs +++ b/源代码/StgSharp/Graphics/GL/GLhandle.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -18,12 +48,14 @@ namespace StgSharp.Graphics /// public unsafe struct glHandle { + internal glHandleSet source; internal uint* valuePtr; - [Obsolete("Cannot init instance of this type", true)] - public glHandle() + private glHandle(IntPtr handle) { + this.valuePtr = (uint*)handle; + source = null; } internal glHandle(uint* val, glHandleSet set) @@ -32,15 +64,9 @@ namespace StgSharp.Graphics valuePtr = val; } - private glHandle(IntPtr handle) + [Obsolete("Cannot init instance of this type", true)] + public glHandle() { - this.valuePtr = (uint*)handle; - source = null; - } - - public static glHandle Zero - { - get { return Alloc(0); } } public IntPtr Handle @@ -75,13 +101,9 @@ namespace StgSharp.Graphics } } - internal uint DirectValue - { - get - { - return *valuePtr; - } - } + public static glHandle Zero => Alloc(0); + + internal uint DirectValue => *valuePtr; public static glHandle Alloc(uint value) { @@ -97,10 +119,12 @@ namespace StgSharp.Graphics { return new glHandle(handle); } + } public unsafe struct glSHandle { + internal glHandleSet source; internal int* valuePtr; @@ -110,29 +134,25 @@ namespace StgSharp.Graphics valuePtr = val; } - public static glSHandle Zero - { - get { return Alloc(0); } - } + public static glSHandle Zero => Alloc(0); - internal int DirectValue - { - get { return *valuePtr; } - } + internal int DirectValue => *valuePtr; public static glSHandle Alloc(int value) { glSHandle ret = default; ret.source = new glHandleSet(1); ret.valuePtr = (int*)ret.source.handle; - *ret.valuePtr = (int)value; + *ret.valuePtr = value; return ret; } + } //TODO 发现一个大问题,paramQueue大多数时候取出的是数组,不是数组句柄,也就是说其内存将被长期固定且不能回收,这是内存泄漏 public unsafe class glArrayHandle { + internal readonly Array a; internal GCHandle handle; @@ -142,20 +162,6 @@ namespace StgSharp.Graphics handle = GCHandle.Alloc(array, GCHandleType.Pinned); } - [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); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static glArrayHandle Alloc(T[] array) where T : struct - { - return new glArrayHandle(array); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public IntPtr AddressOfArray() { @@ -169,11 +175,26 @@ namespace StgSharp.Graphics } } + [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; } + } /// @@ -181,9 +202,10 @@ namespace StgSharp.Graphics /// public unsafe class glHandleSet { + + private readonly uint[] _value; internal uint* handle; internal int length; - private readonly uint[] _value; public glHandleSet(int count) { @@ -212,13 +234,13 @@ namespace StgSharp.Graphics { throw new IndexOutOfRangeException(); } - return new glSHandle((int*)handle + index, this); + return new glSHandle(((int*)handle) + index, this); } } public static void Copy(in glHandleSet source, glHandleSet target) { - if (source == null || target == null) + if ((source == null) || (target == null)) { throw new NullReferenceException(); } @@ -279,5 +301,6 @@ namespace StgSharp.Graphics { _value[index] = value; } + } } \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/GL/GLonRender.cs b/源代码/StgSharp/Graphics/GL/GLonRender.cs index a58167fd..34f9175c 100644 --- a/源代码/StgSharp/Graphics/GL/GLonRender.cs +++ b/源代码/StgSharp/Graphics/GL/GLonRender.cs @@ -1,4 +1,34 @@ -using StgSharp.Logic; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="GLonRender.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; @@ -12,23 +42,15 @@ namespace StgSharp.Graphics { internal unsafe partial class GLonRender : IglFunc { - internal GLcontext* api; + private FrameTimeoutException refreshSIgnal = new FrameTimeoutException(); + internal GLcontext* api; internal GLonRender(GLcontext* context) { api = context; } - GLcontext* IglFunc.Context - { - get => api; - } - - void IglFunc.SwitchContext() - { - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] void IglFunc.ActiveTexture(uint type) { @@ -87,35 +109,6 @@ namespace StgSharp.Graphics while (api->glGetError() != 0) { } } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - unsafe void IglFunc.LoadShaderSource(glHandle shaderHandle, string codeStream) - { - byte[] stream = Encoding.UTF8.GetBytes(codeStream); - fixed (byte* streamPtr = stream) - { - api->glShaderSource(shaderHandle.DirectValue, 1, &streamPtr, (void*)0); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - glHandleSet IglFunc.CreateShaderSet(int count, ShaderType type) - { - glHandleSet ret = new glHandleSet(count); - uint t = (uint)type; - for (int i = 0; i < count; i++) - { - uint id = api->glCreateShader(t); - if (id == 0) - { - uint error = api->glGetError(); - InternalIO.InternalWriteLog($"Failed in creating shader: {error}", LogType.Error); - throw new Exception(); - } - ret.SetValue(i, id); - } - return ret; - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] void IglFunc.CompileShader(glHandle shaderhandle) { @@ -139,6 +132,25 @@ namespace StgSharp.Graphics return h; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + glHandleSet IglFunc.CreateShaderSet(int count, ShaderType type) + { + glHandleSet ret = new glHandleSet(count); + uint t = (uint)type; + for (int i = 0; i < count; i++) + { + uint id = api->glCreateShader(t); + if (id == 0) + { + uint error = api->glGetError(); + InternalIO.InternalWriteLog($"Failed in creating shader: {error}", LogType.Error); + throw new Exception(); + } + ret.SetValue(i, id); + } + return ret; + } + unsafe IntPtr IglFunc.CreateWindowHandle( int width, int height, string tittle, IntPtr monitor, Form share) { @@ -147,15 +159,15 @@ namespace StgSharp.Graphics if (share == null) { windowPtr = InternalIO.glfwCreateWindow( - width, height, tittleBytes, monitor, IntPtr.Zero); + width, height, tittleBytes, monitor, (GLFWwindow*)IntPtr.Zero); } else { windowPtr = InternalIO.glfwCreateWindow( - width, height, tittleBytes, monitor, share.windowID); + width, height, tittleBytes, monitor, share.id); } - if ((long)windowPtr == -1 || (long)windowPtr == -2) + if (((long)windowPtr == -1) || ((long)windowPtr == -2)) { throw new Exception("Cannot create window instance!"); } @@ -180,14 +192,14 @@ namespace StgSharp.Graphics [MethodImpl(MethodImplOptions.AggressiveInlining)] unsafe void IglFunc.DeleteBuffers(glHandleSet handle) { - api->glDeleteBuffers((uint)handle.length, (uint*)handle.handle); + api->glDeleteBuffers((uint)handle.length, handle.handle); handle.Free(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] unsafe void IglFunc.DeleteVertexArrays(glHandleSet arrays) { - api->glDeleteVertexArrays((uint)arrays.length, (uint*)arrays.handle); + api->glDeleteVertexArrays((uint)arrays.length, arrays.handle); arrays.Free(); } @@ -211,18 +223,22 @@ namespace StgSharp.Graphics default: InternalIO.InternalWriteLog( - $"Parameter error in parameter {nameof(type)} method DrawElements. " + - $"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are suporrted.", + $"{($"Parameter error in parameter {nameof(type)} method DrawElements. ")}{($"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are suporrted.")}", LogType.Error); return; } api->glDrawElements((uint)mode, count, a, (void*)ptr); } + void IglFunc.frameworkHandleEnqueue(System.IntPtr handle, params M128[] param) + { + throw new InvalidOperationException(); + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] unsafe glHandleSet IglFunc.GenBuffers(int count) { - glHandleSet h = new glHandleSet((int)count); + glHandleSet h = new glHandleSet(count); api->glGenBuffers((uint)count, h.handle); return h; } @@ -230,7 +246,7 @@ namespace StgSharp.Graphics [MethodImpl(MethodImplOptions.AggressiveInlining)] unsafe glHandleSet IglFunc.GenTextures(int count) { - glHandleSet h = new glHandleSet((int)count); + glHandleSet h = new glHandleSet(count); api->glGenTextures((uint)count, h.handle); return h; } @@ -256,18 +272,28 @@ namespace StgSharp.Graphics [MethodImpl(MethodImplOptions.AggressiveInlining)] unsafe bool IglFunc.GetWindowShouldClose(Form form) { - return InternalIO.glfwWindowShouldClose(form.windowID) == 0; + return InternalIO.glfwWindowShouldClose(form.id) == 0; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + unsafe void IglFunc.LoadShaderSource(glHandle shaderHandle, string codeStream) + { + byte[] stream = Encoding.UTF8.GetBytes(codeStream); + fixed (byte* streamPtr = stream) + { + api->glShaderSource(shaderHandle.DirectValue, 1, &streamPtr, (void*)0); + } } [MethodImpl(MethodImplOptions.AggressiveInlining)] unsafe void IglFunc.MakeContexCurrent(Form form) { - if (form.windowID == IntPtr.Zero) + if (form.WindowID == IntPtr.Zero) { InternalIO.InternalWriteLog($"From {nameof(form)} is not initted.", LogType.Warning); return; } - InternalIO.glfwMakeContextCurrent(form.windowID); + InternalIO.glfwMakeContextCurrent(form.id); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -290,11 +316,13 @@ namespace StgSharp.Graphics return; } fixed (void* bufferPtr = bufferArray) + { api->glBufferData( - (uint)bufferType, - (IntPtr)size, - (IntPtr)bufferPtr, - (uint)usage); + (uint)bufferType, + (IntPtr)size, + (IntPtr)bufferPtr, + (uint)usage); + } } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -305,6 +333,10 @@ namespace StgSharp.Graphics api->glEnableVertexAttribArray(index); } + void IglFunc.SwitchContext() + { + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] void IglFunc.TextureImage2d(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, glHandle pixels) { @@ -331,9 +363,8 @@ namespace StgSharp.Graphics api->glViewport(x, y, width, height); } - void IglFunc.frameworkHandleEnqueue(System.IntPtr handle, params M128[] param) - { - throw new InvalidOperationException(); - } + GLcontext* IglFunc.Context +=> api; + } } \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/GL/GLonUpdate.cs b/源代码/StgSharp/Graphics/GL/GLonUpdate.cs index 0383d599..adafb6c5 100644 --- a/源代码/StgSharp/Graphics/GL/GLonUpdate.cs +++ b/源代码/StgSharp/Graphics/GL/GLonUpdate.cs @@ -1,4 +1,34 @@ -using StgSharp.Logic; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="GLonUpdate.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; @@ -15,10 +45,10 @@ namespace StgSharp.Graphics { internal unsafe partial class GLonUpdate : IglFunc { + private GLcontext* api; - private IntPtr SwapBufferPtr = (IntPtr)(delegate*)&InternalIO.glfwSwapBuffers; - private glSHandle unupdatedFrame = glSHandle.Alloc(0); private FrameOperationBuffer frameOpBuffer; + private glSHandle unupdatedFrame = glSHandle.Alloc(0); internal GLonUpdate(GLcontext* context) { @@ -29,15 +59,19 @@ namespace StgSharp.Graphics api = context; } - GLcontext* IglFunc.Context - { - get => api; - } - public FrameOperationBuffer ActivatedOperationBuffer { - get { return frameOpBuffer; } - set { frameOpBuffer = value; } + get => frameOpBuffer; + set => frameOpBuffer = value; + } + + public void GLswapBuffers(Form form) + { + if (form.WindowID == IntPtr.Zero) + { + return; + } + InternalIO.glfwSwapBuffers(form.id); } void IglFunc.ActiveTexture(uint type) @@ -77,7 +111,7 @@ namespace StgSharp.Graphics void IglFunc.BindTexture(uint type, glHandle texture) { M128 m = default; - m.Write(0, (uint)type); + m.Write(0, type); m.Write(1, (ulong)texture.valuePtr); frameOpBuffer.ParamEnqueue(m); frameOpBuffer.MethodEnqueue(BindTexturePtr); @@ -156,15 +190,15 @@ namespace StgSharp.Graphics if (share == null) { windowPtr = InternalIO.glfwCreateWindow( - width, height, tittleBytes, monitor, IntPtr.Zero); + width, height, tittleBytes, monitor, (GLFWwindow*)IntPtr.Zero); } else { windowPtr = InternalIO.glfwCreateWindow( - width, height, tittleBytes, monitor, share.windowID); + width, height, tittleBytes, monitor, share.id); } - if ((long)windowPtr == -1 || (long)windowPtr == -2) + if (((long)windowPtr == -1) || ((long)windowPtr == -2)) { throw new Exception("Cannot create window instance!"); } @@ -229,8 +263,7 @@ namespace StgSharp.Graphics default: InternalIO.InternalWriteLog( - $"Parameter error in parameter {type} method DrawElements. " + - $"Only {TypeCode.Byte}, {TypeCode.UInt16}, {TypeCode.UInt32} types are suporrted.", + $"{($"Parameter error in parameter {type} method DrawElements. ")}{($"Only {TypeCode.Byte}, {TypeCode.UInt16}, {TypeCode.UInt32} types are suporrted.")}", LogType.Error); return; } @@ -239,6 +272,16 @@ namespace StgSharp.Graphics frameOpBuffer.MethodEnqueue(DrawElementsPtr); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + void IglFunc.frameworkHandleEnqueue(IntPtr methodHandle, params M128[] param) + { + foreach (M128 item in param) + { + frameOpBuffer.ParamEnqueue(item); + } + frameOpBuffer.ParamEnqueue(methodHandle); + } + unsafe glHandleSet IglFunc.GenBuffers(int count) { glHandleSet h = new glHandleSet(count); @@ -282,16 +325,7 @@ namespace StgSharp.Graphics [MethodImpl(MethodImplOptions.AggressiveInlining)] bool IglFunc.GetWindowShouldClose(Form form) { - return InternalIO.glfwWindowShouldClose(form.windowID) == 0; - } - - public void GLswapBuffers(Form form) - { - if (form.windowID == IntPtr.Zero) - { - return; - } - InternalIO.glfwSwapBuffers(form.windowID); + return InternalIO.glfwWindowShouldClose(form.id) == 0; } void IglFunc.LoadShaderSource(glHandle shaderHandle, string codeStream) @@ -304,11 +338,11 @@ namespace StgSharp.Graphics [MethodImpl(MethodImplOptions.AggressiveInlining)] void IglFunc.MakeContexCurrent(Form form) { - if (form.windowID == IntPtr.Zero) + if (form.WindowID == IntPtr.Zero) { return; } - InternalIO.glfwMakeContextCurrent(form.windowID); + InternalIO.glfwMakeContextCurrent(form.id); } void IglFunc.SetBufferData(BufferType bufferType, T bufferData, BufferUsage usage) @@ -370,14 +404,8 @@ namespace StgSharp.Graphics frameOpBuffer.MethodEnqueue(ViewPortPtr); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - void IglFunc.frameworkHandleEnqueue(IntPtr methodHandle, params M128[] param) - { - foreach (M128 item in param) - { - frameOpBuffer.ParamEnqueue(item); - } - frameOpBuffer.ParamEnqueue(methodHandle); - } + GLcontext* IglFunc.Context +=> api; + } } \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/GL/GLonUpdateInternal.cs b/源代码/StgSharp/Graphics/GL/GLonUpdateInternal.cs index deb4590b..ca8050cc 100644 --- a/源代码/StgSharp/Graphics/GL/GLonUpdateInternal.cs +++ b/源代码/StgSharp/Graphics/GL/GLonUpdateInternal.cs @@ -1,28 +1,49 @@ -using StgSharp.Logic; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="GLonUpdateInternal.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.Concurrent; -using System.Collections.Generic; using System.Linq; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading; -using System.Threading.Tasks; namespace StgSharp.Graphics { internal unsafe partial class GLonUpdate : IglFunc { + private IntPtr ActiveTexturePtr = (IntPtr)(delegate*)&InternalActiveTexture; private IntPtr AttachShaderPtr = (IntPtr)(delegate*)&InternalAttachShader; private IntPtr BindBufferPtr = (IntPtr)(delegate*)&InternalBindBuffer; private IntPtr BindTexturePtr = (IntPtr)(delegate*)&InternalBindTexture; private IntPtr BindVertexArrayPtr = (IntPtr)(delegate*)&InternalBindVertexArray; private IntPtr BufferDataPtr = (IntPtr)(delegate*)&InternalSetBufferData; - private IntPtr CanUpdatePtr = (IntPtr)(delegate*)&InternalFrameCanUpdate; private IntPtr ClearColorPtr = (IntPtr)(delegate*)&InternalClearColor; private IntPtr ClearGraphicErrorPtr = (IntPtr)(delegate*)&InternalClearGraphicError; private IntPtr ClearPtr = (IntPtr)(delegate*)&InternalClear; @@ -35,7 +56,6 @@ namespace StgSharp.Graphics private IntPtr DrawElementsPtr = (IntPtr)(delegate*)&InternalDrawElements; private IntPtr GenBufferPtr = (IntPtr)(delegate*)&InternalGenBuffers; private IntPtr GenTexturesPtr = (IntPtr)(delegate*)&InternalGenTextures; - private IntPtr GenVertexArraysPtr = (IntPtr)(delegate*)&InternalGenVertexArrays; private IntPtr GetUniformLocationPtr = (IntPtr)(delegate*)&InternalGetUniformLocation; private IntPtr SetVertexArrayPtr = (IntPtr)(delegate*)&InternalSetVertexAttribute; private IntPtr ShaderSourcePtr = (IntPtr)(delegate*)&InternalShaderSource; @@ -147,7 +167,7 @@ namespace StgSharp.Graphics activatedContext->glDeleteBuffers(m.Read(2), (uint*)m.Read(0)); for (int i = 0; i < m.Read(2); i++) { - *((uint*)m.Read(0) + i) = 0; + *(((uint*)m.Read(0)) + i) = 0; } } @@ -167,13 +187,6 @@ namespace StgSharp.Graphics activatedContext->glDrawElements(mode, count, type, (void*)ptr); } - private static void InternalFrameCanUpdate(FrameOperationBuffer frameBuffer, GLcontext* activatedContext) - { - IntPtr ptr; - frameBuffer.TryDequeue(out ptr); - Interlocked.Add(ref *(int*)ptr, -1); - } - private static void InternalGenBuffers(FrameOperationBuffer frameBuffer, GLcontext* activatedContext) { M128 m = default; @@ -188,13 +201,6 @@ namespace StgSharp.Graphics activatedContext->glGenTextures(m.Read(2), (uint*)m.Read(0)); } - private static void InternalGenVertexArrays(FrameOperationBuffer frameBuffer, GLcontext* activatedContext) - { - M128 m = default; - frameBuffer.TryDequeue(out m); - activatedContext->glGenVertexArrays(m.Read(2), (uint*)m.Read(0)); - } - private static void InternalGetUniformLocation(FrameOperationBuffer frameBuffer, GLcontext* activatedContext) { IntPtr programHandle = default, nameHandle = default, targetHandle = default; @@ -265,14 +271,5 @@ namespace StgSharp.Graphics activatedContext->glViewport(m.Read(0), m.Read(1), m.Read(2), m.Read(3)); } - private void InternalMakeContexCurrent(Form form) - { - throw new NotImplementedException(); - } - - private void InternalSwitchContext() - { - throw new NotImplementedException(); - } } } \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/GL/GLresourceGenrator.cs b/源代码/StgSharp/Graphics/GL/GLresourceGenrator.cs index 8986ad3e..e658725b 100644 --- a/源代码/StgSharp/Graphics/GL/GLresourceGenrator.cs +++ b/源代码/StgSharp/Graphics/GL/GLresourceGenrator.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -9,6 +39,7 @@ namespace StgSharp.Graphics { public partial class Form { + /// /// Create a set of . /// @@ -20,17 +51,6 @@ namespace StgSharp.Graphics return new ElementBuffer(count, this.gl); } - /// - /// Create a set of . - /// - /// Amount of VAO to be crated. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected VertexArray CreateVertexArray(int count) - { - return new VertexArray(count, gl); - } - /// /// Create a sets of /// @@ -42,6 +62,17 @@ namespace StgSharp.Graphics return new Texture(count, this.GL); } + /// + /// Create a set of . + /// + /// Amount of VAO to be crated. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected VertexArray CreateVertexArray(int count) + { + return new VertexArray(count, gl); + } + /// /// Create aset of . /// @@ -52,5 +83,6 @@ namespace StgSharp.Graphics { return new VertexBuffer(count, gl); } + } } \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/GL/ShaderEdit/Shader.cs b/源代码/StgSharp/Graphics/GL/ShaderEdit/Shader.cs index f64de134..242cad2e 100644 --- a/源代码/StgSharp/Graphics/GL/ShaderEdit/Shader.cs +++ b/源代码/StgSharp/Graphics/GL/ShaderEdit/Shader.cs @@ -1,4 +1,34 @@ -using StgSharp; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 System; using System.Collections.Generic; @@ -10,6 +40,12 @@ namespace StgSharp.Graphics { public partial class Form { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected Shader CreateShader(ShaderType type, int count) + { + return new Shader(this.gl, gl.CreateShaderSet(count, type), type); + } /// /// Create an instance of program /// @@ -20,18 +56,14 @@ namespace StgSharp.Graphics return new ShaderProgram(GL); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected Shader CreateShader(ShaderType type, int count) - { - return new Shader(this.gl, gl.CreateShaderSet(count, type), type); - } } public class Shader { + + private readonly IglFunc GL; internal readonly glHandleSet handle; public readonly ShaderType type; - private readonly IglFunc GL; internal Shader(IglFunc gl, glHandleSet handle, ShaderType usage) { @@ -40,17 +72,6 @@ namespace StgSharp.Graphics type = usage; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void Compile(int index, string code) - { - if (code == null) - { - throw new ArgumentNullException("Must provide enough code"); - } - GL.LoadShaderSource(handle[index], code + '\0'); - GL.CompileShader(handle[index]); - } - //TODO:写链接着色器的文档注释 /// /// @@ -63,16 +84,29 @@ namespace StgSharp.Graphics GL.AttachShader(target.handle, handle[index]); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void Compile(int index, string code) + { + if (code == null) + { + throw new ArgumentNullException("Must provide enough code"); + } + GL.LoadShaderSource(handle[index], $"{code}\0"); + GL.CompileShader(handle[index]); + } + public override string ToString() { return $"This is a {type} shader, its shader handles are {handle.ToString()}."; } + } public class ShaderProgram { - internal readonly glHandle handle; + private readonly IglFunc GL; + internal readonly glHandle handle; /// /// Inti a shader with no program attached. @@ -83,29 +117,6 @@ namespace StgSharp.Graphics handle = GL.CreateProgram(); } - /// - /// Link the shader to current context. - /// - public unsafe void Link() - { - if (InternalIO.InternalLinkShaderProgram(GL.Context, 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", ""); - InternalIO.InternalWriteLog(log, LogType.Error); - } - catch (Exception ex) - { - InternalIO.InternalWriteLog(ex.Message, LogType.Error); - } - } - } - /// /// Get a uniform form current shader, /// the value type of the uniform should be provided. @@ -145,6 +156,29 @@ namespace StgSharp.Graphics return new Uniform(this, name, GL); } + /// + /// Link the shader to current context. + /// + public unsafe void Link() + { + if (InternalIO.InternalLinkShaderProgram(GL.Context, 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. /// @@ -153,5 +187,6 @@ namespace StgSharp.Graphics { GL.UseProgram(handle); } + } } \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/GL/ShaderEdit/ShaderGenerator.cs b/源代码/StgSharp/Graphics/GL/ShaderEdit/ShaderGenerator.cs index b94eecb1..c90ed187 100644 --- a/源代码/StgSharp/Graphics/GL/ShaderEdit/ShaderGenerator.cs +++ b/源代码/StgSharp/Graphics/GL/ShaderEdit/ShaderGenerator.cs @@ -1,4 +1,34 @@ -using StgSharp.Graphics; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="ShaderGenerator.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; @@ -11,6 +41,7 @@ namespace StgSharp.Graphics.GL.ShaderEdit { public class ShaderGenerator { + private List codeList; private List usedShaderFunctions; @@ -18,19 +49,18 @@ namespace StgSharp.Graphics.GL.ShaderEdit { throw new NotImplementedException(); } + } public class ShaderFunction { - private string name; + private List codeList; private List inputList; + private string name; private ShaderParameter outPut; - public int ParameterCount - { - get { return inputList.Count; } - } + public int ParameterCount => inputList.Count; public void EmitCall(ShaderFunction function, ShaderParameter outPut, params ShaderParameter[] inputParams) { @@ -52,7 +82,7 @@ namespace StgSharp.Graphics.GL.ShaderEdit throw new Exception("Provided parameters does not match function's parameter list."); } } - string codeLine = ""; // adding a line like " outvalue = Func(input1, input2,...); " + string codeLine = string.Empty; // adding a line like " outvalue = Func(input1, input2,...); " if (outPut != ShaderParameter.Void) { codeLine += $"{outPut.name} = "; @@ -65,13 +95,16 @@ namespace StgSharp.Graphics.GL.ShaderEdit codeLine += ");\n"; codeList.Add(codeLine); } + } public class ShaderParameter { - internal readonly InternalShaderType type; - internal readonly string name; + + public static readonly ShaderParameter Void = new ShaderParameter(string.Empty, InternalShaderType.Void); internal readonly bool isReadOnly; + internal readonly string name; + internal readonly InternalShaderType type; public ShaderParameter(string name, InternalShaderType type) { @@ -80,8 +113,6 @@ namespace StgSharp.Graphics.GL.ShaderEdit isReadOnly = false; } - public static readonly ShaderParameter Void = new ShaderParameter("", InternalShaderType.Void); - public static bool IsSameType(ShaderParameter param1, ShaderParameter param2) { if (param1.type != InternalShaderType.Struct) @@ -93,6 +124,7 @@ namespace StgSharp.Graphics.GL.ShaderEdit throw new Exception("Struct is currently not supported."); } } + } public enum InternalShaderType diff --git a/源代码/StgSharp/Graphics/GL/ShaderEdit/Uniform.cs b/源代码/StgSharp/Graphics/GL/ShaderEdit/Uniform.cs index a78c9bf9..d1af2049 100644 --- a/源代码/StgSharp/Graphics/GL/ShaderEdit/Uniform.cs +++ b/源代码/StgSharp/Graphics/GL/ShaderEdit/Uniform.cs @@ -1,4 +1,34 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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.Math; using System; using System.Collections.Generic; @@ -11,8 +41,14 @@ namespace StgSharp.Graphics { public class Uniform where T : struct { - internal glSHandle id; + private IglFunc GL; + internal glSHandle id; + + internal unsafe Uniform(glSHandle id) + { + this.id = id; + } internal unsafe Uniform( ShaderProgram program, string name, IglFunc gl) @@ -21,18 +57,20 @@ namespace StgSharp.Graphics id = GL.GetUniformLocation(program.handle, name); } - internal unsafe Uniform(glSHandle id) - { - this.id = id; - } } public class Uniform where T : struct where U : struct { - internal glSHandle id; + private IglFunc GL; + internal glSHandle id; + + internal unsafe Uniform(glSHandle id) + { + this.id = id; + } internal unsafe Uniform( ShaderProgram program, string name, IglFunc gl) @@ -41,10 +79,6 @@ namespace StgSharp.Graphics id = GL.GetUniformLocation(program.handle, name); } - internal unsafe Uniform(glSHandle id) - { - this.id = id; - } } public class Uniform @@ -52,8 +86,14 @@ namespace StgSharp.Graphics where U : struct where V : struct { - internal glSHandle id; + private IglFunc GL; + internal glSHandle id; + + internal unsafe Uniform(glSHandle id) + { + this.id = id; + } public unsafe Uniform(ShaderProgram program, string name, IglFunc gl) { @@ -61,10 +101,6 @@ namespace StgSharp.Graphics id = GL.GetUniformLocation(program.handle, name); } - internal unsafe Uniform(glSHandle id) - { - this.id = id; - } } public class Uniform @@ -73,8 +109,14 @@ namespace StgSharp.Graphics where V : struct where W : struct { - internal glSHandle id; + private IglFunc GL; + internal glSHandle id; + + internal unsafe Uniform(glSHandle id) + { + this.id = id; + } internal unsafe Uniform(ShaderProgram program, string name, IglFunc gl) { @@ -82,14 +124,23 @@ namespace StgSharp.Graphics id = GL.GetUniformLocation(program.handle, name); } - internal unsafe Uniform(glSHandle id) - { - this.id = id; - } } internal partial class GLonRender : IglFunc { + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void SetValue(Uniform uniform, Vec4d vec) + { + api->glUniform1fv(uniform.id.DirectValue, 4, &vec); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe void SetValue(Uniform uniform, Vec4d vec) + { + api->glUniform1fv(uniform.id.DirectValue, 4, &vec); + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] unsafe void IglFunc.SetValue(Uniform uniform, float v0) { @@ -120,21 +171,11 @@ namespace StgSharp.Graphics api->glUniform4f(uniform.id.DirectValue, v0, v1, v2, v3); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void SetValue(Uniform uniform, Vec4d vec) - { - api->glUniform1fv(uniform.id.DirectValue, 4, &vec); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe void SetValue(Uniform uniform, Vec4d vec) - { - api->glUniform1fv(uniform.id.DirectValue, 4, &vec); - } } internal unsafe partial class GLonUpdate { + private IntPtr UniformVal1fPtr = (IntPtr)(delegate*)&UniformVal1f; private IntPtr UniformVal1fvPtr = (IntPtr)(delegate*)&UniformVal1fv; private IntPtr UniformVal1iPtr = (IntPtr)(delegate*)&UniformVal1i; @@ -142,6 +183,53 @@ namespace StgSharp.Graphics private IntPtr UniformVal3fPtr = (IntPtr)(delegate*)&UniformVal3f; private IntPtr UniformVal4fPtr = (IntPtr)(delegate*)&UniformVal4f; + private static void UniformVal1f(FrameOperationBuffer frameOpBuffer, GLcontext* activatedContext) + { + M128 m = default; + frameOpBuffer.TryDequeue(out m); + activatedContext->glUniform1f(*(int*)m.Read(0), m.Read(2)); + } + + private static unsafe void UniformVal1fv(FrameOperationBuffer frameOpBuffer, GLcontext* activatedContext) + { + M128 m = default, v = default; + frameOpBuffer.TryDequeue(out m); + frameOpBuffer.TryDequeue(out v); + activatedContext->glUniform1fv(*(int*)m.Read(0), 4, (Vec4d*)&v); + } + + private static void UniformVal1i(FrameOperationBuffer frameOpBuffer, GLcontext* activatedContext) + { + M128 m = default; + frameOpBuffer.TryDequeue(out m); + activatedContext->glUniform1i(*(int*)m.Read(0), m.Read(2)); + } + + private static void UniformVal2f(FrameOperationBuffer frameOpBuffer, GLcontext* activatedContext) + { + M128 m = default; + frameOpBuffer.TryDequeue(out m); + activatedContext->glUniform2f(*(int*)m.Read(0), m.Read(2), m.Read(3)); + } + + private static void UniformVal3f(FrameOperationBuffer frameOpBuffer, GLcontext* activatedContext) + { + IntPtr handle = IntPtr.Zero; + M128 m = default; + frameOpBuffer.TryDequeue(out handle); + frameOpBuffer.TryDequeue(out m); + activatedContext->glUniform3f(*(int*)handle, m.Read(0), m.Read(1), m.Read(2)); + } + + private static void UniformVal4f(FrameOperationBuffer frameOpBuffer, GLcontext* activatedContext) + { + IntPtr handle = IntPtr.Zero; + M128 m = default; + frameOpBuffer.TryDequeue(out handle); + frameOpBuffer.TryDequeue(out m); + activatedContext->glUniform4f(*(int*)handle, m.Read(0), m.Read(1), m.Read(2), m.Read(3)); + } + unsafe void IglFunc.SetValue(Uniform uniform, float f0, float f1, float f2) { frameOpBuffer.ParamEnqueue((IntPtr)uniform.id.valuePtr); @@ -194,55 +282,9 @@ namespace StgSharp.Graphics unsafe void IglFunc.SetValue(Uniform uniform, Vec4d vec) { Vec4d m = vec; - frameOpBuffer.ParamEnqueue((IntPtr)uniform.id.valuePtr, (IntPtr)(Vec4d*)&m); + frameOpBuffer.ParamEnqueue((IntPtr)uniform.id.valuePtr, (IntPtr)(&m)); frameOpBuffer.MethodEnqueue(UniformVal1fvPtr); } - private static void UniformVal1f(FrameOperationBuffer frameOpBuffer, GLcontext* activatedContext) - { - M128 m = default; - frameOpBuffer.TryDequeue(out m); - activatedContext->glUniform1f(*(int*)m.Read(0), m.Read(2)); - } - - private static unsafe void UniformVal1fv(FrameOperationBuffer frameOpBuffer, GLcontext* activatedContext) - { - M128 m = default, v = default; - frameOpBuffer.TryDequeue(out m); - frameOpBuffer.TryDequeue(out v); - activatedContext->glUniform1fv(*(int*)m.Read(0), 4, (Vec4d*)&v); - } - - private static void UniformVal1i(FrameOperationBuffer frameOpBuffer, GLcontext* activatedContext) - { - M128 m = default; - frameOpBuffer.TryDequeue(out m); - activatedContext->glUniform1i(*(int*)m.Read(0), m.Read(2)); - } - - private static void UniformVal2f(FrameOperationBuffer frameOpBuffer, GLcontext* activatedContext) - { - M128 m = default; - frameOpBuffer.TryDequeue(out m); - activatedContext->glUniform2f(*(int*)m.Read(0), m.Read(2), m.Read(3)); - } - - private static void UniformVal3f(FrameOperationBuffer frameOpBuffer, GLcontext* activatedContext) - { - IntPtr handle = IntPtr.Zero; - M128 m = default; - frameOpBuffer.TryDequeue(out handle); - frameOpBuffer.TryDequeue(out m); - activatedContext->glUniform3f(*(int*)handle, m.Read(0), m.Read(1), m.Read(2)); - } - - private static void UniformVal4f(FrameOperationBuffer frameOpBuffer, GLcontext* activatedContext) - { - IntPtr handle = IntPtr.Zero; - M128 m = default; - frameOpBuffer.TryDequeue(out handle); - frameOpBuffer.TryDequeue(out m); - activatedContext->glUniform4f(*(int*)handle, m.Read(0), m.Read(1), m.Read(2), m.Read(3)); - } } } \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/GL/framework.cs b/源代码/StgSharp/Graphics/GL/framework.cs index ec7d0d9f..f3d751ea 100644 --- a/源代码/StgSharp/Graphics/GL/framework.cs +++ b/源代码/StgSharp/Graphics/GL/framework.cs @@ -1,4 +1,34 @@ -using StgSharp.Graphics; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="framework.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; @@ -67,83 +97,83 @@ namespace StgSharp [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, GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* window, GLFWwindowcontentscalefun callback); [DllImport(SSC_libname, EntryPoint = "glfwPollEvents")] internal static extern unsafe void glfwPollEvents(); @@ -153,9 +183,9 @@ namespace StgSharp [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(GLFWwindow* 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(GLFWwindow* window, int mode, int value); [DllImport(SSC_libname, EntryPoint = "glfwRawMouseMotionSupported")] internal static extern unsafe int glfwRawMouseMotionSupported(); @@ -163,13 +193,13 @@ namespace StgSharp [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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* window, double xpos, double ypos); [DllImport(SSC_libname, EntryPoint = "glfwCreateCursor")] internal static extern unsafe GLFWcursor* glfwCreateCursor(GLFWimage* image, int xhot, int yhot); @@ -177,23 +207,23 @@ namespace StgSharp [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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* 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(GLFWwindow* window, GLFWdropfun callback); [DllImport(SSC_libname, EntryPoint = "glfwJoystickPresent")] internal static extern unsafe int glfwJoystickPresent(int jid); @@ -221,9 +251,9 @@ namespace StgSharp [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(GLFWwindow* 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(GLFWwindow* window); [DllImport(SSC_libname, EntryPoint = "glfwGetTime")] internal static extern unsafe double glfwGetTime(); @@ -233,11 +263,11 @@ namespace StgSharp [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(GLFWwindow* window); [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(GLFWwindow* window); [DllImport(SSC_libname, EntryPoint = "glfwSwapInterval")] internal static extern unsafe void glfwSwapInterval(int interval); @@ -251,7 +281,7 @@ namespace StgSharp //[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetInstanceProcAddress")] internal extern unsafe static GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, byte* procname); //[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwGetPhysicalDevicePresentationSupport")] internal extern unsafe static int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint* queuefamily); - //[DllImport(InternalIO.SSC_libname, EntryPoint = "glfwCreateWindowSurface")] internal extern unsafe static VkResult glfwCreateWindowSurface(VkInstance instance, IntPtr window, VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); + //[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/源代码/StgSharp/Graphics/GL/glApiManager.cs b/源代码/StgSharp/Graphics/GL/glApiManager.cs index a90ccb95..720dc5ae 100644 --- a/源代码/StgSharp/Graphics/GL/glApiManager.cs +++ b/源代码/StgSharp/Graphics/GL/glApiManager.cs @@ -1,4 +1,34 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -11,6 +41,7 @@ namespace StgSharp.Graphics { public static partial class glManager { + private const int glExtension = 0x1f03; private const int glVersion = 0x1f02; @@ -63,7 +94,7 @@ namespace StgSharp.Graphics { if (coreVersion.Contains(branch)) { - coreVersion.Replace(branch, ""); + coreVersion.Replace(branch, string.Empty); } } string[] versionSep = coreVersion.Split('.'); @@ -99,7 +130,10 @@ namespace StgSharp.Graphics } catch (Exception ex) { - if (ex.Message != "Final Version") throw; + if (ex.Message != "Final Version") + { + throw; + } } IntPtr strPtr = context->glGetString(glExtension); @@ -763,27 +797,178 @@ namespace StgSharp.Graphics 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; + if ((majorVersion >= 1) || ((majorVersion == 1) && (minorVersion == 0))) + { + core10 = true; + } + else + { + goto log; + } - 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; @@ -794,7 +979,7 @@ namespace StgSharp.Graphics { if (context.glGetString == null) { - return ""; + return string.Empty; } return Marshal.PtrToStringAnsi( context.glGetString(glExtension)); @@ -812,7 +997,7 @@ namespace StgSharp.Graphics catch (Exception ex) { InternalIO.InternalWriteLog( - $"Failed to convert the api {typeof(T).Name}.\n" + ex.Message, LogType.Warning); + $"{($"Failed to convert the api {typeof(T).Name}.\n")}{ex.Message}", LogType.Warning); return default; } } @@ -1781,5 +1966,6 @@ namespace StgSharp.Graphics InternalIO.InternalAppendLog("Successfully load all OpenGL 4.6 APIs"); } + } } \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/GL/glApiManagerConst.cs b/源代码/StgSharp/Graphics/GL/glApiManagerConst.cs index 50ab29dc..85de47ef 100644 --- a/源代码/StgSharp/Graphics/GL/glApiManagerConst.cs +++ b/源代码/StgSharp/Graphics/GL/glApiManagerConst.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; diff --git a/源代码/StgSharp/Graphics/IglFunc.cs b/源代码/StgSharp/Graphics/IglFunc.cs index bf8c9246..c5d4c072 100644 --- a/源代码/StgSharp/Graphics/IglFunc.cs +++ b/源代码/StgSharp/Graphics/IglFunc.cs @@ -1,4 +1,34 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="IglFunc.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.Concurrent; @@ -8,6 +38,12 @@ namespace StgSharp.Graphics { public interface IglFunc { + + internal unsafe GLcontext* Context + { + get; + } + /// /// Same function as OpenGL api glActiveTexture /// @@ -86,18 +122,14 @@ namespace StgSharp.Graphics void ClearGraphicError(); + void CompileShader(glHandle shaderhandle); + /// /// Same function as OpenGL api, glCreateProgram /// /// A handle representing a single shader program glHandle CreateProgram(); - glHandleSet CreateShaderSet(int count, ShaderType type); - - void LoadShaderSource(glHandle shaderHandle, string codeStream); - - void CompileShader(glHandle shaderhandle); - /// /// Same function as OpenGL api, glCreateProgram. /// Used for creating multiple shader program. @@ -105,6 +137,8 @@ namespace StgSharp.Graphics /// A handle representing all shader programs glHandleSet CreateProgram(int count); + glHandleSet CreateShaderSet(int count, ShaderType type); + /// /// Creates a form and its associated /// @@ -174,6 +208,8 @@ namespace StgSharp.Graphics bool GetWindowShouldClose(Form form); + void LoadShaderSource(glHandle shaderHandle, string codeStream); + /// /// Make the OpenGL context of a certain as the activated OpenGL context. /// @@ -184,17 +220,6 @@ namespace StgSharp.Graphics void SetBufferData(BufferType bufferType, T[] bufferArray, BufferUsage usage) where T : struct, IConvertible; - /// - /// Set data value to a float , - /// all types of parameters are float. - /// - /// The target - /// The first value to be set - /// The second value to be set - /// The third value to be set - /// The forth value to be set - void SetValue(Uniform uniform, float v0, float v1, float v2, float v3); - /// /// Set data value to a float , /// all types of parameters are float. @@ -203,25 +228,6 @@ namespace StgSharp.Graphics /// A packing four parameters of the uniform void SetValue(Uniform uniform, Vec4d vec); - /// - /// Set data value to a float , - /// all types of parameters are float. - /// - /// The target - /// The first value to be set - /// The second value to be set - /// The third value to be set - void SetValue(Uniform uniform, float v0, float v1, float v2); - - /// - /// Set data value to a float , - /// all types of parameters are float. - /// - /// The target - /// The first value to be set - /// The second value to be set - void SetValue(Uniform uniform, float v0, float v1); - /// /// Set data value to a float , /// all types of parameters are float. @@ -246,6 +252,36 @@ namespace StgSharp.Graphics /// A value of the uniform void SetValue(Uniform uniform, Vec4d vec); + /// + /// Set data value to a float , + /// all types of parameters are float. + /// + /// The target + /// The first value to be set + /// The second value to be set + void SetValue(Uniform uniform, float v0, float v1); + + /// + /// Set data value to a float , + /// all types of parameters are float. + /// + /// The target + /// The first value to be set + /// The second value to be set + /// The third value to be set + void SetValue(Uniform uniform, float v0, float v1, float v2); + + /// + /// Set data value to a float , + /// all types of parameters are float. + /// + /// The target + /// The first value to be set + /// The second value to be set + /// The third value to be set + /// The forth value to be set + void SetValue(Uniform uniform, float v0, float v1, float v2, float v3); + /// /// Set how a shader parameter read data from a VBO. /// @@ -293,13 +329,9 @@ namespace StgSharp.Graphics /// void Viewport(int x, int y, uint width, uint height); + internal void frameworkHandleEnqueue(IntPtr handle, params M128[] param); + internal void SwitchContext(); - internal unsafe GLcontext* Context - { - get; - } - - internal void frameworkHandleEnqueue(IntPtr handle, params M128[] param); } } \ No newline at end of file diff --git a/源代码/StgSharp/Graphics/Image.cs b/源代码/StgSharp/Graphics/Image.cs index 8d162242..8a76c4df 100644 --- a/源代码/StgSharp/Graphics/Image.cs +++ b/源代码/StgSharp/Graphics/Image.cs @@ -1,4 +1,34 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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.Math; using System; using System.Collections.Generic; @@ -12,21 +42,10 @@ namespace StgSharp.Graphics { public class Image { - [StructLayout(LayoutKind.Sequential)] - internal struct ImageInfo - { - internal int width; - internal int height; - internal int channel; - internal IntPtr pixelPtr; - } - internal glHandle pixelArrayHandle; internal ImageInfo info; - public int Width { get => info.width; } - public int Height { get => info.height; } - public int Channel { get => info.channel; } + internal glHandle pixelArrayHandle; internal Image(ImageInfo information) { @@ -40,9 +59,26 @@ namespace StgSharp.Graphics info = new ImageInfo(); } + public int Channel => info.channel; + public int Height => info.height; + + public int Width => info.width; + ~Image() { Marshal.FreeHGlobal(info.pixelPtr); } + + [StructLayout(LayoutKind.Sequential)] + internal struct ImageInfo + { + + internal int width; + internal int height; + internal int channel; + internal IntPtr pixelPtr; + + } + } } \ No newline at end of file diff --git a/源代码/StgSharp/Logic/ArrayList.cs b/源代码/StgSharp/Logic/ArrayList.cs index e4bcb415..9264a6e4 100644 --- a/源代码/StgSharp/Logic/ArrayList.cs +++ b/源代码/StgSharp/Logic/ArrayList.cs @@ -1,4 +1,34 @@ -using StgSharp.Graphics; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -14,6 +44,7 @@ namespace StgSharp.Logic [StructLayout(LayoutKind.Explicit, Size = 8)] internal struct LogSeperator { + [FieldOffset(0)] public ulong all; [FieldOffset(0)] public long all_s; @@ -28,6 +59,7 @@ namespace StgSharp.Logic this.high = high; this.low = low; } + } /// @@ -38,6 +70,7 @@ namespace StgSharp.Logic /// public class DynamicArrayList { + private List arrayIndexList; private LogSeperator indexpair; private int lastMain = 0; @@ -139,10 +172,10 @@ namespace StgSharp.Logic { indexpair.all_s = index; if ( - indexpair.low_s > lastSub || - indexpair.high_s > lastMain || - indexpair.low_s < 0 || - indexpair.high_s < 0) + (indexpair.low_s > lastSub) || + (indexpair.high_s > lastMain) || + (indexpair.low_s < 0) || + (indexpair.high_s < 0)) { throw new IndexOutOfRangeException(); } @@ -152,10 +185,10 @@ namespace StgSharp.Logic { indexpair.all_s = index; if ( - indexpair.low_s > lastSub || - indexpair.high_s > lastMain || - indexpair.low_s < 0 || - indexpair.high_s < 0) + (indexpair.low_s > lastSub) || + (indexpair.high_s > lastMain) || + (indexpair.low_s < 0) || + (indexpair.high_s < 0)) { throw new IndexOutOfRangeException(); } @@ -163,30 +196,11 @@ namespace StgSharp.Logic } } - 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 T this[int index] { get { - if (index + 1 > length || index < 0) + if ((index + 1 > length) || (index < 0)) { throw new ArgumentOutOfRangeException("index"); } @@ -195,7 +209,7 @@ namespace StgSharp.Logic } set { - if (index + 1 > length || index < 0) + if ((index + 1 > length) || (index < 0)) { throw new ArgumentOutOfRangeException("index"); } @@ -208,7 +222,7 @@ namespace StgSharp.Logic { get { - if (index + 1 > length || index < 0) + if ((index + 1 > length) || (index < 0)) { throw new ArgumentOutOfRangeException("index"); } @@ -217,7 +231,7 @@ namespace StgSharp.Logic } set { - if (index + 1 > length || index < 0) + if ((index + 1 > length) || (index < 0)) { throw new ArgumentOutOfRangeException("index"); } @@ -231,10 +245,7 @@ namespace StgSharp.Logic /// /// Length of this /// - public int Length - { - get { return length; } - } + public int Length => length; public int Add(T item) { @@ -297,6 +308,25 @@ namespace StgSharp.Logic 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; @@ -307,7 +337,7 @@ namespace StgSharp.Logic { if (i.Equals(item)) { - return index + subindex - 1; + return (index + subindex) - 1; } subindex++; } @@ -328,11 +358,11 @@ namespace StgSharp.Logic if (i.Equals(item)) { list[subindex] = default; - if (subindex == lastSub && index == lastMain) + if ((subindex == lastSub) && (index == lastMain)) { if (lastSub == 0) { - lastMain = lastMain == 0 ? 0 : lastMain - 1; + lastMain = (lastMain == 0) ? 0 : (lastMain - 1); lastSub = arrayIndexList[lastMain].Length - 1; } else @@ -356,7 +386,7 @@ namespace StgSharp.Logic [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) + if ((index > length) || (index < 0)) { throw new ArgumentOutOfRangeException(nameof(index)); } @@ -402,7 +432,7 @@ namespace StgSharp.Logic mainindex++; } indexpair.high_s = mainindex; - indexpair.low >>= (int)(32 - mainindex); + indexpair.low >>= 32 - mainindex; } private void SeprateIndex(int longIndex) @@ -415,7 +445,8 @@ namespace StgSharp.Logic mainindex++; } indexpair.high_s = mainindex; - indexpair.low >>= (int)(32 - mainindex); + indexpair.low >>= 32 - mainindex; } + } } \ No newline at end of file diff --git a/源代码/StgSharp/Logic/Control.cs b/源代码/StgSharp/Logic/Control.cs index 56cc5857..051d46db 100644 --- a/源代码/StgSharp/Logic/Control.cs +++ b/源代码/StgSharp/Logic/Control.cs @@ -1,4 +1,34 @@ -using StgSharp.Entities; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Control.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.Geometries; using StgSharp.Math; @@ -6,15 +36,17 @@ namespace StgSharp { public partial class Control { + + internal Line bottomBoader; internal Line leftBoader; internal Line rightBoader; internal Line topBoader; - internal Line bottomBoader; + + public Line BottomBoarder => bottomBoader; public Line LeftBoarder => leftBoader; public Line RightBoarder => rightBoader; public Line TopBoarder => topBoader; - public Line BottomBoarder => bottomBoader; private void initContainers() diff --git a/源代码/StgSharp/Logic/Counter.cs b/源代码/StgSharp/Logic/Counter.cs index 522f9494..eadd526b 100644 --- a/源代码/StgSharp/Logic/Counter.cs +++ b/源代码/StgSharp/Logic/Counter.cs @@ -1,80 +1,48 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 delegate void TimeSourceProvider(TimeProvider subscriber); - - public class TimeProvider - { - private readonly long _spanLength; - private long _spanBegin; - private Counter timeSpanCount = new Counter(0, 1, 1); - - public static TimeSourceProvider DefaultProvider - { - get - { - return new(StgSharp.SubscribeTimeProvider); - } - } - - public TimeProvider( - long spanLength - ) - { - _spanLength = spanLength; - } - - internal void CheckTime(long microseconds) - { - if (microseconds - _spanBegin > _spanLength) - { - _spanBegin = microseconds; - timeSpanCount++; - } - } - - public void SubcsribeToTimeSource(TimeSourceProvider serviceHandler) - { - serviceHandler(this); - } - - public static implicit operator uint(TimeProvider provider) - { - return provider.timeSpanCount.Value; - } - } public class Counter where T : struct, IConvertible, IFormattable, IComparable { - internal readonly T _defualtValue; + internal readonly T _defualtAddValue; internal readonly T _defualtSubValue; + internal readonly T _defualtValue; internal dynamic _value; - public T Value - { - get { return _value; } - set { _value = value; } - } - - public T Span - { - get { return _value - _defualtValue; } - } - - public T Increament - { - get { return _defualtAddValue; } - } - - public T Decreament - { - get { return _defualtSubValue; } - } - public Counter(T defualtValue, T defualtAddValue, T defualtSubValue) { var type = Type.GetTypeCode(defualtValue.GetType()); @@ -120,6 +88,18 @@ namespace StgSharp _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; @@ -130,11 +110,6 @@ namespace StgSharp _value += _defualtAddValue; } - public void Sub(T value) - { - _value -= value; - } - public void QuickSub() { _value -= _defualtSubValue; @@ -145,10 +120,14 @@ namespace StgSharp _value = _defualtValue; } - public static Counter operator ++(Counter counter) + public void Sub(T value) { - counter.QuickAdd(); - return counter; + _value -= value; + } + + public override string ToString() + { + return Value.ToString(); } public static Counter operator --(Counter counter) @@ -157,14 +136,16 @@ namespace StgSharp return counter; } - public override string ToString() + public static Counter operator ++(Counter counter) { - return Value.ToString(); + counter.QuickAdd(); + return counter; } public static implicit operator T(Counter counter) { return counter.Value; } + } } \ No newline at end of file diff --git a/源代码/StgSharp/Logic/Exception.cs b/源代码/StgSharp/Logic/Exception.cs index 99c62737..24459314 100644 --- a/源代码/StgSharp/Logic/Exception.cs +++ b/源代码/StgSharp/Logic/Exception.cs @@ -1,4 +1,34 @@ -using StgSharp.Graphics; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -11,6 +41,12 @@ namespace StgSharp.Logic [System.Serializable] internal class FrameTimeoutException : Exception { + + protected FrameTimeoutException( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) : base(info, context) + { + } internal FrameTimeoutException() { } @@ -22,10 +58,5 @@ namespace StgSharp.Logic { } - protected FrameTimeoutException( - System.Runtime.Serialization.SerializationInfo info, - System.Runtime.Serialization.StreamingContext context) : base(info, context) - { - } } } \ No newline at end of file diff --git a/源代码/StgSharp/Logic/LogicValue.cs b/源代码/StgSharp/Logic/LogicValue.cs index 2c934bb5..ac107343 100644 --- a/源代码/StgSharp/Logic/LogicValue.cs +++ b/源代码/StgSharp/Logic/LogicValue.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="LogicValue.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; @@ -13,6 +43,7 @@ namespace StgSharp.Logic [StructLayout(LayoutKind.Explicit, Size = 2)] public struct Bool2 { + /// /// A value. /// The lower byte is , @@ -33,5 +64,6 @@ namespace StgSharp.Logic [FieldOffset(1)] public bool bool1; [FieldOffset(1)] public bool byte1; + } } diff --git a/源代码/StgSharp/Logic/Sensor.cs b/源代码/StgSharp/Logic/Sensor.cs index 451b6393..1bad6f77 100644 --- a/源代码/StgSharp/Logic/Sensor.cs +++ b/源代码/StgSharp/Logic/Sensor.cs @@ -1,4 +1,34 @@ -using StgSharp.Geometries; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 { @@ -7,26 +37,30 @@ namespace StgSharp public class Sensor { + internal PlainGeometry _boarder; - internal PlainGeometry _target; internal SensorRuleHandler _rule; + internal PlainGeometry _target; - public PlainGeometry boarder + public PlainGeometry boarder => _boarder; + + public SensorRuleHandler Rule { - get { return _boarder; } + get => _rule; + set => _rule = value; } public PlainGeometry target { - get { return _target; } - set { _target = value; } + get => _target; + set => _target = value; } - public SensorRuleHandler Rule + public static Sensor operator -(Sensor sensor, SensorRuleHandler rule) { - get { return _rule; } - set { _rule = value; } + sensor._rule -= rule; + return sensor; } public static Sensor operator +(Sensor sensor, SensorRuleHandler rule) @@ -35,10 +69,5 @@ namespace StgSharp return sensor; } - public static Sensor operator -(Sensor sensor, SensorRuleHandler rule) - { - sensor._rule -= rule; - return sensor; - } } } diff --git a/源代码/StgSharp/Logic/TimeSourceProvider.cs b/源代码/StgSharp/Logic/TimeSourceProvider.cs new file mode 100644 index 00000000..e471fd25 --- /dev/null +++ b/源代码/StgSharp/Logic/TimeSourceProvider.cs @@ -0,0 +1,88 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 StgSharpDebug.Logic +{ + + + public abstract class TimeSourceProviderBase + { + + private SemaphoreSlim _addSubscriberSemaphore = new SemaphoreSlim(1, 1); + + 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/源代码/StgSharp/Logic/TimeSpanProvider.cs b/源代码/StgSharp/Logic/TimeSpanProvider.cs new file mode 100644 index 00000000..1274cd3e --- /dev/null +++ b/源代码/StgSharp/Logic/TimeSpanProvider.cs @@ -0,0 +1,122 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 StgSharpDebug.Logic; + +using System; +using System.Linq; + +namespace StgSharp +{ + public delegate void TimeSpanRefeshCallback(); + + /// + /// A microsecond-accuracy timer. It will refresh every a certain time span. + /// + public class TimeSpanProvider + { + + private readonly int _maxSpanCount; + private TimeSpanRefeshCallback _refeshCallback; + private long _spanBegin; + private readonly long _spanLength; + private bool _subscribed; + private Counter timeSpanCount = new Counter(0, 1, 1); + + /// + /// Create a new and define the length of time span. Length of a single time span is defined in microseconds. + /// + /// + /// + public TimeSpanProvider(long spanLength, TimeSourceProviderBase provider) + { + _spanLength = spanLength; + provider.AddSubscriber(this); + _subscribed = true; + } + /// + /// Create a new and define the length of time span. Length of a single time span is defined in microseconds. + /// + /// + /// + public TimeSpanProvider(long spanLength, uint maxSpan, TimeSourceProviderBase provider) + { + _spanLength = spanLength; + provider.AddSubscriber(this); + _subscribed = true; + } + + + /// + /// Time source provider provided in internal framework. + /// + public static TimeSourceProviderBase DefaultProvider => StgSharpTime.OnlyInstance; + + /// + /// The method this will call every time a new time span started. + /// + public TimeSpanRefeshCallback SpanRefreshCallback + { + get => _refeshCallback; + set => _refeshCallback = value; + } + + + public void SubcsribeToTimeSource(TimeSourceProviderBase serviceHandler) + { + if (_subscribed) + { + return; + } + _subscribed = true; + serviceHandler.AddSubscriber(this); + } + + internal bool CheckTime(long microseconds) + { + if (microseconds - _spanBegin > _spanLength) + { + _spanBegin = microseconds; + timeSpanCount++; + } + if (timeSpanCount > _maxSpanCount) + { + return false; + } + return true; + } + + public static implicit operator uint(TimeSpanProvider provider) + { + return provider.timeSpanCount.Value; + } + + } +} \ No newline at end of file diff --git a/源代码/StgSharp/Logic/glParamQueue.cs b/源代码/StgSharp/Logic/glParamQueue.cs index 664c0611..ca9a6a19 100644 --- a/源代码/StgSharp/Logic/glParamQueue.cs +++ b/源代码/StgSharp/Logic/glParamQueue.cs @@ -1,4 +1,34 @@ -using StgSharp.Graphics; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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.Graphics; using StgSharp.Math; using System; @@ -16,9 +46,10 @@ namespace StgSharp.Logic { internal unsafe class GLparamQueue { - internal GLcontext* context; + private ConcurrentQueue paramQueue; private ConcurrentQueue streamQueue; + internal GLcontext* context; public GLparamQueue() { @@ -47,6 +78,45 @@ namespace StgSharp.Logic 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) { @@ -65,6 +135,33 @@ namespace StgSharp.Logic 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) { @@ -84,6 +181,16 @@ namespace StgSharp.Logic 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) { @@ -95,67 +202,6 @@ namespace StgSharp.Logic 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(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(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) - { - M128 m = default; - m.Write(0, i0); - 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(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(int i0, int i1, int i2, int i3) { @@ -167,21 +213,6 @@ namespace StgSharp.Logic 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 TryDequeue(out glArrayHandle arrayHandle) { @@ -244,6 +275,36 @@ namespace StgSharp.Logic } } + [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) { @@ -260,6 +321,38 @@ namespace StgSharp.Logic } } + [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) { @@ -277,6 +370,40 @@ namespace StgSharp.Logic } } + [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) { @@ -295,37 +422,6 @@ namespace StgSharp.Logic } } - [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) { @@ -344,71 +440,6 @@ namespace StgSharp.Logic } } - [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) { diff --git a/源代码/StgSharp/Math/GLfixed.cs b/源代码/StgSharp/Math/GLfixed.cs index 753aba22..dd4984c0 100644 --- a/源代码/StgSharp/Math/GLfixed.cs +++ b/源代码/StgSharp/Math/GLfixed.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -10,8 +40,10 @@ 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/源代码/StgSharp/Math/Linear/Cordination.cs b/源代码/StgSharp/Math/Linear/Cordination.cs index be8a74df..33a976ed 100644 --- a/源代码/StgSharp/Math/Linear/Cordination.cs +++ b/源代码/StgSharp/Math/Linear/Cordination.cs @@ -1,4 +1,34 @@ -namespace StgSharp.Math +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 { internal class Cordination diff --git a/源代码/StgSharp/Math/Linear/M128.cs b/源代码/StgSharp/Math/Linear/M128.cs index 518c75b7..92a005d7 100644 --- a/源代码/StgSharp/Math/Linear/M128.cs +++ b/源代码/StgSharp/Math/Linear/M128.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="M128.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.Numerics; @@ -19,35 +49,40 @@ namespace StgSharp.Math [StructLayout(LayoutKind.Explicit, Pack = 16)] public unsafe struct M128 { + [FieldOffset(0)] internal Vector4 vec; [MethodImpl(MethodImplOptions.AggressiveInlining)] public T Read(int index) where T : struct { fixed (Vector4* p = &vec) - return *((T*)(p) + index); + { + return *(((T*)p) + index); + } + } + + public override string ToString() + { + return string.Empty; + } + + public string ToString(int sample) + { + string str = string.Empty; + for (int i = 0; i < 16; i++) + { + str += $"{Convert.ToString(this.Read(i), sample)} "; + } + return str; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void Write(int index, T value) where T : struct { fixed (Vector4* p = &vec) - *((T*)(p) + index) = value; - } - - public override string ToString() - { - return ""; - } - - public string ToString(int sample) - { - string str = ""; - for (int i = 0; i < 16; i++) { - str += $"{Convert.ToString(this.Read(i), sample)} "; + *(((T*)p) + index) = value; } - return str; } #if NET5_0_OR_GREATER diff --git a/源代码/StgSharp/Math/Linear/MatInterface.cs b/源代码/StgSharp/Math/Linear/MatInterface.cs index 04941bbe..8e0ba0d3 100644 --- a/源代码/StgSharp/Math/Linear/MatInterface.cs +++ b/源代码/StgSharp/Math/Linear/MatInterface.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; diff --git a/源代码/StgSharp/Math/Linear/Vector.Cross.cs b/源代码/StgSharp/Math/Linear/Vector.Cross.cs index ffe59024..6920b0b9 100644 --- a/源代码/StgSharp/Math/Linear/Vector.Cross.cs +++ b/源代码/StgSharp/Math/Linear/Vector.Cross.cs @@ -1,20 +1,51 @@ -namespace StgSharp.Math +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 Vector { public static float Cross(Vec2d vec1, Vec2d vec2) { - return vec1.X * vec2.Y - vec1.Y * vec2.X; + 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 + (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/源代码/StgSharp/Math/Linear/Vector.GetAngle.cs b/源代码/StgSharp/Math/Linear/Vector.GetAngle.cs index 5a8d7ec8..60c0b506 100644 --- a/源代码/StgSharp/Math/Linear/Vector.GetAngle.cs +++ b/源代码/StgSharp/Math/Linear/Vector.GetAngle.cs @@ -1,7 +1,38 @@ -namespace StgSharp.Math +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 Vector { + public static float GetAngle(Vec2d vec1, Vec2d vec2) { return Scaler.ACos(1 @@ -13,7 +44,7 @@ public static float GetAngle(vec3d vec1, vec3d vec2) { return Scaler.ACos( - vec1 * vec2 + (vec1 * vec2) / (vec1.GetLength() * vec2.GetLength()) ); } diff --git a/源代码/StgSharp/Math/Linear/Vector.GetLength.cs b/源代码/StgSharp/Math/Linear/Vector.GetLength.cs index 4817a8bf..e41de6cd 100644 --- a/源代码/StgSharp/Math/Linear/Vector.GetLength.cs +++ b/源代码/StgSharp/Math/Linear/Vector.GetLength.cs @@ -1,21 +1,52 @@ -namespace StgSharp.Math +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 Vector { + public static float GetLength(this vec3d vec) { return Scaler.Sqrt( - vec.X * vec.X + - vec.Y * vec.Y + - vec.Z * vec.Z + (vec.X * vec.X) + + (vec.Y * vec.Y) + + (vec.Z * vec.Z) ); } public static float GetLength(this Vec2d vec) { return Scaler.Sqrt( - vec.X * vec.X + - vec.Y * vec.Y + (vec.X * vec.X) + + (vec.Y * vec.Y) ); } diff --git a/源代码/StgSharp/Math/Linear/Vector.VectorTransform.cs b/源代码/StgSharp/Math/Linear/Vector.VectorTransform.cs index 424fc9c7..21478bc4 100644 --- a/源代码/StgSharp/Math/Linear/Vector.VectorTransform.cs +++ b/源代码/StgSharp/Math/Linear/Vector.VectorTransform.cs @@ -1,14 +1,40 @@ -using System.Numerics; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Vector.VectorTransform.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; namespace StgSharp.Math { - public unsafe static partial class VectorCalc + public static unsafe partial class VectorCalc { - public static vec3d To3D(Vec2d vec) - { - return new vec3d(vec.X, vec.Y, 0.0f); - } public static Vec2d To2D(vec3d vec, CordinatePlain plain) { @@ -28,12 +54,17 @@ namespace StgSharp.Math 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) { return new vec3d(vector); } + } diff --git a/源代码/StgSharp/Math/Linear/mat2.cs b/源代码/StgSharp/Math/Linear/mat2.cs index 78da122f..51c50b2e 100644 --- a/源代码/StgSharp/Math/Linear/mat2.cs +++ b/源代码/StgSharp/Math/Linear/mat2.cs @@ -1,4 +1,35 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -8,6 +39,7 @@ namespace StgSharp { internal static unsafe partial class InternalIO { + #region add [DllImport(InternalIO.SSC_libname, EntryPoint = "add_Mat2", @@ -16,6 +48,15 @@ namespace StgSharp 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 @@ -42,14 +83,6 @@ namespace StgSharp #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 } } @@ -85,7 +118,7 @@ namespace StgSharp.Math [MethodImpl(MethodImplOptions.AggressiveInlining)] public override bool Equals(object? obj) { - return obj is Mat2 mat && Equals(mat); + return (obj is Mat2 mat) && Equals(mat); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -95,16 +128,17 @@ namespace StgSharp.Math 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); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Mat2 left, Mat2 right) - { - return !(left == right); - } } } diff --git a/源代码/StgSharp/Math/Linear/mat3.cs b/源代码/StgSharp/Math/Linear/mat3.cs index 00e886f2..3eae60c8 100644 --- a/源代码/StgSharp/Math/Linear/mat3.cs +++ b/源代码/StgSharp/Math/Linear/mat3.cs @@ -1,4 +1,35 @@ -using StgSharp.Math; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -34,6 +65,7 @@ namespace StgSharp #endregion + } } @@ -66,7 +98,7 @@ namespace StgSharp.Math public override bool Equals(object? obj) { - return obj is Mat3 mat && Equals(mat); + return (obj is Mat3 mat) && Equals(mat); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -77,16 +109,17 @@ namespace StgSharp.Math 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); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Mat3 left, Mat3 right) - { - return !(left == right); - } } } diff --git a/源代码/StgSharp/Math/Linear/mat4.cs b/源代码/StgSharp/Math/Linear/mat4.cs index 0f28cbd1..536683ca 100644 --- a/源代码/StgSharp/Math/Linear/mat4.cs +++ b/源代码/StgSharp/Math/Linear/mat4.cs @@ -1,5 +1,36 @@ -using StgSharp; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -10,6 +41,26 @@ namespace StgSharp internal static unsafe partial class InternalIO { + #region deinit_mat4 + + + [DllImport(InternalIO.SSC_libname, EntryPoint = "deinit_mat4", + CallingConvention = CallingConvention.Cdecl)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static extern void deinit_mat4(Mat4* mat); + + #endregion + + #region det + + [DllImport(InternalIO.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(InternalIO.SSC_libname, EntryPoint = "transpose4to4", @@ -27,25 +78,6 @@ namespace StgSharp #endregion - #region det - - [DllImport(InternalIO.SSC_libname, EntryPoint = "det_mat4", - CallingConvention = CallingConvention.Cdecl)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static unsafe extern float det_mat4(Mat4* matPtr, Mat4* transpose); - - #endregion - - #region deinit_mat4 - - - [DllImport(InternalIO.SSC_libname, EntryPoint = "deinit_mat4", - CallingConvention = CallingConvention.Cdecl)] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static extern void deinit_mat4(Mat4* mat); - - #endregion - } @@ -57,6 +89,7 @@ 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; @@ -98,7 +131,7 @@ namespace StgSharp.Math public override bool Equals(object? obj) { - return obj is Mat4 mat && Equals(mat); + return (obj is Mat4 mat) && Equals(mat); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -110,16 +143,17 @@ namespace StgSharp.Math 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); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(Mat4 left, Mat4 right) - { - return !(left == right); - } } } diff --git a/源代码/StgSharp/Math/Linear/mat5.cs b/源代码/StgSharp/Math/Linear/mat5.cs index 5ee2af0c..1cff88ac 100644 --- a/源代码/StgSharp/Math/Linear/mat5.cs +++ b/源代码/StgSharp/Math/Linear/mat5.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -9,10 +39,12 @@ namespace StgSharp.Math.Linear [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/源代码/StgSharp/Math/Linear/mat6.cs b/源代码/StgSharp/Math/Linear/mat6.cs index 527755a8..00935552 100644 --- a/源代码/StgSharp/Math/Linear/mat6.cs +++ b/源代码/StgSharp/Math/Linear/mat6.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -9,11 +39,13 @@ namespace StgSharp.Math.Linear [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/源代码/StgSharp/Math/Linear/matrix2x2.cs b/源代码/StgSharp/Math/Linear/matrix2x2.cs index 463591c3..f78cfe99 100644 --- a/源代码/StgSharp/Math/Linear/matrix2x2.cs +++ b/源代码/StgSharp/Math/Linear/matrix2x2.cs @@ -1,12 +1,43 @@ -using System.Numerics; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="matrix2x2.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)] + [StructLayout(LayoutKind.Explicit, Size = (2 * 2 * 4 * sizeof(float)) + sizeof(bool), Pack = 16)] public struct Matrix2x2 : IMat { + [FieldOffset(0)] internal Mat2 mat; [FieldOffset(2 * 4 * sizeof(float))] @@ -14,13 +45,11 @@ namespace StgSharp.Math [FieldOffset(2 * 2 * 4 * sizeof(float))] internal bool isTransposed; - public Matrix2x2( - float a00, float a01, - float a10, float a11 + internal Matrix2x2( + Mat2 mat ) { - mat.colum0 = new Vector4(a00, a10, 0, 0); - mat.colum1 = new Vector4(a01, a11, 0, 0); + this.mat = mat; } internal Matrix2x2( @@ -32,11 +61,13 @@ namespace StgSharp.Math mat.colum1 = c1; } - internal Matrix2x2( - Mat2 mat + public Matrix2x2( + float a00, float a01, + float a10, float a11 ) { - this.mat = mat; + mat.colum0 = new Vector4(a00, a10, 0, 0); + mat.colum1 = new Vector4(a01, a11, 0, 0); } public Matrix2x2 Transpose @@ -48,6 +79,12 @@ namespace StgSharp.Math } } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float Det() + { + return (mat.m00 * mat.m11) - (mat.m10 * mat.m01); + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void InternalTranspose() { @@ -62,16 +99,6 @@ namespace StgSharp.Math } } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe Matrix2x2 operator +(Matrix2x2 left, Matrix2x2 right) - { - Mat2* refmat = InternalIO.add_mat2(&left.mat, &right.mat); - Matrix2x2 ret = new Matrix2x2(*refmat); - InternalIO.deinit_mat2(refmat); - return ret; - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Matrix2x2 operator -(Matrix2x2 left, Matrix2x2 right) { @@ -90,15 +117,6 @@ namespace StgSharp.Math ); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix2x2 operator /(Matrix2x2 mat, float value) - { - return new Matrix2x2( - mat.mat.colum0 / value, - mat.mat.colum1 / value - ); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Matrix2x2 operator *(Matrix2x2 left, Matrix2x2 right) { @@ -145,9 +163,22 @@ namespace StgSharp.Math } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public float Det() + public static Matrix2x2 operator /(Matrix2x2 mat, float value) { - return mat.m00 * mat.m11 - mat.m10 * mat.m01; + return new Matrix2x2( + mat.mat.colum0 / value, + mat.mat.colum1 / value + ); + } + + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe Matrix2x2 operator +(Matrix2x2 left, Matrix2x2 right) + { + Mat2* refmat = InternalIO.add_mat2(&left.mat, &right.mat); + Matrix2x2 ret = new Matrix2x2(*refmat); + InternalIO.deinit_mat2(refmat); + return ret; } diff --git a/源代码/StgSharp/Math/Linear/matrix2x3.cs b/源代码/StgSharp/Math/Linear/matrix2x3.cs index e87cec8f..6e682f28 100644 --- a/源代码/StgSharp/Math/Linear/matrix2x3.cs +++ b/源代码/StgSharp/Math/Linear/matrix2x3.cs @@ -1,27 +1,48 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="matrix2x3.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)] + [StructLayout(LayoutKind.Explicit, Size = ((3 + 2) * 4 * sizeof(float)) + sizeof(bool), Pack = 16)] public struct Matrix2x3 { + [FieldOffset(0)] internal Mat3 mat; [FieldOffset(3 * 4 * sizeof(float))] internal Mat2 transpose; [FieldOffset(5 * 4 * sizeof(float))] internal bool isTransposed; - public Matrix2x3( - 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); - } - internal Matrix2x3( Vector4 c0, Vector4 c1, @@ -33,43 +54,53 @@ namespace StgSharp.Math mat.colum2 = c2; } + public Matrix2x3( + 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) + if ((rowNum > 1) || (rowNum < 0)) { throw new ArgumentOutOfRangeException(nameof(columNum)); } - if (columNum > 2 || columNum < 0) + 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; + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); return *(float*)pbit; } } set { - if (rowNum > 1 || rowNum < 0) + if ((rowNum > 1) || (rowNum < 0)) { throw new ArgumentOutOfRangeException(nameof(columNum)); } - if (columNum > 2 || columNum < 0) + 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; + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); *(float*)pbit = value; } isTransposed = false; @@ -81,24 +112,17 @@ namespace StgSharp.Math { if (!isTransposed) { - fixed(Mat3* source = &this.mat) - fixed(Mat2* target = &this.transpose) + fixed (Mat3* source = &this.mat) { - InternalIO.Transpose3to2_internal(source, target); + fixed (Mat2* target = &this.transpose) + { + InternalIO.Transpose3to2_internal(source, target); + } } + isTransposed = true; } } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix2x3 operator +(Matrix2x3 left, Matrix2x3 right) - { - return new Matrix2x3( - left.mat.colum0 + right.mat.colum0, - left.mat.colum1 + right.mat.colum1, - left.mat.colum2 + right.mat.colum2 - ); - } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Matrix2x3 operator -(Matrix2x3 left, Matrix2x3 right) @@ -120,16 +144,6 @@ namespace StgSharp.Math ); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix2x3 operator /(Matrix2x3 mat, float value) - { - return new Matrix2x3( - mat.mat.colum0 / value, - mat.mat.colum1 / value, - mat.mat.colum2 / value - ); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Matrix2x2 operator *(Matrix2x3 left, Matrix3x2 right) { @@ -175,6 +189,26 @@ namespace StgSharp.Math ); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix2x3 operator /(Matrix2x3 mat, float value) + { + return new Matrix2x3( + mat.mat.colum0 / value, + mat.mat.colum1 / value, + mat.mat.colum2 / value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix2x3 operator +(Matrix2x3 left, Matrix2x3 right) + { + return new Matrix2x3( + left.mat.colum0 + right.mat.colum0, + left.mat.colum1 + right.mat.colum1, + left.mat.colum2 + right.mat.colum2 + ); + } + } diff --git a/源代码/StgSharp/Math/Linear/matrix2x4.cs b/源代码/StgSharp/Math/Linear/matrix2x4.cs index 321fa419..84827be0 100644 --- a/源代码/StgSharp/Math/Linear/matrix2x4.cs +++ b/源代码/StgSharp/Math/Linear/matrix2x4.cs @@ -1,13 +1,44 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="matrix2x4.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)] + [StructLayout(LayoutKind.Explicit, Size = ((4 + 2) * 4 * sizeof(float)) + sizeof(bool), Pack = 16)] public struct Matrix2x4 { + [FieldOffset(0)] internal Mat4 mat; [FieldOffset(4 * 4 * sizeof(float))] internal Mat2 transpose; [FieldOffset(6 * 4 * sizeof(float))] internal bool isTransposed; @@ -17,18 +48,6 @@ namespace StgSharp.Math [FieldOffset(32)] public Vec2d Colum2; [FieldOffset(48)] public Vec2d Colum3; - - public Matrix2x4( - 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); - } - internal Matrix2x4( Vector4 c0, Vector4 c1, @@ -42,74 +61,84 @@ namespace StgSharp.Math mat.colum3 = c3; } + + public Matrix2x4( + 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) + if ((rowNum > 1) || (rowNum < 0)) { throw new ArgumentOutOfRangeException(nameof(columNum)); } - if (columNum > 3 || columNum < 0) + 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; + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); return *(float*)pbit; } } set { - if (rowNum > 1 || rowNum < 0) + if ((rowNum > 1) || (rowNum < 0)) { throw new ArgumentOutOfRangeException(nameof(columNum)); } - if (columNum > 3 || columNum < 0) + 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; + 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); + fixed (Mat2* target = &this.transpose) + { + InternalIO.Transpose4to2_internal(source, target); + } } + isTransposed = true; } } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix2x4 operator +(Matrix2x4 left, Matrix2x4 right) - { - return new Matrix2x4( - 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 Matrix2x4 operator -(Matrix2x4 left, Matrix2x4 right) { @@ -132,17 +161,6 @@ namespace StgSharp.Math ); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix2x4 operator /(Matrix2x4 mat, float value) - { - return new Matrix2x4( - mat.mat.colum0 / value, - mat.mat.colum1 / value, - mat.mat.colum2 / value, - mat.mat.colum3 / value - ); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Matrix2x2 operator *(Matrix2x4 left, Matrix4x2 right) { @@ -188,11 +206,26 @@ namespace StgSharp.Math ); } - public override string ToString() + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix2x4 operator /(Matrix2x4 mat, float value) { - InternalTranspose(); - return $"[{mat.m00},{mat.m01},{mat.m02},{mat.m03}]," + - $"[{mat.m10},{mat.m11},{mat.m12},{mat.m13}]"; + return new Matrix2x4( + mat.mat.colum0 / value, + mat.mat.colum1 / value, + mat.mat.colum2 / value, + mat.mat.colum3 / value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix2x4 operator +(Matrix2x4 left, Matrix2x4 right) + { + return new Matrix2x4( + 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/源代码/StgSharp/Math/Linear/matrix3x2.cs b/源代码/StgSharp/Math/Linear/matrix3x2.cs index 9f68eae5..9e53fd85 100644 --- a/源代码/StgSharp/Math/Linear/matrix3x2.cs +++ b/源代码/StgSharp/Math/Linear/matrix3x2.cs @@ -1,19 +1,59 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="matrix3x2.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)] + [StructLayout(LayoutKind.Explicit, Size = (5 * 4 * sizeof(float)) + sizeof(bool), Pack = 16)] public struct Matrix3x2 { + [FieldOffset(0)] internal Mat2 mat; [FieldOffset(0)] internal vec3d colum0; [FieldOffset(4 * 4)] internal vec3d colum1; [FieldOffset(2 * 4 * sizeof(float))] internal Mat3 transpose; [FieldOffset(5 * 4 * sizeof(float))] internal bool isTransposed; + internal Matrix3x2( + Vector4 c0, + Vector4 c1 + ) + { + mat.colum0 = c0; + mat.colum1 = c1; + } + public unsafe Matrix3x2( float a00, float a01, @@ -30,86 +70,71 @@ namespace StgSharp.Math #endif } - internal Matrix3x2( - Vector4 c0, - Vector4 c1 - ) - { - mat.colum0 = c0; - mat.colum1 = c1; - } - - public vec3d VerticalVecMultiply(Vec2d vec) - { - return colum0 * vec.X + colum1 * vec.Y; - } - public unsafe float this[int rowNum, int columNum] { get { - if (rowNum > 2 || rowNum < 0) + if ((rowNum > 2) || (rowNum < 0)) { throw new ArgumentOutOfRangeException(nameof(columNum)); } - if (columNum > 1 || columNum < 0) + 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; + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); return *(float*)pbit; } } set { - if (rowNum > 2 || rowNum < 0) + if ((rowNum > 2) || (rowNum < 0)) { throw new ArgumentOutOfRangeException(nameof(columNum)); } - if (columNum > 1 || columNum < 0) + 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; + 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); + fixed (Mat3* target = &this.transpose) + { + InternalIO.Transpose2to3_internal(source, target); + } } + isTransposed = true; } } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix3x2 operator +(Matrix3x2 left, Matrix3x2 right) - { - return new Matrix3x2( - left.mat.colum0 + right.mat.colum0, - left.mat.colum1 + right.mat.colum1 - ); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Matrix3x2 operator -(Matrix3x2 left, Matrix3x2 right) { @@ -128,15 +153,6 @@ namespace StgSharp.Math ); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix3x2 operator /(Matrix3x2 mat, float value) - { - return new Matrix3x2( - mat.mat.colum0 / value, - mat.mat.colum1 / value - ); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Matrix3x2 operator *(Matrix3x2 left, Matrix2x2 right) { @@ -194,6 +210,24 @@ namespace StgSharp.Math ); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix3x2 operator /(Matrix3x2 mat, float value) + { + return new Matrix3x2( + mat.mat.colum0 / value, + mat.mat.colum1 / value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix3x2 operator +(Matrix3x2 left, Matrix3x2 right) + { + return new Matrix3x2( + left.mat.colum0 + right.mat.colum0, + left.mat.colum1 + right.mat.colum1 + ); + } + } } diff --git a/源代码/StgSharp/Math/Linear/matrix3x3.cs b/源代码/StgSharp/Math/Linear/matrix3x3.cs index 04b6731d..fb28ca99 100644 --- a/源代码/StgSharp/Math/Linear/matrix3x3.cs +++ b/源代码/StgSharp/Math/Linear/matrix3x3.cs @@ -1,13 +1,44 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="matrix3x3.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)] + [StructLayout(LayoutKind.Explicit, Size = (6 * 4 * sizeof(float)) + sizeof(bool), Pack = 16)] public struct Matrix3x3 { + [FieldOffset(0)] internal Mat3 mat; [FieldOffset(3 * 4 * sizeof(float))] internal Mat3 transpose; [FieldOffset(6 * 4 * sizeof(float))] internal bool isTransposed; @@ -15,17 +46,6 @@ namespace StgSharp.Math [FieldOffset(1 * 4 * sizeof(float))] public vec3d Colum1; [FieldOffset(2 * 4 * sizeof(float))] public vec3d Colum2; - public Matrix3x3( - 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); - } - internal Matrix3x3( Vector4 c0, Vector4 c1, @@ -37,34 +57,45 @@ namespace StgSharp.Math mat.colum2 = c2; } + public Matrix3x3( + 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) + if ((rowNum > 2) || (rowNum < 0)) { throw new ArgumentOutOfRangeException(nameof(columNum)); } - if (columNum > 2 || columNum < 0) + 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; + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); return *(float*)pbit; } } set { - if (rowNum > 2 || rowNum < 0) + if ((rowNum > 2) || (rowNum < 0)) { throw new ArgumentOutOfRangeException(nameof(columNum)); } - if (columNum > 2 || columNum < 0) + if ((columNum > 2) || (columNum < 0)) { InternalIO.InternalWriteLog( $"Attempt to write unused space in {GetType().Name} {nameof(mat)}", @@ -74,15 +105,24 @@ namespace StgSharp.Math InternalTranspose(); fixed (float* p = &this.transpose.m00) { - ulong pbit = (ulong)p - + (ulong)sizeof(Vector4) * (ulong)rowNum - + (ulong)sizeof(float) * (ulong)columNum; + 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() { @@ -96,25 +136,6 @@ namespace StgSharp.Math } } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe float Det() - { - fixed (Mat3* mat = &this.mat) - { - return InternalIO.det_mat3(mat); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix3x3 operator +(Matrix3x3 left, Matrix3x3 right) - { - return new Matrix3x3( - left.mat.colum0 + right.mat.colum0, - left.mat.colum1 + right.mat.colum1, - left.mat.colum2 + right.mat.colum2 - ); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Matrix3x3 operator -(Matrix3x3 left, Matrix3x3 right) { @@ -135,16 +156,6 @@ namespace StgSharp.Math ); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix3x3 operator /(Matrix3x3 mat, float value) - { - return new Matrix3x3( - mat.mat.colum0 / value, - mat.mat.colum1 / value, - mat.mat.colum2 / value - ); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static vec3d operator *(Matrix3x3 left, vec3d right) { @@ -213,6 +224,26 @@ namespace StgSharp.Math ); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix3x3 operator /(Matrix3x3 mat, float value) + { + return new Matrix3x3( + mat.mat.colum0 / value, + mat.mat.colum1 / value, + mat.mat.colum2 / value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix3x3 operator +(Matrix3x3 left, Matrix3x3 right) + { + return new Matrix3x3( + left.mat.colum0 + right.mat.colum0, + left.mat.colum1 + right.mat.colum1, + left.mat.colum2 + right.mat.colum2 + ); + } + } } diff --git a/源代码/StgSharp/Math/Linear/matrix3x4.cs b/源代码/StgSharp/Math/Linear/matrix3x4.cs index 7b615905..7a5c1ca8 100644 --- a/源代码/StgSharp/Math/Linear/matrix3x4.cs +++ b/源代码/StgSharp/Math/Linear/matrix3x4.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="matrix3x4.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; @@ -7,9 +37,10 @@ using System.Runtime.InteropServices; namespace StgSharp.Math { - [StructLayout(LayoutKind.Explicit, Size = 7 * 4 * sizeof(float) + sizeof(bool), Pack = 16)] + [StructLayout(LayoutKind.Explicit, Size = (7 * 4 * sizeof(float)) + sizeof(bool), Pack = 16)] public struct Matrix3x4 { + [FieldOffset(0)] internal Mat4 mat; [FieldOffset(4 * 4 * sizeof(float))] internal Mat3 transpose; [FieldOffset(7 * 4 * sizeof(float))] internal bool isTransposed; @@ -19,16 +50,9 @@ namespace StgSharp.Math [FieldOffset(2 * 4 * sizeof(float))] public vec3d Colum2; [FieldOffset(3 * 4 * sizeof(float))] public vec3d Colum3; - public Matrix3x4( - float a00, float a01, float a02, float a03, - float a10, float a11, float a12, float a13, - float a20, float a21, float a22, float a23 - ) + internal Matrix3x4(Mat4 mat) { - 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); + this.mat = mat; } internal Matrix3x4( @@ -44,48 +68,55 @@ namespace StgSharp.Math mat.colum3 = c3; } - internal Matrix3x4(Mat4 mat) + public Matrix3x4( + float a00, float a01, float a02, float a03, + float a10, float a11, float a12, float a13, + float a20, float a21, float a22, float a23 + ) { - this.mat = mat; + 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) + if ((rowNum > 2) || (rowNum < 0)) { throw new ArgumentOutOfRangeException(nameof(columNum)); } - if (columNum > 3 || columNum < 0) + 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; + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); return *(float*)pbit; } } set { - if (rowNum > 2 || rowNum < 0) + if ((rowNum > 2) || (rowNum < 0)) { throw new ArgumentOutOfRangeException(nameof(columNum)); } - if (columNum > 3 || columNum < 0) + 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; + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); *(float*)pbit = value; } isTransposed = false; @@ -97,25 +128,17 @@ namespace StgSharp.Math if (!isTransposed) { fixed (Mat4* source = &this.mat) - fixed (Mat3* target = &this.transpose) { - InternalIO.Transpose4to3_internal(source, target); + fixed (Mat3* target = &this.transpose) + { + InternalIO.Transpose4to3_internal(source, target); + } } + isTransposed = true; } } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix3x4 operator +(Matrix3x4 left, Matrix3x4 right) - { - return new Matrix3x4( - 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 Matrix3x4 operator -(Matrix3x4 left, Matrix3x4 right) { @@ -138,17 +161,6 @@ namespace StgSharp.Math ); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix3x4 operator /(Matrix3x4 mat, float value) - { - return new Matrix3x4( - mat.mat.colum0 / value, - mat.mat.colum1 / value, - mat.mat.colum2 / value, - mat.mat.colum3 / value - ); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Matrix3x2 operator *(Matrix3x4 left, Matrix4x2 right) { @@ -206,6 +218,28 @@ namespace StgSharp.Math ); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix3x4 operator /(Matrix3x4 mat, float value) + { + return new Matrix3x4( + mat.mat.colum0 / value, + mat.mat.colum1 / value, + mat.mat.colum2 / value, + mat.mat.colum3 / value + ); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix3x4 operator +(Matrix3x4 left, Matrix3x4 right) + { + return new Matrix3x4( + 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/源代码/StgSharp/Math/Linear/matrix4x2.cs b/源代码/StgSharp/Math/Linear/matrix4x2.cs index cf7a7156..050e64dd 100644 --- a/源代码/StgSharp/Math/Linear/matrix4x2.cs +++ b/源代码/StgSharp/Math/Linear/matrix4x2.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="matrix4x2.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; @@ -8,13 +38,28 @@ namespace StgSharp.Math { - [StructLayout(LayoutKind.Explicit, Size = (16 + 8) * sizeof(float) + sizeof(bool), Pack = 16)] + [StructLayout(LayoutKind.Explicit, Size = ((16 + 8) * sizeof(float)) + sizeof(bool), Pack = 16)] public struct Matrix4x2 { + [FieldOffset(0)] internal Mat2 mat; [FieldOffset(8 * sizeof(float))] internal Mat4 transpose; [FieldOffset((16 + 8) * sizeof(float))] internal bool isTransposed; + internal Matrix4x2(Mat2 mat) + { + this.mat = mat; + } + + internal Matrix4x2( + Vector4 c0, + Vector4 c1 + ) + { + mat.colum0 = c0; + mat.colum1 = c1; + } + public Matrix4x2( float a00, float a01, @@ -27,71 +72,82 @@ namespace StgSharp.Math mat.colum1 = new Vector4(a01, a11, a21, a31); } - internal Matrix4x2( - Vector4 c0, - Vector4 c1 - ) - { - mat.colum0 = c0; - mat.colum1 = c1; - } - - internal Matrix4x2(Mat2 mat) - { - this.mat = mat; - } - public unsafe float this[int rowNum, int columNum] { get { - if (rowNum > 3 || rowNum < 0) + if ((rowNum > 3) || (rowNum < 0)) { throw new ArgumentOutOfRangeException(nameof(columNum)); } - if (columNum > 1 || columNum < 0) + 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; + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); return *(float*)pbit; } } set { - if (rowNum > 3 || rowNum < 0) + if ((rowNum > 3) || (rowNum < 0)) { throw new ArgumentOutOfRangeException(nameof(columNum)); } - if (columNum > 1 || columNum < 0) + 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; + 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)] - public static unsafe Matrix4x2 operator +(Matrix4x2 left, Matrix4x2 right) + 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 Matrix4x2 operator -(Matrix4x2 left, Matrix4x2 right) { return new Matrix4x2( - left.mat.colum0 + right.mat.colum0, - left.mat.colum0 + right.mat.colum0 + left.mat.colum0 - right.mat.colum0, + left.mat.colum0 - right.mat.colum0 ); } @@ -104,24 +160,6 @@ namespace StgSharp.Math ); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix4x2 operator /(Matrix4x2 mat, float value) - { - return new Matrix4x2( - mat.mat.colum0 / value, - mat.mat.colum1 / value - ); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe Matrix4x2 operator -(Matrix4x2 left, Matrix4x2 right) - { - return new Matrix4x2( - left.mat.colum0 - right.mat.colum0, - left.mat.colum0 - right.mat.colum0 - ); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Matrix4x2 operator *(Matrix4x2 left, Matrix2x2 right) { @@ -192,24 +230,20 @@ namespace StgSharp.Math } [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal unsafe void InternalTranspose() + public static Matrix4x2 operator /(Matrix4x2 mat, float value) { - if (!isTransposed) - { - fixed (Mat2* source = &this.mat) - fixed (Mat4* target = &this.transpose) - { - InternalIO.Transpose2to4_internal(source, target); - } - isTransposed = true; - } + return new Matrix4x2( + mat.mat.colum0 / value, + mat.mat.colum1 / value + ); } - public override int GetHashCode() + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe Matrix4x2 operator +(Matrix4x2 left, Matrix4x2 right) { - return HashCode.Combine( - mat.colum0.GetHashCode(), - mat.colum1.GetHashCode() + return new Matrix4x2( + left.mat.colum0 + right.mat.colum0, + left.mat.colum0 + right.mat.colum0 ); } diff --git a/源代码/StgSharp/Math/Linear/matrix4x3.cs b/源代码/StgSharp/Math/Linear/matrix4x3.cs index d6008c0b..4cdd9df4 100644 --- a/源代码/StgSharp/Math/Linear/matrix4x3.cs +++ b/源代码/StgSharp/Math/Linear/matrix4x3.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="matrix4x3.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; @@ -6,9 +36,10 @@ using System.Runtime.InteropServices; namespace StgSharp.Math { - [StructLayout(LayoutKind.Explicit, Size = 7 * 4 * sizeof(float) + sizeof(bool), Pack = 16)] + [StructLayout(LayoutKind.Explicit, Size = (7 * 4 * sizeof(float)) + sizeof(bool), Pack = 16)] public struct Matrix4x3 : IEquatable { + [FieldOffset(0)] internal Mat3 mat; @@ -18,6 +49,17 @@ namespace StgSharp.Math [FieldOffset(7 * 4 * sizeof(float))] internal bool isTransposed; + internal Matrix4x3( + Vector4 c0, + Vector4 c1, + Vector4 c2 + ) + { + mat.colum0 = c0; + mat.colum1 = c1; + mat.colum2 = c2; + } + public Matrix4x3( float a00, float a01, float a02, float a10, float a11, float a12, @@ -30,94 +72,85 @@ namespace StgSharp.Math mat.colum2 = new Vector4(a02, a12, a22, a32); } - internal Matrix4x3( - Vector4 c0, - Vector4 c1, - Vector4 c2 - ) - { - mat.colum0 = c0; - mat.colum1 = c1; - mat.colum2 = c2; - } - public unsafe float this[int rowNum, int columNum] { get { - if (rowNum > 3 || rowNum < 0) + if ((rowNum > 3) || (rowNum < 0)) { throw new ArgumentOutOfRangeException(nameof(columNum)); } - if (columNum > 2 || columNum < 0) + 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; + ulong pbit = ((ulong)p) + + (((ulong)sizeof(Vector4)) * ((ulong)rowNum)) + + (((ulong)sizeof(float)) * ((ulong)columNum)); return *(float*)pbit; } } set { - if (rowNum > 3 || rowNum < 0) + if ((rowNum > 3) || (rowNum < 0)) { throw new ArgumentOutOfRangeException(nameof(columNum)); } - if (columNum > 2 || columNum < 0) + 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; + 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 Matrix4x3 x) && Equals(x); + } + + public bool Equals(Matrix4x3 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); + fixed (Mat4* target = &this.transpose) + { + InternalIO.Transpose3to4_internal(source, target); + } } + isTransposed = true; } } - public override bool Equals(object? obj) - { - return obj is Matrix4x3 x && Equals(x); - } - - public bool Equals(Matrix4x3 other) - { - return EqualityComparer.Default.Equals(mat, other.mat); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix4x3 operator +(Matrix4x3 left, Matrix4x3 right) - { - return new Matrix4x3( - left.mat.colum0 + right.mat.colum0, - left.mat.colum1 + right.mat.colum1, - left.mat.colum2 + right.mat.colum2 - ); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Matrix4x3 operator -(Matrix4x3 left, Matrix4x3 right) { @@ -128,11 +161,6 @@ namespace StgSharp.Math ); } - public static bool operator ==(Matrix4x3 left, Matrix4x3 right) - { - return left.Equals(right); - } - public static bool operator !=(Matrix4x3 left, Matrix4x3 right) { return !(left == right); @@ -148,16 +176,6 @@ namespace StgSharp.Math ); } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Matrix4x3 operator /(Matrix4x3 mat, float value) - { - return new Matrix4x3( - mat.mat.colum0 / value, - mat.mat.colum1 / value, - mat.mat.colum2 / value - ); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Matrix4x2 operator *(Matrix4x3 left, Matrix3x2 right) { @@ -230,13 +248,30 @@ namespace StgSharp.Math ); } - public override int GetHashCode() + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix4x3 operator /(Matrix4x3 mat, float value) { - return HashCode.Combine( - mat.colum0.GetHashCode(), - mat.colum1.GetHashCode(), - mat.colum2.GetHashCode() + return new Matrix4x3( + mat.mat.colum0 / value, + mat.mat.colum1 / value, + mat.mat.colum2 / value ); } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Matrix4x3 operator +(Matrix4x3 left, Matrix4x3 right) + { + return new Matrix4x3( + left.mat.colum0 + right.mat.colum0, + left.mat.colum1 + right.mat.colum1, + left.mat.colum2 + right.mat.colum2 + ); + } + + public static bool operator ==(Matrix4x3 left, Matrix4x3 right) + { + return left.Equals(right); + } + } } \ No newline at end of file diff --git a/源代码/StgSharp/Math/Linear/matrix4x4.cs b/源代码/StgSharp/Math/Linear/matrix4x4.cs index 17c0e67a..dbadcdab 100644 --- a/源代码/StgSharp/Math/Linear/matrix4x4.cs +++ b/源代码/StgSharp/Math/Linear/matrix4x4.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="matrix4x4.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; @@ -8,15 +38,34 @@ using System.Runtime.InteropServices; namespace StgSharp.Math { - - [StructLayout(LayoutKind.Explicit, Size = 2*16*sizeof(float)+sizeof(bool), Pack = 16)] + + [StructLayout(LayoutKind.Explicit, Size = (2 * 16 * sizeof(float)) + sizeof(bool), Pack = 16)] public struct Matrix4x4 : IEquatable { + [FieldOffset(0)] internal Mat4 mat; - [FieldOffset(64*sizeof(float))] internal Mat4 transpose; - [FieldOffset(2*64*sizeof(float))]internal bool isTransposed; - + [FieldOffset(64 * sizeof(float))] internal Mat4 transpose; + [FieldOffset(2 * 64 * sizeof(float))] internal bool isTransposed; + + internal Matrix4x4(Mat4 mat) + { + this.mat = mat; + } + + internal Matrix4x4( + Vector4 vec0, + Vector4 vec1, + Vector4 vec2, + Vector4 vec3 + ) + { + mat.colum0 = vec0; + mat.colum1 = vec1; + mat.colum2 = vec2; + mat.colum3 = vec3; + } + public unsafe Matrix4x4( float a00, float a01, float a02, float a03, @@ -36,40 +85,40 @@ namespace StgSharp.Math { get { - if (rowNum>3||rowNum<0) + if ((rowNum > 3) || (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 > 3 || rowNum < 0) - { - throw new ArgumentOutOfRangeException(nameof(columNum)); - } - if (columNum > 3 || columNum < 0) + 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; + 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 > 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; @@ -78,46 +127,73 @@ namespace StgSharp.Math } - internal Matrix4x4( - Vector4 vec0, - Vector4 vec1, - Vector4 vec2, - Vector4 vec3 - ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe float Det() { - mat.colum0 = vec0; - mat.colum1 = vec1; - mat.colum2 = vec2; - mat.colum3 = vec3; + InternalTranspose(); + fixed (Mat4* _this = &mat, _trans = &transpose) + { + return InternalIO.det_mat4(_this, _trans); + } } - internal Matrix4x4(Mat4 mat) + public override bool Equals(object? obj) { - this.mat = mat; + return (obj is Matrix4x4 x) && Equals(x); } + public bool Equals(Matrix4x4 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)] - public static unsafe Matrix4x4 operator +(Matrix4x4 left, Matrix4x4 right) + internal unsafe void InternalTranspose() { - return new Matrix4x4( - right.mat.colum0 + left.mat.colum0, - right.mat.colum1 + left.mat.colum1, - right.mat.colum2 + left.mat.colum2, - right.mat.colum3 + left.mat.colum3 - ); + if (!isTransposed) + { + fixed (Mat4* source = &this.mat, target = &this.transpose) + { + InternalIO.Transpose4to4_internal(source, target); + } + + isTransposed = true; + } } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Matrix4x4 operator -(Matrix4x4 left, Matrix4x4 right) { return new Matrix4x4( - right.mat.colum0-left.mat.colum0, - right.mat.colum1-left.mat.colum1, - right.mat.colum2-left.mat.colum2, - right.mat.colum3-left.mat.colum3 + 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 !=(Matrix4x4 left, Matrix4x4 right) + { + return !(left == right); + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe Matrix4x4 operator *(Matrix4x4 mat, float value) { @@ -153,21 +229,21 @@ namespace StgSharp.Math { left.InternalTranspose(); return new Matrix4x3( - 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), - 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.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) + 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) ); } @@ -199,65 +275,20 @@ namespace StgSharp.Math ); } - public static bool operator ==(Matrix4x4 left, Matrix4x4 right) - { - return left.Equals(right); - } - - public static bool operator !=(Matrix4x4 left, Matrix4x4 right) - { - return !(left == right); - } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe float Det() + public static unsafe Matrix4x4 operator +(Matrix4x4 left, Matrix4x4 right) { - InternalTranspose(); - fixed (Mat4* _this = &mat, _trans = &transpose) - { - return InternalIO.det_mat4(_this,_trans); - } - } - - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal unsafe void InternalTranspose() - { - if (!isTransposed) - { - fixed (Mat4* source = &this.mat, target = &this.transpose) - { - InternalIO.Transpose4to4_internal(source, target); - } - - isTransposed = true; - } - } - - public override bool Equals(object? obj) - { - return obj is Matrix4x4 x && Equals(x); - } - - public bool Equals(Matrix4x4 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() + return new Matrix4x4( + 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 override string ToString() + public static bool operator ==(Matrix4x4 left, Matrix4x4 right) { - InternalTranspose(); - return $"{transpose.colum0}{transpose.colum1}{transpose.colum2}{transpose.colum3}"; + return left.Equals(right); } } diff --git a/源代码/StgSharp/Math/Linear/vec2d.cs b/源代码/StgSharp/Math/Linear/vec2d.cs index 6f6c1877..9edd580a 100644 --- a/源代码/StgSharp/Math/Linear/vec2d.cs +++ b/源代码/StgSharp/Math/Linear/vec2d.cs @@ -1,4 +1,34 @@ -using System.Numerics; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -22,30 +52,23 @@ namespace StgSharp.Math [FieldOffset(0)] internal Vector2 v; - public Vec2d(float x, float y) - { - v = new Vector2(x, y); - } - internal Vec2d(Vector2 vec) { v = vec; } - public static Vec2d Zero + public Vec2d(float x, float y) { - get { return new Vec2d(0, 0); } + v = new Vector2(x, y); } - public static Vec2d Unit - { - get { return new Vec2d(1, 1); } - } + public static Vec2d Unit => new Vec2d(1, 1); - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Vec2d operator +(Vec2d left, Vec2d right) + public static Vec2d Zero => new Vec2d(0, 0); + + public float Cross(Vec2d right) { - return new Vec2d(left.v + right.v); + return (X * right.Y) - (Y * right.X); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -54,6 +77,11 @@ namespace StgSharp.Math 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); @@ -64,20 +92,16 @@ namespace StgSharp.Math return new Vec2d(vec.v / value); } + [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.v == right.v; } - public static bool operator !=(Vec2d left, Vec2d right) - { - return !(left == right); - } - - public float Cross(Vec2d right) - { - return X * right.Y - Y * right.X; - } - } } diff --git a/源代码/StgSharp/Math/Linear/vec3d.cs b/源代码/StgSharp/Math/Linear/vec3d.cs index 1d664b5b..3a29feb1 100644 --- a/源代码/StgSharp/Math/Linear/vec3d.cs +++ b/源代码/StgSharp/Math/Linear/vec3d.cs @@ -1,4 +1,35 @@ -using StgSharp.Controlling; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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.Controlling; + using System; using System.Numerics; using System.Runtime.CompilerServices; @@ -10,6 +41,7 @@ namespace StgSharp.Math [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] public struct vec3d : IEquatable { + [FieldOffset(0)] internal Vector4 vec; [FieldOffset(0)] @@ -19,21 +51,6 @@ namespace StgSharp.Math [FieldOffset(4)] public float Y; [FieldOffset(8)] public float Z; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public vec3d Zero() - { - return new vec3d(0, 0, 0); - } - - public vec3d( - float x, float y, float z) - { -#if NET5_0_OR_GREATER - Unsafe.SkipInit(out vec); -#endif - v = new Vector3(x, y, z); - } - internal vec3d(Vector4 vector) { vec = vector; @@ -44,6 +61,25 @@ namespace StgSharp.Math v = vector; } + public vec3d( + float x, float y, float z) + { +#if NET5_0_OR_GREATER + Unsafe.SkipInit(out vec); +#endif + v = new Vector3(x, y, z); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public vec3d Cross(vec3d right) + { + return new vec3d( + (this.Y * right.Z) - (this.Z * right.Y), + (this.X * right.Z) - (this.Z * right.X), + (this.X * right.Y) - (this.Y * right.X) + ); + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public float Dot(vec3d right) { @@ -53,75 +89,6 @@ namespace StgSharp.Math + vector4.Z; } - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public vec3d Cross(vec3d right) - { - return new vec3d( - this.Y * right.Z - this.Z * right.Y, - this.X * right.Z - this.Z * right.X, - this.X * right.Y - this.Y * right.X - ); - } - - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static vec3d operator +(vec3d left, vec3d right) - { - return new vec3d( - left.vec + right.vec - ); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public float GetMaxValue() - { - float ret = X; - ret = ret > Y ? ret : Y; - ret = ret > Z ? ret : Z; - return ret; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static vec3d operator -(vec3d left, vec3d right) - { - return new vec3d(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 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 bool operator ==(vec3d left, vec3d right) - { - return left.v == right.v; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool operator !=(vec3d left, vec3d right) - { - return left.v != right.v; - } - - public string ToString(string sample) - { - return $"[{X.ToString(sample)},{Y.ToString(sample)},{Z.ToString(sample)}]"; - } - public bool Equals(vec3d other) { return this.vec == other.vec; @@ -139,21 +106,91 @@ namespace StgSharp.Math } } - public unsafe override int GetHashCode() + 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 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; + } + } public static class Vec3d { - public static vec3d Unit { get => new vec3d(1, 1, 1); } - public static vec3d Zero { get => new vec3d(0, 0, 0); } + + public static vec3d Unit => new vec3d(1, 1, 1); + public static vec3d Zero => new vec3d(0, 0, 0); + } } diff --git a/源代码/StgSharp/Math/Linear/vec4d.cs b/源代码/StgSharp/Math/Linear/vec4d.cs index 672ebd38..8553c89d 100644 --- a/源代码/StgSharp/Math/Linear/vec4d.cs +++ b/源代码/StgSharp/Math/Linear/vec4d.cs @@ -1,4 +1,34 @@ -using StgSharp.Controlling; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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.Controlling; using StgSharp.Math; using System; @@ -11,6 +41,7 @@ namespace StgSharp.Math [StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)] public struct Vec4d { + [FieldOffset(0)] internal Vector4 vec; [FieldOffset(0)] internal M128 reg; @@ -28,5 +59,6 @@ namespace StgSharp.Math { return vec.reg; } + } } \ No newline at end of file diff --git a/源代码/StgSharp/Math/Scalar/ACos.cs b/源代码/StgSharp/Math/Scalar/ACos.cs index 4612807b..dcbd5983 100644 --- a/源代码/StgSharp/Math/Scalar/ACos.cs +++ b/源代码/StgSharp/Math/Scalar/ACos.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 @@ -75,5 +105,6 @@ namespace StgSharp.Math return piby2 - v; */ } + } } diff --git a/源代码/StgSharp/Math/Scalar/ASin.cs b/源代码/StgSharp/Math/Scalar/ASin.cs index b3ac56d6..fe6959c8 100644 --- a/源代码/StgSharp/Math/Scalar/ASin.cs +++ b/源代码/StgSharp/Math/Scalar/ASin.cs @@ -1,4 +1,34 @@ -// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// // // some of the code is rewritten from the AMD code: // https://github.com/amd/aocl-libm-ose/blob/a43e092b03213eb0e129a1cc129900e6e4475778/src/ref/asinf.c @@ -89,5 +119,6 @@ namespace StgSharp.Math return sign * v; */ } + } } diff --git a/源代码/StgSharp/Math/Scalar/ATan.cs b/源代码/StgSharp/Math/Scalar/ATan.cs index c174217d..0939826e 100644 --- a/源代码/StgSharp/Math/Scalar/ATan.cs +++ b/源代码/StgSharp/Math/Scalar/ATan.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 @@ -84,5 +114,6 @@ namespace StgSharp.Math return v; */ } + } } diff --git a/源代码/StgSharp/Math/Scalar/BasicOps.cs b/源代码/StgSharp/Math/Scalar/BasicOps.cs index e920d005..ad0c66ac 100644 --- a/源代码/StgSharp/Math/Scalar/BasicOps.cs +++ b/源代码/StgSharp/Math/Scalar/BasicOps.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="BasicOps.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.Globalization; using System.Runtime.CompilerServices; @@ -6,6 +36,7 @@ namespace StgSharp.Math { public static unsafe partial class Scaler { + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe float Abs(float x) { @@ -36,5 +67,6 @@ namespace StgSharp.Math return CultureInfo.CurrentCulture.TextInfo.ListSeparator; } + } } \ No newline at end of file diff --git a/源代码/StgSharp/Math/Scalar/Cos.cs b/源代码/StgSharp/Math/Scalar/Cos.cs index 4242d7bc..fec41150 100644 --- a/源代码/StgSharp/Math/Scalar/Cos.cs +++ b/源代码/StgSharp/Math/Scalar/Cos.cs @@ -1,4 +1,34 @@ -namespace StgSharp.Math +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +namespace StgSharp.Math { public static partial class Scaler { @@ -15,8 +45,9 @@ 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 ((-sinData[a]) * ((0.1570796327f * refer) - (6.459640975e-4f * refer * refer2))) + + (cosData[a] * ((1 - (0.0123370055f * refer2)) + (2.536695709e-5f * refer2 * refer2))); } + } } diff --git a/源代码/StgSharp/Math/Scalar/Ctor.cs b/源代码/StgSharp/Math/Scalar/Ctor.cs index 51373929..d9c239f1 100644 --- a/源代码/StgSharp/Math/Scalar/Ctor.cs +++ b/源代码/StgSharp/Math/Scalar/Ctor.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 @@ -7,18 +37,20 @@ namespace StgSharp.Math 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); - const uint MEM_COMMIT = 0x1000; - const uint MEM_RESERVE = 0x2000; - const uint PAGE_EXECUTE_READWRITE = 0x40; - const uint MEM_RELEASE = 0x8000; - - static Scaler() - { - } } } diff --git a/源代码/StgSharp/Math/Scalar/Exp.cs b/源代码/StgSharp/Math/Scalar/Exp.cs index 656a2386..7934cc44 100644 --- a/源代码/StgSharp/Math/Scalar/Exp.cs +++ b/源代码/StgSharp/Math/Scalar/Exp.cs @@ -1,9 +1,40 @@ -namespace StgSharp.Math +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; /// @@ -30,12 +61,12 @@ 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)))); + t = 1.0f + (x * ( + 1.0f + (x * ( + 0.5f + (x * ( + 0.1666666667f + (x * ( + 0.0416666666667f + (x * + 8.333333333e-3f))))))))); } else { @@ -45,20 +76,20 @@ */ uint zBit = *(uint*)&z; uint zBitAbs = zBit & 0b_0111_1111_1111_1111_1111_1111_1111_1111; - uint uintm = (zBitAbs >> 23); + 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; + float n = (*(float*)&nBit) - 1; - t = 2.718281828f + n * ( - 2.718281828f + n * ( - 1.359140914f + n * ( - 0.4530469714f + n * ( - 0.1132617429f + n * - 0.02265234857f)))); + 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++) { @@ -72,5 +103,6 @@ } return t; } + } } diff --git a/源代码/StgSharp/Math/Scalar/Function.cs b/源代码/StgSharp/Math/Scalar/Function.cs index 5de1681a..af8aa838 100644 --- a/源代码/StgSharp/Math/Scalar/Function.cs +++ b/源代码/StgSharp/Math/Scalar/Function.cs @@ -1,4 +1,34 @@ -namespace StgSharp.Math +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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/源代码/StgSharp/Math/Scalar/Log.cs b/源代码/StgSharp/Math/Scalar/Log.cs index f15c4db4..2c288265 100644 --- a/源代码/StgSharp/Math/Scalar/Log.cs +++ b/源代码/StgSharp/Math/Scalar/Log.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 { @@ -41,16 +71,16 @@ namespace StgSharp.Math 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; + 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 + + (f * 0.6931471806f) + result + logArray[order]; } diff --git a/源代码/StgSharp/Math/Scalar/Pow.cs b/源代码/StgSharp/Math/Scalar/Pow.cs index 3f6b6057..496f378e 100644 --- a/源代码/StgSharp/Math/Scalar/Pow.cs +++ b/源代码/StgSharp/Math/Scalar/Pow.cs @@ -1,7 +1,38 @@ -namespace StgSharp.Math +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 /// @@ -23,15 +54,15 @@ * */ float z, t; - if (x == 1 || y == 0) + if ((x == 1) || (y == 0)) { return 1; } - if (x == 1 && y == 0) + if ((x == 1) && (y == 0)) { return float.PositiveInfinity; } - if (x==0&&y!=0) + if ((x == 0) && (y != 0)) { return 0; } @@ -47,31 +78,31 @@ if (z < 0.5f) { - t = 1.0f + z * ( - 1.0f + z * ( - 0.5f + z * ( - 0.1666666667f + z * ( - 0.0416666666667f + z * - 8.333333333e-3f)))); + 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); + 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; + float n = (*(float*)&nBit) - 1; - t = 2.718281828f + n * ( - 2.718281828f + n * ( - 1.359140914f + n * ( - 0.4530469714f + n * ( - 0.1132617429f + n * - 0.02265234857f)))); + 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++) { @@ -87,5 +118,6 @@ return t; } + } } diff --git a/源代码/StgSharp/Math/Scalar/Random.cs b/源代码/StgSharp/Math/Scalar/Random.cs index f7dd4a1c..c4874a88 100644 --- a/源代码/StgSharp/Math/Scalar/Random.cs +++ b/源代码/StgSharp/Math/Scalar/Random.cs @@ -1,4 +1,35 @@ -using StgSharp.Controlling; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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.Controlling; + using System; using System.Collections.Generic; using System.Runtime.CompilerServices; @@ -16,15 +47,6 @@ namespace StgSharp.Math = Abs(System.DateTime.UtcNow.GetHashCode()); #endif - /// - /// - /// - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float Random() - { - throw new NotImplementedException(); - } /// /// returns a random float number between 0 and 1. @@ -46,7 +68,7 @@ namespace StgSharp.Math currentSeed = sample; sample2 *= 1000000; - float result = sample2 - (int)sample2; + float result = sample2 - ((int)sample2); if (result == 0) { currentSeed = sample2 + 0.1f; @@ -55,6 +77,15 @@ namespace StgSharp.Math return result; } + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Random() + { + throw new NotImplementedException(); + } /// /// Generates a random seed in int value. @@ -70,5 +101,6 @@ namespace StgSharp.Math return *(int*)&seedValue; } + } } diff --git a/源代码/StgSharp/Math/Scalar/Sin.cs b/源代码/StgSharp/Math/Scalar/Sin.cs index 7036a909..7b394e0c 100644 --- a/源代码/StgSharp/Math/Scalar/Sin.cs +++ b/源代码/StgSharp/Math/Scalar/Sin.cs @@ -1,11 +1,56 @@ -using System.Net.NetworkInformation; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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.Net.NetworkInformation; 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, @@ -18,19 +63,6 @@ namespace StgSharp.Math -0.70710684750053f, -0.587785330331566f, -0.453990588074927f, -0.309017091212098f, -0.156434568253757f, - }; - 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, - - }; public static unsafe float Sin(float x) @@ -45,8 +77,9 @@ namespace StgSharp.Math 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 (sinData[a] * ((1 - (0.0123370055f * refer2)) + (2.536695709e-5f * refer2 * refer2))) + + (cosData[a] * ((0.1570796327f * refer) - (6.459640975e-4f * refer * refer2))); } + } } diff --git a/源代码/StgSharp/Math/Scalar/Sqrt.cs b/源代码/StgSharp/Math/Scalar/Sqrt.cs index 25d33d1e..e281655e 100644 --- a/源代码/StgSharp/Math/Scalar/Sqrt.cs +++ b/源代码/StgSharp/Math/Scalar/Sqrt.cs @@ -1,16 +1,40 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static float Sqrt(float x) - { - return MathF.Sqrt(x); - /**/ - } public static unsafe float SeedSqrt(float x) { @@ -73,8 +97,15 @@ namespace StgSharp.Math e += f; float result = *(float*)&e; - result = (result + x / result) / 2; - return (result + x / result) / 2; + 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/源代码/StgSharp/Math/Scalar/Tan.cs b/源代码/StgSharp/Math/Scalar/Tan.cs index e4e06d49..687727b0 100644 --- a/源代码/StgSharp/Math/Scalar/Tan.cs +++ b/源代码/StgSharp/Math/Scalar/Tan.cs @@ -1,4 +1,34 @@ -namespace StgSharp.Math +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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 { @@ -14,11 +44,12 @@ 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); + 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); + return ((sinData[a] * cos) + (cosData[a] * sin)) + / ((cosData[a] * cos) - (sinData[a] * sin)); } + } } diff --git a/源代码/StgSharp/Math/glClampf.cs b/源代码/StgSharp/Math/glClampf.cs index f3d28b0d..dbe60314 100644 --- a/源代码/StgSharp/Math/glClampf.cs +++ b/源代码/StgSharp/Math/glClampf.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="glClampf.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; @@ -14,6 +44,7 @@ namespace StgSharp.Math [StructLayout(LayoutKind.Sequential)] public struct GLclampf { + public float value; public GLclampf(float a) @@ -21,15 +52,16 @@ namespace StgSharp.Math value = a; } + public static explicit operator float(GLclampf v) + { + return v.value; + } + public static explicit operator GLclampf(float v) { return new GLclampf(v); } - public static explicit operator float(GLclampf v) - { - return v.value; - } } /// @@ -39,6 +71,7 @@ namespace StgSharp.Math [StructLayout(LayoutKind.Sequential)] public struct GLclampd { + public double value; public GLclampd(double a) @@ -46,14 +79,15 @@ namespace StgSharp.Math value = a; } + public static explicit operator double(GLclampd v) + { + return v.value; + } + public static explicit operator GLclampd(double v) { return new GLclampd(v); } - public static explicit operator double(GLclampd v) - { - return v.value; - } } } diff --git a/源代码/StgSharp/Math/glHalfNV.cs b/源代码/StgSharp/Math/glHalfNV.cs index 953057f3..e75b0eea 100644 --- a/源代码/StgSharp/Math/glHalfNV.cs +++ b/源代码/StgSharp/Math/glHalfNV.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// 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; @@ -11,6 +41,7 @@ namespace StgSharp.Math [StructLayout(LayoutKind.Explicit, Size = 16)] public struct GLhalfNV { + [FieldOffset(0)] public short binary; public GLhalfNV(short bin) @@ -18,14 +49,15 @@ namespace StgSharp.Math binary = bin; } + public static explicit operator GLhalfNV(short x) + { + return new GLhalfNV(x); + } + public static explicit operator short(GLhalfNV x) { return x.binary; } - public static explicit operator GLhalfNV(short x) - { - return new GLhalfNV(x); - } } } diff --git a/源代码/StgSharp/bin/x64/Debug/netstandard2.1/StgSharp.dll b/源代码/StgSharp/bin/x64/Debug/netstandard2.1/StgSharp.dll index e1cafb9f..cd384511 100644 Binary files a/源代码/StgSharp/bin/x64/Debug/netstandard2.1/StgSharp.dll and b/源代码/StgSharp/bin/x64/Debug/netstandard2.1/StgSharp.dll differ diff --git a/源代码/StgSharp/bin/x64/Debug/netstandard2.1/StgSharp.xml b/源代码/StgSharp/bin/x64/Debug/netstandard2.1/StgSharp.xml index 88911f27..e09bd156 100644 --- a/源代码/StgSharp/bin/x64/Debug/netstandard2.1/StgSharp.xml +++ b/源代码/StgSharp/bin/x64/Debug/netstandard2.1/StgSharp.xml @@ -26,7 +26,8 @@ - OpenGL package used by current form context. + OpenGL package binded to current form context. + A OpenGL context is only binded to current form. @@ -51,24 +52,18 @@ - 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. + 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. + + Something goes wrong and StgSharp fails in creating a new OpenGL context. + Set all necessary metadata to current form instance - - - Resize the current form - - New width of the window - New height of the window - Resize the current form @@ -77,14 +72,12 @@ A (width,height) representing the new size of current form - + - Set the size limit of current form + Resize the current form - Minimum width of current form - Minimum height of current form - Maximum width of curent form - Maximum height of current form + New width of the window + New height of the window @@ -97,6 +90,15 @@ 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 curent form + Maximum height of current form + Necessary operation to init this form. @@ -105,8 +107,7 @@ - Behaviour of current form when in a render cycle. - When this form + Behaviour of current form when in a render cycle. When this form @@ -119,7 +120,7 @@ Get OpenGL library of this form's context. - A package contains all opengl APIs + A package contains all opengl APIs @@ -163,23 +164,6 @@ New instance of instance. - - - A timer counting frames after its construction. - - - - - Frames after this timer created. - - - - - Convert a into uint value. - this will get total frames since the timer was created. - - to be converted - Interface of all kinds OpenGL buffer onjects @@ -611,21 +595,20 @@ Y position of an enemy entity - + + + Init an instance of OpenGL program, + This method should be called before any other StgSharp api. + + + Version of current StgSharp platform. Main version represent in hundred's digit, and sub version represent in ten's digit. - - - Init an instance of OpenGL program, - This method should be called before other - graphic methods, after LoadGL method. - - - + Write a log message to log file, and mark the level of this message. @@ -709,11 +692,6 @@ 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。 - - - Tick time this geometry eas crested - - Get all sides of this . @@ -726,6 +704,11 @@ + + + Tick time this geometry eas crested + + Update the coordinate of the point. If this is a moving point, @@ -795,6 +778,27 @@ The second value. + + + 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. + + + + + + Time source provider provided in internal framework. + + + + + The method this will call every time a new time span started. + + OpenGL numeric type. diff --git a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.cs b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.cs index 348b87f0..6d967c68 100644 --- a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.cs +++ b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.cs @@ -1,3 +1,33 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file=".NETStandard,Version=v2.1.AssemblyAttributes.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.Reflection; diff --git a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.AssemblyInfo.cs b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.AssemblyInfo.cs index fbb9fdae..51866ba1 100644 --- a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.AssemblyInfo.cs +++ b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.AssemblyInfo.cs @@ -1,3 +1,33 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="StgSharp.AssemblyInfo.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. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- //------------------------------------------------------------------------------ // // 此代码由工具生成。 @@ -14,7 +44,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a770bbe68567b43385bb30c9c86eb80e5b1e23e8")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+15bf989285b01c5617b5f5612667e0da6a2b1781")] [assembly: System.Reflection.AssemblyProductAttribute("StgSharp")] [assembly: System.Reflection.AssemblyTitleAttribute("StgSharp")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.AssemblyInfoInputs.cache b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.AssemblyInfoInputs.cache index 744cc8db..bd9d3620 100644 --- a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.AssemblyInfoInputs.cache +++ b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.AssemblyInfoInputs.cache @@ -1 +1 @@ -559b4f40232d6149ba7b0f1f8a02c2a2db80768c9617d556a49bc6d74abbd942 +a5fb7efba2f765dd708647c8b1db6590919a361aa8faa70d0f2be4d86bb8ef88 diff --git a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache index fdc7eedc..ee6bcf37 100644 --- a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache +++ b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -e8717691e705c7b75c1986d0e9dbd7e0de7ddd4858970bab93baeea5f7aae833 +a06c60f5be94183de3d46acf621d479d68deba0e60d6792c10889c0210bf4540 diff --git a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.dll b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.dll index e1cafb9f..cd384511 100644 Binary files a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.dll and b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.dll differ diff --git a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.sourcelink.json b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.sourcelink.json index cbc457f0..11305d94 100644 --- a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.sourcelink.json +++ b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.sourcelink.json @@ -1 +1 @@ -{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/a770bbe68567b43385bb30c9c86eb80e5b1e23e8/*"}} \ No newline at end of file +{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/15bf989285b01c5617b5f5612667e0da6a2b1781/*"}} \ No newline at end of file diff --git a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.xml b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.xml index 88911f27..e09bd156 100644 --- a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.xml +++ b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/StgSharp.xml @@ -26,7 +26,8 @@ - OpenGL package used by current form context. + OpenGL package binded to current form context. + A OpenGL context is only binded to current form. @@ -51,24 +52,18 @@ - 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. + 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. + + Something goes wrong and StgSharp fails in creating a new OpenGL context. + Set all necessary metadata to current form instance - - - Resize the current form - - New width of the window - New height of the window - Resize the current form @@ -77,14 +72,12 @@ A (width,height) representing the new size of current form - + - Set the size limit of current form + Resize the current form - Minimum width of current form - Minimum height of current form - Maximum width of curent form - Maximum height of current form + New width of the window + New height of the window @@ -97,6 +90,15 @@ 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 curent form + Maximum height of current form + Necessary operation to init this form. @@ -105,8 +107,7 @@ - Behaviour of current form when in a render cycle. - When this form + Behaviour of current form when in a render cycle. When this form @@ -119,7 +120,7 @@ Get OpenGL library of this form's context. - A package contains all opengl APIs + A package contains all opengl APIs @@ -163,23 +164,6 @@ New instance of instance. - - - A timer counting frames after its construction. - - - - - Frames after this timer created. - - - - - Convert a into uint value. - this will get total frames since the timer was created. - - to be converted - Interface of all kinds OpenGL buffer onjects @@ -611,21 +595,20 @@ Y position of an enemy entity - + + + Init an instance of OpenGL program, + This method should be called before any other StgSharp api. + + + Version of current StgSharp platform. Main version represent in hundred's digit, and sub version represent in ten's digit. - - - Init an instance of OpenGL program, - This method should be called before other - graphic methods, after LoadGL method. - - - + Write a log message to log file, and mark the level of this message. @@ -709,11 +692,6 @@ 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。 - - - Tick time this geometry eas crested - - Get all sides of this . @@ -726,6 +704,11 @@ + + + Tick time this geometry eas crested + + Update the coordinate of the point. If this is a moving point, @@ -795,6 +778,27 @@ The second value. + + + 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. + + + + + + Time source provider provided in internal framework. + + + + + The method this will call every time a new time span started. + + OpenGL numeric type. diff --git a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/ref/StgSharp.dll b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/ref/StgSharp.dll index 3002827d..b329b020 100644 Binary files a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/ref/StgSharp.dll and b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/ref/StgSharp.dll differ diff --git a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/refint/StgSharp.dll b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/refint/StgSharp.dll index 3002827d..b329b020 100644 Binary files a/源代码/StgSharp/obj/x64/Debug/netstandard2.1/refint/StgSharp.dll and b/源代码/StgSharp/obj/x64/Debug/netstandard2.1/refint/StgSharp.dll differ diff --git a/源代码/StgSharpC.bsc b/源代码/StgSharpC.bsc index e47c81d3..ec94a2f5 100644 Binary files a/源代码/StgSharpC.bsc and b/源代码/StgSharpC.bsc differ diff --git a/源代码/StgSharpC.dll b/源代码/StgSharpC.dll index 2404217d..a032ac23 100644 Binary files a/源代码/StgSharpC.dll and b/源代码/StgSharpC.dll differ diff --git a/源代码/StgSharpC.exp b/源代码/StgSharpC.exp index 2b9487b2..50569525 100644 Binary files a/源代码/StgSharpC.exp and b/源代码/StgSharpC.exp differ diff --git a/源代码/StgSharpC.lib b/源代码/StgSharpC.lib index ea61c7cd..7d006ae9 100644 Binary files a/源代码/StgSharpC.lib and b/源代码/StgSharpC.lib differ diff --git a/源代码/StgSharpC.pdb b/源代码/StgSharpC.pdb index ed719cb9..50e7187a 100644 Binary files a/源代码/StgSharpC.pdb and b/源代码/StgSharpC.pdb differ diff --git a/源代码/StgSharpC/glfw3.lib b/源代码/StgSharpC/glfw3.lib index 58f9eecb..4baa46d0 100644 Binary files a/源代码/StgSharpC/glfw3.lib and b/源代码/StgSharpC/glfw3.lib differ diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.cod b/源代码/StgSharpC/x64/Debug/StgSharpC.cod index f8f27f70..e0004059 100644 --- a/源代码/StgSharpC/x64/Debug/StgSharpC.cod +++ b/源代码/StgSharpC/x64/Debug/StgSharpC.cod @@ -143,16 +143,15 @@ PUBLIC __local_stdio_printf_options PUBLIC _vfprintf_l PUBLIC printf PUBLIC initGL -PUBLIC loadShaderCode PUBLIC linkShaderProgram PUBLIC loadImageData PUBLIC loadGlfuncDefault PUBLIC unloadImageData PUBLIC readLog PUBLIC __JustMyCode_Default -PUBLIC ??_C@_03OFAPEBGM@?$CFs?6@ ; `string' 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 EXTRN __imp_free:PROC EXTRN glfwInit:PROC @@ -197,12 +196,6 @@ $pdata$initGL DD imagerel $LN3 pdata ENDS ; COMDAT pdata pdata SEGMENT -$pdata$loadShaderCode DD imagerel $LN8 - DD imagerel $LN8+380 - DD imagerel $unwind$loadShaderCode -pdata ENDS -; COMDAT pdata -pdata SEGMENT $pdata$linkShaderProgram DD imagerel $LN5 DD imagerel $LN5+223 DD imagerel $unwind$linkShaderProgram @@ -239,6 +232,10 @@ rtc$TMZ ENDS rtc$IMZ SEGMENT _RTC_InitBase.rtc$IMZ DQ FLAT:_RTC_InitBase rtc$IMZ ENDS +; COMDAT ??_C@_03OFAPEBGM@?$CFs?6@ +CONST SEGMENT +??_C@_03OFAPEBGM@?$CFs?6@ DB '%s', 0aH, 00H ; `string' +CONST ENDS ; COMDAT ??_C@_0BL@MOJGOJJP@Failed?5to?5load?5OpenGL?5api?3@ CONST SEGMENT ??_C@_0BL@MOJGOJJP@Failed?5to?5load?5OpenGL?5api?3@ DB 'Failed to load Op' @@ -248,10 +245,6 @@ CONST ENDS CONST SEGMENT ??_C@_05JMLLFKBP@?$CFllu?6@ DB '%llu', 0aH, 00H ; `string' CONST ENDS -; COMDAT ??_C@_03OFAPEBGM@?$CFs?6@ -CONST SEGMENT -??_C@_03OFAPEBGM@?$CFs?6@ DB '%s', 0aH, 00H ; `string' -CONST ENDS ; COMDAT xdata xdata SEGMENT $unwind$readLog DD 025050f01H @@ -313,39 +306,6 @@ linkShaderProgram$rtcFrameData DD 01H DD 00H DQ FLAT:linkShaderProgram$rtcVarDesc CONST ENDS -; COMDAT voltbl -voltbl SEGMENT -_volmd DW 040H - DW 0163H -voltbl ENDS -; COMDAT xdata -xdata SEGMENT -$unwind$loadShaderCode DD 025054719H - DD 0118231dH - DD 070110029H - DD 05010H - DD imagerel __GSHandlerCheck - DD 0138H -xdata ENDS -; COMDAT CONST -CONST SEGMENT -loadShaderCode$rtcName$0 DB 073H - DB 075H - DB 063H - DB 063H - DB 065H - DB 073H - DB 073H - DB 00H - ORG $+8 -loadShaderCode$rtcVarDesc DD 044H - DD 04H - DQ FLAT:loadShaderCode$rtcName$0 - ORG $+48 -loadShaderCode$rtcFrameData DD 01H - DD 00H - DQ FLAT:loadShaderCode$rtcVarDesc -CONST ENDS ; COMDAT xdata xdata SEGMENT $unwind$initGL DD 025051601H @@ -415,7 +375,7 @@ _TEXT SEGMENT $T1 = 200 readLog PROC ; COMDAT -; 91 : { +; 66 : { $LN5: 00000 40 55 push rbp @@ -427,7 +387,7 @@ $LN5: 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 00016 e8 00 00 00 00 call __CheckForDebuggerJustMyCode -; 92 : infolog[511] = '\0'; +; 67 : infolog[511] = '\0'; 0001b b8 01 00 00 00 mov eax, 1 00020 48 69 c0 ff 01 @@ -448,13 +408,13 @@ $LN4@readLog: 00 00 mov rcx, QWORD PTR $T1[rbp] 00050 c6 04 08 00 mov BYTE PTR [rax+rcx], 0 -; 93 : return &infolog; +; 68 : return &infolog; 00054 48 8d 05 00 00 00 00 lea rax, OFFSET FLAT:infolog $LN2@readLog: -; 94 : } +; 69 : } 0005b 48 8d a5 e8 00 00 00 lea rsp, QWORD PTR [rbp+232] @@ -470,7 +430,7 @@ _TEXT SEGMENT out$ = 224 unloadImageData PROC ; COMDAT -; 86 : { +; 61 : { $LN3: 00000 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx @@ -483,7 +443,7 @@ $LN3: 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 0001a e8 00 00 00 00 call __CheckForDebuggerJustMyCode -; 87 : free(out->pixelPtr); +; 62 : free(out->pixelPtr); 0001f 48 8b 85 e0 00 00 00 mov rax, QWORD PTR out$[rbp] @@ -491,7 +451,7 @@ $LN3: 0002a ff 15 00 00 00 00 call QWORD PTR __imp_free -; 88 : } +; 63 : } 00030 48 8d a5 c8 00 00 00 lea rsp, QWORD PTR [rbp+200] @@ -509,7 +469,7 @@ i$1 = 40 procName$ = 288 loadGlfuncDefault PROC ; COMDAT -; 44 : { +; 19 : { $LN7: 00000 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx @@ -522,29 +482,29 @@ $LN7: 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 0001a e8 00 00 00 00 call __CheckForDebuggerJustMyCode -; 45 : void* ret = glfwGetProcAddress(procName); +; 20 : 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 -; 46 : printf("%llu\n", (uint64_t)ret); +; 21 : printf("%llu\n", (uint64_t)ret); 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 -; 47 : if (ret = NULL) +; 22 : if (ret = NULL) 0003f 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 -; 48 : { -; 49 : *infolog = "Failed to load OpenGL api:"; +; 23 : { +; 24 : *infolog = "Failed to load OpenGL api:"; 0004e b8 01 00 00 00 mov eax, 1 00053 48 6b c0 00 imul rax, rax, 0 @@ -554,7 +514,7 @@ $LN7: 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 -; 50 : for (size_t i = 0; i < sizeof(procName); i++) +; 25 : for (size_t i = 0; i < sizeof(procName); i++) 00068 48 c7 45 28 00 00 00 00 mov QWORD PTR i$1[rbp], 0 @@ -567,8 +527,8 @@ $LN4@loadGlfunc: 0007d 48 83 7d 28 08 cmp QWORD PTR i$1[rbp], 8 00082 73 25 jae SHORT $LN3@loadGlfunc -; 51 : { -; 52 : infolog[30 + i] = procName[i]; +; 26 : { +; 27 : infolog[30 + i] = procName[i]; 00084 48 8d 05 00 00 00 00 lea rax, OFFSET FLAT:infolog @@ -581,12 +541,12 @@ $LN4@loadGlfunc: 000a0 0f b6 09 movzx ecx, BYTE PTR [rcx] 000a3 88 4c 10 1e mov BYTE PTR [rax+rdx+30], cl -; 53 : } +; 28 : } 000a7 eb c9 jmp SHORT $LN2@loadGlfunc $LN3@loadGlfunc: -; 54 : printf("%s\n", infolog); +; 29 : printf("%s\n", infolog); 000a9 48 8d 15 00 00 00 00 lea rdx, OFFSET FLAT:infolog @@ -595,12 +555,12 @@ $LN3@loadGlfunc: 000b7 e8 00 00 00 00 call printf $LN5@loadGlfunc: -; 55 : } -; 56 : return (GLFWglproc)ret; +; 30 : } +; 31 : return (GLFWglproc)ret; 000bc 48 8b 45 08 mov rax, QWORD PTR ret$[rbp] -; 57 : } +; 32 : } 000c0 48 8d a5 08 01 00 00 lea rsp, QWORD PTR [rbp+264] @@ -618,7 +578,7 @@ out$ = 232 loader$ = 240 loadImageData PROC ; COMDAT -; 77 : { +; 52 : { $LN4: 00000 4c 89 44 24 18 mov QWORD PTR [rsp+24], r8 @@ -633,14 +593,14 @@ $LN4: 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 00024 e8 00 00 00 00 call __CheckForDebuggerJustMyCode -; 78 : if (loader == NULL) +; 53 : 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 -; 79 : { -; 80 : loader = stbi_load; +; 54 : { +; 55 : loader = stbi_load; 00033 48 8d 05 00 00 00 00 lea rax, OFFSET FLAT:stbi_load @@ -648,8 +608,8 @@ $LN4: 00 00 mov QWORD PTR loader$[rbp], rax $LN2@loadImageD: -; 81 : } -; 82 : out->pixelPtr = loader(location, &(out->width), &(out->height), &(out->channel), 0); +; 56 : } +; 57 : 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] @@ -671,7 +631,7 @@ $LN2@loadImageD: 00 00 mov rcx, QWORD PTR out$[rbp] 00080 48 89 41 10 mov QWORD PTR [rcx+16], rax -; 83 : } +; 58 : } 00084 48 8d a5 c8 00 00 00 lea rsp, QWORD PTR [rbp+200] @@ -690,7 +650,7 @@ context$ = 256 shaderProgram$ = 264 linkShaderProgram PROC ; COMDAT -; 60 : { +; 35 : { $LN5: 00000 89 54 24 10 mov DWORD PTR [rsp+16], edx @@ -715,7 +675,7 @@ $LN5: 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c 00048 e8 00 00 00 00 call __CheckForDebuggerJustMyCode -; 61 : context->LinkProgram(shaderProgram); +; 36 : context->LinkProgram(shaderProgram); 0004d 8b 8d 08 01 00 00 mov ecx, DWORD PTR shaderProgram$[rbp] @@ -724,9 +684,9 @@ $LN5: 0005a ff 90 80 22 00 00 call QWORD PTR [rax+8832] -; 62 : -; 63 : int success; -; 64 : context->GetProgramiv(shaderProgram, GL_LINK_STATUS, &success); +; 37 : +; 38 : int success; +; 39 : 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 @@ -737,13 +697,13 @@ $LN5: 00076 ff 90 48 1a 00 00 call QWORD PTR [rax+6728] -; 65 : if (!success) +; 40 : if (!success) 0007c 83 7d 04 00 cmp DWORD PTR success$[rbp], 0 00080 75 28 jne SHORT $LN2@linkShader -; 66 : { -; 67 : context->GetProgramInfoLog(shaderProgram, 512, NULL, infolog); +; 41 : { +; 42 : context->GetProgramInfoLog(shaderProgram, 512, NULL, infolog); 00082 4c 8d 0d 00 00 00 00 lea r9, OFFSET FLAT:infolog @@ -756,27 +716,27 @@ $LN5: 0009e ff 90 98 19 00 00 call QWORD PTR [rax+6552] -; 68 : return 0; +; 43 : return 0; 000a4 33 c0 xor eax, eax 000a6 eb 08 jmp SHORT $LN1@linkShader -; 69 : } +; 44 : } 000a8 eb 06 jmp SHORT $LN3@linkShader $LN2@linkShader: -; 70 : else -; 71 : { -; 72 : return shaderProgram; +; 45 : else +; 46 : { +; 47 : return shaderProgram; 000aa 8b 85 08 01 00 00 mov eax, DWORD PTR shaderProgram$[rbp] $LN3@linkShader: $LN1@linkShader: -; 73 : } -; 74 : } +; 48 : } +; 49 : } 000b0 48 8b f8 mov rdi, rax 000b3 48 8d 4d e0 lea rcx, QWORD PTR [rbp-32] @@ -797,192 +757,6 @@ linkShaderProgram ENDP _TEXT ENDS ; Function compile flags: /Odtp /RTCsu /ZI ; File D:\NitloadIndustry\Ñо¿ÏîĿ\1-Flagship\TH2020\ProjectFile\Դ´úÂë\StgSharpC\StgSharpC.c -; COMDAT loadShaderCode -_TEXT SEGMENT -shader$ = 4 -success$ = 36 -$T4 = 264 -__$ArrayPad$ = 280 -context$ = 320 -shaderCode$ = 328 -shadertype$ = 336 -loadShaderCode PROC ; COMDAT - -; 19 : { - -$LN8: - 00000 44 89 44 24 18 mov DWORD PTR [rsp+24], r8d - 00005 48 89 54 24 10 mov QWORD PTR [rsp+16], rdx - 0000a 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx - 0000f 55 push rbp - 00010 57 push rdi - 00011 48 81 ec 48 01 - 00 00 sub rsp, 328 ; 00000148H - 00018 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32] - 0001d 48 8d 7c 24 20 lea rdi, QWORD PTR [rsp+32] - 00022 b9 1a 00 00 00 mov ecx, 26 - 00027 b8 cc cc cc cc mov eax, -858993460 ; ccccccccH - 0002c f3 ab rep stosd - 0002e 48 8b 8c 24 68 - 01 00 00 mov rcx, QWORD PTR [rsp+360] - 00036 48 8b 05 00 00 - 00 00 mov rax, QWORD PTR __security_cookie - 0003d 48 33 c5 xor rax, rbp - 00040 48 89 85 18 01 - 00 00 mov QWORD PTR __$ArrayPad$[rbp], rax - 00047 48 8d 0d 00 00 - 00 00 lea rcx, OFFSET FLAT:__59F96598_StgSharpC@c - 0004e e8 00 00 00 00 call __CheckForDebuggerJustMyCode - -; 20 : unsigned int shader = context->CreateShader(GL_VERTEX_SHADER); - - 00053 b9 31 8b 00 00 mov ecx, 35633 ; 00008b31H - 00058 48 8b 85 40 01 - 00 00 mov rax, QWORD PTR context$[rbp] - 0005f ff 90 f0 09 00 - 00 call QWORD PTR [rax+2544] - 00065 89 45 04 mov DWORD PTR shader$[rbp], eax - -; 21 : if (!shader) - - 00068 83 7d 04 00 cmp DWORD PTR shader$[rbp], 0 - 0006c 75 0a jne SHORT $LN2@loadShader - -; 22 : { -; 23 : return 0xffffffff; - - 0006e b8 ff ff ff ff mov eax, -1 ; ffffffffH - 00073 e9 d5 00 00 00 jmp $LN1@loadShader -$LN2@loadShader: - -; 24 : } -; 25 : printf("%s\n", shaderCode); - - 00078 48 8b 95 48 01 - 00 00 mov rdx, QWORD PTR shaderCode$[rbp] - 0007f 48 8d 0d 00 00 - 00 00 lea rcx, OFFSET FLAT:??_C@_03OFAPEBGM@?$CFs?6@ - 00086 e8 00 00 00 00 call printf - -; 26 : context->ShaderSource(shader, 1, shaderCode, NULL); - - 0008b 45 33 c9 xor r9d, r9d - 0008e 4c 8b 85 48 01 - 00 00 mov r8, QWORD PTR shaderCode$[rbp] - 00095 ba 01 00 00 00 mov edx, 1 - 0009a 8b 4d 04 mov ecx, DWORD PTR shader$[rbp] - 0009d 48 8b 85 40 01 - 00 00 mov rax, QWORD PTR context$[rbp] - 000a4 ff 90 50 37 00 - 00 call QWORD PTR [rax+14160] - -; 27 : printf("%s\n", shaderCode); - - 000aa 48 8b 95 48 01 - 00 00 mov rdx, QWORD PTR shaderCode$[rbp] - 000b1 48 8d 0d 00 00 - 00 00 lea rcx, OFFSET FLAT:??_C@_03OFAPEBGM@?$CFs?6@ - 000b8 e8 00 00 00 00 call printf - -; 28 : context->CompileShader(shader); - - 000bd 8b 4d 04 mov ecx, DWORD PTR shader$[rbp] - 000c0 48 8b 85 40 01 - 00 00 mov rax, QWORD PTR context$[rbp] - 000c7 ff 90 18 07 00 - 00 call QWORD PTR [rax+1816] - -; 29 : int success; -; 30 : context->GetShaderiv(shader, GL_COMPILE_STATUS, &success); - - 000cd 4c 8d 45 24 lea r8, QWORD PTR success$[rbp] - 000d1 ba 81 8b 00 00 mov edx, 35713 ; 00008b81H - 000d6 8b 4d 04 mov ecx, DWORD PTR shader$[rbp] - 000d9 48 8b 85 40 01 - 00 00 mov rax, QWORD PTR context$[rbp] - 000e0 ff 90 40 1b 00 - 00 call QWORD PTR [rax+6976] - -; 31 : if (!success) - - 000e6 83 7d 24 00 cmp DWORD PTR success$[rbp], 0 - 000ea 75 5e jne SHORT $LN3@loadShader - -; 32 : { -; 33 : context->GetShaderInfoLog(shader, 512, NULL, infolog); - - 000ec 4c 8d 0d 00 00 - 00 00 lea r9, OFFSET FLAT:infolog - 000f3 45 33 c0 xor r8d, r8d - 000f6 ba 00 02 00 00 mov edx, 512 ; 00000200H - 000fb 8b 4d 04 mov ecx, DWORD PTR shader$[rbp] - 000fe 48 8b 85 40 01 - 00 00 mov rax, QWORD PTR context$[rbp] - 00105 ff 90 20 1b 00 - 00 call QWORD PTR [rax+6944] - -; 34 : infolog[511] = '\0'; - - 0010b b8 01 00 00 00 mov eax, 1 - 00110 48 69 c0 ff 01 - 00 00 imul rax, rax, 511 ; 000001ffH - 00117 48 89 85 08 01 - 00 00 mov QWORD PTR $T4[rbp], rax - 0011e 48 81 bd 08 01 - 00 00 00 02 00 - 00 cmp QWORD PTR $T4[rbp], 512 ; 00000200H - 00129 73 02 jae SHORT $LN6@loadShader - 0012b eb 05 jmp SHORT $LN7@loadShader -$LN6@loadShader: - 0012d e8 00 00 00 00 call __report_rangecheckfailure -$LN7@loadShader: - 00132 48 8d 05 00 00 - 00 00 lea rax, OFFSET FLAT:infolog - 00139 48 8b 8d 08 01 - 00 00 mov rcx, QWORD PTR $T4[rbp] - 00140 c6 04 08 00 mov BYTE PTR [rax+rcx], 0 - -; 35 : return 0; - - 00144 33 c0 xor eax, eax - 00146 eb 05 jmp SHORT $LN1@loadShader - -; 36 : } - - 00148 eb 03 jmp SHORT $LN4@loadShader -$LN3@loadShader: - -; 37 : else -; 38 : { -; 39 : return shader; - - 0014a 8b 45 04 mov eax, DWORD PTR shader$[rbp] -$LN4@loadShader: -$LN1@loadShader: -$LN5@loadShader: - -; 40 : } -; 41 : } - - 0014d 48 8b f8 mov rdi, rax - 00150 48 8d 4d e0 lea rcx, QWORD PTR [rbp-32] - 00154 48 8d 15 00 00 - 00 00 lea rdx, OFFSET FLAT:loadShaderCode$rtcFrameData - 0015b e8 00 00 00 00 call _RTC_CheckStackVars - 00160 48 8b c7 mov rax, rdi - 00163 48 8b 8d 18 01 - 00 00 mov rcx, QWORD PTR __$ArrayPad$[rbp] - 0016a 48 33 cd xor rcx, rbp - 0016d e8 00 00 00 00 call __security_check_cookie - 00172 48 8d a5 28 01 - 00 00 lea rsp, QWORD PTR [rbp+296] - 00179 5f pop rdi - 0017a 5d pop rbp - 0017b c3 ret 0 -loadShaderCode ENDP -_TEXT ENDS -; Function compile flags: /Odtp /RTCsu /ZI -; File D:\NitloadIndustry\Ñо¿ÏîĿ\1-Flagship\TH2020\ProjectFile\Դ´úÂë\StgSharpC\StgSharpC.c ; COMDAT initGL _TEXT SEGMENT majorVersion$ = 224 diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.ilk b/源代码/StgSharpC/x64/Debug/StgSharpC.ilk index 3f409f2f..b3680ea6 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 f81fb4e5..8de73ba4 100644 --- a/源代码/StgSharpC/x64/Debug/StgSharpC.log +++ b/源代码/StgSharpC/x64/Debug/StgSharpC.log @@ -1,8 +1,3 @@ - StgSharpC.c -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\StgSharpC.c(26,38): warning C4047: “函数”:“const GLchar *const *”与“char *const ”的间接级别不同 -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\StgSharpC.c(26,38): warning C4024: “通过指针的函数”: 形参和实参 3 的类型不同 -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\StgSharpC.c(49,18): warning C4047: “=”:“char”与“char [27]”的间接级别不同 -D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\StgSharpC.c(93,5): warning C4047: “return”:“char *”与“char (*)[512]”的间接级别不同 -glfw3.lib(init.obj) : warning LNK4099: 未找到 PDB“”(使用“glfw3.lib(init.obj)”或在“”中寻找);正在链接对象,如同没有调试信息一样 -glfw3.lib(win32_joystick.obj) : warning LNK4099: 未找到 PDB“”(使用“glfw3.lib(win32_joystick.obj)”或在“”中寻找);正在链接对象,如同没有调试信息一样 + 正在创建库 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 diff --git a/源代码/StgSharpC/x64/Debug/StgSharpC.obj b/源代码/StgSharpC/x64/Debug/StgSharpC.obj index b80abd7f..2ea1bf7b 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 2d5abb54..c43b79b3 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 1da29656..1b7bc92e 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 2f12c916..9db22846 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 d3766dd1..40ef7c8f 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/link.read.1.tlog b/源代码/StgSharpC/x64/Debug/StgSharpC.tlog/link.read.1.tlog index 21f3687c..1d3db80b 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.obj b/源代码/StgSharpC/x64/Debug/dllmain.obj index 9385076b..374ea078 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 e1707948..a28f8b16 100644 Binary files a/源代码/StgSharpC/x64/Debug/dllmain.sbr and b/源代码/StgSharpC/x64/Debug/dllmain.sbr differ diff --git a/源代码/StgSharpC/x64/Debug/mat2.obj b/源代码/StgSharpC/x64/Debug/mat2.obj index 85108839..f2e67486 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 28373dd9..1894cf2e 100644 Binary files a/源代码/StgSharpC/x64/Debug/mat2.sbr and b/源代码/StgSharpC/x64/Debug/mat2.sbr differ diff --git a/源代码/StgSharpC/x64/Debug/mat3.obj b/源代码/StgSharpC/x64/Debug/mat3.obj index 981116d9..63849c97 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 c8b833c5..3564a092 100644 Binary files a/源代码/StgSharpC/x64/Debug/mat3.sbr and b/源代码/StgSharpC/x64/Debug/mat3.sbr differ diff --git a/源代码/StgSharpC/x64/Debug/mat4.obj b/源代码/StgSharpC/x64/Debug/mat4.obj index baf2ae9d..2e743791 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 5081a22e..4e247f00 100644 Binary files a/源代码/StgSharpC/x64/Debug/mat4.sbr and b/源代码/StgSharpC/x64/Debug/mat4.sbr differ diff --git a/源代码/StgSharpC/x64/Debug/vc143.idb b/源代码/StgSharpC/x64/Debug/vc143.idb index 302af1c2..13c108bb 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 4127dc86..bc57bd3b 100644 Binary files a/源代码/StgSharpC/x64/Debug/vc143.pdb and b/源代码/StgSharpC/x64/Debug/vc143.pdb differ diff --git a/源代码/StgSharpDebug/Environment/GlobalSetting.cs b/源代码/StgSharpDebug/Environment/GlobalSetting.cs index 1e2c72c6..c90ae68f 100644 --- a/源代码/StgSharpDebug/Environment/GlobalSetting.cs +++ b/源代码/StgSharpDebug/Environment/GlobalSetting.cs @@ -1,4 +1,34 @@ -using System; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="GlobalSetting.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; @@ -9,6 +39,7 @@ namespace StgSharp { public static unsafe partial class StgSharp { + /// /// Init an instance of OpenGL program, /// This method should be called before any other StgSharp api. @@ -28,17 +59,20 @@ namespace StgSharp public static class GlobalSetting { + private static bool vSyncActivated; public static bool VSyncActivated { - get { return vsyncActivated; } + get => vsyncActivated; set { InternalIO.glfwSwapInterval(value ? 1 : 0); vsyncActivated = value; } } + } + } } \ No newline at end of file diff --git a/源代码/StgSharpDebug/Environment/Platform.cs b/源代码/StgSharpDebug/Environment/Platform.cs index 7f62a86b..0f47df8f 100644 --- a/源代码/StgSharpDebug/Environment/Platform.cs +++ b/源代码/StgSharpDebug/Environment/Platform.cs @@ -1,4 +1,34 @@ -// using StgSharp.Envitronment; +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="Platform.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.Envitronment; // using StgSharp.Envitronment.Win32; // using StgSharp.Graphics; // using StgSharp.Math; @@ -36,9 +66,17 @@ namespace StgSharp public static partial class StgSharp { - internal static GraphicAPI API = default; - private static bool vsyncActivated; + + /// + /// Version of current StgSharp platform. + /// Main version represent in hundred's digit, + /// and sub version represent in ten's digit. + /// + public const long version = 430; + private static uint markCount = 0; + private static bool vsyncActivated; + internal static GraphicAPI API = default; public static void Mark(bool needConsole) { @@ -49,12 +87,34 @@ namespace StgSharp } } - /// - /// Version of current StgSharp platform. - /// Main version represent in hundred's digit, - /// and sub version represent in ten's digit. - /// - public const long version = 430; + public static void Track( + object target, + string message, + bool isConsole, + [CallerFilePath] string filePath = "", + [CallerMemberName] string callerName = "", + [CallerLineNumber] int lineNumber = 0 + ) + { + Type t = target.GetType(); + string log = $"Tracked object: {nameof(target)}\t\tType:{t.Name}\n"; + FieldInfo[] fieldInfo = t.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); + log += "|\tFieldName\t|\tFieldType\t|\tFieldValue\t|\n"; + foreach (FieldInfo field in fieldInfo) + { + log += $"|{field.Name}\t\t|{field.FieldType}\t\t|{field.GetValue(target)}\t\t|\n"; + } + log += $"Tracking at:\n{filePath}\t{callerName}\tline {lineNumber}\n"; + log += $"Additional information:\n{message}\n"; + if (isConsole) + { + Console.WriteLine(log); + } + else + { + InternalIO.InternalWriteLog(log, LogType.Info); + } + } /// /// Write a log message to log file, and mark the level of this message. @@ -99,33 +159,5 @@ namespace StgSharp } } - public static void Track( - object target, - string message, - bool isConsole, - [CallerFilePath] string filePath = "", - [CallerMemberName] string callerName = "", - [CallerLineNumber] int lineNumber = 0 - ) - { - Type t = target.GetType(); - string log = $"Tracked object: {nameof(target)}\t\tType:{t.Name}\n"; - FieldInfo[] fieldInfo = t.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); - log += "|\tFieldName\t|\tFieldType\t|\tFieldValue\t|\n"; - foreach (FieldInfo field in fieldInfo) - { - log += $"|{field.Name}\t\t|{field.FieldType}\t\t|{field.GetValue(target)}\t\t|\n"; - } - log += $"Tracking at:\n{filePath}\t{callerName}\tline {lineNumber}\n"; - log += $"Additional information:\n{message}\n"; - if (isConsole) - { - Console.WriteLine(log); - } - else - { - InternalIO.InternalWriteLog(log, LogType.Info); - } - } } } \ No newline at end of file diff --git a/源代码/StgSharpDebug/Environment/TimeProvaider.cs b/源代码/StgSharpDebug/Environment/TimeProvaider.cs deleted file mode 100644 index d7e4b0d9..00000000 --- a/源代码/StgSharpDebug/Environment/TimeProvaider.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Runtime.CompilerServices; -using System.Text; -using System.Threading; -using System.Threading.Tasks; - -namespace StgSharp -{ - public static partial class StgSharp - { - private static Stopwatch mainProvider = new Stopwatch(); - private static List subscriberList = new List(); - private static Thread timeProvideThread; - private static long accuracy; - - private static void ProvideTime() - { - long totalMS, previousFrameMS = 0, - internalFrequncy = Stopwatch.Frequency; - lock (mainProvider) - { - mainProvider.Restart(); - } - while (mainProvider.IsRunning) - { - totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L)); - foreach (TimeProvider subscriber in subscriberList) - { - subscriber.CheckTime(totalMS); - } - } - } - - [MethodImpl(MethodImplOptions.NoOptimization)] - public static void TimerActivate(int maxFrameUpdateSensitiveTimeProviderCount) - { - if (!mainProvider.IsRunning) - { - mainProvider.Start(); - //speed test - long totalMS, previousSecondMS = 0, - internalFrequncy = Stopwatch.Frequency; - for (int i = 0; i < 100; i++) - { - totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L)); - for (int t = 0; t < 10; t++) - { - if (totalMS < 1000) - { - subscriberList.Add(new TimeProvider(100L)); - } - } - } - mainProvider.Stop(); - subscriberList.Clear(); - totalMS = (mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L))) / 100L; - accuracy = totalMS * 2 / 3; - mainProvider.Reset(); - timeProvideThread = new Thread(new ThreadStart(ProvideTime)); - timeProvideThread.Start(); - } - } - - public static void SubscribeTimeProvider(TimeProvider provider) - { - } - - public static void TimerDeactivate() - { - lock (mainProvider) - { - mainProvider.Stop(); - } - } - } -} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Environment/TimeProvider.cs b/源代码/StgSharpDebug/Environment/TimeProvider.cs new file mode 100644 index 00000000..f40ebefc --- /dev/null +++ b/源代码/StgSharpDebug/Environment/TimeProvider.cs @@ -0,0 +1,129 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="TimeProvider.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.Diagnostics; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Threading; + +namespace StgSharp +{ + public partial class StgSharp + { + + internal static StgSharpTime mainTimeProvider; + + } + + public sealed class StgSharpTime : TimeSourceProviderBase + { + + private static long accuracy; + private static Stopwatch mainProvider = new Stopwatch(); + private static List subscriberList = new List(); + private static Thread timeProvideThread; + + internal StgSharpTime() + { + } + + public static StgSharpTime OnlyInstance +=> StgSharp.mainTimeProvider; + + public override sealed void StartProvidingTime() + { + if (mainProvider.IsRunning) + { + return; + } + mainProvider.Start(); + //speed test + long totalMS, internalFrequncy = Stopwatch.Frequency; + for (int i = 0; i < 100; i++) + { + totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L)); + for (int t = 0; t < 10; t++) + { + if (totalMS < 1000) + { + subscriberList.Add(new TimeSpanProvider(100L, TimeSpanProvider.DefaultProvider)); + } + } + } + mainProvider.Stop(); + subscriberList.Clear(); + totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L)) / 100L; + accuracy = (totalMS * 2) / 3; + mainProvider.Reset(); + timeProvideThread = new Thread(new ThreadStart(ProvideTime)); + timeProvideThread.Start(); + } + + [MethodImpl(MethodImplOptions.NoOptimization)] + public static void TimerActivate(int maxFrameUpdateSensitiveTimeProviderCount) + { + } + + protected override sealed void AddSubscriberUnsynced(TimeSpanProvider subscriber) + { + subscriberList.Add(subscriber); + } + + protected override sealed void RemoveSubscriberUnsynced(TimeSpanProvider subscriber) + { + subscriberList.Remove(subscriber); + } + + private void ProvideTime() + { + long totalMS, internalFrequncy = Stopwatch.Frequency; + lock (mainProvider) + { + mainProvider.Restart(); + } + while (mainProvider.IsRunning) + { + totalMS = mainProvider.ElapsedTicks / (internalFrequncy / (1000L * 1000L)); + foreach (TimeSpanProvider subscriber in subscriberList) + { + if (subscriber.CheckTime(totalMS)) + { + + }; + } + } + } + + } +} \ No newline at end of file diff --git a/源代码/StgSharpDebug/Program.cs b/源代码/StgSharpDebug/Program.cs index 2cadef70..1a706bdc 100644 --- a/源代码/StgSharpDebug/Program.cs +++ b/源代码/StgSharpDebug/Program.cs @@ -1,17 +1,8 @@ //using StgSharp.Envitronment.Win32; using StgSharp.Geometries; using StgSharp.Graphics; -using StgSharp.Logic; -using StgSharp.Math; -using StgSharp.Math.Linear; using System; -using System.Collections.Concurrent; -using System.Diagnostics; -using System.IO; -using System.Numerics; -using System.Runtime.InteropServices; -using System.Text; namespace StgSharp { @@ -28,10 +19,10 @@ namespace StgSharp public static unsafe void ProcessInput(IntPtr windowPtr) { - if (InternalIO.glfwGetKey(windowPtr, (int)Operation.Key.ESCAPE) + if (InternalIO.glfwGetKey((GLFWwindow*)windowPtr, (int)Operation.Key.ESCAPE) == KeyStatus.PRESS) { - InternalIO.glfwSetWindowShouldClose(windowPtr, 1); + InternalIO.glfwSetWindowShouldClose((GLFWwindow*)windowPtr, 1); } } @@ -55,7 +46,7 @@ namespace StgSharp { InternalIO.InternalWriteLog("\n\n\n", "Program start", LogType.Info); - SetRenderThreads(2); + SetRenderThreads(1); SetMetadata(800, 600, "Hello, STG#!", IntPtr.Zero, null); MakeAsCurrentContext(); @@ -145,7 +136,7 @@ namespace StgSharp public override void Main(params object[] args) { - ProcessInput(windowID); + ProcessInput(WindowID); gl.ClearColor(0.333f, 0.555f, 0.555f, 1.0f); //GL.api.Clear(GLconst.COLOR_BUFFER_BIT); @@ -162,9 +153,10 @@ namespace StgSharp /**/ float time = (float)InternalIO.glfwGetTime(); + gl.SetValue(color, 0.5f + MathF.Sin(time), - 0.5f + MathF.Sin(time/* + 0.667f * 3.14f/**/), + 0.5f + MathF.Sin(time * 0.1f), 0.5f + MathF.Sin(time/* - 0.667f * 3.14f/**/) ); @@ -174,8 +166,6 @@ namespace StgSharp vao.BindNull(); - SwapBuffers(); - PollEvents(); } } diff --git a/源代码/StgSharpDebug/Shader/fragment.frag b/源代码/StgSharpDebug/Shader/fragment.frag index ca2f7bc0..53635067 100644 --- a/源代码/StgSharpDebug/Shader/fragment.frag +++ b/源代码/StgSharpDebug/Shader/fragment.frag @@ -12,6 +12,6 @@ void main() { vec4 tex1 = texture(ourTexture, TexCoord); vec4 tex2 = texture(ourTexture2,TexCoord); - FragColor = mix(tex1,tex2,0.2) /**/ *vec4( TexColor,1.0) /**/; + FragColor = mix(tex1 * vec4( TexColor,1.0),tex2,0.2) /* *vec4( TexColor,1.0) /**/; } diff --git a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.AssemblyInfo.cs b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.AssemblyInfo.cs index 03e968cf..2e45b063 100644 --- a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.AssemblyInfo.cs +++ b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharpDebug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a770bbe68567b43385bb30c9c86eb80e5b1e23e8")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+15bf989285b01c5617b5f5612667e0da6a2b1781")] [assembly: System.Reflection.AssemblyProductAttribute("StgSharpDebug")] [assembly: System.Reflection.AssemblyTitleAttribute("StgSharpDebug")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.AssemblyInfoInputs.cache b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.AssemblyInfoInputs.cache index a0a90b9d..9920664d 100644 --- a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.AssemblyInfoInputs.cache +++ b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.AssemblyInfoInputs.cache @@ -1 +1 @@ -a30a9fd1462f450229b650c6f00eadf2b5bbe11b75c90e2b6d0f6e8aab7ab56e +3aa7da67b6813f3947d097a5f157a32e0cc91617596bb9e7a8770735ee78e02b 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 7c0000bf..c3240e33 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 @@ -d0739f6dcc2b7c56b30c8bf5da3b96332ce6e8031f525daae9acdf819b2e29b3 +c392364d0fdf9f80d34fdb655daec7662e4a9944698e668e912c170812c83950 diff --git a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.dll b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.dll index fd6c7e36..d2f43b9a 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 8d9fa635..4a24e1a4 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.sourcelink.json b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.sourcelink.json index cbc457f0..11305d94 100644 --- a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.sourcelink.json +++ b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.sourcelink.json @@ -1 +1 @@ -{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/a770bbe68567b43385bb30c9c86eb80e5b1e23e8/*"}} \ No newline at end of file +{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/15bf989285b01c5617b5f5612667e0da6a2b1781/*"}} \ No newline at end of file diff --git a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.xml b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.xml index ed95f6eb..3551421f 100644 --- a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.xml +++ b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/StgSharpDebug.xml @@ -26,7 +26,8 @@ - OpenGL package used by current form context. + OpenGL package binded to current form context. + A OpenGL context is only binded to current form. @@ -51,24 +52,18 @@ - 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. + 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. + + Something goes wrong and StgSharp fails in creating a new OpenGL context. + Set all necessary metadata to current form instance - - - Resize the current form - - New width of the window - New height of the window - Resize the current form @@ -77,14 +72,12 @@ A (width,height) representing the new size of current form - + - Set the size limit of current form + Resize the current form - Minimum width of current form - Minimum height of current form - Maximum width of curent form - Maximum height of current form + New width of the window + New height of the window @@ -97,6 +90,15 @@ 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 curent form + Maximum height of current form + Necessary operation to init this form. @@ -105,8 +107,7 @@ - Behaviour of current form when in a render cycle. - When this form + Behaviour of current form when in a render cycle. When this form @@ -119,7 +120,7 @@ Get OpenGL library of this form's context. - A package contains all opengl APIs + A package contains all opengl APIs @@ -163,23 +164,6 @@ New instance of instance. - - - A timer counting frames after its construction. - - - - - Frames after this timer created. - - - - - Convert a into uint value. - this will get total frames since the timer was created. - - to be converted - Interface of all kinds OpenGL buffer onjects @@ -611,21 +595,20 @@ Y position of an enemy entity - + + + Init an instance of OpenGL program, + This method should be called before any other StgSharp api. + + + Version of current StgSharp platform. Main version represent in hundred's digit, and sub version represent in ten's digit. - - - Init an instance of OpenGL program, - This method should be called before other - graphic methods, after LoadGL method. - - - + Write a log message to log file, and mark the level of this message. @@ -709,11 +692,6 @@ 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。 - - - Tick time this geometry eas crested - - Get all sides of this . @@ -726,6 +704,11 @@ + + + Tick time this geometry eas crested + + Update the coordinate of the point. If this is a moving point, @@ -795,6 +778,27 @@ The second value. + + + 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. + + + + + + Time source provider provided in internal framework. + + + + + The method this will call every time a new time span started. + + OpenGL numeric type. diff --git a/源代码/StgSharpDebug/obj/x64/Debug/net6.0/apphost.exe b/源代码/StgSharpDebug/obj/x64/Debug/net6.0/apphost.exe index 73158cd1..4c0f4435 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/源代码/StgSharpDevelop.sln b/源代码/StgSharpDevelop.sln index 4a578898..1553b3b7 100644 --- a/源代码/StgSharpDevelop.sln +++ b/源代码/StgSharpDevelop.sln @@ -25,6 +25,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BenchMark", "BenchMark\Benc EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StgSharpC", "StgSharpC\StgSharpC.vcxproj", "{20CBFF26-6746-402E-992C-7B643E9423EB}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0961B2BE-415C-45EA-8607-5B83623B2EF7}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Benchmark|Any CPU = Benchmark|Any CPU diff --git a/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.AssemblyInfo.cs b/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.AssemblyInfo.cs index c0e91970..bb3ee599 100644 --- a/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.AssemblyInfo.cs +++ b/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgsharpEnvDebug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a770bbe68567b43385bb30c9c86eb80e5b1e23e8")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+15bf989285b01c5617b5f5612667e0da6a2b1781")] [assembly: System.Reflection.AssemblyProductAttribute("StgsharpEnvDebug")] [assembly: System.Reflection.AssemblyTitleAttribute("StgsharpEnvDebug")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.AssemblyInfoInputs.cache b/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.AssemblyInfoInputs.cache index 9a18d79f..5db6fdf3 100644 --- a/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.AssemblyInfoInputs.cache +++ b/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.AssemblyInfoInputs.cache @@ -1 +1 @@ -79f2b872051c7619fff5b34141b27643e9f666037c4cc5c361301d43678b13a2 +2ca7ccb7ba3e43bbfc557f46ee96e48e65cf1acb0d37efdf05e0fca553d8f3e3 diff --git a/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.csproj.AssemblyReference.cache b/源代码/StgsharpEnvDebug/obj/Debug/net6.0/StgsharpEnvDebug.csproj.AssemblyReference.cache index e8700ec4..5ecdc345 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