daily update on 20240305 by nitload youmu

This commit is contained in:
YoumuLiu
2024-03-05 10:17:02 +08:00
parent 1f2fca4c8f
commit 6a0cccae79
156 changed files with 23040 additions and 1385 deletions
Binary file not shown.
@@ -0,0 +1,52 @@
{
"Version": 1,
"WorkspaceRootPath": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\ConsoleApp1\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{7F1EBEA1-0AAB-4989-A824-50BCF7A23840}|ConsoleApp1\\ConsoleApp1.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u5B9E\u9A8C\\consoleapp1\\consoleapp1\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{7F1EBEA1-0AAB-4989-A824-50BCF7A23840}|ConsoleApp1\\ConsoleApp1.csproj|solutionrelative:consoleapp1\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{7F1EBEA1-0AAB-4989-A824-50BCF7A23840}|ConsoleApp1\\ConsoleApp1.csproj|d:\\nitloadindustry\\\u7814\u7A76\u9879\u76EE\\1-flagship\\th2020\\projectfile\\\u5B9E\u9A8C\\consoleapp1\\consoleapp1\\consoleapp1.csproj||{04B8AB82-A572-4FEF-95CE-5222444B6B64}|",
"RelativeMoniker": "D:0:0:{7F1EBEA1-0AAB-4989-A824-50BCF7A23840}|ConsoleApp1\\ConsoleApp1.csproj|solutionrelative:consoleapp1\\consoleapp1.csproj||{04B8AB82-A572-4FEF-95CE-5222444B6B64}|"
}
],
"DocumentGroupContainers": [
{
"Orientation": 1,
"VerticalTabListWidth": 189,
"DocumentGroups": [
{
"DockedHeight": 268,
"SelectedChildIndex": 1,
"Children": [
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "ConsoleApp1",
"DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj",
"RelativeDocumentMoniker": "ConsoleApp1\\ConsoleApp1.csproj",
"ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\ConsoleApp1\\ConsoleApp1\\ConsoleApp1.csproj",
"RelativeToolTip": "ConsoleApp1\\ConsoleApp1.csproj",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000758|",
"WhenOpened": "2023-12-25T14:22:56.056Z"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Program.cs",
"DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\ConsoleApp1\\ConsoleApp1\\Program.cs",
"RelativeDocumentMoniker": "ConsoleApp1\\Program.cs",
"ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\ConsoleApp1\\ConsoleApp1\\Program.cs",
"RelativeToolTip": "ConsoleApp1\\Program.cs",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAsAAAAmAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2023-12-25T14:19:45.079Z",
"EditorCaption": ""
}
]
}
]
}
]
}
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("ConsoleApp1")] [assembly: System.Reflection.AssemblyCompanyAttribute("ConsoleApp1")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+14eaab455f9eeb6990fa39994b2d2c8b1da39b36")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1f2fca4c8fe323daf9751677ccfdf0f7b04a9be8")]
[assembly: System.Reflection.AssemblyProductAttribute("ConsoleApp1")] [assembly: System.Reflection.AssemblyProductAttribute("ConsoleApp1")]
[assembly: System.Reflection.AssemblyTitleAttribute("ConsoleApp1")] [assembly: System.Reflection.AssemblyTitleAttribute("ConsoleApp1")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
b418ea045882d52b2c4e566a443fa31ed23dedefb026927dfbf62bccee6ba2f2 6d1b2974d9965588611db00469e69ee1cadefa5fb0a5eb601b9f8b770a59dbf6
Binary file not shown.
@@ -0,0 +1,122 @@
{
"Version": 1,
"WorkspaceRootPath": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{1639BE5E-7661-45AA-B8FA-C533B00157B2}|GLenvTest.vcxproj|D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\main.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{1639BE5E-7661-45AA-B8FA-C533B00157B2}|GLenvTest.vcxproj|solutionrelative:main.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{1639BE5E-7661-45AA-B8FA-C533B00157B2}|GLenvTest.vcxproj|D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\main.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{1639BE5E-7661-45AA-B8FA-C533B00157B2}|GLenvTest.vcxproj|solutionrelative:main.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{1639BE5E-7661-45AA-B8FA-C533B00157B2}|GLenvTest.vcxproj|D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\gl.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{1639BE5E-7661-45AA-B8FA-C533B00157B2}|GLenvTest.vcxproj|solutionrelative:gl.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{1639BE5E-7661-45AA-B8FA-C533B00157B2}|GLenvTest.vcxproj|D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\gl.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{1639BE5E-7661-45AA-B8FA-C533B00157B2}|GLenvTest.vcxproj|solutionrelative:gl.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{1639BE5E-7661-45AA-B8FA-C533B00157B2}|GLenvTest.vcxproj|D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\wgl.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{1639BE5E-7661-45AA-B8FA-C533B00157B2}|GLenvTest.vcxproj|solutionrelative:wgl.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{1639BE5E-7661-45AA-B8FA-C533B00157B2}|GLenvTest.vcxproj|D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\wgl.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{1639BE5E-7661-45AA-B8FA-C533B00157B2}|GLenvTest.vcxproj|solutionrelative:wgl.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 100,
"DocumentGroups": [
{
"DockedWidth": 197,
"SelectedChildIndex": 5,
"Children": [
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "wgl.h",
"DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\wgl.h",
"RelativeDocumentMoniker": "wgl.h",
"ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\wgl.h",
"RelativeToolTip": "wgl.h",
"ViewState": "AQIAABAAAAAAAAAAAADwvyAAAAAPAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-02T19:14:55.785Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 5,
"Title": "wgl.c",
"DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\wgl.c",
"RelativeDocumentMoniker": "wgl.c",
"ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\wgl.c",
"RelativeToolTip": "wgl.c",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAYAAAAQAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000423|",
"WhenOpened": "2024-03-02T19:14:32.427Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "gl.c",
"DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\gl.c",
"RelativeDocumentMoniker": "gl.c",
"ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\gl.c",
"RelativeToolTip": "gl.c",
"ViewState": "AQIAAOISAAAAAAAAAAAkwOkSAAAgAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000423|",
"WhenOpened": "2024-03-02T19:06:03.063Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "gl.h",
"DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\gl.h",
"RelativeDocumentMoniker": "gl.h",
"ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\gl.h",
"RelativeToolTip": "gl.h",
"ViewState": "AQIAAJUVAAAAAAAAAAAkwKUVAAAUAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-02T19:13:23.575Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "main.h",
"DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\main.h",
"RelativeDocumentMoniker": "main.h",
"ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\main.h",
"RelativeToolTip": "main.h",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAYAAAAXAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-02T19:05:37.826Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "main.c",
"DocumentMoniker": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\main.c",
"RelativeDocumentMoniker": "main.c",
"ToolTip": "D:\\NitloadIndustry\\\u7814\u7A76\u9879\u76EE\\1-Flagship\\TH2020\\ProjectFile\\\u5B9E\u9A8C\\GLenvTest\\main.c",
"RelativeToolTip": "main.c",
"ViewState": "AQIAABEAAAAAAAAAAAAAABwAAAAvAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000423|",
"WhenOpened": "2024-03-02T19:02:36.377Z",
"EditorCaption": ""
}
]
}
]
}
]
}
+31
View File
@@ -0,0 +1,31 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34607.119
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GLenvTest", "GLenvTest.vcxproj", "{1639BE5E-7661-45AA-B8FA-C533B00157B2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1639BE5E-7661-45AA-B8FA-C533B00157B2}.Debug|x64.ActiveCfg = Debug|x64
{1639BE5E-7661-45AA-B8FA-C533B00157B2}.Debug|x64.Build.0 = Debug|x64
{1639BE5E-7661-45AA-B8FA-C533B00157B2}.Debug|x86.ActiveCfg = Debug|Win32
{1639BE5E-7661-45AA-B8FA-C533B00157B2}.Debug|x86.Build.0 = Debug|Win32
{1639BE5E-7661-45AA-B8FA-C533B00157B2}.Release|x64.ActiveCfg = Release|x64
{1639BE5E-7661-45AA-B8FA-C533B00157B2}.Release|x64.Build.0 = Release|x64
{1639BE5E-7661-45AA-B8FA-C533B00157B2}.Release|x86.ActiveCfg = Release|Win32
{1639BE5E-7661-45AA-B8FA-C533B00157B2}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AFD5F12F-B1FD-4404-AE32-4CD03F3E8D9E}
EndGlobalSection
EndGlobal
+153
View File
@@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{1639be5e-7661-45aa-b8fa-c533b00157b2}</ProjectGuid>
<RootNamespace>GLenvTest</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>OPENGL32.LIB;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>OPENGL32.LIB;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="gl.h" />
<ClInclude Include="glfw3.h" />
<ClInclude Include="khrplatform.h" />
<ClInclude Include="main.h" />
<ClInclude Include="wgl.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="gl.c" />
<ClCompile Include="main.c" />
<ClCompile Include="wgl.c" />
</ItemGroup>
<ItemGroup>
<Library Include="glfw3.lib" />
<Library Include="glfw3dll.lib" />
<Library Include="glfw3_mt.lib" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="gl.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="glfw3.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="khrplatform.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="wgl.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="main.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="gl.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="wgl.c">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="main.c">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Library Include="glfw3.lib">
<Filter>资源文件</Filter>
</Library>
<Library Include="glfw3_mt.lib">
<Filter>资源文件</Filter>
</Library>
<Library Include="glfw3dll.lib">
<Filter>资源文件</Filter>
</Library>
</ItemGroup>
</Project>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\GLenvTest\x64\Debug\GLenvTest.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>
Binary file not shown.
@@ -0,0 +1,5 @@
main.c
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\GLenvTest\main.c(18,9): warning C4098: “main”:“void”函数返回值
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\GLenvTest\main.c(31,12): warning C4477: “printf”: 格式字符串“%s”需要类型“char *”的参数,但可变参数 1 拥有了类型“const GLchar **”
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\GLenvTest\main.c(53,5): warning C4098: “main”:“void”函数返回值
GLenvTest.vcxproj -> D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\GLenvTest\x64\Debug\GLenvTest.exe
@@ -0,0 +1,3 @@
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\GLenvTest\gl.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\GLenvTest\GLenvTest\x64\Debug\gl.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\GLenvTest\main.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\GLenvTest\GLenvTest\x64\Debug\main.obj
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\GLenvTest\wgl.c;D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\GLenvTest\GLenvTest\x64\Debug\wgl.obj
@@ -0,0 +1,2 @@
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.39.33519:TargetPlatformVersion=10.0.22621.0:
Debug|x64|D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\GLenvTest\|
@@ -0,0 +1,2 @@
^D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\实验\GLENVTEST\GLENVTEST\X64\DEBUG\GL.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\实验\GLENVTEST\GLENVTEST\X64\DEBUG\MAIN.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\实验\GLENVTEST\GLENVTEST\X64\DEBUG\WGL.OBJ|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\实验\GLENVTEST\GLFW3.LIB|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\实验\GLENVTEST\GLFW3DLL.LIB|D:\NITLOADINDUSTRY\研究项目\1-FLAGSHIP\TH2020\PROJECTFILE\实验\GLENVTEST\GLFW3_MT.LIB
D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\实验\GLenvTest\GLenvTest\x64\Debug\GLenvTest.ilk
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
+11098
View File
File diff suppressed because one or more lines are too long
+311
View File
@@ -0,0 +1,311 @@
#ifndef __khrplatform_h_
#define __khrplatform_h_
/*
** Copyright (c) 2008-2018 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be included
** in all copies or substantial portions of the Materials.
**
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/* Khronos platform-specific types and definitions.
*
* The master copy of khrplatform.h is maintained in the Khronos EGL
* Registry repository at https://github.com/KhronosGroup/EGL-Registry
* The last semantic modification to khrplatform.h was at commit ID:
* 67a3e0864c2d75ea5287b9f3d2eb74a745936692
*
* Adopters may modify this file to suit their platform. Adopters are
* encouraged to submit platform specific modifications to the Khronos
* group so that they can be included in future versions of this file.
* Please submit changes by filing pull requests or issues on
* the EGL Registry repository linked above.
*
*
* See the Implementer's Guidelines for information about where this file
* should be located on your system and for more details of its use:
* http://www.khronos.org/registry/implementers_guide.pdf
*
* This file should be included as
* #include <KHR/khrplatform.h>
* by Khronos client API header files that use its types and defines.
*
* The types in khrplatform.h should only be used to define API-specific types.
*
* Types defined in khrplatform.h:
* khronos_int8_t signed 8 bit
* khronos_uint8_t unsigned 8 bit
* khronos_int16_t signed 16 bit
* khronos_uint16_t unsigned 16 bit
* khronos_int32_t signed 32 bit
* khronos_uint32_t unsigned 32 bit
* khronos_int64_t signed 64 bit
* khronos_uint64_t unsigned 64 bit
* khronos_intptr_t signed same number of bits as a pointer
* khronos_uintptr_t unsigned same number of bits as a pointer
* khronos_ssize_t signed size
* khronos_usize_t unsigned size
* khronos_float_t signed 32 bit floating point
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
* nanoseconds
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
* khronos_boolean_enum_t enumerated boolean type. This should
* only be used as a base type when a client API's boolean type is
* an enum. Client APIs which use an integer or other type for
* booleans cannot use this as the base type for their boolean.
*
* Tokens defined in khrplatform.h:
*
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
*
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
*
* Calling convention macros defined in this file:
* KHRONOS_APICALL
* KHRONOS_APIENTRY
* KHRONOS_APIATTRIBUTES
*
* These may be used in function prototypes as:
*
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
* int arg1,
* int arg2) KHRONOS_APIATTRIBUTES;
*/
#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
# define KHRONOS_STATIC 1
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APICALL
*-------------------------------------------------------------------------
* This precedes the return type of the function in the function prototype.
*/
#if defined(KHRONOS_STATIC)
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
* header compatible with static linking. */
# define KHRONOS_APICALL
#elif defined(_WIN32)
# define KHRONOS_APICALL __declspec(dllimport)
#elif defined (__SYMBIAN32__)
# define KHRONOS_APICALL IMPORT_C
#elif defined(__ANDROID__)
# define KHRONOS_APICALL __attribute__((visibility("default")))
#else
# define KHRONOS_APICALL
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIENTRY
*-------------------------------------------------------------------------
* This follows the return type of the function and precedes the function
* name in the function prototype.
*/
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
/* Win32 but not WinCE */
# define KHRONOS_APIENTRY __stdcall
#else
# define KHRONOS_APIENTRY
#endif
/*-------------------------------------------------------------------------
* Definition of KHRONOS_APIATTRIBUTES
*-------------------------------------------------------------------------
* This follows the closing parenthesis of the function prototype arguments.
*/
#if defined (__ARMCC_2__)
#define KHRONOS_APIATTRIBUTES __softfp
#else
#define KHRONOS_APIATTRIBUTES
#endif
/*-------------------------------------------------------------------------
* basic type definitions
*-----------------------------------------------------------------------*/
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
/*
* Using <stdint.h>
*/
#include <stdint.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
/*
* To support platform where unsigned long cannot be used interchangeably with
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
* unsigned long long or similar (this results in different C++ name mangling).
* To avoid changes for existing platforms, we restrict usage of intptr_t to
* platforms where the size of a pointer is larger than the size of long.
*/
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
#define KHRONOS_USE_INTPTR_T
#endif
#endif
#elif defined(__VMS ) || defined(__sgi)
/*
* Using <inttypes.h>
*/
#include <inttypes.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
/*
* Win32
*/
typedef __int32 khronos_int32_t;
typedef unsigned __int32 khronos_uint32_t;
typedef __int64 khronos_int64_t;
typedef unsigned __int64 khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif defined(__sun__) || defined(__digital__)
/*
* Sun or Digital
*/
typedef int khronos_int32_t;
typedef unsigned int khronos_uint32_t;
#if defined(__arch64__) || defined(_LP64)
typedef long int khronos_int64_t;
typedef unsigned long int khronos_uint64_t;
#else
typedef long long int khronos_int64_t;
typedef unsigned long long int khronos_uint64_t;
#endif /* __arch64__ */
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#elif 0
/*
* Hypothetical platform with no float or int64 support
*/
typedef int khronos_int32_t;
typedef unsigned int khronos_uint32_t;
#define KHRONOS_SUPPORT_INT64 0
#define KHRONOS_SUPPORT_FLOAT 0
#else
/*
* Generic fallback
*/
#include <stdint.h>
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
#endif
/*
* Types that are (so far) the same on all platforms
*/
typedef signed char khronos_int8_t;
typedef unsigned char khronos_uint8_t;
typedef signed short int khronos_int16_t;
typedef unsigned short int khronos_uint16_t;
/*
* Types that differ between LLP64 and LP64 architectures - in LLP64,
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
* to be the only LLP64 architecture in current use.
*/
#ifdef KHRONOS_USE_INTPTR_T
typedef intptr_t khronos_intptr_t;
typedef uintptr_t khronos_uintptr_t;
#elif defined(_WIN64)
typedef signed long long int khronos_intptr_t;
typedef unsigned long long int khronos_uintptr_t;
#else
typedef signed long int khronos_intptr_t;
typedef unsigned long int khronos_uintptr_t;
#endif
#if defined(_WIN64)
typedef signed long long int khronos_ssize_t;
typedef unsigned long long int khronos_usize_t;
#else
typedef signed long int khronos_ssize_t;
typedef unsigned long int khronos_usize_t;
#endif
#if KHRONOS_SUPPORT_FLOAT
/*
* Float type
*/
typedef float khronos_float_t;
#endif
#if KHRONOS_SUPPORT_INT64
/* Time types
*
* These types can be used to represent a time interval in nanoseconds or
* an absolute Unadjusted System Time. Unadjusted System Time is the number
* of nanoseconds since some arbitrary system event (e.g. since the last
* time the system booted). The Unadjusted System Time is an unsigned
* 64 bit value that wraps back to 0 every 584 years. Time intervals
* may be either signed or unsigned.
*/
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
typedef khronos_int64_t khronos_stime_nanoseconds_t;
#endif
/*
* Dummy value used to pad enum types to 32 bits.
*/
#ifndef KHRONOS_MAX_ENUM
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
#endif
/*
* Enumerated boolean type
*
* Values other than zero should be considered to be true. Therefore
* comparisons should not be made against KHRONOS_TRUE.
*/
typedef enum {
KHRONOS_FALSE = 0,
KHRONOS_TRUE = 1,
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
} khronos_boolean_enum_t;
#endif /* __khrplatform_h_ */
+71
View File
@@ -0,0 +1,71 @@
#include "gl.h"
#include "glfw3.h"
#include "stdio.h"
#include "stdlib.h"
#include <stdbool.h>
#include "main.h"
void main()
{
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 6);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
GLFWwindow* window = glfwCreateWindow(800, 600, "Test", NULL, NULL);
if (window == NULL)
{
return -100;
}
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
glfwMakeContextCurrent(window);
context = malloc(sizeof(GladGLContext));
gladLoadGLContext(context, glfwGetProcAddress);
unsigned int shader = context->CreateShader(GL_VERTEX_SHADER);
const GLchar* code[] = { "Test string\0" };
context->ShaderSource(shader, 1, code, NULL);
printf("%s\n", code);
while (!glfwWindowShouldClose(window))
{
// input
// -----
processInput(window);
// render
// ------
context->ClearColor(0.2f, 0.3f, 0.3f, 1.0f);
context->Clear(GL_COLOR_BUFFER_BIT);
// glfw: swap buffers and poll IO events (keys pressed/released, mouse moved etc.)
// -------------------------------------------------------------------------------
glfwSwapBuffers(window);
glfwPollEvents();
}
// glfw: terminate, clearing all previously allocated GLFW resources.
// ------------------------------------------------------------------
glfwTerminate();
free(context);
return 0;
}
// process all input: query GLFW whether relevant keys are pressed/released this frame and react accordingly
// ---------------------------------------------------------------------------------------------------------
void processInput(GLFWwindow* window)
{
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
glfwSetWindowShouldClose(window, true);
}
// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
{
// make sure the viewport matches the new window dimensions; note that width and
// height will be significantly larger than specified on retina displays.
context->Viewport(0, 0, width, height);
}
+7
View File
@@ -0,0 +1,7 @@
#pragma once
void main();
void processInput(GLFWwindow* window);
void framebuffer_size_callback(GLFWwindow* window, int width, int height);
GladGLContext* context;
+569
View File
@@ -0,0 +1,569 @@
/**
* SPDX-License-Identifier: (WTFPL OR CC0-1.0) AND Apache-2.0
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "wgl.h"
#ifndef GLAD_IMPL_UTIL_C_
#define GLAD_IMPL_UTIL_C_
#ifdef _MSC_VER
#define GLAD_IMPL_UTIL_SSCANF sscanf_s
#else
#define GLAD_IMPL_UTIL_SSCANF sscanf
#endif
#endif /* GLAD_IMPL_UTIL_C_ */
#ifdef __cplusplus
extern "C" {
#endif
int GLAD_WGL_VERSION_1_0 = 0;
int GLAD_WGL_3DFX_multisample = 0;
int GLAD_WGL_3DL_stereo_control = 0;
int GLAD_WGL_AMD_gpu_association = 0;
int GLAD_WGL_ARB_buffer_region = 0;
int GLAD_WGL_ARB_context_flush_control = 0;
int GLAD_WGL_ARB_create_context = 0;
int GLAD_WGL_ARB_create_context_no_error = 0;
int GLAD_WGL_ARB_create_context_profile = 0;
int GLAD_WGL_ARB_create_context_robustness = 0;
int GLAD_WGL_ARB_extensions_string = 0;
int GLAD_WGL_ARB_framebuffer_sRGB = 0;
int GLAD_WGL_ARB_make_current_read = 0;
int GLAD_WGL_ARB_multisample = 0;
int GLAD_WGL_ARB_pbuffer = 0;
int GLAD_WGL_ARB_pixel_format = 0;
int GLAD_WGL_ARB_pixel_format_float = 0;
int GLAD_WGL_ARB_render_texture = 0;
int GLAD_WGL_ARB_robustness_application_isolation = 0;
int GLAD_WGL_ARB_robustness_share_group_isolation = 0;
int GLAD_WGL_ATI_pixel_format_float = 0;
int GLAD_WGL_ATI_render_texture_rectangle = 0;
int GLAD_WGL_EXT_colorspace = 0;
int GLAD_WGL_EXT_create_context_es2_profile = 0;
int GLAD_WGL_EXT_create_context_es_profile = 0;
int GLAD_WGL_EXT_depth_float = 0;
int GLAD_WGL_EXT_display_color_table = 0;
int GLAD_WGL_EXT_extensions_string = 0;
int GLAD_WGL_EXT_framebuffer_sRGB = 0;
int GLAD_WGL_EXT_make_current_read = 0;
int GLAD_WGL_EXT_multisample = 0;
int GLAD_WGL_EXT_pbuffer = 0;
int GLAD_WGL_EXT_pixel_format = 0;
int GLAD_WGL_EXT_pixel_format_packed_float = 0;
int GLAD_WGL_EXT_swap_control = 0;
int GLAD_WGL_EXT_swap_control_tear = 0;
int GLAD_WGL_I3D_digital_video_control = 0;
int GLAD_WGL_I3D_gamma = 0;
int GLAD_WGL_I3D_genlock = 0;
int GLAD_WGL_I3D_image_buffer = 0;
int GLAD_WGL_I3D_swap_frame_lock = 0;
int GLAD_WGL_I3D_swap_frame_usage = 0;
int GLAD_WGL_NV_DX_interop = 0;
int GLAD_WGL_NV_DX_interop2 = 0;
int GLAD_WGL_NV_copy_image = 0;
int GLAD_WGL_NV_delay_before_swap = 0;
int GLAD_WGL_NV_float_buffer = 0;
int GLAD_WGL_NV_gpu_affinity = 0;
int GLAD_WGL_NV_multigpu_context = 0;
int GLAD_WGL_NV_multisample_coverage = 0;
int GLAD_WGL_NV_present_video = 0;
int GLAD_WGL_NV_render_depth_texture = 0;
int GLAD_WGL_NV_render_texture_rectangle = 0;
int GLAD_WGL_NV_swap_group = 0;
int GLAD_WGL_NV_vertex_array_range = 0;
int GLAD_WGL_NV_video_capture = 0;
int GLAD_WGL_NV_video_output = 0;
int GLAD_WGL_OML_sync_control = 0;
PFNWGLALLOCATEMEMORYNVPROC glad_wglAllocateMemoryNV = NULL;
PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC glad_wglAssociateImageBufferEventsI3D = NULL;
PFNWGLBEGINFRAMETRACKINGI3DPROC glad_wglBeginFrameTrackingI3D = NULL;
PFNWGLBINDDISPLAYCOLORTABLEEXTPROC glad_wglBindDisplayColorTableEXT = NULL;
PFNWGLBINDSWAPBARRIERNVPROC glad_wglBindSwapBarrierNV = NULL;
PFNWGLBINDTEXIMAGEARBPROC glad_wglBindTexImageARB = NULL;
PFNWGLBINDVIDEOCAPTUREDEVICENVPROC glad_wglBindVideoCaptureDeviceNV = NULL;
PFNWGLBINDVIDEODEVICENVPROC glad_wglBindVideoDeviceNV = NULL;
PFNWGLBINDVIDEOIMAGENVPROC glad_wglBindVideoImageNV = NULL;
PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC glad_wglBlitContextFramebufferAMD = NULL;
PFNWGLCHOOSEPIXELFORMATARBPROC glad_wglChoosePixelFormatARB = NULL;
PFNWGLCHOOSEPIXELFORMATEXTPROC glad_wglChoosePixelFormatEXT = NULL;
PFNWGLCOPYIMAGESUBDATANVPROC glad_wglCopyImageSubDataNV = NULL;
PFNWGLCREATEAFFINITYDCNVPROC glad_wglCreateAffinityDCNV = NULL;
PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC glad_wglCreateAssociatedContextAMD = NULL;
PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC glad_wglCreateAssociatedContextAttribsAMD = NULL;
PFNWGLCREATEBUFFERREGIONARBPROC glad_wglCreateBufferRegionARB = NULL;
PFNWGLCREATECONTEXTATTRIBSARBPROC glad_wglCreateContextAttribsARB = NULL;
PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC glad_wglCreateDisplayColorTableEXT = NULL;
PFNWGLCREATEIMAGEBUFFERI3DPROC glad_wglCreateImageBufferI3D = NULL;
PFNWGLCREATEPBUFFERARBPROC glad_wglCreatePbufferARB = NULL;
PFNWGLCREATEPBUFFEREXTPROC glad_wglCreatePbufferEXT = NULL;
PFNWGLDXCLOSEDEVICENVPROC glad_wglDXCloseDeviceNV = NULL;
PFNWGLDXLOCKOBJECTSNVPROC glad_wglDXLockObjectsNV = NULL;
PFNWGLDXOBJECTACCESSNVPROC glad_wglDXObjectAccessNV = NULL;
PFNWGLDXOPENDEVICENVPROC glad_wglDXOpenDeviceNV = NULL;
PFNWGLDXREGISTEROBJECTNVPROC glad_wglDXRegisterObjectNV = NULL;
PFNWGLDXSETRESOURCESHAREHANDLENVPROC glad_wglDXSetResourceShareHandleNV = NULL;
PFNWGLDXUNLOCKOBJECTSNVPROC glad_wglDXUnlockObjectsNV = NULL;
PFNWGLDXUNREGISTEROBJECTNVPROC glad_wglDXUnregisterObjectNV = NULL;
PFNWGLDELAYBEFORESWAPNVPROC glad_wglDelayBeforeSwapNV = NULL;
PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC glad_wglDeleteAssociatedContextAMD = NULL;
PFNWGLDELETEBUFFERREGIONARBPROC glad_wglDeleteBufferRegionARB = NULL;
PFNWGLDELETEDCNVPROC glad_wglDeleteDCNV = NULL;
PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC glad_wglDestroyDisplayColorTableEXT = NULL;
PFNWGLDESTROYIMAGEBUFFERI3DPROC glad_wglDestroyImageBufferI3D = NULL;
PFNWGLDESTROYPBUFFERARBPROC glad_wglDestroyPbufferARB = NULL;
PFNWGLDESTROYPBUFFEREXTPROC glad_wglDestroyPbufferEXT = NULL;
PFNWGLDISABLEFRAMELOCKI3DPROC glad_wglDisableFrameLockI3D = NULL;
PFNWGLDISABLEGENLOCKI3DPROC glad_wglDisableGenlockI3D = NULL;
PFNWGLENABLEFRAMELOCKI3DPROC glad_wglEnableFrameLockI3D = NULL;
PFNWGLENABLEGENLOCKI3DPROC glad_wglEnableGenlockI3D = NULL;
PFNWGLENDFRAMETRACKINGI3DPROC glad_wglEndFrameTrackingI3D = NULL;
PFNWGLENUMGPUDEVICESNVPROC glad_wglEnumGpuDevicesNV = NULL;
PFNWGLENUMGPUSFROMAFFINITYDCNVPROC glad_wglEnumGpusFromAffinityDCNV = NULL;
PFNWGLENUMGPUSNVPROC glad_wglEnumGpusNV = NULL;
PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC glad_wglEnumerateVideoCaptureDevicesNV = NULL;
PFNWGLENUMERATEVIDEODEVICESNVPROC glad_wglEnumerateVideoDevicesNV = NULL;
PFNWGLFREEMEMORYNVPROC glad_wglFreeMemoryNV = NULL;
PFNWGLGENLOCKSAMPLERATEI3DPROC glad_wglGenlockSampleRateI3D = NULL;
PFNWGLGENLOCKSOURCEDELAYI3DPROC glad_wglGenlockSourceDelayI3D = NULL;
PFNWGLGENLOCKSOURCEEDGEI3DPROC glad_wglGenlockSourceEdgeI3D = NULL;
PFNWGLGENLOCKSOURCEI3DPROC glad_wglGenlockSourceI3D = NULL;
PFNWGLGETCONTEXTGPUIDAMDPROC glad_wglGetContextGPUIDAMD = NULL;
PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC glad_wglGetCurrentAssociatedContextAMD = NULL;
PFNWGLGETCURRENTREADDCARBPROC glad_wglGetCurrentReadDCARB = NULL;
PFNWGLGETCURRENTREADDCEXTPROC glad_wglGetCurrentReadDCEXT = NULL;
PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC glad_wglGetDigitalVideoParametersI3D = NULL;
PFNWGLGETEXTENSIONSSTRINGARBPROC glad_wglGetExtensionsStringARB = NULL;
PFNWGLGETEXTENSIONSSTRINGEXTPROC glad_wglGetExtensionsStringEXT = NULL;
PFNWGLGETFRAMEUSAGEI3DPROC glad_wglGetFrameUsageI3D = NULL;
PFNWGLGETGPUIDSAMDPROC glad_wglGetGPUIDsAMD = NULL;
PFNWGLGETGPUINFOAMDPROC glad_wglGetGPUInfoAMD = NULL;
PFNWGLGETGAMMATABLEI3DPROC glad_wglGetGammaTableI3D = NULL;
PFNWGLGETGAMMATABLEPARAMETERSI3DPROC glad_wglGetGammaTableParametersI3D = NULL;
PFNWGLGETGENLOCKSAMPLERATEI3DPROC glad_wglGetGenlockSampleRateI3D = NULL;
PFNWGLGETGENLOCKSOURCEDELAYI3DPROC glad_wglGetGenlockSourceDelayI3D = NULL;
PFNWGLGETGENLOCKSOURCEEDGEI3DPROC glad_wglGetGenlockSourceEdgeI3D = NULL;
PFNWGLGETGENLOCKSOURCEI3DPROC glad_wglGetGenlockSourceI3D = NULL;
PFNWGLGETMSCRATEOMLPROC glad_wglGetMscRateOML = NULL;
PFNWGLGETPBUFFERDCARBPROC glad_wglGetPbufferDCARB = NULL;
PFNWGLGETPBUFFERDCEXTPROC glad_wglGetPbufferDCEXT = NULL;
PFNWGLGETPIXELFORMATATTRIBFVARBPROC glad_wglGetPixelFormatAttribfvARB = NULL;
PFNWGLGETPIXELFORMATATTRIBFVEXTPROC glad_wglGetPixelFormatAttribfvEXT = NULL;
PFNWGLGETPIXELFORMATATTRIBIVARBPROC glad_wglGetPixelFormatAttribivARB = NULL;
PFNWGLGETPIXELFORMATATTRIBIVEXTPROC glad_wglGetPixelFormatAttribivEXT = NULL;
PFNWGLGETSWAPINTERVALEXTPROC glad_wglGetSwapIntervalEXT = NULL;
PFNWGLGETSYNCVALUESOMLPROC glad_wglGetSyncValuesOML = NULL;
PFNWGLGETVIDEODEVICENVPROC glad_wglGetVideoDeviceNV = NULL;
PFNWGLGETVIDEOINFONVPROC glad_wglGetVideoInfoNV = NULL;
PFNWGLISENABLEDFRAMELOCKI3DPROC glad_wglIsEnabledFrameLockI3D = NULL;
PFNWGLISENABLEDGENLOCKI3DPROC glad_wglIsEnabledGenlockI3D = NULL;
PFNWGLJOINSWAPGROUPNVPROC glad_wglJoinSwapGroupNV = NULL;
PFNWGLLOADDISPLAYCOLORTABLEEXTPROC glad_wglLoadDisplayColorTableEXT = NULL;
PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC glad_wglLockVideoCaptureDeviceNV = NULL;
PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC glad_wglMakeAssociatedContextCurrentAMD = NULL;
PFNWGLMAKECONTEXTCURRENTARBPROC glad_wglMakeContextCurrentARB = NULL;
PFNWGLMAKECONTEXTCURRENTEXTPROC glad_wglMakeContextCurrentEXT = NULL;
PFNWGLQUERYCURRENTCONTEXTNVPROC glad_wglQueryCurrentContextNV = NULL;
PFNWGLQUERYFRAMECOUNTNVPROC glad_wglQueryFrameCountNV = NULL;
PFNWGLQUERYFRAMELOCKMASTERI3DPROC glad_wglQueryFrameLockMasterI3D = NULL;
PFNWGLQUERYFRAMETRACKINGI3DPROC glad_wglQueryFrameTrackingI3D = NULL;
PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC glad_wglQueryGenlockMaxSourceDelayI3D = NULL;
PFNWGLQUERYMAXSWAPGROUPSNVPROC glad_wglQueryMaxSwapGroupsNV = NULL;
PFNWGLQUERYPBUFFERARBPROC glad_wglQueryPbufferARB = NULL;
PFNWGLQUERYPBUFFEREXTPROC glad_wglQueryPbufferEXT = NULL;
PFNWGLQUERYSWAPGROUPNVPROC glad_wglQuerySwapGroupNV = NULL;
PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC glad_wglQueryVideoCaptureDeviceNV = NULL;
PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC glad_wglReleaseImageBufferEventsI3D = NULL;
PFNWGLRELEASEPBUFFERDCARBPROC glad_wglReleasePbufferDCARB = NULL;
PFNWGLRELEASEPBUFFERDCEXTPROC glad_wglReleasePbufferDCEXT = NULL;
PFNWGLRELEASETEXIMAGEARBPROC glad_wglReleaseTexImageARB = NULL;
PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC glad_wglReleaseVideoCaptureDeviceNV = NULL;
PFNWGLRELEASEVIDEODEVICENVPROC glad_wglReleaseVideoDeviceNV = NULL;
PFNWGLRELEASEVIDEOIMAGENVPROC glad_wglReleaseVideoImageNV = NULL;
PFNWGLRESETFRAMECOUNTNVPROC glad_wglResetFrameCountNV = NULL;
PFNWGLRESTOREBUFFERREGIONARBPROC glad_wglRestoreBufferRegionARB = NULL;
PFNWGLSAVEBUFFERREGIONARBPROC glad_wglSaveBufferRegionARB = NULL;
PFNWGLSENDPBUFFERTOVIDEONVPROC glad_wglSendPbufferToVideoNV = NULL;
PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC glad_wglSetDigitalVideoParametersI3D = NULL;
PFNWGLSETGAMMATABLEI3DPROC glad_wglSetGammaTableI3D = NULL;
PFNWGLSETGAMMATABLEPARAMETERSI3DPROC glad_wglSetGammaTableParametersI3D = NULL;
PFNWGLSETPBUFFERATTRIBARBPROC glad_wglSetPbufferAttribARB = NULL;
PFNWGLSETSTEREOEMITTERSTATE3DLPROC glad_wglSetStereoEmitterState3DL = NULL;
PFNWGLSWAPBUFFERSMSCOMLPROC glad_wglSwapBuffersMscOML = NULL;
PFNWGLSWAPINTERVALEXTPROC glad_wglSwapIntervalEXT = NULL;
PFNWGLSWAPLAYERBUFFERSMSCOMLPROC glad_wglSwapLayerBuffersMscOML = NULL;
PFNWGLWAITFORMSCOMLPROC glad_wglWaitForMscOML = NULL;
PFNWGLWAITFORSBCOMLPROC glad_wglWaitForSbcOML = NULL;
static void glad_wgl_load_WGL_3DL_stereo_control(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_3DL_stereo_control) return;
glad_wglSetStereoEmitterState3DL = (PFNWGLSETSTEREOEMITTERSTATE3DLPROC)load(userptr, "wglSetStereoEmitterState3DL");
}
static void glad_wgl_load_WGL_AMD_gpu_association(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_AMD_gpu_association) return;
glad_wglBlitContextFramebufferAMD = (PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)load(userptr, "wglBlitContextFramebufferAMD");
glad_wglCreateAssociatedContextAMD = (PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)load(userptr, "wglCreateAssociatedContextAMD");
glad_wglCreateAssociatedContextAttribsAMD = (PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)load(userptr, "wglCreateAssociatedContextAttribsAMD");
glad_wglDeleteAssociatedContextAMD = (PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)load(userptr, "wglDeleteAssociatedContextAMD");
glad_wglGetContextGPUIDAMD = (PFNWGLGETCONTEXTGPUIDAMDPROC)load(userptr, "wglGetContextGPUIDAMD");
glad_wglGetCurrentAssociatedContextAMD = (PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)load(userptr, "wglGetCurrentAssociatedContextAMD");
glad_wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)load(userptr, "wglGetGPUIDsAMD");
glad_wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)load(userptr, "wglGetGPUInfoAMD");
glad_wglMakeAssociatedContextCurrentAMD = (PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)load(userptr, "wglMakeAssociatedContextCurrentAMD");
}
static void glad_wgl_load_WGL_ARB_buffer_region(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_ARB_buffer_region) return;
glad_wglCreateBufferRegionARB = (PFNWGLCREATEBUFFERREGIONARBPROC)load(userptr, "wglCreateBufferRegionARB");
glad_wglDeleteBufferRegionARB = (PFNWGLDELETEBUFFERREGIONARBPROC)load(userptr, "wglDeleteBufferRegionARB");
glad_wglRestoreBufferRegionARB = (PFNWGLRESTOREBUFFERREGIONARBPROC)load(userptr, "wglRestoreBufferRegionARB");
glad_wglSaveBufferRegionARB = (PFNWGLSAVEBUFFERREGIONARBPROC)load(userptr, "wglSaveBufferRegionARB");
}
static void glad_wgl_load_WGL_ARB_create_context(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_ARB_create_context) return;
glad_wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)load(userptr, "wglCreateContextAttribsARB");
}
static void glad_wgl_load_WGL_ARB_extensions_string(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_ARB_extensions_string) return;
glad_wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)load(userptr, "wglGetExtensionsStringARB");
}
static void glad_wgl_load_WGL_ARB_make_current_read(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_ARB_make_current_read) return;
glad_wglGetCurrentReadDCARB = (PFNWGLGETCURRENTREADDCARBPROC)load(userptr, "wglGetCurrentReadDCARB");
glad_wglMakeContextCurrentARB = (PFNWGLMAKECONTEXTCURRENTARBPROC)load(userptr, "wglMakeContextCurrentARB");
}
static void glad_wgl_load_WGL_ARB_pbuffer(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_ARB_pbuffer) return;
glad_wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)load(userptr, "wglCreatePbufferARB");
glad_wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)load(userptr, "wglDestroyPbufferARB");
glad_wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)load(userptr, "wglGetPbufferDCARB");
glad_wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)load(userptr, "wglQueryPbufferARB");
glad_wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)load(userptr, "wglReleasePbufferDCARB");
}
static void glad_wgl_load_WGL_ARB_pixel_format(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_ARB_pixel_format) return;
glad_wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)load(userptr, "wglChoosePixelFormatARB");
glad_wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)load(userptr, "wglGetPixelFormatAttribfvARB");
glad_wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)load(userptr, "wglGetPixelFormatAttribivARB");
}
static void glad_wgl_load_WGL_ARB_render_texture(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_ARB_render_texture) return;
glad_wglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC)load(userptr, "wglBindTexImageARB");
glad_wglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC)load(userptr, "wglReleaseTexImageARB");
glad_wglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC)load(userptr, "wglSetPbufferAttribARB");
}
static void glad_wgl_load_WGL_EXT_display_color_table(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_EXT_display_color_table) return;
glad_wglBindDisplayColorTableEXT = (PFNWGLBINDDISPLAYCOLORTABLEEXTPROC)load(userptr, "wglBindDisplayColorTableEXT");
glad_wglCreateDisplayColorTableEXT = (PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC)load(userptr, "wglCreateDisplayColorTableEXT");
glad_wglDestroyDisplayColorTableEXT = (PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC)load(userptr, "wglDestroyDisplayColorTableEXT");
glad_wglLoadDisplayColorTableEXT = (PFNWGLLOADDISPLAYCOLORTABLEEXTPROC)load(userptr, "wglLoadDisplayColorTableEXT");
}
static void glad_wgl_load_WGL_EXT_extensions_string(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_EXT_extensions_string) return;
glad_wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)load(userptr, "wglGetExtensionsStringEXT");
}
static void glad_wgl_load_WGL_EXT_make_current_read(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_EXT_make_current_read) return;
glad_wglGetCurrentReadDCEXT = (PFNWGLGETCURRENTREADDCEXTPROC)load(userptr, "wglGetCurrentReadDCEXT");
glad_wglMakeContextCurrentEXT = (PFNWGLMAKECONTEXTCURRENTEXTPROC)load(userptr, "wglMakeContextCurrentEXT");
}
static void glad_wgl_load_WGL_EXT_pbuffer(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_EXT_pbuffer) return;
glad_wglCreatePbufferEXT = (PFNWGLCREATEPBUFFEREXTPROC)load(userptr, "wglCreatePbufferEXT");
glad_wglDestroyPbufferEXT = (PFNWGLDESTROYPBUFFEREXTPROC)load(userptr, "wglDestroyPbufferEXT");
glad_wglGetPbufferDCEXT = (PFNWGLGETPBUFFERDCEXTPROC)load(userptr, "wglGetPbufferDCEXT");
glad_wglQueryPbufferEXT = (PFNWGLQUERYPBUFFEREXTPROC)load(userptr, "wglQueryPbufferEXT");
glad_wglReleasePbufferDCEXT = (PFNWGLRELEASEPBUFFERDCEXTPROC)load(userptr, "wglReleasePbufferDCEXT");
}
static void glad_wgl_load_WGL_EXT_pixel_format(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_EXT_pixel_format) return;
glad_wglChoosePixelFormatEXT = (PFNWGLCHOOSEPIXELFORMATEXTPROC)load(userptr, "wglChoosePixelFormatEXT");
glad_wglGetPixelFormatAttribfvEXT = (PFNWGLGETPIXELFORMATATTRIBFVEXTPROC)load(userptr, "wglGetPixelFormatAttribfvEXT");
glad_wglGetPixelFormatAttribivEXT = (PFNWGLGETPIXELFORMATATTRIBIVEXTPROC)load(userptr, "wglGetPixelFormatAttribivEXT");
}
static void glad_wgl_load_WGL_EXT_swap_control(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_EXT_swap_control) return;
glad_wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)load(userptr, "wglGetSwapIntervalEXT");
glad_wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)load(userptr, "wglSwapIntervalEXT");
}
static void glad_wgl_load_WGL_I3D_digital_video_control(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_I3D_digital_video_control) return;
glad_wglGetDigitalVideoParametersI3D = (PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC)load(userptr, "wglGetDigitalVideoParametersI3D");
glad_wglSetDigitalVideoParametersI3D = (PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC)load(userptr, "wglSetDigitalVideoParametersI3D");
}
static void glad_wgl_load_WGL_I3D_gamma(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_I3D_gamma) return;
glad_wglGetGammaTableI3D = (PFNWGLGETGAMMATABLEI3DPROC)load(userptr, "wglGetGammaTableI3D");
glad_wglGetGammaTableParametersI3D = (PFNWGLGETGAMMATABLEPARAMETERSI3DPROC)load(userptr, "wglGetGammaTableParametersI3D");
glad_wglSetGammaTableI3D = (PFNWGLSETGAMMATABLEI3DPROC)load(userptr, "wglSetGammaTableI3D");
glad_wglSetGammaTableParametersI3D = (PFNWGLSETGAMMATABLEPARAMETERSI3DPROC)load(userptr, "wglSetGammaTableParametersI3D");
}
static void glad_wgl_load_WGL_I3D_genlock(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_I3D_genlock) return;
glad_wglDisableGenlockI3D = (PFNWGLDISABLEGENLOCKI3DPROC)load(userptr, "wglDisableGenlockI3D");
glad_wglEnableGenlockI3D = (PFNWGLENABLEGENLOCKI3DPROC)load(userptr, "wglEnableGenlockI3D");
glad_wglGenlockSampleRateI3D = (PFNWGLGENLOCKSAMPLERATEI3DPROC)load(userptr, "wglGenlockSampleRateI3D");
glad_wglGenlockSourceDelayI3D = (PFNWGLGENLOCKSOURCEDELAYI3DPROC)load(userptr, "wglGenlockSourceDelayI3D");
glad_wglGenlockSourceEdgeI3D = (PFNWGLGENLOCKSOURCEEDGEI3DPROC)load(userptr, "wglGenlockSourceEdgeI3D");
glad_wglGenlockSourceI3D = (PFNWGLGENLOCKSOURCEI3DPROC)load(userptr, "wglGenlockSourceI3D");
glad_wglGetGenlockSampleRateI3D = (PFNWGLGETGENLOCKSAMPLERATEI3DPROC)load(userptr, "wglGetGenlockSampleRateI3D");
glad_wglGetGenlockSourceDelayI3D = (PFNWGLGETGENLOCKSOURCEDELAYI3DPROC)load(userptr, "wglGetGenlockSourceDelayI3D");
glad_wglGetGenlockSourceEdgeI3D = (PFNWGLGETGENLOCKSOURCEEDGEI3DPROC)load(userptr, "wglGetGenlockSourceEdgeI3D");
glad_wglGetGenlockSourceI3D = (PFNWGLGETGENLOCKSOURCEI3DPROC)load(userptr, "wglGetGenlockSourceI3D");
glad_wglIsEnabledGenlockI3D = (PFNWGLISENABLEDGENLOCKI3DPROC)load(userptr, "wglIsEnabledGenlockI3D");
glad_wglQueryGenlockMaxSourceDelayI3D = (PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC)load(userptr, "wglQueryGenlockMaxSourceDelayI3D");
}
static void glad_wgl_load_WGL_I3D_image_buffer(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_I3D_image_buffer) return;
glad_wglAssociateImageBufferEventsI3D = (PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC)load(userptr, "wglAssociateImageBufferEventsI3D");
glad_wglCreateImageBufferI3D = (PFNWGLCREATEIMAGEBUFFERI3DPROC)load(userptr, "wglCreateImageBufferI3D");
glad_wglDestroyImageBufferI3D = (PFNWGLDESTROYIMAGEBUFFERI3DPROC)load(userptr, "wglDestroyImageBufferI3D");
glad_wglReleaseImageBufferEventsI3D = (PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC)load(userptr, "wglReleaseImageBufferEventsI3D");
}
static void glad_wgl_load_WGL_I3D_swap_frame_lock(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_I3D_swap_frame_lock) return;
glad_wglDisableFrameLockI3D = (PFNWGLDISABLEFRAMELOCKI3DPROC)load(userptr, "wglDisableFrameLockI3D");
glad_wglEnableFrameLockI3D = (PFNWGLENABLEFRAMELOCKI3DPROC)load(userptr, "wglEnableFrameLockI3D");
glad_wglIsEnabledFrameLockI3D = (PFNWGLISENABLEDFRAMELOCKI3DPROC)load(userptr, "wglIsEnabledFrameLockI3D");
glad_wglQueryFrameLockMasterI3D = (PFNWGLQUERYFRAMELOCKMASTERI3DPROC)load(userptr, "wglQueryFrameLockMasterI3D");
}
static void glad_wgl_load_WGL_I3D_swap_frame_usage(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_I3D_swap_frame_usage) return;
glad_wglBeginFrameTrackingI3D = (PFNWGLBEGINFRAMETRACKINGI3DPROC)load(userptr, "wglBeginFrameTrackingI3D");
glad_wglEndFrameTrackingI3D = (PFNWGLENDFRAMETRACKINGI3DPROC)load(userptr, "wglEndFrameTrackingI3D");
glad_wglGetFrameUsageI3D = (PFNWGLGETFRAMEUSAGEI3DPROC)load(userptr, "wglGetFrameUsageI3D");
glad_wglQueryFrameTrackingI3D = (PFNWGLQUERYFRAMETRACKINGI3DPROC)load(userptr, "wglQueryFrameTrackingI3D");
}
static void glad_wgl_load_WGL_NV_DX_interop(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_NV_DX_interop) return;
glad_wglDXCloseDeviceNV = (PFNWGLDXCLOSEDEVICENVPROC)load(userptr, "wglDXCloseDeviceNV");
glad_wglDXLockObjectsNV = (PFNWGLDXLOCKOBJECTSNVPROC)load(userptr, "wglDXLockObjectsNV");
glad_wglDXObjectAccessNV = (PFNWGLDXOBJECTACCESSNVPROC)load(userptr, "wglDXObjectAccessNV");
glad_wglDXOpenDeviceNV = (PFNWGLDXOPENDEVICENVPROC)load(userptr, "wglDXOpenDeviceNV");
glad_wglDXRegisterObjectNV = (PFNWGLDXREGISTEROBJECTNVPROC)load(userptr, "wglDXRegisterObjectNV");
glad_wglDXSetResourceShareHandleNV = (PFNWGLDXSETRESOURCESHAREHANDLENVPROC)load(userptr, "wglDXSetResourceShareHandleNV");
glad_wglDXUnlockObjectsNV = (PFNWGLDXUNLOCKOBJECTSNVPROC)load(userptr, "wglDXUnlockObjectsNV");
glad_wglDXUnregisterObjectNV = (PFNWGLDXUNREGISTEROBJECTNVPROC)load(userptr, "wglDXUnregisterObjectNV");
}
static void glad_wgl_load_WGL_NV_copy_image(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_NV_copy_image) return;
glad_wglCopyImageSubDataNV = (PFNWGLCOPYIMAGESUBDATANVPROC)load(userptr, "wglCopyImageSubDataNV");
}
static void glad_wgl_load_WGL_NV_delay_before_swap(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_NV_delay_before_swap) return;
glad_wglDelayBeforeSwapNV = (PFNWGLDELAYBEFORESWAPNVPROC)load(userptr, "wglDelayBeforeSwapNV");
}
static void glad_wgl_load_WGL_NV_gpu_affinity(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_NV_gpu_affinity) return;
glad_wglCreateAffinityDCNV = (PFNWGLCREATEAFFINITYDCNVPROC)load(userptr, "wglCreateAffinityDCNV");
glad_wglDeleteDCNV = (PFNWGLDELETEDCNVPROC)load(userptr, "wglDeleteDCNV");
glad_wglEnumGpuDevicesNV = (PFNWGLENUMGPUDEVICESNVPROC)load(userptr, "wglEnumGpuDevicesNV");
glad_wglEnumGpusFromAffinityDCNV = (PFNWGLENUMGPUSFROMAFFINITYDCNVPROC)load(userptr, "wglEnumGpusFromAffinityDCNV");
glad_wglEnumGpusNV = (PFNWGLENUMGPUSNVPROC)load(userptr, "wglEnumGpusNV");
}
static void glad_wgl_load_WGL_NV_present_video(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_NV_present_video) return;
glad_wglBindVideoDeviceNV = (PFNWGLBINDVIDEODEVICENVPROC)load(userptr, "wglBindVideoDeviceNV");
glad_wglEnumerateVideoDevicesNV = (PFNWGLENUMERATEVIDEODEVICESNVPROC)load(userptr, "wglEnumerateVideoDevicesNV");
glad_wglQueryCurrentContextNV = (PFNWGLQUERYCURRENTCONTEXTNVPROC)load(userptr, "wglQueryCurrentContextNV");
}
static void glad_wgl_load_WGL_NV_swap_group(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_NV_swap_group) return;
glad_wglBindSwapBarrierNV = (PFNWGLBINDSWAPBARRIERNVPROC)load(userptr, "wglBindSwapBarrierNV");
glad_wglJoinSwapGroupNV = (PFNWGLJOINSWAPGROUPNVPROC)load(userptr, "wglJoinSwapGroupNV");
glad_wglQueryFrameCountNV = (PFNWGLQUERYFRAMECOUNTNVPROC)load(userptr, "wglQueryFrameCountNV");
glad_wglQueryMaxSwapGroupsNV = (PFNWGLQUERYMAXSWAPGROUPSNVPROC)load(userptr, "wglQueryMaxSwapGroupsNV");
glad_wglQuerySwapGroupNV = (PFNWGLQUERYSWAPGROUPNVPROC)load(userptr, "wglQuerySwapGroupNV");
glad_wglResetFrameCountNV = (PFNWGLRESETFRAMECOUNTNVPROC)load(userptr, "wglResetFrameCountNV");
}
static void glad_wgl_load_WGL_NV_vertex_array_range(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_NV_vertex_array_range) return;
glad_wglAllocateMemoryNV = (PFNWGLALLOCATEMEMORYNVPROC)load(userptr, "wglAllocateMemoryNV");
glad_wglFreeMemoryNV = (PFNWGLFREEMEMORYNVPROC)load(userptr, "wglFreeMemoryNV");
}
static void glad_wgl_load_WGL_NV_video_capture(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_NV_video_capture) return;
glad_wglBindVideoCaptureDeviceNV = (PFNWGLBINDVIDEOCAPTUREDEVICENVPROC)load(userptr, "wglBindVideoCaptureDeviceNV");
glad_wglEnumerateVideoCaptureDevicesNV = (PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC)load(userptr, "wglEnumerateVideoCaptureDevicesNV");
glad_wglLockVideoCaptureDeviceNV = (PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC)load(userptr, "wglLockVideoCaptureDeviceNV");
glad_wglQueryVideoCaptureDeviceNV = (PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC)load(userptr, "wglQueryVideoCaptureDeviceNV");
glad_wglReleaseVideoCaptureDeviceNV = (PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC)load(userptr, "wglReleaseVideoCaptureDeviceNV");
}
static void glad_wgl_load_WGL_NV_video_output(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_NV_video_output) return;
glad_wglBindVideoImageNV = (PFNWGLBINDVIDEOIMAGENVPROC)load(userptr, "wglBindVideoImageNV");
glad_wglGetVideoDeviceNV = (PFNWGLGETVIDEODEVICENVPROC)load(userptr, "wglGetVideoDeviceNV");
glad_wglGetVideoInfoNV = (PFNWGLGETVIDEOINFONVPROC)load(userptr, "wglGetVideoInfoNV");
glad_wglReleaseVideoDeviceNV = (PFNWGLRELEASEVIDEODEVICENVPROC)load(userptr, "wglReleaseVideoDeviceNV");
glad_wglReleaseVideoImageNV = (PFNWGLRELEASEVIDEOIMAGENVPROC)load(userptr, "wglReleaseVideoImageNV");
glad_wglSendPbufferToVideoNV = (PFNWGLSENDPBUFFERTOVIDEONVPROC)load(userptr, "wglSendPbufferToVideoNV");
}
static void glad_wgl_load_WGL_OML_sync_control(GLADuserptrloadfunc load, void* userptr) {
if (!GLAD_WGL_OML_sync_control) return;
glad_wglGetMscRateOML = (PFNWGLGETMSCRATEOMLPROC)load(userptr, "wglGetMscRateOML");
glad_wglGetSyncValuesOML = (PFNWGLGETSYNCVALUESOMLPROC)load(userptr, "wglGetSyncValuesOML");
glad_wglSwapBuffersMscOML = (PFNWGLSWAPBUFFERSMSCOMLPROC)load(userptr, "wglSwapBuffersMscOML");
glad_wglSwapLayerBuffersMscOML = (PFNWGLSWAPLAYERBUFFERSMSCOMLPROC)load(userptr, "wglSwapLayerBuffersMscOML");
glad_wglWaitForMscOML = (PFNWGLWAITFORMSCOMLPROC)load(userptr, "wglWaitForMscOML");
glad_wglWaitForSbcOML = (PFNWGLWAITFORSBCOMLPROC)load(userptr, "wglWaitForSbcOML");
}
static int glad_wgl_has_extension(HDC hdc, const char* ext) {
const char* terminator;
const char* loc;
const char* extensions;
if (wglGetExtensionsStringEXT == NULL && wglGetExtensionsStringARB == NULL)
return 0;
if (wglGetExtensionsStringARB == NULL || hdc == INVALID_HANDLE_VALUE)
extensions = wglGetExtensionsStringEXT();
else
extensions = wglGetExtensionsStringARB(hdc);
if (extensions == NULL || ext == NULL)
return 0;
while (1) {
loc = strstr(extensions, ext);
if (loc == NULL)
break;
terminator = loc + strlen(ext);
if ((loc == extensions || *(loc - 1) == ' ') &&
(*terminator == ' ' || *terminator == '\0'))
{
return 1;
}
extensions = terminator;
}
return 0;
}
static GLADapiproc glad_wgl_get_proc_from_userptr(void* userptr, const char* name) {
return (GLAD_GNUC_EXTENSION(GLADapiproc(*)(const char* name)) userptr)(name);
}
static int glad_wgl_find_extensions_wgl(HDC hdc) {
GLAD_WGL_3DFX_multisample = glad_wgl_has_extension(hdc, "WGL_3DFX_multisample");
GLAD_WGL_3DL_stereo_control = glad_wgl_has_extension(hdc, "WGL_3DL_stereo_control");
GLAD_WGL_AMD_gpu_association = glad_wgl_has_extension(hdc, "WGL_AMD_gpu_association");
GLAD_WGL_ARB_buffer_region = glad_wgl_has_extension(hdc, "WGL_ARB_buffer_region");
GLAD_WGL_ARB_context_flush_control = glad_wgl_has_extension(hdc, "WGL_ARB_context_flush_control");
GLAD_WGL_ARB_create_context = glad_wgl_has_extension(hdc, "WGL_ARB_create_context");
GLAD_WGL_ARB_create_context_no_error = glad_wgl_has_extension(hdc, "WGL_ARB_create_context_no_error");
GLAD_WGL_ARB_create_context_profile = glad_wgl_has_extension(hdc, "WGL_ARB_create_context_profile");
GLAD_WGL_ARB_create_context_robustness = glad_wgl_has_extension(hdc, "WGL_ARB_create_context_robustness");
GLAD_WGL_ARB_extensions_string = glad_wgl_has_extension(hdc, "WGL_ARB_extensions_string");
GLAD_WGL_ARB_framebuffer_sRGB = glad_wgl_has_extension(hdc, "WGL_ARB_framebuffer_sRGB");
GLAD_WGL_ARB_make_current_read = glad_wgl_has_extension(hdc, "WGL_ARB_make_current_read");
GLAD_WGL_ARB_multisample = glad_wgl_has_extension(hdc, "WGL_ARB_multisample");
GLAD_WGL_ARB_pbuffer = glad_wgl_has_extension(hdc, "WGL_ARB_pbuffer");
GLAD_WGL_ARB_pixel_format = glad_wgl_has_extension(hdc, "WGL_ARB_pixel_format");
GLAD_WGL_ARB_pixel_format_float = glad_wgl_has_extension(hdc, "WGL_ARB_pixel_format_float");
GLAD_WGL_ARB_render_texture = glad_wgl_has_extension(hdc, "WGL_ARB_render_texture");
GLAD_WGL_ARB_robustness_application_isolation = glad_wgl_has_extension(hdc, "WGL_ARB_robustness_application_isolation");
GLAD_WGL_ARB_robustness_share_group_isolation = glad_wgl_has_extension(hdc, "WGL_ARB_robustness_share_group_isolation");
GLAD_WGL_ATI_pixel_format_float = glad_wgl_has_extension(hdc, "WGL_ATI_pixel_format_float");
GLAD_WGL_ATI_render_texture_rectangle = glad_wgl_has_extension(hdc, "WGL_ATI_render_texture_rectangle");
GLAD_WGL_EXT_colorspace = glad_wgl_has_extension(hdc, "WGL_EXT_colorspace");
GLAD_WGL_EXT_create_context_es2_profile = glad_wgl_has_extension(hdc, "WGL_EXT_create_context_es2_profile");
GLAD_WGL_EXT_create_context_es_profile = glad_wgl_has_extension(hdc, "WGL_EXT_create_context_es_profile");
GLAD_WGL_EXT_depth_float = glad_wgl_has_extension(hdc, "WGL_EXT_depth_float");
GLAD_WGL_EXT_display_color_table = glad_wgl_has_extension(hdc, "WGL_EXT_display_color_table");
GLAD_WGL_EXT_extensions_string = glad_wgl_has_extension(hdc, "WGL_EXT_extensions_string");
GLAD_WGL_EXT_framebuffer_sRGB = glad_wgl_has_extension(hdc, "WGL_EXT_framebuffer_sRGB");
GLAD_WGL_EXT_make_current_read = glad_wgl_has_extension(hdc, "WGL_EXT_make_current_read");
GLAD_WGL_EXT_multisample = glad_wgl_has_extension(hdc, "WGL_EXT_multisample");
GLAD_WGL_EXT_pbuffer = glad_wgl_has_extension(hdc, "WGL_EXT_pbuffer");
GLAD_WGL_EXT_pixel_format = glad_wgl_has_extension(hdc, "WGL_EXT_pixel_format");
GLAD_WGL_EXT_pixel_format_packed_float = glad_wgl_has_extension(hdc, "WGL_EXT_pixel_format_packed_float");
GLAD_WGL_EXT_swap_control = glad_wgl_has_extension(hdc, "WGL_EXT_swap_control");
GLAD_WGL_EXT_swap_control_tear = glad_wgl_has_extension(hdc, "WGL_EXT_swap_control_tear");
GLAD_WGL_I3D_digital_video_control = glad_wgl_has_extension(hdc, "WGL_I3D_digital_video_control");
GLAD_WGL_I3D_gamma = glad_wgl_has_extension(hdc, "WGL_I3D_gamma");
GLAD_WGL_I3D_genlock = glad_wgl_has_extension(hdc, "WGL_I3D_genlock");
GLAD_WGL_I3D_image_buffer = glad_wgl_has_extension(hdc, "WGL_I3D_image_buffer");
GLAD_WGL_I3D_swap_frame_lock = glad_wgl_has_extension(hdc, "WGL_I3D_swap_frame_lock");
GLAD_WGL_I3D_swap_frame_usage = glad_wgl_has_extension(hdc, "WGL_I3D_swap_frame_usage");
GLAD_WGL_NV_DX_interop = glad_wgl_has_extension(hdc, "WGL_NV_DX_interop");
GLAD_WGL_NV_DX_interop2 = glad_wgl_has_extension(hdc, "WGL_NV_DX_interop2");
GLAD_WGL_NV_copy_image = glad_wgl_has_extension(hdc, "WGL_NV_copy_image");
GLAD_WGL_NV_delay_before_swap = glad_wgl_has_extension(hdc, "WGL_NV_delay_before_swap");
GLAD_WGL_NV_float_buffer = glad_wgl_has_extension(hdc, "WGL_NV_float_buffer");
GLAD_WGL_NV_gpu_affinity = glad_wgl_has_extension(hdc, "WGL_NV_gpu_affinity");
GLAD_WGL_NV_multigpu_context = glad_wgl_has_extension(hdc, "WGL_NV_multigpu_context");
GLAD_WGL_NV_multisample_coverage = glad_wgl_has_extension(hdc, "WGL_NV_multisample_coverage");
GLAD_WGL_NV_present_video = glad_wgl_has_extension(hdc, "WGL_NV_present_video");
GLAD_WGL_NV_render_depth_texture = glad_wgl_has_extension(hdc, "WGL_NV_render_depth_texture");
GLAD_WGL_NV_render_texture_rectangle = glad_wgl_has_extension(hdc, "WGL_NV_render_texture_rectangle");
GLAD_WGL_NV_swap_group = glad_wgl_has_extension(hdc, "WGL_NV_swap_group");
GLAD_WGL_NV_vertex_array_range = glad_wgl_has_extension(hdc, "WGL_NV_vertex_array_range");
GLAD_WGL_NV_video_capture = glad_wgl_has_extension(hdc, "WGL_NV_video_capture");
GLAD_WGL_NV_video_output = glad_wgl_has_extension(hdc, "WGL_NV_video_output");
GLAD_WGL_OML_sync_control = glad_wgl_has_extension(hdc, "WGL_OML_sync_control");
return 1;
}
static int glad_wgl_find_core_wgl(void) {
int major = 1, minor = 0;
GLAD_WGL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
return GLAD_MAKE_VERSION(major, minor);
}
int gladLoadWGLUserPtr(HDC hdc, GLADuserptrloadfunc load, void* userptr) {
int version;
wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)load(userptr, "wglGetExtensionsStringARB");
wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)load(userptr, "wglGetExtensionsStringEXT");
if (wglGetExtensionsStringARB == NULL && wglGetExtensionsStringEXT == NULL) return 0;
version = glad_wgl_find_core_wgl();
if (!glad_wgl_find_extensions_wgl(hdc)) return 0;
glad_wgl_load_WGL_3DL_stereo_control(load, userptr);
glad_wgl_load_WGL_AMD_gpu_association(load, userptr);
glad_wgl_load_WGL_ARB_buffer_region(load, userptr);
glad_wgl_load_WGL_ARB_create_context(load, userptr);
glad_wgl_load_WGL_ARB_extensions_string(load, userptr);
glad_wgl_load_WGL_ARB_make_current_read(load, userptr);
glad_wgl_load_WGL_ARB_pbuffer(load, userptr);
glad_wgl_load_WGL_ARB_pixel_format(load, userptr);
glad_wgl_load_WGL_ARB_render_texture(load, userptr);
glad_wgl_load_WGL_EXT_display_color_table(load, userptr);
glad_wgl_load_WGL_EXT_extensions_string(load, userptr);
glad_wgl_load_WGL_EXT_make_current_read(load, userptr);
glad_wgl_load_WGL_EXT_pbuffer(load, userptr);
glad_wgl_load_WGL_EXT_pixel_format(load, userptr);
glad_wgl_load_WGL_EXT_swap_control(load, userptr);
glad_wgl_load_WGL_I3D_digital_video_control(load, userptr);
glad_wgl_load_WGL_I3D_gamma(load, userptr);
glad_wgl_load_WGL_I3D_genlock(load, userptr);
glad_wgl_load_WGL_I3D_image_buffer(load, userptr);
glad_wgl_load_WGL_I3D_swap_frame_lock(load, userptr);
glad_wgl_load_WGL_I3D_swap_frame_usage(load, userptr);
glad_wgl_load_WGL_NV_DX_interop(load, userptr);
glad_wgl_load_WGL_NV_copy_image(load, userptr);
glad_wgl_load_WGL_NV_delay_before_swap(load, userptr);
glad_wgl_load_WGL_NV_gpu_affinity(load, userptr);
glad_wgl_load_WGL_NV_present_video(load, userptr);
glad_wgl_load_WGL_NV_swap_group(load, userptr);
glad_wgl_load_WGL_NV_vertex_array_range(load, userptr);
glad_wgl_load_WGL_NV_video_capture(load, userptr);
glad_wgl_load_WGL_NV_video_output(load, userptr);
glad_wgl_load_WGL_OML_sync_control(load, userptr);
return version;
}
int gladLoadWGL(HDC hdc, GLADloadfunc load) {
return gladLoadWGLUserPtr(hdc, glad_wgl_get_proc_from_userptr, GLAD_GNUC_EXTENSION(void*) load);
}
#ifdef __cplusplus
}
#endif
+981
View File
@@ -0,0 +1,981 @@
/**
* Loader generated by glad 2.0.5 on Fri Feb 16 00:51:03 2024
*
* SPDX-License-Identifier: (WTFPL OR CC0-1.0) AND Apache-2.0
*
* Generator: C/C++
* Specification: wgl
* Extensions: 57
*
* APIs:
* - wgl=1.0
*
* Options:
* - ALIAS = False
* - DEBUG = False
* - HEADER_ONLY = False
* - LOADER = False
* - MX = True
* - ON_DEMAND = False
*
* Commandline:
* --api='wgl=1.0' --extensions='WGL_3DFX_multisample,WGL_3DL_stereo_control,WGL_AMD_gpu_association,WGL_ARB_buffer_region,WGL_ARB_context_flush_control,WGL_ARB_create_context,WGL_ARB_create_context_no_error,WGL_ARB_create_context_profile,WGL_ARB_create_context_robustness,WGL_ARB_extensions_string,WGL_ARB_framebuffer_sRGB,WGL_ARB_make_current_read,WGL_ARB_multisample,WGL_ARB_pbuffer,WGL_ARB_pixel_format,WGL_ARB_pixel_format_float,WGL_ARB_render_texture,WGL_ARB_robustness_application_isolation,WGL_ARB_robustness_share_group_isolation,WGL_ATI_pixel_format_float,WGL_ATI_render_texture_rectangle,WGL_EXT_colorspace,WGL_EXT_create_context_es2_profile,WGL_EXT_create_context_es_profile,WGL_EXT_depth_float,WGL_EXT_display_color_table,WGL_EXT_extensions_string,WGL_EXT_framebuffer_sRGB,WGL_EXT_make_current_read,WGL_EXT_multisample,WGL_EXT_pbuffer,WGL_EXT_pixel_format,WGL_EXT_pixel_format_packed_float,WGL_EXT_swap_control,WGL_EXT_swap_control_tear,WGL_I3D_digital_video_control,WGL_I3D_gamma,WGL_I3D_genlock,WGL_I3D_image_buffer,WGL_I3D_swap_frame_lock,WGL_I3D_swap_frame_usage,WGL_NV_DX_interop,WGL_NV_DX_interop2,WGL_NV_copy_image,WGL_NV_delay_before_swap,WGL_NV_float_buffer,WGL_NV_gpu_affinity,WGL_NV_multigpu_context,WGL_NV_multisample_coverage,WGL_NV_present_video,WGL_NV_render_depth_texture,WGL_NV_render_texture_rectangle,WGL_NV_swap_group,WGL_NV_vertex_array_range,WGL_NV_video_capture,WGL_NV_video_output,WGL_OML_sync_control' c --mx
*
* Online:
* http://glad.sh/#api=wgl%3D1.0&extensions=WGL_3DFX_multisample%2CWGL_3DL_stereo_control%2CWGL_AMD_gpu_association%2CWGL_ARB_buffer_region%2CWGL_ARB_context_flush_control%2CWGL_ARB_create_context%2CWGL_ARB_create_context_no_error%2CWGL_ARB_create_context_profile%2CWGL_ARB_create_context_robustness%2CWGL_ARB_extensions_string%2CWGL_ARB_framebuffer_sRGB%2CWGL_ARB_make_current_read%2CWGL_ARB_multisample%2CWGL_ARB_pbuffer%2CWGL_ARB_pixel_format%2CWGL_ARB_pixel_format_float%2CWGL_ARB_render_texture%2CWGL_ARB_robustness_application_isolation%2CWGL_ARB_robustness_share_group_isolation%2CWGL_ATI_pixel_format_float%2CWGL_ATI_render_texture_rectangle%2CWGL_EXT_colorspace%2CWGL_EXT_create_context_es2_profile%2CWGL_EXT_create_context_es_profile%2CWGL_EXT_depth_float%2CWGL_EXT_display_color_table%2CWGL_EXT_extensions_string%2CWGL_EXT_framebuffer_sRGB%2CWGL_EXT_make_current_read%2CWGL_EXT_multisample%2CWGL_EXT_pbuffer%2CWGL_EXT_pixel_format%2CWGL_EXT_pixel_format_packed_float%2CWGL_EXT_swap_control%2CWGL_EXT_swap_control_tear%2CWGL_I3D_digital_video_control%2CWGL_I3D_gamma%2CWGL_I3D_genlock%2CWGL_I3D_image_buffer%2CWGL_I3D_swap_frame_lock%2CWGL_I3D_swap_frame_usage%2CWGL_NV_DX_interop%2CWGL_NV_DX_interop2%2CWGL_NV_copy_image%2CWGL_NV_delay_before_swap%2CWGL_NV_float_buffer%2CWGL_NV_gpu_affinity%2CWGL_NV_multigpu_context%2CWGL_NV_multisample_coverage%2CWGL_NV_present_video%2CWGL_NV_render_depth_texture%2CWGL_NV_render_texture_rectangle%2CWGL_NV_swap_group%2CWGL_NV_vertex_array_range%2CWGL_NV_video_capture%2CWGL_NV_video_output%2CWGL_OML_sync_control&generator=c&options=MX
*
*/
#ifndef GLAD_WGL_H_
#define GLAD_WGL_H_
#include <windows.h>
#include "gl.h"
#define GLAD_WGL
#ifdef __cplusplus
extern "C" {
#endif
#ifndef GLAD_PLATFORM_H_
#define GLAD_PLATFORM_H_
#ifndef GLAD_PLATFORM_WIN32
#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)
#define GLAD_PLATFORM_WIN32 1
#else
#define GLAD_PLATFORM_WIN32 0
#endif
#endif
#ifndef GLAD_PLATFORM_APPLE
#ifdef __APPLE__
#define GLAD_PLATFORM_APPLE 1
#else
#define GLAD_PLATFORM_APPLE 0
#endif
#endif
#ifndef GLAD_PLATFORM_EMSCRIPTEN
#ifdef __EMSCRIPTEN__
#define GLAD_PLATFORM_EMSCRIPTEN 1
#else
#define GLAD_PLATFORM_EMSCRIPTEN 0
#endif
#endif
#ifndef GLAD_PLATFORM_UWP
#if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY)
#ifdef __has_include
#if __has_include(<winapifamily.h>)
#define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
#endif
#elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
#define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
#endif
#endif
#ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY
#include <winapifamily.h>
#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
#define GLAD_PLATFORM_UWP 1
#endif
#endif
#ifndef GLAD_PLATFORM_UWP
#define GLAD_PLATFORM_UWP 0
#endif
#endif
#ifdef __GNUC__
#define GLAD_GNUC_EXTENSION __extension__
#else
#define GLAD_GNUC_EXTENSION
#endif
#define GLAD_UNUSED(x) (void)(x)
#ifndef GLAD_API_CALL
#if defined(GLAD_API_CALL_EXPORT)
#if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__)
#if defined(GLAD_API_CALL_EXPORT_BUILD)
#if defined(__GNUC__)
#define GLAD_API_CALL __attribute__ ((dllexport)) extern
#else
#define GLAD_API_CALL __declspec(dllexport) extern
#endif
#else
#if defined(__GNUC__)
#define GLAD_API_CALL __attribute__ ((dllimport)) extern
#else
#define GLAD_API_CALL __declspec(dllimport) extern
#endif
#endif
#elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD)
#define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern
#else
#define GLAD_API_CALL extern
#endif
#else
#define GLAD_API_CALL extern
#endif
#endif
#ifdef APIENTRY
#define GLAD_API_PTR APIENTRY
#elif GLAD_PLATFORM_WIN32
#define GLAD_API_PTR __stdcall
#else
#define GLAD_API_PTR
#endif
#ifndef GLAPI
#define GLAPI GLAD_API_CALL
#endif
#ifndef GLAPIENTRY
#define GLAPIENTRY GLAD_API_PTR
#endif
#define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor)
#define GLAD_VERSION_MAJOR(version) (version / 10000)
#define GLAD_VERSION_MINOR(version) (version % 10000)
#define GLAD_GENERATOR_VERSION "2.0.5"
typedef void (*GLADapiproc)(void);
typedef GLADapiproc(*GLADloadfunc)(const char* name);
typedef GLADapiproc(*GLADuserptrloadfunc)(void* userptr, const char* name);
typedef void (*GLADprecallback)(const char* name, GLADapiproc apiproc, int len_args, ...);
typedef void (*GLADpostcallback)(void* ret, const char* name, GLADapiproc apiproc, int len_args, ...);
#endif /* GLAD_PLATFORM_H_ */
#define ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
#define ERROR_INVALID_PROFILE_ARB 0x2096
#define ERROR_INVALID_VERSION_ARB 0x2095
#define ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
#define WGL_ACCELERATION_ARB 0x2003
#define WGL_ACCELERATION_EXT 0x2003
#define WGL_ACCESS_READ_ONLY_NV 0x00000000
#define WGL_ACCESS_READ_WRITE_NV 0x00000001
#define WGL_ACCESS_WRITE_DISCARD_NV 0x00000002
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
#define WGL_ACCUM_BITS_ARB 0x201D
#define WGL_ACCUM_BITS_EXT 0x201D
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
#define WGL_ACCUM_RED_BITS_ARB 0x201E
#define WGL_ACCUM_RED_BITS_EXT 0x201E
#define WGL_ALPHA_BITS_ARB 0x201B
#define WGL_ALPHA_BITS_EXT 0x201B
#define WGL_ALPHA_SHIFT_ARB 0x201C
#define WGL_ALPHA_SHIFT_EXT 0x201C
#define WGL_AUX0_ARB 0x2087
#define WGL_AUX1_ARB 0x2088
#define WGL_AUX2_ARB 0x2089
#define WGL_AUX3_ARB 0x208A
#define WGL_AUX4_ARB 0x208B
#define WGL_AUX5_ARB 0x208C
#define WGL_AUX6_ARB 0x208D
#define WGL_AUX7_ARB 0x208E
#define WGL_AUX8_ARB 0x208F
#define WGL_AUX9_ARB 0x2090
#define WGL_AUX_BUFFERS_ARB 0x2024
#define WGL_AUX_BUFFERS_EXT 0x2024
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
#define WGL_BACK_LEFT_ARB 0x2085
#define WGL_BACK_RIGHT_ARB 0x2086
#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
#define WGL_BLUE_BITS_ARB 0x2019
#define WGL_BLUE_BITS_EXT 0x2019
#define WGL_BLUE_SHIFT_ARB 0x201A
#define WGL_BLUE_SHIFT_EXT 0x201A
#define WGL_COLORSPACE_EXT 0x309D
#define WGL_COLORSPACE_LINEAR_EXT 0x308A
#define WGL_COLORSPACE_SRGB_EXT 0x3089
#define WGL_COLOR_BITS_ARB 0x2014
#define WGL_COLOR_BITS_EXT 0x2014
#define WGL_COLOR_SAMPLES_NV 0x20B9
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004
#define WGL_CONTEXT_FLAGS_ARB 0x2094
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
#define WGL_CONTEXT_MULTIGPU_ATTRIB_AFR_NV 0x20AC
#define WGL_CONTEXT_MULTIGPU_ATTRIB_MULTICAST_NV 0x20AD
#define WGL_CONTEXT_MULTIGPU_ATTRIB_MULTI_DISPLAY_MULTICAST_NV 0x20AE
#define WGL_CONTEXT_MULTIGPU_ATTRIB_NV 0x20AA
#define WGL_CONTEXT_MULTIGPU_ATTRIB_SINGLE_NV 0x20AB
#define WGL_CONTEXT_OPENGL_NO_ERROR_ARB 0x31B3
#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097
#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098
#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0
#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
#define WGL_COVERAGE_SAMPLES_NV 0x2042
#define WGL_CUBE_MAP_FACE_ARB 0x207C
#define WGL_DEPTH_BITS_ARB 0x2022
#define WGL_DEPTH_BITS_EXT 0x2022
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
#define WGL_DEPTH_COMPONENT_NV 0x20A7
#define WGL_DEPTH_FLOAT_EXT 0x2040
#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
#define WGL_DOUBLE_BUFFER_ARB 0x2011
#define WGL_DOUBLE_BUFFER_EXT 0x2011
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
#define WGL_FLOAT_COMPONENTS_NV 0x20B0
#define WGL_FONT_LINES 0
#define WGL_FONT_POLYGONS 1
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
#define WGL_FRONT_LEFT_ARB 0x2083
#define WGL_FRONT_RIGHT_ARB 0x2084
#define WGL_FULL_ACCELERATION_ARB 0x2027
#define WGL_FULL_ACCELERATION_EXT 0x2027
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046
#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045
#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
#define WGL_GPU_CLOCK_AMD 0x21A4
#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
#define WGL_GPU_NUM_PIPES_AMD 0x21A5
#define WGL_GPU_NUM_RB_AMD 0x21A7
#define WGL_GPU_NUM_SIMD_AMD 0x21A6
#define WGL_GPU_NUM_SPI_AMD 0x21A8
#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
#define WGL_GPU_RAM_AMD 0x21A3
#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
#define WGL_GPU_VENDOR_AMD 0x1F00
#define WGL_GREEN_BITS_ARB 0x2017
#define WGL_GREEN_BITS_EXT 0x2017
#define WGL_GREEN_SHIFT_ARB 0x2018
#define WGL_GREEN_SHIFT_EXT 0x2018
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
#define WGL_MIPMAP_LEVEL_ARB 0x207B
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
#define WGL_NEED_PALETTE_ARB 0x2004
#define WGL_NEED_PALETTE_EXT 0x2004
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
#define WGL_NO_ACCELERATION_ARB 0x2025
#define WGL_NO_ACCELERATION_EXT 0x2025
#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
#define WGL_NO_TEXTURE_ARB 0x2077
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
#define WGL_PBUFFER_LARGEST_ARB 0x2033
#define WGL_PBUFFER_LARGEST_EXT 0x2033
#define WGL_PBUFFER_LOST_ARB 0x2036
#define WGL_PBUFFER_WIDTH_ARB 0x2034
#define WGL_PBUFFER_WIDTH_EXT 0x2034
#define WGL_PIXEL_TYPE_ARB 0x2013
#define WGL_PIXEL_TYPE_EXT 0x2013
#define WGL_RED_BITS_ARB 0x2015
#define WGL_RED_BITS_EXT 0x2015
#define WGL_RED_SHIFT_ARB 0x2016
#define WGL_RED_SHIFT_EXT 0x2016
#define WGL_SAMPLES_3DFX 0x2061
#define WGL_SAMPLES_ARB 0x2042
#define WGL_SAMPLES_EXT 0x2042
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
#define WGL_SHARE_ACCUM_ARB 0x200E
#define WGL_SHARE_ACCUM_EXT 0x200E
#define WGL_SHARE_DEPTH_ARB 0x200C
#define WGL_SHARE_DEPTH_EXT 0x200C
#define WGL_SHARE_STENCIL_ARB 0x200D
#define WGL_SHARE_STENCIL_EXT 0x200D
#define WGL_STENCIL_BITS_ARB 0x2023
#define WGL_STENCIL_BITS_EXT 0x2023
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
#define WGL_STEREO_ARB 0x2012
#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
#define WGL_STEREO_EXT 0x2012
#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
#define WGL_SUPPORT_GDI_ARB 0x200F
#define WGL_SUPPORT_GDI_EXT 0x200F
#define WGL_SUPPORT_OPENGL_ARB 0x2010
#define WGL_SUPPORT_OPENGL_EXT 0x2010
#define WGL_SWAP_COPY_ARB 0x2029
#define WGL_SWAP_COPY_EXT 0x2029
#define WGL_SWAP_EXCHANGE_ARB 0x2028
#define WGL_SWAP_EXCHANGE_EXT 0x2028
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
#define WGL_SWAP_MAIN_PLANE 0x00000001
#define WGL_SWAP_METHOD_ARB 0x2007
#define WGL_SWAP_METHOD_EXT 0x2007
#define WGL_SWAP_OVERLAY1 0x00000002
#define WGL_SWAP_OVERLAY10 0x00000400
#define WGL_SWAP_OVERLAY11 0x00000800
#define WGL_SWAP_OVERLAY12 0x00001000
#define WGL_SWAP_OVERLAY13 0x00002000
#define WGL_SWAP_OVERLAY14 0x00004000
#define WGL_SWAP_OVERLAY15 0x00008000
#define WGL_SWAP_OVERLAY2 0x00000004
#define WGL_SWAP_OVERLAY3 0x00000008
#define WGL_SWAP_OVERLAY4 0x00000010
#define WGL_SWAP_OVERLAY5 0x00000020
#define WGL_SWAP_OVERLAY6 0x00000040
#define WGL_SWAP_OVERLAY7 0x00000080
#define WGL_SWAP_OVERLAY8 0x00000100
#define WGL_SWAP_OVERLAY9 0x00000200
#define WGL_SWAP_UNDEFINED_ARB 0x202A
#define WGL_SWAP_UNDEFINED_EXT 0x202A
#define WGL_SWAP_UNDERLAY1 0x00010000
#define WGL_SWAP_UNDERLAY10 0x02000000
#define WGL_SWAP_UNDERLAY11 0x04000000
#define WGL_SWAP_UNDERLAY12 0x08000000
#define WGL_SWAP_UNDERLAY13 0x10000000
#define WGL_SWAP_UNDERLAY14 0x20000000
#define WGL_SWAP_UNDERLAY15 0x40000000
#define WGL_SWAP_UNDERLAY2 0x00020000
#define WGL_SWAP_UNDERLAY3 0x00040000
#define WGL_SWAP_UNDERLAY4 0x00080000
#define WGL_SWAP_UNDERLAY5 0x00100000
#define WGL_SWAP_UNDERLAY6 0x00200000
#define WGL_SWAP_UNDERLAY7 0x00400000
#define WGL_SWAP_UNDERLAY8 0x00800000
#define WGL_SWAP_UNDERLAY9 0x01000000
#define WGL_TEXTURE_1D_ARB 0x2079
#define WGL_TEXTURE_2D_ARB 0x207A
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
#define WGL_TEXTURE_FORMAT_ARB 0x2072
#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5
#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
#define WGL_TEXTURE_RGBA_ARB 0x2076
#define WGL_TEXTURE_RGB_ARB 0x2075
#define WGL_TEXTURE_TARGET_ARB 0x2073
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
#define WGL_TRANSPARENT_ARB 0x200A
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
#define WGL_TRANSPARENT_EXT 0x200A
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
#define WGL_TYPE_COLORINDEX_ARB 0x202C
#define WGL_TYPE_COLORINDEX_EXT 0x202C
#define WGL_TYPE_RGBA_ARB 0x202B
#define WGL_TYPE_RGBA_EXT 0x202B
#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
#define WGL_UNIQUE_ID_NV 0x20CE
#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
#define WGL_VIDEO_OUT_FIELD_1 0x20C9
#define WGL_VIDEO_OUT_FIELD_2 0x20CA
#define WGL_VIDEO_OUT_FRAME 0x20C8
#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
struct _GPU_DEVICE {
DWORD cb;
CHAR DeviceName[32];
CHAR DeviceString[128];
DWORD Flags;
RECT rcVirtualScreen;
};
DECLARE_HANDLE(HPBUFFERARB);
DECLARE_HANDLE(HPBUFFEREXT);
DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
DECLARE_HANDLE(HPVIDEODEV);
DECLARE_HANDLE(HPGPUNV);
DECLARE_HANDLE(HGPUNV);
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
typedef struct _GPU_DEVICE GPU_DEVICE;
typedef struct _GPU_DEVICE* PGPU_DEVICE;
#define WGL_VERSION_1_0 1
GLAD_API_CALL int GLAD_WGL_VERSION_1_0;
#define WGL_3DFX_multisample 1
GLAD_API_CALL int GLAD_WGL_3DFX_multisample;
#define WGL_3DL_stereo_control 1
GLAD_API_CALL int GLAD_WGL_3DL_stereo_control;
#define WGL_AMD_gpu_association 1
GLAD_API_CALL int GLAD_WGL_AMD_gpu_association;
#define WGL_ARB_buffer_region 1
GLAD_API_CALL int GLAD_WGL_ARB_buffer_region;
#define WGL_ARB_context_flush_control 1
GLAD_API_CALL int GLAD_WGL_ARB_context_flush_control;
#define WGL_ARB_create_context 1
GLAD_API_CALL int GLAD_WGL_ARB_create_context;
#define WGL_ARB_create_context_no_error 1
GLAD_API_CALL int GLAD_WGL_ARB_create_context_no_error;
#define WGL_ARB_create_context_profile 1
GLAD_API_CALL int GLAD_WGL_ARB_create_context_profile;
#define WGL_ARB_create_context_robustness 1
GLAD_API_CALL int GLAD_WGL_ARB_create_context_robustness;
#define WGL_ARB_extensions_string 1
GLAD_API_CALL int GLAD_WGL_ARB_extensions_string;
#define WGL_ARB_framebuffer_sRGB 1
GLAD_API_CALL int GLAD_WGL_ARB_framebuffer_sRGB;
#define WGL_ARB_make_current_read 1
GLAD_API_CALL int GLAD_WGL_ARB_make_current_read;
#define WGL_ARB_multisample 1
GLAD_API_CALL int GLAD_WGL_ARB_multisample;
#define WGL_ARB_pbuffer 1
GLAD_API_CALL int GLAD_WGL_ARB_pbuffer;
#define WGL_ARB_pixel_format 1
GLAD_API_CALL int GLAD_WGL_ARB_pixel_format;
#define WGL_ARB_pixel_format_float 1
GLAD_API_CALL int GLAD_WGL_ARB_pixel_format_float;
#define WGL_ARB_render_texture 1
GLAD_API_CALL int GLAD_WGL_ARB_render_texture;
#define WGL_ARB_robustness_application_isolation 1
GLAD_API_CALL int GLAD_WGL_ARB_robustness_application_isolation;
#define WGL_ARB_robustness_share_group_isolation 1
GLAD_API_CALL int GLAD_WGL_ARB_robustness_share_group_isolation;
#define WGL_ATI_pixel_format_float 1
GLAD_API_CALL int GLAD_WGL_ATI_pixel_format_float;
#define WGL_ATI_render_texture_rectangle 1
GLAD_API_CALL int GLAD_WGL_ATI_render_texture_rectangle;
#define WGL_EXT_colorspace 1
GLAD_API_CALL int GLAD_WGL_EXT_colorspace;
#define WGL_EXT_create_context_es2_profile 1
GLAD_API_CALL int GLAD_WGL_EXT_create_context_es2_profile;
#define WGL_EXT_create_context_es_profile 1
GLAD_API_CALL int GLAD_WGL_EXT_create_context_es_profile;
#define WGL_EXT_depth_float 1
GLAD_API_CALL int GLAD_WGL_EXT_depth_float;
#define WGL_EXT_display_color_table 1
GLAD_API_CALL int GLAD_WGL_EXT_display_color_table;
#define WGL_EXT_extensions_string 1
GLAD_API_CALL int GLAD_WGL_EXT_extensions_string;
#define WGL_EXT_framebuffer_sRGB 1
GLAD_API_CALL int GLAD_WGL_EXT_framebuffer_sRGB;
#define WGL_EXT_make_current_read 1
GLAD_API_CALL int GLAD_WGL_EXT_make_current_read;
#define WGL_EXT_multisample 1
GLAD_API_CALL int GLAD_WGL_EXT_multisample;
#define WGL_EXT_pbuffer 1
GLAD_API_CALL int GLAD_WGL_EXT_pbuffer;
#define WGL_EXT_pixel_format 1
GLAD_API_CALL int GLAD_WGL_EXT_pixel_format;
#define WGL_EXT_pixel_format_packed_float 1
GLAD_API_CALL int GLAD_WGL_EXT_pixel_format_packed_float;
#define WGL_EXT_swap_control 1
GLAD_API_CALL int GLAD_WGL_EXT_swap_control;
#define WGL_EXT_swap_control_tear 1
GLAD_API_CALL int GLAD_WGL_EXT_swap_control_tear;
#define WGL_I3D_digital_video_control 1
GLAD_API_CALL int GLAD_WGL_I3D_digital_video_control;
#define WGL_I3D_gamma 1
GLAD_API_CALL int GLAD_WGL_I3D_gamma;
#define WGL_I3D_genlock 1
GLAD_API_CALL int GLAD_WGL_I3D_genlock;
#define WGL_I3D_image_buffer 1
GLAD_API_CALL int GLAD_WGL_I3D_image_buffer;
#define WGL_I3D_swap_frame_lock 1
GLAD_API_CALL int GLAD_WGL_I3D_swap_frame_lock;
#define WGL_I3D_swap_frame_usage 1
GLAD_API_CALL int GLAD_WGL_I3D_swap_frame_usage;
#define WGL_NV_DX_interop 1
GLAD_API_CALL int GLAD_WGL_NV_DX_interop;
#define WGL_NV_DX_interop2 1
GLAD_API_CALL int GLAD_WGL_NV_DX_interop2;
#define WGL_NV_copy_image 1
GLAD_API_CALL int GLAD_WGL_NV_copy_image;
#define WGL_NV_delay_before_swap 1
GLAD_API_CALL int GLAD_WGL_NV_delay_before_swap;
#define WGL_NV_float_buffer 1
GLAD_API_CALL int GLAD_WGL_NV_float_buffer;
#define WGL_NV_gpu_affinity 1
GLAD_API_CALL int GLAD_WGL_NV_gpu_affinity;
#define WGL_NV_multigpu_context 1
GLAD_API_CALL int GLAD_WGL_NV_multigpu_context;
#define WGL_NV_multisample_coverage 1
GLAD_API_CALL int GLAD_WGL_NV_multisample_coverage;
#define WGL_NV_present_video 1
GLAD_API_CALL int GLAD_WGL_NV_present_video;
#define WGL_NV_render_depth_texture 1
GLAD_API_CALL int GLAD_WGL_NV_render_depth_texture;
#define WGL_NV_render_texture_rectangle 1
GLAD_API_CALL int GLAD_WGL_NV_render_texture_rectangle;
#define WGL_NV_swap_group 1
GLAD_API_CALL int GLAD_WGL_NV_swap_group;
#define WGL_NV_vertex_array_range 1
GLAD_API_CALL int GLAD_WGL_NV_vertex_array_range;
#define WGL_NV_video_capture 1
GLAD_API_CALL int GLAD_WGL_NV_video_capture;
#define WGL_NV_video_output 1
GLAD_API_CALL int GLAD_WGL_NV_video_output;
#define WGL_OML_sync_control 1
GLAD_API_CALL int GLAD_WGL_OML_sync_control;
typedef int (GLAD_API_PTR* PFNCHOOSEPIXELFORMATPROC)(HDC hDc, const PIXELFORMATDESCRIPTOR* pPfd);
typedef int (GLAD_API_PTR* PFNDESCRIBEPIXELFORMATPROC)(HDC hdc, int ipfd, UINT cjpfd, PIXELFORMATDESCRIPTOR* ppfd);
typedef UINT(GLAD_API_PTR* PFNGETENHMETAFILEPIXELFORMATPROC)(HENHMETAFILE hemf, UINT cbBuffer, PIXELFORMATDESCRIPTOR* ppfd);
typedef int (GLAD_API_PTR* PFNGETPIXELFORMATPROC)(HDC hdc);
typedef BOOL(GLAD_API_PTR* PFNSETPIXELFORMATPROC)(HDC hdc, int ipfd, const PIXELFORMATDESCRIPTOR* ppfd);
typedef BOOL(GLAD_API_PTR* PFNSWAPBUFFERSPROC)(HDC hdc);
typedef void* (GLAD_API_PTR* PFNWGLALLOCATEMEMORYNVPROC)(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
typedef BOOL(GLAD_API_PTR* PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC)(HDC hDC, const HANDLE* pEvent, const LPVOID* pAddress, const DWORD* pSize, UINT count);
typedef BOOL(GLAD_API_PTR* PFNWGLBEGINFRAMETRACKINGI3DPROC)(void);
typedef GLboolean(GLAD_API_PTR* PFNWGLBINDDISPLAYCOLORTABLEEXTPROC)(GLushort id);
typedef BOOL(GLAD_API_PTR* PFNWGLBINDSWAPBARRIERNVPROC)(GLuint group, GLuint barrier);
typedef BOOL(GLAD_API_PTR* PFNWGLBINDTEXIMAGEARBPROC)(HPBUFFERARB hPbuffer, int iBuffer);
typedef BOOL(GLAD_API_PTR* PFNWGLBINDVIDEOCAPTUREDEVICENVPROC)(UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
typedef BOOL(GLAD_API_PTR* PFNWGLBINDVIDEODEVICENVPROC)(HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList);
typedef BOOL(GLAD_API_PTR* PFNWGLBINDVIDEOIMAGENVPROC)(HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
typedef VOID(GLAD_API_PTR* PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)(HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
typedef BOOL(GLAD_API_PTR* PFNWGLCHOOSEPIXELFORMATARBPROC)(HDC hdc, const int* piAttribIList, const FLOAT* pfAttribFList, UINT nMaxFormats, int* piFormats, UINT* nNumFormats);
typedef BOOL(GLAD_API_PTR* PFNWGLCHOOSEPIXELFORMATEXTPROC)(HDC hdc, const int* piAttribIList, const FLOAT* pfAttribFList, UINT nMaxFormats, int* piFormats, UINT* nNumFormats);
typedef BOOL(GLAD_API_PTR* PFNWGLCOPYCONTEXTPROC)(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask);
typedef BOOL(GLAD_API_PTR* PFNWGLCOPYIMAGESUBDATANVPROC)(HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
typedef HDC(GLAD_API_PTR* PFNWGLCREATEAFFINITYDCNVPROC)(const HGPUNV* phGpuList);
typedef HGLRC(GLAD_API_PTR* PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)(UINT id);
typedef HGLRC(GLAD_API_PTR* PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)(UINT id, HGLRC hShareContext, const int* attribList);
typedef HANDLE(GLAD_API_PTR* PFNWGLCREATEBUFFERREGIONARBPROC)(HDC hDC, int iLayerPlane, UINT uType);
typedef HGLRC(GLAD_API_PTR* PFNWGLCREATECONTEXTPROC)(HDC hDc);
typedef HGLRC(GLAD_API_PTR* PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC hDC, HGLRC hShareContext, const int* attribList);
typedef GLboolean(GLAD_API_PTR* PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC)(GLushort id);
typedef LPVOID(GLAD_API_PTR* PFNWGLCREATEIMAGEBUFFERI3DPROC)(HDC hDC, DWORD dwSize, UINT uFlags);
typedef HGLRC(GLAD_API_PTR* PFNWGLCREATELAYERCONTEXTPROC)(HDC hDc, int level);
typedef HPBUFFERARB(GLAD_API_PTR* PFNWGLCREATEPBUFFERARBPROC)(HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList);
typedef HPBUFFEREXT(GLAD_API_PTR* PFNWGLCREATEPBUFFEREXTPROC)(HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList);
typedef BOOL(GLAD_API_PTR* PFNWGLDXCLOSEDEVICENVPROC)(HANDLE hDevice);
typedef BOOL(GLAD_API_PTR* PFNWGLDXLOCKOBJECTSNVPROC)(HANDLE hDevice, GLint count, HANDLE* hObjects);
typedef BOOL(GLAD_API_PTR* PFNWGLDXOBJECTACCESSNVPROC)(HANDLE hObject, GLenum access);
typedef HANDLE(GLAD_API_PTR* PFNWGLDXOPENDEVICENVPROC)(void* dxDevice);
typedef HANDLE(GLAD_API_PTR* PFNWGLDXREGISTEROBJECTNVPROC)(HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access);
typedef BOOL(GLAD_API_PTR* PFNWGLDXSETRESOURCESHAREHANDLENVPROC)(void* dxObject, HANDLE shareHandle);
typedef BOOL(GLAD_API_PTR* PFNWGLDXUNLOCKOBJECTSNVPROC)(HANDLE hDevice, GLint count, HANDLE* hObjects);
typedef BOOL(GLAD_API_PTR* PFNWGLDXUNREGISTEROBJECTNVPROC)(HANDLE hDevice, HANDLE hObject);
typedef BOOL(GLAD_API_PTR* PFNWGLDELAYBEFORESWAPNVPROC)(HDC hDC, GLfloat seconds);
typedef BOOL(GLAD_API_PTR* PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)(HGLRC hglrc);
typedef VOID(GLAD_API_PTR* PFNWGLDELETEBUFFERREGIONARBPROC)(HANDLE hRegion);
typedef BOOL(GLAD_API_PTR* PFNWGLDELETECONTEXTPROC)(HGLRC oldContext);
typedef BOOL(GLAD_API_PTR* PFNWGLDELETEDCNVPROC)(HDC hdc);
typedef BOOL(GLAD_API_PTR* PFNWGLDESCRIBELAYERPLANEPROC)(HDC hDc, int pixelFormat, int layerPlane, UINT nBytes, LAYERPLANEDESCRIPTOR* plpd);
typedef VOID(GLAD_API_PTR* PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC)(GLushort id);
typedef BOOL(GLAD_API_PTR* PFNWGLDESTROYIMAGEBUFFERI3DPROC)(HDC hDC, LPVOID pAddress);
typedef BOOL(GLAD_API_PTR* PFNWGLDESTROYPBUFFERARBPROC)(HPBUFFERARB hPbuffer);
typedef BOOL(GLAD_API_PTR* PFNWGLDESTROYPBUFFEREXTPROC)(HPBUFFEREXT hPbuffer);
typedef BOOL(GLAD_API_PTR* PFNWGLDISABLEFRAMELOCKI3DPROC)(void);
typedef BOOL(GLAD_API_PTR* PFNWGLDISABLEGENLOCKI3DPROC)(HDC hDC);
typedef BOOL(GLAD_API_PTR* PFNWGLENABLEFRAMELOCKI3DPROC)(void);
typedef BOOL(GLAD_API_PTR* PFNWGLENABLEGENLOCKI3DPROC)(HDC hDC);
typedef BOOL(GLAD_API_PTR* PFNWGLENDFRAMETRACKINGI3DPROC)(void);
typedef BOOL(GLAD_API_PTR* PFNWGLENUMGPUDEVICESNVPROC)(HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
typedef BOOL(GLAD_API_PTR* PFNWGLENUMGPUSFROMAFFINITYDCNVPROC)(HDC hAffinityDC, UINT iGpuIndex, HGPUNV* hGpu);
typedef BOOL(GLAD_API_PTR* PFNWGLENUMGPUSNVPROC)(UINT iGpuIndex, HGPUNV* phGpu);
typedef UINT(GLAD_API_PTR* PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC)(HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList);
typedef int (GLAD_API_PTR* PFNWGLENUMERATEVIDEODEVICESNVPROC)(HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList);
typedef void (GLAD_API_PTR* PFNWGLFREEMEMORYNVPROC)(void* pointer);
typedef BOOL(GLAD_API_PTR* PFNWGLGENLOCKSAMPLERATEI3DPROC)(HDC hDC, UINT uRate);
typedef BOOL(GLAD_API_PTR* PFNWGLGENLOCKSOURCEDELAYI3DPROC)(HDC hDC, UINT uDelay);
typedef BOOL(GLAD_API_PTR* PFNWGLGENLOCKSOURCEEDGEI3DPROC)(HDC hDC, UINT uEdge);
typedef BOOL(GLAD_API_PTR* PFNWGLGENLOCKSOURCEI3DPROC)(HDC hDC, UINT uSource);
typedef UINT(GLAD_API_PTR* PFNWGLGETCONTEXTGPUIDAMDPROC)(HGLRC hglrc);
typedef HGLRC(GLAD_API_PTR* PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)(void);
typedef HGLRC(GLAD_API_PTR* PFNWGLGETCURRENTCONTEXTPROC)(void);
typedef HDC(GLAD_API_PTR* PFNWGLGETCURRENTDCPROC)(void);
typedef HDC(GLAD_API_PTR* PFNWGLGETCURRENTREADDCARBPROC)(void);
typedef HDC(GLAD_API_PTR* PFNWGLGETCURRENTREADDCEXTPROC)(void);
typedef BOOL(GLAD_API_PTR* PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC)(HDC hDC, int iAttribute, int* piValue);
typedef const char* (GLAD_API_PTR* PFNWGLGETEXTENSIONSSTRINGARBPROC)(HDC hdc);
typedef const char* (GLAD_API_PTR* PFNWGLGETEXTENSIONSSTRINGEXTPROC)(void);
typedef BOOL(GLAD_API_PTR* PFNWGLGETFRAMEUSAGEI3DPROC)(float* pUsage);
typedef UINT(GLAD_API_PTR* PFNWGLGETGPUIDSAMDPROC)(UINT maxCount, UINT* ids);
typedef INT(GLAD_API_PTR* PFNWGLGETGPUINFOAMDPROC)(UINT id, INT property, GLenum dataType, UINT size, void* data);
typedef BOOL(GLAD_API_PTR* PFNWGLGETGAMMATABLEI3DPROC)(HDC hDC, int iEntries, USHORT* puRed, USHORT* puGreen, USHORT* puBlue);
typedef BOOL(GLAD_API_PTR* PFNWGLGETGAMMATABLEPARAMETERSI3DPROC)(HDC hDC, int iAttribute, int* piValue);
typedef BOOL(GLAD_API_PTR* PFNWGLGETGENLOCKSAMPLERATEI3DPROC)(HDC hDC, UINT* uRate);
typedef BOOL(GLAD_API_PTR* PFNWGLGETGENLOCKSOURCEDELAYI3DPROC)(HDC hDC, UINT* uDelay);
typedef BOOL(GLAD_API_PTR* PFNWGLGETGENLOCKSOURCEEDGEI3DPROC)(HDC hDC, UINT* uEdge);
typedef BOOL(GLAD_API_PTR* PFNWGLGETGENLOCKSOURCEI3DPROC)(HDC hDC, UINT* uSource);
typedef int (GLAD_API_PTR* PFNWGLGETLAYERPALETTEENTRIESPROC)(HDC hdc, int iLayerPlane, int iStart, int cEntries, COLORREF* pcr);
typedef BOOL(GLAD_API_PTR* PFNWGLGETMSCRATEOMLPROC)(HDC hdc, INT32* numerator, INT32* denominator);
typedef HDC(GLAD_API_PTR* PFNWGLGETPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer);
typedef HDC(GLAD_API_PTR* PFNWGLGETPBUFFERDCEXTPROC)(HPBUFFEREXT hPbuffer);
typedef BOOL(GLAD_API_PTR* PFNWGLGETPIXELFORMATATTRIBFVARBPROC)(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT* pfValues);
typedef BOOL(GLAD_API_PTR* PFNWGLGETPIXELFORMATATTRIBFVEXTPROC)(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT* pfValues);
typedef BOOL(GLAD_API_PTR* PFNWGLGETPIXELFORMATATTRIBIVARBPROC)(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int* piValues);
typedef BOOL(GLAD_API_PTR* PFNWGLGETPIXELFORMATATTRIBIVEXTPROC)(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int* piValues);
typedef PROC(GLAD_API_PTR* PFNWGLGETPROCADDRESSPROC)(LPCSTR lpszProc);
typedef int (GLAD_API_PTR* PFNWGLGETSWAPINTERVALEXTPROC)(void);
typedef BOOL(GLAD_API_PTR* PFNWGLGETSYNCVALUESOMLPROC)(HDC hdc, INT64* ust, INT64* msc, INT64* sbc);
typedef BOOL(GLAD_API_PTR* PFNWGLGETVIDEODEVICENVPROC)(HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice);
typedef BOOL(GLAD_API_PTR* PFNWGLGETVIDEOINFONVPROC)(HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long* pulCounterOutputVideo);
typedef BOOL(GLAD_API_PTR* PFNWGLISENABLEDFRAMELOCKI3DPROC)(BOOL* pFlag);
typedef BOOL(GLAD_API_PTR* PFNWGLISENABLEDGENLOCKI3DPROC)(HDC hDC, BOOL* pFlag);
typedef BOOL(GLAD_API_PTR* PFNWGLJOINSWAPGROUPNVPROC)(HDC hDC, GLuint group);
typedef GLboolean(GLAD_API_PTR* PFNWGLLOADDISPLAYCOLORTABLEEXTPROC)(const GLushort* table, GLuint length);
typedef BOOL(GLAD_API_PTR* PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC)(HDC hDc, HVIDEOINPUTDEVICENV hDevice);
typedef BOOL(GLAD_API_PTR* PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)(HGLRC hglrc);
typedef BOOL(GLAD_API_PTR* PFNWGLMAKECONTEXTCURRENTARBPROC)(HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
typedef BOOL(GLAD_API_PTR* PFNWGLMAKECONTEXTCURRENTEXTPROC)(HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
typedef BOOL(GLAD_API_PTR* PFNWGLMAKECURRENTPROC)(HDC hDc, HGLRC newContext);
typedef BOOL(GLAD_API_PTR* PFNWGLQUERYCURRENTCONTEXTNVPROC)(int iAttribute, int* piValue);
typedef BOOL(GLAD_API_PTR* PFNWGLQUERYFRAMECOUNTNVPROC)(HDC hDC, GLuint* count);
typedef BOOL(GLAD_API_PTR* PFNWGLQUERYFRAMELOCKMASTERI3DPROC)(BOOL* pFlag);
typedef BOOL(GLAD_API_PTR* PFNWGLQUERYFRAMETRACKINGI3DPROC)(DWORD* pFrameCount, DWORD* pMissedFrames, float* pLastMissedUsage);
typedef BOOL(GLAD_API_PTR* PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC)(HDC hDC, UINT* uMaxLineDelay, UINT* uMaxPixelDelay);
typedef BOOL(GLAD_API_PTR* PFNWGLQUERYMAXSWAPGROUPSNVPROC)(HDC hDC, GLuint* maxGroups, GLuint* maxBarriers);
typedef BOOL(GLAD_API_PTR* PFNWGLQUERYPBUFFERARBPROC)(HPBUFFERARB hPbuffer, int iAttribute, int* piValue);
typedef BOOL(GLAD_API_PTR* PFNWGLQUERYPBUFFEREXTPROC)(HPBUFFEREXT hPbuffer, int iAttribute, int* piValue);
typedef BOOL(GLAD_API_PTR* PFNWGLQUERYSWAPGROUPNVPROC)(HDC hDC, GLuint* group, GLuint* barrier);
typedef BOOL(GLAD_API_PTR* PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC)(HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue);
typedef BOOL(GLAD_API_PTR* PFNWGLREALIZELAYERPALETTEPROC)(HDC hdc, int iLayerPlane, BOOL bRealize);
typedef BOOL(GLAD_API_PTR* PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC)(HDC hDC, const LPVOID* pAddress, UINT count);
typedef int (GLAD_API_PTR* PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer, HDC hDC);
typedef int (GLAD_API_PTR* PFNWGLRELEASEPBUFFERDCEXTPROC)(HPBUFFEREXT hPbuffer, HDC hDC);
typedef BOOL(GLAD_API_PTR* PFNWGLRELEASETEXIMAGEARBPROC)(HPBUFFERARB hPbuffer, int iBuffer);
typedef BOOL(GLAD_API_PTR* PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC)(HDC hDc, HVIDEOINPUTDEVICENV hDevice);
typedef BOOL(GLAD_API_PTR* PFNWGLRELEASEVIDEODEVICENVPROC)(HPVIDEODEV hVideoDevice);
typedef BOOL(GLAD_API_PTR* PFNWGLRELEASEVIDEOIMAGENVPROC)(HPBUFFERARB hPbuffer, int iVideoBuffer);
typedef BOOL(GLAD_API_PTR* PFNWGLRESETFRAMECOUNTNVPROC)(HDC hDC);
typedef BOOL(GLAD_API_PTR* PFNWGLRESTOREBUFFERREGIONARBPROC)(HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
typedef BOOL(GLAD_API_PTR* PFNWGLSAVEBUFFERREGIONARBPROC)(HANDLE hRegion, int x, int y, int width, int height);
typedef BOOL(GLAD_API_PTR* PFNWGLSENDPBUFFERTOVIDEONVPROC)(HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock);
typedef BOOL(GLAD_API_PTR* PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC)(HDC hDC, int iAttribute, const int* piValue);
typedef BOOL(GLAD_API_PTR* PFNWGLSETGAMMATABLEI3DPROC)(HDC hDC, int iEntries, const USHORT* puRed, const USHORT* puGreen, const USHORT* puBlue);
typedef BOOL(GLAD_API_PTR* PFNWGLSETGAMMATABLEPARAMETERSI3DPROC)(HDC hDC, int iAttribute, const int* piValue);
typedef int (GLAD_API_PTR* PFNWGLSETLAYERPALETTEENTRIESPROC)(HDC hdc, int iLayerPlane, int iStart, int cEntries, const COLORREF* pcr);
typedef BOOL(GLAD_API_PTR* PFNWGLSETPBUFFERATTRIBARBPROC)(HPBUFFERARB hPbuffer, const int* piAttribList);
typedef BOOL(GLAD_API_PTR* PFNWGLSETSTEREOEMITTERSTATE3DLPROC)(HDC hDC, UINT uState);
typedef BOOL(GLAD_API_PTR* PFNWGLSHARELISTSPROC)(HGLRC hrcSrvShare, HGLRC hrcSrvSource);
typedef INT64(GLAD_API_PTR* PFNWGLSWAPBUFFERSMSCOMLPROC)(HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
typedef BOOL(GLAD_API_PTR* PFNWGLSWAPINTERVALEXTPROC)(int interval);
typedef BOOL(GLAD_API_PTR* PFNWGLSWAPLAYERBUFFERSPROC)(HDC hdc, UINT fuFlags);
typedef INT64(GLAD_API_PTR* PFNWGLSWAPLAYERBUFFERSMSCOMLPROC)(HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
typedef BOOL(GLAD_API_PTR* PFNWGLUSEFONTBITMAPSPROC)(HDC hDC, DWORD first, DWORD count, DWORD listBase);
typedef BOOL(GLAD_API_PTR* PFNWGLUSEFONTBITMAPSAPROC)(HDC hDC, DWORD first, DWORD count, DWORD listBase);
typedef BOOL(GLAD_API_PTR* PFNWGLUSEFONTBITMAPSWPROC)(HDC hDC, DWORD first, DWORD count, DWORD listBase);
typedef BOOL(GLAD_API_PTR* PFNWGLUSEFONTOUTLINESPROC)(HDC hDC, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf);
typedef BOOL(GLAD_API_PTR* PFNWGLUSEFONTOUTLINESAPROC)(HDC hDC, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf);
typedef BOOL(GLAD_API_PTR* PFNWGLUSEFONTOUTLINESWPROC)(HDC hDC, DWORD first, DWORD count, DWORD listBase, FLOAT deviation, FLOAT extrusion, int format, LPGLYPHMETRICSFLOAT lpgmf);
typedef BOOL(GLAD_API_PTR* PFNWGLWAITFORMSCOMLPROC)(HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64* msc, INT64* sbc);
typedef BOOL(GLAD_API_PTR* PFNWGLWAITFORSBCOMLPROC)(HDC hdc, INT64 target_sbc, INT64* ust, INT64* msc, INT64* sbc);
GLAD_API_CALL PFNWGLALLOCATEMEMORYNVPROC glad_wglAllocateMemoryNV;
#define wglAllocateMemoryNV glad_wglAllocateMemoryNV
GLAD_API_CALL PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC glad_wglAssociateImageBufferEventsI3D;
#define wglAssociateImageBufferEventsI3D glad_wglAssociateImageBufferEventsI3D
GLAD_API_CALL PFNWGLBEGINFRAMETRACKINGI3DPROC glad_wglBeginFrameTrackingI3D;
#define wglBeginFrameTrackingI3D glad_wglBeginFrameTrackingI3D
GLAD_API_CALL PFNWGLBINDDISPLAYCOLORTABLEEXTPROC glad_wglBindDisplayColorTableEXT;
#define wglBindDisplayColorTableEXT glad_wglBindDisplayColorTableEXT
GLAD_API_CALL PFNWGLBINDSWAPBARRIERNVPROC glad_wglBindSwapBarrierNV;
#define wglBindSwapBarrierNV glad_wglBindSwapBarrierNV
GLAD_API_CALL PFNWGLBINDTEXIMAGEARBPROC glad_wglBindTexImageARB;
#define wglBindTexImageARB glad_wglBindTexImageARB
GLAD_API_CALL PFNWGLBINDVIDEOCAPTUREDEVICENVPROC glad_wglBindVideoCaptureDeviceNV;
#define wglBindVideoCaptureDeviceNV glad_wglBindVideoCaptureDeviceNV
GLAD_API_CALL PFNWGLBINDVIDEODEVICENVPROC glad_wglBindVideoDeviceNV;
#define wglBindVideoDeviceNV glad_wglBindVideoDeviceNV
GLAD_API_CALL PFNWGLBINDVIDEOIMAGENVPROC glad_wglBindVideoImageNV;
#define wglBindVideoImageNV glad_wglBindVideoImageNV
GLAD_API_CALL PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC glad_wglBlitContextFramebufferAMD;
#define wglBlitContextFramebufferAMD glad_wglBlitContextFramebufferAMD
GLAD_API_CALL PFNWGLCHOOSEPIXELFORMATARBPROC glad_wglChoosePixelFormatARB;
#define wglChoosePixelFormatARB glad_wglChoosePixelFormatARB
GLAD_API_CALL PFNWGLCHOOSEPIXELFORMATEXTPROC glad_wglChoosePixelFormatEXT;
#define wglChoosePixelFormatEXT glad_wglChoosePixelFormatEXT
GLAD_API_CALL PFNWGLCOPYIMAGESUBDATANVPROC glad_wglCopyImageSubDataNV;
#define wglCopyImageSubDataNV glad_wglCopyImageSubDataNV
GLAD_API_CALL PFNWGLCREATEAFFINITYDCNVPROC glad_wglCreateAffinityDCNV;
#define wglCreateAffinityDCNV glad_wglCreateAffinityDCNV
GLAD_API_CALL PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC glad_wglCreateAssociatedContextAMD;
#define wglCreateAssociatedContextAMD glad_wglCreateAssociatedContextAMD
GLAD_API_CALL PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC glad_wglCreateAssociatedContextAttribsAMD;
#define wglCreateAssociatedContextAttribsAMD glad_wglCreateAssociatedContextAttribsAMD
GLAD_API_CALL PFNWGLCREATEBUFFERREGIONARBPROC glad_wglCreateBufferRegionARB;
#define wglCreateBufferRegionARB glad_wglCreateBufferRegionARB
GLAD_API_CALL PFNWGLCREATECONTEXTATTRIBSARBPROC glad_wglCreateContextAttribsARB;
#define wglCreateContextAttribsARB glad_wglCreateContextAttribsARB
GLAD_API_CALL PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC glad_wglCreateDisplayColorTableEXT;
#define wglCreateDisplayColorTableEXT glad_wglCreateDisplayColorTableEXT
GLAD_API_CALL PFNWGLCREATEIMAGEBUFFERI3DPROC glad_wglCreateImageBufferI3D;
#define wglCreateImageBufferI3D glad_wglCreateImageBufferI3D
GLAD_API_CALL PFNWGLCREATEPBUFFERARBPROC glad_wglCreatePbufferARB;
#define wglCreatePbufferARB glad_wglCreatePbufferARB
GLAD_API_CALL PFNWGLCREATEPBUFFEREXTPROC glad_wglCreatePbufferEXT;
#define wglCreatePbufferEXT glad_wglCreatePbufferEXT
GLAD_API_CALL PFNWGLDXCLOSEDEVICENVPROC glad_wglDXCloseDeviceNV;
#define wglDXCloseDeviceNV glad_wglDXCloseDeviceNV
GLAD_API_CALL PFNWGLDXLOCKOBJECTSNVPROC glad_wglDXLockObjectsNV;
#define wglDXLockObjectsNV glad_wglDXLockObjectsNV
GLAD_API_CALL PFNWGLDXOBJECTACCESSNVPROC glad_wglDXObjectAccessNV;
#define wglDXObjectAccessNV glad_wglDXObjectAccessNV
GLAD_API_CALL PFNWGLDXOPENDEVICENVPROC glad_wglDXOpenDeviceNV;
#define wglDXOpenDeviceNV glad_wglDXOpenDeviceNV
GLAD_API_CALL PFNWGLDXREGISTEROBJECTNVPROC glad_wglDXRegisterObjectNV;
#define wglDXRegisterObjectNV glad_wglDXRegisterObjectNV
GLAD_API_CALL PFNWGLDXSETRESOURCESHAREHANDLENVPROC glad_wglDXSetResourceShareHandleNV;
#define wglDXSetResourceShareHandleNV glad_wglDXSetResourceShareHandleNV
GLAD_API_CALL PFNWGLDXUNLOCKOBJECTSNVPROC glad_wglDXUnlockObjectsNV;
#define wglDXUnlockObjectsNV glad_wglDXUnlockObjectsNV
GLAD_API_CALL PFNWGLDXUNREGISTEROBJECTNVPROC glad_wglDXUnregisterObjectNV;
#define wglDXUnregisterObjectNV glad_wglDXUnregisterObjectNV
GLAD_API_CALL PFNWGLDELAYBEFORESWAPNVPROC glad_wglDelayBeforeSwapNV;
#define wglDelayBeforeSwapNV glad_wglDelayBeforeSwapNV
GLAD_API_CALL PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC glad_wglDeleteAssociatedContextAMD;
#define wglDeleteAssociatedContextAMD glad_wglDeleteAssociatedContextAMD
GLAD_API_CALL PFNWGLDELETEBUFFERREGIONARBPROC glad_wglDeleteBufferRegionARB;
#define wglDeleteBufferRegionARB glad_wglDeleteBufferRegionARB
GLAD_API_CALL PFNWGLDELETEDCNVPROC glad_wglDeleteDCNV;
#define wglDeleteDCNV glad_wglDeleteDCNV
GLAD_API_CALL PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC glad_wglDestroyDisplayColorTableEXT;
#define wglDestroyDisplayColorTableEXT glad_wglDestroyDisplayColorTableEXT
GLAD_API_CALL PFNWGLDESTROYIMAGEBUFFERI3DPROC glad_wglDestroyImageBufferI3D;
#define wglDestroyImageBufferI3D glad_wglDestroyImageBufferI3D
GLAD_API_CALL PFNWGLDESTROYPBUFFERARBPROC glad_wglDestroyPbufferARB;
#define wglDestroyPbufferARB glad_wglDestroyPbufferARB
GLAD_API_CALL PFNWGLDESTROYPBUFFEREXTPROC glad_wglDestroyPbufferEXT;
#define wglDestroyPbufferEXT glad_wglDestroyPbufferEXT
GLAD_API_CALL PFNWGLDISABLEFRAMELOCKI3DPROC glad_wglDisableFrameLockI3D;
#define wglDisableFrameLockI3D glad_wglDisableFrameLockI3D
GLAD_API_CALL PFNWGLDISABLEGENLOCKI3DPROC glad_wglDisableGenlockI3D;
#define wglDisableGenlockI3D glad_wglDisableGenlockI3D
GLAD_API_CALL PFNWGLENABLEFRAMELOCKI3DPROC glad_wglEnableFrameLockI3D;
#define wglEnableFrameLockI3D glad_wglEnableFrameLockI3D
GLAD_API_CALL PFNWGLENABLEGENLOCKI3DPROC glad_wglEnableGenlockI3D;
#define wglEnableGenlockI3D glad_wglEnableGenlockI3D
GLAD_API_CALL PFNWGLENDFRAMETRACKINGI3DPROC glad_wglEndFrameTrackingI3D;
#define wglEndFrameTrackingI3D glad_wglEndFrameTrackingI3D
GLAD_API_CALL PFNWGLENUMGPUDEVICESNVPROC glad_wglEnumGpuDevicesNV;
#define wglEnumGpuDevicesNV glad_wglEnumGpuDevicesNV
GLAD_API_CALL PFNWGLENUMGPUSFROMAFFINITYDCNVPROC glad_wglEnumGpusFromAffinityDCNV;
#define wglEnumGpusFromAffinityDCNV glad_wglEnumGpusFromAffinityDCNV
GLAD_API_CALL PFNWGLENUMGPUSNVPROC glad_wglEnumGpusNV;
#define wglEnumGpusNV glad_wglEnumGpusNV
GLAD_API_CALL PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC glad_wglEnumerateVideoCaptureDevicesNV;
#define wglEnumerateVideoCaptureDevicesNV glad_wglEnumerateVideoCaptureDevicesNV
GLAD_API_CALL PFNWGLENUMERATEVIDEODEVICESNVPROC glad_wglEnumerateVideoDevicesNV;
#define wglEnumerateVideoDevicesNV glad_wglEnumerateVideoDevicesNV
GLAD_API_CALL PFNWGLFREEMEMORYNVPROC glad_wglFreeMemoryNV;
#define wglFreeMemoryNV glad_wglFreeMemoryNV
GLAD_API_CALL PFNWGLGENLOCKSAMPLERATEI3DPROC glad_wglGenlockSampleRateI3D;
#define wglGenlockSampleRateI3D glad_wglGenlockSampleRateI3D
GLAD_API_CALL PFNWGLGENLOCKSOURCEDELAYI3DPROC glad_wglGenlockSourceDelayI3D;
#define wglGenlockSourceDelayI3D glad_wglGenlockSourceDelayI3D
GLAD_API_CALL PFNWGLGENLOCKSOURCEEDGEI3DPROC glad_wglGenlockSourceEdgeI3D;
#define wglGenlockSourceEdgeI3D glad_wglGenlockSourceEdgeI3D
GLAD_API_CALL PFNWGLGENLOCKSOURCEI3DPROC glad_wglGenlockSourceI3D;
#define wglGenlockSourceI3D glad_wglGenlockSourceI3D
GLAD_API_CALL PFNWGLGETCONTEXTGPUIDAMDPROC glad_wglGetContextGPUIDAMD;
#define wglGetContextGPUIDAMD glad_wglGetContextGPUIDAMD
GLAD_API_CALL PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC glad_wglGetCurrentAssociatedContextAMD;
#define wglGetCurrentAssociatedContextAMD glad_wglGetCurrentAssociatedContextAMD
GLAD_API_CALL PFNWGLGETCURRENTREADDCARBPROC glad_wglGetCurrentReadDCARB;
#define wglGetCurrentReadDCARB glad_wglGetCurrentReadDCARB
GLAD_API_CALL PFNWGLGETCURRENTREADDCEXTPROC glad_wglGetCurrentReadDCEXT;
#define wglGetCurrentReadDCEXT glad_wglGetCurrentReadDCEXT
GLAD_API_CALL PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC glad_wglGetDigitalVideoParametersI3D;
#define wglGetDigitalVideoParametersI3D glad_wglGetDigitalVideoParametersI3D
GLAD_API_CALL PFNWGLGETEXTENSIONSSTRINGARBPROC glad_wglGetExtensionsStringARB;
#define wglGetExtensionsStringARB glad_wglGetExtensionsStringARB
GLAD_API_CALL PFNWGLGETEXTENSIONSSTRINGEXTPROC glad_wglGetExtensionsStringEXT;
#define wglGetExtensionsStringEXT glad_wglGetExtensionsStringEXT
GLAD_API_CALL PFNWGLGETFRAMEUSAGEI3DPROC glad_wglGetFrameUsageI3D;
#define wglGetFrameUsageI3D glad_wglGetFrameUsageI3D
GLAD_API_CALL PFNWGLGETGPUIDSAMDPROC glad_wglGetGPUIDsAMD;
#define wglGetGPUIDsAMD glad_wglGetGPUIDsAMD
GLAD_API_CALL PFNWGLGETGPUINFOAMDPROC glad_wglGetGPUInfoAMD;
#define wglGetGPUInfoAMD glad_wglGetGPUInfoAMD
GLAD_API_CALL PFNWGLGETGAMMATABLEI3DPROC glad_wglGetGammaTableI3D;
#define wglGetGammaTableI3D glad_wglGetGammaTableI3D
GLAD_API_CALL PFNWGLGETGAMMATABLEPARAMETERSI3DPROC glad_wglGetGammaTableParametersI3D;
#define wglGetGammaTableParametersI3D glad_wglGetGammaTableParametersI3D
GLAD_API_CALL PFNWGLGETGENLOCKSAMPLERATEI3DPROC glad_wglGetGenlockSampleRateI3D;
#define wglGetGenlockSampleRateI3D glad_wglGetGenlockSampleRateI3D
GLAD_API_CALL PFNWGLGETGENLOCKSOURCEDELAYI3DPROC glad_wglGetGenlockSourceDelayI3D;
#define wglGetGenlockSourceDelayI3D glad_wglGetGenlockSourceDelayI3D
GLAD_API_CALL PFNWGLGETGENLOCKSOURCEEDGEI3DPROC glad_wglGetGenlockSourceEdgeI3D;
#define wglGetGenlockSourceEdgeI3D glad_wglGetGenlockSourceEdgeI3D
GLAD_API_CALL PFNWGLGETGENLOCKSOURCEI3DPROC glad_wglGetGenlockSourceI3D;
#define wglGetGenlockSourceI3D glad_wglGetGenlockSourceI3D
GLAD_API_CALL PFNWGLGETMSCRATEOMLPROC glad_wglGetMscRateOML;
#define wglGetMscRateOML glad_wglGetMscRateOML
GLAD_API_CALL PFNWGLGETPBUFFERDCARBPROC glad_wglGetPbufferDCARB;
#define wglGetPbufferDCARB glad_wglGetPbufferDCARB
GLAD_API_CALL PFNWGLGETPBUFFERDCEXTPROC glad_wglGetPbufferDCEXT;
#define wglGetPbufferDCEXT glad_wglGetPbufferDCEXT
GLAD_API_CALL PFNWGLGETPIXELFORMATATTRIBFVARBPROC glad_wglGetPixelFormatAttribfvARB;
#define wglGetPixelFormatAttribfvARB glad_wglGetPixelFormatAttribfvARB
GLAD_API_CALL PFNWGLGETPIXELFORMATATTRIBFVEXTPROC glad_wglGetPixelFormatAttribfvEXT;
#define wglGetPixelFormatAttribfvEXT glad_wglGetPixelFormatAttribfvEXT
GLAD_API_CALL PFNWGLGETPIXELFORMATATTRIBIVARBPROC glad_wglGetPixelFormatAttribivARB;
#define wglGetPixelFormatAttribivARB glad_wglGetPixelFormatAttribivARB
GLAD_API_CALL PFNWGLGETPIXELFORMATATTRIBIVEXTPROC glad_wglGetPixelFormatAttribivEXT;
#define wglGetPixelFormatAttribivEXT glad_wglGetPixelFormatAttribivEXT
GLAD_API_CALL PFNWGLGETSWAPINTERVALEXTPROC glad_wglGetSwapIntervalEXT;
#define wglGetSwapIntervalEXT glad_wglGetSwapIntervalEXT
GLAD_API_CALL PFNWGLGETSYNCVALUESOMLPROC glad_wglGetSyncValuesOML;
#define wglGetSyncValuesOML glad_wglGetSyncValuesOML
GLAD_API_CALL PFNWGLGETVIDEODEVICENVPROC glad_wglGetVideoDeviceNV;
#define wglGetVideoDeviceNV glad_wglGetVideoDeviceNV
GLAD_API_CALL PFNWGLGETVIDEOINFONVPROC glad_wglGetVideoInfoNV;
#define wglGetVideoInfoNV glad_wglGetVideoInfoNV
GLAD_API_CALL PFNWGLISENABLEDFRAMELOCKI3DPROC glad_wglIsEnabledFrameLockI3D;
#define wglIsEnabledFrameLockI3D glad_wglIsEnabledFrameLockI3D
GLAD_API_CALL PFNWGLISENABLEDGENLOCKI3DPROC glad_wglIsEnabledGenlockI3D;
#define wglIsEnabledGenlockI3D glad_wglIsEnabledGenlockI3D
GLAD_API_CALL PFNWGLJOINSWAPGROUPNVPROC glad_wglJoinSwapGroupNV;
#define wglJoinSwapGroupNV glad_wglJoinSwapGroupNV
GLAD_API_CALL PFNWGLLOADDISPLAYCOLORTABLEEXTPROC glad_wglLoadDisplayColorTableEXT;
#define wglLoadDisplayColorTableEXT glad_wglLoadDisplayColorTableEXT
GLAD_API_CALL PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC glad_wglLockVideoCaptureDeviceNV;
#define wglLockVideoCaptureDeviceNV glad_wglLockVideoCaptureDeviceNV
GLAD_API_CALL PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC glad_wglMakeAssociatedContextCurrentAMD;
#define wglMakeAssociatedContextCurrentAMD glad_wglMakeAssociatedContextCurrentAMD
GLAD_API_CALL PFNWGLMAKECONTEXTCURRENTARBPROC glad_wglMakeContextCurrentARB;
#define wglMakeContextCurrentARB glad_wglMakeContextCurrentARB
GLAD_API_CALL PFNWGLMAKECONTEXTCURRENTEXTPROC glad_wglMakeContextCurrentEXT;
#define wglMakeContextCurrentEXT glad_wglMakeContextCurrentEXT
GLAD_API_CALL PFNWGLQUERYCURRENTCONTEXTNVPROC glad_wglQueryCurrentContextNV;
#define wglQueryCurrentContextNV glad_wglQueryCurrentContextNV
GLAD_API_CALL PFNWGLQUERYFRAMECOUNTNVPROC glad_wglQueryFrameCountNV;
#define wglQueryFrameCountNV glad_wglQueryFrameCountNV
GLAD_API_CALL PFNWGLQUERYFRAMELOCKMASTERI3DPROC glad_wglQueryFrameLockMasterI3D;
#define wglQueryFrameLockMasterI3D glad_wglQueryFrameLockMasterI3D
GLAD_API_CALL PFNWGLQUERYFRAMETRACKINGI3DPROC glad_wglQueryFrameTrackingI3D;
#define wglQueryFrameTrackingI3D glad_wglQueryFrameTrackingI3D
GLAD_API_CALL PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC glad_wglQueryGenlockMaxSourceDelayI3D;
#define wglQueryGenlockMaxSourceDelayI3D glad_wglQueryGenlockMaxSourceDelayI3D
GLAD_API_CALL PFNWGLQUERYMAXSWAPGROUPSNVPROC glad_wglQueryMaxSwapGroupsNV;
#define wglQueryMaxSwapGroupsNV glad_wglQueryMaxSwapGroupsNV
GLAD_API_CALL PFNWGLQUERYPBUFFERARBPROC glad_wglQueryPbufferARB;
#define wglQueryPbufferARB glad_wglQueryPbufferARB
GLAD_API_CALL PFNWGLQUERYPBUFFEREXTPROC glad_wglQueryPbufferEXT;
#define wglQueryPbufferEXT glad_wglQueryPbufferEXT
GLAD_API_CALL PFNWGLQUERYSWAPGROUPNVPROC glad_wglQuerySwapGroupNV;
#define wglQuerySwapGroupNV glad_wglQuerySwapGroupNV
GLAD_API_CALL PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC glad_wglQueryVideoCaptureDeviceNV;
#define wglQueryVideoCaptureDeviceNV glad_wglQueryVideoCaptureDeviceNV
GLAD_API_CALL PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC glad_wglReleaseImageBufferEventsI3D;
#define wglReleaseImageBufferEventsI3D glad_wglReleaseImageBufferEventsI3D
GLAD_API_CALL PFNWGLRELEASEPBUFFERDCARBPROC glad_wglReleasePbufferDCARB;
#define wglReleasePbufferDCARB glad_wglReleasePbufferDCARB
GLAD_API_CALL PFNWGLRELEASEPBUFFERDCEXTPROC glad_wglReleasePbufferDCEXT;
#define wglReleasePbufferDCEXT glad_wglReleasePbufferDCEXT
GLAD_API_CALL PFNWGLRELEASETEXIMAGEARBPROC glad_wglReleaseTexImageARB;
#define wglReleaseTexImageARB glad_wglReleaseTexImageARB
GLAD_API_CALL PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC glad_wglReleaseVideoCaptureDeviceNV;
#define wglReleaseVideoCaptureDeviceNV glad_wglReleaseVideoCaptureDeviceNV
GLAD_API_CALL PFNWGLRELEASEVIDEODEVICENVPROC glad_wglReleaseVideoDeviceNV;
#define wglReleaseVideoDeviceNV glad_wglReleaseVideoDeviceNV
GLAD_API_CALL PFNWGLRELEASEVIDEOIMAGENVPROC glad_wglReleaseVideoImageNV;
#define wglReleaseVideoImageNV glad_wglReleaseVideoImageNV
GLAD_API_CALL PFNWGLRESETFRAMECOUNTNVPROC glad_wglResetFrameCountNV;
#define wglResetFrameCountNV glad_wglResetFrameCountNV
GLAD_API_CALL PFNWGLRESTOREBUFFERREGIONARBPROC glad_wglRestoreBufferRegionARB;
#define wglRestoreBufferRegionARB glad_wglRestoreBufferRegionARB
GLAD_API_CALL PFNWGLSAVEBUFFERREGIONARBPROC glad_wglSaveBufferRegionARB;
#define wglSaveBufferRegionARB glad_wglSaveBufferRegionARB
GLAD_API_CALL PFNWGLSENDPBUFFERTOVIDEONVPROC glad_wglSendPbufferToVideoNV;
#define wglSendPbufferToVideoNV glad_wglSendPbufferToVideoNV
GLAD_API_CALL PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC glad_wglSetDigitalVideoParametersI3D;
#define wglSetDigitalVideoParametersI3D glad_wglSetDigitalVideoParametersI3D
GLAD_API_CALL PFNWGLSETGAMMATABLEI3DPROC glad_wglSetGammaTableI3D;
#define wglSetGammaTableI3D glad_wglSetGammaTableI3D
GLAD_API_CALL PFNWGLSETGAMMATABLEPARAMETERSI3DPROC glad_wglSetGammaTableParametersI3D;
#define wglSetGammaTableParametersI3D glad_wglSetGammaTableParametersI3D
GLAD_API_CALL PFNWGLSETPBUFFERATTRIBARBPROC glad_wglSetPbufferAttribARB;
#define wglSetPbufferAttribARB glad_wglSetPbufferAttribARB
GLAD_API_CALL PFNWGLSETSTEREOEMITTERSTATE3DLPROC glad_wglSetStereoEmitterState3DL;
#define wglSetStereoEmitterState3DL glad_wglSetStereoEmitterState3DL
GLAD_API_CALL PFNWGLSWAPBUFFERSMSCOMLPROC glad_wglSwapBuffersMscOML;
#define wglSwapBuffersMscOML glad_wglSwapBuffersMscOML
GLAD_API_CALL PFNWGLSWAPINTERVALEXTPROC glad_wglSwapIntervalEXT;
#define wglSwapIntervalEXT glad_wglSwapIntervalEXT
GLAD_API_CALL PFNWGLSWAPLAYERBUFFERSMSCOMLPROC glad_wglSwapLayerBuffersMscOML;
#define wglSwapLayerBuffersMscOML glad_wglSwapLayerBuffersMscOML
GLAD_API_CALL PFNWGLWAITFORMSCOMLPROC glad_wglWaitForMscOML;
#define wglWaitForMscOML glad_wglWaitForMscOML
GLAD_API_CALL PFNWGLWAITFORSBCOMLPROC glad_wglWaitForSbcOML;
#define wglWaitForSbcOML glad_wglWaitForSbcOML
GLAD_API_CALL int gladLoadWGLUserPtr(HDC hdc, GLADuserptrloadfunc load, void* userptr);
GLAD_API_CALL int gladLoadWGL(HDC hdc, GLADloadfunc load);
#ifdef __cplusplus
}
#endif
#endif
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("BenchMark")] [assembly: System.Reflection.AssemblyCompanyAttribute("BenchMark")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a2241a5a5816a9438c63e3ca3c69313e6f2e8f56")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1f2fca4c8fe323daf9751677ccfdf0f7b04a9be8")]
[assembly: System.Reflection.AssemblyProductAttribute("BenchMark")] [assembly: System.Reflection.AssemblyProductAttribute("BenchMark")]
[assembly: System.Reflection.AssemblyTitleAttribute("BenchMark")] [assembly: System.Reflection.AssemblyTitleAttribute("BenchMark")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
@@ -1 +1 @@
fe1624e5f302bd492e10a40cae96d24ccf2b6a19e0800ac0ba18b718db3e3a16 1b559b7de794dd65a77a826f372c4869f4f694564820837fdd05922d644b8624
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -204,7 +204,7 @@
<member name="T:StgSharp.Graphics.ElementBuffer"> <member name="T:StgSharp.Graphics.ElementBuffer">
<summary> <summary>
A collecion of handle to Element Buffer Object in OpenGL. A collecion of handle to Element Buffer Object in OpenGL.
Each <see langword="int"/> value indexed from instance of this class this Each <see langword="uint"/> value indexed from instance of this class this
is the only handle to one Element Buffer Object. is the only handle to one Element Buffer Object.
</summary> </summary>
</member> </member>
@@ -234,9 +234,9 @@
<param name="usage">How OpenGL use these data, defined by <see cref="T:StgSharp.Graphics.BufferUsage"/></param> <param name="usage">How OpenGL use these data, defined by <see cref="T:StgSharp.Graphics.BufferUsage"/></param>
</member> </member>
<member name="M:StgSharp.Graphics.VertexBuffer.Unbind"> <member name="M:StgSharp.Graphics.VertexBuffer.Unbind">
<summary> <summary>
</summary> </summary>
</member> </member>
<member name="M:StgSharp.Graphics.glManager.LoadGLapi(StgSharp.Graphics.Form,StgSharp.Graphics.GLfuncLoader)"> <member name="M:StgSharp.Graphics.glManager.LoadGLapi(StgSharp.Graphics.Form,StgSharp.Graphics.GLfuncLoader)">
<summary> <summary>
@@ -252,18 +252,37 @@
<param name="name">Name of the OpenGL api</param> <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> <returns>The funtion pointer of the api in form of <see cref="T:System.IntPtr"/></returns>
</member> </member>
<member name="M:StgSharp.Graphics.Shader.Compile(System.String[])"> <member name="T:StgSharp.Graphics.glHandle">
<summary> <summary>
Compile the vertex shader to be attached to this shader. A handle to an OpenGL object,
must be indexed from a <see cref="T:StgSharp.Graphics.glHandleSet"/>.
Direct call will cause <see langword="InvalidOperationException"/>
</summary>
</member>
<member name="T:StgSharp.Graphics.glHandleSet">
<summary>
A handle to an OpenGL object.
</summary>
</member>
<member name="M:StgSharp.Graphics.glHandleSet.Free">
<summary>
temporarily release the handle of GLhandle sets.
Please call <see cref="M:StgSharp.Graphics.glHandleSet.Pin"/> method before indexing.
</summary>
</member>
<member name="M:StgSharp.Graphics.glHandleSet.Release">
<summary>
Realse all resource in this handle.
This will release all resource in this <see cref="T:StgSharp.Graphics.glHandle"/>.
This <see langword="glHandle"/> will be not usable.
</summary> </summary>
<param name="code">GLSL code of vertex shader.</param>
</member> </member>
<member name="M:StgSharp.Graphics.Shader.AttachTo(System.Int32,StgSharp.Graphics.ShaderProgram)"> <member name="M:StgSharp.Graphics.Shader.AttachTo(System.Int32,StgSharp.Graphics.ShaderProgram)">
<summary> <summary>
</summary> </summary>
<param name="target"></param> <param name="target"></param>
<param name="index"></param> <param name="index"></param>
</member> </member>
<member name="M:StgSharp.Graphics.ShaderProgram.#ctor(StgSharp.Graphics.IglFunc)"> <member name="M:StgSharp.Graphics.ShaderProgram.#ctor(StgSharp.Graphics.IglFunc)">
<summary> <summary>
@@ -277,24 +296,24 @@
</member> </member>
<member name="M:StgSharp.Graphics.ShaderProgram.GetUniform``1(System.String)"> <member name="M:StgSharp.Graphics.ShaderProgram.GetUniform``1(System.String)">
<summary> <summary>
Get a uniform form current shader, Get a uniform form current shader,
the value type of the uniform should be provided. the value type of the uniform should be provided.
</summary> </summary>
<param name="name">Name of the Uniform in shader code</param> <param name="name">Name of the Uniform in shader code</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:StgSharp.Graphics.ShaderProgram.GetUniform``2(System.String)"> <member name="M:StgSharp.Graphics.ShaderProgram.GetUniform``2(System.String)">
<summary> <summary>
Get a uniform form current shader, Get a uniform form current shader,
the value type of the uniform should be provided. the value type of the uniform should be provided.
</summary> </summary>
<param name="name">Name of the Uniform in shader code</param> <param name="name">Name of the Uniform in shader code</param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:StgSharp.Graphics.ShaderProgram.GetUniform``3(System.String)"> <member name="M:StgSharp.Graphics.ShaderProgram.GetUniform``3(System.String)">
<summary> <summary>
Get a uniform form current shader, Get a uniform form current shader,
the value type of the uniform should be provided. the value type of the uniform should be provided.
</summary> </summary>
<param name="name">Name of the Uniform in shader code</param> <param name="name">Name of the Uniform in shader code</param>
<returns></returns> <returns></returns>
@@ -332,7 +351,7 @@
<param name="form">The form used as frame update benchmark.</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> <exception cref="T:System.InvalidOperationException">More than one alingment attached to one form timer</exception>
</member> </member>
<member name="M:StgSharp.Graphics.IglFunc.AttachShader(System.glHandle,System.glHandle)"> <member name="M:StgSharp.Graphics.IglFunc.AttachShader(StgSharp.Graphics.glHandle,StgSharp.Graphics.glHandle)">
<summary> <summary>
Same fucntion as OpenGL api glAttachShader. Same fucntion as OpenGL api glAttachShader.
Only the first <see href="shader"/> in handle Only the first <see href="shader"/> in handle
@@ -342,21 +361,21 @@
<param name="program">Shader program to be attachec</param> <param name="program">Shader program to be attachec</param>
<param name="shader">A shader part to attach</param> <param name="shader">A shader part to attach</param>
</member> </member>
<member name="M:StgSharp.Graphics.IglFunc.BindBuffer(StgSharp.Graphics.BufferType,System.glHandle)"> <member name="M:StgSharp.Graphics.IglFunc.BindBuffer(StgSharp.Graphics.BufferType,StgSharp.Graphics.glHandle)">
<summary> <summary>
Bind the indexed buffer object to certain type of buffer Bind the indexed buffer object to certain type of buffer
</summary> </summary>
<param name="bufferType"></param> <param name="bufferType"></param>
<param name="handle"></param> <param name="handle"></param>
</member> </member>
<member name="M:StgSharp.Graphics.IglFunc.BindTexture(System.UInt32,System.glHandle)"> <member name="M:StgSharp.Graphics.IglFunc.BindTexture(System.UInt32,StgSharp.Graphics.glHandle)">
<summary> <summary>
Same function as OpenGL api, glBindTexture. Same function as OpenGL api, glBindTexture.
</summary> </summary>
<param name="type">Type of texture to bind</param> <param name="type">Type of texture to bind</param>
<param name="texture">Sign of texture</param> <param name="texture">Sign of texture</param>
</member> </member>
<member name="M:StgSharp.Graphics.IglFunc.BindVertexArray(System.glHandle)"> <member name="M:StgSharp.Graphics.IglFunc.BindVertexArray(StgSharp.Graphics.glHandle)">
<summary> <summary>
Same function as OpenGL api, glBindVertexArray Same function as OpenGL api, glBindVertexArray
</summary> </summary>
@@ -379,15 +398,6 @@
<param name="B">Specify the red values used when the color buffers are cleared.</param> <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> <param name="A">Specify the red values used when the color buffers are cleared.</param>
</member> </member>
<member name="M:StgSharp.Graphics.IglFunc.CompileShader(StgSharp.Graphics.ShaderType,System.String[])">
<summary>
Conpile the provided shader code in string form.
</summary>
<param name="shaderCodeArray">A string array contains all shaders' code</param>
<param name="shaderType">An <see cref="T:StgSharp.Graphics.ShaderType"/> enum represent the type of the shader to
conpile, including vertex shader and fragment shader.</param>
<returns>An handle of conpiled shader</returns>
</member>
<member name="M:StgSharp.Graphics.IglFunc.CreateProgram"> <member name="M:StgSharp.Graphics.IglFunc.CreateProgram">
<summary> <summary>
Same function as OpenGL api, glCreateProgram Same function as OpenGL api, glCreateProgram
@@ -412,19 +422,19 @@
<param name="share"></param> <param name="share"></param>
<exception cref="T:System.Exception"></exception> <exception cref="T:System.Exception"></exception>
</member> </member>
<member name="M:StgSharp.Graphics.IglFunc.DeleteBuffer(System.glHandle)"> <member name="M:StgSharp.Graphics.IglFunc.DeleteBuffer(StgSharp.Graphics.glHandle)">
<summary> <summary>
Same function as OpenGL api, glDeleteBuffer. This method can delete one buffer in one call Same function as OpenGL api, glDeleteBuffer. This method can delete one buffer in one call
</summary> </summary>
<param name="handle">a handle representing the buffer to be deleted</param> <param name="handle">a handle representing the buffer to be deleted</param>
</member> </member>
<member name="M:StgSharp.Graphics.IglFunc.DeleteBuffers(System.glHandleSet)"> <member name="M:StgSharp.Graphics.IglFunc.DeleteBuffers(StgSharp.Graphics.glHandleSet)">
<summary> <summary>
Same function as OpenGL api, glDeleteBuffer. This method can delete a sets of buffers in one call. Same function as OpenGL api, glDeleteBuffer. This method can delete a sets of buffers in one call.
</summary> </summary>
<param name="handleSet">Array of buffers to be deleted</param> <param name="handleSet">Array of buffers to be deleted</param>
</member> </member>
<member name="M:StgSharp.Graphics.IglFunc.DeleteVertexArrays(System.glHandleSet)"> <member name="M:StgSharp.Graphics.IglFunc.DeleteVertexArrays(StgSharp.Graphics.glHandleSet)">
<summary> <summary>
Same function as OpenGL api, glDeleteVertexArrays Same function as OpenGL api, glDeleteVertexArrays
</summary> </summary>
@@ -458,7 +468,7 @@
</summary> </summary>
<param name="count">Amount of vao to be generated</param> <param name="count">Amount of vao to be generated</param>
</member> </member>
<member name="M:StgSharp.Graphics.IglFunc.GetUniformLocation(System.glHandle,System.String)"> <member name="M:StgSharp.Graphics.IglFunc.GetUniformLocation(StgSharp.Graphics.glHandle,System.String)">
<summary> <summary>
Same fucntion as OpenGL api, glGetUniformLocation Same fucntion as OpenGL api, glGetUniformLocation
</summary> </summary>
@@ -545,7 +555,7 @@
<param name="stride">Pixels stride of each sets of data</param> <param name="stride">Pixels stride of each sets of data</param>
<param name="pointer"></param> <param name="pointer"></param>
</member> </member>
<member name="M:StgSharp.Graphics.IglFunc.TextureImage2d``1(System.Int32,System.Int32,System.UInt32,System.UInt32,System.UInt32,System.UInt32,System.UInt32,System.glHandle)"> <member name="M:StgSharp.Graphics.IglFunc.TextureImage2d``1(System.Int32,System.Int32,System.UInt32,System.UInt32,System.UInt32,System.UInt32,System.UInt32,StgSharp.Graphics.glHandle)">
<summary> <summary>
Same function as OpenGL api glTexImage2d Same function as OpenGL api glTexImage2d
</summary> </summary>
@@ -566,7 +576,7 @@
<param name="pname">name of parameter</param> <param name="pname">name of parameter</param>
<param name="param">value of parameter</param> <param name="param">value of parameter</param>
</member> </member>
<member name="M:StgSharp.Graphics.IglFunc.UseProgram(System.glHandle)"> <member name="M:StgSharp.Graphics.IglFunc.UseProgram(StgSharp.Graphics.glHandle)">
<summary> <summary>
Same fucntion as OpenGL api glUseShader. Same fucntion as OpenGL api glUseShader.
</summary> </summary>
@@ -905,31 +915,6 @@
</summary> </summary>
<returns></returns> <returns></returns>
</member> </member>
<member name="T:System.glHandle">
<summary>
A handle to an OpenGL object,
must be indexed from a <see cref="T:System.glHandleSet"/>.
Direct call will cause <see langword="InvalidOperationException"/>
</summary>
</member>
<member name="T:System.glHandleSet">
<summary>
A handle to an OpenGL object.
</summary>
</member>
<member name="M:System.glHandleSet.Free">
<summary>
temporarily release the handle of GLhandle sets.
Please call <see cref="M:System.glHandleSet.Pin"/> method before indexing.
</summary>
</member>
<member name="M:System.glHandleSet.Release">
<summary>
Realse all resource in this handle.
This will release all resource in this <see cref="T:System.glHandle"/>.
This <see langword="glHandle"/> will be not usable.
</summary>
</member>
<member name="T:Windows.Win32.Foundation.COLORREF"> <member name="T:Windows.Win32.Foundation.COLORREF">
<summary>The COLORREF value is used to specify an RGB color.</summary> <summary>The COLORREF value is used to specify an RGB color.</summary>
<remarks> <remarks>
+3 -2
View File
@@ -1,6 +1,7 @@
using StgSharp.Controlling; using StgSharp.Controlling;
using StgSharp.Graphics; using StgSharp.Graphics;
using StgSharp.Math; using StgSharp.Math;
using System; using System;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
@@ -187,7 +188,7 @@ namespace StgSharp.Graphics
internal unsafe delegate*<uint, uint, int, int, int, int, int, int, int, int, uint, uint, void> glBlitNamedFramebuffer; internal unsafe delegate*<uint, uint, int, int, int, int, int, int, int, int, uint, uint, void> glBlitNamedFramebuffer;
internal unsafe delegate*<uint, uint, ulong, UIntPtr, void> glBufferAddressRangeNV; internal unsafe delegate*<uint, uint, ulong, UIntPtr, void> glBufferAddressRangeNV;
internal unsafe delegate*<uint, uint, ulong, void> glBufferAttachMemoryNV; internal unsafe delegate*<uint, uint, ulong, void> glBufferAttachMemoryNV;
internal unsafe delegate*<uint, IntPtr, void*, uint, void> glBufferData; internal unsafe delegate*<uint, IntPtr, IntPtr, uint, void> glBufferData;
internal unsafe delegate*<uint, IntPtr, void*, uint, void> glBufferDataARB; internal unsafe delegate*<uint, IntPtr, void*, uint, void> glBufferDataARB;
internal unsafe delegate*<uint, IntPtr, UIntPtr, bool, void> glBufferPageCommitmentARB; internal unsafe delegate*<uint, IntPtr, UIntPtr, bool, void> glBufferPageCommitmentARB;
internal unsafe delegate*<uint, IntPtr, UIntPtr, uint, ulong, bool, void> glBufferPageCommitmentMemNV; internal unsafe delegate*<uint, IntPtr, UIntPtr, uint, ulong, bool, void> glBufferPageCommitmentMemNV;
@@ -1823,7 +1824,7 @@ namespace StgSharp.Graphics
internal unsafe delegate*<uint, uint, uint, void> glShaderOp1EXT; internal unsafe delegate*<uint, uint, uint, void> glShaderOp1EXT;
internal unsafe delegate*<uint, uint, uint, uint, void> glShaderOp2EXT; internal unsafe delegate*<uint, uint, uint, uint, void> glShaderOp2EXT;
internal unsafe delegate*<uint, uint, uint, uint, uint, void> glShaderOp3EXT; internal unsafe delegate*<uint, uint, uint, uint, uint, void> glShaderOp3EXT;
internal unsafe delegate*<uint, uint, byte*, string, byte*, void> glShaderSource; internal unsafe delegate* unmanaged[Stdcall]<uint, uint, byte**, void*, void> glShaderSource;
internal unsafe delegate*<GLhandleARB, uint, byte**, int*, void> glShaderSourceARB; internal unsafe delegate*<GLhandleARB, uint, byte**, int*, void> glShaderSourceARB;
internal unsafe delegate*<uint, uint, uint, void> glShaderStorageBlockBinding; internal unsafe delegate*<uint, uint, uint, void> glShaderStorageBlockBinding;
internal unsafe delegate*<bool, void> glShadingRateImageBarrierNV; internal unsafe delegate*<bool, void> glShadingRateImageBarrierNV;
@@ -104,6 +104,7 @@ namespace StgSharp
internal static void InternalWriteLog(string logLine, LogType logType) internal static void InternalWriteLog(string logLine, LogType logType)
{ {
logSyncSemaphore.Wait();
if (!File.Exists(SS_errorlog)) if (!File.Exists(SS_errorlog))
{ {
FileStream stream = File.Create(SS_errorlog); FileStream stream = File.Create(SS_errorlog);
@@ -115,6 +116,7 @@ namespace StgSharp
logStream.WriteLine($"{logType}\t@\t{DateTime.Now.ToString("o")}"); logStream.WriteLine($"{logType}\t@\t{DateTime.Now.ToString("o")}");
logStream.WriteLine(logLine); logStream.WriteLine(logLine);
} }
logSyncSemaphore.Release(1);
} }
} }
} }
@@ -1,36 +1,37 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
/**/ /**/
namespace StgSharp.Graphics namespace StgSharp.Graphics
{ {
//rename types in style of GLFW //rename types in style of GLFW
using GLFWbool = Boolean; using GLFWbool = Boolean;
//strucs defined in GLFW3.h //strucs defined in GLFW3.h
#region GLFW3 struct #region GLFW3 struct
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWcontext public unsafe struct GLFWcontext
{ {
int client; private int client;
int source; private int source;
int major, minor, revision; private int major, minor, revision;
GLFWbool forward, debug, noerror; private GLFWbool forward, debug, noerror;
int profile; private int profile;
int robustness; private int robustness;
int release; private int release;
//PFNGLGETSTRINGIPROC GetStringi; //PFNGLGETSTRINGIPROC GetStringi;
IntPtr GetStringi; private IntPtr GetStringi;
//PFNGLGETINTEGERVPROC GetIntegerv; //PFNGLGETINTEGERVPROC GetIntegerv;
IntPtr GetIntegerv; private IntPtr GetIntegerv;
//PFNGLGETSTRINGPROC GetString; //PFNGLGETSTRINGPROC GetString;
IntPtr GetString; private IntPtr GetString;
/* /*
void (* makeCurrent) (GLFWwindow*); void (* makeCurrent) (GLFWwindow*);
@@ -41,12 +42,12 @@ namespace StgSharp.Graphics
void (* destroy) (GLFWwindow*); void (* destroy) (GLFWwindow*);
*/ */
delegate*<GLFWwindow*> makeCurrent; private delegate*<GLFWwindow*> makeCurrent;
delegate*<GLFWwindow*> swapBuffer; private delegate*<GLFWwindow*> swapBuffer;
delegate*<int> swapInterval; private delegate*<int> swapInterval;
delegate*<byte*> extensionSupported; private delegate*<byte*> extensionSupported;
delegate*<delegate*<void>, void> getProcAddress; private delegate*<delegate*<void>, void> getProcAddress;
IntPtr destroy; private IntPtr destroy;
internal struct egl internal struct egl
{ {
@@ -55,24 +56,24 @@ namespace StgSharp.Graphics
EGLContext handle; EGLContext handle;
EGLSurface surface; EGLSurface surface;
*/ */
void* config; private void* config;
void* handle; private void* handle;
void* surface; private void* surface;
void* client; private void* client;
} }
internal struct osmesa internal struct osmesa
{ {
//OSMesaContext handle; //OSMesaContext handle;
void* handle; private void* handle;
int width;
int height; private int width;
void* buffer; private int height;
private void* buffer;
} }
// This is defined in platform.h // This is defined in platform.h
//GLFW_PLATFORM_CONTEXT_STATE //GLFW_PLATFORM_CONTEXT_STATE
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
@@ -95,46 +96,43 @@ namespace StgSharp.Graphics
public int blueBits; public int blueBits;
/*! The refresh rate, in Hz, of the video mode. /*! The refresh rate, in Hz, of the video mode.
*/ */
int refreshRate; private int refreshRate;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWgammaramp public unsafe struct GLFWgammaramp
{ {
/*! An array of value describing the response of the red channel. /*! An array of value describing the response of the red channel.
*/ */
ushort* red; private ushort* red;
/*! An array of value describing the response of the green channel. /*! An array of value describing the response of the green channel.
*/ */
ushort* green; private ushort* green;
/*! An array of value describing the response of the blue channel. /*! An array of value describing the response of the blue channel.
*/ */
ushort* blue; private ushort* blue;
/*! The number of elements in each array. /*! The number of elements in each array.
*/ */
uint size; private uint size;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWimage public unsafe struct GLFWimage
{ {
/*! The width, in pixels, of this image. /*! The width, in pixels, of this image.
*/ */
int width; private int width;
/*! The height, in pixels, of this image. /*! The height, in pixels, of this image.
*/ */
int height; private int height;
/*! The pixel data of this image, arranged left-to-right, top-to-bottom. /*! The pixel data of this image, arranged left-to-right, top-to-bottom.
*/ */
byte* pixels; private byte* pixels;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWgamepadstate public unsafe struct GLFWgamepadstate
{ {
/*! The states of each [gamepad button](@ref gamepad_buttons), `GLFW_PRESS` /*! The states of each [gamepad button](@ref gamepad_buttons), `GLFW_PRESS`
* or `GLFW_RELEASE`. * or `GLFW_RELEASE`.
*/ */
@@ -149,40 +147,44 @@ namespace StgSharp.Graphics
public unsafe struct GLFWallocator public unsafe struct GLFWallocator
{ {
//GLFWallocatefun allocate; //GLFWallocatefun allocate;
IntPtr allocate; private IntPtr allocate;
//GLFWreallocatefun reallocate; //GLFWreallocatefun reallocate;
IntPtr reallocate; private IntPtr reallocate;
//GLFWdeallocatefun deallocate; //GLFWdeallocatefun deallocate;
IntPtr deallocate; private IntPtr deallocate;
void* user;
private void* user;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWmonitor public unsafe struct GLFWmonitor
{ {
private byte[] name = new byte[128];
byte[] name = new byte[128]; private void* userPointer;
void* userPointer;
// Physical dimensions in millimeters. // Physical dimensions in millimeters.
int widthMM, heightMM; private int widthMM, heightMM;
// The window whose video mode is current on this monitor // The window whose video mode is current on this monitor
//GLFWwindow* window; //GLFWwindow* window;
IntPtr window; private IntPtr window;
//GLFWvidmode* modes; //GLFWvidmode* modes;
IntPtr modes; private IntPtr modes;
int modeCount;
GLFWvidmode currentMode;
GLFWgammaramp originalRamp; private int modeCount;
GLFWgammaramp currentRamp; private GLFWvidmode currentMode;
private GLFWgammaramp originalRamp;
private GLFWgammaramp currentRamp;
// not transformed // not transformed
//GLFW_PLATFORM_MONITOR_STATE; //GLFW_PLATFORM_MONITOR_STATE;
public GLFWmonitor() { } public GLFWmonitor()
{ }
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
@@ -214,15 +216,16 @@ namespace StgSharp.Graphics
public int cursorMode = 0; public int cursorMode = 0;
public fixed byte mouseButtons[8]; public fixed byte mouseButtons[8];
public fixed byte keys[349]; public fixed byte keys[349];
// Virtual cursor position when cursor is disabled // Virtual cursor position when cursor is disabled
public double virtualCursorPosX = 0, virtualCursorPosY = 0; public double virtualCursorPosX = 0, virtualCursorPosY = 0;
public bool rawMouseMotion = false; public bool rawMouseMotion = false;
public GLFWcontext context = default; public GLFWcontext context = default;
public GLFWwindow() public GLFWwindow()
{ {
} }
} }
@@ -230,7 +233,7 @@ namespace StgSharp.Graphics
public struct GLFWcursor public struct GLFWcursor
{ {
//GLFWcursor* next; //GLFWcursor* next;
IntPtr next; private IntPtr next;
// This is defined in platform.h // This is defined in platform.h
// not completed in tranformation // not completed in tranformation
@@ -241,7 +244,6 @@ namespace StgSharp.Graphics
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWerror public unsafe struct GLFWerror
{ {
//GLFWerror* next; //GLFWerror* next;
IntPtr next; IntPtr next;
int code; int code;
@@ -257,61 +259,64 @@ namespace StgSharp.Graphics
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWinitconfig public unsafe struct GLFWinitconfig
{ {
private GLFWbool hatButtons;
private int angleType;
private int platformID;
GLFWbool hatButtons;
int angleType;
int platformID;
//PFN_vkGetInstanceProcAddr vulkanLoader; //PFN_vkGetInstanceProcAddr vulkanLoader;
IntPtr vulkanLoader; private IntPtr vulkanLoader;
struct ns
private struct ns
{ {
GLFWbool menubar; private GLFWbool menubar;
GLFWbool chdir; private GLFWbool chdir;
} }
struct x11
private struct x11
{ {
GLFWbool xcbVulkanSurface; private GLFWbool xcbVulkanSurface;
} }
struct wl
private struct wl
{ {
int libdecorMode; private int libdecorMode;
} }
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWwndconfig public unsafe struct GLFWwndconfig
{ {
private int xpos;
private int ypos;
private int width;
private int height;
private byte* title;
private GLFWbool resizable;
private GLFWbool visible;
private GLFWbool decorated;
private GLFWbool focused;
private GLFWbool autoIconify;
private GLFWbool floating;
private GLFWbool maximized;
private GLFWbool centerCursor;
private GLFWbool focusOnShow;
private GLFWbool mousePassthrough;
private GLFWbool scaleToMonitor;
int xpos;
int ypos;
int width;
int height;
byte* title;
GLFWbool resizable;
GLFWbool visible;
GLFWbool decorated;
GLFWbool focused;
GLFWbool autoIconify;
GLFWbool floating;
GLFWbool maximized;
GLFWbool centerCursor;
GLFWbool focusOnShow;
GLFWbool mousePassthrough;
GLFWbool scaleToMonitor;
internal struct Ns internal struct Ns
{ {
GLFWbool retina = false; private GLFWbool retina = false;
public fixed byte frameName[256]; public fixed byte frameName[256];
public Ns() public Ns()
{ {
} }
} }
internal Ns ns = new Ns(); internal Ns ns = new Ns();
internal struct X11 internal struct X11
{ {
public fixed byte className[256]; public fixed byte className[256];
public fixed byte instanceName[256]; public fixed byte instanceName[256];
@@ -319,12 +324,14 @@ namespace StgSharp.Graphics
{ {
} }
} }
internal X11 x11 = new X11(); internal X11 x11 = new X11();
internal struct Win32 internal struct Win32
{ {
GLFWbool keymenu; private GLFWbool keymenu;
} }
internal Win32 win32 = new Win32(); internal Win32 win32 = new Win32();
internal struct Wl internal struct Wl
@@ -335,6 +342,7 @@ namespace StgSharp.Graphics
{ {
} }
} }
internal Wl wl = new Wl(); internal Wl wl = new Wl();
public GLFWwndconfig() public GLFWwndconfig()
@@ -345,22 +353,25 @@ namespace StgSharp.Graphics
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWctxconfig public unsafe struct GLFWctxconfig
{ {
int client; private int client;
int source; private int source;
int major; private int major;
int minor; private int minor;
GLFWbool forward; private GLFWbool forward;
GLFWbool debug; private GLFWbool debug;
GLFWbool noerror; private GLFWbool noerror;
int profile; private int profile;
int robustness; private int robustness;
int release; private int release;
//GLFWwindow* share; //GLFWwindow* share;
IntPtr share; private IntPtr share;
internal struct Nsgl internal struct Nsgl
{ {
GLFWbool offline; private GLFWbool offline;
} }
internal Nsgl nsgl = new Nsgl(); internal Nsgl nsgl = new Nsgl();
public GLFWctxconfig() public GLFWctxconfig()
@@ -371,78 +382,81 @@ namespace StgSharp.Graphics
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWfbconfig public unsafe struct GLFWfbconfig
{ {
private int redBits;
int redBits; private int greenBits;
int greenBits; private int blueBits;
int blueBits; private int alphaBits;
int alphaBits; private int depthBits;
int depthBits; private int stencilBits;
int stencilBits; private int accumRedBits;
int accumRedBits; private int accumGreenBits;
int accumGreenBits; private int accumBlueBits;
int accumBlueBits; private int accumAlphaBits;
int accumAlphaBits; private int auxBuffers;
int auxBuffers; private GLFWbool stereo;
GLFWbool stereo; private int samples;
int samples; private GLFWbool sRGB;
GLFWbool sRGB; private GLFWbool doublebuffer;
GLFWbool doublebuffer; private GLFWbool transparent;
GLFWbool transparent; private uintptr_t handle;
uintptr_t handle;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
internal unsafe struct GLFWlibrary internal unsafe struct GLFWlibrary
{ {
GLFWbool initialized; private GLFWbool initialized;
GLFWallocator allocator; private GLFWallocator allocator;
GLFWplatform platform; private GLFWplatform platform;
internal unsafe struct Hints internal unsafe struct Hints
{ {
GLFWinitconfig init; private GLFWinitconfig init;
GLFWfbconfig framebuffer; private GLFWfbconfig framebuffer;
GLFWwndconfig window; private GLFWwndconfig window;
GLFWctxconfig context; private GLFWctxconfig context;
int refreshRate; private int refreshRate;
} }
internal Hints hints = new Hints(); internal Hints hints = new Hints();
//GLFWerror* errorListHead; //GLFWerror* errorListHead;
IntPtr errorListHead; private IntPtr errorListHead;
//GLFWcursor* cursorListHead; //GLFWcursor* cursorListHead;
IntPtr cursorListHead; private IntPtr cursorListHead;
//GLFWwindow* windowListHead; //GLFWwindow* windowListHead;
IntPtr windowListHead; private IntPtr windowListHead;
//GLFWmonitor** monitors; //GLFWmonitor** monitors;
IntPtr monitors; private IntPtr monitors;
int monitorCount;
private int monitorCount;
private GLFWbool joysticksInitialized;
GLFWbool joysticksInitialized;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = GLconst.GLFW_JOYSTICK_LAST + 1)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = GLconst.GLFW_JOYSTICK_LAST + 1)]
GLFWjoystick[] joysticks = new GLFWjoystick[GLconst.GLFW_JOYSTICK_LAST + 1]; private GLFWjoystick[] joysticks = new GLFWjoystick[GLconst.GLFW_JOYSTICK_LAST + 1];
//GLFWmapping* mappings;
IntPtr mappings;
int mappingCount;
GLFWls errorSlot; //GLFWmapping* mappings;
GLFWls contextSlot; private IntPtr mappings;
GLFWmutex errorLock;
private int mappingCount;
private GLFWls errorSlot;
private GLFWls contextSlot;
private GLFWmutex errorLock;
internal unsafe struct timer internal unsafe struct timer
{ {
ulong offset; private ulong offset;
// This is defined in platform.h // This is defined in platform.h
//not transformed function defination //not transformed function defination
//GLFW_PLATFORM_LIBRARY_TIMER_STATE //GLFW_PLATFORM_LIBRARY_TIMER_STATE
} }
internal unsafe struct Egl internal unsafe struct Egl
{ {
internal int platform; internal int platform;
@@ -488,101 +502,105 @@ namespace StgSharp.Graphics
internal IntPtr GetPlatformDisplayEXT; internal IntPtr GetPlatformDisplayEXT;
internal IntPtr CreatePlatformWindowSurfaceEXT; internal IntPtr CreatePlatformWindowSurfaceEXT;
} }
internal Egl egl = new Egl(); internal Egl egl = new Egl();
internal unsafe struct Osmesa internal unsafe struct Osmesa
{ {
void* handle; private void* handle;
IntPtr CreateContextExt; private IntPtr CreateContextExt;
IntPtr CreateContextAttribs; private IntPtr CreateContextAttribs;
IntPtr DestroyContext; private IntPtr DestroyContext;
IntPtr MakeCurrent; private IntPtr MakeCurrent;
IntPtr GetColorBuffer; private IntPtr GetColorBuffer;
IntPtr GetDepthBuffer; private IntPtr GetDepthBuffer;
IntPtr GetProcAddress; private IntPtr GetProcAddress;
} }
internal Osmesa osmesa = new Osmesa(); internal Osmesa osmesa = new Osmesa();
internal unsafe struct vk internal unsafe struct vk
{ {
GLFWbool available; private GLFWbool available;
void* handle; private void* handle;
fixed ulong extensions[2]; private fixed ulong extensions[2];
IntPtr GetInstanceProcAddr; private IntPtr GetInstanceProcAddr;
GLFWbool KHR_surface; private GLFWbool KHR_surface;
GLFWbool KHR_win32_surface; private GLFWbool KHR_win32_surface;
GLFWbool MVK_macos_surface; private GLFWbool MVK_macos_surface;
GLFWbool EXT_metal_surface; private GLFWbool EXT_metal_surface;
GLFWbool KHR_xlib_surface; private GLFWbool KHR_xlib_surface;
GLFWbool KHR_xcb_surface; private GLFWbool KHR_xcb_surface;
GLFWbool KHR_wayland_surface; private GLFWbool KHR_wayland_surface;
public vk() public vk()
{ {
} }
} }
internal unsafe struct Callbacks internal unsafe struct Callbacks
{ {
IntPtr monitor; private IntPtr monitor;
IntPtr joystick; private IntPtr joystick;
} }
internal Callbacks callbacks = new Callbacks(); internal Callbacks callbacks = new Callbacks();
public GLFWlibrary() public GLFWlibrary()
{ {
} }
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWmapelement public unsafe struct GLFWmapelement
{ {
byte type; private byte type;
byte index; private byte index;
sbyte axisScale; private sbyte axisScale;
sbyte axisOffset; private sbyte axisOffset;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWmapping public unsafe struct GLFWmapping
{ {
private fixed byte name[128];
private fixed byte guid[33];
fixed byte name[128];
fixed byte guid[33];
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)]
GLFWmapelement[] buttons = new GLFWmapelement[15]; private GLFWmapelement[] buttons = new GLFWmapelement[15];
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
GLFWmapelement[] axes = new GLFWmapelement[6];
public GLFWmapping() { } [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
private GLFWmapelement[] axes = new GLFWmapelement[6];
public GLFWmapping()
{ }
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWjoystick public unsafe struct GLFWjoystick
{ {
private GLFWbool allocated;
private GLFWbool connected;
private float* axes;
private int axisCount;
private byte* buttons;
private int buttonCount;
private byte* hats;
private int hatCount;
private fixed byte name[128];
private void* userPointer;
private fixed byte guid[33];
GLFWbool allocated;
GLFWbool connected;
float* axes;
int axisCount;
byte* buttons;
int buttonCount;
byte* hats;
int hatCount;
fixed byte name[128];
void* userPointer;
fixed byte guid[33];
//GLFWmapping* mapping; //GLFWmapping* mapping;
IntPtr mapping; private IntPtr mapping;
// This is defined in platform.h // This is defined in platform.h
// not completed in transforming // not completed in transforming
// GLFW_PLATFORM_JOYSTICK_STATE; // GLFW_PLATFORM_JOYSTICK_STATE;
public GLFWjoystick() { } public GLFWjoystick()
{ }
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
@@ -596,13 +614,14 @@ namespace StgSharp.Graphics
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public unsafe struct GLFWplatform public unsafe struct GLFWplatform
{ {
private int platformID;
int platformID;
// init // init
//GLFWbool(*init)(void); //GLFWbool(*init)(void);
IntPtr init; private IntPtr init;
//void (* terminate) (void); //void (* terminate) (void);
IntPtr terminate; private IntPtr terminate;
// input // input
/* void (* getCursorPos) (GLFWwindow*, double*, double*); /* void (* getCursorPos) (GLFWwindow*, double*, double*);
@@ -688,8 +707,10 @@ namespace StgSharp.Graphics
internal IntPtr pollJoystick; internal IntPtr pollJoystick;
internal IntPtr getMappingName; internal IntPtr getMappingName;
internal IntPtr updateGamepadGUID; internal IntPtr updateGamepadGUID;
// monitor // monitor
internal IntPtr freeMonitor; internal IntPtr freeMonitor;
internal IntPtr getMonitorPos; internal IntPtr getMonitorPos;
internal IntPtr getMonitorContentScale; internal IntPtr getMonitorContentScale;
internal IntPtr getMonitorWorkarea; internal IntPtr getMonitorWorkarea;
@@ -697,8 +718,10 @@ namespace StgSharp.Graphics
internal IntPtr getVideoMode; internal IntPtr getVideoMode;
internal IntPtr getGammaRamp; internal IntPtr getGammaRamp;
internal IntPtr setGammaRamp; internal IntPtr setGammaRamp;
// window // window
internal IntPtr createWindow; internal IntPtr createWindow;
internal IntPtr destroyWindow; internal IntPtr destroyWindow;
internal IntPtr setWindowTitle; internal IntPtr setWindowTitle;
internal IntPtr setWindowIcon; internal IntPtr setWindowIcon;
@@ -736,25 +759,23 @@ namespace StgSharp.Graphics
internal IntPtr waitEventsTimeout; internal IntPtr waitEventsTimeout;
internal IntPtr postEmptyEvent; internal IntPtr postEmptyEvent;
// EGL // EGL
//EGLenum(*getEGLPlatform)(EGLint**); //EGLenum(*getEGLPlatform)(EGLint**);
//EGLNativeDisplayType(*getEGLNativeDisplay)(void); //EGLNativeDisplayType(*getEGLNativeDisplay)(void);
//EGLNativeWindowType(*getEGLNativeWindow)(GLFWwindow*); //EGLNativeWindowType(*getEGLNativeWindow)(GLFWwindow*);
internal IntPtr getEGLPlatform; internal IntPtr getEGLPlatform;
internal IntPtr getEGLNativeDisplay; internal IntPtr getEGLNativeDisplay;
internal IntPtr getEGLNativeWindow; internal IntPtr getEGLNativeWindow;
// vulkan // vulkan
//void (* getRequiredInstanceExtensions) (byte**); //void (* getRequiredInstanceExtensions) (byte**);
//GLFWbool(*getPhysicalDevicePresentationSupport)(VkInstance, VkPhysicalDevice, uint32_t); //GLFWbool(*getPhysicalDevicePresentationSupport)(VkInstance, VkPhysicalDevice, uint32_t);
//VkResult(*createWindowSurface)(VkInstance, GLFWwindow*,const VkAllocationCallbacks*, VkSurfaceKHR*); //VkResult(*createWindowSurface)(VkInstance, GLFWwindow*,const VkAllocationCallbacks*, VkSurfaceKHR*);
internal IntPtr getRequiredInstanceExtensions; internal IntPtr getRequiredInstanceExtensions;
internal IntPtr VkPhysicalDevice; internal IntPtr VkPhysicalDevice;
internal IntPtr GLFWwindow; internal IntPtr GLFWwindow;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
@@ -769,8 +790,8 @@ namespace StgSharp.Graphics
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
internal unsafe struct VkExtensionProperties internal unsafe struct VkExtensionProperties
{ {
fixed byte extensionName[256]; private fixed byte extensionName[256];
uint specVersion; private uint specVersion;
public VkExtensionProperties() public VkExtensionProperties()
{ {
@@ -792,27 +813,26 @@ namespace StgSharp.Graphics
} }
*/ */
[StructLayout(LayoutKind.Explicit, Size = 16)] [StructLayout(LayoutKind.Explicit, Size = 16)]
public struct uintptr_t public struct uintptr_t
{ {
[FieldOffset(0)] [FieldOffset(0)]
long part1; private long part1;
[FieldOffset(8)] [FieldOffset(8)]
long part2; private long part2;
} }
#endregion
#endregion GLFW3 struct
#region glad struct #region glad struct
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
internal struct GLsync internal struct GLsync
{ {
} }
#endregion glad struct
#endregion
} }
/**/ /**/
+19 -4
View File
@@ -2,6 +2,7 @@
using StgSharp.Controlling; using StgSharp.Controlling;
using StgSharp.Logic; using StgSharp.Logic;
using StgSharp.Math; using StgSharp.Math;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
@@ -272,7 +273,7 @@ namespace StgSharp.Graphics
else else
{ {
M128 m = default; M128 m = default;
m.UInt64[0] = (ulong)windowID; m.Write<ulong>(0, (ulong)windowID);
GLonUpdate glu = gl as GLonUpdate; GLonUpdate glu = gl as GLonUpdate;
glu.frameworkHandleEnqueue( glu.frameworkHandleEnqueue(
(IntPtr)(delegate*<void>)&InternalSwapBuffer, m); (IntPtr)(delegate*<void>)&InternalSwapBuffer, m);
@@ -405,13 +406,27 @@ namespace StgSharp.Graphics
ConcurrentQueue<IntPtr> glActions = (gl as GLonUpdate).GLactionQueue; ConcurrentQueue<IntPtr> glActions = (gl as GLonUpdate).GLactionQueue;
#pragma warning restore CS8602 #pragma warning restore CS8602
IntPtr currentOperation; IntPtr currentOperation;
while (gl.GetWindowShouldClose(this)) TimeSpan span = new TimeSpan(100L);
try
{ {
if (glActions.TryDequeue(out currentOperation)) while (gl.GetWindowShouldClose(this))
{ {
((delegate*<void>)currentOperation)(); if (glActions.TryDequeue(out currentOperation))
{
((delegate*<void>)currentOperation)();
}
else
{
Thread.Sleep(span);
}
} }
} }
catch (Exception e)
{
this.ShouldClose = true;
(gl as GLonUpdate).ShowDequeueStream();
throw;
}
} }
#endregion form main #endregion form main
+2 -1
View File
@@ -1,5 +1,6 @@
using StgSharp; using StgSharp;
using StgSharp.Logic; using StgSharp.Logic;
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Threading; using System.Threading;
@@ -9,7 +10,6 @@ namespace StgSharp.Graphics
{ {
public partial class Form public partial class Form
{ {
private bool isFullyRendered = false; private bool isFullyRendered = false;
internal class FrameUpdateTimer internal class FrameUpdateTimer
@@ -29,6 +29,7 @@ namespace StgSharp.Graphics
{ {
get { return tickCounter; } get { return tickCounter; }
} }
internal void Refresh() internal void Refresh()
{ {
refreshed = false; refreshed = false;
+7 -7
View File
@@ -1,4 +1,5 @@
using StgSharp.Math; using StgSharp.Math;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
@@ -7,11 +8,9 @@ using System.Text;
namespace StgSharp.Graphics namespace StgSharp.Graphics
{ {
/// <summary> /// <summary>
/// A collecion of handle to Element Buffer Object in OpenGL. /// A collecion of handle to Element Buffer Object in OpenGL.
/// Each <see langword="int"/> value indexed from instance of this class this /// Each <see langword="uint"/> value indexed from instance of this class this
/// is the only handle to one Element Buffer Object. /// is the only handle to one Element Buffer Object.
/// </summary> /// </summary>
public unsafe class ElementBuffer : BufferObjectBase public unsafe class ElementBuffer : BufferObjectBase
@@ -22,8 +21,7 @@ namespace StgSharp.Graphics
_bufferHandle = GL.GenBuffers(n); _bufferHandle = GL.GenBuffers(n);
} }
public override sealed void Bind(int index)
public override void Bind(int index)
{ {
GL.BindBuffer(BufferType.ELEMENT_ARRAY_BUFFER, _bufferHandle[index]); GL.BindBuffer(BufferType.ELEMENT_ARRAY_BUFFER, _bufferHandle[index]);
} }
@@ -31,16 +29,18 @@ namespace StgSharp.Graphics
public void SetValue<T>(int index, T[] bufferArray, BufferUsage usage) public void SetValue<T>(int index, T[] bufferArray, BufferUsage usage)
where T : struct, IConvertible where T : struct, IConvertible
{ {
Console.WriteLine("Setting ebo data.");
GL.BindBuffer(BufferType.ELEMENT_ARRAY_BUFFER, _bufferHandle[index]); GL.BindBuffer(BufferType.ELEMENT_ARRAY_BUFFER, _bufferHandle[index]);
GL.SetBufferData(BufferType.ELEMENT_ARRAY_BUFFER, bufferArray, usage); GL.SetBufferData(BufferType.ELEMENT_ARRAY_BUFFER, bufferArray, usage);
} }
protected sealed override void Dispose(bool disposing) protected override sealed void Dispose(bool disposing)
{ {
if (disposing) if (disposing)
{ {
GL.DeleteBuffers(_bufferHandle); GL.DeleteBuffers(_bufferHandle);
_bufferHandle.Release();
} }
} }
} }
} }
+5 -5
View File
@@ -5,7 +5,6 @@ using System.Text;
namespace StgSharp.Graphics namespace StgSharp.Graphics
{ {
public unsafe class VertexArray : BufferObjectBase public unsafe class VertexArray : BufferObjectBase
{ {
internal VertexArray(int n, IglFunc gl) internal VertexArray(int n, IglFunc gl)
@@ -15,7 +14,7 @@ namespace StgSharp.Graphics
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public sealed override void Bind(int index) public override sealed void Bind(int index)
{ {
GL.BindVertexArray(_bufferHandle[index]); GL.BindVertexArray(_bufferHandle[index]);
} }
@@ -23,7 +22,7 @@ namespace StgSharp.Graphics
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public void BindNull() public void BindNull()
{ {
GL.BindVertexArray(glHandle.Alloc(0)); GL.BindVertexArray(glHandle.Zero);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -35,12 +34,13 @@ namespace StgSharp.Graphics
stride, pointer); stride, pointer);
} }
protected sealed override void Dispose(bool disposing) protected override sealed void Dispose(bool disposing)
{ {
if (disposing) if (disposing)
{ {
GL.DeleteVertexArrays(_bufferHandle); GL.DeleteVertexArrays(_bufferHandle);
_bufferHandle.Release();
} }
} }
} }
} }
+7 -7
View File
@@ -1,4 +1,5 @@
using StgSharp.Math; using StgSharp.Math;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Net.Security; using System.Net.Security;
@@ -9,7 +10,6 @@ using System.Text;
namespace StgSharp.Graphics namespace StgSharp.Graphics
{ {
public unsafe class VertexBuffer : BufferObjectBase public unsafe class VertexBuffer : BufferObjectBase
{ {
internal VertexBuffer(int n, IglFunc glFunc) internal VertexBuffer(int n, IglFunc glFunc)
@@ -18,7 +18,7 @@ namespace StgSharp.Graphics
_bufferHandle = GL.GenBuffers(n); _bufferHandle = GL.GenBuffers(n);
} }
public sealed override void Bind(int index) public override sealed void Bind(int index)
{ {
GL.BindBuffer(BufferType.ARRAY_BUFFER, _bufferHandle[index]); GL.BindBuffer(BufferType.ARRAY_BUFFER, _bufferHandle[index]);
} }
@@ -32,9 +32,9 @@ namespace StgSharp.Graphics
/// <param name="usage">How OpenGL use these data, defined by <see cref="BufferUsage"/></param> /// <param name="usage">How OpenGL use these data, defined by <see cref="BufferUsage"/></param>
public void SetValue<T>(int index, T bufferData, BufferUsage usage) where T : IMat public void SetValue<T>(int index, T bufferData, BufferUsage usage) where T : IMat
{ {
Console.WriteLine("Setting vbo data.");
GL.BindBuffer(BufferType.ARRAY_BUFFER, _bufferHandle[index]); GL.BindBuffer(BufferType.ARRAY_BUFFER, _bufferHandle[index]);
GL.SetBufferData(BufferType.ARRAY_BUFFER, bufferData, usage); GL.SetBufferData(BufferType.ARRAY_BUFFER, bufferData, usage);
} }
/// <summary> /// <summary>
@@ -51,7 +51,7 @@ namespace StgSharp.Graphics
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Unbind() public void Unbind()
@@ -65,13 +65,13 @@ namespace StgSharp.Graphics
GL = gl; GL = gl;
} }
protected sealed override void Dispose(bool disposing) protected override sealed void Dispose(bool disposing)
{ {
if (disposing) if (disposing)
{ {
GL.DeleteBuffers(_bufferHandle); GL.DeleteBuffers(_bufferHandle);
_bufferHandle.Release();
} }
} }
} }
} }
+28 -1
View File
@@ -9,8 +9,35 @@ using System.Security.AccessControl;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace System namespace StgSharp.Graphics
{ {
//TODO 发现一个大问题,paramQueue大多数时候取出的是数组,不是数组句柄,也就是说其内存将被长期固定且不能回收,这是内存泄漏
public unsafe class glArrayHandle
{
internal readonly Array copy;
internal GCHandle handle;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public IntPtr AddressOfArray()
{
return handle.AddrOfPinnedObject();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static glArrayHandle Alloc<T>(T[] array) where T : struct
{
Array copy = new T[array.Length];
array.CopyTo(copy, 0);
return new glArrayHandle(copy);
}
internal glArrayHandle(Array array)
{
copy = array;
handle = GCHandle.Alloc(array, GCHandleType.Pinned);
}
}
/// <summary> /// <summary>
/// A handle to an OpenGL object, /// A handle to an OpenGL object,
/// must be indexed from a <see cref="glHandleSet"/>. /// must be indexed from a <see cref="glHandleSet"/>.
+1 -3
View File
@@ -9,7 +9,5 @@ namespace StgSharp.Graphics
{ {
public unsafe partial class Form public unsafe partial class Form
{ {
} }
} }
+30 -48
View File
@@ -54,13 +54,13 @@ namespace StgSharp.Graphics
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
void IglFunc.AttachShader(glHandle program, glHandle shader) void IglFunc.AttachShader(glHandle program, glHandle shader)
{ {
api->glAttachShader(*program.valuePtr, *shader.valuePtr); api->glAttachShader(*program.valuePtr, shader.DirectValue);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
void IglFunc.BindBuffer(BufferType bufferType, glHandle handle) void IglFunc.BindBuffer(BufferType bufferType, glHandle handle)
{ {
api->glBindBuffer((uint)bufferType, *handle.valuePtr); api->glBindBuffer((uint)bufferType, handle.DirectValue);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -93,57 +93,39 @@ namespace StgSharp.Graphics
while (api->glGetError() != 0) { } while (api->glGetError() != 0) { }
} }
glHandleSet IglFunc.CompileShader(ShaderType shaderType, params string[] shaderCodeArray) [MethodImpl(MethodImplOptions.AggressiveInlining)]
unsafe void IglFunc.LoadShaderSource(glHandle shaderHandle, string codeStream)
{ {
int l = shaderCodeArray.Length; byte[] stream = Encoding.UTF8.GetBytes(codeStream);
if (l == 0) fixed (byte* streamPtr = stream)
{ {
throw new ArgumentException("At least one pice of code is required."); api->glShaderSource(shaderHandle.DirectValue, 1, &streamPtr, (void*)0);
} }
glHandleSet handleSet = new glHandleSet(l); }
for (int i = 0; i < l; i++)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
glHandleSet IglFunc.CreateShaderSet(int count, ShaderType type)
{
glHandleSet ret = new glHandleSet(count);
uint t = (uint)type;
for (int i = 0; i < count; i++)
{ {
uint shaderID; uint id = api->glCreateShader(t);
byte[] data = Encoding.UTF8.GetBytes(shaderCodeArray[i] + '\0'); if (id == 0)
fixed (byte* codePtr = data)
{ {
shaderID = InternalIO.InternalLoadShaderCode(api, codePtr, (int)shaderType); uint error = api->glGetError();
InternalIO.InternalWriteLog($"Failed in creating shader: {error}", LogType.Error);
throw new Exception();
} }
if (shaderID == 0) //compile error handler ret.SetValue(i, id);
{
IntPtr logPtr = InternalIO.InternalReadSSCLog();
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.\n" +
"Failed to get GLSL compiler log";
}
InternalIO.InternalWriteLog(log, LogType.Error);
}
handleSet.SetValue(i, shaderID);
} }
return handleSet; return ret;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
void IglFunc.CompileShader(glHandle shaderhandle)
{
api->glCompileShader(shaderhandle.DirectValue);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -301,7 +283,7 @@ namespace StgSharp.Graphics
api->glBufferData( api->glBufferData(
(uint)bufferType, (uint)bufferType,
(IntPtr)size, (IntPtr)size,
&bufferData, (IntPtr)(&bufferData),
(uint)usage); (uint)usage);
} }
@@ -317,7 +299,7 @@ namespace StgSharp.Graphics
api->glBufferData( api->glBufferData(
(uint)bufferType, (uint)bufferType,
(IntPtr)size, (IntPtr)size,
bufferPtr, (IntPtr)bufferPtr,
(uint)usage); (uint)usage);
} }
+18 -8
View File
@@ -18,11 +18,11 @@ namespace StgSharp.Graphics
private FrameTimeoutException refreshSIgnal = new FrameTimeoutException(); private FrameTimeoutException refreshSIgnal = new FrameTimeoutException();
private FrameTimeoutException signal = new FrameTimeoutException("This frame is timeout"); private FrameTimeoutException signal = new FrameTimeoutException("This frame is timeout");
unsafe GLcontext* IglFunc.Context => throw signal;
private GLonTimeout() private GLonTimeout()
{ } { }
unsafe GLcontext* IglFunc.Context => throw signal;
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;
@@ -43,12 +43,17 @@ namespace StgSharp.Graphics
void IglFunc.ClearGraphicError() => throw signal; void IglFunc.ClearGraphicError() => throw signal;
glHandleSet IglFunc.CompileShader(ShaderType shaderType, params string[] shaderCode) => throw signal; public void CompileShader(glHandle shaderhandle)
{
throw signal;
}
glHandle IglFunc.CreateProgram() => throw signal; glHandle IglFunc.CreateProgram() => throw signal;
glHandleSet IglFunc.CreateProgram(int count) => throw signal; glHandleSet IglFunc.CreateProgram(int count) => throw signal;
glHandleSet IglFunc.CreateShaderSet(int count, StgSharp.Graphics.ShaderType type) => 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;
glHandle IglFunc.CreatGraphicProgram() => throw signal; glHandle IglFunc.CreatGraphicProgram() => throw signal;
@@ -71,6 +76,11 @@ namespace StgSharp.Graphics
bool IglFunc.GetWindowShouldClose(Form form) => throw signal; bool IglFunc.GetWindowShouldClose(Form form) => throw signal;
void IglFunc.LoadShaderSource(glHandle shaderHandle, string codeStream)
{
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;
@@ -93,6 +103,11 @@ namespace StgSharp.Graphics
void IglFunc.SetVertexAttribute(uint index, int size, TypeCode t, bool normalized, uint stride, int pointer) => throw signal; void IglFunc.SetVertexAttribute(uint index, int size, TypeCode t, bool normalized, uint stride, int pointer) => throw signal;
void IglFunc.SwitchContext()
{
throw signal;
}
unsafe void IglFunc.TextureImage2d<T>(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, glHandle pixels) => throw signal; unsafe void IglFunc.TextureImage2d<T>(int target, int level, uint internalformat, uint width, uint height, uint format, uint type, glHandle pixels) => throw signal;
void IglFunc.TextureParameter(int target, uint pname, int param) => throw signal; void IglFunc.TextureParameter(int target, uint pname, int param) => throw signal;
@@ -102,10 +117,5 @@ namespace StgSharp.Graphics
void IglFunc.Viewport(int x, int y, uint width, uint height) => throw signal; void IglFunc.Viewport(int x, int y, uint width, uint height) => throw signal;
internal static GLonTimeout Set() => singleInstance; internal static GLonTimeout Set() => singleInstance;
void IglFunc.SwitchContext()
{
throw signal;
}
} }
} }
+54 -42
View File
@@ -17,15 +17,13 @@ namespace StgSharp.Graphics
{ {
private static ConcurrentQueue<IntPtr> glActionQueue; private static ConcurrentQueue<IntPtr> glActionQueue;
private static GLparamQueue paramQueue; private static GLparamQueue paramQueue;
private FrameTimeoutException refreshSignal = new();
private GLcontext* api; private GLcontext* api;
private FrameTimeoutException refreshSignal = new();
private IntPtr SwapBufferPtr = (IntPtr)(delegate*<IntPtr, void>)&InternalIO.glfwSwapBuffers; private IntPtr SwapBufferPtr = (IntPtr)(delegate*<IntPtr, void>)&InternalIO.glfwSwapBuffers;
GLcontext* IglFunc.Context internal void ShowDequeueStream()
{ {
get => api; paramQueue.ShowDequeueLog();
} }
internal GLonUpdate(GLcontext* context) internal GLonUpdate(GLcontext* context)
@@ -38,6 +36,11 @@ namespace StgSharp.Graphics
api = context; api = context;
} }
GLcontext* IglFunc.Context
{
get => api;
}
internal static GLparamQueue ParamQueue internal static GLparamQueue ParamQueue
{ {
get { return paramQueue; } get { return paramQueue; }
@@ -84,8 +87,8 @@ namespace StgSharp.Graphics
void IglFunc.BindBuffer(BufferType bufferType, glHandle handle) void IglFunc.BindBuffer(BufferType bufferType, glHandle handle)
{ {
M128 m = default; M128 m = default;
m.UInt32[0] = (uint)bufferType; m.Write<uint>(0, (uint)bufferType);
m.UInt64[1] = (ulong)handle.Handle; m.Write<ulong>(1, (ulong)handle.valuePtr);
paramQueue.Enqueue(m); paramQueue.Enqueue(m);
glActionQueue.Enqueue(BindBufferPtr); glActionQueue.Enqueue(BindBufferPtr);
} }
@@ -94,8 +97,8 @@ namespace StgSharp.Graphics
void IglFunc.BindTexture(uint type, glHandle texture) void IglFunc.BindTexture(uint type, glHandle texture)
{ {
M128 m = default; M128 m = default;
m.UInt64[1] = (ulong)texture.valuePtr; m.Write<uint>(0, (uint)type);
m.UInt32[0] = (uint)type; m.Write<ulong>(1, (ulong)texture.valuePtr);
paramQueue.Enqueue(m); paramQueue.Enqueue(m);
glActionQueue.Enqueue(BindTexturePtr); glActionQueue.Enqueue(BindTexturePtr);
} }
@@ -110,6 +113,7 @@ namespace StgSharp.Graphics
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
void IglFunc.Clear(MaskBufferBit mask) void IglFunc.Clear(MaskBufferBit mask)
{ {
paramQueue.Enqueue((int)mask);
glActionQueue.Enqueue(ClearPtr); glActionQueue.Enqueue(ClearPtr);
} }
@@ -126,22 +130,10 @@ namespace StgSharp.Graphics
glActionQueue.Enqueue(ClearGraphicErrorPtr); glActionQueue.Enqueue(ClearGraphicErrorPtr);
} }
glHandleSet IglFunc.CompileShader(ShaderType shaderType, params string[] shaderCode) unsafe void IglFunc.CompileShader(glHandle shaderhandle)
{ {
int l = shaderCode.Length; paramQueue.Enqueue((IntPtr)shaderhandle.valuePtr);
if (l == 0)
{
throw new ArgumentException("Should input at least one piece of shader code");
}
glHandleSet shaderHandle = new glHandleSet(shaderCode.Length);
paramQueue.Enqueue((int)shaderType, l);
for (int i = 0; i < l; i++)
{
GCHandle codePtr = GCHandle.Alloc(Encoding.UTF8.GetBytes(shaderCode[i] + '\0'), GCHandleType.Pinned);
paramQueue.Enqueue((IntPtr)(shaderHandle.handle + i), codePtr.AddrOfPinnedObject());
}
glActionQueue.Enqueue(CompileShaderPtr); glActionQueue.Enqueue(CompileShaderPtr);
return shaderHandle;
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -153,18 +145,31 @@ namespace StgSharp.Graphics
return h; return h;
} }
//TODO
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
glHandleSet IglFunc.CreateProgram(int count) glHandleSet IglFunc.CreateProgram(int count)
{ {
M128 m = default; M128 m = default;
glHandleSet h = new glHandleSet(count); glHandleSet h = new glHandleSet(count);
m.UInt64[0] = (ulong)h.handle; m.Write<ulong>(0, (ulong)h.handle);
m.Int32[2] = count; m.Write<int>(2, count);
paramQueue.Enqueue(m); paramQueue.Enqueue(m);
glActionQueue.Enqueue(CreateProgramSetPtr); glActionQueue.Enqueue(CreateProgramSetPtr);
return h; return h;
} }
glHandleSet IglFunc.CreateShaderSet(int count, ShaderType type)
{
glHandleSet ret = new glHandleSet(count);
M128 m = new M128();
m.Write<int>(0, count);
m.Write<uint>(1, (uint)type);
m.Write<ulong>(1, (ulong)ret.handle);
paramQueue.Enqueue(m);
glActionQueue.Enqueue(CreateShaderPtr);
return ret;
}
IntPtr IglFunc.CreateWindowHandle(int width, int height, string tittle, IntPtr monitor, Form share) IntPtr IglFunc.CreateWindowHandle(int width, int height, string tittle, IntPtr monitor, Form share)
{ {
byte[] tittleBytes = Encoding.UTF8.GetBytes(tittle); byte[] tittleBytes = Encoding.UTF8.GetBytes(tittle);
@@ -203,8 +208,8 @@ namespace StgSharp.Graphics
unsafe void IglFunc.DeleteBuffer(glHandle handle) unsafe void IglFunc.DeleteBuffer(glHandle handle)
{ {
M128 m = default; M128 m = default;
m.UInt64[0] = (ulong)handle.Handle; m.Write<ulong>(0, (ulong)handle.valuePtr);
m.UInt32[2] = 1; m.Write(2, 1);
paramQueue.Enqueue(m); paramQueue.Enqueue(m);
glActionQueue.Enqueue(DeleBufferPtr); glActionQueue.Enqueue(DeleBufferPtr);
} }
@@ -212,16 +217,16 @@ namespace StgSharp.Graphics
unsafe void IglFunc.DeleteBuffers(glHandleSet handle) unsafe void IglFunc.DeleteBuffers(glHandleSet handle)
{ {
M128 m = default; M128 m = default;
m.UInt32[2] = (uint)handle.length; m.Write<uint>(2, (uint)handle.length);
m.UInt64[0] = (ulong)handle.handle; m.Write<ulong>(0, (ulong)handle.handle);
paramQueue.Enqueue(m); paramQueue.Enqueue(m);
glActionQueue.Enqueue(DeleBufferPtr); glActionQueue.Enqueue(DeleBufferPtr);
} }
unsafe void IglFunc.DeleteVertexArrays(glHandleSet arrays) unsafe void IglFunc.DeleteVertexArrays(glHandleSet arrays)
{ {
M128 m = default; m.UInt64[1] = (ulong)arrays.handle; M128 m = default; m.Write<ulong>(1, (ulong)arrays.handle);
m.Int32[0] = arrays.length; m.Write<int>(0, arrays.length);
paramQueue.Enqueue(m); paramQueue.Enqueue(m);
glActionQueue.Enqueue(DeleteVertexArrayPtr); glActionQueue.Enqueue(DeleteVertexArrayPtr);
} }
@@ -258,7 +263,7 @@ namespace StgSharp.Graphics
unsafe glHandleSet IglFunc.GenBuffers(int count) unsafe glHandleSet IglFunc.GenBuffers(int count)
{ {
glHandleSet h = new glHandleSet(count); glHandleSet h = new glHandleSet(count);
M128 m = default; m.UInt32[2] = (uint)count; m.UInt64[0] = (ulong)h.handle; M128 m = default; m.Write<uint>(2, (uint)count); m.Write<ulong>(0, (ulong)h.handle);
paramQueue.Enqueue(m); paramQueue.Enqueue(m);
glActionQueue.Enqueue(GenBufferPtr); glActionQueue.Enqueue(GenBufferPtr);
return h; return h;
@@ -267,7 +272,7 @@ namespace StgSharp.Graphics
unsafe glHandleSet IglFunc.GenTextures(int count) unsafe glHandleSet IglFunc.GenTextures(int count)
{ {
glHandleSet h = new glHandleSet(count); glHandleSet h = new glHandleSet(count);
M128 m = default; m.UInt32[2] = (uint)count; m.UInt64[0] = (ulong)h.handle; M128 m = default; m.Write<uint>(2, (uint)count); m.Write<ulong>(0, (ulong)h.handle);
paramQueue.Enqueue(m); paramQueue.Enqueue(m);
glActionQueue.Enqueue(GenTexturesPtr); glActionQueue.Enqueue(GenTexturesPtr);
return h; return h;
@@ -276,7 +281,7 @@ namespace StgSharp.Graphics
unsafe glHandleSet IglFunc.GenVertexArrays(int count) unsafe glHandleSet IglFunc.GenVertexArrays(int count)
{ {
glHandleSet h = new glHandleSet(count); glHandleSet h = new glHandleSet(count);
M128 m = default; m.UInt32[2] = (uint)count; m.UInt64[0] = (ulong)h.handle; M128 m = default; m.Write<uint>(2, (uint)count); m.Write<ulong>(0, (ulong)h.handle);
paramQueue.Enqueue(m); paramQueue.Enqueue(m);
glActionQueue.Enqueue(GenTexturesPtr); glActionQueue.Enqueue(GenTexturesPtr);
return h; return h;
@@ -286,9 +291,9 @@ namespace StgSharp.Graphics
unsafe glSHandle IglFunc.GetUniformLocation(glHandle program, string ptr) unsafe glSHandle IglFunc.GetUniformLocation(glHandle program, string ptr)
{ {
glSHandle h = glSHandle.Alloc(0); glSHandle h = glSHandle.Alloc(0);
M128 m; M128 m = default;
m.UInt64[0] = (ulong)program.Handle; m.Write<ulong>(0, (ulong)program.Handle);
m.UInt64[1] = (ulong)GCHandle.Alloc(Encoding.UTF8.GetBytes(ptr)).AddrOfPinnedObject(); m.Write<ulong>(1, (ulong)GCHandle.Alloc(Encoding.UTF8.GetBytes(ptr)).AddrOfPinnedObject());
paramQueue.Enqueue(m); paramQueue.Enqueue(m);
paramQueue.Enqueue((IntPtr)h.valuePtr); paramQueue.Enqueue((IntPtr)h.valuePtr);
glActionQueue.Enqueue(GetUniformLocationPtr); glActionQueue.Enqueue(GetUniformLocationPtr);
@@ -310,6 +315,12 @@ namespace StgSharp.Graphics
InternalIO.glfwSwapBuffers(form.windowID); InternalIO.glfwSwapBuffers(form.windowID);
} }
void IglFunc.LoadShaderSource(glHandle shaderHandle, string codeStream)
{
paramQueue.Enqueue(shaderHandle);
paramQueue.Enqueue(codeStream);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
void IglFunc.MakeContexCurrent(Form form) void IglFunc.MakeContexCurrent(Form form)
{ {
@@ -330,7 +341,8 @@ namespace StgSharp.Graphics
void IglFunc.SetBufferData<T>(BufferType bufferType, T[] bufferArray, BufferUsage usage) void IglFunc.SetBufferData<T>(BufferType bufferType, T[] bufferArray, BufferUsage usage)
{ {
paramQueue.Enqueue((uint)bufferType, (uint)usage); paramQueue.Enqueue((uint)bufferType, (uint)usage);
paramQueue.Enqueue((IntPtr)(Marshal.SizeOf<T>() * bufferArray.Length), GCHandle.Alloc(bufferArray).AddrOfPinnedObject()); paramQueue.Enqueue((IntPtr)(Marshal.SizeOf<T>() * bufferArray.Length));
paramQueue.Enqueue<T>(bufferArray);
glActionQueue.Enqueue(BufferDataPtr); glActionQueue.Enqueue(BufferDataPtr);
} }
@@ -359,9 +371,9 @@ namespace StgSharp.Graphics
void IglFunc.TextureParameter(int target, uint pname, int param) void IglFunc.TextureParameter(int target, uint pname, int param)
{ {
M128 m = default; M128 m = default;
m.Int32[0] = target; m.Write<int>(0, target);
m.UInt32[2] = pname; m.Write<uint>(2, pname);
m.Int32[3] = param; m.Write<int>(3, param);
paramQueue.Enqueue(m); paramQueue.Enqueue(m);
glActionQueue.Enqueue(TextureParameterPtr); glActionQueue.Enqueue(TextureParameterPtr);
} }
@@ -382,11 +394,11 @@ namespace StgSharp.Graphics
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
internal void frameworkHandleEnqueue(IntPtr methodHandle, params M128[] param) internal void frameworkHandleEnqueue(IntPtr methodHandle, params M128[] param)
{ {
glActionQueue.Enqueue(methodHandle);
foreach (M128 item in param) foreach (M128 item in param)
{ {
paramQueue.Enqueue(item); paramQueue.Enqueue(item);
} }
glActionQueue.Enqueue(methodHandle);
} }
} }
} }
@@ -18,16 +18,17 @@ namespace StgSharp.Graphics
private IntPtr ActiveTexturePtr = (IntPtr)(delegate*<void>)&InternalActiveTexture; private IntPtr ActiveTexturePtr = (IntPtr)(delegate*<void>)&InternalActiveTexture;
private IntPtr AttachShaderPtr = (IntPtr)(delegate*<void>)&InternalAttachShader; private IntPtr AttachShaderPtr = (IntPtr)(delegate*<void>)&InternalAttachShader;
private IntPtr BindBufferPtr = (IntPtr)(delegate*<void>)&InternalBindBuffer; private IntPtr BindBufferPtr = (IntPtr)(delegate*<void>)&InternalBindBuffer;
private IntPtr ClearColorPtr = (IntPtr)(delegate*<void>)&InternalClearColor;
private IntPtr ClearGraphicErrorPtr = (IntPtr)(delegate*<void>)&InternalClearGraphicError;
private IntPtr CompileShaderPtr = (IntPtr)(delegate*<void>)&InternalCompileShader;
private IntPtr DeleBufferPtr = (IntPtr)(delegate*<void>)&InternalDeleteBuffer;
private IntPtr BindTexturePtr = (IntPtr)(delegate*<void>)&InternalBindTexture; private IntPtr BindTexturePtr = (IntPtr)(delegate*<void>)&InternalBindTexture;
private IntPtr BindVertexArrayPtr = (IntPtr)(delegate*<void>)&InternalBindVertexArray; private IntPtr BindVertexArrayPtr = (IntPtr)(delegate*<void>)&InternalBindVertexArray;
private IntPtr BufferDataPtr = (IntPtr)(delegate*<void>)&InternalSetBufferData; private IntPtr BufferDataPtr = (IntPtr)(delegate*<void>)&InternalSetBufferData;
private IntPtr ClearColorPtr = (IntPtr)(delegate*<void>)&InternalClearColor;
private IntPtr ClearGraphicErrorPtr = (IntPtr)(delegate*<void>)&InternalClearGraphicError;
private IntPtr ClearPtr = (IntPtr)(delegate*<void>)&InternalClear; private IntPtr ClearPtr = (IntPtr)(delegate*<void>)&InternalClear;
private IntPtr CompileShaderPtr = (IntPtr)(delegate*<void>)&InternalCompileShader;
private IntPtr CreateProgramPtr = (IntPtr)(delegate*<void>)&InternalCreateProgram; private IntPtr CreateProgramPtr = (IntPtr)(delegate*<void>)&InternalCreateProgram;
private IntPtr CreateProgramSetPtr = (IntPtr)(delegate*<void>)&InternalCreateProgramSet; private IntPtr CreateProgramSetPtr = (IntPtr)(delegate*<void>)&InternalCreateProgramSet;
private IntPtr CreateShaderPtr = (IntPtr)(delegate*<void>)&InternalCreateShader;
private IntPtr DeleBufferPtr = (IntPtr)(delegate*<void>)&InternalDeleteBuffer;
private IntPtr DeleteVertexArrayPtr = (IntPtr)(delegate*<void>)&InternalDeleteVertexArrays; private IntPtr DeleteVertexArrayPtr = (IntPtr)(delegate*<void>)&InternalDeleteVertexArrays;
private IntPtr DrawElementsPtr = (IntPtr)(delegate*<void>)&InternalDrawElements; private IntPtr DrawElementsPtr = (IntPtr)(delegate*<void>)&InternalDrawElements;
private IntPtr GenBufferPtr = (IntPtr)(delegate*<void>)&InternalGenBuffers; private IntPtr GenBufferPtr = (IntPtr)(delegate*<void>)&InternalGenBuffers;
@@ -35,6 +36,7 @@ namespace StgSharp.Graphics
private IntPtr GenVertexArraysPtr = (IntPtr)(delegate*<void>)&InternalGenVertexArrays; private IntPtr GenVertexArraysPtr = (IntPtr)(delegate*<void>)&InternalGenVertexArrays;
private IntPtr GetUniformLocationPtr = (IntPtr)(delegate*<void>)&InternalGetUniformLocation; private IntPtr GetUniformLocationPtr = (IntPtr)(delegate*<void>)&InternalGetUniformLocation;
private IntPtr SetVertexArrayPtr = (IntPtr)(delegate*<void>)&InternalSetVertexAttribute; private IntPtr SetVertexArrayPtr = (IntPtr)(delegate*<void>)&InternalSetVertexAttribute;
private IntPtr ShaderSourcePtr = (IntPtr)(delegate*<void>)&InternalShaderSource;
private IntPtr textureImage2dPtr = (IntPtr)(delegate*<void>)&InternalTextureImage2d; private IntPtr textureImage2dPtr = (IntPtr)(delegate*<void>)&InternalTextureImage2d;
private IntPtr TextureParameterPtr = (IntPtr)(delegate*<void>)&InternalTextureParameter; private IntPtr TextureParameterPtr = (IntPtr)(delegate*<void>)&InternalTextureParameter;
private IntPtr UseProgramPtr = (IntPtr)(delegate*<void>)&InternalUseProgram; private IntPtr UseProgramPtr = (IntPtr)(delegate*<void>)&InternalUseProgram;
@@ -56,16 +58,21 @@ namespace StgSharp.Graphics
private static void InternalBindBuffer() private static void InternalBindBuffer()
{ {
M128 m = default; M128 m = new M128();
paramQueue.TryDequeue(out m); paramQueue.TryDequeue(out m);
paramQueue.context->glBindBuffer(m.UInt32[0], *(uint*)m.UInt64[1]); uint usage = m.Read<uint>(0);
uint handle = *(uint*)m.Read<ulong>(1);
paramQueue.context->glBindBuffer(usage, handle);
} }
private static void InternalBindTexture() private static void InternalBindTexture()
{ {
M128 m = default; M128 m = default;
paramQueue.TryDequeue(out m); paramQueue.TryDequeue(out m);
paramQueue.context->glBindTexture(m.UInt32[0], *(uint*)m.UInt64[1]); paramQueue.context->glBindTexture(
m.Read<uint>(0),
*(uint*)m.Read<ulong>(1)
);
} }
private static void InternalBindVertexArray() private static void InternalBindVertexArray()
@@ -94,53 +101,14 @@ namespace StgSharp.Graphics
while (paramQueue.context->glGetError() != 0) { } while (paramQueue.context->glGetError() != 0) { }
} }
private static void InternalCompileShader() private static unsafe void InternalCompileShader()
{ {
IntPtr shaderHandle, codeHandle; IntPtr handle = default;
int count, type; paramQueue.TryDequeue(out handle);
paramQueue.TryDequeue(out type, out count); paramQueue.context->glCompileShader(*(uint*)handle);
for (int i = 0; i < count; i++)
{
paramQueue.TryDequeue(out shaderHandle, out codeHandle);
GCHandle code = GCHandle.FromIntPtr(codeHandle);
byte[] c = (byte[])code.Target;
Console.WriteLine(Encoding.UTF8.GetString(c));
*(uint*)shaderHandle = InternalIO.InternalLoadShaderCode(paramQueue.context, (byte*)codeHandle, type);
if (*(uint*)shaderHandle == 0)
{
IntPtr logPtr = InternalIO.InternalReadSSCLog();
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);
}
GCHandle.FromIntPtr(codeHandle).Free();
}
} }
//TODO
private static void InternalCreateProgram() private static void InternalCreateProgram()
{ {
IntPtr programHandle = default; IntPtr programHandle = default;
@@ -153,25 +121,36 @@ namespace StgSharp.Graphics
uint* programHandle; uint* programHandle;
M128 m = default; M128 m = default;
paramQueue.TryDequeue(out m); paramQueue.TryDequeue(out m);
programHandle = (uint*)m.UInt64[0]; programHandle = (uint*)m.Read<ulong>(0);
for (int i = 0; i < m.Int32[2]; i++) for (int i = 0; i < m.Read<int>(2); i++)
{ {
*(programHandle + i) = paramQueue.context->glCreateProgram(); *(programHandle + i) = paramQueue.context->glCreateProgram();
} }
} }
private static unsafe void InternalCreateShader()
{
M128 m = default;
paramQueue.TryDequeue(out m);
int count = m.Read<int>(0); uint type = m.Read<uint>(1); uint* handle = (uint*)m.Read<ulong>(1);
for (int i = 0; i < count; i++)
{
*(handle + i) = paramQueue.context->glCreateShader(type);
}
}
private static void InternalDeleteBuffer() private static void InternalDeleteBuffer()
{ {
M128 m = default; M128 m = default;
paramQueue.TryDequeue(out m); paramQueue.TryDequeue(out m);
paramQueue.context->glDeleteBuffers(m.UInt32[2], (uint*)m.UInt64[0]); paramQueue.context->glDeleteBuffers(m.Read<uint>(2), (uint*)m.Read<ulong>(0));
} }
private static void InternalDeleteVertexArrays() private static void InternalDeleteVertexArrays()
{ {
M128 m = default; M128 m = default;
paramQueue.TryDequeue(out m); paramQueue.TryDequeue(out m);
paramQueue.context->glDeleteVertexArrays((uint)m.Int32[0], (uint*)m.UInt64[0]); paramQueue.context->glDeleteVertexArrays((uint)m.Read<int>(0), (uint*)m.Read<ulong>(0));
} }
private static void InternalDrawElements() private static void InternalDrawElements()
@@ -187,21 +166,21 @@ namespace StgSharp.Graphics
{ {
M128 m = default; M128 m = default;
paramQueue.TryDequeue(out m); paramQueue.TryDequeue(out m);
paramQueue.context->glGenBuffers(m.UInt32[2], (uint*)m.UInt64[0]); paramQueue.context->glGenBuffers(m.Read<uint>(2), (uint*)m.Read<ulong>(0));
} }
private static void InternalGenTextures() private static void InternalGenTextures()
{ {
M128 m = default; M128 m = default;
paramQueue.TryDequeue(out m); paramQueue.TryDequeue(out m);
paramQueue.context->glGenTextures(m.UInt32[2], (uint*)m.UInt64[0]); paramQueue.context->glGenTextures(m.Read<uint>(2), (uint*)m.Read<ulong>(0));
} }
private static void InternalGenVertexArrays() private static void InternalGenVertexArrays()
{ {
M128 m = default; M128 m = default;
paramQueue.TryDequeue(out m); paramQueue.TryDequeue(out m);
paramQueue.context->glGenVertexArrays(m.UInt32[2], (uint*)m.UInt64[0]); paramQueue.context->glGenVertexArrays(m.Read<uint>(2), (uint*)m.Read<ulong>(0));
} }
private static void InternalGetUniformLocation() private static void InternalGetUniformLocation()
@@ -215,11 +194,12 @@ namespace StgSharp.Graphics
private static void InternalSetBufferData() private static void InternalSetBufferData()
{ {
uint type = 0, use = 0; uint type = 0, use = 0;
IntPtr size = default, handle = default; IntPtr size = default;
glArrayHandle array = default;
paramQueue.TryDequeue(out type, out use); paramQueue.TryDequeue(out type, out use);
paramQueue.TryDequeue(out size, out handle); paramQueue.TryDequeue(out size);
paramQueue.context->glBufferData(type, size, (void*)handle, use); paramQueue.TryDequeue(out array);
GCHandle.FromIntPtr(handle).Free(); paramQueue.context->glBufferData(type, size, array.AddressOfArray(), use);
} }
private static void InternalSetVertexAttribute() private static void InternalSetVertexAttribute()
@@ -232,6 +212,18 @@ namespace StgSharp.Graphics
paramQueue.context->glEnableVertexAttribArray(index); paramQueue.context->glEnableVertexAttribArray(index);
} }
private static unsafe void InternalShaderSource()
{
IntPtr handle = default;
byte[] stream = Array.Empty<byte>();
paramQueue.TryDequeue(out handle);
paramQueue.TryDequeue(out stream);
fixed (byte* sPtr = stream)
{
paramQueue.context->glShaderSource(*(uint*)handle, 1, &sPtr, (void*)0);
}
}
private static void InternalTextureImage2d() private static void InternalTextureImage2d()
{ {
IntPtr pix = IntPtr.Zero; IntPtr pix = IntPtr.Zero;
@@ -240,14 +232,13 @@ namespace StgSharp.Graphics
paramQueue.TryDequeue(out level, out internalFormat, out width, out height); paramQueue.TryDequeue(out level, out internalFormat, out width, out height);
paramQueue.TryDequeue(out target, out format, out type); paramQueue.TryDequeue(out target, out format, out type);
paramQueue.context->glTexImage2D(target, (int)level, internalFormat, width, height, 0, format, type, (void*)pix); paramQueue.context->glTexImage2D(target, (int)level, internalFormat, width, height, 0, format, type, (void*)pix);
GCHandle.FromIntPtr(pix).Free();
} }
private static void InternalTextureParameter() private static void InternalTextureParameter()
{ {
M128 m = default; M128 m = default;
paramQueue.TryDequeue(out m); paramQueue.TryDequeue(out m);
paramQueue.context->glTextureParameteri(m.UInt32[0], m.UInt32[2], m.Int32[3]); paramQueue.context->glTextureParameteri(m.Read<uint>(0), m.Read<uint>(2), m.Read<int>(3));
} }
private static void InternalUseProgram() private static void InternalUseProgram()
@@ -261,7 +252,7 @@ namespace StgSharp.Graphics
{ {
M128 m = default; M128 m = default;
paramQueue.TryDequeue(out m); paramQueue.TryDequeue(out m);
paramQueue.context->glViewport(m.Int32[0], m.Int32[1], m.UInt32[2], m.UInt32[3]); paramQueue.context->glViewport(m.Read<int>(0), m.Read<int>(1), m.Read<uint>(2), m.Read<uint>(3));
} }
private void InternalMakeContexCurrent(Form form) private void InternalMakeContexCurrent(Form form)
@@ -269,11 +260,6 @@ namespace StgSharp.Graphics
throw new NotImplementedException(); throw new NotImplementedException();
} }
private void InternalSetValue(Uniform<float, float, float, float> uniform, float v0, float v1, float v2, float v3)
{
throw new NotImplementedException();
}
private void InternalSwitchContext() private void InternalSwitchContext()
{ {
throw new NotImplementedException(); throw new NotImplementedException();
@@ -1,4 +1,5 @@
using StgSharp; using StgSharp;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
@@ -19,9 +20,10 @@ namespace StgSharp.Graphics
return new ShaderProgram(GL); return new ShaderProgram(GL);
} }
[MethodImpl(MethodImplOptions.AggressiveInlining)]
protected Shader CreateShader(ShaderType type, int count) protected Shader CreateShader(ShaderType type, int count)
{ {
return new Shader(this.gl, new glHandleSet(count), type); return new Shader(this.gl, gl.CreateShaderSet(count, type), type);
} }
} }
@@ -38,18 +40,20 @@ namespace StgSharp.Graphics
type = usage; type = usage;
} }
/// <summary> [MethodImpl(MethodImplOptions.AggressiveInlining)]
/// Compile the vertex shader to be attached to this shader. public unsafe void Compile(int index, string code)
/// </summary>
/// <param name="code">GLSL code of vertex shader.</param>
public unsafe void Compile(params string[] code)
{ {
glHandleSet.Copy(GL.CompileShader(type, code), handle); if (code == null)
{
throw new ArgumentNullException("Must provide enough code");
}
GL.LoadShaderSource(handle[index], code + '\0');
GL.CompileShader(handle[index]);
} }
//TODO:写链接着色器的文档注释 //TODO:写链接着色器的文档注释
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="target"></param> /// <param name="target"></param>
/// <param name="index"></param> /// <param name="index"></param>
@@ -103,8 +107,8 @@ namespace StgSharp.Graphics
} }
/// <summary> /// <summary>
/// Get a uniform form current shader, /// Get a uniform form current shader,
/// the value type of the uniform should be provided. /// the value type of the uniform should be provided.
/// </summary> /// </summary>
/// <param name="name">Name of the Uniform in shader code</param> /// <param name="name">Name of the Uniform in shader code</param>
/// <returns></returns> /// <returns></returns>
@@ -113,9 +117,10 @@ namespace StgSharp.Graphics
{ {
return new Uniform<T>(this, name, GL); return new Uniform<T>(this, name, GL);
} }
/// <summary> /// <summary>
/// Get a uniform form current shader, /// Get a uniform form current shader,
/// the value type of the uniform should be provided. /// the value type of the uniform should be provided.
/// </summary> /// </summary>
/// <param name="name">Name of the Uniform in shader code</param> /// <param name="name">Name of the Uniform in shader code</param>
/// <returns></returns> /// <returns></returns>
@@ -125,9 +130,10 @@ namespace StgSharp.Graphics
{ {
return new Uniform<T, U>(this, name, GL); return new Uniform<T, U>(this, name, GL);
} }
/// <summary> /// <summary>
/// Get a uniform form current shader, /// Get a uniform form current shader,
/// the value type of the uniform should be provided. /// the value type of the uniform should be provided.
/// </summary> /// </summary>
/// <param name="name">Name of the Uniform in shader code</param> /// <param name="name">Name of the Uniform in shader code</param>
/// <returns></returns> /// <returns></returns>
@@ -148,4 +154,4 @@ namespace StgSharp.Graphics
GL.UseProgram(handle); GL.UseProgram(handle);
} }
} }
} }
@@ -0,0 +1,108 @@
using StgSharp.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace StgSharpDebug.Graphics.GL.ShaderEdit
{
public class ShaderGenerator
{
private List<string> codeList;
private List<ShaderFunction> usedShaderFunctions;
public Uniform<T> DefineUniform<T>() where T : struct
{
throw new NotImplementedException();
}
}
public class ShaderFunction
{
private string name;
private List<string> codeList;
private List<ShaderParameter> inputList;
private ShaderParameter outPut;
public int ParameterCount
{
get { return inputList.Count; }
}
public void EmitCall(ShaderFunction function, ShaderParameter outPut, params ShaderParameter[] inputParams)
{
if (inputParams.Length != function.ParameterCount)
{
throw new ArgumentException("Provided parameters does not match function's parameter list.");
}
if (!ShaderParameter.IsSameType(outPut, function.outPut))
{
throw new Exception("Provided parameters does not match function's parameter list.");
}
for (int i = 0; i < inputParams.Length; i++)
{
if (!ShaderParameter.IsSameType(function.inputList[i], inputParams[i]))
{
throw new Exception("Provided parameters does not match function's parameter list.");
}
}
string codeLine = "";
if (outPut != ShaderParameter.Void)
{
codeLine += $"{outPut.name} = ";
}
codeLine += $"{function.name}(";
foreach (ShaderParameter inputParam in inputParams)
{
codeLine += inputParam.name;
}
codeLine += ");\n";
codeList.Add(codeLine);
}
}
public class ShaderParameter
{
internal readonly InternalShaderType type;
internal readonly string name;
internal readonly bool isReadOnly;
public ShaderParameter(string name, InternalShaderType type)
{
this.name = name;
this.type = type;
isReadOnly = false;
}
public static readonly ShaderParameter Void = new ShaderParameter("", InternalShaderType.Void);
public static bool IsSameType(ShaderParameter param1, ShaderParameter param2)
{
if (param1.type != InternalShaderType.Struct)
{
return param1.type == param2.type;
}
else
{
throw new Exception("Struct is currently not supported.");
}
}
}
public enum InternalShaderType
{
#pragma warning disable CS1591
Struct, Void,
Int, UInt,
Float, Double,
Vector2, Vector3, Vector4,
VectorD2, VectorD3, VectorD4,
Matrix2x2, Matrix2x3, Matrix2x4,
Matrix3x2, Matrix3x3, Matrix3x4,
Matrix4x2, Matrix4x3, Matrix4x4,
#pragma warning restore CS1591
}
}

Some files were not shown because too many files have changed in this diff Show More