daily update on 20240104 by nitload youmu, double threading not work
This commit is contained in:
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.8.34322.80
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{7F1EBEA1-0AAB-4989-A824-50BCF7A23840}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7F1EBEA1-0AAB-4989-A824-50BCF7A23840}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7F1EBEA1-0AAB-4989-A824-50BCF7A23840}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7F1EBEA1-0AAB-4989-A824-50BCF7A23840}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7F1EBEA1-0AAB-4989-A824-50BCF7A23840}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {771B1275-E359-4649-9121-1D7C0FC8B004}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,22 @@
|
||||
// Online C# Editor for free
|
||||
// Write, Edit and Run your C# code using C# Online Compiler
|
||||
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
public class HelloWorld
|
||||
{
|
||||
public unsafe static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine(sizeof(st));
|
||||
}
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public unsafe struct st
|
||||
{
|
||||
public delegate*<void> dele;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"runtimeTarget": {
|
||||
"name": ".NETCoreApp,Version=v6.0",
|
||||
"signature": ""
|
||||
},
|
||||
"compilationOptions": {},
|
||||
"targets": {
|
||||
".NETCoreApp,Version=v6.0": {
|
||||
"ConsoleApp1/1.0.0": {
|
||||
"runtime": {
|
||||
"ConsoleApp1.dll": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"ConsoleApp1/1.0.0": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net6.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "6.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\实验\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\实验\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\实验\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj",
|
||||
"projectName": "ConsoleApp1",
|
||||
"projectPath": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\实验\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj",
|
||||
"packagesPath": "C:\\Users\\Nitlo\\.nuget\\packages\\",
|
||||
"outputPath": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\实验\\ConsoleApp1\\ConsoleApp1\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\Nitlo\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net6.0"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"C:\\Program Files\\dotnet\\library-packs": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.100\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Nitlo\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.8.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\Nitlo\.nuget\packages\" />
|
||||
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
|
||||
@@ -0,0 +1,23 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// 运行时版本:4.0.30319.42000
|
||||
//
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
// 重新生成代码,这些更改将会丢失。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("ConsoleApp1")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+14eaab455f9eeb6990fa39994b2d2c8b1da39b36")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("ConsoleApp1")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("ConsoleApp1")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// 由 MSBuild WriteCodeFragment 类生成。
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
b418ea045882d52b2c4e566a443fa31ed23dedefb026927dfbf62bccee6ba2f2
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
is_global = true
|
||||
build_property.TargetFramework = net6.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property.EnforceExtendedAnalyzerRules =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = ConsoleApp1
|
||||
build_property.ProjectDir = D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\
|
||||
build_property.EnableComHosting =
|
||||
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||
@@ -0,0 +1,8 @@
|
||||
// <auto-generated/>
|
||||
global using global::System;
|
||||
global using global::System.Collections.Generic;
|
||||
global using global::System.IO;
|
||||
global using global::System.Linq;
|
||||
global using global::System.Net.Http;
|
||||
global using global::System.Threading;
|
||||
global using global::System.Threading.Tasks;
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
d087487cde3ee26242ba8f1c10202526565acdafe91d3cfd1ae83ab7043c5120
|
||||
@@ -0,0 +1,15 @@
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\obj\Debug\net6.0\ConsoleApp1.GeneratedMSBuildEditorConfig.editorconfig
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\obj\Debug\net6.0\ConsoleApp1.AssemblyInfoInputs.cache
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\obj\Debug\net6.0\ConsoleApp1.AssemblyInfo.cs
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\obj\Debug\net6.0\ConsoleApp1.csproj.CoreCompileInputs.cache
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\obj\Debug\net6.0\ConsoleApp1.sourcelink.json
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\bin\Debug\net6.0\ConsoleApp1.exe
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\bin\Debug\net6.0\ConsoleApp1.deps.json
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\bin\Debug\net6.0\ConsoleApp1.runtimeconfig.json
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\bin\Debug\net6.0\ConsoleApp1.dll
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\bin\Debug\net6.0\ConsoleApp1.pdb
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\obj\Debug\net6.0\ConsoleApp1.dll
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\obj\Debug\net6.0\refint\ConsoleApp1.dll
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\obj\Debug\net6.0\ConsoleApp1.pdb
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\obj\Debug\net6.0\ConsoleApp1.genruntimeconfig.cache
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\ConsoleApp1\ConsoleApp1\obj\Debug\net6.0\ref\ConsoleApp1.dll
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
1352e0469e9be5c14307699fc895f3e160a0c3b7ee3bf0e8bb735cac301f58d4
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/14eaab455f9eeb6990fa39994b2d2c8b1da39b36/*"}}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"version": 3,
|
||||
"targets": {
|
||||
"net6.0": {}
|
||||
},
|
||||
"libraries": {},
|
||||
"projectFileDependencyGroups": {
|
||||
"net6.0": []
|
||||
},
|
||||
"packageFolders": {
|
||||
"C:\\Users\\Nitlo\\.nuget\\packages\\": {},
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
|
||||
},
|
||||
"project": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\实验\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj",
|
||||
"projectName": "ConsoleApp1",
|
||||
"projectPath": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\实验\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj",
|
||||
"packagesPath": "C:\\Users\\Nitlo\\.nuget\\packages\\",
|
||||
"outputPath": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\实验\\ConsoleApp1\\ConsoleApp1\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"fallbackFolders": [
|
||||
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
||||
],
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\Nitlo\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net6.0"
|
||||
],
|
||||
"sources": {
|
||||
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||
"C:\\Program Files\\dotnet\\library-packs": {},
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48",
|
||||
"net481"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.100\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "LcdcjiHVeSIhpKAF6fVE3u0cE0qsstf+zb2bY/4A2i75Z88FhinV9CGMOKYlMOOFxg8CzsOhJ9b0qYTsff57Zw==",
|
||||
"success": true,
|
||||
"projectFilePath": "D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\实验\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj",
|
||||
"expectedPackageFiles": [],
|
||||
"logs": []
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,9 +1,74 @@
|
||||
Error @ 2023-12-18T00:27:50.8218872+08:00
|
||||
Index was outside the bounds of the array.
|
||||
at StgSharp.Logic.DynamicArrayList`1.get_Item(Int32 index) in D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpDebug\Logic\ArrayList.cs:line 101
|
||||
at StgSharp.Program.Main(String[] args) in D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpDebug\Program.cs:line 209
|
||||
Error @ 2023-12-18T00:50:06.7905891+08:00
|
||||
Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
|
||||
at System.Collections.Generic.List`1.get_Item(Int32 index)
|
||||
at StgSharp.Logic.DynamicArrayList`1.get_Item(Int32 index) in D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpDebug\Logic\ArrayList.cs:line 101
|
||||
at StgSharp.Program.Main(String[] args) in D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpDebug\Program.cs:line 209
|
||||
|
||||
|
||||
|
||||
|
||||
Info @ 2024-01-03T11:51:40.4340523+08:00
|
||||
Program start
|
||||
Info @ 2024-01-03T11:51:40.6745399+08:00
|
||||
Successfully load GLFW APIs. StgSharp is now working on p/invoke mode
|
||||
Info @ 2024-01-03T11:51:42.9888934+08:00
|
||||
Successfully create a context binded to current form. Its ID is 1443106161584
|
||||
Info @ 2024-01-03T11:51:43.3177952+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
|
||||
Cannot load OpenGL api called glGetnTexImage, this api may not exist or supported.
|
||||
Cannot load OpenGL api called glGetnUniformdv, this api may not exist or supported.
|
||||
Successfully load all OpenGL 4.5 APIs
|
||||
Cannot load OpenGL api called glMultiDrawArraysIndirectCount, this api may not exist or supported.
|
||||
Cannot load OpenGL api called glMultiDrawElementsIndirectCount, this api may not exist or supported.
|
||||
Successfully load all OpenGL 4.6 APIs
|
||||
Info @ 2024-01-03T11:51:43.3362791+08:00
|
||||
No supported OpenGL extensions are found.
|
||||
|
||||
|
||||
|
||||
|
||||
Info @ 2024-01-03T20:22:16.2158195+08:00
|
||||
Program start
|
||||
Info @ 2024-01-03T20:22:16.2555343+08:00
|
||||
Successfully load GLFW APIs. StgSharp is now working on p/invoke mode
|
||||
Info @ 2024-01-03T20:22:16.2633088+08:00
|
||||
Successfully create a context binded to current form. Its ID is 2975850861888
|
||||
Info @ 2024-01-03T20:22:16.4447679+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
|
||||
Cannot load OpenGL api called glGetnTexImage, this api may not exist or supported.
|
||||
Cannot load OpenGL api called glGetnUniformdv, this api may not exist or supported.
|
||||
Successfully load all OpenGL 4.5 APIs
|
||||
Cannot load OpenGL api called glMultiDrawArraysIndirectCount, this api may not exist or supported.
|
||||
Cannot load OpenGL api called glMultiDrawElementsIndirectCount, this api may not exist or supported.
|
||||
Successfully load all OpenGL 4.6 APIs
|
||||
Info @ 2024-01-03T20:22:16.4632028+08:00
|
||||
No supported OpenGL extensions are found.
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -16,7 +16,7 @@
|
||||
<summary>
|
||||
Function handler to load an opengl function by serching its name.
|
||||
</summary>
|
||||
<param name="funcname">the name of the Opengl function</param>
|
||||
<param name="name">the name of the Opengl function</param>
|
||||
<returns>An intptr value representing the pointer to the function</returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.Form">
|
||||
@@ -29,6 +29,11 @@
|
||||
Height of this form, represent in <see cref="T:System.Int32"/>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.Graphics.Form.GL">
|
||||
<summary>
|
||||
OpenGL package used by current form context.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.Graphics.Form.IsDoubleRendering">
|
||||
<summary>
|
||||
Representing
|
||||
@@ -39,6 +44,11 @@
|
||||
Width of this form, represent in <see cref="T:System.Int32"/>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.Graphics.Form.Width">
|
||||
<summary>
|
||||
Width of this form, represent in <see cref="T:System.Int32"/>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Init(System.Object[])">
|
||||
<summary>
|
||||
Necessary operation to init this form.
|
||||
@@ -57,19 +67,17 @@
|
||||
Init this form and render it on screen, and respond with operation
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.SetRenderThreads(System.Boolean)">
|
||||
<member name="M:StgSharp.Graphics.Form.SetRenderThreads(System.Int32)">
|
||||
<summary>
|
||||
Define how current form render in one frame.
|
||||
</summary>
|
||||
<param name="totalThread">
|
||||
|
||||
Please define
|
||||
<param name="requireDoubleRendering">
|
||||
Please define this befor calling any OpenGL api and other graphic methods.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.InitForm(System.Int32,System.Int32,System.String,System.IntPtr,StgSharp.Graphics.Form)">
|
||||
<member name="M:StgSharp.Graphics.Form.SetMetadata(System.Int32,System.Int32,System.String,System.IntPtr,StgSharp.Graphics.Form)">
|
||||
<summary>
|
||||
Constructor of a Form, creats an instance of a form and
|
||||
initilize all the customizing operations.
|
||||
Set all necessary metadata to current form instance
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.MakeAsCurrentContext">
|
||||
@@ -115,59 +123,32 @@
|
||||
Maximum size of current form. In form of a <see cref="T:StgSharp.Math.Vec2d"/> of (width,height)
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Texture.LoadTexture(System.Int32,System.String,StgSharp.Graphics.ImageLoader)">
|
||||
<member name="M:StgSharp.Graphics.Form.CreateElementBuffer(System.UInt32)">
|
||||
<summary>
|
||||
|
||||
Create a set of <see cref="T:StgSharp.Graphics.ElementBuffer"/>.
|
||||
</summary>
|
||||
<param name="name"></param>
|
||||
<param name="index"></param>
|
||||
<param name="loader"></param>
|
||||
<param name="count">Amount of EBO to be created.</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.CreateVertexArray(System.UInt32)">
|
||||
<summary>
|
||||
Create a set of <see cref="T:StgSharp.Graphics.VertexArray"/>.
|
||||
</summary>
|
||||
<param name="count">Amount of VAO to be crated.</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.CreateVertexBuffer(System.UInt32)">
|
||||
<summary>
|
||||
Create aset of <see cref="T:StgSharp.Graphics.VertexBuffer"/>.
|
||||
</summary>
|
||||
<param name="count">Amount of Object to be created.</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.CreateShader">
|
||||
<summary>
|
||||
Create an instance of <see cref="T:StgSharp.Graphics.Form.Shader"/> program
|
||||
</summary>
|
||||
<returns>New instance of <see cref="T:StgSharp.Graphics.Form.Shader"/> instance. </returns>
|
||||
</member>
|
||||
<member name="F:StgSharp.Graphics.Form.Shader.programID">
|
||||
<summary>
|
||||
A <see cref="T:System.UInt32"/> value represent this shader.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.#ctor(StgSharp.Graphics.IglFunc)">
|
||||
<summary>
|
||||
Inti a shader with no program attached.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.CompileVertexShader(System.String)">
|
||||
<summary>
|
||||
Compile the vertex shader to be attached to this shader.
|
||||
</summary>
|
||||
<param name="shaderCode">GLSL code of vertex shader.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.CompileFragmentShader(System.String)">
|
||||
<summary>
|
||||
Compile the fragment shader to be attached to this shader.
|
||||
</summary>
|
||||
<param name="shaderCode">GLSL code of fragment shader.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.Link">
|
||||
<summary>
|
||||
Link the shader to current context.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.GetUniform``1(System.String)">
|
||||
<summary>
|
||||
Get a uniform form current shader,
|
||||
the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param name="name"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.Use">
|
||||
<summary>
|
||||
Let the current context use this shader.
|
||||
Create an instance of <see cref="T:StgSharp.Graphics.Shader"/> program
|
||||
</summary>
|
||||
<returns>New instance of <see cref="T:StgSharp.Graphics.Shader"/> instance. </returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.FrameTimer">
|
||||
<summary>
|
||||
@@ -186,11 +167,39 @@
|
||||
</summary>
|
||||
<param name="timer"><see cref="T:StgSharp.Graphics.FrameTimer"/> to be converted</param>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.ElementBuffer">
|
||||
<summary>
|
||||
A collecion of handle to Element Buffer Object in OpenGL.
|
||||
Each <see cref="T:System.UInt32"/> value indexed from instance of this class this
|
||||
is the only handle to one Element Buffer Object.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.IBufferObject">
|
||||
<summary>
|
||||
Interface of all kinds OpenGL buffer onjects
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.Graphics.IBufferObject.Item(System.Int32)">
|
||||
<summary>
|
||||
Get the only handle to one of the Object instance
|
||||
</summary>
|
||||
<param name="index"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IBufferObject.Bind(System.Int32)">
|
||||
<summary>
|
||||
Bind a buffer instance to OpenGL
|
||||
</summary>
|
||||
<param name="index">Index of handle of the object in this instance to be bind</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Texture.LoadTexture(System.Int32,System.String,StgSharp.Graphics.ImageLoader)">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<param name="name"></param>
|
||||
<param name="index"></param>
|
||||
<param name="loader"></param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.VertexBuffer.Unbind">
|
||||
<summary>
|
||||
|
||||
@@ -228,77 +237,67 @@
|
||||
<param name="name">Name of the OpenGL api</param>
|
||||
<returns>The funtion pointer of the api in form of <see cref="T:System.IntPtr"/></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.StgSharp#Graphics#IglFunc#SetValue(StgSharp.Graphics.Uniform{System.Single},System.Single)">
|
||||
<member name="F:StgSharp.Graphics.Shader.programID">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are float.
|
||||
A <see cref="T:System.UInt32"/> value represent this shader.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="v0">The value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.StgSharp#Graphics#IglFunc#SetValue(StgSharp.Graphics.Uniform{System.Int32},System.Int32)">
|
||||
<member name="M:StgSharp.Graphics.Shader.#ctor(StgSharp.Graphics.IglFunc)">
|
||||
<summary>
|
||||
Set data value to a int <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are int.
|
||||
Inti a shader with no program attached.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="i0">The value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.StgSharp#Graphics#IglFunc#SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single},System.Single,System.Single)">
|
||||
<member name="M:StgSharp.Graphics.Shader.CompileVertexShader(System.String)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`2"/>,
|
||||
all types of parameters are float.
|
||||
Compile the vertex shader to be attached to this shader.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`2"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
<param name="shaderCode">GLSL code of vertex shader.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.StgSharp#Graphics#IglFunc#SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single},System.Single,System.Single,System.Single)">
|
||||
<member name="M:StgSharp.Graphics.Shader.CompileFragmentShader(System.String)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`3"/>,
|
||||
all types of parameters are float.
|
||||
Compile the fragment shader to be attached to this shader.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`3"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
<param name="v2">The third value to be set</param>
|
||||
<param name="shaderCode">GLSL code of fragment shader.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.StgSharp#Graphics#IglFunc#SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},System.Single,System.Single,System.Single,System.Single)">
|
||||
<member name="M:StgSharp.Graphics.Shader.Link">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
|
||||
all types of parameters are float.
|
||||
Link the shader to current context.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
<param name="v2">The third value to be set</param>
|
||||
<param name="v3">The forth value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},StgSharp.Math.Vec4d)">
|
||||
<member name="M:StgSharp.Graphics.Shader.GetUniform``1(System.String)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
|
||||
all types of parameters are float.
|
||||
Get a uniform form current shader,
|
||||
the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
|
||||
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> packing four parameters of the uniform </param>
|
||||
<param name="name">Name of the Uniform in shader code</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.SetValue(StgSharp.Graphics.Uniform{StgSharp.Math.Vec4d},StgSharp.Math.Vec4d)">
|
||||
<member name="M:StgSharp.Graphics.Shader.GetUniform``2(System.String)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are <see cref="T:StgSharp.Math.Vec4d"/>.
|
||||
Get a uniform form current shader,
|
||||
the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> value of the uniform </param>
|
||||
<param name="name">Name of the Uniform in shader code</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.AlignFrame(StgSharp.Graphics.Form)">
|
||||
<member name="M:StgSharp.Graphics.Shader.GetUniform``3(System.String)">
|
||||
<summary>
|
||||
Align a sets of code to frame update of a <see cref="T:StgSharp.Graphics.Form"/>.
|
||||
Usually, a call of <see cref="M:StgSharp.Graphics.IglFunc.AfterAlign(StgSharp.Graphics.Form,System.Action)"/> is required.
|
||||
This method is used as sigle thread method. If more than one
|
||||
alignment is requested, a <see cref="T:System.InvalidOperationException"/> will throw.
|
||||
Get a uniform form current shader,
|
||||
the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param name="form">The form used as frame update benchmark.</param>
|
||||
<exception cref="T:System.InvalidOperationException">More than one alingment attached to one form timer</exception>
|
||||
<param name="name">Name of the Uniform in shader code</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Shader.Use">
|
||||
<summary>
|
||||
Let the current context use this shader.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.ActiveTexture(System.UInt32)">
|
||||
<summary>
|
||||
Same function as OpenGL api glActiveTexture
|
||||
</summary>
|
||||
<param name="type">type of texture to activate</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.AfterAlign(StgSharp.Graphics.Form,System.Action)">
|
||||
<summary>
|
||||
@@ -312,11 +311,15 @@
|
||||
<param name="action">Operation after frame update alignment.</param>
|
||||
<exception cref="T:System.InvalidOperationException">The action binded to a wrong alignment.</exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.ActiveTexture(System.UInt32)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.AlignFrame(StgSharp.Graphics.Form)">
|
||||
<summary>
|
||||
Same function as OpenGL api glActiveTexture
|
||||
Align a sets of code to frame update of a <see cref="T:StgSharp.Graphics.Form"/>.
|
||||
Usually, a call of <see cref="M:StgSharp.Graphics.IglFunc.AfterAlign(StgSharp.Graphics.Form,System.Action)"/> is required.
|
||||
This method is used as sigle thread method. If more than one
|
||||
alignment is requested, a <see cref="T:System.InvalidOperationException"/> will throw.
|
||||
</summary>
|
||||
<param name="type">type of texture to activate</param>
|
||||
<param name="form">The form used as frame update benchmark.</param>
|
||||
<exception cref="T:System.InvalidOperationException">More than one alingment attached to one form timer</exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.AttachShader(System.UInt32,System.UInt32)">
|
||||
<summary>
|
||||
@@ -381,43 +384,49 @@
|
||||
<summary>
|
||||
Creates a form and its associated
|
||||
</summary>
|
||||
<param name="handle">The instance of created form</param>
|
||||
<param name="width">Required width</param>
|
||||
<param name="height">Required width</param>
|
||||
<param name="tittle">Tittle of the window </param>
|
||||
<param name="monitor"></param>
|
||||
<param name="share"></param>
|
||||
<returns>The instance of created form</returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.DeleteBuffers(System.Int32,System.UInt32*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.DeleteBuffer(System.UInt32)">
|
||||
<summary>
|
||||
Same function as OpenGL api, glDeleteBuffer.
|
||||
Same function as OpenGL api, glDeleteBuffer. This method can delete one buffer in one call
|
||||
</summary>
|
||||
<param name="handle">a handle representing the buffer to be deleted</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.DeleteBuffers(System.UInt32,System.UInt32[])">
|
||||
<summary>
|
||||
Same function as OpenGL api, glDeleteBuffer. This method can delete a sets of buffers in one call.
|
||||
</summary>
|
||||
<param name="count">Amount of bufferd to be deleted</param>
|
||||
<param name="ptr">Pointer of buffer to be deleted</param>
|
||||
<param name="handle">Array of buffers to be deleted</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.DeleteVertexArrays(System.Int32,System.UInt32*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.DeleteVertexArrays(System.UInt32,System.UInt32[])">
|
||||
<summary>
|
||||
Same function as OpenGL api, glDeleteVertexArrays
|
||||
</summary>
|
||||
<param name="count">Amount of vao to be deleted</param>
|
||||
<param name="ptr">pointer of vao sign array</param>
|
||||
<param name="arrays">A array representing a colletion of vertex objects.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenBuffers(System.Int32,System.UInt32*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenBuffers(System.UInt32,System.UInt32*)">
|
||||
<summary>
|
||||
Same fucntion as the OpenGL api glGenBuffers
|
||||
</summary>
|
||||
<param name="count"></param>
|
||||
<param name="ptr"></param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenTextures(System.Int32,System.UInt32*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenTextures(System.UInt32,System.UInt32*)">
|
||||
<summary>
|
||||
Same fucnction as OpenGL api glGenTextures.
|
||||
</summary>
|
||||
<param name="count">amount of textures to generate</param>
|
||||
<param name="ptr">pointer to texture signs' array</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenVertexArrays(System.Int32,System.UInt32*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenVertexArrays(System.UInt32,System.UInt32*)">
|
||||
<summary>
|
||||
Same fucntion as OpenGL api, glGenVertexArray
|
||||
</summary>
|
||||
@@ -446,7 +455,69 @@
|
||||
<param name="id">The only signiture stands for the <see cref="T:StgSharp.Graphics.Form"/> to be controlled</param>
|
||||
<param name="handler">Method hadler </param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetVertexAttribute(System.UInt32,System.Int32,System.Type,System.Boolean,System.Int32,System.Int32)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},System.Single,System.Single,System.Single,System.Single)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
|
||||
all types of parameters are float.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
<param name="v2">The third value to be set</param>
|
||||
<param name="v3">The forth value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},StgSharp.Math.Vec4d)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
|
||||
all types of parameters are float.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
|
||||
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> packing four parameters of the uniform </param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single},System.Single,System.Single,System.Single)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`3"/>,
|
||||
all types of parameters are float.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`3"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
<param name="v2">The third value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single},System.Single,System.Single)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`2"/>,
|
||||
all types of parameters are float.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`2"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single},System.Single)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are float.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="v0">The value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Int32},System.Int32)">
|
||||
<summary>
|
||||
Set data value to a int <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are int.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="i0">The value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{StgSharp.Math.Vec4d},StgSharp.Math.Vec4d)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are <see cref="T:StgSharp.Math.Vec4d"/>.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> value of the uniform </param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetVertexAttribute(System.UInt32,System.Int32,System.Type,System.Boolean,System.UInt32,System.Int32)">
|
||||
<summary>
|
||||
Set how a shader parameter read data from a VBO.
|
||||
</summary>
|
||||
@@ -457,7 +528,7 @@
|
||||
<param name="stride">Pixels stride of each sets of data</param>
|
||||
<param name="pointer"></param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.TextureImage2d(System.UInt32,System.Int32,System.UInt32,System.Int32,System.Int32,System.UInt32,System.UInt32,System.Void*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.TextureImage2d(System.UInt32,System.Int32,System.UInt32,System.UInt32,System.UInt32,System.UInt32,System.UInt32,System.Void*)">
|
||||
<summary>
|
||||
Same function as OpenGL api glTexImage2d
|
||||
</summary>
|
||||
@@ -484,7 +555,7 @@
|
||||
</summary>
|
||||
<param name="program">Sign of program to be used</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.Viewport(System.Int32,System.Int32,System.Int32,System.Int32)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.Viewport(System.Int32,System.Int32,System.UInt32,System.UInt32)">
|
||||
<summary>
|
||||
Same function as the OpenGL api, glViewPort
|
||||
</summary>
|
||||
@@ -662,6 +733,7 @@
|
||||
</summary>
|
||||
<param name="count">Amount of elements to be prepared.</param>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "M:StgSharp.Logic.DynamicArrayList`1.#ctor(System.Int32,`0)" -->
|
||||
<member name="P:StgSharp.Logic.DynamicArrayList`1.Length">
|
||||
<summary>
|
||||
Length of this <see cref="T:StgSharp.Logic.DynamicArrayList`1"/>
|
||||
@@ -741,6 +813,18 @@
|
||||
remove the last member of the list
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Math.GLclampf">
|
||||
<summary>
|
||||
OpenGL numeric type.
|
||||
An IEEE-754 floating-point value, clamped to the range [0,1].
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Math.GLclampd">
|
||||
<summary>
|
||||
OpenGL numeric type.
|
||||
An IEEE-754 double precision floating-point value, clamped to the range [0,1].
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Math.Vec2d">
|
||||
<summary>
|
||||
A two dimension vector defined by two elements.
|
||||
|
||||
+2537
-5084
File diff suppressed because it is too large
Load Diff
@@ -132,21 +132,17 @@ namespace StgSharp.Graphics
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct GLFWgamepadstate
|
||||
public unsafe struct GLFWgamepadstate
|
||||
{
|
||||
|
||||
/*! The states of each [gamepad button](@ref gamepad_buttons), `GLFW_PRESS`
|
||||
* or `GLFW_RELEASE`.
|
||||
*/
|
||||
byte[] buttons = new byte[15];
|
||||
public fixed byte buttons[15];
|
||||
/*! The states of each [gamepad axis](@ref gamepad_axes), in the range -1.0
|
||||
* to 1.0 inclusive.
|
||||
*/
|
||||
float[] axes = new float[6];
|
||||
|
||||
public GLFWgamepadstate()
|
||||
{
|
||||
}
|
||||
public fixed float axes[6];
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
@@ -216,10 +212,8 @@ namespace StgSharp.Graphics
|
||||
public bool stickyMouseButtons = false;
|
||||
public bool lockKeyMods = false;
|
||||
public int cursorMode = 0;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
||||
public byte[] mouseButtons = new byte[8];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 349)]
|
||||
public byte[] keys = new byte[349];
|
||||
public fixed byte mouseButtons[8];
|
||||
public fixed byte keys[349];
|
||||
// Virtual cursor position when cursor is disabled
|
||||
public double virtualCursorPosX = 0, virtualCursorPosY = 0;
|
||||
public bool rawMouseMotion = false;
|
||||
@@ -307,8 +301,7 @@ namespace StgSharp.Graphics
|
||||
internal struct Ns
|
||||
{
|
||||
GLFWbool retina = false;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
|
||||
byte[] frameName = new byte[256];
|
||||
public fixed byte frameName[256];
|
||||
|
||||
public Ns()
|
||||
{
|
||||
@@ -318,10 +311,9 @@ namespace StgSharp.Graphics
|
||||
|
||||
internal struct X11
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
|
||||
byte[] className = new byte[256];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
|
||||
byte[] instanceName = new byte[256];
|
||||
|
||||
public fixed byte className[256];
|
||||
public fixed byte instanceName[256];
|
||||
|
||||
public X11()
|
||||
{
|
||||
@@ -337,8 +329,7 @@ namespace StgSharp.Graphics
|
||||
|
||||
internal struct Wl
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
|
||||
byte[] appId = new byte[256];
|
||||
public fixed byte appId[256];
|
||||
|
||||
public Wl()
|
||||
{
|
||||
@@ -517,8 +508,7 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
GLFWbool available;
|
||||
void* handle;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
||||
byte*[] extensions = new byte*[2];
|
||||
fixed ulong extensions[2];
|
||||
IntPtr GetInstanceProcAddr;
|
||||
GLFWbool KHR_surface;
|
||||
GLFWbool KHR_win32_surface;
|
||||
@@ -560,10 +550,8 @@ namespace StgSharp.Graphics
|
||||
public unsafe struct GLFWmapping
|
||||
{
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
|
||||
byte[] name = new byte[128];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 33)]
|
||||
byte[] guid = new byte[33];
|
||||
fixed byte name[128];
|
||||
fixed byte guid[33];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)]
|
||||
GLFWmapelement[] buttons = new GLFWmapelement[15];
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
|
||||
@@ -584,11 +572,9 @@ namespace StgSharp.Graphics
|
||||
int buttonCount;
|
||||
byte* hats;
|
||||
int hatCount;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
|
||||
byte[] name = new byte[128];
|
||||
fixed byte name[128];
|
||||
void* userPointer;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 33)]
|
||||
byte[] guid = new byte[33];
|
||||
fixed byte guid[33];
|
||||
//GLFWmapping* mapping;
|
||||
IntPtr mapping;
|
||||
|
||||
@@ -783,8 +769,7 @@ namespace StgSharp.Graphics
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct VkExtensionProperties
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
|
||||
byte[] extensionName = new byte[256];
|
||||
fixed byte extensionName[256];
|
||||
uint specVersion;
|
||||
|
||||
public VkExtensionProperties()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+131
-119
@@ -1,6 +1,8 @@
|
||||
using StgSharp.Controlling;
|
||||
using StgSharp.Logic;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
@@ -21,40 +23,36 @@ namespace StgSharp.Graphics
|
||||
/// </summary>
|
||||
public abstract partial class Form
|
||||
{
|
||||
#region metadata
|
||||
internal LinkedList<Control> allControl;
|
||||
internal Vector4 color;
|
||||
internal Thread formThread;
|
||||
internal IglFunc GL;
|
||||
internal Vector4 backgroundColor;
|
||||
internal unsafe GLcontext* contextID;
|
||||
internal DynamicArrayList<IntPtr> formBuffer;
|
||||
internal int height;
|
||||
internal IntPtr monitor;
|
||||
internal string name;
|
||||
internal FormRenderBuffer RenderBuffer;
|
||||
internal Form sharedForm;
|
||||
internal FrameUpdateTimer timer = new FrameUpdateTimer();
|
||||
internal FormUpdateBuffer UpdateBuffer;
|
||||
internal int width;
|
||||
internal IntPtr windowID;
|
||||
|
||||
private bool alignAtRender;
|
||||
private bool alignAtUpdate;
|
||||
private bool isSingleThread;
|
||||
|
||||
private Action OnRender;
|
||||
private Action OnUpdate;
|
||||
|
||||
#region thread sync
|
||||
internal readonly SemaphoreSlim ouetrPong = new SemaphoreSlim(0, 1);
|
||||
private SemaphoreSlim ping = new SemaphoreSlim(1, 1);
|
||||
private SemaphoreSlim pong = new SemaphoreSlim(0, 1);
|
||||
protected IglFunc gl;
|
||||
private bool closed;
|
||||
#endregion
|
||||
|
||||
private Form()
|
||||
#region form thread setting
|
||||
internal FrameUpdateTimer timer = new FrameUpdateTimer();
|
||||
private SemaphoreSlim _renderFinishSignal = new SemaphoreSlim(0, 1);
|
||||
private SemaphoreSlim _renderStartSignal = new SemaphoreSlim(1, 1);
|
||||
private bool isSingleThread = true;
|
||||
private Thread renderThread;
|
||||
#endregion
|
||||
|
||||
#region glapicount
|
||||
private int missingAPIcount = 0;
|
||||
private int problemAPIcount = 0;
|
||||
#endregion
|
||||
|
||||
protected Form()
|
||||
{
|
||||
#if NET5_0_OR_GREATER
|
||||
Unsafe.SkipInit(out UpdateBuffer);
|
||||
Unsafe.SkipInit(out RenderBuffer);
|
||||
Unsafe.SkipInit(out GL);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -66,6 +64,20 @@ namespace StgSharp.Graphics
|
||||
set => height = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// OpenGL package used by current form context.
|
||||
/// </summary>
|
||||
public IglFunc GL
|
||||
{
|
||||
get => gl;
|
||||
internal set => gl = value;
|
||||
}
|
||||
|
||||
internal Thread RenderThread
|
||||
{
|
||||
get { return renderThread; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Representing
|
||||
/// </summary>
|
||||
@@ -73,6 +85,7 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
get { return isSingleThread; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Width of this form, represent in <see cref="int"/>
|
||||
/// </summary>
|
||||
@@ -86,148 +99,152 @@ namespace StgSharp.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Width of this form, represent in <see cref="int"/>
|
||||
/// </summary>
|
||||
public int Width
|
||||
{
|
||||
get => width;
|
||||
set => width = value;
|
||||
}
|
||||
|
||||
internal bool IsSingleThread
|
||||
{
|
||||
get { return isSingleThread; }
|
||||
}
|
||||
|
||||
internal SemaphoreSlim RenderFinishSignal
|
||||
{
|
||||
get { return _renderFinishSignal; }
|
||||
set { _renderFinishSignal = value; }
|
||||
}
|
||||
|
||||
internal SemaphoreSlim RenderStrartSignal
|
||||
{
|
||||
get { return _renderStartSignal; }
|
||||
set { _renderStartSignal = value; }
|
||||
}
|
||||
unsafe ~Form()
|
||||
{
|
||||
Marshal.FreeHGlobal((IntPtr)contextID);
|
||||
RenderBuffer.GL.api = default;
|
||||
}
|
||||
|
||||
#region form main
|
||||
|
||||
public abstract void Deinit(object[] args);
|
||||
public abstract void Deinit(params object[] args);
|
||||
|
||||
/// <summary>
|
||||
/// Necessary operation to init this form.
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
public abstract void Init(object[] args);
|
||||
public abstract void Init(params object[] args);
|
||||
|
||||
/// <summary>
|
||||
/// Behaviour of current form when in a render cycle.
|
||||
/// When this form
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
public abstract void Main(object[] args);
|
||||
public abstract void Main(params object[] args);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Init this form and render it on screen, and respond with operation
|
||||
/// </summary>
|
||||
public void Show(object[] args)
|
||||
public void Show(params object[] args)
|
||||
{
|
||||
if (args == null)
|
||||
if (gl == null)
|
||||
{
|
||||
args = new object[4] { null, null, null, null };
|
||||
InternalIO.InternalWriteLog($"Attempt to show form {name} before init", LogType.Error);
|
||||
}
|
||||
Operation.RegistForm(this);
|
||||
if (!TimeLine.RenderStarted)
|
||||
else if (isSingleThread)
|
||||
{
|
||||
TimeLine.RenderAll();
|
||||
while (gl.GetWindowShouldClose(this))
|
||||
{
|
||||
Main(args);
|
||||
}
|
||||
}
|
||||
try
|
||||
else
|
||||
{
|
||||
Thread updateThread = new Thread(InternalUpdateFrame);
|
||||
Thread renderThread = new Thread(InternalRenderFrame);
|
||||
|
||||
updateThread.Start(args[1]);
|
||||
renderThread.Start(args[2]);
|
||||
|
||||
updateThread.Join();
|
||||
while (gl.GetWindowShouldClose(this))
|
||||
{
|
||||
Main(args);
|
||||
}
|
||||
renderThread.Join();
|
||||
|
||||
ping.Dispose();
|
||||
pong.Dispose();
|
||||
|
||||
InternalDeinit(args[3]);
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
internal void InternalDeinit(object args)
|
||||
private void InternalRender()
|
||||
{
|
||||
Deinit((object[])args);
|
||||
#pragma warning disable CS8602
|
||||
ConcurrentQueue<Action<int>> glActions = (gl as GLonUpdate).GLactionQueue;
|
||||
#pragma warning restore CS8602
|
||||
Action currentAction = new Action(() => { return; });
|
||||
while (gl.GetWindowShouldClose(this))
|
||||
{
|
||||
if (glActions.TryDequeue(out currentAction))
|
||||
{
|
||||
currentAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void InternalInit(object args)
|
||||
internal void InternalDeinit(params object[] args)
|
||||
{
|
||||
Deinit(args);
|
||||
}
|
||||
|
||||
internal void InternalInit(params object[] args)
|
||||
{
|
||||
Init((object[])args);
|
||||
}
|
||||
|
||||
internal void InternalRenderFrame()
|
||||
{
|
||||
while (InternalIO.glfw.WindowShouldClose(windowID) != 0)
|
||||
{
|
||||
ping.Wait();
|
||||
try
|
||||
{
|
||||
OnRender();
|
||||
timer.WaitNextFrame();
|
||||
pong.Release();
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
throw new Exception("Forget to reload GL apis");
|
||||
pong.Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void InternalUpdateFrame()
|
||||
{
|
||||
while (InternalIO.glfw.WindowShouldClose(windowID) != 0)
|
||||
{
|
||||
pong.Wait();
|
||||
try
|
||||
{
|
||||
OnUpdate();
|
||||
timer.WaitNextFrame();
|
||||
ping.Release();
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
throw new Exception("Forget to reload GL apis");
|
||||
ping.Release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Define how current form render in one frame.
|
||||
/// </summary>
|
||||
/// <param name="totalThread">
|
||||
///
|
||||
/// Please define
|
||||
/// <param name="requireDoubleRendering">
|
||||
/// Please define this befor calling any OpenGL api and other graphic methods.
|
||||
/// </param>
|
||||
protected void SetRenderThreads(bool requireDoubleRendering)
|
||||
protected unsafe void SetRenderThreads(int requiredThreds)
|
||||
{
|
||||
switch (requireDoubleRendering)
|
||||
if (gl != default)
|
||||
{
|
||||
case true:
|
||||
isSingleThread = false;
|
||||
OnUpdate = new Action(() => { });
|
||||
break;
|
||||
case false:
|
||||
isSingleThread = false;
|
||||
break;
|
||||
throw new InvalidOperationException("Cannot define threads after loading gl context.");
|
||||
}
|
||||
if (requiredThreds == 1)
|
||||
{
|
||||
isSingleThread = true;
|
||||
}
|
||||
else if (requiredThreds == 2)
|
||||
{
|
||||
isSingleThread = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(GLcontext)));
|
||||
contextID = (GLcontext*)ptr;
|
||||
*contextID = new GLcontext();
|
||||
contextID->glGetString = (delegate*<uint, IntPtr>)IntPtr.Zero;
|
||||
InternalIO.InternalWriteLog("Successfully create a context binded to current form. " +
|
||||
$"Its ID is {(ulong)ptr}", LogType.Info);
|
||||
if (isSingleThread)
|
||||
{
|
||||
gl = new GLonRender(contextID);
|
||||
}
|
||||
else
|
||||
{
|
||||
GLonUpdate pack = new GLonUpdate(contextID);
|
||||
gl = pack;
|
||||
renderThread = new Thread(new ThreadStart(InternalRender));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Constructor of a Form, creats an instance of a form and
|
||||
/// initilize all the customizing operations.
|
||||
/// Set all necessary metadata to current form instance
|
||||
/// </summary>
|
||||
public void InitForm(int width, int height, string name, IntPtr monitor, Form sharedForm)
|
||||
public void SetMetadata(int width, int height, string name, IntPtr monitor, Form sharedForm)
|
||||
{
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
@@ -267,18 +284,10 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
windowID = windowPtr;
|
||||
}
|
||||
GLcontext glContext = new GLcontext();
|
||||
IntPtr ptr = Marshal.AllocHGlobal(sizeof(GLcontextIO));
|
||||
contextID = (GLcontextIO*)ptr;
|
||||
*contextID = new GLcontextIO();
|
||||
InternalIO.InternalWriteLog("Successfully create a context binded to current form. " +
|
||||
$"Its ID is {(ulong)ptr}", LogType.Info);
|
||||
GLonRender glRender = new GLonRender(glContext);
|
||||
GLonUpdate glUpdate = new GLonUpdate(glContext);
|
||||
}
|
||||
InternalIO.InternalSetCurrentGLContext(windowID, (IntPtr)contextID);
|
||||
}
|
||||
|
||||
}
|
||||
InternalIO.InternalSetCurrentGLContext(windowID, contextID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resize the current form
|
||||
@@ -298,6 +307,7 @@ namespace StgSharp.Graphics
|
||||
/// <param name="size">
|
||||
/// A <see cref="Vec2d"/> (width,height) representing the new size of current form
|
||||
/// </param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SetSize(Vec2d size)
|
||||
{
|
||||
this.Size = size;
|
||||
@@ -312,6 +322,7 @@ namespace StgSharp.Graphics
|
||||
/// <param name="minHeight">Minimum height of current form</param>
|
||||
/// <param name="maxWidth">Maximum width of curent form</param>
|
||||
/// <param name="maxHeight">Maximum height of current form</param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SetSizeLimit(int minWidth, int minHeight, int maxWidth, int maxHeight)
|
||||
{
|
||||
InternalIO.glfw.SetWindowSizeLimits(
|
||||
@@ -328,6 +339,7 @@ namespace StgSharp.Graphics
|
||||
/// <param name="maxSize">
|
||||
/// Maximum size of current form. In form of a <see cref="Vec2d"/> of (width,height)
|
||||
/// </param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SetSizeLimit(Vec2d minSize, Vec2d maxSize)
|
||||
{
|
||||
InternalIO.glfw.SetWindowSizeLimits(
|
||||
|
||||
@@ -1,20 +1,37 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
public unsafe class ElementBuffer : IDisposable, IBufferObject
|
||||
public partial class Form
|
||||
{
|
||||
uint[] _bufferID;
|
||||
private IglFunc GL;
|
||||
/// <summary>
|
||||
/// Create a set of <see cref="ElementBuffer"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">Amount of EBO to be created.</param>
|
||||
/// <returns></returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
protected ElementBuffer CreateElementBuffer(uint count)
|
||||
{
|
||||
return new ElementBuffer(count, this.gl);
|
||||
}
|
||||
}
|
||||
|
||||
internal ElementBuffer(int n, IglFunc glFunc)
|
||||
/// <summary>
|
||||
/// A collecion of handle to Element Buffer Object in OpenGL.
|
||||
/// Each <see cref="uint"/> value indexed from instance of this class this
|
||||
/// is the only handle to one Element Buffer Object.
|
||||
/// </summary>
|
||||
public unsafe class ElementBuffer : IBufferObject
|
||||
{
|
||||
internal ElementBuffer(uint n, IglFunc gl)
|
||||
{
|
||||
_bufferID = new uint[n];
|
||||
GL = glFunc;
|
||||
GL = gl;
|
||||
fixed (uint* id = _bufferID)
|
||||
{
|
||||
GL.GenBuffers(n, id);
|
||||
@@ -26,7 +43,7 @@ namespace StgSharp.Graphics
|
||||
get { return _bufferID[n]; }
|
||||
}
|
||||
|
||||
public void Bind(int index)
|
||||
public override void Bind(int index)
|
||||
{
|
||||
GL.BindBuffer(BufferType.ELEMENT_ARRAY_BUFFER, _bufferID[index]);
|
||||
}
|
||||
@@ -38,14 +55,12 @@ namespace StgSharp.Graphics
|
||||
GL.SetBufferData(BufferType.ELEMENT_ARRAY_BUFFER, bufferArray, usage);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
protected sealed override void Dispose(bool disposing)
|
||||
{
|
||||
fixed (uint* id = _bufferID)
|
||||
if (disposing)
|
||||
{
|
||||
GL.DeleteBuffers(_bufferID.Length, id);
|
||||
GL.DeleteBuffers((uint)_bufferID.Length, _bufferID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
internal class FormRenderBuffer
|
||||
{
|
||||
internal GLonRender GL;
|
||||
internal InternalFormBuffer data;
|
||||
}
|
||||
|
||||
internal class FormUpdateBuffer
|
||||
{
|
||||
internal GLonUpdate GL;
|
||||
internal InternalFormBuffer data;
|
||||
}
|
||||
|
||||
internal class InternalFormBuffer
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,38 @@ namespace StgSharp.Graphics
|
||||
/// <summary>
|
||||
/// Interface of all kinds OpenGL buffer onjects
|
||||
/// </summary>
|
||||
public interface IBufferObject
|
||||
public abstract class IBufferObject : IDisposable
|
||||
{
|
||||
uint this[int index] { get; }
|
||||
void Bind(int index);
|
||||
protected uint[] _bufferID;
|
||||
protected IglFunc GL;
|
||||
|
||||
/// <summary>
|
||||
/// Get the only handle to one of the Object instance
|
||||
/// </summary>
|
||||
/// <param name="index"></param>
|
||||
/// <returns></returns>
|
||||
public uint this[int index]
|
||||
{
|
||||
get { return _bufferID[index]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Bind a buffer instance to OpenGL
|
||||
/// </summary>
|
||||
/// <param name="index">Index of handle of the object in this instance to be bind</param>
|
||||
public abstract void Bind(int index);
|
||||
|
||||
protected abstract void Dispose(bool disposing);
|
||||
|
||||
~IBufferObject()
|
||||
{
|
||||
Dispose(disposing: false);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(disposing: true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,55 +5,59 @@ using System.Text;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
|
||||
public unsafe struct VertexArray : IDisposable, IBufferObject
|
||||
public partial class Form
|
||||
{
|
||||
internal uint[] _bufferID;
|
||||
private IglFunc GL;
|
||||
/// <summary>
|
||||
/// Create a set of <see cref="VertexArray"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">Amount of VAO to be crated.</param>
|
||||
/// <returns></returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
protected VertexArray CreateVertexArray(uint count)
|
||||
{
|
||||
return new VertexArray(count, gl);
|
||||
}
|
||||
}
|
||||
|
||||
internal VertexArray(int n)
|
||||
public unsafe class VertexArray : IBufferObject
|
||||
{
|
||||
internal VertexArray(uint n, IglFunc gl)
|
||||
{
|
||||
_bufferID = new uint[n];
|
||||
//GL = glFunc;
|
||||
GL = gl;
|
||||
fixed (uint* id = _bufferID)
|
||||
{
|
||||
GL.GenVertexArrays(n, id);
|
||||
}
|
||||
}
|
||||
|
||||
public uint this[int n]
|
||||
{
|
||||
get
|
||||
{
|
||||
return _bufferID[n];
|
||||
}
|
||||
}
|
||||
|
||||
public void Bind(int index)
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public sealed override void Bind(int index)
|
||||
{
|
||||
GL.BindVertexArray(_bufferID[index]);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
fixed (uint* id = _bufferID)
|
||||
{
|
||||
GL.DeleteVertexArrays(_bufferID.Length, id);
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void BindNull()
|
||||
{
|
||||
GL.BindVertexArray(0);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void SetVertexAttribute(uint index, int vertexLength, Type dataType, bool isNomalized, int stride, int pointer)
|
||||
public void SetVertexAttribute(uint index, int vertexLength, Type dataType, bool isNomalized, uint stride, int pointer)
|
||||
{
|
||||
GL.SetVertexAttribute(
|
||||
index, vertexLength, dataType,
|
||||
isNomalized,
|
||||
stride, pointer);
|
||||
}
|
||||
|
||||
protected sealed override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
GL.DeleteVertexArrays((uint)_bufferID.Length, _bufferID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,17 +3,29 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Security;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
public unsafe struct VertexBuffer : IDisposable, IBufferObject
|
||||
public partial class Form
|
||||
{
|
||||
internal uint[] _bufferID;
|
||||
private IglFunc GL;
|
||||
/// <summary>
|
||||
/// Create aset of <see cref="VertexBuffer"/>.
|
||||
/// </summary>
|
||||
/// <param name="count">Amount of Object to be created.</param>
|
||||
/// <returns></returns>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
protected VertexBuffer CreateVertexBuffer(uint count)
|
||||
{
|
||||
return new VertexBuffer(count, gl);
|
||||
}
|
||||
}
|
||||
|
||||
internal VertexBuffer(int n, IglFunc glFunc)
|
||||
public unsafe class VertexBuffer : IBufferObject
|
||||
{
|
||||
internal VertexBuffer(uint n, IglFunc glFunc)
|
||||
{
|
||||
_bufferID = new uint[n];
|
||||
GL = glFunc;
|
||||
@@ -23,29 +35,33 @@ namespace StgSharp.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
public uint this[int n]
|
||||
{
|
||||
get { return _bufferID[n]; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Unbind()
|
||||
{
|
||||
GL.BindBuffer(BufferType.ARRAY_BUFFER, 0);
|
||||
}
|
||||
|
||||
public void Bind(int index)
|
||||
public sealed override void Bind(int index)
|
||||
{
|
||||
GL.BindBuffer(BufferType.ARRAY_BUFFER, _bufferID[index]);
|
||||
GL.BindBuffer(BufferType.ARRAY_BUFFER, (uint)index);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
internal void ChangeEnvironment(IglFunc gl)
|
||||
{
|
||||
fixed (uint* id = _bufferID)
|
||||
GL = gl;
|
||||
}
|
||||
|
||||
protected sealed override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
GL.DeleteBuffers(_bufferID.Length, id);
|
||||
fixed (uint* id = _bufferID)
|
||||
{
|
||||
GL.DeleteBuffers((uint)_bufferID.Length, _bufferID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,139 +11,143 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
public partial class Form
|
||||
{
|
||||
protected Texture CreateTexture(int n)
|
||||
protected Texture CreateTexture(uint n)
|
||||
{
|
||||
return new Texture(n, GL);
|
||||
return new Texture(n, this.GL);
|
||||
}
|
||||
}
|
||||
public unsafe class Texture
|
||||
{
|
||||
internal uint[] textureId;
|
||||
internal Image[] sourceList;
|
||||
internal static bool[] unitActivated = new bool[16];
|
||||
private IglFunc GL;
|
||||
|
||||
internal void ChangeEnvironment(IglFunc gl)
|
||||
{
|
||||
GL = gl;
|
||||
}
|
||||
|
||||
protected unsafe class Texture
|
||||
internal Texture(uint n, IglFunc gl)
|
||||
{
|
||||
internal uint[] textureId;
|
||||
internal Image[] sourceList;
|
||||
internal static bool[] unitActivated = new bool[16];
|
||||
private IglFunc GL;
|
||||
|
||||
internal Texture(int n, IglFunc glFunc)
|
||||
textureId = new uint[n];
|
||||
sourceList = new Image[n];
|
||||
GL = gl;
|
||||
fixed (uint* id = textureId)
|
||||
{
|
||||
textureId = new uint[n];
|
||||
sourceList = new Image[n];
|
||||
GL = glFunc;
|
||||
fixed (uint* id = textureId)
|
||||
{
|
||||
GL.GenTextures(n, id);
|
||||
}
|
||||
GL.GenTextures(n, id);
|
||||
}
|
||||
|
||||
public void Bind2D(int index)
|
||||
{
|
||||
GL.BindTexture(GLconst.TEXTURE_2D, textureId[index]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="loader"></param>
|
||||
public unsafe void LoadTexture(int index, string name, ImageLoader loader)
|
||||
{
|
||||
sourceList[index] = new Image();
|
||||
fixed (Image.ImageInfo* textureInfo = &sourceList[index].info)
|
||||
{
|
||||
InternalIO.InternalLoadImage(name, textureInfo, loader);
|
||||
}
|
||||
|
||||
if (sourceList[index].info.pixelPtr != IntPtr.Zero)
|
||||
{
|
||||
uint channel;
|
||||
switch (sourceList[index].info.channel)
|
||||
{
|
||||
case 1:
|
||||
channel = GLconst.RED; break;
|
||||
case 2:
|
||||
channel = GLconst.RG; break;
|
||||
case 3:
|
||||
channel = GLconst.RGB; break;
|
||||
case 4:
|
||||
channel = GLconst.RGBA; break;
|
||||
default:
|
||||
channel = 0;
|
||||
break;
|
||||
}
|
||||
GL.TextureImage2d(
|
||||
GLconst.TEXTURE_2D, 0, channel,
|
||||
sourceList[index].Width, sourceList[index].Height,
|
||||
channel, GLconst.UNSIGNED_BYTE, (byte*)sourceList[index].info.pixelPtr
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog($"Failed to load image file of \"{name}\".", LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
#region texture set
|
||||
|
||||
public void Set2dFilterProperty(
|
||||
Filter onMinify, Filter onMagnify)
|
||||
{
|
||||
GL.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_MIN_FILTER, (int)onMinify);
|
||||
GL.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_MAG_FILTER, (int)onMagnify);
|
||||
}
|
||||
|
||||
public void Set2dWrapProperty(
|
||||
Wrap onHorizontial, Wrap onVertical)
|
||||
{
|
||||
GL.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_WRAP_S, (int)onHorizontial);
|
||||
GL.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_WRAP_T, (int)onVertical);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void Activate(TextureUnit unit)
|
||||
{
|
||||
GL.ActiveTexture((uint)unit);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public enum TextureUnit
|
||||
public void Bind2D(int index)
|
||||
{
|
||||
Unit0 = GLconst.TEXTURE0,
|
||||
Unit1 = GLconst.TEXTURE1,
|
||||
Unit2 = GLconst.TEXTURE2,
|
||||
Unit3 = GLconst.TEXTURE3,
|
||||
Unit4 = GLconst.TEXTURE4,
|
||||
Unit5 = GLconst.TEXTURE5,
|
||||
Unit6 = GLconst.TEXTURE6,
|
||||
Unit7 = GLconst.TEXTURE7,
|
||||
Unit8 = GLconst.TEXTURE8,
|
||||
Unit9 = GLconst.TEXTURE9,
|
||||
Unit10 = GLconst.TEXTURE10,
|
||||
Unit11 = GLconst.TEXTURE11,
|
||||
Unit12 = GLconst.TEXTURE12,
|
||||
Unit13 = GLconst.TEXTURE13,
|
||||
Unit14 = GLconst.TEXTURE14,
|
||||
Unit15 = GLconst.TEXTURE15,
|
||||
GL.BindTexture(GLconst.TEXTURE_2D, textureId[index]);
|
||||
}
|
||||
|
||||
public enum Wrap
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="index"></param>
|
||||
/// <param name="loader"></param>
|
||||
public unsafe void LoadTexture(int index, string name, ImageLoader loader)
|
||||
{
|
||||
Repeat = GLconst.REPEAT,
|
||||
MirroredRepeat = GLconst.MIRRORED_REPEAT,
|
||||
ClampToEdge = GLconst.CLAMP_TO_EDGE,
|
||||
ClampToBorder = GLconst.CLAMP_TO_BORDER,
|
||||
sourceList[index] = new Image();
|
||||
fixed (Image.ImageInfo* textureInfo = &sourceList[index].info)
|
||||
{
|
||||
InternalIO.InternalLoadImage(name, textureInfo, loader);
|
||||
}
|
||||
|
||||
if (sourceList[index].info.pixelPtr != IntPtr.Zero)
|
||||
{
|
||||
uint channel;
|
||||
switch (sourceList[index].info.channel)
|
||||
{
|
||||
case 1:
|
||||
channel = GLconst.RED; break;
|
||||
case 2:
|
||||
channel = GLconst.RG; break;
|
||||
case 3:
|
||||
channel = GLconst.RGB; break;
|
||||
case 4:
|
||||
channel = GLconst.RGBA; break;
|
||||
default:
|
||||
channel = 0;
|
||||
break;
|
||||
}
|
||||
GL.TextureImage2d(
|
||||
GLconst.TEXTURE_2D, 0, channel,
|
||||
(uint)sourceList[index].Width, (uint)sourceList[index].Height,
|
||||
channel, GLconst.UNSIGNED_BYTE, (byte*)sourceList[index].info.pixelPtr
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
InternalIO.InternalWriteLog($"Failed to load image file of \"{name}\".", LogType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
public enum Filter
|
||||
#region texture set
|
||||
|
||||
public void Set2dFilterProperty(
|
||||
Filter onMinify, Filter onMagnify)
|
||||
{
|
||||
Nearest = GLconst.NEAREST,
|
||||
Linear = GLconst.LINEAR,
|
||||
Nearest_LinearMipmap = GLconst.NEAREST_MIPMAP_LINEAR,
|
||||
Linear_LinearMipmap = GLconst.LINEAR_MIPMAP_LINEAR,
|
||||
Nearest_NearestMipmap = GLconst.NEAREST_MIPMAP_NEAREST,
|
||||
Linear_NearestMipmap = GLconst.LINEAR_MIPMAP_NEAREST,
|
||||
GL.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_MIN_FILTER, (int)onMinify);
|
||||
GL.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_MAG_FILTER, (int)onMagnify);
|
||||
}
|
||||
|
||||
public void Set2dWrapProperty(
|
||||
Wrap onHorizontial, Wrap onVertical)
|
||||
{
|
||||
GL.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_WRAP_S, (int)onHorizontial);
|
||||
GL.TextureParameter(GLconst.TEXTURE_2D, GLconst.TEXTURE_WRAP_T, (int)onVertical);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void Activate(TextureUnit unit)
|
||||
{
|
||||
GL.ActiveTexture((uint)unit);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public enum TextureUnit
|
||||
{
|
||||
Unit0 = GLconst.TEXTURE0,
|
||||
Unit1 = GLconst.TEXTURE1,
|
||||
Unit2 = GLconst.TEXTURE2,
|
||||
Unit3 = GLconst.TEXTURE3,
|
||||
Unit4 = GLconst.TEXTURE4,
|
||||
Unit5 = GLconst.TEXTURE5,
|
||||
Unit6 = GLconst.TEXTURE6,
|
||||
Unit7 = GLconst.TEXTURE7,
|
||||
Unit8 = GLconst.TEXTURE8,
|
||||
Unit9 = GLconst.TEXTURE9,
|
||||
Unit10 = GLconst.TEXTURE10,
|
||||
Unit11 = GLconst.TEXTURE11,
|
||||
Unit12 = GLconst.TEXTURE12,
|
||||
Unit13 = GLconst.TEXTURE13,
|
||||
Unit14 = GLconst.TEXTURE14,
|
||||
Unit15 = GLconst.TEXTURE15,
|
||||
}
|
||||
|
||||
public enum Wrap
|
||||
{
|
||||
Repeat = GLconst.REPEAT,
|
||||
MirroredRepeat = GLconst.MIRRORED_REPEAT,
|
||||
ClampToEdge = GLconst.CLAMP_TO_EDGE,
|
||||
ClampToBorder = GLconst.CLAMP_TO_BORDER,
|
||||
}
|
||||
|
||||
public enum Filter
|
||||
{
|
||||
Nearest = GLconst.NEAREST,
|
||||
Linear = GLconst.LINEAR,
|
||||
Nearest_LinearMipmap = GLconst.NEAREST_MIPMAP_LINEAR,
|
||||
Linear_LinearMipmap = GLconst.LINEAR_MIPMAP_LINEAR,
|
||||
Nearest_NearestMipmap = GLconst.NEAREST_MIPMAP_NEAREST,
|
||||
Linear_NearestMipmap = GLconst.LINEAR_MIPMAP_NEAREST,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,15 +9,7 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
public unsafe partial class Form
|
||||
{
|
||||
internal GLcontextIO* contextID;
|
||||
|
||||
private int missingAPIcount = 0;
|
||||
private int problemAPIcount = 0;
|
||||
|
||||
internal GLcontext glContext
|
||||
{
|
||||
get { return RenderBuffer.GL.api; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using StgSharp.Logic;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -11,19 +12,18 @@ namespace StgSharp.Graphics
|
||||
|
||||
internal unsafe partial class GLonRender : IglFunc
|
||||
{
|
||||
internal GLcontext* api;
|
||||
FrameTimeoutException refreshSIgnal = new FrameTimeoutException();
|
||||
|
||||
internal GLonRender(GLcontext context)
|
||||
|
||||
internal GLonRender(GLcontext* context)
|
||||
{
|
||||
api = context;
|
||||
}
|
||||
|
||||
internal GLcontext api;
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.ActiveTexture(uint type)
|
||||
{
|
||||
api.ActiveTexture(type);
|
||||
api->glActiveTexture(type);
|
||||
}
|
||||
|
||||
void IglFunc.AfterAlign(Form form, Action action)
|
||||
@@ -45,41 +45,44 @@ namespace StgSharp.Graphics
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.AttachShader(uint program, uint shader)
|
||||
{
|
||||
api.AttachShader(program, shader);
|
||||
api->glAttachShader(program, shader);
|
||||
}
|
||||
|
||||
void IglFunc.BindBuffer(BufferType bufferType, uint index)
|
||||
{
|
||||
api.BindBuffer((uint)bufferType, index);
|
||||
api->glBindBuffer((uint)bufferType, index);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.BindTexture(uint type, uint texture)
|
||||
{
|
||||
api.BindTexture(type, texture);
|
||||
api->glBindTexture(type, texture);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.BindVertexArray(uint index)
|
||||
{
|
||||
api.BindVertexArray(index);
|
||||
api->glBindVertexArray(index);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.Clear(MaskBufferBit mask)
|
||||
{
|
||||
api.Clear((uint)mask);
|
||||
api->glClear((uint)mask);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.ClearColor(float R, float G, float B, float A)
|
||||
{
|
||||
api.ClearColor(R, G, B, A);
|
||||
api->glClearColor(R, G, B, A);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.ClearGraphicError()
|
||||
{
|
||||
while (api.GetError() != 0) { }
|
||||
while (api->glGetError() != 0) { }
|
||||
}
|
||||
|
||||
uint IglFunc.CompileShader(string shaderCode, ShaderType shaderType)
|
||||
{
|
||||
uint shaderID;
|
||||
@@ -123,7 +126,7 @@ namespace StgSharp.Graphics
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
uint IglFunc.CreateProgram()
|
||||
{
|
||||
return api.CreateProgram();
|
||||
return api->glCreateProgram();
|
||||
}
|
||||
|
||||
unsafe IntPtr IglFunc.CreateWindowHandle(
|
||||
@@ -152,36 +155,44 @@ namespace StgSharp.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe uint IglFunc.CreatGraphicProgram()
|
||||
{
|
||||
return api.CreateProgram();
|
||||
return api->glCreateProgram();
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.DeleteBuffers(int count, uint* ptr)
|
||||
unsafe void IglFunc.DeleteBuffer(uint handle)
|
||||
{
|
||||
api.DeleteBuffers(count, ptr);
|
||||
api->glDeleteBuffers(1, &handle);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.DeleteVertexArrays(int count, uint* ptr)
|
||||
unsafe void IglFunc.DeleteBuffers(uint count, uint[] handle)
|
||||
{
|
||||
api.DeleteVertexArrays(count, ptr);
|
||||
fixed (uint* ptr = handle)
|
||||
api->glDeleteBuffers(count, ptr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.DrawElements(GepmetryType mode, int count, Type type, IntPtr ptr)
|
||||
unsafe void IglFunc.DeleteVertexArrays(uint count, uint[] arrays)
|
||||
{
|
||||
fixed (uint* ptr = arrays)
|
||||
api->glDeleteVertexArrays(count, ptr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.DrawElements(GepmetryType mode, uint count, Type type, IntPtr ptr)
|
||||
{
|
||||
uint a;
|
||||
switch (type.Name)
|
||||
switch (Type.GetTypeCode(type))
|
||||
{
|
||||
case "UInt32":
|
||||
case TypeCode.UInt32:
|
||||
a = GLconst.UNSIGNED_INT;
|
||||
break;
|
||||
case "UInt16":
|
||||
case TypeCode.UInt16:
|
||||
a = GLconst.UNSIGNED_SHORT;
|
||||
break;
|
||||
case "Byte":
|
||||
case TypeCode.Byte:
|
||||
a = GLconst.UNSIGNED_BYTE;
|
||||
break;
|
||||
default:
|
||||
@@ -191,31 +202,31 @@ namespace StgSharp.Graphics
|
||||
LogType.Error);
|
||||
return;
|
||||
}
|
||||
api.DrawElements((uint)mode, count, a, (void*)ptr);
|
||||
api->glDrawElements((uint)mode, count, a, (void*)ptr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.GenBuffers(int count, uint* ptr)
|
||||
unsafe void IglFunc.GenBuffers(uint count, uint* ptr)
|
||||
{
|
||||
api.GenBuffers(count, ptr);
|
||||
api->glGenBuffers(count, ptr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.GenTextures(int count, uint* ptr)
|
||||
unsafe void IglFunc.GenTextures(uint count, uint* ptr)
|
||||
{
|
||||
api.GenTextures(count, ptr);
|
||||
api->glGenTextures(count, ptr);
|
||||
}
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.GenVertexArrays(int count, uint* ptr)
|
||||
unsafe void IglFunc.GenVertexArrays(uint count, uint* ptr)
|
||||
{
|
||||
api.GenVertexArrays(count, ptr);
|
||||
api->glGenVertexArrays(count, ptr);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.GetGraphicError()
|
||||
{
|
||||
string error = null;
|
||||
uint code = api.GetError();
|
||||
uint code = api->glGetError();
|
||||
while (code != 0)
|
||||
{
|
||||
error += $"OpenGL error {code}\n";
|
||||
@@ -242,7 +253,7 @@ namespace StgSharp.Graphics
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe int IglFunc.GetUniformLocation(uint program, byte* ptr)
|
||||
{
|
||||
return api.GetUniformLocation(program, ptr);
|
||||
return api->glGetUniformLocation(program, ptr);
|
||||
}
|
||||
|
||||
unsafe bool IglFunc.GetWindowShouldClose(Form form)
|
||||
@@ -263,9 +274,9 @@ namespace StgSharp.Graphics
|
||||
unsafe void IglFunc.SetBufferData<T>(BufferType bufferType, T bufferData, BufferUsage usage)
|
||||
{
|
||||
int size = sizeof(T);
|
||||
api.BufferData(
|
||||
api->glBufferData(
|
||||
(uint)bufferType,
|
||||
size,
|
||||
(UIntPtr)size,
|
||||
&bufferData,
|
||||
(uint)usage);
|
||||
}
|
||||
@@ -274,14 +285,20 @@ namespace StgSharp.Graphics
|
||||
unsafe void IglFunc.SetBufferData<T>(BufferType bufferType, T[] bufferArray, BufferUsage usage)
|
||||
{
|
||||
int size = bufferArray.Length * Marshal.SizeOf(typeof(T));
|
||||
fixed (void* bufferPtr = &bufferArray[0])
|
||||
api.BufferData(
|
||||
if (bufferArray == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
fixed (void* bufferPtr = bufferArray)
|
||||
api->glBufferData(
|
||||
(uint)bufferType,
|
||||
size,
|
||||
(UIntPtr)size,
|
||||
bufferPtr,
|
||||
(uint)usage);
|
||||
}
|
||||
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.SetFrameBufferSizeCallback(IntPtr id, FrameBufferSizeHandler handler)
|
||||
{
|
||||
@@ -290,11 +307,17 @@ namespace StgSharp.Graphics
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.SetVertexAttribute(uint index, int size, Type t, bool normalized, int stride, int pointer)
|
||||
void IglFunc.SetVertexAttribute(uint index, int size, Type t, bool normalized, uint stride, int pointer)
|
||||
{
|
||||
uint type = InternalIO.GLtype[t];
|
||||
api.VertexAttribPointer(index, size, type, normalized, stride, (void*)pointer);
|
||||
api.EnableVertexAttribArray(index);
|
||||
api->glVertexAttribPointer(index, size, type, normalized, stride, (void*)pointer);
|
||||
api->glEnableVertexAttribArray(index);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.SetWindowShouldClose(Form form, bool mark)
|
||||
{
|
||||
InternalIO.glfw.SetWindowShouldClose(form.windowID, mark ? 1 : 0);
|
||||
}
|
||||
|
||||
unsafe void IglFunc.SwapBuffers(Form form)
|
||||
@@ -306,27 +329,31 @@ namespace StgSharp.Graphics
|
||||
InternalIO.glfw.SwapBuffers(form.windowID);
|
||||
}
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.TextureImage2d(uint target, int level, uint internalformat, int width, int height, uint format, uint type, void* pixels)
|
||||
void IglFunc.TextureImage2d(uint target, int level, uint internalformat, uint width, uint height, uint format, uint type, void* pixels)
|
||||
{
|
||||
api.TexImage2D(
|
||||
api->glTexImage2D(
|
||||
target, level, internalformat, width, height, 0, format, type, pixels
|
||||
);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.TextureParameter(uint target, uint pname, int param)
|
||||
{
|
||||
api.TexParameteri(target, pname, param);
|
||||
api->glTexParameteri(target, pname, param);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.UseProgram(uint program)
|
||||
{
|
||||
api.UseProgram(program);
|
||||
api->glUseProgram(program);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.Viewport(int x, int y, int width, int height)
|
||||
void IglFunc.Viewport(int x, int y, uint width, uint height)
|
||||
{
|
||||
api.Viewport(x, y, width, height);
|
||||
api->glViewport(x, y, width, height);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using StgSharp.Logic;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -10,217 +11,97 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
internal class GLonTimeout : IglFunc
|
||||
{
|
||||
FrameTimeoutException refreshSIgnal = new FrameTimeoutException();
|
||||
FrameTimeoutException signal = new FrameTimeoutException("This frame is timeout");
|
||||
|
||||
private static readonly GLonTimeout singleInstance
|
||||
= new GLonTimeout();
|
||||
|
||||
FrameTimeoutException refreshSIgnal = new FrameTimeoutException();
|
||||
FrameTimeoutException signal = new FrameTimeoutException("This frame is timeout");
|
||||
private GLonTimeout() { }
|
||||
|
||||
internal static GLonTimeout Set()
|
||||
{
|
||||
return singleInstance;
|
||||
}
|
||||
void IglFunc.ActiveTexture(uint type) => throw signal;
|
||||
|
||||
void IglFunc.ActiveTexture(uint type)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.AfterAlign(Form form, Action action) => throw signal;
|
||||
|
||||
void IglFunc.AfterAlign(Form form, Action action)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.AlignFrame(Form form) => throw signal;
|
||||
|
||||
void IglFunc.AlignFrame(Form form)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.AttachShader(uint program, uint shader) => throw signal;
|
||||
|
||||
void IglFunc.AttachShader(uint program, uint shader)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.BindBuffer(BufferType bufferType, uint index) => throw signal;
|
||||
|
||||
void IglFunc.BindBuffer(BufferType bufferType, uint index)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.BindTexture(uint type, uint texture) => throw signal;
|
||||
|
||||
void IglFunc.BindTexture(uint type, uint texture)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.BindVertexArray(uint index) => throw signal;
|
||||
|
||||
void IglFunc.BindVertexArray(uint index)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.Clear(MaskBufferBit mask) => throw signal;
|
||||
|
||||
void IglFunc.Clear(MaskBufferBit mask)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.ClearColor(float R, float G, float B, float A) => throw signal;
|
||||
|
||||
void IglFunc.ClearColor(float R, float G, float B, float A)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.ClearGraphicError() => throw signal;
|
||||
|
||||
void IglFunc.ClearGraphicError()
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
uint IglFunc.CompileShader(string shaderCode, ShaderType shaderType) => throw signal;
|
||||
|
||||
uint IglFunc.CompileShader(string shaderCode, ShaderType shaderType)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
uint IglFunc.CreateProgram() => throw signal;
|
||||
|
||||
uint IglFunc.CreateProgram()
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
IntPtr IglFunc.CreateWindowHandle(int width, int height, string tittle, IntPtr monitor, Form share) => throw signal;
|
||||
|
||||
IntPtr IglFunc.CreateWindowHandle(int width, int height, string tittle, IntPtr monitor, Form share)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
uint IglFunc.CreatGraphicProgram() => throw signal;
|
||||
|
||||
uint IglFunc.CreatGraphicProgram()
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
public void DeleteBuffer(uint handle) => throw signal;
|
||||
|
||||
unsafe void IglFunc.DeleteBuffers(int count, uint* ptr)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
unsafe void IglFunc.DeleteBuffers(uint count, uint[] ptr) => throw signal;
|
||||
|
||||
unsafe void IglFunc.DeleteVertexArrays(int count, uint* ptr)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
unsafe void IglFunc.DeleteVertexArrays(uint count, uint[] ptr) => throw signal;
|
||||
|
||||
void IglFunc.DrawElements(GepmetryType mode, int count, Type type, IntPtr ptr)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.DrawElements(GepmetryType mode, uint count, Type type, IntPtr ptr) => throw signal;
|
||||
|
||||
unsafe void IglFunc.GenBuffers(int count, uint* ptr)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
unsafe void IglFunc.GenBuffers(uint count, uint* ptr) => throw signal;
|
||||
|
||||
unsafe void IglFunc.GenTextures(int count, uint* ptr)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
unsafe void IglFunc.GenTextures(uint count, uint* ptr) => throw signal;
|
||||
|
||||
unsafe void IglFunc.GenVertexArrays(int count, uint* ptr)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
unsafe void IglFunc.GenVertexArrays(uint count, uint* ptr) => throw signal;
|
||||
|
||||
void IglFunc.GetGraphicError()
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.GetGraphicError() => throw signal;
|
||||
|
||||
unsafe int IglFunc.GetUniformLocation(uint program, byte* ptr)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
unsafe int IglFunc.GetUniformLocation(uint program, byte* ptr) => throw signal;
|
||||
|
||||
bool IglFunc.GetWindowShouldClose(Form form)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
bool IglFunc.GetWindowShouldClose(Form form) => throw signal;
|
||||
|
||||
void IglFunc.MakeContexCurrent(Form form)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.MakeContexCurrent(Form form) => throw signal;
|
||||
|
||||
void IglFunc.SetBufferData<T>(BufferType bufferType, T bufferData, BufferUsage usage)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.SetBufferData<T>(BufferType bufferType, T bufferData, BufferUsage usage) => throw signal;
|
||||
|
||||
void IglFunc.SetBufferData<T>(BufferType bufferType, T[] bufferArray, BufferUsage usage)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.SetBufferData<T>(BufferType bufferType, T[] bufferArray, BufferUsage usage) => throw signal;
|
||||
|
||||
void IglFunc.SetFrameBufferSizeCallback(IntPtr id, FrameBufferSizeHandler handler)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.SetFrameBufferSizeCallback(IntPtr id, FrameBufferSizeHandler handler) => throw signal;
|
||||
|
||||
void IglFunc.SetValue(Uniform<float, float, float, float> uniform, float v0, float v1, float v2, float v3)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.SetValue(Uniform<float, float, float, float> uniform, float v0, float v1, float v2, float v3) => throw signal;
|
||||
|
||||
void IglFunc.SetValue(Uniform<float, float, float, float> uniform, Vec4d vec)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.SetValue(Uniform<float, float, float, float> uniform, Vec4d vec) => throw signal;
|
||||
|
||||
void IglFunc.SetValue(Uniform<float, float, float> uniform, float v0, float v1, float v2)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.SetValue(Uniform<float, float, float> uniform, float v0, float v1, float v2) => throw signal;
|
||||
|
||||
void IglFunc.SetValue(Uniform<float, float> uniform, float v0, float v1)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.SetValue(Uniform<float, float> uniform, float v0, float v1) => throw signal;
|
||||
|
||||
void IglFunc.SetValue(Uniform<float> uniform, float v0)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.SetValue(Uniform<float> uniform, float v0) => throw signal;
|
||||
|
||||
void IglFunc.SetValue(Uniform<int> uniform, int i0)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.SetValue(Uniform<int> uniform, int i0) => throw signal;
|
||||
|
||||
void IglFunc.SetValue(Uniform<Vec4d> uniform, Vec4d vec)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.SetValue(Uniform<Vec4d> uniform, Vec4d vec) => throw signal;
|
||||
|
||||
void IglFunc.SetVertexAttribute(uint index, int size, Type t, bool normalized, int stride, int pointer)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.SetVertexAttribute(uint index, int size, Type t, bool normalized, uint stride, int pointer) => throw signal;
|
||||
|
||||
void IglFunc.SwapBuffers(Form form)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.SwapBuffers(Form form) => throw signal;
|
||||
|
||||
unsafe void IglFunc.TextureImage2d(uint target, int level, uint internalformat, int width, int height, uint format, uint type, void* pixels)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
unsafe void IglFunc.TextureImage2d(uint target, int level, uint internalformat, uint width, uint height, uint format, uint type, void* pixels) => throw signal;
|
||||
|
||||
void IglFunc.TextureParameter(uint target, uint pname, int param)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.TextureParameter(uint target, uint pname, int param) => throw signal;
|
||||
|
||||
void IglFunc.UseProgram(uint program)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.UseProgram(uint program) => throw signal;
|
||||
|
||||
void IglFunc.Viewport(int x, int y, int width, int height)
|
||||
{
|
||||
throw signal;
|
||||
}
|
||||
void IglFunc.Viewport(int x, int y, uint width, uint height) => throw signal;
|
||||
|
||||
internal static GLonTimeout Set() => singleInstance;
|
||||
|
||||
void IglFunc.SetWindowShouldClose(Form form, bool mark) => throw signal;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,55 @@
|
||||
using StgSharp.Logic;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
internal partial class GLonUpdate : IglFunc
|
||||
{
|
||||
private FrameTimeoutException refreshSignal = new();
|
||||
internal readonly GLcontext api;
|
||||
using glMetaData = (
|
||||
int i0, int i1, int i2, int i3,
|
||||
double d0, double d1, double d2, double d3,
|
||||
IntPtr p0, IntPtr p1, IntPtr p2, IntPtr p3
|
||||
);
|
||||
|
||||
internal GLonUpdate(GLcontext context)
|
||||
internal unsafe partial class GLonUpdate : IglFunc
|
||||
{
|
||||
|
||||
internal GLcontext* api;
|
||||
private ConcurrentQueue<Action> glActionQueue;
|
||||
private FrameTimeoutException refreshSignal = new();
|
||||
private DynamicArrayList<glMetaData> threadBuffer = new DynamicArrayList<glMetaData>(16, default);
|
||||
|
||||
ConcurrentQueue<Action<int>> GLactionQueue
|
||||
{
|
||||
get
|
||||
{
|
||||
return glActionQueue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal GLonUpdate(GLcontext* context)
|
||||
{
|
||||
api = context;
|
||||
glActionQueue = new ConcurrentQueue<Action>();
|
||||
glActionQueue.Enqueue(() => { });
|
||||
}
|
||||
|
||||
void IglFunc.ActiveTexture(uint type)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
api->glActiveTexture(type);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,52 +69,125 @@ namespace StgSharp.Graphics
|
||||
throw refreshSignal;
|
||||
}
|
||||
|
||||
void IglFunc.AttachShader(uint program, uint shader)
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.AttachShader(uint program, uint shader)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() => api->glAttachShader(program, shader)
|
||||
);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.BindBuffer(BufferType bufferType, uint index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() => api->glBindBuffer((uint)bufferType, index)
|
||||
);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.BindTexture(uint type, uint texture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() => api->glBindTexture((uint)type, texture)
|
||||
);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.BindVertexArray(uint index)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() => api->glBindVertexArray((uint)index)
|
||||
);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.Clear(MaskBufferBit mask)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() => api->glClear((uint)mask)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void IglFunc.ClearColor(float R, float G, float B, float A)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() => api->glClearColor(R, G, B, A)
|
||||
);
|
||||
}
|
||||
|
||||
void IglFunc.ClearGraphicError()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
while (api->glGetError() != 0) { };
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
uint IglFunc.CompileShader(string shaderCode, ShaderType shaderType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
int id = -1;
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
uint shaderID;
|
||||
shaderCode += '\0';
|
||||
shaderID = InternalIO.InternalLoadShaderCode(shaderCode, (int)shaderType);
|
||||
if (shaderID == 0)
|
||||
{
|
||||
IntPtr logPtr = InternalIO.InternalReadLog();
|
||||
string log;
|
||||
try
|
||||
{
|
||||
byte[] logByte = new byte[512];
|
||||
Marshal.Copy(logPtr, logByte, 0, 512);
|
||||
log = Encoding.UTF8.GetString(logByte);
|
||||
log = log.Replace("\0", "");
|
||||
|
||||
bool isUseful = false;
|
||||
foreach (char item in log)
|
||||
{
|
||||
if (!char.IsControl(item))
|
||||
{
|
||||
isUseful = true; break;
|
||||
}
|
||||
}
|
||||
if (!isUseful)
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
log = "Failed to compile shader.\nFailed to get GLSL compiler log";
|
||||
}
|
||||
|
||||
InternalIO.InternalWriteLog(log, LogType.Error);
|
||||
}
|
||||
Interlocked.Add(ref id, (int)(shaderID + 1));
|
||||
}
|
||||
);
|
||||
while (id < 0) { }
|
||||
return (uint)id;
|
||||
}
|
||||
|
||||
|
||||
uint IglFunc.CreateProgram()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
int id = -1;
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
int ret = (int)api->glCreateProgram();
|
||||
Interlocked.Add(ref id, ret + 1);
|
||||
}
|
||||
);
|
||||
while (id < 0) { }
|
||||
return (uint)id;
|
||||
}
|
||||
|
||||
IntPtr IglFunc.CreateWindowHandle(int width, int height, string tittle, IntPtr monitor, Form share)
|
||||
@@ -118,44 +218,118 @@ namespace StgSharp.Graphics
|
||||
|
||||
uint IglFunc.CreatGraphicProgram()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
int id = 0;
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
Interlocked.Add(ref id, (int)(api->glCreateProgram() + 1));
|
||||
}
|
||||
);
|
||||
while (id < 0) { }
|
||||
return (uint)id;
|
||||
}
|
||||
|
||||
|
||||
unsafe void IglFunc.DeleteBuffers(int count, uint* ptr)
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.SetWindowShouldClose(Form form, bool mark)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
InternalIO.glfw.SetWindowShouldClose(form.windowID, mark ? 1 : 0);
|
||||
}
|
||||
|
||||
unsafe void IglFunc.DeleteVertexArrays(int count, uint* ptr)
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.DeleteBuffer(uint handle)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
uint target = handle;
|
||||
api->glDeleteBuffers(1, &target);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public void DrawElements(GepmetryType mode, int count, Type type, IntPtr ptr)
|
||||
unsafe void IglFunc.DeleteBuffers(uint count, uint[] handle)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
uint[] h = handle;
|
||||
fixed (uint* p = h)
|
||||
{
|
||||
api->glDeleteBuffers(count, p);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void IglFunc.DrawElements(GepmetryType mode, int count, Type type, IntPtr ptr)
|
||||
unsafe void IglFunc.DeleteVertexArrays(uint count, uint[] arrays)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
uint[] target = arrays;
|
||||
fixed (uint* ptr = target)
|
||||
{
|
||||
api->glDeleteVertexArrays(count, ptr);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
unsafe void IglFunc.GenBuffers(int count, uint* ptr)
|
||||
void IglFunc.DrawElements(GepmetryType mode, uint count, Type type, IntPtr ptr)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
uint a;
|
||||
switch (Type.GetTypeCode(type))
|
||||
{
|
||||
case TypeCode.UInt32:
|
||||
a = GLconst.UNSIGNED_INT;
|
||||
break;
|
||||
case TypeCode.UInt16:
|
||||
a = GLconst.UNSIGNED_SHORT;
|
||||
break;
|
||||
case TypeCode.Byte:
|
||||
a = GLconst.UNSIGNED_BYTE;
|
||||
break;
|
||||
default:
|
||||
InternalIO.InternalWriteLog(
|
||||
$"Parameter error in parameter {nameof(type)} method DrawElements. " +
|
||||
$"Only {typeof(uint).Name},{typeof(ushort).Name},{typeof(byte).Name} types are suporrted.",
|
||||
LogType.Error);
|
||||
return;
|
||||
}
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{ api->glDrawElements((uint)mode, count, a, (void*)ptr); }
|
||||
);
|
||||
}
|
||||
|
||||
unsafe void IglFunc.GenTextures(int count, uint* ptr)
|
||||
unsafe void IglFunc.GenBuffers(uint count, uint* ptr)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
api->glGenBuffers(count, ptr);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
unsafe void IglFunc.GenVertexArrays(int count, uint* ptr)
|
||||
unsafe void IglFunc.GenTextures(uint count, uint* ptr)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
api->glGenTextures(count, ptr);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
unsafe void IglFunc.GenVertexArrays(uint count, uint* ptr)
|
||||
{
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
api->glGenVertexArrays(count, ptr);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public void GetGraphicError()
|
||||
@@ -168,25 +342,26 @@ namespace StgSharp.Graphics
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public unsafe int GetUniformLocation(uint program, byte* ptr)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
unsafe int IglFunc.GetUniformLocation(uint program, byte* ptr)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
int ret = -1;
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
int location = api->glGetUniformLocation(program, ptr);
|
||||
Interlocked.Add(ref ret, location + 1);
|
||||
}
|
||||
);
|
||||
while (ret < 0) { }
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool GetWindowShouldClose(Form form)
|
||||
{
|
||||
return InternalIO.glfw.WindowShouldClose(form.windowID) == 0;
|
||||
}
|
||||
|
||||
bool IglFunc.GetWindowShouldClose(Form form)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
return InternalIO.glfw.WindowShouldClose(form.windowID) == 0;
|
||||
}
|
||||
|
||||
public void GLswapBuffers(Form form)
|
||||
@@ -198,7 +373,8 @@ namespace StgSharp.Graphics
|
||||
InternalIO.glfw.SwapBuffers(form.windowID);
|
||||
}
|
||||
|
||||
public void MakeContexCurrent(Form form)
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
void IglFunc.MakeContexCurrent(Form form)
|
||||
{
|
||||
if (form.windowID == IntPtr.Zero)
|
||||
{
|
||||
@@ -207,29 +383,40 @@ namespace StgSharp.Graphics
|
||||
InternalIO.glfw.MakeContextCurrent(form.windowID);
|
||||
}
|
||||
|
||||
void IglFunc.MakeContexCurrent(Form form)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void SetBufferData<T>(BufferType bufferType, T bufferData, BufferUsage usage) where T : IMat
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void SetBufferData<T>(BufferType bufferType, T[] bufferArray, BufferUsage usage) where T : struct, IConvertible
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
void IglFunc.SetBufferData<T>(BufferType bufferType, T bufferData, BufferUsage usage)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
T data = bufferData;
|
||||
int size = sizeof(T);
|
||||
api->glBufferData(
|
||||
(uint)bufferType,
|
||||
(UIntPtr)size,
|
||||
&data,
|
||||
(uint)usage);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void IglFunc.SetBufferData<T>(BufferType bufferType, T[] bufferArray, BufferUsage usage)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
int size = bufferArray.Length * Marshal.SizeOf(typeof(T));
|
||||
if (bufferArray == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
fixed (void* bufferPtr = bufferArray)
|
||||
api->glBufferData(
|
||||
(uint)bufferType,
|
||||
(UIntPtr)size,
|
||||
bufferPtr,
|
||||
(uint)usage);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -240,44 +427,70 @@ namespace StgSharp.Graphics
|
||||
}
|
||||
|
||||
|
||||
void IglFunc.SetVertexAttribute(uint index, int size, Type t, bool normalized, int stride, int pointer)
|
||||
void IglFunc.SetVertexAttribute(uint index, int size, Type t, bool normalized, uint stride, int pointer)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
uint type = InternalIO.GLtype[t];
|
||||
api->glVertexAttribPointer(index, size, type, normalized, stride, (void*)pointer);
|
||||
api->glEnableVertexAttribArray(index);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void IglFunc.SwapBuffers(Form form)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
if (form.windowID == IntPtr.Zero)
|
||||
{
|
||||
return;
|
||||
}
|
||||
InternalIO.glfw.SwapBuffers(form.windowID);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public unsafe void TextureImage2d(uint target, int level, uint internalformat, int width, int height, uint format, uint type, void* pixels)
|
||||
unsafe void IglFunc.TextureImage2d(uint target, int level, uint internalformat, uint width, uint height, uint format, uint type, void* pixels)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
unsafe void IglFunc.TextureImage2d(uint target, int level, uint internalformat, int width, int height, uint format, uint type, void* pixels)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void TextureParameter(uint target, uint pname, int param)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
api->glTexImage2D(target, level, internalformat, width, height, 0, format, type, pixels);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void IglFunc.TextureParameter(uint target, uint pname, int param)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
api->glTextureParameteri(target, pname, param);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void IglFunc.UseProgram(uint rogram)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
api->glUseProgram(rogram);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void IglFunc.Viewport(int x, int y, int width, int height)
|
||||
void IglFunc.Viewport(int x, int y, uint width, uint height)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
api->glViewport(x, y, width, height);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,102 +18,158 @@ namespace StgSharp.Graphics
|
||||
{
|
||||
return new Shader(GL);
|
||||
}
|
||||
}
|
||||
|
||||
public class Shader
|
||||
public class Shader
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see cref="uint"/> value represent this shader.
|
||||
/// </summary>
|
||||
public readonly uint programID;
|
||||
internal uint vertexShaderID;
|
||||
internal uint fragmentShaderID;
|
||||
private IglFunc GL;
|
||||
|
||||
/// <summary>
|
||||
/// Inti a shader with no program attached.
|
||||
/// </summary>
|
||||
internal unsafe Shader(IglFunc gl)
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see cref="uint"/> value represent this shader.
|
||||
/// </summary>
|
||||
public readonly uint programID;
|
||||
internal uint vertexShaderID;
|
||||
internal uint fragmentShaderID;
|
||||
private IglFunc GL;
|
||||
|
||||
/// <summary>
|
||||
/// Inti a shader with no program attached.
|
||||
/// </summary>
|
||||
internal unsafe Shader(IglFunc glFunc)
|
||||
{
|
||||
GL = glFunc;
|
||||
programID = GL.CreateProgram();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compile the vertex shader to be attached to this shader.
|
||||
/// </summary>
|
||||
/// <param name="shaderCode">GLSL code of vertex shader.</param>
|
||||
public unsafe void CompileVertexShader(string shaderCode)
|
||||
{
|
||||
vertexShaderID = GL.CompileShader(shaderCode, ShaderType.VERTEX);
|
||||
GL.AttachShader(programID, vertexShaderID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compile the fragment shader to be attached to this shader.
|
||||
/// </summary>
|
||||
/// <param name="shaderCode">GLSL code of fragment shader.</param>
|
||||
public unsafe void CompileFragmentShader(string shaderCode)
|
||||
{
|
||||
fragmentShaderID = GL.CompileShader(shaderCode, ShaderType.FRAGMENT);
|
||||
GL.AttachShader(programID, fragmentShaderID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Link the shader to current context.
|
||||
/// </summary>
|
||||
public void Link()
|
||||
{
|
||||
if (InternalIO.InternalLinkShaderProgram(programID) == 0)
|
||||
{
|
||||
IntPtr logPtr = InternalIO.InternalReadLog();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a uniform form current shader,
|
||||
/// the value type of the uniform should be provided.
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public unsafe Uniform<T> GetUniform<T>(string name) where T : struct
|
||||
{
|
||||
byte[] bytes = Encoding.ASCII.GetBytes(name);
|
||||
int uniform;
|
||||
fixed (byte* ptr = bytes)
|
||||
{
|
||||
uniform = GL.GetUniformLocation(programID, ptr);
|
||||
}
|
||||
if (uniform != -1)
|
||||
{
|
||||
return new Uniform<T>(uniform);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"Cannot find the uniform {name} in shader {programID}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Let the current context use this shader.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void Use()
|
||||
{
|
||||
GL.UseProgram(programID);
|
||||
}
|
||||
|
||||
GL = gl;
|
||||
programID = GL.CreateProgram();
|
||||
}
|
||||
|
||||
internal void ChangeEnvironment(IglFunc gl)
|
||||
{
|
||||
GL = gl;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compile the vertex shader to be attached to this shader.
|
||||
/// </summary>
|
||||
/// <param name="shaderCode">GLSL code of vertex shader.</param>
|
||||
public unsafe void CompileVertexShader(string shaderCode)
|
||||
{
|
||||
vertexShaderID = GL.CompileShader(shaderCode, ShaderType.VERTEX);
|
||||
GL.AttachShader(programID, vertexShaderID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compile the fragment shader to be attached to this shader.
|
||||
/// </summary>
|
||||
/// <param name="shaderCode">GLSL code of fragment shader.</param>
|
||||
public unsafe void CompileFragmentShader(string shaderCode)
|
||||
{
|
||||
fragmentShaderID = GL.CompileShader(shaderCode, ShaderType.FRAGMENT);
|
||||
GL.AttachShader(programID, fragmentShaderID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Link the shader to current context.
|
||||
/// </summary>
|
||||
public void Link()
|
||||
{
|
||||
if (InternalIO.InternalLinkShaderProgram(programID) == 0)
|
||||
{
|
||||
IntPtr logPtr = InternalIO.InternalReadLog();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a uniform form current shader,
|
||||
/// the value type of the uniform should be provided.
|
||||
/// </summary>
|
||||
/// <param name="name">Name of the Uniform in shader code</param>
|
||||
/// <returns></returns>
|
||||
public unsafe Uniform<T> GetUniform<T>(string name) where T : struct
|
||||
{
|
||||
byte[] bytes = Encoding.ASCII.GetBytes(name);
|
||||
int uniform;
|
||||
fixed (byte* ptr = bytes)
|
||||
{
|
||||
uniform = GL.GetUniformLocation(programID, ptr);
|
||||
}
|
||||
if (uniform != -1)
|
||||
{
|
||||
return new Uniform<T>(uniform);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"Cannot find the uniform {name} in shader {programID}");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Get a uniform form current shader,
|
||||
/// the value type of the uniform should be provided.
|
||||
/// </summary>
|
||||
/// <param name="name">Name of the Uniform in shader code</param>
|
||||
/// <returns></returns>
|
||||
public unsafe Uniform<T, U> GetUniform<T, U>(string name)
|
||||
where T : struct
|
||||
where U : struct
|
||||
{
|
||||
byte[] bytes = Encoding.ASCII.GetBytes(name);
|
||||
int uniform;
|
||||
fixed (byte* ptr = bytes)
|
||||
{
|
||||
uniform = GL.GetUniformLocation(programID, ptr);
|
||||
}
|
||||
if (uniform != -1)
|
||||
{
|
||||
return new Uniform<T, U>(uniform);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"Cannot find the uniform {name} in shader {programID}");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Get a uniform form current shader,
|
||||
/// the value type of the uniform should be provided.
|
||||
/// </summary>
|
||||
/// <param name="name">Name of the Uniform in shader code</param>
|
||||
/// <returns></returns>
|
||||
public unsafe Uniform<T, U, V> GetUniform<T, U, V>(string name)
|
||||
where T : struct
|
||||
where U : struct
|
||||
where V : struct
|
||||
{
|
||||
byte[] bytes = Encoding.ASCII.GetBytes(name);
|
||||
int uniform;
|
||||
fixed (byte* ptr = bytes)
|
||||
{
|
||||
uniform = GL.GetUniformLocation(programID, ptr);
|
||||
}
|
||||
if (uniform != -1)
|
||||
{
|
||||
return new Uniform<T, U, V>(uniform);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"Cannot find the uniform {name} in shader {programID}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Let the current context use this shader.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void Use()
|
||||
{
|
||||
GL.UseProgram(programID);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
@@ -14,13 +15,13 @@ namespace StgSharp.Graphics
|
||||
private IglFunc GL;
|
||||
|
||||
internal unsafe Uniform(
|
||||
Form.Shader program, string name, IglFunc gL)
|
||||
uint shaderID, string name, IglFunc gL)
|
||||
{
|
||||
byte[] namearray = Encoding.ASCII.GetBytes(name);
|
||||
GL = gL;
|
||||
fixed (byte* ptr = namearray)
|
||||
{
|
||||
id = GL.GetUniformLocation(program.programID, ptr);
|
||||
id = GL.GetUniformLocation(shaderID, ptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +41,7 @@ namespace StgSharp.Graphics
|
||||
private IglFunc GL;
|
||||
|
||||
internal unsafe Uniform(
|
||||
Form.Shader program, string name, IglFunc glFunc)
|
||||
Shader program, string name, IglFunc glFunc)
|
||||
{
|
||||
byte[] namearray = Encoding.ASCII.GetBytes(name);
|
||||
GL = glFunc;
|
||||
@@ -64,7 +65,7 @@ namespace StgSharp.Graphics
|
||||
internal int id;
|
||||
private IglFunc GL;
|
||||
|
||||
public unsafe Uniform(Form.Shader program, string name, IglFunc glFunc)
|
||||
public unsafe Uniform(Shader program, string name, IglFunc glFunc)
|
||||
{
|
||||
byte[] namearray = Encoding.ASCII.GetBytes(name);
|
||||
GL = glFunc;
|
||||
@@ -89,7 +90,7 @@ namespace StgSharp.Graphics
|
||||
internal int id;
|
||||
private IglFunc GL;
|
||||
|
||||
internal unsafe Uniform(Form.Shader program, string name, IglFunc glFunc)
|
||||
internal unsafe Uniform(Shader program, string name, IglFunc glFunc)
|
||||
{
|
||||
byte[] namearray = Encoding.ASCII.GetBytes(name);
|
||||
fixed (byte* ptr = namearray)
|
||||
@@ -108,125 +109,107 @@ namespace StgSharp.Graphics
|
||||
|
||||
internal partial class GLonRender : IglFunc
|
||||
{
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T}"/>,
|
||||
/// all types of parameters are float.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T}"/> target</param>
|
||||
/// <param name="v0">The value to be set</param>
|
||||
void IglFunc.SetValue(Uniform<float> uniform, float v0)
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.SetValue(Uniform<float> uniform, float v0)
|
||||
{
|
||||
api.Uniform1f(uniform.id, v0);
|
||||
api->glUniform1f(uniform.id, v0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a int <see cref="Uniform{T}"/>,
|
||||
/// all types of parameters are int.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T}"/> target</param>
|
||||
/// <param name="i0">The value to be set</param>
|
||||
void IglFunc.SetValue(Uniform<int> uniform, int i0)
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.SetValue(Uniform<int> uniform, int i0)
|
||||
{
|
||||
api.Uniform1i(uniform.id, i0);
|
||||
api->glUniform1i(uniform.id, i0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T,U}"/>,
|
||||
/// all types of parameters are float.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T,U}"/> target</param>
|
||||
/// <param name="v0">The first value to be set</param>
|
||||
/// <param name="v1">The second value to be set</param>
|
||||
void IglFunc.SetValue(Uniform<float, float> uniform, float v0, float v1)
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.SetValue(Uniform<float, float> uniform, float v0, float v1)
|
||||
{
|
||||
api.Uniform2f(uniform.id, v0, v1);
|
||||
api->glUniform2f(uniform.id, v0, v1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T,U,V}"/>,
|
||||
/// all types of parameters are float.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T,U,V}"/> target</param>
|
||||
/// <param name="v0">The first value to be set</param>
|
||||
/// <param name="v1">The second value to be set</param>
|
||||
/// <param name="v2">The third value to be set</param>
|
||||
void IglFunc.SetValue(Uniform<float, float, float> uniform, float v0, float v1, float v2)
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.SetValue(Uniform<float, float, float> uniform, float v0, float v1, float v2)
|
||||
{
|
||||
api.Uniform3f(uniform.id, v0, v1, v2);
|
||||
api->glUniform3f(uniform.id, v0, v1, v2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T,U,V,W}"/>,
|
||||
/// all types of parameters are float.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T,U,V,W}"/> target</param>
|
||||
/// <param name="v0">The first value to be set</param>
|
||||
/// <param name="v1">The second value to be set</param>
|
||||
/// <param name="v2">The third value to be set</param>
|
||||
/// <param name="v3">The forth value to be set</param>
|
||||
void IglFunc.SetValue(Uniform<float, float, float, float> uniform, float v0, float v1, float v2, float v3)
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
unsafe void IglFunc.SetValue(Uniform<float, float, float, float> uniform, float v0, float v1, float v2, float v3)
|
||||
{
|
||||
api.Uniform4f(uniform.id, v0, v1, v2, v3);
|
||||
api->glUniform4f(uniform.id, v0, v1, v2, v3);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T,U,V,W}"/>,
|
||||
/// all types of parameters are float.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T,U,V,W}"/> target</param>
|
||||
/// <param name="vec">A <see cref="Vec4d"/> packing four parameters of the uniform </param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void SetValue(Uniform<float, float, float, float> uniform, Vec4d vec)
|
||||
{
|
||||
api.Uniform1fv(uniform.id, 4, &vec.fvec);
|
||||
api->glUniform1fv(uniform.id, 4, &vec);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T}"/>,
|
||||
/// all types of parameters are <see cref="Vec4d"/>.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T}"/> target</param>
|
||||
/// <param name="vec">A <see cref="Vec4d"/> value of the uniform </param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public unsafe void SetValue(Uniform<Vec4d> uniform, Vec4d vec)
|
||||
{
|
||||
api.Uniform1fv(uniform.id, 4, &vec.fvec);
|
||||
api->glUniform1fv(uniform.id, 4, &vec);
|
||||
}
|
||||
}
|
||||
|
||||
internal partial class GLonUpdate
|
||||
{
|
||||
void IglFunc.SetValue(Uniform<float, float, float> uniform, float v0, float v1, float v2)
|
||||
unsafe void IglFunc.SetValue(Uniform<float, float, float> uniform, float v0, float v1, float v2)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() => { api->glUniform3f(uniform.id, v0, v1, v2); }
|
||||
);
|
||||
}
|
||||
|
||||
void IglFunc.SetValue(Uniform<float, float> uniform, float v0, float v1)
|
||||
unsafe void IglFunc.SetValue(Uniform<float, float> uniform, float v0, float v1)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() => { api->glUniform2f(uniform.id, v0, v1); }
|
||||
);
|
||||
}
|
||||
|
||||
void IglFunc.SetValue(Uniform<float, float, float, float> uniform, float v0, float v1, float v2, float v3)
|
||||
unsafe void IglFunc.SetValue(Uniform<float, float, float, float> uniform, float v0, float v1, float v2, float v3)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() => { api->glUniform4f(uniform.id, v0, v1, v2, v3); }
|
||||
);
|
||||
}
|
||||
|
||||
void IglFunc.SetValue(Uniform<float, float, float, float> uniform, Vec4d vec)
|
||||
unsafe void IglFunc.SetValue(Uniform<float, float, float, float> uniform, Vec4d vec)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
Vec4d cache = vec;
|
||||
api->glUniform1fv(uniform.id, 4, &cache);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void IglFunc.SetValue(Uniform<float> uniform, float v0)
|
||||
unsafe void IglFunc.SetValue(Uniform<float> uniform, float v0)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() => { api->glUniform1f(uniform.id, v0); }
|
||||
);
|
||||
}
|
||||
|
||||
void IglFunc.SetValue(Uniform<int> uniform, int i0)
|
||||
unsafe void IglFunc.SetValue(Uniform<int> uniform, int i0)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() => { api->glUniform1d(uniform.id, i0); }
|
||||
);
|
||||
}
|
||||
|
||||
void IglFunc.SetValue(Uniform<Vec4d> uniform, Vec4d vec)
|
||||
unsafe void IglFunc.SetValue(Uniform<Vec4d> uniform, Vec4d vec)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
glActionQueue.Enqueue(
|
||||
() =>
|
||||
{
|
||||
Vec4d cache = vec;
|
||||
api->glUniform1fv(uniform.id, 4, &cache);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,16 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Controlling
|
||||
{
|
||||
public static class Graphic
|
||||
{
|
||||
public static void Render()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,17 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
public interface IglFunc
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Align a sets of code to frame update of a <see cref="Form"/>.
|
||||
/// Usually, a call of <see cref="AfterAlign(Form,Action)"/> is required.
|
||||
/// This method is used as sigle thread method. If more than one
|
||||
/// alignment is requested, a <see cref="InvalidOperationException"/> will throw.
|
||||
/// Same function as OpenGL api glActiveTexture
|
||||
/// </summary>
|
||||
/// <param name="form">The form used as frame update benchmark.</param>
|
||||
/// <exception cref="InvalidOperationException">More than one alingment attached to one form timer</exception>
|
||||
void AlignFrame(Form form);
|
||||
/// <param name="type">type of texture to activate</param>
|
||||
void ActiveTexture(uint type);
|
||||
|
||||
/// <summary>
|
||||
/// Operation after alignment by calling <see cref="AlignFrame(Form)"/>.
|
||||
@@ -28,10 +26,14 @@ namespace StgSharp.Graphics
|
||||
void AfterAlign(Form form, Action action);
|
||||
|
||||
/// <summary>
|
||||
/// Same function as OpenGL api glActiveTexture
|
||||
/// Align a sets of code to frame update of a <see cref="Form"/>.
|
||||
/// Usually, a call of <see cref="AfterAlign(Form,Action)"/> is required.
|
||||
/// This method is used as sigle thread method. If more than one
|
||||
/// alignment is requested, a <see cref="InvalidOperationException"/> will throw.
|
||||
/// </summary>
|
||||
/// <param name="type">type of texture to activate</param>
|
||||
void ActiveTexture(uint type);
|
||||
/// <param name="form">The form used as frame update benchmark.</param>
|
||||
/// <exception cref="InvalidOperationException">More than one alingment attached to one form timer</exception>
|
||||
void AlignFrame(Form form);
|
||||
|
||||
/// <summary>
|
||||
/// Same fucntion as OpenGL api glAttachShader
|
||||
@@ -76,6 +78,7 @@ namespace StgSharp.Graphics
|
||||
/// <param name="B">Specify the red values used when the color buffers are cleared.</param>
|
||||
/// <param name="A">Specify the red values used when the color buffers are cleared.</param>
|
||||
void ClearColor(float R, float G, float B, float A);
|
||||
|
||||
void ClearGraphicError();
|
||||
|
||||
/// <summary>
|
||||
@@ -96,53 +99,59 @@ namespace StgSharp.Graphics
|
||||
/// <summary>
|
||||
/// Creates a form and its associated
|
||||
/// </summary>
|
||||
/// <param name="handle">The instance of created form</param>
|
||||
/// <param name="width">Required width</param>
|
||||
/// <param name="height">Required width</param>
|
||||
/// <param name="tittle">Tittle of the window </param>
|
||||
/// <param name="monitor"></param>
|
||||
/// <param name="share"></param>
|
||||
/// <returns>The instance of created form</returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
IntPtr CreateWindowHandle(int width, int height, string tittle, IntPtr monitor, Form share);
|
||||
|
||||
uint CreatGraphicProgram();
|
||||
|
||||
/// <summary>
|
||||
/// Same function as OpenGL api, glDeleteBuffer.
|
||||
/// Same function as OpenGL api, glDeleteBuffer. This method can delete one buffer in one call
|
||||
/// </summary>
|
||||
/// <param name="handle">a handle representing the buffer to be deleted</param>
|
||||
unsafe void DeleteBuffer(uint handle);
|
||||
|
||||
/// <summary>
|
||||
/// Same function as OpenGL api, glDeleteBuffer. This method can delete a sets of buffers in one call.
|
||||
/// </summary>
|
||||
/// <param name="count">Amount of bufferd to be deleted</param>
|
||||
/// <param name="ptr">Pointer of buffer to be deleted</param>
|
||||
unsafe void DeleteBuffers(int count, uint* ptr);
|
||||
/// <param name="handle">Array of buffers to be deleted</param>
|
||||
unsafe void DeleteBuffers(uint count, uint[] handle);
|
||||
|
||||
/// <summary>
|
||||
/// Same function as OpenGL api, glDeleteVertexArrays
|
||||
/// </summary>
|
||||
/// <param name="count">Amount of vao to be deleted</param>
|
||||
/// <param name="ptr">pointer of vao sign array</param>
|
||||
unsafe void DeleteVertexArrays(int count, uint* ptr);
|
||||
/// <param name="arrays">A array representing a colletion of vertex objects.</param>
|
||||
unsafe void DeleteVertexArrays(uint count, uint[] arrays);
|
||||
|
||||
void DrawElements(GepmetryType mode, int count, Type type, IntPtr ptr);
|
||||
void DrawElements(GepmetryType mode, uint count, Type type, IntPtr ptr);
|
||||
|
||||
/// <summary>
|
||||
/// Same fucntion as the OpenGL api glGenBuffers
|
||||
/// </summary>
|
||||
/// <param name="count"></param>
|
||||
/// <param name="ptr"></param>
|
||||
unsafe void GenBuffers(int count, uint* ptr);
|
||||
unsafe void GenBuffers(uint count, uint* ptr);
|
||||
|
||||
/// <summary>
|
||||
/// Same fucnction as OpenGL api glGenTextures.
|
||||
/// </summary>
|
||||
/// <param name="count">amount of textures to generate</param>
|
||||
/// <param name="ptr">pointer to texture signs' array</param>
|
||||
unsafe void GenTextures(int count, uint* ptr);
|
||||
unsafe void GenTextures(uint count, uint* ptr);
|
||||
|
||||
/// <summary>
|
||||
/// Same fucntion as OpenGL api, glGenVertexArray
|
||||
/// </summary>
|
||||
/// <param name="count">Amount of vao to be generated</param>
|
||||
/// <param name="ptr">Pointer of vao sign array</param>
|
||||
unsafe void GenVertexArrays(int count, uint* ptr);
|
||||
unsafe void GenVertexArrays(uint count, uint* ptr);
|
||||
|
||||
void GetGraphicError();
|
||||
|
||||
@@ -174,18 +183,66 @@ namespace StgSharp.Graphics
|
||||
/// <param name="handler">Method hadler </param>
|
||||
void SetFrameBufferSizeCallback(IntPtr id, FrameBufferSizeHandler handler);
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T,U,V,W}"/>,
|
||||
/// all types of parameters are float.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T,U,V,W}"/> target</param>
|
||||
/// <param name="v0">The first value to be set</param>
|
||||
/// <param name="v1">The second value to be set</param>
|
||||
/// <param name="v2">The third value to be set</param>
|
||||
/// <param name="v3">The forth value to be set</param>
|
||||
void SetValue(Uniform<float, float, float, float> uniform, float v0, float v1, float v2, float v3);
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T,U,V,W}"/>,
|
||||
/// all types of parameters are float.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T,U,V,W}"/> target</param>
|
||||
/// <param name="vec">A <see cref="Vec4d"/> packing four parameters of the uniform </param>
|
||||
void SetValue(Uniform<float, float, float, float> uniform, Vec4d vec);
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T,U,V}"/>,
|
||||
/// all types of parameters are float.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T,U,V}"/> target</param>
|
||||
/// <param name="v0">The first value to be set</param>
|
||||
/// <param name="v1">The second value to be set</param>
|
||||
/// <param name="v2">The third value to be set</param>
|
||||
void SetValue(Uniform<float, float, float> uniform, float v0, float v1, float v2);
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T,U}"/>,
|
||||
/// all types of parameters are float.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T,U}"/> target</param>
|
||||
/// <param name="v0">The first value to be set</param>
|
||||
/// <param name="v1">The second value to be set</param>
|
||||
void SetValue(Uniform<float, float> uniform, float v0, float v1);
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T}"/>,
|
||||
/// all types of parameters are float.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T}"/> target</param>
|
||||
/// <param name="v0">The value to be set</param>
|
||||
void SetValue(Uniform<float> uniform, float v0);
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a int <see cref="Uniform{T}"/>,
|
||||
/// all types of parameters are int.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T}"/> target</param>
|
||||
/// <param name="i0">The value to be set</param>
|
||||
void SetValue(Uniform<int> uniform, int i0);
|
||||
|
||||
/// <summary>
|
||||
/// Set data value to a float <see cref="Uniform{T}"/>,
|
||||
/// all types of parameters are <see cref="Vec4d"/>.
|
||||
/// </summary>
|
||||
/// <param name="uniform">The <see cref="Uniform{T}"/> target</param>
|
||||
/// <param name="vec">A <see cref="Vec4d"/> value of the uniform </param>
|
||||
void SetValue(Uniform<Vec4d> uniform, Vec4d vec);
|
||||
|
||||
/// <summary>
|
||||
@@ -197,7 +254,7 @@ namespace StgSharp.Graphics
|
||||
/// <param name="normalized"></param>
|
||||
/// <param name="stride">Pixels stride of each sets of data</param>
|
||||
/// <param name="pointer"></param>
|
||||
void SetVertexAttribute(uint index, int size, Type t, bool normalized, int stride, int pointer);
|
||||
void SetVertexAttribute(uint index, int size, Type t, bool normalized, uint stride, int pointer);
|
||||
|
||||
void SwapBuffers(Form form);
|
||||
|
||||
@@ -212,7 +269,7 @@ namespace StgSharp.Graphics
|
||||
/// <param name="format">color channels of this image</param>
|
||||
/// <param name="type">how this image express each pixel</param>
|
||||
/// <param name="pixels">pointer to data array of pixels</param>
|
||||
unsafe void TextureImage2d(uint target, int level, uint internalformat, int width, int height, uint format, uint type, void* pixels);
|
||||
unsafe void TextureImage2d(uint target, int level, uint internalformat, uint width, uint height, uint format, uint type, void* pixels);
|
||||
|
||||
/// <summary>
|
||||
/// Same fucntion as OpenGL api glTexParameteri
|
||||
@@ -227,6 +284,7 @@ namespace StgSharp.Graphics
|
||||
/// </summary>
|
||||
/// <param name="program">Sign of program to be used</param>
|
||||
void UseProgram(uint program);
|
||||
|
||||
/// <summary>
|
||||
/// Same function as the OpenGL api, glViewPort
|
||||
/// </summary>
|
||||
@@ -234,7 +292,9 @@ namespace StgSharp.Graphics
|
||||
/// <param name="y"></param>
|
||||
/// <param name="width"></param>
|
||||
/// <param name="height"></param>
|
||||
void Viewport(int x, int y, int width, int height);
|
||||
void Viewport(int x, int y, uint width, uint height);
|
||||
|
||||
void SetWindowShouldClose(Form form, bool mark);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using StgSharp.Graphics;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -9,6 +10,8 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Logic
|
||||
{
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
internal struct LogSeperator
|
||||
{
|
||||
@@ -28,6 +31,8 @@ namespace StgSharp.Logic
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A linear data structure with dynamic length.
|
||||
/// It contains a <see cref="List{T}"/> of <see cref="Array"/>,
|
||||
@@ -47,6 +52,7 @@ namespace StgSharp.Logic
|
||||
// sub index to the last used element
|
||||
private Queue<int> unusedMainIndex;
|
||||
private Queue<int> unusedSubIndex;
|
||||
|
||||
public DynamicArrayList()
|
||||
{
|
||||
arrayIndexList = [new T[1]];
|
||||
@@ -91,6 +97,43 @@ namespace StgSharp.Logic
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new instance of <see cref="DynamicArrayList{T}">,
|
||||
/// and fill the begining ones of elemtns as given instance.
|
||||
/// </summary>
|
||||
/// <param name="count">Amount of beginning elements to be filled</param>
|
||||
/// <param name="instace"></param>
|
||||
public DynamicArrayList(int count, T instace)
|
||||
{
|
||||
|
||||
arrayIndexList = new List<T[]>();
|
||||
length = count;
|
||||
unusedMainIndex = new();
|
||||
unusedSubIndex = new();
|
||||
|
||||
SeprateIndex(count);
|
||||
int subcount = 1;
|
||||
for (int i = 0; i < indexpair.high_s; i++)
|
||||
{
|
||||
arrayIndexList.Add(new T[count]);
|
||||
for (int j = 0; j < subcount; j++)
|
||||
{
|
||||
unusedMainIndex.Enqueue(i);
|
||||
unusedSubIndex.Enqueue(j);
|
||||
}
|
||||
count >>= 1;
|
||||
}
|
||||
if (indexpair.low_s != 0)
|
||||
{
|
||||
arrayIndexList.Add(new T[1 >> indexpair.high_s]);
|
||||
for (int j = 0; j < indexpair.high_s; j++)
|
||||
{
|
||||
unusedMainIndex.Enqueue(indexpair.high_s);
|
||||
unusedSubIndex.Enqueue(j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal T this[long index]
|
||||
{
|
||||
get
|
||||
@@ -122,6 +165,25 @@ namespace StgSharp.Logic
|
||||
|
||||
}
|
||||
|
||||
public void CopyTo(DynamicArrayList<T> 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<int>(unusedMainIndex.ToArray());
|
||||
target.unusedSubIndex = new Queue<int>(unusedSubIndex.ToArray());
|
||||
}
|
||||
|
||||
public T this[int index]
|
||||
{
|
||||
get
|
||||
@@ -192,6 +254,7 @@ namespace StgSharp.Logic
|
||||
arrayIndexList[lastMain][0] = item;
|
||||
|
||||
length++;
|
||||
subLength = 1;
|
||||
return length - 1;
|
||||
|
||||
}
|
||||
@@ -199,6 +262,7 @@ namespace StgSharp.Logic
|
||||
length++;
|
||||
lastSub++;
|
||||
arrayIndexList[lastMain][lastSub] = item;
|
||||
subLength = 1;
|
||||
return length - 1;
|
||||
}
|
||||
|
||||
@@ -207,15 +271,19 @@ namespace StgSharp.Logic
|
||||
int sub = unusedSubIndex.Dequeue();
|
||||
arrayIndexList[main][sub] = item;
|
||||
|
||||
subLength = 1;
|
||||
return sub + (1 << main);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
arrayIndexList.Clear();
|
||||
arrayIndexList.Add(new T[1]);
|
||||
unusedMainIndex.Clear();
|
||||
unusedSubIndex.Clear();
|
||||
length = 0;
|
||||
unusedMainIndex.Enqueue(0);
|
||||
unusedSubIndex.Enqueue(0);
|
||||
}
|
||||
|
||||
public bool Contains(T item)
|
||||
@@ -252,6 +320,7 @@ namespace StgSharp.Logic
|
||||
return -1;
|
||||
}
|
||||
|
||||
[Obsolete("This method is not same, you may read data form an empty index.", false)]
|
||||
public bool Remove(T item)
|
||||
{
|
||||
int index = 0;
|
||||
@@ -288,6 +357,9 @@ namespace StgSharp.Logic
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Obsolete("This method is not same, you may read data form an empty index.", false)]
|
||||
public void RemoveAt(int index)
|
||||
{
|
||||
if (index > length || index < 0)
|
||||
@@ -295,7 +367,6 @@ namespace StgSharp.Logic
|
||||
throw new ArgumentOutOfRangeException(nameof(index));
|
||||
}
|
||||
SeprateIndex(index);
|
||||
arrayIndexList[indexpair.high_s][indexpair.low] = default;
|
||||
|
||||
//the last element was removed.
|
||||
if (index + 1 == length)
|
||||
@@ -313,7 +384,6 @@ namespace StgSharp.Logic
|
||||
|
||||
unusedMainIndex.Enqueue(indexpair.high_s);
|
||||
unusedSubIndex.Enqueue(indexpair.low_s);
|
||||
|
||||
}
|
||||
|
||||
public void ShowStructure()
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 8)]
|
||||
public struct GLfixed
|
||||
{
|
||||
[FieldOffset(0)] public int All;
|
||||
[FieldOffset(0)] public short Decimals;
|
||||
[FieldOffset(4)] public short Inertger;
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
||||
|
||||
namespace StgSharp
|
||||
{
|
||||
internal static partial class InternalIO
|
||||
{
|
||||
[DllImport(InternalIO.SSC_libname, EntryPoint = "set_Vector4ptr_default",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern IntPtr set_Vector4ptr_default_internal();
|
||||
|
||||
|
||||
#region deinit Vector4
|
||||
|
||||
[DllImport(
|
||||
"msvcrt.dll",
|
||||
EntryPoint = "_aligned_free",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static extern unsafe void deinit_internal(Vector4* ptr);
|
||||
|
||||
[DllImport(
|
||||
"msvcrt.dll",
|
||||
EntryPoint = "_aligned_free",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static extern unsafe void deinit_internal(Mat2* ptr);
|
||||
|
||||
/*
|
||||
[DllImport(
|
||||
"msvcrt.dll",
|
||||
EntryPoint = "_aligned_free",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static extern unsafe void deinit_internal(Mat3* ptr);
|
||||
*/
|
||||
|
||||
[DllImport(
|
||||
"msvcrt.dll",
|
||||
EntryPoint = "_aligned_free",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static extern unsafe void deinit_internal(Mat4* ptr);
|
||||
|
||||
[DllImport(InternalIO.SSC_libname, EntryPoint = "deinitVector4",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern void deinitVector4_internal(ref Vector4 vec);
|
||||
|
||||
[DllImport(InternalIO.SSC_libname, EntryPoint = "deinitVector4",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern unsafe void deinitVector4_internal(Vector4* vec);
|
||||
|
||||
#endregion
|
||||
|
||||
[DllImport(InternalIO.SSC_libname, EntryPoint = "deinit_matmapPtr_sse",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern void deinitMatmapPtr_sse_internal(ref Vector4Map mapPtr);
|
||||
|
||||
[DllImport(InternalIO.SSC_libname, EntryPoint = "deinit_matmap_sse",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
internal static extern void deinitMatmap_sse_internal(ref Vector4Map mapPtr);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
using StgSharp;
|
||||
using StgSharp.Controlling;
|
||||
using StgSharp.Logic;
|
||||
using System.Numerics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
public unsafe class Vector4Map
|
||||
{
|
||||
public readonly long mapID;
|
||||
internal long mapPtr;
|
||||
internal readonly StgSharp.LinkedListNode<long> _unusedVector4Header;
|
||||
private const int mapSize = 30 * 30;
|
||||
|
||||
internal StgSharp.LinkedList<long> vector4Map =
|
||||
new StgSharp.LinkedList<long>();
|
||||
|
||||
public bool isFull
|
||||
{
|
||||
get
|
||||
{
|
||||
return _unusedVector4Header == vector4Map._hook;
|
||||
}
|
||||
}
|
||||
|
||||
public Vector4Map()
|
||||
{
|
||||
mapPtr = (long)(Marshal.AllocHGlobal(sizeof(Vector4)*mapSize)+15);
|
||||
|
||||
long firstVector4ptr = (mapPtr / 16 + 1) * 16;
|
||||
|
||||
vector4Map.Add(0);
|
||||
_unusedVector4Header = vector4Map._hook._next;
|
||||
|
||||
for (int i = 0; i < 4*30*30*4; i+=16)
|
||||
{
|
||||
vector4Map.Add(firstVector4ptr+i);
|
||||
}
|
||||
|
||||
mapID = Scaler.RandomSeed();
|
||||
}
|
||||
|
||||
internal long RegistManagedVector4Ptr()
|
||||
{
|
||||
LinkedListNode<long> Vector4 = _unusedVector4Header._next;
|
||||
LinkedListNode<long> Vector4Previous = _unusedVector4Header._previous;
|
||||
|
||||
Vector4._next._previous = _unusedVector4Header.Next;
|
||||
Vector4Previous._next = Vector4;
|
||||
Vector4._previous = Vector4Previous;
|
||||
_unusedVector4Header._next = Vector4._next;
|
||||
Vector4._next = _unusedVector4Header;
|
||||
_unusedVector4Header._previous = Vector4;
|
||||
|
||||
return Vector4._value;
|
||||
|
||||
}
|
||||
|
||||
internal void RecycleManagedVector4Ptr()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
|
||||
public static unsafe partial class SSE
|
||||
{
|
||||
public static int Vector4Size = 16;
|
||||
|
||||
internal static IntPtr defaultVector4Ptr =
|
||||
InternalIO.set_Vector4ptr_default_internal();
|
||||
|
||||
|
||||
internal static IntPtr defaultM256Ptr;
|
||||
|
||||
|
||||
public enum Registor : byte
|
||||
{
|
||||
XMM0 = 0,
|
||||
XMM1 = 1,
|
||||
XMM2 = 2,
|
||||
XMM3 = 3,
|
||||
XMM4 = 4,
|
||||
XMM5 = 5,
|
||||
XMM6 = 6,
|
||||
XMM7 = 7
|
||||
}
|
||||
|
||||
static SSE()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 32, Pack = 32)]
|
||||
internal struct M256
|
||||
{
|
||||
[FieldOffset(0)] public float single_0;
|
||||
[FieldOffset(4)] public float single_1;
|
||||
[FieldOffset(8)] public float single_2;
|
||||
[FieldOffset(12)] public float single_3;
|
||||
[FieldOffset(16)] public float single_4;
|
||||
[FieldOffset(20)] public float single_5;
|
||||
[FieldOffset(24)] public float single_6;
|
||||
[FieldOffset(28)] public float single_7;
|
||||
|
||||
[FieldOffset(0)] public long uint64_0;
|
||||
[FieldOffset(8)] public long uint64_1;
|
||||
[FieldOffset(16)] public long uint64_2;
|
||||
[FieldOffset(24)] public long uint64_3;
|
||||
|
||||
[FieldOffset(0)] public double double_0;
|
||||
[FieldOffset(8)] public double double_1;
|
||||
[FieldOffset(16)] public double double_2;
|
||||
[FieldOffset(24)] public double double_3;
|
||||
|
||||
[FieldOffset(0)] public IntPtr ptr_0;
|
||||
[FieldOffset(8)] public IntPtr ptr_1;
|
||||
[FieldOffset(16)] public IntPtr ptr_2;
|
||||
[FieldOffset(24)] public IntPtr ptr_3;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Controlling
|
||||
{
|
||||
internal static unsafe partial class TimeLine
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
/// <summary>
|
||||
/// OpenGL numeric type.
|
||||
/// An IEEE-754 floating-point value, clamped to the range [0,1].
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct GLclampf
|
||||
{
|
||||
public float value;
|
||||
|
||||
public GLclampf(float a)
|
||||
{
|
||||
value = a;
|
||||
}
|
||||
|
||||
public static explicit operator GLclampf(float v)
|
||||
{
|
||||
return new GLclampf(v);
|
||||
}
|
||||
|
||||
public static explicit operator float(GLclampf v)
|
||||
{
|
||||
return v.value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// OpenGL numeric type.
|
||||
/// An IEEE-754 double precision floating-point value, clamped to the range [0,1].
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct GLclampd
|
||||
{
|
||||
public double value;
|
||||
|
||||
public GLclampd(double a)
|
||||
{
|
||||
value = a;
|
||||
}
|
||||
|
||||
public static explicit operator GLclampd(double v)
|
||||
{
|
||||
return new GLclampd(v);
|
||||
}
|
||||
|
||||
public static explicit operator double(GLclampd v)
|
||||
{
|
||||
return v.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Explicit, Size = 16)]
|
||||
public struct GLhalfNV
|
||||
{
|
||||
[FieldOffset(0)] public short binary;
|
||||
|
||||
public GLhalfNV(short bin)
|
||||
{
|
||||
binary = bin;
|
||||
}
|
||||
|
||||
public static explicit operator short(GLhalfNV x)
|
||||
{
|
||||
return x.binary;
|
||||
}
|
||||
|
||||
public static explicit operator GLhalfNV(short x)
|
||||
{
|
||||
return new GLhalfNV(x);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -16,7 +16,7 @@
|
||||
<summary>
|
||||
Function handler to load an opengl function by serching its name.
|
||||
</summary>
|
||||
<param name="funcname">the name of the Opengl function</param>
|
||||
<param name="name">the name of the Opengl function</param>
|
||||
<returns>An intptr value representing the pointer to the function</returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.Form">
|
||||
@@ -29,6 +29,11 @@
|
||||
Height of this form, represent in <see cref="T:System.Int32"/>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.Graphics.Form.GL">
|
||||
<summary>
|
||||
OpenGL package used by current form context.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.Graphics.Form.IsDoubleRendering">
|
||||
<summary>
|
||||
Representing
|
||||
@@ -39,6 +44,11 @@
|
||||
Width of this form, represent in <see cref="T:System.Int32"/>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.Graphics.Form.Width">
|
||||
<summary>
|
||||
Width of this form, represent in <see cref="T:System.Int32"/>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Init(System.Object[])">
|
||||
<summary>
|
||||
Necessary operation to init this form.
|
||||
@@ -57,19 +67,17 @@
|
||||
Init this form and render it on screen, and respond with operation
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.SetRenderThreads(System.Boolean)">
|
||||
<member name="M:StgSharp.Graphics.Form.SetRenderThreads(System.Int32)">
|
||||
<summary>
|
||||
Define how current form render in one frame.
|
||||
</summary>
|
||||
<param name="totalThread">
|
||||
|
||||
Please define
|
||||
<param name="requireDoubleRendering">
|
||||
Please define this befor calling any OpenGL api and other graphic methods.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.InitForm(System.Int32,System.Int32,System.String,System.IntPtr,StgSharp.Graphics.Form)">
|
||||
<member name="M:StgSharp.Graphics.Form.SetMetadata(System.Int32,System.Int32,System.String,System.IntPtr,StgSharp.Graphics.Form)">
|
||||
<summary>
|
||||
Constructor of a Form, creats an instance of a form and
|
||||
initilize all the customizing operations.
|
||||
Set all necessary metadata to current form instance
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.MakeAsCurrentContext">
|
||||
@@ -115,59 +123,32 @@
|
||||
Maximum size of current form. In form of a <see cref="T:StgSharp.Math.Vec2d"/> of (width,height)
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Texture.LoadTexture(System.Int32,System.String,StgSharp.Graphics.ImageLoader)">
|
||||
<member name="M:StgSharp.Graphics.Form.CreateElementBuffer(System.UInt32)">
|
||||
<summary>
|
||||
|
||||
Create a set of <see cref="T:StgSharp.Graphics.ElementBuffer"/>.
|
||||
</summary>
|
||||
<param name="name"></param>
|
||||
<param name="index"></param>
|
||||
<param name="loader"></param>
|
||||
<param name="count">Amount of EBO to be created.</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.CreateVertexArray(System.UInt32)">
|
||||
<summary>
|
||||
Create a set of <see cref="T:StgSharp.Graphics.VertexArray"/>.
|
||||
</summary>
|
||||
<param name="count">Amount of VAO to be crated.</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.CreateVertexBuffer(System.UInt32)">
|
||||
<summary>
|
||||
Create aset of <see cref="T:StgSharp.Graphics.VertexBuffer"/>.
|
||||
</summary>
|
||||
<param name="count">Amount of Object to be created.</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.CreateShader">
|
||||
<summary>
|
||||
Create an instance of <see cref="T:StgSharp.Graphics.Form.Shader"/> program
|
||||
</summary>
|
||||
<returns>New instance of <see cref="T:StgSharp.Graphics.Form.Shader"/> instance. </returns>
|
||||
</member>
|
||||
<member name="F:StgSharp.Graphics.Form.Shader.programID">
|
||||
<summary>
|
||||
A <see cref="T:System.UInt32"/> value represent this shader.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.#ctor(StgSharp.Graphics.IglFunc)">
|
||||
<summary>
|
||||
Inti a shader with no program attached.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.CompileVertexShader(System.String)">
|
||||
<summary>
|
||||
Compile the vertex shader to be attached to this shader.
|
||||
</summary>
|
||||
<param name="shaderCode">GLSL code of vertex shader.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.CompileFragmentShader(System.String)">
|
||||
<summary>
|
||||
Compile the fragment shader to be attached to this shader.
|
||||
</summary>
|
||||
<param name="shaderCode">GLSL code of fragment shader.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.Link">
|
||||
<summary>
|
||||
Link the shader to current context.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.GetUniform``1(System.String)">
|
||||
<summary>
|
||||
Get a uniform form current shader,
|
||||
the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param name="name"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.Use">
|
||||
<summary>
|
||||
Let the current context use this shader.
|
||||
Create an instance of <see cref="T:StgSharp.Graphics.Shader"/> program
|
||||
</summary>
|
||||
<returns>New instance of <see cref="T:StgSharp.Graphics.Shader"/> instance. </returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.FrameTimer">
|
||||
<summary>
|
||||
@@ -186,11 +167,39 @@
|
||||
</summary>
|
||||
<param name="timer"><see cref="T:StgSharp.Graphics.FrameTimer"/> to be converted</param>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.ElementBuffer">
|
||||
<summary>
|
||||
A collecion of handle to Element Buffer Object in OpenGL.
|
||||
Each <see cref="T:System.UInt32"/> value indexed from instance of this class this
|
||||
is the only handle to one Element Buffer Object.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.IBufferObject">
|
||||
<summary>
|
||||
Interface of all kinds OpenGL buffer onjects
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.Graphics.IBufferObject.Item(System.Int32)">
|
||||
<summary>
|
||||
Get the only handle to one of the Object instance
|
||||
</summary>
|
||||
<param name="index"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IBufferObject.Bind(System.Int32)">
|
||||
<summary>
|
||||
Bind a buffer instance to OpenGL
|
||||
</summary>
|
||||
<param name="index">Index of handle of the object in this instance to be bind</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Texture.LoadTexture(System.Int32,System.String,StgSharp.Graphics.ImageLoader)">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<param name="name"></param>
|
||||
<param name="index"></param>
|
||||
<param name="loader"></param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.VertexBuffer.Unbind">
|
||||
<summary>
|
||||
|
||||
@@ -228,77 +237,67 @@
|
||||
<param name="name">Name of the OpenGL api</param>
|
||||
<returns>The funtion pointer of the api in form of <see cref="T:System.IntPtr"/></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.StgSharp#Graphics#IglFunc#SetValue(StgSharp.Graphics.Uniform{System.Single},System.Single)">
|
||||
<member name="F:StgSharp.Graphics.Shader.programID">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are float.
|
||||
A <see cref="T:System.UInt32"/> value represent this shader.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="v0">The value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.StgSharp#Graphics#IglFunc#SetValue(StgSharp.Graphics.Uniform{System.Int32},System.Int32)">
|
||||
<member name="M:StgSharp.Graphics.Shader.#ctor(StgSharp.Graphics.IglFunc)">
|
||||
<summary>
|
||||
Set data value to a int <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are int.
|
||||
Inti a shader with no program attached.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="i0">The value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.StgSharp#Graphics#IglFunc#SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single},System.Single,System.Single)">
|
||||
<member name="M:StgSharp.Graphics.Shader.CompileVertexShader(System.String)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`2"/>,
|
||||
all types of parameters are float.
|
||||
Compile the vertex shader to be attached to this shader.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`2"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
<param name="shaderCode">GLSL code of vertex shader.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.StgSharp#Graphics#IglFunc#SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single},System.Single,System.Single,System.Single)">
|
||||
<member name="M:StgSharp.Graphics.Shader.CompileFragmentShader(System.String)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`3"/>,
|
||||
all types of parameters are float.
|
||||
Compile the fragment shader to be attached to this shader.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`3"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
<param name="v2">The third value to be set</param>
|
||||
<param name="shaderCode">GLSL code of fragment shader.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.StgSharp#Graphics#IglFunc#SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},System.Single,System.Single,System.Single,System.Single)">
|
||||
<member name="M:StgSharp.Graphics.Shader.Link">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
|
||||
all types of parameters are float.
|
||||
Link the shader to current context.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
<param name="v2">The third value to be set</param>
|
||||
<param name="v3">The forth value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},StgSharp.Math.Vec4d)">
|
||||
<member name="M:StgSharp.Graphics.Shader.GetUniform``1(System.String)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
|
||||
all types of parameters are float.
|
||||
Get a uniform form current shader,
|
||||
the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
|
||||
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> packing four parameters of the uniform </param>
|
||||
<param name="name">Name of the Uniform in shader code</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.SetValue(StgSharp.Graphics.Uniform{StgSharp.Math.Vec4d},StgSharp.Math.Vec4d)">
|
||||
<member name="M:StgSharp.Graphics.Shader.GetUniform``2(System.String)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are <see cref="T:StgSharp.Math.Vec4d"/>.
|
||||
Get a uniform form current shader,
|
||||
the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> value of the uniform </param>
|
||||
<param name="name">Name of the Uniform in shader code</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.AlignFrame(StgSharp.Graphics.Form)">
|
||||
<member name="M:StgSharp.Graphics.Shader.GetUniform``3(System.String)">
|
||||
<summary>
|
||||
Align a sets of code to frame update of a <see cref="T:StgSharp.Graphics.Form"/>.
|
||||
Usually, a call of <see cref="M:StgSharp.Graphics.IglFunc.AfterAlign(StgSharp.Graphics.Form,System.Action)"/> is required.
|
||||
This method is used as sigle thread method. If more than one
|
||||
alignment is requested, a <see cref="T:System.InvalidOperationException"/> will throw.
|
||||
Get a uniform form current shader,
|
||||
the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param name="form">The form used as frame update benchmark.</param>
|
||||
<exception cref="T:System.InvalidOperationException">More than one alingment attached to one form timer</exception>
|
||||
<param name="name">Name of the Uniform in shader code</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Shader.Use">
|
||||
<summary>
|
||||
Let the current context use this shader.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.ActiveTexture(System.UInt32)">
|
||||
<summary>
|
||||
Same function as OpenGL api glActiveTexture
|
||||
</summary>
|
||||
<param name="type">type of texture to activate</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.AfterAlign(StgSharp.Graphics.Form,System.Action)">
|
||||
<summary>
|
||||
@@ -312,11 +311,15 @@
|
||||
<param name="action">Operation after frame update alignment.</param>
|
||||
<exception cref="T:System.InvalidOperationException">The action binded to a wrong alignment.</exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.ActiveTexture(System.UInt32)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.AlignFrame(StgSharp.Graphics.Form)">
|
||||
<summary>
|
||||
Same function as OpenGL api glActiveTexture
|
||||
Align a sets of code to frame update of a <see cref="T:StgSharp.Graphics.Form"/>.
|
||||
Usually, a call of <see cref="M:StgSharp.Graphics.IglFunc.AfterAlign(StgSharp.Graphics.Form,System.Action)"/> is required.
|
||||
This method is used as sigle thread method. If more than one
|
||||
alignment is requested, a <see cref="T:System.InvalidOperationException"/> will throw.
|
||||
</summary>
|
||||
<param name="type">type of texture to activate</param>
|
||||
<param name="form">The form used as frame update benchmark.</param>
|
||||
<exception cref="T:System.InvalidOperationException">More than one alingment attached to one form timer</exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.AttachShader(System.UInt32,System.UInt32)">
|
||||
<summary>
|
||||
@@ -381,43 +384,49 @@
|
||||
<summary>
|
||||
Creates a form and its associated
|
||||
</summary>
|
||||
<param name="handle">The instance of created form</param>
|
||||
<param name="width">Required width</param>
|
||||
<param name="height">Required width</param>
|
||||
<param name="tittle">Tittle of the window </param>
|
||||
<param name="monitor"></param>
|
||||
<param name="share"></param>
|
||||
<returns>The instance of created form</returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.DeleteBuffers(System.Int32,System.UInt32*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.DeleteBuffer(System.UInt32)">
|
||||
<summary>
|
||||
Same function as OpenGL api, glDeleteBuffer.
|
||||
Same function as OpenGL api, glDeleteBuffer. This method can delete one buffer in one call
|
||||
</summary>
|
||||
<param name="handle">a handle representing the buffer to be deleted</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.DeleteBuffers(System.UInt32,System.UInt32[])">
|
||||
<summary>
|
||||
Same function as OpenGL api, glDeleteBuffer. This method can delete a sets of buffers in one call.
|
||||
</summary>
|
||||
<param name="count">Amount of bufferd to be deleted</param>
|
||||
<param name="ptr">Pointer of buffer to be deleted</param>
|
||||
<param name="handle">Array of buffers to be deleted</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.DeleteVertexArrays(System.Int32,System.UInt32*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.DeleteVertexArrays(System.UInt32,System.UInt32[])">
|
||||
<summary>
|
||||
Same function as OpenGL api, glDeleteVertexArrays
|
||||
</summary>
|
||||
<param name="count">Amount of vao to be deleted</param>
|
||||
<param name="ptr">pointer of vao sign array</param>
|
||||
<param name="arrays">A array representing a colletion of vertex objects.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenBuffers(System.Int32,System.UInt32*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenBuffers(System.UInt32,System.UInt32*)">
|
||||
<summary>
|
||||
Same fucntion as the OpenGL api glGenBuffers
|
||||
</summary>
|
||||
<param name="count"></param>
|
||||
<param name="ptr"></param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenTextures(System.Int32,System.UInt32*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenTextures(System.UInt32,System.UInt32*)">
|
||||
<summary>
|
||||
Same fucnction as OpenGL api glGenTextures.
|
||||
</summary>
|
||||
<param name="count">amount of textures to generate</param>
|
||||
<param name="ptr">pointer to texture signs' array</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenVertexArrays(System.Int32,System.UInt32*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenVertexArrays(System.UInt32,System.UInt32*)">
|
||||
<summary>
|
||||
Same fucntion as OpenGL api, glGenVertexArray
|
||||
</summary>
|
||||
@@ -446,7 +455,69 @@
|
||||
<param name="id">The only signiture stands for the <see cref="T:StgSharp.Graphics.Form"/> to be controlled</param>
|
||||
<param name="handler">Method hadler </param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetVertexAttribute(System.UInt32,System.Int32,System.Type,System.Boolean,System.Int32,System.Int32)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},System.Single,System.Single,System.Single,System.Single)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
|
||||
all types of parameters are float.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
<param name="v2">The third value to be set</param>
|
||||
<param name="v3">The forth value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},StgSharp.Math.Vec4d)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
|
||||
all types of parameters are float.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
|
||||
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> packing four parameters of the uniform </param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single},System.Single,System.Single,System.Single)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`3"/>,
|
||||
all types of parameters are float.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`3"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
<param name="v2">The third value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single},System.Single,System.Single)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`2"/>,
|
||||
all types of parameters are float.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`2"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single},System.Single)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are float.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="v0">The value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Int32},System.Int32)">
|
||||
<summary>
|
||||
Set data value to a int <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are int.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="i0">The value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{StgSharp.Math.Vec4d},StgSharp.Math.Vec4d)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are <see cref="T:StgSharp.Math.Vec4d"/>.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> value of the uniform </param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetVertexAttribute(System.UInt32,System.Int32,System.Type,System.Boolean,System.UInt32,System.Int32)">
|
||||
<summary>
|
||||
Set how a shader parameter read data from a VBO.
|
||||
</summary>
|
||||
@@ -457,7 +528,7 @@
|
||||
<param name="stride">Pixels stride of each sets of data</param>
|
||||
<param name="pointer"></param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.TextureImage2d(System.UInt32,System.Int32,System.UInt32,System.Int32,System.Int32,System.UInt32,System.UInt32,System.Void*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.TextureImage2d(System.UInt32,System.Int32,System.UInt32,System.UInt32,System.UInt32,System.UInt32,System.UInt32,System.Void*)">
|
||||
<summary>
|
||||
Same function as OpenGL api glTexImage2d
|
||||
</summary>
|
||||
@@ -484,7 +555,7 @@
|
||||
</summary>
|
||||
<param name="program">Sign of program to be used</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.Viewport(System.Int32,System.Int32,System.Int32,System.Int32)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.Viewport(System.Int32,System.Int32,System.UInt32,System.UInt32)">
|
||||
<summary>
|
||||
Same function as the OpenGL api, glViewPort
|
||||
</summary>
|
||||
@@ -641,6 +712,7 @@
|
||||
</summary>
|
||||
<param name="count">Amount of elements to be prepared.</param>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "M:StgSharp.Logic.DynamicArrayList`1.#ctor(System.Int32,`0)" -->
|
||||
<member name="P:StgSharp.Logic.DynamicArrayList`1.Length">
|
||||
<summary>
|
||||
Length of this <see cref="T:StgSharp.Logic.DynamicArrayList`1"/>
|
||||
@@ -720,6 +792,18 @@
|
||||
remove the last member of the list
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Math.GLclampf">
|
||||
<summary>
|
||||
OpenGL numeric type.
|
||||
An IEEE-754 floating-point value, clamped to the range [0,1].
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Math.GLclampd">
|
||||
<summary>
|
||||
OpenGL numeric type.
|
||||
An IEEE-754 double precision floating-point value, clamped to the range [0,1].
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Math.Vec2d">
|
||||
<summary>
|
||||
A two dimension vector defined by two elements.
|
||||
|
||||
@@ -14,7 +14,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+659420aa6c98d2cef990b65d1c5999c6968f3699")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+14eaab455f9eeb6990fa39994b2d2c8b1da39b36")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("StgSharp")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("StgSharp")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
bcf13fcec07855c69d564591ac032f02d17b49be8f336cc2ec1ec87e480fffe2
|
||||
d01b7128f8b90c0985a1b2414c95a2b534c62fef76269eba921dd927e261ca00
|
||||
|
||||
@@ -1 +1 @@
|
||||
702ac4d4fbaabeae74bc8b3fa2292445ac720207ccc73052ea62c69d2a449e40
|
||||
05a8eb7cc7d6041a0f10d116d51691faa52f37272145e9d9297793a6ae11ad26
|
||||
|
||||
@@ -6,8 +6,8 @@ D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp\obj\x64\Debug\netstandard2.1\StgSharp.AssemblyInfoInputs.cache
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp\obj\x64\Debug\netstandard2.1\StgSharp.AssemblyInfo.cs
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp\obj\x64\Debug\netstandard2.1\StgSharp.csproj.CoreCompileInputs.cache
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp\obj\x64\Debug\netstandard2.1\StgSharp.sourcelink.json
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp\obj\x64\Debug\netstandard2.1\StgSharp.dll
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp\obj\x64\Debug\netstandard2.1\refint\StgSharp.dll
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp\obj\x64\Debug\netstandard2.1\StgSharp.xml
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp\obj\x64\Debug\netstandard2.1\ref\StgSharp.dll
|
||||
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharp\obj\x64\Debug\netstandard2.1\StgSharp.sourcelink.json
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/659420aa6c98d2cef990b65d1c5999c6968f3699/*"}}
|
||||
{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/14eaab455f9eeb6990fa39994b2d2c8b1da39b36/*"}}
|
||||
@@ -16,7 +16,7 @@
|
||||
<summary>
|
||||
Function handler to load an opengl function by serching its name.
|
||||
</summary>
|
||||
<param name="funcname">the name of the Opengl function</param>
|
||||
<param name="name">the name of the Opengl function</param>
|
||||
<returns>An intptr value representing the pointer to the function</returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.Form">
|
||||
@@ -29,6 +29,11 @@
|
||||
Height of this form, represent in <see cref="T:System.Int32"/>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.Graphics.Form.GL">
|
||||
<summary>
|
||||
OpenGL package used by current form context.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.Graphics.Form.IsDoubleRendering">
|
||||
<summary>
|
||||
Representing
|
||||
@@ -39,6 +44,11 @@
|
||||
Width of this form, represent in <see cref="T:System.Int32"/>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.Graphics.Form.Width">
|
||||
<summary>
|
||||
Width of this form, represent in <see cref="T:System.Int32"/>
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Init(System.Object[])">
|
||||
<summary>
|
||||
Necessary operation to init this form.
|
||||
@@ -57,19 +67,17 @@
|
||||
Init this form and render it on screen, and respond with operation
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.SetRenderThreads(System.Boolean)">
|
||||
<member name="M:StgSharp.Graphics.Form.SetRenderThreads(System.Int32)">
|
||||
<summary>
|
||||
Define how current form render in one frame.
|
||||
</summary>
|
||||
<param name="totalThread">
|
||||
|
||||
Please define
|
||||
<param name="requireDoubleRendering">
|
||||
Please define this befor calling any OpenGL api and other graphic methods.
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.InitForm(System.Int32,System.Int32,System.String,System.IntPtr,StgSharp.Graphics.Form)">
|
||||
<member name="M:StgSharp.Graphics.Form.SetMetadata(System.Int32,System.Int32,System.String,System.IntPtr,StgSharp.Graphics.Form)">
|
||||
<summary>
|
||||
Constructor of a Form, creats an instance of a form and
|
||||
initilize all the customizing operations.
|
||||
Set all necessary metadata to current form instance
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.MakeAsCurrentContext">
|
||||
@@ -115,59 +123,32 @@
|
||||
Maximum size of current form. In form of a <see cref="T:StgSharp.Math.Vec2d"/> of (width,height)
|
||||
</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Texture.LoadTexture(System.Int32,System.String,StgSharp.Graphics.ImageLoader)">
|
||||
<member name="M:StgSharp.Graphics.Form.CreateElementBuffer(System.UInt32)">
|
||||
<summary>
|
||||
|
||||
Create a set of <see cref="T:StgSharp.Graphics.ElementBuffer"/>.
|
||||
</summary>
|
||||
<param name="name"></param>
|
||||
<param name="index"></param>
|
||||
<param name="loader"></param>
|
||||
<param name="count">Amount of EBO to be created.</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.CreateVertexArray(System.UInt32)">
|
||||
<summary>
|
||||
Create a set of <see cref="T:StgSharp.Graphics.VertexArray"/>.
|
||||
</summary>
|
||||
<param name="count">Amount of VAO to be crated.</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.CreateVertexBuffer(System.UInt32)">
|
||||
<summary>
|
||||
Create aset of <see cref="T:StgSharp.Graphics.VertexBuffer"/>.
|
||||
</summary>
|
||||
<param name="count">Amount of Object to be created.</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.CreateShader">
|
||||
<summary>
|
||||
Create an instance of <see cref="T:StgSharp.Graphics.Form.Shader"/> program
|
||||
</summary>
|
||||
<returns>New instance of <see cref="T:StgSharp.Graphics.Form.Shader"/> instance. </returns>
|
||||
</member>
|
||||
<member name="F:StgSharp.Graphics.Form.Shader.programID">
|
||||
<summary>
|
||||
A <see cref="T:System.UInt32"/> value represent this shader.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.#ctor(StgSharp.Graphics.IglFunc)">
|
||||
<summary>
|
||||
Inti a shader with no program attached.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.CompileVertexShader(System.String)">
|
||||
<summary>
|
||||
Compile the vertex shader to be attached to this shader.
|
||||
</summary>
|
||||
<param name="shaderCode">GLSL code of vertex shader.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.CompileFragmentShader(System.String)">
|
||||
<summary>
|
||||
Compile the fragment shader to be attached to this shader.
|
||||
</summary>
|
||||
<param name="shaderCode">GLSL code of fragment shader.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.Link">
|
||||
<summary>
|
||||
Link the shader to current context.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.GetUniform``1(System.String)">
|
||||
<summary>
|
||||
Get a uniform form current shader,
|
||||
the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param name="name"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Form.Shader.Use">
|
||||
<summary>
|
||||
Let the current context use this shader.
|
||||
Create an instance of <see cref="T:StgSharp.Graphics.Shader"/> program
|
||||
</summary>
|
||||
<returns>New instance of <see cref="T:StgSharp.Graphics.Shader"/> instance. </returns>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.FrameTimer">
|
||||
<summary>
|
||||
@@ -186,11 +167,39 @@
|
||||
</summary>
|
||||
<param name="timer"><see cref="T:StgSharp.Graphics.FrameTimer"/> to be converted</param>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.ElementBuffer">
|
||||
<summary>
|
||||
A collecion of handle to Element Buffer Object in OpenGL.
|
||||
Each <see cref="T:System.UInt32"/> value indexed from instance of this class this
|
||||
is the only handle to one Element Buffer Object.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Graphics.IBufferObject">
|
||||
<summary>
|
||||
Interface of all kinds OpenGL buffer onjects
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:StgSharp.Graphics.IBufferObject.Item(System.Int32)">
|
||||
<summary>
|
||||
Get the only handle to one of the Object instance
|
||||
</summary>
|
||||
<param name="index"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IBufferObject.Bind(System.Int32)">
|
||||
<summary>
|
||||
Bind a buffer instance to OpenGL
|
||||
</summary>
|
||||
<param name="index">Index of handle of the object in this instance to be bind</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Texture.LoadTexture(System.Int32,System.String,StgSharp.Graphics.ImageLoader)">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<param name="name"></param>
|
||||
<param name="index"></param>
|
||||
<param name="loader"></param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.VertexBuffer.Unbind">
|
||||
<summary>
|
||||
|
||||
@@ -228,77 +237,67 @@
|
||||
<param name="name">Name of the OpenGL api</param>
|
||||
<returns>The funtion pointer of the api in form of <see cref="T:System.IntPtr"/></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.StgSharp#Graphics#IglFunc#SetValue(StgSharp.Graphics.Uniform{System.Single},System.Single)">
|
||||
<member name="F:StgSharp.Graphics.Shader.programID">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are float.
|
||||
A <see cref="T:System.UInt32"/> value represent this shader.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="v0">The value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.StgSharp#Graphics#IglFunc#SetValue(StgSharp.Graphics.Uniform{System.Int32},System.Int32)">
|
||||
<member name="M:StgSharp.Graphics.Shader.#ctor(StgSharp.Graphics.IglFunc)">
|
||||
<summary>
|
||||
Set data value to a int <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are int.
|
||||
Inti a shader with no program attached.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="i0">The value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.StgSharp#Graphics#IglFunc#SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single},System.Single,System.Single)">
|
||||
<member name="M:StgSharp.Graphics.Shader.CompileVertexShader(System.String)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`2"/>,
|
||||
all types of parameters are float.
|
||||
Compile the vertex shader to be attached to this shader.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`2"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
<param name="shaderCode">GLSL code of vertex shader.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.StgSharp#Graphics#IglFunc#SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single},System.Single,System.Single,System.Single)">
|
||||
<member name="M:StgSharp.Graphics.Shader.CompileFragmentShader(System.String)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`3"/>,
|
||||
all types of parameters are float.
|
||||
Compile the fragment shader to be attached to this shader.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`3"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
<param name="v2">The third value to be set</param>
|
||||
<param name="shaderCode">GLSL code of fragment shader.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.StgSharp#Graphics#IglFunc#SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},System.Single,System.Single,System.Single,System.Single)">
|
||||
<member name="M:StgSharp.Graphics.Shader.Link">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
|
||||
all types of parameters are float.
|
||||
Link the shader to current context.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
<param name="v2">The third value to be set</param>
|
||||
<param name="v3">The forth value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},StgSharp.Math.Vec4d)">
|
||||
<member name="M:StgSharp.Graphics.Shader.GetUniform``1(System.String)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
|
||||
all types of parameters are float.
|
||||
Get a uniform form current shader,
|
||||
the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
|
||||
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> packing four parameters of the uniform </param>
|
||||
<param name="name">Name of the Uniform in shader code</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.GLonRender.SetValue(StgSharp.Graphics.Uniform{StgSharp.Math.Vec4d},StgSharp.Math.Vec4d)">
|
||||
<member name="M:StgSharp.Graphics.Shader.GetUniform``2(System.String)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are <see cref="T:StgSharp.Math.Vec4d"/>.
|
||||
Get a uniform form current shader,
|
||||
the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> value of the uniform </param>
|
||||
<param name="name">Name of the Uniform in shader code</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.AlignFrame(StgSharp.Graphics.Form)">
|
||||
<member name="M:StgSharp.Graphics.Shader.GetUniform``3(System.String)">
|
||||
<summary>
|
||||
Align a sets of code to frame update of a <see cref="T:StgSharp.Graphics.Form"/>.
|
||||
Usually, a call of <see cref="M:StgSharp.Graphics.IglFunc.AfterAlign(StgSharp.Graphics.Form,System.Action)"/> is required.
|
||||
This method is used as sigle thread method. If more than one
|
||||
alignment is requested, a <see cref="T:System.InvalidOperationException"/> will throw.
|
||||
Get a uniform form current shader,
|
||||
the value type of the uniform should be provided.
|
||||
</summary>
|
||||
<param name="form">The form used as frame update benchmark.</param>
|
||||
<exception cref="T:System.InvalidOperationException">More than one alingment attached to one form timer</exception>
|
||||
<param name="name">Name of the Uniform in shader code</param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.Shader.Use">
|
||||
<summary>
|
||||
Let the current context use this shader.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.ActiveTexture(System.UInt32)">
|
||||
<summary>
|
||||
Same function as OpenGL api glActiveTexture
|
||||
</summary>
|
||||
<param name="type">type of texture to activate</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.AfterAlign(StgSharp.Graphics.Form,System.Action)">
|
||||
<summary>
|
||||
@@ -312,11 +311,15 @@
|
||||
<param name="action">Operation after frame update alignment.</param>
|
||||
<exception cref="T:System.InvalidOperationException">The action binded to a wrong alignment.</exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.ActiveTexture(System.UInt32)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.AlignFrame(StgSharp.Graphics.Form)">
|
||||
<summary>
|
||||
Same function as OpenGL api glActiveTexture
|
||||
Align a sets of code to frame update of a <see cref="T:StgSharp.Graphics.Form"/>.
|
||||
Usually, a call of <see cref="M:StgSharp.Graphics.IglFunc.AfterAlign(StgSharp.Graphics.Form,System.Action)"/> is required.
|
||||
This method is used as sigle thread method. If more than one
|
||||
alignment is requested, a <see cref="T:System.InvalidOperationException"/> will throw.
|
||||
</summary>
|
||||
<param name="type">type of texture to activate</param>
|
||||
<param name="form">The form used as frame update benchmark.</param>
|
||||
<exception cref="T:System.InvalidOperationException">More than one alingment attached to one form timer</exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.AttachShader(System.UInt32,System.UInt32)">
|
||||
<summary>
|
||||
@@ -381,43 +384,49 @@
|
||||
<summary>
|
||||
Creates a form and its associated
|
||||
</summary>
|
||||
<param name="handle">The instance of created form</param>
|
||||
<param name="width">Required width</param>
|
||||
<param name="height">Required width</param>
|
||||
<param name="tittle">Tittle of the window </param>
|
||||
<param name="monitor"></param>
|
||||
<param name="share"></param>
|
||||
<returns>The instance of created form</returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.DeleteBuffers(System.Int32,System.UInt32*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.DeleteBuffer(System.UInt32)">
|
||||
<summary>
|
||||
Same function as OpenGL api, glDeleteBuffer.
|
||||
Same function as OpenGL api, glDeleteBuffer. This method can delete one buffer in one call
|
||||
</summary>
|
||||
<param name="handle">a handle representing the buffer to be deleted</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.DeleteBuffers(System.UInt32,System.UInt32[])">
|
||||
<summary>
|
||||
Same function as OpenGL api, glDeleteBuffer. This method can delete a sets of buffers in one call.
|
||||
</summary>
|
||||
<param name="count">Amount of bufferd to be deleted</param>
|
||||
<param name="ptr">Pointer of buffer to be deleted</param>
|
||||
<param name="handle">Array of buffers to be deleted</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.DeleteVertexArrays(System.Int32,System.UInt32*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.DeleteVertexArrays(System.UInt32,System.UInt32[])">
|
||||
<summary>
|
||||
Same function as OpenGL api, glDeleteVertexArrays
|
||||
</summary>
|
||||
<param name="count">Amount of vao to be deleted</param>
|
||||
<param name="ptr">pointer of vao sign array</param>
|
||||
<param name="arrays">A array representing a colletion of vertex objects.</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenBuffers(System.Int32,System.UInt32*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenBuffers(System.UInt32,System.UInt32*)">
|
||||
<summary>
|
||||
Same fucntion as the OpenGL api glGenBuffers
|
||||
</summary>
|
||||
<param name="count"></param>
|
||||
<param name="ptr"></param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenTextures(System.Int32,System.UInt32*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenTextures(System.UInt32,System.UInt32*)">
|
||||
<summary>
|
||||
Same fucnction as OpenGL api glGenTextures.
|
||||
</summary>
|
||||
<param name="count">amount of textures to generate</param>
|
||||
<param name="ptr">pointer to texture signs' array</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenVertexArrays(System.Int32,System.UInt32*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.GenVertexArrays(System.UInt32,System.UInt32*)">
|
||||
<summary>
|
||||
Same fucntion as OpenGL api, glGenVertexArray
|
||||
</summary>
|
||||
@@ -446,7 +455,69 @@
|
||||
<param name="id">The only signiture stands for the <see cref="T:StgSharp.Graphics.Form"/> to be controlled</param>
|
||||
<param name="handler">Method hadler </param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetVertexAttribute(System.UInt32,System.Int32,System.Type,System.Boolean,System.Int32,System.Int32)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},System.Single,System.Single,System.Single,System.Single)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
|
||||
all types of parameters are float.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
<param name="v2">The third value to be set</param>
|
||||
<param name="v3">The forth value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single,System.Single},StgSharp.Math.Vec4d)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`4"/>,
|
||||
all types of parameters are float.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`4"/> target</param>
|
||||
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> packing four parameters of the uniform </param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single,System.Single},System.Single,System.Single,System.Single)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`3"/>,
|
||||
all types of parameters are float.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`3"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
<param name="v2">The third value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single,System.Single},System.Single,System.Single)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`2"/>,
|
||||
all types of parameters are float.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`2"/> target</param>
|
||||
<param name="v0">The first value to be set</param>
|
||||
<param name="v1">The second value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Single},System.Single)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are float.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="v0">The value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{System.Int32},System.Int32)">
|
||||
<summary>
|
||||
Set data value to a int <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are int.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="i0">The value to be set</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetValue(StgSharp.Graphics.Uniform{StgSharp.Math.Vec4d},StgSharp.Math.Vec4d)">
|
||||
<summary>
|
||||
Set data value to a float <see cref="T:StgSharp.Graphics.Uniform`1"/>,
|
||||
all types of parameters are <see cref="T:StgSharp.Math.Vec4d"/>.
|
||||
</summary>
|
||||
<param name="uniform">The <see cref="T:StgSharp.Graphics.Uniform`1"/> target</param>
|
||||
<param name="vec">A <see cref="T:StgSharp.Math.Vec4d"/> value of the uniform </param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.SetVertexAttribute(System.UInt32,System.Int32,System.Type,System.Boolean,System.UInt32,System.Int32)">
|
||||
<summary>
|
||||
Set how a shader parameter read data from a VBO.
|
||||
</summary>
|
||||
@@ -457,7 +528,7 @@
|
||||
<param name="stride">Pixels stride of each sets of data</param>
|
||||
<param name="pointer"></param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.TextureImage2d(System.UInt32,System.Int32,System.UInt32,System.Int32,System.Int32,System.UInt32,System.UInt32,System.Void*)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.TextureImage2d(System.UInt32,System.Int32,System.UInt32,System.UInt32,System.UInt32,System.UInt32,System.UInt32,System.Void*)">
|
||||
<summary>
|
||||
Same function as OpenGL api glTexImage2d
|
||||
</summary>
|
||||
@@ -484,7 +555,7 @@
|
||||
</summary>
|
||||
<param name="program">Sign of program to be used</param>
|
||||
</member>
|
||||
<member name="M:StgSharp.Graphics.IglFunc.Viewport(System.Int32,System.Int32,System.Int32,System.Int32)">
|
||||
<member name="M:StgSharp.Graphics.IglFunc.Viewport(System.Int32,System.Int32,System.UInt32,System.UInt32)">
|
||||
<summary>
|
||||
Same function as the OpenGL api, glViewPort
|
||||
</summary>
|
||||
@@ -641,6 +712,7 @@
|
||||
</summary>
|
||||
<param name="count">Amount of elements to be prepared.</param>
|
||||
</member>
|
||||
<!-- Badly formed XML comment ignored for member "M:StgSharp.Logic.DynamicArrayList`1.#ctor(System.Int32,`0)" -->
|
||||
<member name="P:StgSharp.Logic.DynamicArrayList`1.Length">
|
||||
<summary>
|
||||
Length of this <see cref="T:StgSharp.Logic.DynamicArrayList`1"/>
|
||||
@@ -720,6 +792,18 @@
|
||||
remove the last member of the list
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Math.GLclampf">
|
||||
<summary>
|
||||
OpenGL numeric type.
|
||||
An IEEE-754 floating-point value, clamped to the range [0,1].
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Math.GLclampd">
|
||||
<summary>
|
||||
OpenGL numeric type.
|
||||
An IEEE-754 double precision floating-point value, clamped to the range [0,1].
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:StgSharp.Math.Vec2d">
|
||||
<summary>
|
||||
A two dimension vector defined by two elements.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user