diff --git a/.ncrunch/ControlCatalog.v3.ncrunchproject b/.ncrunch/ControlCatalog.net6.0.v3.ncrunchproject similarity index 100% rename from .ncrunch/ControlCatalog.v3.ncrunchproject rename to .ncrunch/ControlCatalog.net6.0.v3.ncrunchproject diff --git a/.ncrunch/ControlCatalog.netstandard2.0.v3.ncrunchproject b/.ncrunch/ControlCatalog.netstandard2.0.v3.ncrunchproject new file mode 100644 index 0000000000..319cd523ce --- /dev/null +++ b/.ncrunch/ControlCatalog.netstandard2.0.v3.ncrunchproject @@ -0,0 +1,5 @@ + + + True + + \ No newline at end of file diff --git a/Avalonia.sln b/Avalonia.sln index 25c7daf080..4999719676 100644 --- a/Avalonia.sln +++ b/Avalonia.sln @@ -38,6 +38,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{A689DEF5-D50F-4975-8B72-124C9EB54066}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig + src\Shared\IsExternalInit.cs = src\Shared\IsExternalInit.cs src\Shared\ModuleInitializer.cs = src\Shared\ModuleInitializer.cs src\Shared\SourceGeneratorAttributes.cs = src\Shared\SourceGeneratorAttributes.cs EndProjectSection @@ -205,14 +206,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlSamples", "samples\S EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ControlCatalog.iOS", "samples\ControlCatalog.iOS\ControlCatalog.iOS.csproj", "{70B9F5CC-E2F9-4314-9514-EDE762ACCC4B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.SourceGenerator", "src\Avalonia.SourceGenerator\Avalonia.SourceGenerator.csproj", "{CA932DF3-2616-4BF6-8F28-1AD0EC40F1FF}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevAnalyzers", "src\tools\DevAnalyzers\DevAnalyzers.csproj", "{2B390431-288C-435C-BB6B-A374033BD8D1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Controls.ColorPicker", "src\Avalonia.Controls.ColorPicker\Avalonia.Controls.ColorPicker.csproj", "{7BF6C69D-FC14-43EB-9ED0-782C16F3D5D9}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.DesignerSupport.Tests", "tests\Avalonia.DesignerSupport.Tests\Avalonia.DesignerSupport.Tests.csproj", "{EABE2161-989B-42BF-BD8D-1E34B20C21F1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevGenerators", "src\tools\DevGenerators\DevGenerators.csproj", "{1BBFAD42-B99E-47E0-B00A-A4BC6B6BB4BB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -485,10 +486,6 @@ Global {70B9F5CC-E2F9-4314-9514-EDE762ACCC4B}.Debug|Any CPU.Build.0 = Debug|Any CPU {70B9F5CC-E2F9-4314-9514-EDE762ACCC4B}.Release|Any CPU.ActiveCfg = Release|Any CPU {70B9F5CC-E2F9-4314-9514-EDE762ACCC4B}.Release|Any CPU.Build.0 = Release|Any CPU - {CA932DF3-2616-4BF6-8F28-1AD0EC40F1FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CA932DF3-2616-4BF6-8F28-1AD0EC40F1FF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CA932DF3-2616-4BF6-8F28-1AD0EC40F1FF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CA932DF3-2616-4BF6-8F28-1AD0EC40F1FF}.Release|Any CPU.Build.0 = Release|Any CPU {2B390431-288C-435C-BB6B-A374033BD8D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2B390431-288C-435C-BB6B-A374033BD8D1}.Debug|Any CPU.Build.0 = Debug|Any CPU {2B390431-288C-435C-BB6B-A374033BD8D1}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -501,6 +498,10 @@ Global {EABE2161-989B-42BF-BD8D-1E34B20C21F1}.Debug|Any CPU.Build.0 = Debug|Any CPU {EABE2161-989B-42BF-BD8D-1E34B20C21F1}.Release|Any CPU.ActiveCfg = Release|Any CPU {EABE2161-989B-42BF-BD8D-1E34B20C21F1}.Release|Any CPU.Build.0 = Release|Any CPU + {1BBFAD42-B99E-47E0-B00A-A4BC6B6BB4BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1BBFAD42-B99E-47E0-B00A-A4BC6B6BB4BB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1BBFAD42-B99E-47E0-B00A-A4BC6B6BB4BB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1BBFAD42-B99E-47E0-B00A-A4BC6B6BB4BB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -557,6 +558,8 @@ Global {70B9F5CC-E2F9-4314-9514-EDE762ACCC4B} = {9B9E3891-2366-4253-A952-D08BCEB71098} {2B390431-288C-435C-BB6B-A374033BD8D1} = {4ED8B739-6F4E-4CD4-B993-545E6B5CE637} {EABE2161-989B-42BF-BD8D-1E34B20C21F1} = {C5A00AC3-B34C-4564-9BDD-2DA473EF4D8B} + {1BBFAD42-B99E-47E0-B00A-A4BC6B6BB4BB} = {4ED8B739-6F4E-4CD4-B993-545E6B5CE637} + {4D36CEC8-53F2-40A5-9A37-79AAE356E2DA} = {86C53C40-57AA-45B8-AD42-FAE0EFDF0F2B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {87366D66-1391-4D90-8999-95A620AD786A} diff --git a/azure-pipelines-integrationtests.yml b/azure-pipelines-integrationtests.yml index c3f6292703..0b79758c76 100644 --- a/azure-pipelines-integrationtests.yml +++ b/azure-pipelines-integrationtests.yml @@ -12,8 +12,27 @@ jobs: name: 'AvaloniaMacPool' steps: - - script: ./tests/Avalonia.IntegrationTests.Appium/macos-clean-build-test.sh - displayName: 'run integration tests' + - script: system_profiler SPDisplaysDataType |grep Resolution + + - script: | + pkill node + appium & + pkill IntegrationTestApp + ./build.sh CompileNative + rm -rf $(osascript -e "POSIX path of (path to application id \"net.avaloniaui.avalonia.integrationtestapp\")") + pkill IntegrationTestApp + ./samples/IntegrationTestApp/bundle.sh + open -n ./samples/IntegrationTestApp/bin/Debug/net6.0/osx-arm64/publish/IntegrationTestApp.app + pkill IntegrationTestApp + + - task: DotNetCoreCLI@2 + inputs: + command: 'test' + projects: 'tests/Avalonia.IntegrationTests.Appium/Avalonia.IntegrationTests.Appium.csproj' + + - script: | + pkill IntegrationTestApp + pkill node - job: Windows diff --git a/build/SourceGenerators.props b/build/SourceGenerators.props index d000af1bf6..4929578b60 100644 --- a/build/SourceGenerators.props +++ b/build/SourceGenerators.props @@ -1,7 +1,7 @@ diff --git a/native/Avalonia.Native/src/OSX/AvnView.mm b/native/Avalonia.Native/src/OSX/AvnView.mm index 01725ace03..4ae6ad5a00 100644 --- a/native/Avalonia.Native/src/OSX/AvnView.mm +++ b/native/Avalonia.Native/src/OSX/AvnView.mm @@ -127,7 +127,11 @@ [self updateRenderTarget]; auto reason = [self inLiveResize] ? ResizeUser : _resizeReason; - _parent->BaseEvents->Resized(AvnSize{newSize.width, newSize.height}, reason); + + if(_parent->IsShown()) + { + _parent->BaseEvents->Resized(AvnSize{newSize.width, newSize.height}, reason); + } } } diff --git a/native/Avalonia.Native/src/OSX/rendertarget.mm b/native/Avalonia.Native/src/OSX/rendertarget.mm index 266d0345d1..2075cc85ab 100644 --- a/native/Avalonia.Native/src/OSX/rendertarget.mm +++ b/native/Avalonia.Native/src/OSX/rendertarget.mm @@ -13,6 +13,7 @@ { @public IOSurfaceRef surface; @public AvnPixelSize size; + @public bool hasContent; @public float scale; ComPtr _context; GLuint _framebuffer, _texture, _renderbuffer; @@ -41,6 +42,7 @@ self->scale = scale; self->size = size; self->_context = context; + self->hasContent = false; return self; } @@ -92,6 +94,7 @@ _context->MakeCurrent(release.getPPV()); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); glFlush(); + self->hasContent = true; } -(void) dealloc @@ -170,6 +173,8 @@ static IAvnGlSurfaceRenderTarget* CreateGlRenderTarget(IOSurfaceRenderTarget* ta @synchronized (lock) { if(_layer == nil) return; + if(!surface->hasContent) + return; [CATransaction begin]; [_layer setContents: nil]; if(surface != nil) @@ -213,6 +218,7 @@ static IAvnGlSurfaceRenderTarget* CreateGlRenderTarget(IOSurfaceRenderTarget* ta memcpy(pSurface + y*sstride, pFb + y*fstride, wbytes); } IOSurfaceUnlock(surf, 0, nil); + surface->hasContent = true; [self updateLayer]; return S_OK; } diff --git a/samples/ControlCatalog.Android/ControlCatalog.Android.csproj b/samples/ControlCatalog.Android/ControlCatalog.Android.csproj index e52430f50b..54acdd9114 100644 --- a/samples/ControlCatalog.Android/ControlCatalog.Android.csproj +++ b/samples/ControlCatalog.Android/ControlCatalog.Android.csproj @@ -21,12 +21,12 @@ True - + True diff --git a/samples/ControlCatalog.NetCore/NativeControls/Gtk/EmbedSample.Gtk.cs b/samples/ControlCatalog.NetCore/NativeControls/Gtk/EmbedSample.Gtk.cs index 521d3674eb..81a5ba536f 100644 --- a/samples/ControlCatalog.NetCore/NativeControls/Gtk/EmbedSample.Gtk.cs +++ b/samples/ControlCatalog.NetCore/NativeControls/Gtk/EmbedSample.Gtk.cs @@ -22,8 +22,7 @@ public class EmbedSampleGtk : INativeDemoControl var control = createDefault(); var nodes = Path.GetFullPath(Path.Combine(typeof(EmbedSample).Assembly.GetModules()[0].FullyQualifiedName, - "..", - "nodes.mp4")); + "..", "NativeControls", "Gtk", "nodes.mp4")); _mplayer = Process.Start(new ProcessStartInfo("mplayer", $"-vo x11 -zoom -loop 0 -wid {control.Handle.ToInt64()} \"{nodes}\"") { diff --git a/samples/ControlCatalog.NetCore/NativeControls/Gtk/GtkHelper.cs b/samples/ControlCatalog.NetCore/NativeControls/Gtk/GtkHelper.cs index 456f77a44d..b1fef7c013 100644 --- a/samples/ControlCatalog.NetCore/NativeControls/Gtk/GtkHelper.cs +++ b/samples/ControlCatalog.NetCore/NativeControls/Gtk/GtkHelper.cs @@ -2,6 +2,7 @@ using System; using System.Threading.Tasks; using Avalonia.Controls.Platform; using Avalonia.Platform.Interop; +using Avalonia.X11.Interop; using Avalonia.X11.NativeDialogs; using static Avalonia.X11.NativeDialogs.Gtk; using static Avalonia.X11.NativeDialogs.Glib; @@ -10,8 +11,6 @@ namespace ControlCatalog.NetCore; internal class GtkHelper { - private static Task s_gtkTask; - class FileChooser : INativeControlHostDestroyableControlHandle { private readonly IntPtr _widget; @@ -38,11 +37,7 @@ internal class GtkHelper public static INativeControlHostDestroyableControlHandle CreateGtkFileChooser(IntPtr parentXid) { - if (s_gtkTask == null) - s_gtkTask = StartGtk(); - if (!s_gtkTask.Result) - return null; - return RunOnGlibThread(() => + return GtkInteropHelper.RunOnGlibThread(() => { using (var title = new Utf8Buffer("Embedded")) { diff --git a/samples/ControlCatalog.NetCore/Program.cs b/samples/ControlCatalog.NetCore/Program.cs index 13751b56b5..d98a068d84 100644 --- a/samples/ControlCatalog.NetCore/Program.cs +++ b/samples/ControlCatalog.NetCore/Program.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.Globalization; using System.Linq; @@ -53,7 +53,11 @@ namespace ControlCatalog.NetCore else if (args.Contains("--full-headless")) { return builder - .UseHeadless(true) + .UseHeadless(new AvaloniaHeadlessPlatformOptions + { + UseHeadlessDrawing = true, + UseCompositor = true + }) .AfterSetup(_ => { DispatcherTimer.RunOnce(async () => @@ -63,12 +67,11 @@ namespace ControlCatalog.NetCore var tc = window.GetLogicalDescendants().OfType().First(); foreach (var page in tc.Items.Cast().ToList()) { - // Skip DatePicker because of some layout bug in grid - if (page.Header.ToString() == "DatePicker") + if (page.Header.ToString() == "DatePicker" || page.Header.ToString() == "TreeView") continue; Console.WriteLine("Selecting " + page.Header); tc.SelectedItem = page; - await Task.Delay(500); + await Task.Delay(50); } Console.WriteLine("Selecting the first page"); tc.SelectedItem = tc.Items.OfType().First(); @@ -77,7 +80,7 @@ namespace ControlCatalog.NetCore for (var c = 0; c < 3; c++) { GC.Collect(2, GCCollectionMode.Forced); - await Task.Delay(500); + await Task.Delay(50); } void FormatMem(string metric, long bytes) @@ -87,7 +90,6 @@ namespace ControlCatalog.NetCore FormatMem("GC allocated bytes", GC.GetTotalMemory(true)); FormatMem("WorkingSet64", Process.GetCurrentProcess().WorkingSet64); - }, TimeSpan.FromSeconds(1)); }) .StartWithClassicDesktopLifetime(args); @@ -111,10 +113,11 @@ namespace ControlCatalog.NetCore { EnableMultiTouch = true, UseDBusMenu = true, - EnableIme = true, + EnableIme = true }) .With(new Win32PlatformOptions { + EnableMultitouch = true }) .UseSkia() .AfterSetup(builder => diff --git a/samples/ControlCatalog/App.xaml b/samples/ControlCatalog/App.xaml index c7ad72d2c5..b228e72f72 100644 --- a/samples/ControlCatalog/App.xaml +++ b/samples/ControlCatalog/App.xaml @@ -49,6 +49,7 @@ + diff --git a/samples/ControlCatalog/MainView.xaml b/samples/ControlCatalog/MainView.xaml index 40591c2d24..7461e78c33 100644 --- a/samples/ControlCatalog/MainView.xaml +++ b/samples/ControlCatalog/MainView.xaml @@ -13,6 +13,9 @@ + + + diff --git a/samples/ControlCatalog/Pages/ColorPickerPage.xaml b/samples/ControlCatalog/Pages/ColorPickerPage.xaml index c0c83d6a35..1590be25ba 100644 --- a/samples/ControlCatalog/Pages/ColorPickerPage.xaml +++ b/samples/ControlCatalog/Pages/ColorPickerPage.xaml @@ -13,8 +13,14 @@ - - + + + - - - - - + diff --git a/samples/ControlCatalog/Pages/CompositionPage.axaml b/samples/ControlCatalog/Pages/CompositionPage.axaml new file mode 100644 index 0000000000..22c5c88941 --- /dev/null +++ b/samples/ControlCatalog/Pages/CompositionPage.axaml @@ -0,0 +1,45 @@ + + + Implicit animations + + + + + + + + + + + + + + + + + + + + + + + Resize me + + + + + + + \ No newline at end of file diff --git a/samples/ControlCatalog/Pages/CompositionPage.axaml.cs b/samples/ControlCatalog/Pages/CompositionPage.axaml.cs new file mode 100644 index 0000000000..18069ca857 --- /dev/null +++ b/samples/ControlCatalog/Pages/CompositionPage.axaml.cs @@ -0,0 +1,153 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Threading.Tasks; +using Avalonia; +using Avalonia.Controls; +using Avalonia.Controls.Primitives; +using Avalonia.Interactivity; +using Avalonia.Markup.Xaml; +using Avalonia.Markup.Xaml.Templates; +using Avalonia.Media; +using Avalonia.Rendering.Composition; +using Avalonia.Rendering.Composition.Animations; +using Avalonia.VisualTree; + +namespace ControlCatalog.Pages; + +public partial class CompositionPage : UserControl +{ + private ImplicitAnimationCollection _implicitAnimations; + + public CompositionPage() + { + AvaloniaXamlLoader.Load(this); + } + + protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) + { + base.OnAttachedToVisualTree(e); + this.FindControl("Items").Items = CreateColorItems(); + } + + private List CreateColorItems() + { + var list = new List(); + + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 255, 185, 0))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 231, 72, 86))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 0, 120, 215))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 0, 153, 188))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 122, 117, 116))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 118, 118, 118))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 255, 141, 0))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 232, 17, 35))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 0, 99, 177))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 45, 125, 154))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 93, 90, 88))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 76, 74, 72))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 247, 99, 12))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 234, 0, 94))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 142, 140, 216))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 0, 183, 195))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 104, 118, 138))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 105, 121, 126))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 202, 80, 16))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 195, 0, 82))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 107, 105, 214))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 3, 131, 135))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 81, 92, 107))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 74, 84, 89))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 218, 59, 1))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 227, 0, 140))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 135, 100, 184))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 0, 178, 148))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 86, 124, 115))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 100, 124, 100))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 239, 105, 80))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 191, 0, 119))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 116, 77, 169))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 1, 133, 116))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 72, 104, 96))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 82, 94, 84))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 209, 52, 56))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 194, 57, 179))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 177, 70, 194))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 0, 204, 106))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 73, 130, 5))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 132, 117, 69))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 255, 67, 67))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 154, 0, 137))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 136, 23, 152))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 16, 137, 62))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 16, 124, 16))); + list.Add(new CompositionPageColorItem(Color.FromArgb(255, 126, 115, 95))); + + return list; + } + + private void EnsureImplicitAnimations() + { + if (_implicitAnimations == null) + { + var compositor = ElementComposition.GetElementVisual(this)!.Compositor; + + var offsetAnimation = compositor.CreateVector3KeyFrameAnimation(); + offsetAnimation.Target = "Offset"; + offsetAnimation.InsertExpressionKeyFrame(1.0f, "this.FinalValue"); + offsetAnimation.Duration = TimeSpan.FromMilliseconds(400); + + var rotationAnimation = compositor.CreateScalarKeyFrameAnimation(); + rotationAnimation.Target = "RotationAngle"; + rotationAnimation.InsertKeyFrame(.5f, 0.160f); + rotationAnimation.InsertKeyFrame(1f, 0f); + rotationAnimation.Duration = TimeSpan.FromMilliseconds(400); + + var animationGroup = compositor.CreateAnimationGroup(); + animationGroup.Add(offsetAnimation); + animationGroup.Add(rotationAnimation); + + _implicitAnimations = compositor.CreateImplicitAnimationCollection(); + _implicitAnimations["Offset"] = animationGroup; + } + } + + public static void SetEnableAnimations(Border border, bool value) + { + + var page = border.FindAncestorOfType(); + if (page == null) + { + border.AttachedToVisualTree += delegate { SetEnableAnimations(border, true); }; + return; + } + + if (ElementComposition.GetElementVisual(page) == null) + return; + + page.EnsureImplicitAnimations(); + ElementComposition.GetElementVisual((Visual)border.GetVisualParent()).ImplicitAnimations = + page._implicitAnimations; + } +} + +public class CompositionPageColorItem +{ + public Color Color { get; private set; } + + public SolidColorBrush ColorBrush + { + get { return new SolidColorBrush(Color); } + } + + public String ColorHexValue + { + get { return Color.ToString().Substring(3).ToUpperInvariant(); } + } + + public CompositionPageColorItem(Color color) + { + Color = color; + } +} \ No newline at end of file diff --git a/samples/ControlCatalog/Pages/ProgressBarPage.xaml b/samples/ControlCatalog/Pages/ProgressBarPage.xaml index db7d7d3280..8e73f1d0f5 100644 --- a/samples/ControlCatalog/Pages/ProgressBarPage.xaml +++ b/samples/ControlCatalog/Pages/ProgressBarPage.xaml @@ -1,22 +1,37 @@ A progress bar control - + + + Maximum + + + + Minimum + + + + Progress Text Format + + - + - + - - + + - + diff --git a/samples/RenderDemo/App.xaml.cs b/samples/RenderDemo/App.xaml.cs index 8054b06964..8f4e02df01 100644 --- a/samples/RenderDemo/App.xaml.cs +++ b/samples/RenderDemo/App.xaml.cs @@ -29,6 +29,10 @@ namespace RenderDemo .With(new Win32PlatformOptions { OverlayPopups = true, + }) + .With(new X11PlatformOptions + { + UseCompositor = true }) .UsePlatformDetect() .LogToTrace(); diff --git a/src/Android/Avalonia.Android/ChoreographerTimer.cs b/src/Android/Avalonia.Android/ChoreographerTimer.cs index 1d898261a3..19dc7b4ab6 100644 --- a/src/Android/Avalonia.Android/ChoreographerTimer.cs +++ b/src/Android/Avalonia.Android/ChoreographerTimer.cs @@ -29,6 +29,9 @@ namespace Avalonia.Android _thread = new Thread(Loop); _thread.Start(); } + + + public bool RunsInBackground => true; public event Action Tick { diff --git a/src/Avalonia.Base/Animation/Easings/CubicBezier.cs b/src/Avalonia.Base/Animation/Easings/CubicBezier.cs new file mode 100644 index 0000000000..5c2487a516 --- /dev/null +++ b/src/Avalonia.Base/Animation/Easings/CubicBezier.cs @@ -0,0 +1,306 @@ +// ReSharper disable InconsistentNaming +// Ported from Chromium project https://github.com/chromium/chromium/blob/374d31b7704475fa59f7b2cb836b3b68afdc3d79/ui/gfx/geometry/cubic_bezier.cc + +using System; +using Avalonia.Utilities; + +// ReSharper disable CompareOfFloatsByEqualityOperator +// ReSharper disable CommentTypo +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable TooWideLocalVariableScope +// ReSharper disable UnusedMember.Global +#pragma warning disable 649 + +namespace Avalonia.Animation.Easings +{ + /// + /// Represents a cubic bezier curve and can compute Y coordinate for a given X + /// + internal unsafe struct CubicBezier + { + const int CUBIC_BEZIER_SPLINE_SAMPLES = 11; + double ax_; + double bx_; + double cx_; + + double ay_; + double by_; + double cy_; + + double start_gradient_; + double end_gradient_; + + double range_min_; + double range_max_; + private bool monotonically_increasing_; + + fixed double spline_samples_[CUBIC_BEZIER_SPLINE_SAMPLES]; + + public CubicBezier(double p1x, double p1y, double p2x, double p2y) : this() + { + InitCoefficients(p1x, p1y, p2x, p2y); + InitGradients(p1x, p1y, p2x, p2y); + InitRange(p1y, p2y); + InitSpline(); + } + + public readonly double SampleCurveX(double t) + { + // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule. + return ((ax_ * t + bx_) * t + cx_) * t; + } + + readonly double SampleCurveY(double t) + { + return ((ay_ * t + by_) * t + cy_) * t; + } + + readonly double SampleCurveDerivativeX(double t) + { + return (3.0 * ax_ * t + 2.0 * bx_) * t + cx_; + } + + readonly double SampleCurveDerivativeY(double t) + { + return (3.0 * ay_ * t + 2.0 * by_) * t + cy_; + } + + public readonly double SolveWithEpsilon(double x, double epsilon) + { + if (x < 0.0) + return 0.0 + start_gradient_ * x; + if (x > 1.0) + return 1.0 + end_gradient_ * (x - 1.0); + return SampleCurveY(SolveCurveX(x, epsilon)); + } + + void InitCoefficients(double p1x, + double p1y, + double p2x, + double p2y) + { + // Calculate the polynomial coefficients, implicit first and last control + // points are (0,0) and (1,1). + cx_ = 3.0 * p1x; + bx_ = 3.0 * (p2x - p1x) - cx_; + ax_ = 1.0 - cx_ - bx_; + + cy_ = 3.0 * p1y; + by_ = 3.0 * (p2y - p1y) - cy_; + ay_ = 1.0 - cy_ - by_; + +#if DEBUG + // Bezier curves with x-coordinates outside the range [0,1] for internal + // control points may have multiple values for t for a given value of x. + // In this case, calls to SolveCurveX may produce ambiguous results. + monotonically_increasing_ = p1x >= 0 && p1x <= 1 && p2x >= 0 && p2x <= 1; +#endif + } + + void InitGradients(double p1x, + double p1y, + double p2x, + double p2y) + { + // End-point gradients are used to calculate timing function results + // outside the range [0, 1]. + // + // There are four possibilities for the gradient at each end: + // (1) the closest control point is not horizontally coincident with regard to + // (0, 0) or (1, 1). In this case the line between the end point and + // the control point is tangent to the bezier at the end point. + // (2) the closest control point is coincident with the end point. In + // this case the line between the end point and the far control + // point is tangent to the bezier at the end point. + // (3) both internal control points are coincident with an endpoint. There + // are two special case that fall into this category: + // CubicBezier(0, 0, 0, 0) and CubicBezier(1, 1, 1, 1). Both are + // equivalent to linear. + // (4) the closest control point is horizontally coincident with the end + // point, but vertically distinct. In this case the gradient at the + // end point is Infinite. However, this causes issues when + // interpolating. As a result, we break down to a simple case of + // 0 gradient under these conditions. + + if (p1x > 0) + start_gradient_ = p1y / p1x; + else if (p1y == 0 && p2x > 0) + start_gradient_ = p2y / p2x; + else if (p1y == 0 && p2y == 0) + start_gradient_ = 1; + else + start_gradient_ = 0; + + if (p2x < 1) + end_gradient_ = (p2y - 1) / (p2x - 1); + else if (p2y == 1 && p1x < 1) + end_gradient_ = (p1y - 1) / (p1x - 1); + else if (p2y == 1 && p1y == 1) + end_gradient_ = 1; + else + end_gradient_ = 0; + } + + const double kBezierEpsilon = 1e-7; + + void InitRange(double p1y, double p2y) + { + range_min_ = 0; + range_max_ = 1; + if (0 <= p1y && p1y < 1 && 0 <= p2y && p2y <= 1) + return; + + double epsilon = kBezierEpsilon; + + // Represent the function's derivative in the form at^2 + bt + c + // as in sampleCurveDerivativeY. + // (Technically this is (dy/dt)*(1/3), which is suitable for finding zeros + // but does not actually give the slope of the curve.) + double a = 3.0 * ay_; + double b = 2.0 * by_; + double c = cy_; + + // Check if the derivative is constant. + if (Math.Abs(a) < epsilon && Math.Abs(b) < epsilon) + return; + + // Zeros of the function's derivative. + double t1; + double t2 = 0; + + if (Math.Abs(a) < epsilon) + { + // The function's derivative is linear. + t1 = -c / b; + } + else + { + // The function's derivative is a quadratic. We find the zeros of this + // quadratic using the quadratic formula. + double discriminant = b * b - 4 * a * c; + if (discriminant < 0) + return; + double discriminant_sqrt = Math.Sqrt(discriminant); + t1 = (-b + discriminant_sqrt) / (2 * a); + t2 = (-b - discriminant_sqrt) / (2 * a); + } + + double sol1 = 0; + double sol2 = 0; + + // If the solution is in the range [0,1] then we include it, otherwise we + // ignore it. + + // An interesting fact about these beziers is that they are only + // actually evaluated in [0,1]. After that we take the tangent at that point + // and linearly project it out. + if (0 < t1 && t1 < 1) + sol1 = SampleCurveY(t1); + + if (0 < t2 && t2 < 1) + sol2 = SampleCurveY(t2); + + range_min_ = Math.Min(Math.Min(range_min_, sol1), sol2); + range_max_ = Math.Max(Math.Max(range_max_, sol1), sol2); + } + + void InitSpline() + { + double delta_t = 1.0 / (CUBIC_BEZIER_SPLINE_SAMPLES - 1); + for (int i = 0; i < CUBIC_BEZIER_SPLINE_SAMPLES; i++) + { + spline_samples_[i] = SampleCurveX(i * delta_t); + } + } + + const int kMaxNewtonIterations = 4; + + + public readonly double SolveCurveX(double x, double epsilon) + { + if (x < 0 || x > 1) + throw new ArgumentException(); + + double t0 = 0; + double t1 = 0; + double t2 = x; + double x2 = 0; + double d2; + int i; + +#if DEBUG + if (!monotonically_increasing_) + throw new InvalidOperationException(); +#endif + + // Linear interpolation of spline curve for initial guess. + double delta_t = 1.0 / (CUBIC_BEZIER_SPLINE_SAMPLES - 1); + for (i = 1; i < CUBIC_BEZIER_SPLINE_SAMPLES; i++) + { + if (x <= spline_samples_[i]) + { + t1 = delta_t * i; + t0 = t1 - delta_t; + t2 = t0 + (t1 - t0) * (x - spline_samples_[i - 1]) / + (spline_samples_[i] - spline_samples_[i - 1]); + break; + } + } + + // Perform a few iterations of Newton's method -- normally very fast. + // See https://en.wikipedia.org/wiki/Newton%27s_method. + double newton_epsilon = Math.Min(kBezierEpsilon, epsilon); + for (i = 0; i < kMaxNewtonIterations; i++) + { + x2 = SampleCurveX(t2) - x; + if (Math.Abs(x2) < newton_epsilon) + return t2; + d2 = SampleCurveDerivativeX(t2); + if (Math.Abs(d2) < kBezierEpsilon) + break; + t2 = t2 - x2 / d2; + } + + if (Math.Abs(x2) < epsilon) + return t2; + + // Fall back to the bisection method for reliability. + while (t0 < t1) + { + x2 = SampleCurveX(t2); + if (Math.Abs(x2 - x) < epsilon) + return t2; + if (x > x2) + t0 = t2; + else + t1 = t2; + t2 = (t1 + t0) * .5; + } + + // Failure. + return t2; + } + + public readonly double Solve(double x) + { + return SolveWithEpsilon(x, kBezierEpsilon); + } + + public readonly double SlopeWithEpsilon(double x, double epsilon) + { + x = MathUtilities.Clamp(x, 0.0, 1.0); + double t = SolveCurveX(x, epsilon); + double dx = SampleCurveDerivativeX(t); + double dy = SampleCurveDerivativeY(t); + return dy / dx; + } + + public readonly double Slope(double x) + { + return SlopeWithEpsilon(x, kBezierEpsilon); + } + + public readonly double RangeMin => range_min_; + public readonly double RangeMax => range_max_; + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Animation/Easings/CubicBezierEasing.cs b/src/Avalonia.Base/Animation/Easings/CubicBezierEasing.cs new file mode 100644 index 0000000000..71582fa448 --- /dev/null +++ b/src/Avalonia.Base/Animation/Easings/CubicBezierEasing.cs @@ -0,0 +1,27 @@ +using System; + +namespace Avalonia.Animation.Easings; + +public class CubicBezierEasing : IEasing +{ + private CubicBezier _bezier; + //cubic-bezier(0.25, 0.1, 0.25, 1.0) + internal CubicBezierEasing(Point controlPoint1, Point controlPoint2) + { + ControlPoint1 = controlPoint1; + ControlPoint2 = controlPoint2; + if (controlPoint1.X < 0 || controlPoint1.X > 1 || controlPoint2.X < 0 || controlPoint2.X > 1) + throw new ArgumentException(); + _bezier = new CubicBezier(controlPoint1.X, controlPoint1.Y, controlPoint2.X, controlPoint2.Y); + } + + public Point ControlPoint2 { get; set; } + public Point ControlPoint1 { get; set; } + + internal static IEasing Ease { get; } = new CubicBezierEasing(new Point(0.25, 0.1), new Point(0.25, 1)); + + double IEasing.Ease(double progress) + { + return _bezier.Solve(progress); + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Avalonia.Base.csproj b/src/Avalonia.Base/Avalonia.Base.csproj index a07e0e3667..15feed388b 100644 --- a/src/Avalonia.Base/Avalonia.Base.csproj +++ b/src/Avalonia.Base/Avalonia.Base.csproj @@ -3,10 +3,13 @@ net6.0;netstandard2.0 Avalonia.Base Avalonia - True + True + true + $(BaseIntermediateOutputPath)\GeneratedFiles + @@ -32,6 +35,11 @@ - + + + + + + diff --git a/src/Avalonia.Base/Collections/IAvaloniaReadOnlyList.cs b/src/Avalonia.Base/Collections/IAvaloniaReadOnlyList.cs index a6a5953827..cefbf642be 100644 --- a/src/Avalonia.Base/Collections/IAvaloniaReadOnlyList.cs +++ b/src/Avalonia.Base/Collections/IAvaloniaReadOnlyList.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; diff --git a/src/Avalonia.Base/Collections/Pooled/PooledList.cs b/src/Avalonia.Base/Collections/Pooled/PooledList.cs index 803b8d60dc..267c403ab7 100644 --- a/src/Avalonia.Base/Collections/Pooled/PooledList.cs +++ b/src/Avalonia.Base/Collections/Pooled/PooledList.cs @@ -1434,7 +1434,7 @@ namespace Avalonia.Collections.Pooled /// /// Returns the internal buffers to the ArrayPool. /// - public void Dispose() + public virtual void Dispose() { ReturnArray(); _size = 0; diff --git a/src/Avalonia.Base/Controls/Classes.cs b/src/Avalonia.Base/Controls/Classes.cs index 50605661fa..c3d3fbca46 100644 --- a/src/Avalonia.Base/Controls/Classes.cs +++ b/src/Avalonia.Base/Controls/Classes.cs @@ -1,8 +1,7 @@ using System; using System.Collections.Generic; using Avalonia.Collections; - -#nullable enable +using Avalonia.Utilities; namespace Avalonia.Controls { @@ -14,6 +13,8 @@ namespace Avalonia.Controls /// public class Classes : AvaloniaList, IPseudoClasses { + private SafeEnumerableList? _listeners; + /// /// Initializes a new instance of the class. /// @@ -39,6 +40,11 @@ namespace Avalonia.Controls { } + /// + /// Gets the number of listeners subscribed to this collection for unit testing purposes. + /// + internal int ListenerCount => _listeners?.Count ?? 0; + /// /// Parses a classes string. /// @@ -62,6 +68,7 @@ namespace Avalonia.Controls if (!Contains(name)) { base.Add(name); + NotifyChanged(); } } @@ -89,6 +96,7 @@ namespace Avalonia.Controls } base.AddRange(c); + NotifyChanged(); } /// @@ -103,6 +111,8 @@ namespace Avalonia.Controls RemoveAt(i); } } + + NotifyChanged(); } /// @@ -122,6 +132,7 @@ namespace Avalonia.Controls if (!Contains(name)) { base.Insert(index, name); + NotifyChanged(); } } @@ -154,6 +165,7 @@ namespace Avalonia.Controls if (toInsert != null) { base.InsertRange(index, toInsert); + NotifyChanged(); } } @@ -169,7 +181,14 @@ namespace Avalonia.Controls public override bool Remove(string name) { ThrowIfPseudoclass(name, "removed"); - return base.Remove(name); + + if (base.Remove(name)) + { + NotifyChanged(); + return true; + } + + return false; } /// @@ -197,6 +216,7 @@ namespace Avalonia.Controls if (toRemove != null) { base.RemoveAll(toRemove); + NotifyChanged(); } } @@ -214,6 +234,7 @@ namespace Avalonia.Controls var name = this[index]; ThrowIfPseudoclass(name, "removed"); base.RemoveAt(index); + NotifyChanged(); } /// @@ -224,6 +245,7 @@ namespace Avalonia.Controls public override void RemoveRange(int index, int count) { base.RemoveRange(index, count); + NotifyChanged(); } /// @@ -255,6 +277,7 @@ namespace Avalonia.Controls } base.AddRange(source); + NotifyChanged(); } /// @@ -263,13 +286,38 @@ namespace Avalonia.Controls if (!Contains(name)) { base.Add(name); + NotifyChanged(); } } /// bool IPseudoClasses.Remove(string name) { - return base.Remove(name); + if (base.Remove(name)) + { + NotifyChanged(); + return true; + } + + return false; + } + + internal void AddListener(IClassesChangedListener listener) + { + (_listeners ??= new()).Add(listener); + } + + internal void RemoveListener(IClassesChangedListener listener) + { + _listeners?.Remove(listener); + } + + private void NotifyChanged() + { + if (_listeners is null) + return; + foreach (var listener in _listeners) + listener.Changed(); } private void ThrowIfPseudoclass(string name, string operation) diff --git a/src/Avalonia.Base/Controls/IClassesChangedListener.cs b/src/Avalonia.Base/Controls/IClassesChangedListener.cs new file mode 100644 index 0000000000..b4de893c97 --- /dev/null +++ b/src/Avalonia.Base/Controls/IClassesChangedListener.cs @@ -0,0 +1,14 @@ +namespace Avalonia.Controls +{ + /// + /// Internal interface for listening to changes in in a more + /// performant manner than subscribing to CollectionChanged. + /// + internal interface IClassesChangedListener + { + /// + /// Notifies the listener that the collection has changed. + /// + void Changed(); + } +} diff --git a/src/Avalonia.Base/Controls/IPseudoClasses.cs b/src/Avalonia.Base/Controls/IPseudoClasses.cs index eda521727f..438b05a8cf 100644 --- a/src/Avalonia.Base/Controls/IPseudoClasses.cs +++ b/src/Avalonia.Base/Controls/IPseudoClasses.cs @@ -19,5 +19,12 @@ namespace Avalonia.Controls /// /// The pseudoclass name. bool Remove(string name); + + /// + /// Returns whether a pseudoclass is present in the collection. + /// + /// The pseudoclass name. + /// Whether the pseudoclass is present. + bool Contains(string name); } } diff --git a/src/Avalonia.Base/Data/Core/Plugins/InpcPropertyAccessorPlugin.cs b/src/Avalonia.Base/Data/Core/Plugins/InpcPropertyAccessorPlugin.cs index b93bf87fdf..91d69b5d3d 100644 --- a/src/Avalonia.Base/Data/Core/Plugins/InpcPropertyAccessorPlugin.cs +++ b/src/Avalonia.Base/Data/Core/Plugins/InpcPropertyAccessorPlugin.cs @@ -55,7 +55,7 @@ namespace Avalonia.Data.Core.Plugins private PropertyInfo? GetFirstPropertyWithName(object instance, string propertyName) { - if (instance is IReflectableType reflectableType) + if (instance is IReflectableType reflectableType && instance is not Type) return reflectableType.GetTypeInfo().GetProperty(propertyName, PropertyBindingFlags); var type = instance.GetType(); diff --git a/src/Avalonia.Base/Input/Cursor.cs b/src/Avalonia.Base/Input/Cursor.cs index 122838f682..98c4258a90 100644 --- a/src/Avalonia.Base/Input/Cursor.cs +++ b/src/Avalonia.Base/Input/Cursor.cs @@ -32,10 +32,7 @@ namespace Avalonia.Input DragCopy, DragLink, None, - - [Obsolete("Use BottomSide")] - BottomSize = BottomSide - + // Not available in GTK directly, see http://www.pixelbeat.org/programming/x_cursors/ // We might enable them later, preferably, by loading pixmax directly from theme with fallback image // SizeNorthWestSouthEast, diff --git a/src/Avalonia.Base/Input/DragEventArgs.cs b/src/Avalonia.Base/Input/DragEventArgs.cs index 22ca8358ff..0e613c0f21 100644 --- a/src/Avalonia.Base/Input/DragEventArgs.cs +++ b/src/Avalonia.Base/Input/DragEventArgs.cs @@ -13,9 +13,6 @@ namespace Avalonia.Input public IDataObject Data { get; private set; } - [Obsolete("Use KeyModifiers")] - public InputModifiers Modifiers { get; private set; } - public KeyModifiers KeyModifiers { get; private set; } public Point GetPosition(IVisual relativeTo) @@ -35,17 +32,6 @@ namespace Avalonia.Input return point; } - [Obsolete("Use constructor taking KeyModifiers")] - public DragEventArgs(RoutedEvent routedEvent, IDataObject data, Interactive target, Point targetLocation, InputModifiers modifiers) - : base(routedEvent) - { - Data = data; - _target = target; - _targetLocation = targetLocation; - Modifiers = modifiers; - KeyModifiers = (KeyModifiers)(((int)modifiers) & 0xF); - } - public DragEventArgs(RoutedEvent routedEvent, IDataObject data, Interactive target, Point targetLocation, KeyModifiers keyModifiers) : base(routedEvent) { @@ -53,10 +39,6 @@ namespace Avalonia.Input _target = target; _targetLocation = targetLocation; KeyModifiers = keyModifiers; -#pragma warning disable CS0618 // Type or member is obsolete - Modifiers = (InputModifiers)keyModifiers; -#pragma warning restore CS0618 // Type or member is obsolete } - } } diff --git a/src/Avalonia.Base/Input/GotFocusEventArgs.cs b/src/Avalonia.Base/Input/GotFocusEventArgs.cs index 9d958823fe..5cce138ee0 100644 --- a/src/Avalonia.Base/Input/GotFocusEventArgs.cs +++ b/src/Avalonia.Base/Input/GotFocusEventArgs.cs @@ -1,4 +1,3 @@ -using System; using Avalonia.Interactivity; namespace Avalonia.Input @@ -13,16 +12,6 @@ namespace Avalonia.Input /// public NavigationMethod NavigationMethod { get; set; } - /// - /// Gets or sets any input modifiers active at the time of focus. - /// - [Obsolete("Use KeyModifiers")] - public InputModifiers InputModifiers - { - get => (InputModifiers)KeyModifiers; - set => KeyModifiers = (KeyModifiers)((int)value & 0xF); - } - /// /// Gets or sets any key modifiers active at the time of focus. /// diff --git a/src/Avalonia.Base/Input/IInputRoot.cs b/src/Avalonia.Base/Input/IInputRoot.cs index 7edc69df52..344a4eefd7 100644 --- a/src/Avalonia.Base/Input/IInputRoot.cs +++ b/src/Avalonia.Base/Input/IInputRoot.cs @@ -27,10 +27,5 @@ namespace Avalonia.Input /// Gets or sets a value indicating whether access keys are shown in the window. /// bool ShowAccessKeys { get; set; } - - /// - /// Gets associated mouse device - /// - IMouseDevice? MouseDevice { get; } } } diff --git a/src/Avalonia.Base/Input/IKeyboardDevice.cs b/src/Avalonia.Base/Input/IKeyboardDevice.cs index 80aebc02bc..0b7b5aaecc 100644 --- a/src/Avalonia.Base/Input/IKeyboardDevice.cs +++ b/src/Avalonia.Base/Input/IKeyboardDevice.cs @@ -4,19 +4,6 @@ using Avalonia.Metadata; namespace Avalonia.Input { - [Flags, Obsolete("Use KeyModifiers and PointerPointProperties")] - public enum InputModifiers - { - None = 0, - Alt = 1, - Control = 2, - Shift = 4, - Windows = 8, - LeftMouseButton = 16, - RightMouseButton = 32, - MiddleMouseButton = 64 - } - [Flags] public enum KeyModifiers { diff --git a/src/Avalonia.Base/Input/IMouseDevice.cs b/src/Avalonia.Base/Input/IMouseDevice.cs index 2d66397d63..00c436bf21 100644 --- a/src/Avalonia.Base/Input/IMouseDevice.cs +++ b/src/Avalonia.Base/Input/IMouseDevice.cs @@ -1,4 +1,3 @@ -using System; using Avalonia.Metadata; namespace Avalonia.Input @@ -9,16 +8,5 @@ namespace Avalonia.Input [NotClientImplementable] public interface IMouseDevice : IPointerDevice { - /// - /// Gets the mouse position, in screen coordinates. - /// - [Obsolete("Use PointerEventArgs.GetPosition")] - PixelPoint Position { get; } - - [Obsolete] - void TopLevelClosed(IInputRoot root); - - [Obsolete] - void SceneInvalidated(IInputRoot root, Rect rect); } } diff --git a/src/Avalonia.Base/Input/IPointerDevice.cs b/src/Avalonia.Base/Input/IPointerDevice.cs index 0993835feb..e0aebda9c5 100644 --- a/src/Avalonia.Base/Input/IPointerDevice.cs +++ b/src/Avalonia.Base/Input/IPointerDevice.cs @@ -1,5 +1,3 @@ -using System; -using Avalonia.VisualTree; using Avalonia.Input.Raw; using Avalonia.Metadata; @@ -8,18 +6,6 @@ namespace Avalonia.Input [NotClientImplementable] public interface IPointerDevice : IInputDevice { - /// - [Obsolete("Use IPointer")] - IInputElement? Captured { get; } - - /// - [Obsolete("Use IPointer")] - void Capture(IInputElement? control); - - /// - [Obsolete("Use PointerEventArgs.GetPosition")] - Point GetPosition(IVisual relativeTo); - /// /// Gets a pointer for specific event args. /// diff --git a/src/Avalonia.Base/Input/KeyEventArgs.cs b/src/Avalonia.Base/Input/KeyEventArgs.cs index 67cd5a520a..b8291e9096 100644 --- a/src/Avalonia.Base/Input/KeyEventArgs.cs +++ b/src/Avalonia.Base/Input/KeyEventArgs.cs @@ -9,8 +9,6 @@ namespace Avalonia.Input public Key Key { get; set; } - [Obsolete("Use KeyModifiers")] - public InputModifiers Modifiers => (InputModifiers)KeyModifiers; public KeyModifiers KeyModifiers { get; set; } } } diff --git a/src/Avalonia.Base/Input/KeyGesture.cs b/src/Avalonia.Base/Input/KeyGesture.cs index 3b7a828b86..e79e9341a9 100644 --- a/src/Avalonia.Base/Input/KeyGesture.cs +++ b/src/Avalonia.Base/Input/KeyGesture.cs @@ -15,13 +15,6 @@ namespace Avalonia.Input { "+", Key.OemPlus }, { "-", Key.OemMinus }, { ".", Key.OemPeriod }, { ",", Key.OemComma } }; - [Obsolete("Use constructor taking KeyModifiers")] - public KeyGesture(Key key, InputModifiers modifiers) - { - Key = key; - KeyModifiers = (KeyModifiers)(((int)modifiers) & 0xf); - } - public KeyGesture(Key key, KeyModifiers modifiers = KeyModifiers.None) { Key = key; @@ -63,10 +56,7 @@ namespace Avalonia.Input } public Key Key { get; } - - [Obsolete("Use KeyModifiers")] - public InputModifiers Modifiers => (InputModifiers)KeyModifiers; - + public KeyModifiers KeyModifiers { get; } public static KeyGesture Parse(string gesture) diff --git a/src/Avalonia.Base/Input/MouseDevice.cs b/src/Avalonia.Base/Input/MouseDevice.cs index 5f8ab24b79..055c9cf1fd 100644 --- a/src/Avalonia.Base/Input/MouseDevice.cs +++ b/src/Avalonia.Base/Input/MouseDevice.cs @@ -21,7 +21,6 @@ namespace Avalonia.Input private readonly Pointer _pointer; private bool _disposed; - private PixelPoint? _position; private MouseButton _lastMouseDownButton; public MouseDevice(Pointer? pointer = null) @@ -29,43 +28,6 @@ namespace Avalonia.Input _pointer = pointer ?? new Pointer(Pointer.GetNextFreeId(), PointerType.Mouse, true); } - [Obsolete("Use IPointer instead")] - public IInputElement? Captured => _pointer.Captured; - - [Obsolete("Use events instead")] - public PixelPoint Position - { - get => _position ?? new PixelPoint(-1, -1); - protected set => _position = value; - } - - [Obsolete("Use IPointer instead")] - public void Capture(IInputElement? control) - { - _pointer.Capture(control); - } - - /// - /// Gets the mouse position relative to a control. - /// - /// The control. - /// The mouse position in the control's coordinates. - public Point GetPosition(IVisual relativeTo) - { - relativeTo = relativeTo ?? throw new ArgumentNullException(nameof(relativeTo)); - - if (relativeTo.VisualRoot == null) - { - throw new InvalidOperationException("Control is not attached to visual tree."); - } - -#pragma warning disable CS0618 // Type or member is obsolete - var rootPoint = relativeTo.VisualRoot.PointToClient(Position); -#pragma warning restore CS0618 // Type or member is obsolete - var transform = relativeTo.VisualRoot.TransformToVisual(relativeTo); - return rootPoint * transform!.Value; - } - public void ProcessRawEvent(RawInputEventArgs e) { if (!e.Handled && e is RawPointerEventArgs margs) @@ -96,7 +58,6 @@ namespace Avalonia.Input if(mouse._disposed) return; - _position = e.Root.PointToScreen(e.Position); var props = CreateProperties(e); var keyModifiers = e.InputModifiers.ToKeyModifiers(); switch (e.Type) @@ -145,7 +106,6 @@ namespace Avalonia.Input private void LeaveWindow() { - _position = null; } PointerPointProperties CreateProperties(RawPointerEventArgs args) @@ -324,19 +284,7 @@ namespace Avalonia.Input _disposed = true; _pointer?.Dispose(); } - - [Obsolete] - public void TopLevelClosed(IInputRoot root) - { - // no-op - } - - [Obsolete] - public void SceneInvalidated(IInputRoot root, Rect rect) - { - // no-op - } - + public IPointer? TryGetPointer(RawPointerEventArgs ev) { return _pointer; diff --git a/src/Avalonia.Base/Input/PenDevice.cs b/src/Avalonia.Base/Input/PenDevice.cs index d22b48562c..f5f0e90a45 100644 --- a/src/Avalonia.Base/Input/PenDevice.cs +++ b/src/Avalonia.Base/Input/PenDevice.cs @@ -1,10 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reactive.Linq; using Avalonia.Input.Raw; using Avalonia.Platform; -using Avalonia.VisualTree; namespace Avalonia.Input { @@ -14,7 +12,6 @@ namespace Avalonia.Input public class PenDevice : IPenDevice, IDisposable { private readonly Dictionary _pointers = new(); - private readonly Dictionary _lastPositions = new(); private int _clickCount; private Rect _lastClickRect; private ulong _lastClickTime; @@ -41,9 +38,7 @@ namespace Avalonia.Input _pointers[e.RawPointerId] = pointer = new Pointer(Pointer.GetNextFreeId(), PointerType.Pen, _pointers.Count == 0); } - - _lastPositions[e.RawPointerId] = e.Root.PointToScreen(e.Position); - + var props = new PointerPointProperties(e.InputModifiers, e.Type.ToUpdateKind(), e.Point.Twist, e.Point.Pressure, e.Point.XTilt, e.Point.YTilt); var keyModifiers = e.InputModifiers.ToKeyModifiers(); @@ -69,7 +64,6 @@ namespace Avalonia.Input { pointer.Dispose(); _pointers.Remove(e.RawPointerId); - _lastPositions.Remove(e.RawPointerId); } } @@ -153,17 +147,6 @@ namespace Avalonia.Input p.Dispose(); } - [Obsolete] - IInputElement? IPointerDevice.Captured => _pointers.Values - .FirstOrDefault(p => p.IsPrimary)?.Captured; - - [Obsolete] - void IPointerDevice.Capture(IInputElement? control) => _pointers.Values - .FirstOrDefault(p => p.IsPrimary)?.Capture(control); - - [Obsolete] - Point IPointerDevice.GetPosition(IVisual relativeTo) => new Point(-1, -1); - public IPointer? TryGetPointer(RawPointerEventArgs ev) { return _pointers.TryGetValue(ev.RawPointerId, out var pointer) diff --git a/src/Avalonia.Base/Input/PointerEventArgs.cs b/src/Avalonia.Base/Input/PointerEventArgs.cs index 058c2f9cc1..1f3c726e7b 100644 --- a/src/Avalonia.Base/Input/PointerEventArgs.cs +++ b/src/Avalonia.Base/Input/PointerEventArgs.cs @@ -11,7 +11,7 @@ namespace Avalonia.Input private readonly IVisual? _rootVisual; private readonly Point _rootVisualPosition; private readonly PointerPointProperties _properties; - private Lazy?>? _previousPoints; + private readonly Lazy?>? _previousPoints; public PointerEventArgs(RoutedEvent routedEvent, IInteractive? source, @@ -43,29 +43,6 @@ namespace Avalonia.Input { _previousPoints = previousPoints; } - - - class EmulatedDevice : IPointerDevice - { - private readonly PointerEventArgs _ev; - - public EmulatedDevice(PointerEventArgs ev) - { - _ev = ev; - } - - public void ProcessRawEvent(RawInputEventArgs ev) => throw new NotSupportedException(); - - public IInputElement? Captured => _ev.Pointer.Captured; - public void Capture(IInputElement? control) - { - _ev.Pointer.Capture(control); - } - - public Point GetPosition(IVisual relativeTo) => _ev.GetPosition(relativeTo); - - public IPointer? TryGetPointer(RawPointerEventArgs ev) => _ev.Pointer; - } /// /// Gets specific pointer generated by input device. @@ -77,28 +54,6 @@ namespace Avalonia.Input /// public ulong Timestamp { get; } - private IPointerDevice? _device; - - [Obsolete("Use Pointer to get pointer-specific information")] - public IPointerDevice Device => _device ?? (_device = new EmulatedDevice(this)); - - [Obsolete("Use KeyModifiers and PointerPointProperties")] - public InputModifiers InputModifiers - { - get - { - var mods = (InputModifiers)KeyModifiers; - if (_properties.IsLeftButtonPressed) - mods |= InputModifiers.LeftMouseButton; - if (_properties.IsMiddleButtonPressed) - mods |= InputModifiers.MiddleMouseButton; - if (_properties.IsRightButtonPressed) - mods |= InputModifiers.RightMouseButton; - - return mods; - } - } - /// /// Gets a value that indicates which key modifiers were active at the time that the pointer event was initiated. /// @@ -120,9 +75,6 @@ namespace Avalonia.Input /// The pointer position in the control's coordinates. public Point GetPosition(IVisual? relativeTo) => GetPosition(_rootVisualPosition, relativeTo); - [Obsolete("Use GetCurrentPoint")] - public PointerPoint GetPointerPoint(IVisual? relativeTo) => GetCurrentPoint(relativeTo); - /// /// Returns the PointerPoint associated with the current event /// @@ -171,8 +123,6 @@ namespace Avalonia.Input public class PointerPressedEventArgs : PointerEventArgs { - private readonly int _clickCount; - public PointerPressedEventArgs( IInteractive source, IPointer pointer, @@ -184,13 +134,10 @@ namespace Avalonia.Input : base(InputElement.PointerPressedEvent, source, pointer, rootVisual, rootVisualPosition, timestamp, properties, modifiers) { - _clickCount = clickCount; + ClickCount = clickCount; } - public int ClickCount => _clickCount; - - [Obsolete("Use PointerPressedEventArgs.GetCurrentPoint(this).Properties")] - public MouseButton MouseButton => Properties.PointerUpdateKind.GetMouseButton(); + public int ClickCount { get; } } public class PointerReleasedEventArgs : PointerEventArgs @@ -210,9 +157,6 @@ namespace Avalonia.Input /// Gets the mouse button that triggered the corresponding PointerPressed event /// public MouseButton InitialPressMouseButton { get; } - - [Obsolete("Use InitialPressMouseButton")] - public MouseButton MouseButton => InitialPressMouseButton; } public class PointerCaptureLostEventArgs : RoutedEventArgs diff --git a/src/Avalonia.Base/Input/PointerOverPreProcessor.cs b/src/Avalonia.Base/Input/PointerOverPreProcessor.cs index 67d1eea7e3..a95d66346a 100644 --- a/src/Avalonia.Base/Input/PointerOverPreProcessor.cs +++ b/src/Avalonia.Base/Input/PointerOverPreProcessor.cs @@ -15,6 +15,8 @@ namespace Avalonia.Input _inputRoot = inputRoot ?? throw new ArgumentNullException(nameof(inputRoot)); } + public PixelPoint? LastPosition => _lastPointer?.position; + public void OnCompleted() { ClearPointerOver(); diff --git a/src/Avalonia.Base/Input/Raw/RawDragEvent.cs b/src/Avalonia.Base/Input/Raw/RawDragEvent.cs index 652bad7115..c903aad684 100644 --- a/src/Avalonia.Base/Input/Raw/RawDragEvent.cs +++ b/src/Avalonia.Base/Input/Raw/RawDragEvent.cs @@ -8,8 +8,6 @@ namespace Avalonia.Input.Raw public IDataObject Data { get; } public DragDropEffects Effects { get; set; } public RawDragEventType Type { get; } - [Obsolete("Use KeyModifiers")] - public InputModifiers Modifiers { get; } public KeyModifiers KeyModifiers { get; } public RawDragEvent(IDragDropDevice inputDevice, RawDragEventType type, @@ -21,9 +19,6 @@ namespace Avalonia.Input.Raw Data = data; Effects = effects; KeyModifiers = modifiers.ToKeyModifiers(); -#pragma warning disable CS0618 // Type or member is obsolete - Modifiers = (InputModifiers)modifiers; -#pragma warning restore CS0618 // Type or member is obsolete } } } diff --git a/src/Avalonia.Base/Input/Raw/RawTouchEventArgs.cs b/src/Avalonia.Base/Input/Raw/RawTouchEventArgs.cs index 6706a45f48..3e842e6e3f 100644 --- a/src/Avalonia.Base/Input/Raw/RawTouchEventArgs.cs +++ b/src/Avalonia.Base/Input/Raw/RawTouchEventArgs.cs @@ -19,8 +19,5 @@ namespace Avalonia.Input.Raw { RawPointerId = rawPointerId; } - - [Obsolete("Use RawPointerId")] - public long TouchPointId { get => RawPointerId; set => RawPointerId = value; } } } diff --git a/src/Avalonia.Base/Input/TouchDevice.cs b/src/Avalonia.Base/Input/TouchDevice.cs index e914d860fd..1d5b1d6bbf 100644 --- a/src/Avalonia.Base/Input/TouchDevice.cs +++ b/src/Avalonia.Base/Input/TouchDevice.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Linq; using Avalonia.Input.Raw; using Avalonia.Platform; -using Avalonia.VisualTree; namespace Avalonia.Input { @@ -20,9 +19,6 @@ namespace Avalonia.Input private int _clickCount; private Rect _lastClickRect; private ulong _lastClickTime; - private Pointer? _lastPointer; - - IInputElement? IPointerDevice.Captured => _lastPointer?.Captured; RawInputModifiers GetModifiers(RawInputModifiers modifiers, bool isLeftButtonDown) { @@ -32,10 +28,6 @@ namespace Avalonia.Input return rv; } - void IPointerDevice.Capture(IInputElement? control) => _lastPointer?.Capture(control); - - Point IPointerDevice.GetPosition(IVisual relativeTo) => default; - public void ProcessRawEvent(RawInputEventArgs ev) { if (ev.Handled || _disposed) @@ -51,7 +43,6 @@ namespace Avalonia.Input PointerType.Touch, _pointers.Count == 0); pointer.Capture(hit); } - _lastPointer = pointer; var target = pointer.Captured ?? args.Root; var updateKind = args.Type.ToUpdateKind(); @@ -96,7 +87,6 @@ namespace Avalonia.Input new PointerPointProperties(GetModifiers(args.InputModifiers, false), updateKind), keyModifier, MouseButton.Left)); } - _lastPointer = null; } if (args.Type == RawPointerEventType.TouchCancel) @@ -104,7 +94,6 @@ namespace Avalonia.Input _pointers.Remove(args.RawPointerId); using (pointer) pointer.Capture(null); - _lastPointer = null; } if (args.Type == RawPointerEventType.TouchUpdate) diff --git a/src/Avalonia.Base/Layout/LayoutManager.cs b/src/Avalonia.Base/Layout/LayoutManager.cs index 446f135c83..b9ca6bfbd7 100644 --- a/src/Avalonia.Base/Layout/LayoutManager.cs +++ b/src/Avalonia.Base/Layout/LayoutManager.cs @@ -350,7 +350,7 @@ namespace Avalonia.Layout { for (var i = 0; i < count; ++i) { - var l = _effectiveViewportChangedListeners[i]; + var l = listeners[i]; if (!l.Listener.IsAttachedToVisualTree) { @@ -362,7 +362,7 @@ namespace Avalonia.Layout if (viewport != l.Viewport) { l.Listener.EffectiveViewportChanged(new EffectiveViewportChangedEventArgs(viewport)); - _effectiveViewportChangedListeners[i] = new EffectiveViewportChangedListener(l.Listener, viewport); + l.Viewport = viewport; } } } @@ -414,7 +414,7 @@ namespace Avalonia.Layout } } - private readonly struct EffectiveViewportChangedListener + private class EffectiveViewportChangedListener { public EffectiveViewportChangedListener(ILayoutable listener, Rect viewport) { @@ -423,7 +423,7 @@ namespace Avalonia.Layout } public ILayoutable Listener { get; } - public Rect Viewport { get; } + public Rect Viewport { get; set; } } } } diff --git a/src/Markup/Avalonia.Markup.Xaml/IAddChild.cs b/src/Avalonia.Base/Metadata/IAddChild.cs similarity index 61% rename from src/Markup/Avalonia.Markup.Xaml/IAddChild.cs rename to src/Avalonia.Base/Metadata/IAddChild.cs index 993eb6142d..8ef02912a6 100644 --- a/src/Markup/Avalonia.Markup.Xaml/IAddChild.cs +++ b/src/Avalonia.Base/Metadata/IAddChild.cs @@ -1,11 +1,11 @@ -namespace Avalonia.Markup.Xaml +namespace Avalonia.Metadata { public interface IAddChild { void AddChild(object child); } - public interface IAddChild : IAddChild + public interface IAddChild { void AddChild(T child); } diff --git a/src/Avalonia.Base/Platform/IPlatformGpu.cs b/src/Avalonia.Base/Platform/IPlatformGpu.cs new file mode 100644 index 0000000000..0507dea1d7 --- /dev/null +++ b/src/Avalonia.Base/Platform/IPlatformGpu.cs @@ -0,0 +1,16 @@ +using System; +using Avalonia.Metadata; + +namespace Avalonia.Platform; + +[Unstable] +public interface IPlatformGpu +{ + IPlatformGpuContext PrimaryContext { get; } +} + +[Unstable] +public interface IPlatformGpuContext : IDisposable +{ + IDisposable EnsureCurrent(); +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/AnimationInstanceBase.cs b/src/Avalonia.Base/Rendering/Composition/Animations/AnimationInstanceBase.cs new file mode 100644 index 0000000000..80e64118ee --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Animations/AnimationInstanceBase.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using Avalonia.Rendering.Composition.Expressions; +using Avalonia.Rendering.Composition.Server; + +namespace Avalonia.Rendering.Composition.Animations; + + +/// +/// The base class for both key-frame and expression animation instances +/// Is responsible for activation tracking and for subscribing to properties used in dependencies +/// +internal abstract class AnimationInstanceBase : IAnimationInstance +{ + private List<(ServerObject obj, CompositionProperty member)>? _trackedObjects; + protected PropertySetSnapshot Parameters { get; } + public ServerObject TargetObject { get; } + protected CompositionProperty Property { get; private set; } = null!; + private bool _invalidated; + + public AnimationInstanceBase(ServerObject target, PropertySetSnapshot parameters) + { + Parameters = parameters; + TargetObject = target; + } + + protected void Initialize(CompositionProperty property, HashSet<(string name, string member)> trackedObjects) + { + if (trackedObjects.Count > 0) + { + _trackedObjects = new (); + foreach (var t in trackedObjects) + { + var obj = Parameters.GetObjectParameter(t.name); + if (obj is ServerObject tracked) + { + var off = tracked.GetCompositionProperty(t.member); + if (off == null) +#if DEBUG + throw new InvalidCastException("Attempting to subscribe to unknown field"); +#else + continue; +#endif + _trackedObjects.Add((tracked, off)); + } + } + } + + Property = property; + } + + public abstract void Initialize(TimeSpan startedAt, ExpressionVariant startingValue, CompositionProperty property); + protected abstract ExpressionVariant EvaluateCore(TimeSpan now, ExpressionVariant currentValue); + + public ExpressionVariant Evaluate(TimeSpan now, ExpressionVariant currentValue) + { + _invalidated = false; + return EvaluateCore(now, currentValue); + } + + public virtual void Activate() + { + if (_trackedObjects != null) + foreach (var tracked in _trackedObjects) + tracked.obj.SubscribeToInvalidation(tracked.member, this); + } + + public virtual void Deactivate() + { + if (_trackedObjects != null) + foreach (var tracked in _trackedObjects) + tracked.obj.UnsubscribeFromInvalidation(tracked.member, this); + } + + public void Invalidate() + { + if (_invalidated) + return; + _invalidated = true; + TargetObject.NotifyAnimatedValueChanged(Property); + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/CompositionAnimation.cs b/src/Avalonia.Base/Rendering/Composition/Animations/CompositionAnimation.cs new file mode 100644 index 0000000000..c5102a2d7d --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Animations/CompositionAnimation.cs @@ -0,0 +1,75 @@ +// ReSharper disable InconsistentNaming +// ReSharper disable CheckNamespace + +using System; +using System.Collections.Generic; +using System.Numerics; +using Avalonia.Rendering.Composition.Expressions; +using Avalonia.Rendering.Composition.Server; +using Avalonia.Rendering.Composition.Transport; + +namespace Avalonia.Rendering.Composition.Animations +{ + /// + /// This is the base class for ExpressionAnimation and KeyFrameAnimation. + /// + /// + /// Use the method to start the animation. + /// Value parameters (as opposed to reference parameters which are set using ) + /// are copied and "embedded" into an expression at the time CompositionObject.StartAnimation is called. + /// Changing the value of the variable after is called will not affect + /// the value of the ExpressionAnimation. + /// See the remarks section of ExpressionAnimation for additional information. + /// + public abstract class CompositionAnimation : CompositionObject, ICompositionAnimationBase + { + private readonly CompositionPropertySet _propertySet; + internal CompositionAnimation(Compositor compositor) : base(compositor, null!) + { + _propertySet = new CompositionPropertySet(compositor); + } + + /// + /// Clears all of the parameters of the animation. + /// + public void ClearAllParameters() => _propertySet.ClearAll(); + + /// + /// Clears a parameter from the animation. + /// + public void ClearParameter(string key) => _propertySet.Clear(key); + + void SetVariant(string key, ExpressionVariant value) => _propertySet.Set(key, value); + + public void SetColorParameter(string key, Media.Color value) => SetVariant(key, value); + + public void SetMatrix3x2Parameter(string key, Matrix3x2 value) => SetVariant(key, value); + + public void SetMatrix4x4Parameter(string key, Matrix4x4 value) => SetVariant(key, value); + + public void SetQuaternionParameter(string key, Quaternion value) => SetVariant(key, value); + + public void SetReferenceParameter(string key, CompositionObject compositionObject) => + _propertySet.Set(key, compositionObject); + + public void SetScalarParameter(string key, float value) => SetVariant(key, value); + + public void SetVector2Parameter(string key, Vector2 value) => SetVariant(key, value); + + public void SetVector3Parameter(string key, Vector3 value) => SetVariant(key, value); + + public void SetVector4Parameter(string key, Vector4 value) => SetVariant(key, value); + + public string? Target { get; set; } + + internal abstract IAnimationInstance CreateInstance(ServerObject targetObject, + ExpressionVariant? finalValue); + + internal PropertySetSnapshot CreateSnapshot() => _propertySet.Snapshot(); + + void ICompositionAnimationBase.InternalOnly() + { + + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/CompositionAnimationGroup.cs b/src/Avalonia.Base/Rendering/Composition/Animations/CompositionAnimationGroup.cs new file mode 100644 index 0000000000..89f8ba411d --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Animations/CompositionAnimationGroup.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using Avalonia.Rendering.Composition.Transport; + + +namespace Avalonia.Rendering.Composition.Animations +{ + public class CompositionAnimationGroup : CompositionObject, ICompositionAnimationBase + { + internal List Animations { get; } = new List(); + void ICompositionAnimationBase.InternalOnly() + { + + } + + public void Add(CompositionAnimation value) => Animations.Add(value); + public void Remove(CompositionAnimation value) => Animations.Remove(value); + public void RemoveAll() => Animations.Clear(); + + public CompositionAnimationGroup(Compositor compositor) : base(compositor, null!) + { + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/ExpressionAnimation.cs b/src/Avalonia.Base/Rendering/Composition/Animations/ExpressionAnimation.cs new file mode 100644 index 0000000000..163f4e99ba --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Animations/ExpressionAnimation.cs @@ -0,0 +1,53 @@ +// ReSharper disable CheckNamespace +using System; +using Avalonia.Rendering.Composition.Expressions; +using Avalonia.Rendering.Composition.Server; + +namespace Avalonia.Rendering.Composition.Animations +{ + /// + /// A Composition Animation that uses a mathematical equation to calculate the value for an animating property every frame. + /// + /// + /// The core of ExpressionAnimations allows a developer to define a mathematical equation that can be used to calculate the value + /// of a targeted animating property each frame. + /// This contrasts s, which use an interpolator to define how the animating + /// property changes over time. The mathematical equation can be defined using references to properties + /// of Composition objects, mathematical functions and operators and Input. + /// Use the method to start the animation. + /// + public class ExpressionAnimation : CompositionAnimation + { + private string? _expression; + private Expression? _parsedExpression; + + internal ExpressionAnimation(Compositor compositor) : base(compositor) + { + } + + /// + /// The mathematical equation specifying how the animated value is calculated each frame. + /// The Expression is the core of an and represents the equation + /// the system will use to calculate the value of the animation property each frame. + /// The equation is set on this property in the form of a string. + /// Although expressions can be defined by simple mathematical equations such as "2+2", + /// the real power lies in creating mathematical relationships where the input values can change frame over frame. + /// + public string? Expression + { + get => _expression; + set + { + _expression = value; + _parsedExpression = null; + } + } + + private Expression ParsedExpression => _parsedExpression ??= ExpressionParser.Parse(_expression.AsSpan()); + + internal override IAnimationInstance CreateInstance( + ServerObject targetObject, ExpressionVariant? finalValue) + => new ExpressionAnimationInstance(ParsedExpression, + targetObject, finalValue, CreateSnapshot()); + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/ExpressionAnimationInstance.cs b/src/Avalonia.Base/Rendering/Composition/Animations/ExpressionAnimationInstance.cs new file mode 100644 index 0000000000..764bac9931 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Animations/ExpressionAnimationInstance.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using Avalonia.Rendering.Composition.Expressions; +using Avalonia.Rendering.Composition.Server; + +namespace Avalonia.Rendering.Composition.Animations +{ + + /// + /// Server-side counterpart of with values baked-in. + /// + internal class ExpressionAnimationInstance : AnimationInstanceBase, IAnimationInstance + { + private readonly Expression _expression; + private ExpressionVariant _startingValue; + private readonly ExpressionVariant? _finalValue; + + protected override ExpressionVariant EvaluateCore(TimeSpan now, ExpressionVariant currentValue) + { + var ctx = new ExpressionEvaluationContext + { + Parameters = Parameters, + Target = TargetObject, + ForeignFunctionInterface = BuiltInExpressionFfi.Instance, + StartingValue = _startingValue, + FinalValue = _finalValue ?? _startingValue, + CurrentValue = currentValue + }; + return _expression.Evaluate(ref ctx); + } + + public override void Initialize(TimeSpan startedAt, ExpressionVariant startingValue, CompositionProperty property) + { + _startingValue = startingValue; + var hs = new HashSet<(string, string)>(); + _expression.CollectReferences(hs); + base.Initialize(property, hs); + } + + public ExpressionAnimationInstance(Expression expression, + ServerObject target, + ExpressionVariant? finalValue, + PropertySetSnapshot parameters) : base(target, parameters) + { + _expression = expression; + _finalValue = finalValue; + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/IAnimationInstance.cs b/src/Avalonia.Base/Rendering/Composition/Animations/IAnimationInstance.cs new file mode 100644 index 0000000000..4e1972f2c6 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Animations/IAnimationInstance.cs @@ -0,0 +1,16 @@ +using System; +using Avalonia.Rendering.Composition.Expressions; +using Avalonia.Rendering.Composition.Server; + +namespace Avalonia.Rendering.Composition.Animations +{ + internal interface IAnimationInstance + { + ServerObject TargetObject { get; } + ExpressionVariant Evaluate(TimeSpan now, ExpressionVariant currentValue); + void Initialize(TimeSpan startedAt, ExpressionVariant startingValue, CompositionProperty property); + void Activate(); + void Deactivate(); + void Invalidate(); + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/ICompositionAnimationBase.cs b/src/Avalonia.Base/Rendering/Composition/Animations/ICompositionAnimationBase.cs new file mode 100644 index 0000000000..87e5ad757a --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Animations/ICompositionAnimationBase.cs @@ -0,0 +1,15 @@ +// ReSharper disable CheckNamespace + +using Avalonia.Rendering.Composition.Server; + +namespace Avalonia.Rendering.Composition.Animations +{ + /// + /// Base class for composition animations. + /// + public interface ICompositionAnimationBase + { + internal void InternalOnly(); + } + +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/ImplicitAnimationCollection.cs b/src/Avalonia.Base/Rendering/Composition/Animations/ImplicitAnimationCollection.cs new file mode 100644 index 0000000000..f4bcc6ff38 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Animations/ImplicitAnimationCollection.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using Avalonia.Rendering.Composition.Transport; + +namespace Avalonia.Rendering.Composition.Animations +{ + /// + /// A collection of animations triggered when a condition is met. + /// + /// + /// Implicit animations let you drive animations by specifying trigger conditions rather than requiring the manual definition of animation behavior. + /// They help decouple animation start logic from core app logic. You define animations and the events that should trigger these animations. + /// Currently the only available trigger is animated property change. + /// + /// When expression is used in ImplicitAnimationCollection a special keyword `this.FinalValue` will represent + /// the final value of the animated property that was changed + /// + public class ImplicitAnimationCollection : CompositionObject, IDictionary + { + private Dictionary _inner = new Dictionary(); + private IDictionary _innerface; + internal ImplicitAnimationCollection(Compositor compositor) : base(compositor, null!) + { + _innerface = _inner; + } + + public IEnumerator> GetEnumerator() => _inner.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable) _inner).GetEnumerator(); + + void ICollection>.Add(KeyValuePair item) => _innerface.Add(item); + + public void Clear() => _inner.Clear(); + + bool ICollection>.Contains(KeyValuePair item) => _innerface.Contains(item); + + void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) => _innerface.CopyTo(array, arrayIndex); + + bool ICollection>.Remove(KeyValuePair item) => _innerface.Remove(item); + + public int Count => _inner.Count; + + bool ICollection>.IsReadOnly => _innerface.IsReadOnly; + + public void Add(string key, ICompositionAnimationBase value) => _inner.Add(key, value); + + public bool ContainsKey(string key) => _inner.ContainsKey(key); + + public bool Remove(string key) => _inner.Remove(key); + + public bool TryGetValue(string key, [MaybeNullWhen(false)] out ICompositionAnimationBase value) => + _inner.TryGetValue(key, out value); + + public ICompositionAnimationBase this[string key] + { + get => _inner[key]; + set => _inner[key] = value; + } + + ICollection IDictionary.Keys => _innerface.Keys; + + ICollection IDictionary.Values => + _innerface.Values; + + // UWP compat + public uint Size => (uint) Count; + + public IReadOnlyDictionary GetView() => + new Dictionary(this); + + public bool HasKey(string key) => ContainsKey(key); + public void Insert(string key, ICompositionAnimationBase animation) => Add(key, animation); + + public ICompositionAnimationBase? Lookup(string key) + { + _inner.TryGetValue(key, out var rv); + return rv; + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/Interpolators.cs b/src/Avalonia.Base/Rendering/Composition/Animations/Interpolators.cs new file mode 100644 index 0000000000..a4eeacef32 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Animations/Interpolators.cs @@ -0,0 +1,76 @@ +using System; +using System.Numerics; + +namespace Avalonia.Rendering.Composition.Animations +{ + /// + /// An interface to define interpolation logic for a particular type + /// + internal interface IInterpolator + { + T Interpolate(T from, T to, float progress); + } + + class ScalarInterpolator : IInterpolator + { + public float Interpolate(float @from, float to, float progress) => @from + (to - @from) * progress; + + public static ScalarInterpolator Instance { get; } = new ScalarInterpolator(); + } + + class Vector2Interpolator : IInterpolator + { + public Vector2 Interpolate(Vector2 @from, Vector2 to, float progress) + => Vector2.Lerp(@from, to, progress); + + public static Vector2Interpolator Instance { get; } = new Vector2Interpolator(); + } + + class Vector3Interpolator : IInterpolator + { + public Vector3 Interpolate(Vector3 @from, Vector3 to, float progress) + => Vector3.Lerp(@from, to, progress); + + public static Vector3Interpolator Instance { get; } = new Vector3Interpolator(); + } + + class Vector4Interpolator : IInterpolator + { + public Vector4 Interpolate(Vector4 @from, Vector4 to, float progress) + => Vector4.Lerp(@from, to, progress); + + public static Vector4Interpolator Instance { get; } = new Vector4Interpolator(); + } + + class QuaternionInterpolator : IInterpolator + { + public Quaternion Interpolate(Quaternion @from, Quaternion to, float progress) + => Quaternion.Lerp(@from, to, progress); + + public static QuaternionInterpolator Instance { get; } = new QuaternionInterpolator(); + } + + class ColorInterpolator : IInterpolator + { + static byte Lerp(float a, float b, float p) => (byte) Math.Max(0, Math.Min(255, (p * (b - a) + a))); + + public static Avalonia.Media.Color + LerpRGB(Avalonia.Media.Color to, Avalonia.Media.Color from, float progress) => + new Avalonia.Media.Color(Lerp(to.A, @from.A, progress), + Lerp(to.R, @from.R, progress), + Lerp(to.G, @from.G, progress), + Lerp(to.B, @from.B, progress)); + + public Avalonia.Media.Color Interpolate(Avalonia.Media.Color @from, Avalonia.Media.Color to, float progress) + => LerpRGB(@from, to, progress); + + public static ColorInterpolator Instance { get; } = new ColorInterpolator(); + } + + class BooleanInterpolator : IInterpolator + { + public bool Interpolate(bool @from, bool to, float progress) => progress >= 1 ? to : @from; + + public static BooleanInterpolator Instance { get; } = new BooleanInterpolator(); + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrameAnimation.cs b/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrameAnimation.cs new file mode 100644 index 0000000000..49b3ab753a --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrameAnimation.cs @@ -0,0 +1,134 @@ +using System; +using Avalonia.Animation; +using Avalonia.Animation.Easings; + +namespace Avalonia.Rendering.Composition.Animations +{ + + /// + /// A time-based animation with one or more key frames. + /// These frames are markers, allowing developers to specify values at specific times for the animating property. + /// KeyFrame animations can be further customized by specifying how the animation interpolates between keyframes. + /// + public abstract class KeyFrameAnimation : CompositionAnimation + { + private TimeSpan _duration = TimeSpan.FromMilliseconds(1); + + internal KeyFrameAnimation(Compositor compositor) : base(compositor) + { + } + + /// + /// The delay behavior of the key frame animation. + /// + public AnimationDelayBehavior DelayBehavior { get; set; } + + /// + /// Delay before the animation starts after is called. + /// + public System.TimeSpan DelayTime { get; set; } + + /// + /// The direction the animation is playing. + /// The Direction property allows you to drive your animation from start to end or end to start or alternate + /// between start and end or end to start if animation has an greater than one. + /// This gives an easy way for customizing animation definitions. + /// + public PlaybackDirection Direction { get; set; } + + /// + /// The duration of the animation. + /// Minimum allowed value is 1ms and maximum allowed value is 24 days. + /// + public TimeSpan Duration + { + get => _duration; + set + { + if (_duration < TimeSpan.FromMilliseconds(1) || _duration > TimeSpan.FromDays(1)) + throw new ArgumentException("Minimum allowed value is 1ms and maximum allowed value is 24 days."); + _duration = value; + } + } + + /// + /// The iteration behavior for the key frame animation. + /// + public AnimationIterationBehavior IterationBehavior { get; set; } + + /// + /// The number of times to repeat the key frame animation. + /// + public int IterationCount { get; set; } = 1; + + /// + /// Specifies how to set the property value when animation is stopped + /// + public AnimationStopBehavior StopBehavior { get; set; } + + private protected abstract IKeyFrames KeyFrames { get; } + + /// + /// Inserts an expression keyframe. + /// + /// + /// The time the key frame should occur at, expressed as a percentage of the animation Duration. Allowed value is from 0.0 to 1.0. + /// + /// The expression used to calculate the value of the key frame. + /// The easing function to use when interpolating between frames. + public void InsertExpressionKeyFrame(float normalizedProgressKey, string value, + Easing? easingFunction = null) => + KeyFrames.InsertExpressionKeyFrame(normalizedProgressKey, value, easingFunction ?? Compositor.DefaultEasing); + } + + /// + /// Specifies the animation delay behavior. + /// + public enum AnimationDelayBehavior + { + /// + /// If a DelayTime is specified, it delays starting the animation according to delay time and after delay + /// has expired it applies animation to the object property. + /// + SetInitialValueAfterDelay, + /// + /// Applies the initial value of the animation (i.e. the value at Keyframe 0) to the object before the delay time + /// is elapsed (when there is a DelayTime specified), it then delays starting the animation according to the DelayTime. + /// + SetInitialValueBeforeDelay + } + + /// + /// Specifies if the animation should loop. + /// + public enum AnimationIterationBehavior + { + /// + /// The animation should loop the specified number of times. + /// + Count, + /// + /// The animation should loop forever. + /// + Forever + } + + /// + /// Specifies the behavior of an animation when it stops. + /// + public enum AnimationStopBehavior + { + /// + /// Leave the animation at its current value. + /// + LeaveCurrentValue, + /// + /// Reset the animation to its initial value. + /// + SetToInitialValue, + /// + /// Set the animation to its final value. + /// + SetToFinalValue + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrameAnimationInstance.cs b/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrameAnimationInstance.cs new file mode 100644 index 0000000000..0c0fcfaf2b --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrameAnimationInstance.cs @@ -0,0 +1,178 @@ +using System; +using System.Collections.Generic; +using Avalonia.Animation; +using Avalonia.Rendering.Composition.Expressions; +using Avalonia.Rendering.Composition.Server; + +namespace Avalonia.Rendering.Composition.Animations +{ + /// + /// Server-side counterpart of KeyFrameAnimation with values baked-in + /// + class KeyFrameAnimationInstance : AnimationInstanceBase, IAnimationInstance where T : struct + { + private readonly IInterpolator _interpolator; + private readonly ServerKeyFrame[] _keyFrames; + private readonly ExpressionVariant? _finalValue; + private readonly AnimationDelayBehavior _delayBehavior; + private readonly TimeSpan _delayTime; + private readonly PlaybackDirection _direction; + private readonly TimeSpan _duration; + private readonly AnimationIterationBehavior _iterationBehavior; + private readonly int _iterationCount; + private readonly AnimationStopBehavior _stopBehavior; + private TimeSpan _startedAt; + private T _startingValue; + private readonly TimeSpan _totalDuration; + private bool _finished; + + public KeyFrameAnimationInstance( + IInterpolator interpolator, ServerKeyFrame[] keyFrames, + PropertySetSnapshot snapshot, ExpressionVariant? finalValue, + ServerObject target, + AnimationDelayBehavior delayBehavior, TimeSpan delayTime, + PlaybackDirection direction, TimeSpan duration, + AnimationIterationBehavior iterationBehavior, + int iterationCount, AnimationStopBehavior stopBehavior) : base(target, snapshot) + { + _interpolator = interpolator; + _keyFrames = keyFrames; + _finalValue = finalValue; + _delayBehavior = delayBehavior; + _delayTime = delayTime; + _direction = direction; + _duration = duration; + _iterationBehavior = iterationBehavior; + _iterationCount = iterationCount; + _stopBehavior = stopBehavior; + if (_iterationBehavior == AnimationIterationBehavior.Count) + _totalDuration = delayTime.Add(TimeSpan.FromTicks(iterationCount * _duration.Ticks)); + if (_keyFrames.Length == 0) + throw new InvalidOperationException("Animation has no key frames"); + if(_duration.Ticks <= 0) + throw new InvalidOperationException("Invalid animation duration"); + } + + + protected override ExpressionVariant EvaluateCore(TimeSpan now, ExpressionVariant currentValue) + { + var starting = ExpressionVariant.Create(_startingValue); + var ctx = new ExpressionEvaluationContext + { + Parameters = Parameters, + Target = TargetObject, + CurrentValue = currentValue, + FinalValue = _finalValue ?? starting, + StartingValue = starting, + ForeignFunctionInterface = BuiltInExpressionFfi.Instance + }; + var elapsed = now - _startedAt; + var res = EvaluateImpl(elapsed, currentValue, ref ctx); + + if (_iterationBehavior == AnimationIterationBehavior.Count + && !_finished + && elapsed > _totalDuration) + { + // Active check? + TargetObject.Compositor.RemoveFromClock(this); + _finished = true; + } + return res; + } + + private ExpressionVariant EvaluateImpl(TimeSpan elapsed, ExpressionVariant currentValue, ref ExpressionEvaluationContext ctx) + { + if (elapsed < _delayTime) + { + if (_delayBehavior == AnimationDelayBehavior.SetInitialValueBeforeDelay) + return ExpressionVariant.Create(GetKeyFrame(ref ctx, _keyFrames[0])); + return currentValue; + } + + elapsed -= _delayTime; + var iterationNumber = elapsed.Ticks / _duration.Ticks; + if (_iterationBehavior == AnimationIterationBehavior.Count + && iterationNumber >= _iterationCount) + return ExpressionVariant.Create(GetKeyFrame(ref ctx, _keyFrames[_keyFrames.Length - 1])); + + + var evenIterationNumber = iterationNumber % 2 == 0; + elapsed = TimeSpan.FromTicks(elapsed.Ticks % _duration.Ticks); + + var reverse = + _direction == PlaybackDirection.Alternate + ? !evenIterationNumber + : _direction == PlaybackDirection.AlternateReverse + ? evenIterationNumber + : _direction == PlaybackDirection.Reverse; + + var iterationProgress = elapsed.TotalSeconds / _duration.TotalSeconds; + if (reverse) + iterationProgress = 1 - iterationProgress; + + var left = new ServerKeyFrame + { + Value = _startingValue + }; + var right = _keyFrames[_keyFrames.Length - 1]; + for (var c = 0; c < _keyFrames.Length; c++) + { + var kf = _keyFrames[c]; + if (kf.Key < iterationProgress) + { + // this is the last frame + if (c == _keyFrames.Length - 1) + return ExpressionVariant.Create(GetKeyFrame(ref ctx, kf)); + + left = kf; + right = _keyFrames[c + 1]; + break; + } + } + + var keyProgress = Math.Max(0, Math.Min(1, (iterationProgress - left.Key) / (right.Key - left.Key))); + + var easedKeyProgress = (float)right.EasingFunction.Ease(keyProgress); + if (float.IsNaN(easedKeyProgress) || float.IsInfinity(easedKeyProgress)) + return currentValue; + + return ExpressionVariant.Create(_interpolator.Interpolate( + GetKeyFrame(ref ctx, left), + GetKeyFrame(ref ctx, right), + easedKeyProgress + )); + } + + T GetKeyFrame(ref ExpressionEvaluationContext ctx, ServerKeyFrame f) + { + if (f.Expression != null) + return f.Expression.Evaluate(ref ctx).CastOrDefault(); + else + return f.Value; + } + + public override void Initialize(TimeSpan startedAt, ExpressionVariant startingValue, CompositionProperty property) + { + _startedAt = startedAt; + _startingValue = startingValue.CastOrDefault(); + var hs = new HashSet<(string, string)>(); + + // TODO: Update subscriptions based on the current keyframe rather than keeping subscriptions to all of them + foreach (var frame in _keyFrames) + frame.Expression?.CollectReferences(hs); + Initialize(property, hs); + } + + public override void Activate() + { + TargetObject.Compositor.AddToClock(this); + base.Activate(); + } + + public override void Deactivate() + { + TargetObject.Compositor.RemoveFromClock(this); + base.Deactivate(); + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrames.cs b/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrames.cs new file mode 100644 index 0000000000..369cc80b95 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Animations/KeyFrames.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using Avalonia.Animation.Easings; +using Avalonia.Rendering.Composition.Expressions; + +namespace Avalonia.Rendering.Composition.Animations +{ + + /// + /// Collection of composition animation key frames + /// + /// + class KeyFrames : List>, IKeyFrames + { + void Validate(float key) + { + if (key < 0 || key > 1) + throw new ArgumentException("Key frame key"); + if (Count > 0 && this[Count - 1].NormalizedProgressKey > key) + throw new ArgumentException("Key frame key " + key + " is less than the previous one"); + } + + public void InsertExpressionKeyFrame(float normalizedProgressKey, string value, IEasing easingFunction) + { + Validate(normalizedProgressKey); + Add(new KeyFrame + { + NormalizedProgressKey = normalizedProgressKey, + Expression = Expression.Parse(value), + EasingFunction = easingFunction + }); + } + + public void Insert(float normalizedProgressKey, T value, IEasing easingFunction) + { + Validate(normalizedProgressKey); + Add(new KeyFrame + { + NormalizedProgressKey = normalizedProgressKey, + Value = value, + EasingFunction = easingFunction + }); + } + + public ServerKeyFrame[] Snapshot() + { + var frames = new ServerKeyFrame[Count]; + for (var c = 0; c < Count; c++) + { + var f = this[c]; + frames[c] = new ServerKeyFrame + { + Expression = f.Expression, + Value = f.Value, + EasingFunction = f.EasingFunction, + Key = f.NormalizedProgressKey + }; + } + return frames; + } + } + + /// + /// Composition animation key frame + /// + struct KeyFrame + { + public float NormalizedProgressKey; + public T Value; + public Expression Expression; + public IEasing EasingFunction; + } + + /// + /// Server-side composition animation key frame + /// + struct ServerKeyFrame + { + public T Value; + public Expression? Expression; + public IEasing EasingFunction; + public float Key; + } + + interface IKeyFrames + { + public void InsertExpressionKeyFrame(float normalizedProgressKey, string value, IEasing easingFunction); + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Animations/PropertySetSnapshot.cs b/src/Avalonia.Base/Rendering/Composition/Animations/PropertySetSnapshot.cs new file mode 100644 index 0000000000..fc6cfc9f3d --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Animations/PropertySetSnapshot.cs @@ -0,0 +1,49 @@ +using System.Collections.Generic; +using Avalonia.Rendering.Composition.Expressions; + +namespace Avalonia.Rendering.Composition.Animations +{ + /// + /// A snapshot of properties used by an animation + /// + internal class PropertySetSnapshot : IExpressionParameterCollection, IExpressionObject + { + private readonly Dictionary _dic; + + public struct Value + { + public ExpressionVariant Variant; + public IExpressionObject Object; + + public Value(IExpressionObject o) + { + Object = o; + Variant = default; + } + + public static implicit operator Value(ExpressionVariant v) => new Value + { + Variant = v + }; + } + + public PropertySetSnapshot(Dictionary dic) + { + _dic = dic; + } + + public ExpressionVariant GetParameter(string name) + { + _dic.TryGetValue(name, out var v); + return v.Variant; + } + + public IExpressionObject GetObjectParameter(string name) + { + _dic.TryGetValue(name, out var v); + return v.Object; + } + + public ExpressionVariant GetProperty(string name) => GetParameter(name); + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/CompositingRenderer.cs b/src/Avalonia.Base/Rendering/Composition/CompositingRenderer.cs new file mode 100644 index 0000000000..a571a0518b --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/CompositingRenderer.cs @@ -0,0 +1,278 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Runtime.InteropServices; +using Avalonia.Collections; +using Avalonia.Collections.Pooled; +using Avalonia.Media; +using Avalonia.Rendering.Composition.Drawing; +using Avalonia.Rendering.Composition.Server; +using Avalonia.Threading; +using Avalonia.VisualTree; + +namespace Avalonia.Rendering.Composition; + +/// +/// A renderer that utilizes to render the visual tree +/// +public class CompositingRenderer : IRendererWithCompositor +{ + private readonly IRenderRoot _root; + private readonly Compositor _compositor; + CompositionDrawingContext _recorder = new(); + DrawingContext _recordingContext; + private HashSet _dirty = new(); + private HashSet _recalculateChildren = new(); + private bool _queuedUpdate; + private Action _update; + private Action _invalidateScene; + + internal CompositionTarget CompositionTarget; + + /// + /// Asks the renderer to only draw frames on the render thread. Makes Paint to wait until frame is rendered. + /// + public bool RenderOnlyOnRenderThread { get; set; } = true; + + public CompositingRenderer(IRenderRoot root, + Compositor compositor) + { + _root = root; + _compositor = compositor; + _recordingContext = new DrawingContext(_recorder); + CompositionTarget = compositor.CreateCompositionTarget(root.CreateRenderTarget); + CompositionTarget.Root = ((Visual)root!.VisualRoot!).AttachToCompositor(compositor); + _update = Update; + _invalidateScene = InvalidateScene; + } + + /// + public bool DrawFps + { + get => CompositionTarget.DrawFps; + set => CompositionTarget.DrawFps = value; + } + + /// + public bool DrawDirtyRects + { + get => CompositionTarget.DrawDirtyRects; + set => CompositionTarget.DrawDirtyRects = value; + } + + /// + public event EventHandler? SceneInvalidated; + + void QueueUpdate() + { + if(_queuedUpdate) + return; + _queuedUpdate = true; + Dispatcher.UIThread.Post(_update, DispatcherPriority.Composition); + } + + /// + public void AddDirty(IVisual visual) + { + _dirty.Add((Visual)visual); + QueueUpdate(); + } + + /// + public IEnumerable HitTest(Point p, IVisual root, Func? filter) + { + var res = CompositionTarget.TryHitTest(p, filter); + if(res == null) + yield break; + foreach(var v in res) + { + if (v is CompositionDrawListVisual dv) + { + if (filter == null || filter(dv.Visual)) + yield return dv.Visual; + } + } + } + + /// + public IVisual? HitTestFirst(Point p, IVisual root, Func? filter) + { + // TODO: Optimize + return HitTest(p, root, filter).FirstOrDefault(); + } + + /// + public void RecalculateChildren(IVisual visual) + { + _recalculateChildren.Add((Visual)visual); + QueueUpdate(); + } + + private void SyncChildren(Visual v) + { + //TODO: Optimize by moving that logic to Visual itself + if(v.CompositionVisual == null) + return; + var compositionChildren = v.CompositionVisual.Children; + var visualChildren = (AvaloniaList)v.GetVisualChildren(); + + PooledList<(IVisual visual, int index)>? sortedChildren = null; + if (v.HasNonUniformZIndexChildren && visualChildren.Count > 1) + { + sortedChildren = new (visualChildren.Count); + for (var c = 0; c < visualChildren.Count; c++) + sortedChildren.Add((visualChildren[c], c)); + + // Regular Array.Sort is unstable, we need to provide indices as well to avoid reshuffling elements. + sortedChildren.Sort(static (lhs, rhs) => + { + var result = lhs.visual.ZIndex.CompareTo(rhs.visual.ZIndex); + return result == 0 ? lhs.index.CompareTo(rhs.index) : result; + }); + } + + if (compositionChildren.Count == visualChildren.Count) + { + bool mismatch = false; + if (v.HasNonUniformZIndexChildren) + { + + + } + + if (sortedChildren != null) + for (var c = 0; c < visualChildren.Count; c++) + { + if (!ReferenceEquals(compositionChildren[c], ((Visual)sortedChildren[c].visual).CompositionVisual)) + { + mismatch = true; + break; + } + } + else + for (var c = 0; c < visualChildren.Count; c++) + if (!ReferenceEquals(compositionChildren[c], ((Visual)visualChildren[c]).CompositionVisual)) + { + mismatch = true; + break; + } + + + if (!mismatch) + { + sortedChildren?.Dispose(); + return; + } + } + + compositionChildren.Clear(); + if (sortedChildren != null) + { + foreach (var ch in sortedChildren) + { + var compositionChild = ((Visual)ch.visual).CompositionVisual; + if (compositionChild != null) + compositionChildren.Add(compositionChild); + } + sortedChildren.Dispose(); + } + else + foreach (var ch in v.GetVisualChildren()) + { + var compositionChild = ((Visual)ch).CompositionVisual; + if (compositionChild != null) + compositionChildren.Add(compositionChild); + } + } + + private void InvalidateScene() => + SceneInvalidated?.Invoke(this, new SceneInvalidatedEventArgs(_root, new Rect(_root.ClientSize))); + + private void Update() + { + _queuedUpdate = false; + foreach (var visual in _dirty) + { + var comp = visual.CompositionVisual; + if(comp == null) + continue; + + // TODO: Optimize all of that by moving to the Visual itself, so we won't have to recalculate every time + comp.Offset = new Vector3((float)visual.Bounds.Left, (float)visual.Bounds.Top, 0); + comp.Size = new Vector2((float)visual.Bounds.Width, (float)visual.Bounds.Height); + comp.Visible = visual.IsVisible; + comp.Opacity = (float)visual.Opacity; + comp.ClipToBounds = visual.ClipToBounds; + comp.Clip = visual.Clip?.PlatformImpl; + comp.OpacityMask = visual.OpacityMask; + + var renderTransform = Matrix.Identity; + + if (visual.HasMirrorTransform) + renderTransform = new Matrix(-1.0, 0.0, 0.0, 1.0, visual.Bounds.Width, 0); + + if (visual.RenderTransform != null) + { + var origin = visual.RenderTransformOrigin.ToPixels(new Size(visual.Bounds.Width, visual.Bounds.Height)); + var offset = Matrix.CreateTranslation(origin); + renderTransform *= (-offset) * visual.RenderTransform.Value * (offset); + } + + + + comp.TransformMatrix = MatrixUtils.ToMatrix4x4(renderTransform); + + _recorder.BeginUpdate(comp.DrawList); + visual.Render(_recordingContext); + comp.DrawList = _recorder.EndUpdate(); + + SyncChildren(visual); + } + foreach(var v in _recalculateChildren) + if (!_dirty.Contains(v)) + SyncChildren(v); + _dirty.Clear(); + _recalculateChildren.Clear(); + CompositionTarget.Size = _root.ClientSize; + CompositionTarget.Scaling = _root.RenderScaling; + Compositor.InvokeOnNextCommit(_invalidateScene); + } + + public void Resized(Size size) + { + } + + public void Paint(Rect rect) + { + Update(); + CompositionTarget.RequestRedraw(); + if(RenderOnlyOnRenderThread && Compositor.Loop.RunsInBackground) + Compositor.RequestCommitAsync().Wait(); + else + CompositionTarget.ImmediateUIThreadRender(); + } + + public void Start() => CompositionTarget.IsEnabled = true; + + public void Stop() + { + CompositionTarget.IsEnabled = false; + } + + public void Dispose() + { + Stop(); + CompositionTarget.Dispose(); + + // Wait for the composition batch to be applied and rendered to guarantee that + // render target is not used anymore and can be safely disposed + if (Compositor.Loop.RunsInBackground) + _compositor.RequestCommitAsync().Wait(); + } + + /// + /// The associated object + /// + public Compositor Compositor => _compositor; +} diff --git a/src/Avalonia.Base/Rendering/Composition/CompositionDrawListVisual.cs b/src/Avalonia.Base/Rendering/Composition/CompositionDrawListVisual.cs new file mode 100644 index 0000000000..49aea1c3dc --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/CompositionDrawListVisual.cs @@ -0,0 +1,75 @@ +using System; +using System.Numerics; +using Avalonia.Rendering.Composition.Drawing; +using Avalonia.Rendering.Composition.Server; +using Avalonia.Rendering.Composition.Transport; +using Avalonia.VisualTree; + +namespace Avalonia.Rendering.Composition; + + +/// +/// A composition visual that holds a list of drawing commands issued by +/// +internal class CompositionDrawListVisual : CompositionContainerVisual +{ + /// + /// The associated + /// + public Visual Visual { get; } + + private bool _drawListChanged; + private CompositionDrawList? _drawList; + + /// + /// The list of drawing commands + /// + public CompositionDrawList? DrawList + { + get => _drawList; + set + { + _drawList?.Dispose(); + _drawList = value; + _drawListChanged = true; + RegisterForSerialization(); + } + } + + private protected override void SerializeChangesCore(BatchStreamWriter writer) + { + writer.Write((byte)(_drawListChanged ? 1 : 0)); + if (_drawListChanged) + { + writer.WriteObject(DrawList?.Clone()); + _drawListChanged = false; + } + base.SerializeChangesCore(writer); + } + + internal CompositionDrawListVisual(Compositor compositor, ServerCompositionDrawListVisual server, Visual visual) : base(compositor, server) + { + Visual = visual; + } + + internal override bool HitTest(Point pt, Func? filter) + { + var custom = Visual as ICustomHitTest; + if (DrawList == null && custom == null) + return false; + if (filter != null && !filter(Visual)) + return false; + if (custom != null) + { + // Simulate the old behavior + // TODO: Change behavior once legacy renderers are removed + pt += new Point(Offset.X, Offset.Y); + return custom.HitTest(pt); + } + + foreach (var op in DrawList!) + if (op.Item.HitTest(pt)) + return true; + return false; + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/CompositionObject.cs b/src/Avalonia.Base/Rendering/Composition/CompositionObject.cs new file mode 100644 index 0000000000..f529ee9cff --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/CompositionObject.cs @@ -0,0 +1,141 @@ +using System; +using Avalonia.Rendering.Composition.Animations; +using Avalonia.Rendering.Composition.Expressions; +using Avalonia.Rendering.Composition.Server; +using Avalonia.Rendering.Composition.Transport; +using Avalonia.Utilities; + +namespace Avalonia.Rendering.Composition +{ + /// + /// Base class of the composition API representing a node in the visual tree structure. + /// Composition objects are the visual tree structure on which all other features of the composition API use and build on. + /// The API allows developers to define and create one or many objects each representing a single node in a Visual tree. + /// + public abstract class CompositionObject : IDisposable + { + /// + /// The collection of implicit animations attached to this object. + /// + public ImplicitAnimationCollection? ImplicitAnimations { get; set; } + + private protected InlineDictionary PendingAnimations; + internal CompositionObject(Compositor compositor, ServerObject server) + { + Compositor = compositor; + Server = server; + } + + /// + /// The associated Compositor + /// + public Compositor Compositor { get; } + internal ServerObject Server { get; } + public bool IsDisposed { get; private set; } + private bool _registeredForSerialization; + + private static void ThrowInvalidOperation() => + throw new InvalidOperationException("There is no server-side counterpart for this object"); + + public void Dispose() + { + RegisterForSerialization(); + IsDisposed = true; + } + + /// + /// Connects an animation with the specified property of the object and starts the animation. + /// + public void StartAnimation(string propertyName, CompositionAnimation animation) + => StartAnimation(propertyName, animation, null); + + internal virtual void StartAnimation(string propertyName, CompositionAnimation animation, ExpressionVariant? finalValue) + { + throw new ArgumentException("Unknown property " + propertyName); + } + + /// + /// Starts an animation group. + /// The StartAnimationGroup method on CompositionObject lets you start CompositionAnimationGroup. + /// All the animations in the group will be started at the same time on the object. + /// + public void StartAnimationGroup(ICompositionAnimationBase grp) + { + if (grp is CompositionAnimation animation) + { + if(animation.Target == null) + throw new ArgumentException("Animation Target can't be null"); + StartAnimation(animation.Target, animation); + } + else if (grp is CompositionAnimationGroup group) + { + foreach (var a in group.Animations) + { + if (a.Target == null) + throw new ArgumentException("Animation Target can't be null"); + StartAnimation(a.Target, a); + } + } + } + + bool StartAnimationGroupPart(CompositionAnimation animation, string target, ExpressionVariant finalValue) + { + if(animation.Target == null) + throw new ArgumentException("Animation Target can't be null"); + if (animation.Target == target) + { + StartAnimation(animation.Target, animation, finalValue); + return true; + } + else + { + StartAnimation(animation.Target, animation); + return false; + } + } + + internal bool StartAnimationGroup(ICompositionAnimationBase grp, string target, ExpressionVariant finalValue) + { + if (grp is CompositionAnimation animation) + return StartAnimationGroupPart(animation, target, finalValue); + if (grp is CompositionAnimationGroup group) + { + var matched = false; + foreach (var a in group.Animations) + { + if (a.Target == null) + throw new ArgumentException("Animation Target can't be null"); + if (StartAnimationGroupPart(a, target, finalValue)) + matched = true; + } + + return matched; + } + + throw new ArgumentException(); + } + + protected void RegisterForSerialization() + { + if (Server == null) + throw new InvalidOperationException("The object doesn't have an associated server counterpart"); + + if(_registeredForSerialization) + return; + _registeredForSerialization = true; + Compositor.RegisterForSerialization(this); + } + + internal void SerializeChanges(BatchStreamWriter writer) + { + _registeredForSerialization = false; + SerializeChangesCore(writer); + } + + private protected virtual void SerializeChangesCore(BatchStreamWriter writer) + { + if (Server is IDisposable) + writer.Write((byte)(IsDisposed ? 1 : 0)); + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/CompositionPropertySet.cs b/src/Avalonia.Base/Rendering/Composition/CompositionPropertySet.cs new file mode 100644 index 0000000000..ee4552d154 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/CompositionPropertySet.cs @@ -0,0 +1,147 @@ +using System; +using System.Collections.Generic; +using System.Numerics; +using Avalonia.Rendering.Composition.Animations; +using Avalonia.Rendering.Composition.Expressions; +using Avalonia.Rendering.Composition.Transport; + +namespace Avalonia.Rendering.Composition +{ + /// + /// s are s that allow storage of key values pairs + /// that can be shared across the application and are not tied to the lifetime of another composition object. + /// s are most commonly used with animations, where they maintain key-value pairs + /// that are referenced to drive portions of composition animations. s + /// provide the ability to insert key-value pairs or retrieve a value for a given key. + /// does not support a delete function – ensure you use + /// to store values that will be shared across the application. + /// + public class CompositionPropertySet : CompositionObject + { + private readonly Dictionary _variants = new Dictionary(); + private readonly Dictionary _objects = new Dictionary(); + + internal CompositionPropertySet(Compositor compositor) : base(compositor, null!) + { + } + + internal void Set(string key, ExpressionVariant value) + { + _objects.Remove(key); + _variants[key] = value; + } + + /* + For INTERNAL USE by CompositionAnimation ONLY, we DON'T support expression + paths like SomeParam.SomePropertyObject.SomeValue + */ + internal void Set(string key, CompositionObject obj) + { + _objects[key] = obj ?? throw new ArgumentNullException(nameof(obj)); + _variants.Remove(key); + } + + public void InsertColor(string propertyName, Avalonia.Media.Color value) => Set(propertyName, value); + + public void InsertMatrix3x2(string propertyName, Matrix3x2 value) => Set(propertyName, value); + + public void InsertMatrix4x4(string propertyName, Matrix4x4 value) => Set(propertyName, value); + + public void InsertQuaternion(string propertyName, Quaternion value) => Set(propertyName, value); + + public void InsertScalar(string propertyName, float value) => Set(propertyName, value); + public void InsertVector2(string propertyName, Vector2 value) => Set(propertyName, value); + + public void InsertVector3(string propertyName, Vector3 value) => Set(propertyName, value); + + public void InsertVector4(string propertyName, Vector4 value) => Set(propertyName, value); + + + CompositionGetValueStatus TryGetVariant(string key, out T value) where T : struct + { + value = default; + if (!_variants.TryGetValue(key, out var v)) + return _objects.ContainsKey(key) + ? CompositionGetValueStatus.TypeMismatch + : CompositionGetValueStatus.NotFound; + + return v.TryCast(out value) ? CompositionGetValueStatus.Succeeded : CompositionGetValueStatus.TypeMismatch; + } + + public CompositionGetValueStatus TryGetColor(string propertyName, out Avalonia.Media.Color value) + => TryGetVariant(propertyName, out value); + + public CompositionGetValueStatus TryGetMatrix3x2(string propertyName, out Matrix3x2 value) + => TryGetVariant(propertyName, out value); + + public CompositionGetValueStatus TryGetMatrix4x4(string propertyName, out Matrix4x4 value) + => TryGetVariant(propertyName, out value); + + public CompositionGetValueStatus TryGetQuaternion(string propertyName, out Quaternion value) + => TryGetVariant(propertyName, out value); + + + public CompositionGetValueStatus TryGetScalar(string propertyName, out float value) + => TryGetVariant(propertyName, out value); + + public CompositionGetValueStatus TryGetVector2(string propertyName, out Vector2 value) + => TryGetVariant(propertyName, out value); + + public CompositionGetValueStatus TryGetVector3(string propertyName, out Vector3 value) + => TryGetVariant(propertyName, out value); + + public CompositionGetValueStatus TryGetVector4(string propertyName, out Vector4 value) + => TryGetVariant(propertyName, out value); + + + public void InsertBoolean(string propertyName, bool value) => Set(propertyName, value); + + public CompositionGetValueStatus TryGetBoolean(string propertyName, out bool value) + => TryGetVariant(propertyName, out value); + + internal void ClearAll() + { + _objects.Clear(); + _variants.Clear(); + } + + internal void Clear(string key) + { + _objects.Remove(key); + _variants.Remove(key); + } + + internal PropertySetSnapshot Snapshot() => + SnapshotCore(1); + + private PropertySetSnapshot SnapshotCore(int allowedNestingLevel) + { + var dic = new Dictionary(_objects.Count + _variants.Count); + foreach (var o in _objects) + { + if (o.Value is CompositionPropertySet ps) + { + if (allowedNestingLevel <= 0) + throw new InvalidOperationException("PropertySet depth limit reached"); + dic[o.Key] = new PropertySetSnapshot.Value(ps.SnapshotCore(allowedNestingLevel - 1)); + } + else if (o.Value.Server == null) + throw new InvalidOperationException($"Object of type {o.Value.GetType()} is not allowed"); + else + dic[o.Key] = new PropertySetSnapshot.Value(o.Value.Server); + } + + foreach (var v in _variants) + dic[v.Key] = v.Value; + + return new PropertySetSnapshot(dic); + } + } + + public enum CompositionGetValueStatus + { + Succeeded, + TypeMismatch, + NotFound + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/CompositionTarget.cs b/src/Avalonia.Base/Rendering/Composition/CompositionTarget.cs new file mode 100644 index 0000000000..01b2d0d5d9 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/CompositionTarget.cs @@ -0,0 +1,130 @@ +using System; +using System.Collections.Generic; +using System.Numerics; +using Avalonia.Collections.Pooled; +using Avalonia.VisualTree; + +namespace Avalonia.Rendering.Composition +{ + /// + /// Represents the composition output (e. g. a window, embedded control, entire screen) + /// + public partial class CompositionTarget + { + partial void OnRootChanged() + { + if (Root != null) + Root.Root = this; + } + + partial void OnRootChanging() + { + if (Root != null) + Root.Root = null; + } + + /// + /// Attempts to perform a hit-tst + /// + /// + /// + /// + public PooledList? TryHitTest(Point point, Func? filter) + { + Server.Readback.NextRead(); + if (Root == null) + return null; + var res = new PooledList(); + HitTestCore(Root, point, res, filter); + return res; + } + + /// + /// Attempts to transform a point to a particular CompositionVisual coordinate space + /// + /// + public Point? TryTransformToVisual(CompositionVisual visual, Point point) + { + if (visual.Root != this) + return null; + var v = visual; + var m = Matrix.Identity; + while (v != null) + { + if (!TryGetInvertedTransform(v, out var cm)) + return null; + m = m * cm; + v = v.Parent; + } + + return point * m; + } + + bool TryGetInvertedTransform(CompositionVisual visual, out Matrix matrix) + { + var m = visual.TryGetServerGlobalTransform(); + if (m == null) + { + matrix = default; + return false; + } + + var m33 = MatrixUtils.ToMatrix(m.Value); + return m33.TryInvert(out matrix); + } + + bool TryTransformTo(CompositionVisual visual, Point globalPoint, out Point v) + { + v = default; + if (TryGetInvertedTransform(visual, out var m)) + { + v = globalPoint * m; + return true; + } + + return false; + } + + void HitTestCore(CompositionVisual visual, Point globalPoint, PooledList result, + Func? filter) + { + if (visual.Visible == false) + return; + if (!TryTransformTo(visual, globalPoint, out var point)) + return; + + if (visual.ClipToBounds + && (point.X < 0 || point.Y < 0 || point.X > visual.Size.X || point.Y > visual.Size.Y)) + return; + + if (visual.Clip?.FillContains(point) == false) + return; + + // Inspect children + if (visual is CompositionContainerVisual cv) + for (var c = cv.Children.Count - 1; c >= 0; c--) + { + var ch = cv.Children[c]; + HitTestCore(ch, globalPoint, result, filter); + } + + // Hit-test the current node + if (visual.HitTest(point, filter)) + result.Add(visual); + } + + /// + /// Registers the composition target for explicit redraw + /// + public void RequestRedraw() => RegisterForSerialization(); + + /// + /// Performs composition directly on the UI thread + /// + internal void ImmediateUIThreadRender() + { + Compositor.RequestCommitAsync(); + Compositor.Server.Render(); + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Compositor.cs b/src/Avalonia.Base/Rendering/Composition/Compositor.cs new file mode 100644 index 0000000000..1bdae44cb9 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Compositor.cs @@ -0,0 +1,141 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Numerics; +using System.Threading.Tasks; +using Avalonia.Animation.Easings; +using Avalonia.Media; +using Avalonia.Platform; +using Avalonia.Rendering.Composition.Animations; +using Avalonia.Rendering.Composition.Server; +using Avalonia.Rendering.Composition.Transport; +using Avalonia.Threading; + + +namespace Avalonia.Rendering.Composition +{ + /// + /// The Compositor class manages communication between UI-thread and render-thread parts of the composition engine. + /// It also serves as a factory to create UI-thread parts of various composition objects + /// + public partial class Compositor + { + internal IRenderLoop Loop { get; } + private ServerCompositor _server; + private bool _implicitBatchCommitQueued; + private Action _implicitBatchCommit; + private BatchStreamObjectPool _batchObjectPool = new(); + private BatchStreamMemoryPool _batchMemoryPool = new(); + private List _objectsForSerialization = new(); + internal ServerCompositor Server => _server; + internal IEasing DefaultEasing { get; } + private List? _invokeOnNextCommit; + private readonly Stack> _invokeListPool = new(); + + /// + /// Creates a new compositor on a specified render loop that would use a particular GPU + /// + /// + /// + public Compositor(IRenderLoop loop, IPlatformGpu? gpu) + { + Loop = loop; + _server = new ServerCompositor(loop, gpu, _batchObjectPool, _batchMemoryPool); + _implicitBatchCommit = ImplicitBatchCommit; + + DefaultEasing = new CubicBezierEasing(new Point(0.25f, 0.1f), new Point(0.25f, 1f)); + } + + /// + /// Creates a new CompositionTarget + /// + /// A factory method to create IRenderTarget to be called from the render thread + /// + public CompositionTarget CreateCompositionTarget(Func renderTargetFactory) + { + return new CompositionTarget(this, new ServerCompositionTarget(_server, renderTargetFactory)); + } + + /// + /// Requests pending changes in the composition objects to be serialized and sent to the render thread + /// + /// A task that completes when sent changes are applied and rendered on the render thread + public Task RequestCommitAsync() + { + Dispatcher.UIThread.VerifyAccess(); + var batch = new Batch(); + + using (var writer = new BatchStreamWriter(batch.Changes, _batchMemoryPool, _batchObjectPool)) + { + foreach (var obj in _objectsForSerialization) + { + writer.WriteObject(obj.Server); + obj.SerializeChanges(writer); +#if DEBUG_COMPOSITOR_SERIALIZATION + writer.Write(BatchStreamDebugMarkers.ObjectEndMagic); + writer.WriteObject(BatchStreamDebugMarkers.ObjectEndMarker); +#endif + } + _objectsForSerialization.Clear(); + } + + batch.CommitedAt = Server.Clock.Elapsed; + _server.EnqueueBatch(batch); + if (_invokeOnNextCommit != null) + ScheduleCommitCallbacks(batch.Completed); + + return batch.Completed; + } + + async void ScheduleCommitCallbacks(Task task) + { + var list = _invokeOnNextCommit; + _invokeOnNextCommit = null; + await task; + foreach (var i in list!) + i(); + list.Clear(); + _invokeListPool.Push(list); + } + + public CompositionContainerVisual CreateContainerVisual() => new(this, new ServerCompositionContainerVisual(_server)); + + public ExpressionAnimation CreateExpressionAnimation() => new ExpressionAnimation(this); + + public ExpressionAnimation CreateExpressionAnimation(string expression) => new ExpressionAnimation(this) + { + Expression = expression + }; + + public ImplicitAnimationCollection CreateImplicitAnimationCollection() => new ImplicitAnimationCollection(this); + + public CompositionAnimationGroup CreateAnimationGroup() => new CompositionAnimationGroup(this); + + private void QueueImplicitBatchCommit() + { + if(_implicitBatchCommitQueued) + return; + _implicitBatchCommitQueued = true; + Dispatcher.UIThread.Post(_implicitBatchCommit, DispatcherPriority.CompositionBatch); + } + + private void ImplicitBatchCommit() + { + _implicitBatchCommitQueued = false; + RequestCommitAsync(); + } + + internal void RegisterForSerialization(CompositionObject compositionObject) + { + Dispatcher.UIThread.VerifyAccess(); + _objectsForSerialization.Add(compositionObject); + QueueImplicitBatchCommit(); + } + + internal void InvokeOnNextCommit(Action action) + { + _invokeOnNextCommit ??= _invokeListPool.Count > 0 ? _invokeListPool.Pop() : new(); + _invokeOnNextCommit.Add(action); + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/ContainerVisual.cs b/src/Avalonia.Base/Rendering/Composition/ContainerVisual.cs new file mode 100644 index 0000000000..caf074dd6b --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/ContainerVisual.cs @@ -0,0 +1,24 @@ +using Avalonia.Rendering.Composition.Server; + +namespace Avalonia.Rendering.Composition +{ + /// + /// A node in the visual tree that can have children. + /// + public partial class CompositionContainerVisual : CompositionVisual + { + public CompositionVisualCollection Children { get; private set; } = null!; + + partial void InitializeDefaultsExtra() + { + Children = new CompositionVisualCollection(this, Server.Children); + } + + private protected override void OnRootChangedCore() + { + foreach (var ch in Children) + ch.Root = Root; + base.OnRootChangedCore(); + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Drawing/CompositionDrawList.cs b/src/Avalonia.Base/Rendering/Composition/Drawing/CompositionDrawList.cs new file mode 100644 index 0000000000..432a0832f2 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Drawing/CompositionDrawList.cs @@ -0,0 +1,102 @@ +using System; +using Avalonia.Collections.Pooled; +using Avalonia.Rendering.Composition.Server; +using Avalonia.Rendering.SceneGraph; +using Avalonia.Utilities; + +namespace Avalonia.Rendering.Composition.Drawing; + +/// +/// A list of serialized drawing commands +/// +internal class CompositionDrawList : PooledList> +{ + public Size? Size { get; set; } + + public CompositionDrawList() + { + + } + + public CompositionDrawList(int capacity) : base(capacity) + { + + } + + public override void Dispose() + { + foreach(var item in this) + item.Dispose(); + base.Dispose(); + } + + public CompositionDrawList Clone() + { + var clone = new CompositionDrawList(Count) { Size = Size }; + foreach (var r in this) + clone.Add(r.Clone()); + return clone; + } + + public void Render(CompositorDrawingContextProxy canvas) + { + foreach (var cmd in this) + { + canvas.VisualBrushDrawList = (cmd.Item as BrushDrawOperation)?.Aux as CompositionDrawList; + cmd.Item.Render(canvas); + } + + canvas.VisualBrushDrawList = null; + } +} + +/// +/// An helper class for building +/// +internal class CompositionDrawListBuilder +{ + private CompositionDrawList? _operations; + private bool _owns; + + public void Reset(CompositionDrawList? previousOperations) + { + _operations = previousOperations; + _owns = false; + } + + public int Count => _operations?.Count ?? 0; + public CompositionDrawList? DrawOperations => _operations; + + void MakeWritable(int atIndex) + { + if(_owns) + return; + _owns = true; + var newOps = new CompositionDrawList(_operations?.Count ?? Math.Max(1, atIndex)); + if (_operations != null) + { + for (var c = 0; c < atIndex; c++) + newOps.Add(_operations[c].Clone()); + } + + _operations = newOps; + } + + public void ReplaceDrawOperation(int index, IDrawOperation node) + { + MakeWritable(index); + DrawOperations!.Add(RefCountable.Create(node)); + } + + public void AddDrawOperation(IDrawOperation node) + { + MakeWritable(Count); + DrawOperations!.Add(RefCountable.Create(node)); + } + + public void TrimTo(int count) + { + if (count < Count) + _operations!.RemoveRange(count, _operations.Count - count); + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Drawing/CompositionDrawingContext.cs b/src/Avalonia.Base/Rendering/Composition/Drawing/CompositionDrawingContext.cs new file mode 100644 index 0000000000..d7c1ef125d --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Drawing/CompositionDrawingContext.cs @@ -0,0 +1,391 @@ +using System; +using System.Collections.Generic; +using System.Numerics; +using Avalonia.Media; +using Avalonia.Media.Imaging; +using Avalonia.Platform; +using Avalonia.Rendering.Composition.Drawing; +using Avalonia.Rendering.SceneGraph; +using Avalonia.Utilities; +using Avalonia.VisualTree; +namespace Avalonia.Rendering.Composition; + +/// +/// An IDrawingContextImpl implementation that builds +/// +internal class CompositionDrawingContext : IDrawingContextImpl, IDrawingContextWithAcrylicLikeSupport +{ + private CompositionDrawListBuilder _builder = new(); + private int _drawOperationIndex; + + /// + public Matrix Transform { get; set; } = Matrix.Identity; + + /// + public void Clear(Color color) + { + // Cannot clear a deferred scene. + } + + /// + public void Dispose() + { + // Nothing to do here since we allocate no unmanaged resources. + } + + public void BeginUpdate(CompositionDrawList? list) + { + _builder.Reset(list); + _drawOperationIndex = 0; + } + + public CompositionDrawList EndUpdate() + { + _builder.TrimTo(_drawOperationIndex); + return _builder.DrawOperations!; + } + + /// + public void DrawGeometry(IBrush? brush, IPen? pen, IGeometryImpl geometry) + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(Transform, brush, pen, geometry)) + { + Add(new GeometryNode(Transform, brush, pen, geometry, CreateChildScene(brush))); + } + else + { + ++_drawOperationIndex; + } + } + + /// + public void DrawBitmap(IRef source, double opacity, Rect sourceRect, Rect destRect, + BitmapInterpolationMode bitmapInterpolationMode) + { + var next = NextDrawAs(); + + if (next == null || + !next.Item.Equals(Transform, source, opacity, sourceRect, destRect, bitmapInterpolationMode)) + { + Add(new ImageNode(Transform, source, opacity, sourceRect, destRect, bitmapInterpolationMode)); + } + else + { + ++_drawOperationIndex; + } + } + + /// + public void DrawBitmap(IRef source, IBrush opacityMask, Rect opacityMaskRect, Rect sourceRect) + { + // This method is currently only used to composite layers so shouldn't be called here. + throw new NotSupportedException(); + } + + /// + public void DrawLine(IPen pen, Point p1, Point p2) + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(Transform, pen, p1, p2)) + { + Add(new LineNode(Transform, pen, p1, p2, CreateChildScene(pen.Brush))); + } + else + { + ++_drawOperationIndex; + } + } + + /// + public void DrawRectangle(IBrush? brush, IPen? pen, RoundedRect rect, + BoxShadows boxShadows = default) + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(Transform, brush, pen, rect, boxShadows)) + { + Add(new RectangleNode(Transform, brush, pen, rect, boxShadows, CreateChildScene(brush))); + } + else + { + ++_drawOperationIndex; + } + } + + /// + public void DrawRectangle(IExperimentalAcrylicMaterial material, RoundedRect rect) + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(Transform, material, rect)) + { + Add(new ExperimentalAcrylicNode(Transform, material, rect)); + } + else + { + ++_drawOperationIndex; + } + } + + public void DrawEllipse(IBrush? brush, IPen? pen, Rect rect) + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(Transform, brush, pen, rect)) + { + Add(new EllipseNode(Transform, brush, pen, rect, CreateChildScene(brush))); + } + else + { + ++_drawOperationIndex; + } + } + + public void Custom(ICustomDrawOperation custom) + { + var next = NextDrawAs(); + if (next == null || !next.Item.Equals(Transform, custom)) + Add(new CustomDrawOperation(custom, Transform)); + else + ++_drawOperationIndex; + } + + /// + public void DrawGlyphRun(IBrush foreground, GlyphRun glyphRun) + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(Transform, foreground, glyphRun)) + { + Add(new GlyphRunNode(Transform, foreground, glyphRun, CreateChildScene(foreground))); + } + + else + { + ++_drawOperationIndex; + } + } + + public IDrawingContextLayerImpl CreateLayer(Size size) + { + throw new NotSupportedException("Creating layers on a deferred drawing context not supported"); + } + + /// + public void PopClip() + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(null)) + { + Add(new ClipNode()); + } + else + { + ++_drawOperationIndex; + } + } + + /// + public void PopGeometryClip() + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(null)) + { + Add(new GeometryClipNode()); + } + else + { + ++_drawOperationIndex; + } + } + + /// + public void PopBitmapBlendMode() + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(null)) + { + Add(new BitmapBlendModeNode()); + } + else + { + ++_drawOperationIndex; + } + } + + /// + public void PopOpacity() + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(null)) + { + Add(new OpacityNode()); + } + else + { + ++_drawOperationIndex; + } + } + + /// + public void PopOpacityMask() + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(null, null)) + { + Add(new OpacityMaskNode()); + } + else + { + ++_drawOperationIndex; + } + } + + /// + public void PushClip(Rect clip) + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(Transform, clip)) + { + Add(new ClipNode(Transform, clip)); + } + else + { + ++_drawOperationIndex; + } + } + + /// + public void PushClip(RoundedRect clip) + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(Transform, clip)) + { + Add(new ClipNode(Transform, clip)); + } + else + { + ++_drawOperationIndex; + } + } + + /// + public void PushGeometryClip(IGeometryImpl? clip) + { + if (clip is null) + return; + + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(Transform, clip)) + { + Add(new GeometryClipNode(Transform, clip)); + } + else + { + ++_drawOperationIndex; + } + } + + /// + public void PushOpacity(double opacity) + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(opacity)) + { + Add(new OpacityNode(opacity)); + } + else + { + ++_drawOperationIndex; + } + } + + /// + public void PushOpacityMask(IBrush mask, Rect bounds) + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(mask, bounds)) + { + Add(new OpacityMaskNode(mask, bounds, CreateChildScene(mask))); + } + else + { + ++_drawOperationIndex; + } + } + + /// + public void PushBitmapBlendMode(BitmapBlendingMode blendingMode) + { + var next = NextDrawAs(); + + if (next == null || !next.Item.Equals(blendingMode)) + { + Add(new BitmapBlendModeNode(blendingMode)); + } + else + { + ++_drawOperationIndex; + } + } + + private void Add(T node) where T : class, IDrawOperation + { + if (_drawOperationIndex < _builder.Count) + { + _builder.ReplaceDrawOperation(_drawOperationIndex, node); + } + else + { + _builder.AddDrawOperation(node); + } + + ++_drawOperationIndex; + } + + private IRef? NextDrawAs() where T : class, IDrawOperation + { + return _drawOperationIndex < _builder.Count + ? _builder.DrawOperations![_drawOperationIndex] as IRef + : null; + } + + private IDisposable? CreateChildScene(IBrush? brush) + { + if (brush is VisualBrush visualBrush) + { + var visual = visualBrush.Visual; + + if (visual != null) + { + // TODO: This is a temporary solution to make visual brush to work like it does with DeferredRenderer + // We should directly reference the corresponding CompositionVisual (which should + // be attached to the same composition target) like UWP does. + // Render-able visuals shouldn't be dangling unattached + (visual as IVisualBrushInitialize)?.EnsureInitialized(); + + var recorder = new CompositionDrawingContext(); + recorder.BeginUpdate(null); + ImmediateRenderer.Render(visual, new DrawingContext(recorder)); + var drawList = recorder.EndUpdate(); + drawList.Size = visual.Bounds.Size; + + return drawList; + } + } + return null; + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/ElementCompositionPreview.cs b/src/Avalonia.Base/Rendering/Composition/ElementCompositionPreview.cs new file mode 100644 index 0000000000..1397a20fb6 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/ElementCompositionPreview.cs @@ -0,0 +1,14 @@ +namespace Avalonia.Rendering.Composition; + +/// +/// Enables access to composition visual objects that back XAML elements in the XAML composition tree. +/// +public static class ElementComposition +{ + /// + /// Gets CompositionVisual that backs a Visual + /// + /// + /// + public static CompositionVisual? GetElementVisual(Visual visual) => visual.CompositionVisual; +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Enums.cs b/src/Avalonia.Base/Rendering/Composition/Enums.cs new file mode 100644 index 0000000000..e349845cbf --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Enums.cs @@ -0,0 +1,120 @@ +using System; + +namespace Avalonia.Rendering.Composition +{ + public enum CompositionBlendMode + { + /// No regions are enabled. [Porter Duff Compositing Operators] (https://drafts.fxtf.org/compositing-1/examples/PD_clr.svg) + Clear, + + /// Only the source will be present. [Porter Duff Compositing Operators] (https://drafts.fxtf.org/compositing-1/examples/PD_src.svg) + Src, + + /// Only the destination will be present. [Porter Duff Compositing Operators] (https://drafts.fxtf.org/compositing-1/examples/PD_dst.svg) + Dst, + + /// Source is placed over the destination. [Porter Duff Compositing Operators] (https://drafts.fxtf.org/compositing-1/examples/PD_src-over.svg) + SrcOver, + + /// Destination is placed over the source. [Porter Duff Compositing Operators] (https://drafts.fxtf.org/compositing-1/examples/PD_dst-over.svg) + DstOver, + + /// The source that overlaps the destination, replaces the destination. [Porter Duff Compositing Operators] (https://drafts.fxtf.org/compositing-1/examples/PD_src-in.svg) + SrcIn, + + /// Destination which overlaps the source, replaces the source. [Porter Duff Compositing Operators] (https://drafts.fxtf.org/compositing-1/examples/PD_dst-in.svg) + DstIn, + + /// Source is placed, where it falls outside of the destination. [Porter Duff Compositing Operators] (https://drafts.fxtf.org/compositing-1/examples/PD_src-out.svg) + SrcOut, + + /// Destination is placed, where it falls outside of the source. [Porter Duff Compositing Operators] (https://drafts.fxtf.org/compositing-1/examples/PD_dst-out.svg) + DstOut, + + /// Source which overlaps the destination, replaces the destination. [Porter Duff Compositing Operators] (https://drafts.fxtf.org/compositing-1/examples/PD_src-atop.svg) + SrcATop, + + /// Destination which overlaps the source replaces the source. [Porter Duff Compositing Operators] (https://drafts.fxtf.org/compositing-1/examples/PD_dst-atop.svg) + DstATop, + + /// The non-overlapping regions of source and destination are combined. [Porter Duff Compositing Operators] (https://drafts.fxtf.org/compositing-1/examples/PD_xor.svg) + Xor, + + /// Display the sum of the source image and destination image. [Porter Duff Compositing Operators] + Plus, + + /// Multiplies all components (= alpha and color). [Separable Blend Modes] + Modulate, + + /// Multiplies the complements of the backdrop and source CompositionColorvalues, then complements the result. [Separable Blend Modes] + Screen, + + /// Multiplies or screens the colors, depending on the backdrop CompositionColorvalue. [Separable Blend Modes] + Overlay, + + /// Selects the darker of the backdrop and source colors. [Separable Blend Modes] + Darken, + + /// Selects the lighter of the backdrop and source colors. [Separable Blend Modes] + Lighten, + + /// Brightens the backdrop CompositionColorto reflect the source color. [Separable Blend Modes] + ColorDodge, + + /// Darkens the backdrop CompositionColorto reflect the source color. [Separable Blend Modes] + ColorBurn, + + /// Multiplies or screens the colors, depending on the source CompositionColorvalue. [Separable Blend Modes] + HardLight, + + /// Darkens or lightens the colors, depending on the source CompositionColorvalue. [Separable Blend Modes] + SoftLight, + + /// Subtracts the darker of the two constituent colors from the lighter color. [Separable Blend Modes] + Difference, + + /// Produces an effect similar to that of the Difference mode but lower in contrast. [Separable Blend Modes] + Exclusion, + + /// The source CompositionColoris multiplied by the destination CompositionColorand replaces the destination [Separable Blend Modes] + Multiply, + + /// Creates a CompositionColorwith the hue of the source CompositionColorand the saturation and luminosity of the backdrop color. [Non-Separable Blend Modes] + Hue, + + /// Creates a CompositionColorwith the saturation of the source CompositionColorand the hue and luminosity of the backdrop color. [Non-Separable Blend Modes] + Saturation, + + /// Creates a CompositionColorwith the hue and saturation of the source CompositionColorand the luminosity of the backdrop color. [Non-Separable Blend Modes] + Color, + + /// Creates a CompositionColorwith the luminosity of the source CompositionColorand the hue and saturation of the backdrop color. [Non-Separable Blend Modes] + Luminosity, + } + + public enum CompositionGradientExtendMode + { + Clamp, + Wrap, + Mirror + } + + [Flags] + public enum CompositionTileMode + { + None = 0, + TileX = 1, + TileY = 2, + FlipX = 4, + FlipY = 8, + Tile = TileX | TileY, + Flip = FlipX | FlipY + } + + public enum CompositionStretch + { + None = 0, + Fill = 1, + //TODO: Uniform, UniformToFill + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/BuiltInExpressionFfi.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/BuiltInExpressionFfi.cs new file mode 100644 index 0000000000..44347d2c7a --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/BuiltInExpressionFfi.cs @@ -0,0 +1,237 @@ +using System; +using System.Collections.Generic; +using System.Numerics; +using Avalonia.Rendering.Composition.Animations; +using Avalonia.Utilities; + +namespace Avalonia.Rendering.Composition.Expressions +{ + /// + /// Built-in functions for Foreign Function Interface available from composition animation expressions + /// + internal class BuiltInExpressionFfi : IExpressionForeignFunctionInterface + { + private readonly DelegateExpressionFfi _registry; + + static float Lerp(float a, float b, float p) => p * (b - a) + a; + + static Matrix3x2 Inverse(Matrix3x2 m) + { + Matrix3x2.Invert(m, out var r); + return r; + } + + static Matrix4x4 Inverse(Matrix4x4 m) + { + Matrix4x4.Invert(m, out var r); + return r; + } + + static float SmoothStep(float edge0, float edge1, float x) + { + var t = MathUtilities.Clamp((x - edge0) / (edge1 - edge0), 0.0f, 1.0f); + return t * t * (3.0f - 2.0f * t); + } + + static Vector2 SmoothStep(Vector2 edge0, Vector2 edge1, Vector2 x) + { + return new Vector2( + SmoothStep(edge0.X, edge1.X, x.X), + SmoothStep(edge0.Y, edge1.Y, x.Y) + + ); + } + static Vector3 SmoothStep(Vector3 edge0, Vector3 edge1, Vector3 x) + { + return new Vector3( + SmoothStep(edge0.X, edge1.X, x.X), + SmoothStep(edge0.Y, edge1.Y, x.Y), + SmoothStep(edge0.Z, edge1.Z, x.Z) + + ); + } + + static Vector4 SmoothStep(Vector4 edge0, Vector4 edge1, Vector4 x) + { + return new Vector4( + SmoothStep(edge0.X, edge1.X, x.X), + SmoothStep(edge0.Y, edge1.Y, x.Y), + SmoothStep(edge0.Z, edge1.Z, x.Z), + SmoothStep(edge0.W, edge1.W, x.W) + ); + } + + private BuiltInExpressionFfi() + { + _registry = new DelegateExpressionFfi + { + {"Abs", (float f) => Math.Abs(f)}, + {"Abs", (Vector2 v) => Vector2.Abs(v)}, + {"Abs", (Vector3 v) => Vector3.Abs(v)}, + {"Abs", (Vector4 v) => Vector4.Abs(v)}, + + {"ACos", (float f) => (float) Math.Acos(f)}, + {"ASin", (float f) => (float) Math.Asin(f)}, + {"ATan", (float f) => (float) Math.Atan(f)}, + {"Ceil", (float f) => (float) Math.Ceiling(f)}, + + {"Clamp", (float a1, float a2, float a3) => MathUtilities.Clamp(a1, a2, a3)}, + {"Clamp", (Vector2 a1, Vector2 a2, Vector2 a3) => Vector2.Clamp(a1, a2, a3)}, + {"Clamp", (Vector3 a1, Vector3 a2, Vector3 a3) => Vector3.Clamp(a1, a2, a3)}, + {"Clamp", (Vector4 a1, Vector4 a2, Vector4 a3) => Vector4.Clamp(a1, a2, a3)}, + + {"Concatenate", (Quaternion a1, Quaternion a2) => Quaternion.Concatenate(a1, a2)}, + {"Cos", (float a) => (float) Math.Cos(a)}, + + /* + TODO: + ColorHsl(Float h, Float s, Float l) + ColorLerpHSL(Color colorTo, CompositionColorcolorFrom, Float progress) + */ + + { + "ColorLerp", (Avalonia.Media.Color to, Avalonia.Media.Color from, float progress) => + ColorInterpolator.LerpRGB(to, from, progress) + }, + { + "ColorLerpRGB", (Avalonia.Media.Color to, Avalonia.Media.Color from, float progress) => + ColorInterpolator.LerpRGB(to, from, progress) + }, + { + "ColorRGB", (float a, float r, float g, float b) => Avalonia.Media.Color.FromArgb( + (byte) MathUtilities.Clamp(a, 0, 255), + (byte) MathUtilities.Clamp(r, 0, 255), + (byte) MathUtilities.Clamp(g, 0, 255), + (byte) MathUtilities.Clamp(b, 0, 255) + ) + }, + + {"Distance", (Vector2 a1, Vector2 a2) => Vector2.Distance(a1, a2)}, + {"Distance", (Vector3 a1, Vector3 a2) => Vector3.Distance(a1, a2)}, + {"Distance", (Vector4 a1, Vector4 a2) => Vector4.Distance(a1, a2)}, + + {"DistanceSquared", (Vector2 a1, Vector2 a2) => Vector2.DistanceSquared(a1, a2)}, + {"DistanceSquared", (Vector3 a1, Vector3 a2) => Vector3.DistanceSquared(a1, a2)}, + {"DistanceSquared", (Vector4 a1, Vector4 a2) => Vector4.DistanceSquared(a1, a2)}, + + {"Floor", (float v) => (float) Math.Floor(v)}, + + {"Inverse", (Matrix3x2 v) => Inverse(v)}, + {"Inverse", (Matrix4x4 v) => Inverse(v)}, + + + {"Length", (Vector2 a1) => a1.Length()}, + {"Length", (Vector3 a1) => a1.Length()}, + {"Length", (Vector4 a1) => a1.Length()}, + {"Length", (Quaternion a1) => a1.Length()}, + + {"LengthSquared", (Vector2 a1) => a1.LengthSquared()}, + {"LengthSquared", (Vector3 a1) => a1.LengthSquared()}, + {"LengthSquared", (Vector4 a1) => a1.LengthSquared()}, + {"LengthSquared", (Quaternion a1) => a1.LengthSquared()}, + + {"Lerp", (float a1, float a2, float a3) => Lerp(a1, a2, a3)}, + {"Lerp", (Vector2 a1, Vector2 a2, float a3) => Vector2.Lerp(a1, a2, a3)}, + {"Lerp", (Vector3 a1, Vector3 a2, float a3) => Vector3.Lerp(a1, a2, a3)}, + {"Lerp", (Vector4 a1, Vector4 a2, float a3) => Vector4.Lerp(a1, a2, a3)}, + + + {"Ln", (float f) => (float) Math.Log(f)}, + {"Log10", (float f) => (float) Math.Log10(f)}, + + {"Matrix3x2.CreateFromScale", (Vector2 v) => Matrix3x2.CreateScale(v)}, + {"Matrix3x2.CreateFromTranslation", (Vector2 v) => Matrix3x2.CreateTranslation(v)}, + {"Matrix3x2.CreateRotation", (float v) => Matrix3x2.CreateRotation(v)}, + {"Matrix3x2.CreateScale", (Vector2 v) => Matrix3x2.CreateScale(v)}, + {"Matrix3x2.CreateSkew", (float a1, float a2, Vector2 a3) => Matrix3x2.CreateSkew(a1, a2, a3)}, + {"Matrix3x2.CreateTranslation", (Vector2 v) => Matrix3x2.CreateScale(v)}, + { + "Matrix3x2", (float m11, float m12, float m21, float m22, float m31, float m32) => + new Matrix3x2(m11, m12, m21, m22, m31, m32) + }, + {"Matrix4x4.CreateFromAxisAngle", (Vector3 v, float angle) => Matrix4x4.CreateFromAxisAngle(v, angle)}, + {"Matrix4x4.CreateFromScale", (Vector3 v) => Matrix4x4.CreateScale(v)}, + {"Matrix4x4.CreateFromTranslation", (Vector3 v) => Matrix4x4.CreateTranslation(v)}, + {"Matrix4x4.CreateScale", (Vector3 v) => Matrix4x4.CreateScale(v)}, + {"Matrix4x4.CreateTranslation", (Vector3 v) => Matrix4x4.CreateScale(v)}, + {"Matrix4x4", (Matrix3x2 m) => new Matrix4x4(m)}, + { + "Matrix4x4", + (float m11, float m12, float m13, float m14, + float m21, float m22, float m23, float m24, + float m31, float m32, float m33, float m34, + float m41, float m42, float m43, float m44) => + new Matrix4x4( + m11, m12, m13, m14, + m21, m22, m23, m24, + m31, m32, m33, m34, + m41, m42, m43, m44) + }, + + + {"Max", (float a1, float a2) => Math.Max(a1, a2)}, + {"Max", (Vector2 a1, Vector2 a2) => Vector2.Max(a1, a2)}, + {"Max", (Vector3 a1, Vector3 a2) => Vector3.Max(a1, a2)}, + {"Max", (Vector4 a1, Vector4 a2) => Vector4.Max(a1, a2)}, + + + {"Min", (float a1, float a2) => Math.Min(a1, a2)}, + {"Min", (Vector2 a1, Vector2 a2) => Vector2.Min(a1, a2)}, + {"Min", (Vector3 a1, Vector3 a2) => Vector3.Min(a1, a2)}, + {"Min", (Vector4 a1, Vector4 a2) => Vector4.Min(a1, a2)}, + + {"Mod", (float a, float b) => a % b}, + + {"Normalize", (Quaternion a) => Quaternion.Normalize(a)}, + {"Normalize", (Vector2 a) => Vector2.Normalize(a)}, + {"Normalize", (Vector3 a) => Vector3.Normalize(a)}, + {"Normalize", (Vector4 a) => Vector4.Normalize(a)}, + + {"Pow", (float a, float b) => (float) Math.Pow(a, b)}, + {"Quaternion.CreateFromAxisAngle", (Vector3 a, float b) => Quaternion.CreateFromAxisAngle(a, b)}, + {"Quaternion", (float a, float b, float c, float d) => new Quaternion(a, b, c, d)}, + + {"Round", (float a) => (float) Math.Round(a)}, + + {"Scale", (Matrix3x2 a, float b) => a * b}, + {"Scale", (Matrix4x4 a, float b) => a * b}, + {"Scale", (Vector2 a, float b) => a * b}, + {"Scale", (Vector3 a, float b) => a * b}, + {"Scale", (Vector4 a, float b) => a * b}, + + {"Sin", (float a) => (float) Math.Sin(a)}, + + {"SmoothStep", (float a1, float a2, float a3) => SmoothStep(a1, a2, a3)}, + {"SmoothStep", (Vector2 a1, Vector2 a2, Vector2 a3) => SmoothStep(a1, a2, a3)}, + {"SmoothStep", (Vector3 a1, Vector3 a2, Vector3 a3) => SmoothStep(a1, a2, a3)}, + {"SmoothStep", (Vector4 a1, Vector4 a2, Vector4 a3) => SmoothStep(a1, a2, a3)}, + + // I have no idea how to do a spherical interpolation for a scalar value, so we are doing a linear one + {"Slerp", (float a1, float a2, float a3) => Lerp(a1, a2, a3)}, + {"Slerp", (Quaternion a1, Quaternion a2, float a3) => Quaternion.Slerp(a1, a2, a3)}, + + {"Sqrt", (float a) => (float) Math.Sqrt(a)}, + {"Square", (float a) => a * a}, + {"Tan", (float a) => (float) Math.Tan(a)}, + + {"ToRadians", (float a) => (float) (a * Math.PI / 180)}, + {"ToDegrees", (float a) => (float) (a * 180d / Math.PI)}, + + {"Transform", (Vector2 a, Matrix3x2 b) => Vector2.Transform(a, b)}, + {"Transform", (Vector3 a, Matrix4x4 b) => Vector3.Transform(a, b)}, + + {"Vector2", (float a, float b) => new Vector2(a, b)}, + {"Vector3", (float a, float b, float c) => new Vector3(a, b, c)}, + {"Vector3", (Vector2 v2, float z) => new Vector3(v2, z)}, + {"Vector4", (float a, float b, float c, float d) => new Vector4(a, b, c, d)}, + {"Vector4", (Vector2 v2, float z, float w) => new Vector4(v2, z, w)}, + {"Vector4", (Vector3 v3, float w) => new Vector4(v3, w)}, + }; + } + + public bool Call(string name, IReadOnlyList arguments, out ExpressionVariant result) => + _registry.Call(name, arguments, out result); + + public static BuiltInExpressionFfi Instance { get; } = new BuiltInExpressionFfi(); + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/DelegateExpressionFfi.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/DelegateExpressionFfi.cs new file mode 100644 index 0000000000..85c6141409 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/DelegateExpressionFfi.cs @@ -0,0 +1,184 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using Avalonia.Media; + +namespace Avalonia.Rendering.Composition.Expressions +{ + /// + /// Foreign function interface for composition animations based on calling delegates + /// + internal class DelegateExpressionFfi : IExpressionForeignFunctionInterface, IEnumerable + { + struct FfiRecord + { + public VariantType[] Types; + public Func, ExpressionVariant> Delegate; + } + + private readonly Dictionary>> + _registry = new Dictionary>>(); + + public bool Call(string name, IReadOnlyList arguments, out ExpressionVariant result) + { + result = default; + if (!_registry.TryGetValue(name, out var nameGroup)) + return false; + if (!nameGroup.TryGetValue(arguments.Count, out var countGroup)) + return false; + foreach (var record in countGroup) + { + var match = true; + for (var c = 0; c < arguments.Count; c++) + { + if (record.Types[c] != arguments[c].Type) + { + match = false; + break; + } + } + + if (match) + { + result = record.Delegate(arguments); + return true; + } + } + + return false; + } + + // Stub for collection initializer + IEnumerator IEnumerable.GetEnumerator() => Array.Empty().GetEnumerator(); + + void Add(string name, Func, ExpressionVariant> cb, + params Type[] types) + { + if (!_registry.TryGetValue(name, out var nameGroup)) + _registry[name] = nameGroup = + new Dictionary>(); + if (!nameGroup.TryGetValue(types.Length, out var countGroup)) + nameGroup[types.Length] = countGroup = new List(); + + countGroup.Add(new FfiRecord + { + Types = types.Select(t => TypeMap[t]).ToArray(), + Delegate = cb + }); + } + + static readonly Dictionary TypeMap = new Dictionary + { + [typeof(bool)] = VariantType.Boolean, + [typeof(float)] = VariantType.Scalar, + [typeof(Vector2)] = VariantType.Vector2, + [typeof(Vector3)] = VariantType.Vector3, + [typeof(Vector4)] = VariantType.Vector4, + [typeof(Matrix3x2)] = VariantType.Matrix3x2, + [typeof(Matrix4x4)] = VariantType.Matrix4x4, + [typeof(Quaternion)] = VariantType.Quaternion, + [typeof(Color)] = VariantType.Color + }; + + public void Add(string name, Func cb) where T1 : struct + { + Add(name, args => cb(args[0].CastOrDefault()), typeof(T1)); + } + + public void Add(string name, Func cb) where T1 : struct where T2 : struct + { + Add(name, args => cb(args[0].CastOrDefault(), args[1].CastOrDefault()), typeof(T1), typeof(T2)); + } + + + public void Add(string name, Func cb) + where T1 : struct where T2 : struct where T3 : struct + { + Add(name, args => cb(args[0].CastOrDefault(), args[1].CastOrDefault(), args[2].CastOrDefault()), typeof(T1), typeof(T2), + typeof(T3)); + } + + public void Add(string name, Func cb) + where T1 : struct where T2 : struct where T3 : struct where T4 : struct + { + Add(name, args => cb( + args[0].CastOrDefault(), + args[1].CastOrDefault(), + args[2].CastOrDefault(), + args[3].CastOrDefault()), + typeof(T1), typeof(T2), typeof(T3), typeof(T4)); + } + + public void Add(string name, Func cb) + where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct + { + Add(name, args => cb( + args[0].CastOrDefault(), + args[1].CastOrDefault(), + args[2].CastOrDefault(), + args[3].CastOrDefault(), + args[4].CastOrDefault()), + typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5)); + } + + public void Add(string name, Func cb) + where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct where T6 : struct + { + Add(name, args => cb( + args[0].CastOrDefault(), + args[1].CastOrDefault(), + args[2].CastOrDefault(), + args[3].CastOrDefault(), + args[4].CastOrDefault(), + args[4].CastOrDefault()), + typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5), typeof(T6)); + } + + + public void Add(string name, + Func cb) + where T1 : struct + where T2 : struct + where T3 : struct + where T4 : struct + where T5 : struct + where T6 : struct + where T7 : struct + where T8 : struct + where T9 : struct + where T10 : struct + where T11 : struct + where T12 : struct + where T13 : struct + where T14 : struct + where T15 : struct + where T16 : struct + { + Add(name, args => cb( + args[0].CastOrDefault(), + args[1].CastOrDefault(), + args[2].CastOrDefault(), + args[3].CastOrDefault(), + args[4].CastOrDefault(), + args[4].CastOrDefault(), + args[4].CastOrDefault(), + args[4].CastOrDefault(), + args[4].CastOrDefault(), + args[4].CastOrDefault(), + args[4].CastOrDefault(), + args[4].CastOrDefault(), + args[4].CastOrDefault(), + args[4].CastOrDefault(), + args[4].CastOrDefault(), + args[4].CastOrDefault() + ), + typeof(T1), typeof(T2), typeof(T3), typeof(T4), + typeof(T5), typeof(T6), typeof(T7), typeof(T8), + typeof(T9), typeof(T10), typeof(T11), typeof(T12), + typeof(T13), typeof(T14), typeof(T15), typeof(T16) + ); + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/Expression.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/Expression.cs new file mode 100644 index 0000000000..5abba00365 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/Expression.cs @@ -0,0 +1,377 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Reflection; +using Avalonia.Rendering.Composition.Server; + +namespace Avalonia.Rendering.Composition.Expressions +{ + /// + /// A parsed composition expression + /// + internal abstract class Expression + { + public abstract ExpressionType Type { get; } + public static Expression Parse(string expression) + { + return ExpressionParser.Parse(expression.AsSpan()); + } + + public abstract ExpressionVariant Evaluate(ref ExpressionEvaluationContext context); + + public virtual void CollectReferences(HashSet<(string parameter, string property)> references) + { + + } + + protected abstract string Print(); + public override string ToString() => Print(); + + internal static string OperatorName(ExpressionType t) + { + var attr = typeof(ExpressionType).GetMember(t.ToString())[0] + .GetCustomAttribute(); + if (attr != null) + return attr.Name; + return t.ToString(); + } + } + + internal class PrettyPrintStringAttribute : Attribute + { + public string Name { get; } + + public PrettyPrintStringAttribute(string name) + { + Name = name; + } + } + + internal enum ExpressionType + { + // Binary operators + [PrettyPrintString("+")] + Add, + [PrettyPrintString("-")] + Subtract, + [PrettyPrintString("/")] + Divide, + [PrettyPrintString("*")] + Multiply, + [PrettyPrintString(">")] + MoreThan, + [PrettyPrintString("<")] + LessThan, + [PrettyPrintString(">=")] + MoreThanOrEqual, + [PrettyPrintString("<=")] + LessThanOrEqual, + [PrettyPrintString("&&")] + LogicalAnd, + [PrettyPrintString("||")] + LogicalOr, + [PrettyPrintString("%")] + Remainder, + [PrettyPrintString("==")] + Equals, + [PrettyPrintString("!=")] + NotEquals, + // Unary operators + [PrettyPrintString("!")] + Not, + [PrettyPrintString("-")] + UnaryMinus, + // The rest + MemberAccess, + Parameter, + FunctionCall, + Keyword, + Constant, + ConditionalExpression + } + + internal enum ExpressionKeyword + { + StartingValue, + CurrentValue, + FinalValue, + Target, + Pi, + True, + False + } + + internal class ConditionalExpression : Expression + { + public Expression Condition { get; } + public Expression TruePart { get; } + public Expression FalsePart { get; } + public override ExpressionType Type => ExpressionType.ConditionalExpression; + + public ConditionalExpression(Expression condition, Expression truePart, Expression falsePart) + { + Condition = condition; + TruePart = truePart; + FalsePart = falsePart; + } + + public override ExpressionVariant Evaluate(ref ExpressionEvaluationContext context) + { + var cond = Condition.Evaluate(ref context); + if (cond.Type == VariantType.Boolean && cond.Boolean) + return TruePart.Evaluate(ref context); + return FalsePart.Evaluate(ref context); + } + + public override void CollectReferences(HashSet<(string parameter, string property)> references) + { + Condition.CollectReferences(references); + TruePart.CollectReferences(references); + FalsePart.CollectReferences(references); + } + + protected override string Print() => $"({Condition}) ? ({TruePart}) : ({FalsePart})"; + } + + internal class ConstantExpression : Expression + { + public float Constant { get; } + public override ExpressionType Type => ExpressionType.Constant; + + public ConstantExpression(float constant) + { + Constant = constant; + } + + public override ExpressionVariant Evaluate(ref ExpressionEvaluationContext context) => Constant; + + protected override string Print() => Constant.ToString(CultureInfo.InvariantCulture); + } + + internal class FunctionCallExpression : Expression + { + public string Name { get; } + public List Parameters { get; } + public override ExpressionType Type => ExpressionType.FunctionCall; + + public FunctionCallExpression(string name, List parameters) + { + Name = name; + Parameters = parameters; + } + + public override ExpressionVariant Evaluate(ref ExpressionEvaluationContext context) + { + if (context.ForeignFunctionInterface == null) + return default; + var args = new List(); + foreach (var expr in Parameters) + args.Add(expr.Evaluate(ref context)); + if (!context.ForeignFunctionInterface.Call(Name, args, out var res)) + return default; + return res; + } + + public override void CollectReferences(HashSet<(string parameter, string property)> references) + { + foreach(var arg in Parameters) + arg.CollectReferences(references); + } + + protected override string Print() + { + return Name + "( (" + string.Join("), (", Parameters) + ") )"; + } + } + + internal class MemberAccessExpression : Expression + { + public override ExpressionType Type => ExpressionType.MemberAccess; + public Expression Target { get; } + public string Member { get; } + + public MemberAccessExpression(Expression target, string member) + { + Target = target; + Member = string.Intern(member); + } + + public override void CollectReferences(HashSet<(string parameter, string property)> references) + { + Target.CollectReferences(references); + if (Target is ParameterExpression pe) + references.Add((pe.Name, Member)); + } + + public override ExpressionVariant Evaluate(ref ExpressionEvaluationContext context) + { + if (Target is KeywordExpression ke + && ke.Keyword == ExpressionKeyword.Target) + { + return context.Target.GetProperty(Member); + } + + if (Target is ParameterExpression pe) + { + var obj = context.Parameters?.GetObjectParameter(pe.Name); + if (obj != null) + { + return obj.GetProperty(Member); + } + } + // Those are considered immutable + return Target.Evaluate(ref context).GetProperty(Member); + } + + protected override string Print() + { + return "(" + Target.ToString() + ")." + Member; + } + } + + internal class ParameterExpression : Expression + { + public string Name { get; } + public override ExpressionType Type => ExpressionType.Parameter; + + public ParameterExpression(string name) + { + Name = name; + } + public override ExpressionVariant Evaluate(ref ExpressionEvaluationContext context) + { + return context.Parameters?.GetParameter(Name) ?? default; + } + + protected override string Print() + { + return "{" + Name + "}"; + } + } + + internal class KeywordExpression : Expression + { + public override ExpressionType Type => ExpressionType.Keyword; + public ExpressionKeyword Keyword { get; } + + public KeywordExpression(ExpressionKeyword keyword) + { + Keyword = keyword; + } + + public override ExpressionVariant Evaluate(ref ExpressionEvaluationContext context) + { + if (Keyword == ExpressionKeyword.StartingValue) + return context.StartingValue; + if (Keyword == ExpressionKeyword.CurrentValue) + return context.CurrentValue; + if (Keyword == ExpressionKeyword.FinalValue) + return context.FinalValue; + if (Keyword == ExpressionKeyword.Target) + // should be handled by MemberAccess + return default; + if (Keyword == ExpressionKeyword.True) + return true; + if (Keyword == ExpressionKeyword.False) + return false; + if (Keyword == ExpressionKeyword.Pi) + return (float) Math.PI; + return default; + } + + protected override string Print() + { + return "[" + Keyword + "]"; + } + } + + internal class UnaryExpression : Expression + { + public Expression Parameter { get; } + public override ExpressionType Type { get; } + public override ExpressionVariant Evaluate(ref ExpressionEvaluationContext context) + { + if (Type == ExpressionType.Not) + return !Parameter.Evaluate(ref context); + if (Type == ExpressionType.UnaryMinus) + return -Parameter.Evaluate(ref context); + return default; + } + + public override void CollectReferences(HashSet<(string parameter, string property)> references) + { + Parameter.CollectReferences(references); + } + + protected override string Print() + { + return OperatorName(Type) + Parameter; + } + + public UnaryExpression(Expression parameter, ExpressionType type) + { + Parameter = parameter; + Type = type; + } + } + + internal class BinaryExpression : Expression + { + public Expression Left { get; } + public Expression Right { get; } + public override ExpressionType Type { get; } + public override ExpressionVariant Evaluate(ref ExpressionEvaluationContext context) + { + var left = Left.Evaluate(ref context); + var right = Right.Evaluate(ref context); + if (Type == ExpressionType.Add) + return left + right; + if (Type == ExpressionType.Subtract) + return left - right; + if (Type == ExpressionType.Multiply) + return left * right; + if (Type == ExpressionType.Divide) + return left / right; + if (Type == ExpressionType.Remainder) + return left % right; + if (Type == ExpressionType.MoreThan) + return left > right; + if (Type == ExpressionType.LessThan) + return left < right; + if (Type == ExpressionType.MoreThanOrEqual) + return left > right; + if (Type == ExpressionType.LessThanOrEqual) + return left < right; + if (Type == ExpressionType.LogicalAnd) + return left.And(right); + if (Type == ExpressionType.LogicalOr) + return left.Or(right); + if (Type == ExpressionType.Equals) + return left.EqualsTo(right); + if (Type == ExpressionType.NotEquals) + return left.NotEqualsTo(right); + return default; + } + + public override void CollectReferences(HashSet<(string parameter, string property)> references) + { + Left.CollectReferences(references); + Right.CollectReferences(references); + } + + protected override string Print() + { + return "(" + Left + OperatorName(Type) + Right + ")"; + } + + public BinaryExpression(Expression left, Expression right, ExpressionType type) + { + Left = left; + Right = right; + Type = type; + } + } + + + +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionEvaluationContext.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionEvaluationContext.cs new file mode 100644 index 0000000000..9d23551e43 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionEvaluationContext.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; +using Avalonia.Rendering.Composition.Server; + +namespace Avalonia.Rendering.Composition.Expressions +{ + internal struct ExpressionEvaluationContext + { + public ExpressionVariant StartingValue { get; set; } + public ExpressionVariant CurrentValue { get; set; } + public ExpressionVariant FinalValue { get; set; } + public IExpressionObject Target { get; set; } + public IExpressionParameterCollection Parameters { get; set; } + public IExpressionForeignFunctionInterface ForeignFunctionInterface { get; set; } + } + + internal interface IExpressionObject + { + ExpressionVariant GetProperty(string name); + } + + internal interface IExpressionParameterCollection + { + public ExpressionVariant GetParameter(string name); + + public IExpressionObject GetObjectParameter(string name); + } + + internal interface IExpressionForeignFunctionInterface + { + bool Call(string name, IReadOnlyList arguments, out ExpressionVariant result); + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParseException.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParseException.cs new file mode 100644 index 0000000000..6a207a3bf7 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParseException.cs @@ -0,0 +1,14 @@ +using System; + +namespace Avalonia.Rendering.Composition.Expressions +{ + internal class ExpressionParseException : Exception + { + public int Position { get; } + + public ExpressionParseException(string message, int position) : base(message) + { + Position = position; + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParser.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParser.cs new file mode 100644 index 0000000000..5924bb8f1b --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionParser.cs @@ -0,0 +1,298 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Linq; + +// ReSharper disable StringLiteralTypo + +namespace Avalonia.Rendering.Composition.Expressions +{ + internal class ExpressionParser + { + public static Expression Parse(ReadOnlySpan s) + { + var p = new TokenParser(s); + var parsed = ParseTillTerminator(ref p, "", false, false, out _); + p.SkipWhitespace(); + if (p.Length != 0) + throw new ExpressionParseException("Unexpected data ", p.Position); + return parsed; + } + + private static ReadOnlySpan Dot => ".".AsSpan(); + static bool TryParseAtomic(ref TokenParser parser, + [MaybeNullWhen(returnValue: false)] out Expression expr) + { + // We can parse keywords, parameter names and constants + expr = null; + if (parser.TryParseKeywordLowerCase("this.startingvalue")) + expr = new KeywordExpression(ExpressionKeyword.StartingValue); + else if(parser.TryParseKeywordLowerCase("this.currentvalue")) + expr = new KeywordExpression(ExpressionKeyword.CurrentValue); + else if(parser.TryParseKeywordLowerCase("this.finalvalue")) + expr = new KeywordExpression(ExpressionKeyword.FinalValue); + else if(parser.TryParseKeywordLowerCase("pi")) + expr = new KeywordExpression(ExpressionKeyword.Pi); + else if(parser.TryParseKeywordLowerCase("true")) + expr = new KeywordExpression(ExpressionKeyword.True); + else if(parser.TryParseKeywordLowerCase("false")) + expr = new KeywordExpression(ExpressionKeyword.False); + else if (parser.TryParseKeywordLowerCase("this.target")) + expr = new KeywordExpression(ExpressionKeyword.Target); + + if (expr != null) + return true; + + if (parser.TryParseIdentifier(out var identifier)) + { + expr = new ParameterExpression(identifier.ToString()); + return true; + } + + if(parser.TryParseFloat(out var scalar)) + { + expr = new ConstantExpression(scalar); + return true; + } + + return false; + + } + + static bool TryParseOperator(ref TokenParser parser, out ExpressionType op) + { + op = (ExpressionType) (-1); + if (parser.TryConsume("||")) + op = ExpressionType.LogicalOr; + else if (parser.TryConsume("&&")) + op = ExpressionType.LogicalAnd; + else if (parser.TryConsume(">=")) + op = ExpressionType.MoreThanOrEqual; + else if (parser.TryConsume("<=")) + op = ExpressionType.LessThanOrEqual; + else if (parser.TryConsume("==")) + op = ExpressionType.Equals; + else if (parser.TryConsume("!=")) + op = ExpressionType.NotEquals; + else if (parser.TryConsumeAny("+-/*><%".AsSpan(), out var sop)) + { +#pragma warning disable CS8509 + op = sop switch +#pragma warning restore CS8509 + { + '+' => ExpressionType.Add, + '-' => ExpressionType.Subtract, + '/' => ExpressionType.Divide, + '*' => ExpressionType.Multiply, + '<' => ExpressionType.LessThan, + '>' => ExpressionType.MoreThan, + '%' => ExpressionType.Remainder + }; + } + else + return false; + + return true; + } + + + struct ExpressionOperatorGroup + { + private List _expressions; + private List _operators; + private Expression? _first; + + public bool NotEmpty => !Empty; + public bool Empty => _expressions == null && _first == null; + + public void AppendFirst(Expression expr) + { + if (NotEmpty) + throw new InvalidOperationException(); + _first = expr; + } + + public void AppendWithOperator(Expression expr, ExpressionType op) + { + if (_expressions == null) + { + if (_first == null) + throw new InvalidOperationException(); + _expressions = new List(); + _expressions.Add(_first); + _first = null; + _operators = new List(); + } + _expressions.Add(expr); + _operators.Add(op); + } + + // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/ + private static readonly ExpressionType[][] OperatorPrecedenceGroups = new[] + { + // multiplicative + new[] {ExpressionType.Multiply, ExpressionType.Divide, ExpressionType.Remainder}, + // additive + new[] {ExpressionType.Add, ExpressionType.Subtract}, + // relational + new[] {ExpressionType.MoreThan, ExpressionType.MoreThanOrEqual, ExpressionType.LessThan, ExpressionType.LessThanOrEqual}, + // equality + new[] {ExpressionType.Equals, ExpressionType.NotEquals}, + // conditional AND + new[] {ExpressionType.LogicalAnd}, + // conditional OR + new[]{ ExpressionType.LogicalOr}, + }; + + private static readonly ExpressionType[][] OperatorPrecedenceGroupsReversed = + OperatorPrecedenceGroups.Reverse().ToArray(); + + // a*b+c [a,b,c] [*,+], call with (0, 2) + // ToExpression(a*b) + ToExpression(c) + // a+b*c -> ToExpression(a) + ToExpression(b*c) + Expression ToExpression(int from, int to) + { + if (to - from == 0) + return _expressions[from]; + + if (to - from == 1) + return new BinaryExpression(_expressions[from], _expressions[to], _operators[from]); + + foreach (var grp in OperatorPrecedenceGroupsReversed) + { + for (var c = from; c < to; c++) + { + var currentOperator = _operators[c]; + foreach(var operatorFromGroup in grp) + if (currentOperator == operatorFromGroup) + { + // We are dividing the expression right here + var left = ToExpression(from, c); + var right = ToExpression(c + 1, to); + return new BinaryExpression(left, right, currentOperator); + } + } + } + + // We shouldn't ever get here, if we are, there is something wrong in the code + throw new ExpressionParseException("Expression parsing algorithm bug in ToExpression", 0); + } + + public Expression ToExpression() + { + if (_expressions == null) + return _first ?? throw new InvalidOperationException(); + return ToExpression(0, _expressions.Count - 1); + } + } + + static Expression ParseTillTerminator(ref TokenParser parser, string terminatorChars, + bool throwOnTerminator, + bool throwOnEnd, + out char? token) + { + ExpressionOperatorGroup left = default; + token = null; + while (true) + { + if (parser.TryConsumeAny(terminatorChars.AsSpan(), out var consumedToken)) + { + if (throwOnTerminator || left.Empty) + throw new ExpressionParseException($"Unexpected '{token}'", parser.Position - 1); + token = consumedToken; + return left.ToExpression(); + } + parser.SkipWhitespace(); + if (parser.Length == 0) + { + if (throwOnEnd || left.Empty) + throw new ExpressionParseException("Unexpected end of expression", parser.Position); + return left.ToExpression(); + } + + ExpressionType? op = null; + if (left.NotEmpty) + { + if (parser.TryConsume('?')) + { + var truePart = ParseTillTerminator(ref parser, ":", + false, true, out _); + // pass through the current parsing rules to consume the rest + var falsePart = ParseTillTerminator(ref parser, terminatorChars, throwOnTerminator, throwOnEnd, + out token); + + return new ConditionalExpression(left.ToExpression(), truePart, falsePart); + } + + // We expect a binary operator here + if (!TryParseOperator(ref parser, out var sop)) + throw new ExpressionParseException("Unexpected token", parser.Position); + op = sop; + } + + // We expect an expression to be parsed (either due to expecting a binary operator or parsing the first part + var applyNegation = false; + while (parser.TryConsume('!')) + applyNegation = !applyNegation; + + var applyUnaryMinus = false; + while (parser.TryConsume('-')) + applyUnaryMinus = !applyUnaryMinus; + + Expression? parsed; + + if (parser.TryConsume('(')) + parsed = ParseTillTerminator(ref parser, ")", false, true, out _); + else if (parser.TryParseCall(out var functionName)) + { + var parameterList = new List(); + while (true) + { + parameterList.Add(ParseTillTerminator(ref parser, ",)", false, true, out var closingToken)); + if (closingToken == ')') + break; + if (closingToken != ',') + throw new ExpressionParseException("Unexpected end of the expression", parser.Position); + } + + parsed = new FunctionCallExpression(functionName.ToString(), parameterList); + } + else if (TryParseAtomic(ref parser, out parsed)) + { + // do nothing + } + else + throw new ExpressionParseException("Unexpected token", parser.Position); + + + // Parse any following member accesses + while (parser.TryConsume('.')) + { + if(!parser.TryParseIdentifier(out var memberName)) + throw new ExpressionParseException("Unexpected token", parser.Position); + + parsed = new MemberAccessExpression(parsed, memberName.ToString()); + } + + // Apply ! operator + if (applyNegation) + parsed = new UnaryExpression(parsed, ExpressionType.Not); + + if (applyUnaryMinus) + { + if(parsed is ConstantExpression constexpr) + parsed = new ConstantExpression(-constexpr.Constant); + else parsed = new UnaryExpression(parsed, ExpressionType.UnaryMinus); + } + + if (left.Empty) + left.AppendFirst(parsed); + else + left.AppendWithOperator(parsed, op!.Value); + } + + + + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionTrackedValues.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionTrackedValues.cs new file mode 100644 index 0000000000..334f975aa0 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionTrackedValues.cs @@ -0,0 +1,57 @@ +using System.Collections; +using System.Collections.Generic; +using Avalonia.Rendering.Composition.Server; + +namespace Avalonia.Rendering.Composition.Expressions; + +internal class ExpressionTrackedObjects : IEnumerable +{ + private List _list = new(); + private HashSet _hashSet = new(); + + public void Add(IExpressionObject obj, string member) + { + if (_hashSet.Add(obj)) + _list.Add(obj); + } + + public void Clear() + { + _list.Clear(); + _hashSet.Clear(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return _list.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return ((IEnumerable)_list).GetEnumerator(); + } + + public List.Enumerator GetEnumerator() => _list.GetEnumerator(); + + public struct Pool + { + private Stack _stack = new(); + + public Pool() + { + } + + public ExpressionTrackedObjects Get() + { + if (_stack.Count > 0) + return _stack.Pop(); + return new ExpressionTrackedObjects(); + } + + public void Return(ExpressionTrackedObjects obj) + { + _stack.Clear(); + _stack.Push(obj); + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionVariant.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionVariant.cs new file mode 100644 index 0000000000..7b900534d8 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/ExpressionVariant.cs @@ -0,0 +1,730 @@ +using System; +using System.Globalization; +using System.Numerics; +using System.Runtime.InteropServices; +using Avalonia.Media; + +namespace Avalonia.Rendering.Composition.Expressions +{ + internal enum VariantType + { + Invalid, + Boolean, + Scalar, + Double, + Vector2, + Vector3, + Vector4, + AvaloniaMatrix, + Matrix3x2, + Matrix4x4, + Quaternion, + Color + } + + /// + /// A VARIANT type used in expression animations. Can represent multiple value types + /// + [StructLayout(LayoutKind.Explicit)] + internal struct ExpressionVariant + { + [FieldOffset(0)] public VariantType Type; + + [FieldOffset(4)] public bool Boolean; + [FieldOffset(4)] public float Scalar; + [FieldOffset(4)] public double Double; + [FieldOffset(4)] public Vector2 Vector2; + [FieldOffset(4)] public Vector3 Vector3; + [FieldOffset(4)] public Vector4 Vector4; + [FieldOffset(4)] public Matrix AvaloniaMatrix; + [FieldOffset(4)] public Matrix3x2 Matrix3x2; + [FieldOffset(4)] public Matrix4x4 Matrix4x4; + [FieldOffset(4)] public Quaternion Quaternion; + [FieldOffset(4)] public Color Color; + + + public ExpressionVariant GetProperty(string property) + { + if (Type == VariantType.Vector2) + { + if (ReferenceEquals(property, "X")) + return Vector2.X; + if (ReferenceEquals(property, "Y")) + return Vector2.Y; + return default; + } + + if (Type == VariantType.Vector3) + { + if (ReferenceEquals(property, "X")) + return Vector3.X; + if (ReferenceEquals(property, "Y")) + return Vector3.Y; + if (ReferenceEquals(property, "Z")) + return Vector3.Z; + if(ReferenceEquals(property, "XY")) + return new Vector2(Vector3.X, Vector3.Y); + if(ReferenceEquals(property, "YX")) + return new Vector2(Vector3.Y, Vector3.X); + if(ReferenceEquals(property, "XZ")) + return new Vector2(Vector3.X, Vector3.Z); + if(ReferenceEquals(property, "ZX")) + return new Vector2(Vector3.Z, Vector3.X); + if(ReferenceEquals(property, "YZ")) + return new Vector2(Vector3.Y, Vector3.Z); + if(ReferenceEquals(property, "ZY")) + return new Vector2(Vector3.Z, Vector3.Y); + return default; + } + + if (Type == VariantType.Vector4) + { + if (ReferenceEquals(property, "X")) + return Vector4.X; + if (ReferenceEquals(property, "Y")) + return Vector4.Y; + if (ReferenceEquals(property, "Z")) + return Vector4.Z; + if (ReferenceEquals(property, "W")) + return Vector4.W; + return default; + } + + if (Type == VariantType.Matrix3x2) + { + if (ReferenceEquals(property, "M11")) + return Matrix3x2.M11; + if (ReferenceEquals(property, "M12")) + return Matrix3x2.M12; + if (ReferenceEquals(property, "M21")) + return Matrix3x2.M21; + if (ReferenceEquals(property, "M22")) + return Matrix3x2.M22; + if (ReferenceEquals(property, "M31")) + return Matrix3x2.M31; + if (ReferenceEquals(property, "M32")) + return Matrix3x2.M32; + return default; + } + + if (Type == VariantType.AvaloniaMatrix) + { + if (ReferenceEquals(property, "M11")) + return AvaloniaMatrix.M11; + if (ReferenceEquals(property, "M12")) + return AvaloniaMatrix.M12; + if (ReferenceEquals(property, "M21")) + return AvaloniaMatrix.M21; + if (ReferenceEquals(property, "M22")) + return AvaloniaMatrix.M22; + if (ReferenceEquals(property, "M31")) + return AvaloniaMatrix.M31; + if (ReferenceEquals(property, "M32")) + return AvaloniaMatrix.M32; + return default; + } + + if (Type == VariantType.Matrix4x4) + { + if (ReferenceEquals(property, "M11")) + return Matrix4x4.M11; + if (ReferenceEquals(property, "M12")) + return Matrix4x4.M12; + if (ReferenceEquals(property, "M13")) + return Matrix4x4.M13; + if (ReferenceEquals(property, "M14")) + return Matrix4x4.M14; + if (ReferenceEquals(property, "M21")) + return Matrix4x4.M21; + if (ReferenceEquals(property, "M22")) + return Matrix4x4.M22; + if (ReferenceEquals(property, "M23")) + return Matrix4x4.M23; + if (ReferenceEquals(property, "M24")) + return Matrix4x4.M24; + if (ReferenceEquals(property, "M31")) + return Matrix4x4.M31; + if (ReferenceEquals(property, "M32")) + return Matrix4x4.M32; + if (ReferenceEquals(property, "M33")) + return Matrix4x4.M33; + if (ReferenceEquals(property, "M34")) + return Matrix4x4.M34; + if (ReferenceEquals(property, "M41")) + return Matrix4x4.M41; + if (ReferenceEquals(property, "M42")) + return Matrix4x4.M42; + if (ReferenceEquals(property, "M43")) + return Matrix4x4.M43; + if (ReferenceEquals(property, "M44")) + return Matrix4x4.M44; + return default; + } + + if (Type == VariantType.Quaternion) + { + if (ReferenceEquals(property, "X")) + return Quaternion.X; + if (ReferenceEquals(property, "Y")) + return Quaternion.Y; + if (ReferenceEquals(property, "Z")) + return Quaternion.Z; + if (ReferenceEquals(property, "W")) + return Quaternion.W; + return default; + } + + if (Type == VariantType.Color) + { + if (ReferenceEquals(property, "A")) + return Color.A; + if (ReferenceEquals(property, "R")) + return Color.R; + if (ReferenceEquals(property, "G")) + return Color.G; + if (ReferenceEquals(property, "B")) + return Color.B; + return default; + } + + return default; + } + + public static implicit operator ExpressionVariant(bool value) => + new ExpressionVariant + { + Type = VariantType.Boolean, + Boolean = value + }; + + public static implicit operator ExpressionVariant(float scalar) => + new ExpressionVariant + { + Type = VariantType.Scalar, + Scalar = scalar + }; + + public static implicit operator ExpressionVariant(double d) => + new ExpressionVariant + { + Type = VariantType.Double, + Double = d + }; + + + public static implicit operator ExpressionVariant(Vector2 value) => + new ExpressionVariant + { + Type = VariantType.Vector2, + Vector2 = value + }; + + + public static implicit operator ExpressionVariant(Vector3 value) => + new ExpressionVariant + { + Type = VariantType.Vector3, + Vector3 = value + }; + + + public static implicit operator ExpressionVariant(Vector4 value) => + new ExpressionVariant + { + Type = VariantType.Vector4, + Vector4 = value + }; + + public static implicit operator ExpressionVariant(Matrix3x2 value) => + new ExpressionVariant + { + Type = VariantType.Matrix3x2, + Matrix3x2 = value + }; + + public static implicit operator ExpressionVariant(Matrix value) => + new ExpressionVariant + { + Type = VariantType.Matrix3x2, + AvaloniaMatrix = value + }; + + public static implicit operator ExpressionVariant(Matrix4x4 value) => + new ExpressionVariant + { + Type = VariantType.Matrix4x4, + Matrix4x4 = value + }; + + public static implicit operator ExpressionVariant(Quaternion value) => + new ExpressionVariant + { + Type = VariantType.Quaternion, + Quaternion = value + }; + + public static implicit operator ExpressionVariant(Avalonia.Media.Color value) => + new ExpressionVariant + { + Type = VariantType.Color, + Color = value + }; + + public static ExpressionVariant operator +(ExpressionVariant left, ExpressionVariant right) + { + if (left.Type != right.Type || left.Type == VariantType.Invalid) + return default; + + if (left.Type == VariantType.Scalar) + return left.Scalar + right.Scalar; + + if (left.Type == VariantType.Double) + return left.Double + right.Double; + + if (left.Type == VariantType.Vector2) + return left.Vector2 + right.Vector2; + + if (left.Type == VariantType.Vector3) + return left.Vector3 + right.Vector3; + + if (left.Type == VariantType.Vector4) + return left.Vector4 + right.Vector4; + + if (left.Type == VariantType.Matrix3x2) + return left.Matrix3x2 + right.Matrix3x2; + + if (left.Type == VariantType.Matrix4x4) + return left.Matrix4x4 + right.Matrix4x4; + + if (left.Type == VariantType.Quaternion) + return left.Quaternion + right.Quaternion; + + return default; + } + + public static ExpressionVariant operator -(ExpressionVariant left, ExpressionVariant right) + { + if (left.Type != right.Type || left.Type == VariantType.Invalid) + return default; + + if (left.Type == VariantType.Scalar) + return left.Scalar - right.Scalar; + + if (left.Type == VariantType.Double) + return left.Double - right.Double; + + if (left.Type == VariantType.Vector2) + return left.Vector2 - right.Vector2; + + if (left.Type == VariantType.Vector3) + return left.Vector3 - right.Vector3; + + if (left.Type == VariantType.Vector4) + return left.Vector4 - right.Vector4; + + if (left.Type == VariantType.Matrix3x2) + return left.Matrix3x2 - right.Matrix3x2; + + if (left.Type == VariantType.Matrix4x4) + return left.Matrix4x4 - right.Matrix4x4; + + if (left.Type == VariantType.Quaternion) + return left.Quaternion - right.Quaternion; + + return default; + } + + public static ExpressionVariant operator -(ExpressionVariant left) + { + + if (left.Type == VariantType.Scalar) + return -left.Scalar; + + if (left.Type == VariantType.Double) + return -left.Double; + + if (left.Type == VariantType.Vector2) + return -left.Vector2; + + if (left.Type == VariantType.Vector3) + return -left.Vector3; + + if (left.Type == VariantType.Vector4) + return -left.Vector4; + + if (left.Type == VariantType.Matrix3x2) + return -left.Matrix3x2; + + if (left.Type == VariantType.AvaloniaMatrix) + return -left.AvaloniaMatrix; + + if (left.Type == VariantType.Matrix4x4) + return -left.Matrix4x4; + + if (left.Type == VariantType.Quaternion) + return -left.Quaternion; + + return default; + } + + public static ExpressionVariant operator *(ExpressionVariant left, ExpressionVariant right) + { + if (left.Type == VariantType.Invalid || right.Type == VariantType.Invalid) + return default; + + if (left.Type == VariantType.Scalar && right.Type == VariantType.Scalar) + return left.Scalar * right.Scalar; + + if (left.Type == VariantType.Double && right.Type == VariantType.Double) + return left.Double * right.Double; + + if (left.Type == VariantType.Vector2 && right.Type == VariantType.Vector2) + return left.Vector2 * right.Vector2; + + if (left.Type == VariantType.Vector2 && right.Type == VariantType.Scalar) + return left.Vector2 * right.Scalar; + + if (left.Type == VariantType.Vector3 && right.Type == VariantType.Vector3) + return left.Vector3 * right.Vector3; + + if (left.Type == VariantType.Vector3 && right.Type == VariantType.Scalar) + return left.Vector3 * right.Scalar; + + if (left.Type == VariantType.Vector4 && right.Type == VariantType.Vector4) + return left.Vector4 * right.Vector4; + + if (left.Type == VariantType.Vector4 && right.Type == VariantType.Scalar) + return left.Vector4 * right.Scalar; + + if (left.Type == VariantType.Matrix3x2 && right.Type == VariantType.Matrix3x2) + return left.Matrix3x2 * right.Matrix3x2; + + if (left.Type == VariantType.Matrix3x2 && right.Type == VariantType.Scalar) + return left.Matrix3x2 * right.Scalar; + + if (left.Type == VariantType.AvaloniaMatrix && right.Type == VariantType.AvaloniaMatrix) + return left.AvaloniaMatrix * right.AvaloniaMatrix; + + if (left.Type == VariantType.Matrix4x4 && right.Type == VariantType.Matrix4x4) + return left.Matrix4x4 * right.Matrix4x4; + + if (left.Type == VariantType.Matrix4x4 && right.Type == VariantType.Scalar) + return left.Matrix4x4 * right.Scalar; + + if (left.Type == VariantType.Quaternion && right.Type == VariantType.Quaternion) + return left.Quaternion * right.Quaternion; + + if (left.Type == VariantType.Quaternion && right.Type == VariantType.Scalar) + return left.Quaternion * right.Scalar; + + return default; + } + + public static ExpressionVariant operator /(ExpressionVariant left, ExpressionVariant right) + { + if (left.Type == VariantType.Invalid || right.Type == VariantType.Invalid) + return default; + + if (left.Type == VariantType.Scalar && right.Type == VariantType.Scalar) + return left.Scalar / right.Scalar; + + if (left.Type == VariantType.Double && right.Type == VariantType.Double) + return left.Double / right.Double; + + if (left.Type == VariantType.Vector2 && right.Type == VariantType.Vector2) + return left.Vector2 / right.Vector2; + + if (left.Type == VariantType.Vector2 && right.Type == VariantType.Scalar) + return left.Vector2 / right.Scalar; + + if (left.Type == VariantType.Vector3 && right.Type == VariantType.Vector3) + return left.Vector3 / right.Vector3; + + if (left.Type == VariantType.Vector3 && right.Type == VariantType.Scalar) + return left.Vector3 / right.Scalar; + + if (left.Type == VariantType.Vector4 && right.Type == VariantType.Vector4) + return left.Vector4 / right.Vector4; + + if (left.Type == VariantType.Vector4 && right.Type == VariantType.Scalar) + return left.Vector4 / right.Scalar; + + if (left.Type == VariantType.Quaternion && right.Type == VariantType.Quaternion) + return left.Quaternion / right.Quaternion; + + return default; + } + + public ExpressionVariant EqualsTo(ExpressionVariant right) + { + if (Type != right.Type || Type == VariantType.Invalid) + return default; + + if (Type == VariantType.Scalar) + return Scalar == right.Scalar; + + + if (Type == VariantType.Double) + return Double == right.Double; + + if (Type == VariantType.Vector2) + return Vector2 == right.Vector2; + + if (Type == VariantType.Vector3) + return Vector3 == right.Vector3; + + if (Type == VariantType.Vector4) + return Vector4 == right.Vector4; + + if (Type == VariantType.Boolean) + return Boolean == right.Boolean; + + if (Type == VariantType.Matrix3x2) + return Matrix3x2 == right.Matrix3x2; + + if (Type == VariantType.AvaloniaMatrix) + return AvaloniaMatrix == right.AvaloniaMatrix; + + if (Type == VariantType.Matrix4x4) + return Matrix4x4 == right.Matrix4x4; + + if (Type == VariantType.Quaternion) + return Quaternion == right.Quaternion; + + return default; + } + + public ExpressionVariant NotEqualsTo(ExpressionVariant right) + { + var r = EqualsTo(right); + if (r.Type == VariantType.Boolean) + return !r.Boolean; + return default; + } + + public static ExpressionVariant operator !(ExpressionVariant v) + { + if (v.Type == VariantType.Boolean) + return !v.Boolean; + return default; + } + + public static ExpressionVariant operator %(ExpressionVariant left, ExpressionVariant right) + { + if (left.Type == VariantType.Scalar && right.Type == VariantType.Scalar) + return left.Scalar % right.Scalar; + if (left.Type == VariantType.Double && right.Type == VariantType.Double) + return left.Double % right.Double; + return default; + } + + public static ExpressionVariant operator <(ExpressionVariant left, ExpressionVariant right) + { + if (left.Type == VariantType.Scalar && right.Type == VariantType.Scalar) + return left.Scalar < right.Scalar; + if (left.Type == VariantType.Double && right.Type == VariantType.Double) + return left.Double < right.Double; + return default; + } + + public static ExpressionVariant operator >(ExpressionVariant left, ExpressionVariant right) + { + if (left.Type == VariantType.Scalar && right.Type == VariantType.Scalar) + return left.Scalar > right.Scalar; + + if (left.Type == VariantType.Double && right.Type == VariantType.Double) + return left.Double > right.Double; + return default; + } + + public ExpressionVariant And(ExpressionVariant right) + { + if (Type == VariantType.Boolean && right.Type == VariantType.Boolean) + return Boolean && right.Boolean; + return default; + } + + public ExpressionVariant Or(ExpressionVariant right) + { + if (Type == VariantType.Boolean && right.Type == VariantType.Boolean) + return Boolean && right.Boolean; + return default; + } + + public bool TryCast(out T res) where T : struct + { + if (typeof(T) == typeof(bool)) + { + if (Type == VariantType.Boolean) + { + res = (T) (object) Boolean; + return true; + } + } + + if (typeof(T) == typeof(float)) + { + if (Type == VariantType.Scalar) + { + res = (T) (object) Scalar; + return true; + } + } + + if (typeof(T) == typeof(double)) + { + if (Type == VariantType.Double) + { + res = (T) (object) Double; + return true; + } + } + + if (typeof(T) == typeof(Vector2)) + { + if (Type == VariantType.Vector2) + { + res = (T) (object) Vector2; + return true; + } + } + + if (typeof(T) == typeof(Vector3)) + { + if (Type == VariantType.Vector3) + { + res = (T) (object) Vector3; + return true; + } + } + + if (typeof(T) == typeof(Vector4)) + { + if (Type == VariantType.Vector4) + { + res = (T) (object) Vector4; + return true; + } + } + + if (typeof(T) == typeof(Matrix3x2)) + { + if (Type == VariantType.Matrix3x2) + { + res = (T) (object) Matrix3x2; + return true; + } + } + + if (typeof(T) == typeof(Matrix)) + { + if (Type == VariantType.AvaloniaMatrix) + { + res = (T) (object) Matrix3x2; + return true; + } + } + + if (typeof(T) == typeof(Matrix4x4)) + { + if (Type == VariantType.Matrix4x4) + { + res = (T) (object) Matrix4x4; + return true; + } + } + + if (typeof(T) == typeof(Quaternion)) + { + if (Type == VariantType.Quaternion) + { + res = (T) (object) Quaternion; + return true; + } + } + + if (typeof(T) == typeof(Avalonia.Media.Color)) + { + if (Type == VariantType.Color) + { + res = (T) (object) Color; + return true; + } + } + + res = default(T); + return false; + } + + public static ExpressionVariant Create(T v) where T : struct + { + if (typeof(T) == typeof(bool)) + return (bool) (object) v; + + if (typeof(T) == typeof(float)) + return (float) (object) v; + + if (typeof(T) == typeof(Vector2)) + return (Vector2) (object) v; + + if (typeof(T) == typeof(Vector3)) + return (Vector3) (object) v; + + if (typeof(T) == typeof(Vector4)) + return (Vector4) (object) v; + + if (typeof(T) == typeof(Matrix3x2)) + return (Matrix3x2) (object) v; + + if (typeof(T) == typeof(Matrix)) + return (Matrix) (object) v; + + if (typeof(T) == typeof(Matrix4x4)) + return (Matrix4x4) (object) v; + + if (typeof(T) == typeof(Quaternion)) + return (Quaternion) (object) v; + + if (typeof(T) == typeof(Avalonia.Media.Color)) + return (Avalonia.Media.Color) (object) v; + + throw new ArgumentException("Invalid variant type: " + typeof(T)); + } + + public T CastOrDefault() where T : struct + { + TryCast(out var r); + return r; + } + + public override string ToString() + { + if (Type == VariantType.Boolean) + return Boolean.ToString(); + if (Type == VariantType.Scalar) + return Scalar.ToString(CultureInfo.InvariantCulture); + if (Type == VariantType.Double) + return Double.ToString(CultureInfo.InvariantCulture); + if (Type == VariantType.Vector2) + return Vector2.ToString(); + if (Type == VariantType.Vector3) + return Vector3.ToString(); + if (Type == VariantType.Vector4) + return Vector4.ToString(); + if (Type == VariantType.Quaternion) + return Quaternion.ToString(); + if (Type == VariantType.Matrix3x2) + return Matrix3x2.ToString(); + if (Type == VariantType.AvaloniaMatrix) + return AvaloniaMatrix.ToString(); + if (Type == VariantType.Matrix4x4) + return Matrix4x4.ToString(); + if (Type == VariantType.Color) + return Color.ToString(); + if (Type == VariantType.Invalid) + return "Invalid"; + return "Unknown"; + } + } + +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Expressions/TokenParser.cs b/src/Avalonia.Base/Rendering/Composition/Expressions/TokenParser.cs new file mode 100644 index 0000000000..27782c8c2c --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Expressions/TokenParser.cs @@ -0,0 +1,259 @@ +using System; +using System.Globalization; + +namespace Avalonia.Rendering.Composition.Expressions +{ + /// + /// Helper class for composition expression parser + /// + internal ref struct TokenParser + { + private ReadOnlySpan _s; + public int Position { get; private set; } + public TokenParser(ReadOnlySpan s) + { + _s = s; + Position = 0; + } + + public void SkipWhitespace() + { + while (true) + { + if (_s.Length > 0 && char.IsWhiteSpace(_s[0])) + Advance(1); + else + return; + } + } + + static bool IsAlphaNumeric(char ch) => (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || + (ch >= 'A' && ch <= 'Z'); + + public bool TryConsume(char c) + { + SkipWhitespace(); + if (_s.Length == 0 || _s[0] != c) + return false; + + Advance(1); + return true; + } + public bool TryConsume(string s) + { + SkipWhitespace(); + if (_s.Length < s.Length) + return false; + for (var c = 0; c < s.Length; c++) + { + if (_s[c] != s[c]) + return false; + } + + Advance(s.Length); + return true; + } + + public bool TryConsumeAny(ReadOnlySpan chars, out char token) + { + SkipWhitespace(); + token = default; + if (_s.Length == 0) + return false; + + foreach (var c in chars) + { + if (c == _s[0]) + { + token = c; + Advance(1); + return true; + } + } + + return false; + } + + + public bool TryParseKeyword(string keyword) + { + SkipWhitespace(); + if (keyword.Length > _s.Length) + return false; + for(var c=0; c keyword.Length && IsAlphaNumeric(_s[keyword.Length])) + return false; + + Advance(keyword.Length); + return true; + } + + public bool TryParseKeywordLowerCase(string keywordInLowerCase) + { + SkipWhitespace(); + if (keywordInLowerCase.Length > _s.Length) + return false; + for(var c=0; c keywordInLowerCase.Length && IsAlphaNumeric(_s[keywordInLowerCase.Length])) + return false; + + Advance(keywordInLowerCase.Length); + return true; + } + + public void Advance(int c) + { + _s = _s.Slice(c); + Position += c; + } + + public int Length => _s.Length; + + public bool TryParseIdentifier(ReadOnlySpan extraValidChars, out ReadOnlySpan res) + { + res = ReadOnlySpan.Empty; + SkipWhitespace(); + if (_s.Length == 0) + return false; + var first = _s[0]; + if (!((first >= 'a' && first <= 'z') || (first >= 'A' && first <= 'Z'))) + return false; + int len = 1; + for (var c = 1; c < _s.Length; c++) + { + var ch = _s[c]; + if (IsAlphaNumeric(ch)) + len++; + else + { + var found = false; + foreach(var vc in extraValidChars) + if (vc == ch) + { + found = true; + break; + } + + if (found) + len++; + else + break; + } + } + + res = _s.Slice(0, len); + Advance(len); + return true; + } + + public bool TryParseIdentifier(out ReadOnlySpan res) + { + res = ReadOnlySpan.Empty; + SkipWhitespace(); + if (_s.Length == 0) + return false; + var first = _s[0]; + if (!((first >= 'a' && first <= 'z') || (first >= 'A' && first <= 'Z'))) + return false; + int len = 1; + for (var c = 1; c < _s.Length; c++) + { + var ch = _s[c]; + if (IsAlphaNumeric(ch)) + len++; + else + break; + } + + res = _s.Slice(0, len); + Advance(len); + return true; + } + + public bool TryParseCall(out ReadOnlySpan res) + { + res = ReadOnlySpan.Empty; + SkipWhitespace(); + if (_s.Length == 0) + return false; + var first = _s[0]; + if (!((first >= 'a' && first <= 'z') || (first >= 'A' && first <= 'Z'))) + return false; + int len = 1; + for (var c = 1; c < _s.Length; c++) + { + var ch = _s[c]; + if ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch<= 'Z') || ch == '.') + len++; + else + break; + } + + res = _s.Slice(0, len); + + // Find '(' + for (var c = len; c < _s.Length; c++) + { + if(char.IsWhiteSpace(_s[c])) + continue; + if(_s[c]=='(') + { + Advance(c + 1); + return true; + } + + return false; + + } + + return false; + + } + + + public bool TryParseFloat(out float res) + { + res = 0; + SkipWhitespace(); + if (_s.Length == 0) + return false; + + var len = 0; + var dotCount = 0; + for (var c = 0; c < _s.Length; c++) + { + var ch = _s[c]; + if (ch >= '0' && ch <= '9') + len = c + 1; + else if (ch == '.' && dotCount == 0) + { + len = c + 1; + dotCount++; + } + else + break; + } + + var span = _s.Slice(0, len); + +#if NETSTANDARD2_0 + if (!float.TryParse(span.ToString(), NumberStyles.Number, CultureInfo.InvariantCulture, out res)) + return false; +#else + if (!float.TryParse(span, NumberStyles.Number, CultureInfo.InvariantCulture, out res)) + return false; +#endif + Advance(len); + return true; + } + + public override string ToString() => _s.ToString(); + + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/ICompositionTargetDebugEvents.cs b/src/Avalonia.Base/Rendering/Composition/ICompositionTargetDebugEvents.cs new file mode 100644 index 0000000000..045a4f8cc6 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/ICompositionTargetDebugEvents.cs @@ -0,0 +1,6 @@ +namespace Avalonia.Rendering.Composition; + +internal interface ICompositionTargetDebugEvents +{ + void RectInvalidated(Rect rc); +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/MatrixUtils.cs b/src/Avalonia.Base/Rendering/Composition/MatrixUtils.cs new file mode 100644 index 0000000000..2cb500cae4 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/MatrixUtils.cs @@ -0,0 +1,66 @@ +using System.Numerics; + +namespace Avalonia.Rendering.Composition +{ + static class MatrixUtils + { + public static Matrix4x4 ComputeTransform(Vector2 size, Vector2 anchorPoint, Vector3 centerPoint, + Matrix4x4 transformMatrix, Vector3 scale, float rotationAngle, Quaternion orientation, Vector3 offset) + { + // The math here follows the *observed* UWP behavior since there are no docs on how it's supposed to work + + var anchor = size * anchorPoint; + var mat = Matrix4x4.CreateTranslation(-anchor.X, -anchor.Y, 0); + + var center = new Vector3(centerPoint.X, centerPoint.Y, centerPoint.Z); + + if (!transformMatrix.IsIdentity) + mat = transformMatrix * mat; + + + if (scale != new Vector3(1, 1, 1)) + mat *= Matrix4x4.CreateScale(scale, center); + + //TODO: RotationAxis support + if (rotationAngle != 0) + mat *= Matrix4x4.CreateRotationZ(rotationAngle, center); + + if (orientation != Quaternion.Identity) + { + if (centerPoint != default) + { + mat *= Matrix4x4.CreateTranslation(-center) + * Matrix4x4.CreateFromQuaternion(orientation) + * Matrix4x4.CreateTranslation(center); + } + else + mat *= Matrix4x4.CreateFromQuaternion(orientation); + } + + if (offset != default) + mat *= Matrix4x4.CreateTranslation(offset); + + return mat; + } + + public static Matrix4x4 ToMatrix4x4(Matrix matrix) => + new Matrix4x4( + (float)matrix.M11, (float)matrix.M12, 0, (float)matrix.M13, + (float)matrix.M21, (float)matrix.M22, 0, (float)matrix.M23, + 0, 0, 1, 0, + (float)matrix.M31, (float)matrix.M32, 0, (float)matrix.M33 + ); + + public static Matrix ToMatrix(Matrix4x4 matrix44) => + new Matrix( + matrix44.M11, + matrix44.M12, + matrix44.M14, + matrix44.M21, + matrix44.M22, + matrix44.M24, + matrix44.M41, + matrix44.M42, + matrix44.M44); + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Server/CompositionProperty.cs b/src/Avalonia.Base/Rendering/Composition/Server/CompositionProperty.cs new file mode 100644 index 0000000000..282c0e113d --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Server/CompositionProperty.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Threading; + +namespace Avalonia.Rendering.Composition.Server; + +internal class CompositionProperty +{ + private static volatile int s_NextId = 1; + public int Id { get; private set; } + + public static CompositionProperty Register() => new() + { + Id = Interlocked.Increment(ref s_NextId) + }; +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Server/DrawingContextProxy.cs b/src/Avalonia.Base/Rendering/Composition/Server/DrawingContextProxy.cs new file mode 100644 index 0000000000..e261507f60 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Server/DrawingContextProxy.cs @@ -0,0 +1,179 @@ +using System.Numerics; +using Avalonia.Media; +using Avalonia.Media.Imaging; +using Avalonia.Platform; +using Avalonia.Rendering.Composition.Drawing; +using Avalonia.Rendering.SceneGraph; +using Avalonia.Utilities; + +namespace Avalonia.Rendering.Composition.Server; + +/// +/// A bunch of hacks to make the existing rendering operations and IDrawingContext +/// to work with composition rendering infrastructure. +/// 1) Keeps and applies the transform of the current visual since drawing operations think that +/// they have information about the full render transform (they are not) +/// 2) Keeps the draw list for the VisualBrush contents of the current drawing operation. +/// +internal class CompositorDrawingContextProxy : IDrawingContextImpl, IDrawingContextWithAcrylicLikeSupport +{ + private IDrawingContextImpl _impl; + private readonly VisualBrushRenderer _visualBrushRenderer; + + public CompositorDrawingContextProxy(IDrawingContextImpl impl, VisualBrushRenderer visualBrushRenderer) + { + _impl = impl; + _visualBrushRenderer = visualBrushRenderer; + } + + // This is a hack to make it work with the current way of handling visual brushes + public CompositionDrawList? VisualBrushDrawList + { + get => _visualBrushRenderer.VisualBrushDrawList; + set => _visualBrushRenderer.VisualBrushDrawList = value; + } + + public Matrix PostTransform { get; set; } = Matrix.Identity; + + public void Dispose() + { + _impl.Dispose(); + } + + Matrix _transform; + public Matrix Transform + { + get => _transform; + set => _impl.Transform = (_transform = value) * PostTransform; + } + + public void Clear(Color color) + { + _impl.Clear(color); + } + + public void DrawBitmap(IRef source, double opacity, Rect sourceRect, Rect destRect, + BitmapInterpolationMode bitmapInterpolationMode = BitmapInterpolationMode.Default) + { + _impl.DrawBitmap(source, opacity, sourceRect, destRect, bitmapInterpolationMode); + } + + public void DrawBitmap(IRef source, IBrush opacityMask, Rect opacityMaskRect, Rect destRect) + { + _impl.DrawBitmap(source, opacityMask, opacityMaskRect, destRect); + } + + public void DrawLine(IPen pen, Point p1, Point p2) + { + _impl.DrawLine(pen, p1, p2); + } + + public void DrawGeometry(IBrush? brush, IPen? pen, IGeometryImpl geometry) + { + _impl.DrawGeometry(brush, pen, geometry); + } + + public void DrawRectangle(IBrush? brush, IPen? pen, RoundedRect rect, BoxShadows boxShadows = default) + { + _impl.DrawRectangle(brush, pen, rect, boxShadows); + } + + public void DrawEllipse(IBrush? brush, IPen? pen, Rect rect) + { + _impl.DrawEllipse(brush, pen, rect); + } + + public void DrawGlyphRun(IBrush foreground, GlyphRun glyphRun) + { + _impl.DrawGlyphRun(foreground, glyphRun); + } + + public IDrawingContextLayerImpl CreateLayer(Size size) + { + return _impl.CreateLayer(size); + } + + public void PushClip(Rect clip) + { + _impl.PushClip(clip); + } + + public void PushClip(RoundedRect clip) + { + _impl.PushClip(clip); + } + + public void PopClip() + { + _impl.PopClip(); + } + + public void PushOpacity(double opacity) + { + _impl.PushOpacity(opacity); + } + + public void PopOpacity() + { + _impl.PopOpacity(); + } + + public void PushOpacityMask(IBrush mask, Rect bounds) + { + _impl.PushOpacityMask(mask, bounds); + } + + public void PopOpacityMask() + { + _impl.PopOpacityMask(); + } + + public void PushGeometryClip(IGeometryImpl clip) + { + _impl.PushGeometryClip(clip); + } + + public void PopGeometryClip() + { + _impl.PopGeometryClip(); + } + + public void PushBitmapBlendMode(BitmapBlendingMode blendingMode) + { + _impl.PushBitmapBlendMode(blendingMode); + } + + public void PopBitmapBlendMode() + { + _impl.PopBitmapBlendMode(); + } + + public void Custom(ICustomDrawOperation custom) + { + _impl.Custom(custom); + } + + public class VisualBrushRenderer : IVisualBrushRenderer + { + public CompositionDrawList? VisualBrushDrawList { get; set; } + public Size GetRenderTargetSize(IVisualBrush brush) + { + return VisualBrushDrawList?.Size ?? Size.Empty; + } + + public void RenderVisualBrush(IDrawingContextImpl context, IVisualBrush brush) + { + if (VisualBrushDrawList != null) + { + foreach (var cmd in VisualBrushDrawList) + cmd.Item.Render(context); + } + } + } + + public void DrawRectangle(IExperimentalAcrylicMaterial material, RoundedRect rect) + { + if (_impl is IDrawingContextWithAcrylicLikeSupport acrylic) + acrylic.DrawRectangle(material, rect); + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Server/FpsCounter.cs b/src/Avalonia.Base/Rendering/Composition/Server/FpsCounter.cs new file mode 100644 index 0000000000..7585710540 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Server/FpsCounter.cs @@ -0,0 +1,76 @@ +using System; +using System.Diagnostics; +using System.Globalization; +using Avalonia.Media; +using Avalonia.Media.TextFormatting; +using Avalonia.Platform; +using Avalonia.Utilities; + +namespace Avalonia.Rendering.Composition.Server; + +/// +/// An FPS counter helper that can draw itself on the render thread +/// +internal class FpsCounter +{ + private readonly Stopwatch _stopwatch = Stopwatch.StartNew(); + private int _framesThisSecond; + private int _totalFrames; + private int _fps; + private TimeSpan _lastFpsUpdate; + const int FirstChar = 32; + const int LastChar = 126; + // ASCII chars + private GlyphRun[] _runs = new GlyphRun[LastChar - FirstChar + 1]; + + public FpsCounter(GlyphTypeface typeface) + { + for (var c = FirstChar; c <= LastChar; c++) + { + var s = new string((char)c, 1); + var glyph = typeface.GetGlyph((uint)(s[0])); + _runs[c - FirstChar] = new GlyphRun(typeface, 18, new ReadOnlySlice(s.AsMemory()), new ushort[] { glyph }); + } + } + + public void FpsTick() => _framesThisSecond++; + + public void RenderFps(IDrawingContextImpl context, string aux) + { + var now = _stopwatch.Elapsed; + var elapsed = now - _lastFpsUpdate; + + ++_framesThisSecond; + ++_totalFrames; + + if (elapsed.TotalSeconds > 1) + { + _fps = (int)(_framesThisSecond / elapsed.TotalSeconds); + _framesThisSecond = 0; + _lastFpsUpdate = now; + } + + var fpsLine = $"Frame #{_totalFrames:00000000} FPS: {_fps:000} " + aux; + double width = 0; + double height = 0; + foreach (var ch in fpsLine) + { + var run = _runs[ch - FirstChar]; + width += run.Size.Width; + height = Math.Max(height, run.Size.Height); + } + + var rect = new Rect(0, 0, width + 3, height + 3); + + context.DrawRectangle(Brushes.Black, null, rect); + + double offset = 0; + foreach (var ch in fpsLine) + { + var run = _runs[ch - FirstChar]; + context.Transform = Matrix.CreateTranslation(offset, 0); + context.DrawGlyphRun(Brushes.White, run); + offset += run.Size.Width; + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ReadbackIndices.cs b/src/Avalonia.Base/Rendering/Composition/Server/ReadbackIndices.cs new file mode 100644 index 0000000000..c9592b70ab --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Server/ReadbackIndices.cs @@ -0,0 +1,46 @@ +namespace Avalonia.Rendering.Composition.Server +{ + /// + /// A helper class used to manage the current slots for writing data from the render thread + /// and reading it from the UI thread. + /// Used mostly by hit-testing which needs to know the last transform of the visual + /// + internal class ReadbackIndices + { + private readonly object _lock = new object(); + public int ReadIndex { get; private set; } = 0; + public int WriteIndex { get; private set; } = 1; + public int WrittenIndex { get; private set; } = 0; + public ulong ReadRevision { get; private set; } + public ulong LastWrittenRevision { get; private set; } + + public void NextRead() + { + lock (_lock) + { + if (ReadRevision < LastWrittenRevision) + { + ReadIndex = WrittenIndex; + ReadRevision = LastWrittenRevision; + } + } + } + + public void CompleteWrite(ulong writtenRevision) + { + lock (_lock) + { + for (var c = 0; c < 3; c++) + { + if (c != WriteIndex && c != ReadIndex) + { + WrittenIndex = WriteIndex; + LastWrittenRevision = writtenRevision; + WriteIndex = c; + return; + } + } + } + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionContainerVisual.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionContainerVisual.cs new file mode 100644 index 0000000000..f7152293cc --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionContainerVisual.cs @@ -0,0 +1,44 @@ +using System.Numerics; +using Avalonia.Platform; + +namespace Avalonia.Rendering.Composition.Server +{ + /// + /// Server-side counterpart of . + /// Mostly propagates update and render calls, but is also responsible + /// for updating adorners in deferred manner + /// + internal partial class ServerCompositionContainerVisual : ServerCompositionVisual + { + public ServerCompositionVisualCollection Children { get; private set; } = null!; + + protected override void RenderCore(CompositorDrawingContextProxy canvas, Rect currentTransformedClip) + { + base.RenderCore(canvas, currentTransformedClip); + + foreach (var ch in Children) + { + ch.Render(canvas, currentTransformedClip); + } + } + + public override void Update(ServerCompositionTarget root) + { + base.Update(root); + foreach (var child in Children) + { + if (child.AdornedVisual != null) + root.EnqueueAdornerUpdate(child); + else + child.Update(root); + } + + IsDirtyComposition = false; + } + + partial void Initialize() + { + Children = new ServerCompositionVisualCollection(Compositor); + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionDrawListVisual.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionDrawListVisual.cs new file mode 100644 index 0000000000..93a5226f83 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionDrawListVisual.cs @@ -0,0 +1,75 @@ +using System; +using System.Numerics; +using Avalonia.Collections.Pooled; +using Avalonia.Platform; +using Avalonia.Rendering.Composition.Drawing; +using Avalonia.Rendering.Composition.Transport; +using Avalonia.Rendering.SceneGraph; +using Avalonia.Utilities; + +namespace Avalonia.Rendering.Composition.Server; + +/// +/// Server-side counterpart of +/// +internal class ServerCompositionDrawListVisual : ServerCompositionContainerVisual +{ +#if DEBUG + // This is needed for debugging purposes so we could see inspect the associated visual from debugger + public readonly Visual UiVisual; +#endif + private CompositionDrawList? _renderCommands; + + public ServerCompositionDrawListVisual(ServerCompositor compositor, Visual v) : base(compositor) + { +#if DEBUG + UiVisual = v; +#endif + } + + Rect? _contentBounds; + + public override Rect OwnContentBounds + { + get + { + if (_contentBounds == null) + { + var rect = Rect.Empty; + if(_renderCommands!=null) + foreach (var cmd in _renderCommands) + rect = rect.Union(cmd.Item.Bounds); + _contentBounds = rect; + } + + return _contentBounds.Value; + } + } + + protected override void DeserializeChangesCore(BatchStreamReader reader, TimeSpan commitedAt) + { + if (reader.Read() == 1) + { + _renderCommands?.Dispose(); + _renderCommands = reader.ReadObject(); + _contentBounds = null; + } + base.DeserializeChangesCore(reader, commitedAt); + } + + protected override void RenderCore(CompositorDrawingContextProxy canvas, Rect currentTransformedClip) + { + if (_renderCommands != null) + { + _renderCommands.Render(canvas); + } + base.RenderCore(canvas, currentTransformedClip); + } + +#if DEBUG + public override string ToString() + { + return UiVisual.GetType().ToString(); + } +#endif +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionSurface.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionSurface.cs new file mode 100644 index 0000000000..462a193a86 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionSurface.cs @@ -0,0 +1,9 @@ +namespace Avalonia.Rendering.Composition.Server +{ + internal abstract class ServerCompositionSurface : ServerObject + { + protected ServerCompositionSurface(ServerCompositor compositor) : base(compositor) + { + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionTarget.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionTarget.cs new file mode 100644 index 0000000000..882b66bf70 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionTarget.cs @@ -0,0 +1,221 @@ +using System; +using System.Collections.Generic; +using System.Numerics; +using System.Threading; +using Avalonia.Media; +using Avalonia.Media.Imaging; +using Avalonia.Media.Immutable; +using Avalonia.Platform; +using Avalonia.Rendering.Composition.Transport; +using Avalonia.Utilities; + +namespace Avalonia.Rendering.Composition.Server +{ + /// + /// Server-side counterpart of the + /// That's the place where we update visual transforms, track dirty rects and actually do rendering + /// + internal partial class ServerCompositionTarget : IDisposable + { + private readonly ServerCompositor _compositor; + private readonly Func _renderTargetFactory; + private static long s_nextId = 1; + public long Id { get; } + public ulong Revision { get; private set; } + private IRenderTarget? _renderTarget; + private FpsCounter _fpsCounter = new FpsCounter(Typeface.Default.GlyphTypeface); + private Rect _dirtyRect; + private Random _random = new(); + private Size _layerSize; + private IDrawingContextLayerImpl? _layer; + private bool _redrawRequested; + private bool _disposed; + private HashSet _attachedVisuals = new(); + private Queue _adornerUpdateQueue = new(); + + public ICompositionTargetDebugEvents? DebugEvents { get; set; } + public ReadbackIndices Readback { get; } = new(); + public int RenderedVisuals { get; set; } + + public ServerCompositionTarget(ServerCompositor compositor, Func renderTargetFactory) : + base(compositor) + { + _compositor = compositor; + _renderTargetFactory = renderTargetFactory; + Id = Interlocked.Increment(ref s_nextId); + } + + partial void OnIsEnabledChanged() + { + if (IsEnabled) + { + _compositor.AddCompositionTarget(this); + foreach (var v in _attachedVisuals) + v.Activate(); + } + else + { + _compositor.RemoveCompositionTarget(this); + foreach (var v in _attachedVisuals) + v.Deactivate(); + } + } + + partial void DeserializeChangesExtra(BatchStreamReader c) + { + _redrawRequested = true; + } + + public void Render() + { + if (_disposed) + { + Compositor.RemoveCompositionTarget(this); + return; + } + + if (Root == null) + return; + _renderTarget ??= _renderTargetFactory(); + + Compositor.UpdateServerTime(); + + if(_dirtyRect.IsEmpty && !_redrawRequested) + return; + + Revision++; + + // Update happens in a separate phase to extend dirty rect if needed + Root.Update(this); + + while (_adornerUpdateQueue.Count > 0) + { + var adorner = _adornerUpdateQueue.Dequeue(); + adorner.Update(this); + } + + Readback.CompleteWrite(Revision); + + _redrawRequested = false; + using (var targetContext = _renderTarget.CreateDrawingContext(null)) + { + var layerSize = Size * Scaling; + if (layerSize != _layerSize || _layer == null) + { + _layer?.Dispose(); + _layer = null; + _layer = targetContext.CreateLayer(Size); + _layerSize = layerSize; + } + + if (!_dirtyRect.IsEmpty) + { + var visualBrushHelper = new CompositorDrawingContextProxy.VisualBrushRenderer(); + using (var context = _layer.CreateDrawingContext(visualBrushHelper)) + { + context.PushClip(_dirtyRect); + context.Clear(Colors.Transparent); + Root.Render(new CompositorDrawingContextProxy(context, visualBrushHelper), _dirtyRect); + context.PopClip(); + } + } + + targetContext.Clear(Colors.Transparent); + targetContext.Transform = Matrix.Identity; + if (_layer.CanBlit) + _layer.Blit(targetContext); + else + targetContext.DrawBitmap(RefCountable.CreateUnownedNotClonable(_layer), 1, + new Rect(_layerSize), + new Rect(Size), BitmapInterpolationMode.LowQuality); + + + if (DrawDirtyRects) + { + targetContext.DrawRectangle(new ImmutableSolidColorBrush( + new Color(30, (byte)_random.Next(255), (byte)_random.Next(255), + (byte)_random.Next(255))) + , null, _dirtyRect); + } + + if (DrawFps) + { + var nativeMem = ByteSizeHelper.ToString((ulong)( + (Compositor.BatchMemoryPool.CurrentUsage + Compositor.BatchMemoryPool.CurrentPool) * + Compositor.BatchMemoryPool.BufferSize), false); + var managedMem = ByteSizeHelper.ToString((ulong)( + (Compositor.BatchObjectPool.CurrentUsage + Compositor.BatchObjectPool.CurrentPool) * + Compositor.BatchObjectPool.ArraySize * + IntPtr.Size), false); + _fpsCounter.RenderFps(targetContext, $"M:{managedMem} / N:{nativeMem} R:{RenderedVisuals:0000}"); + } + RenderedVisuals = 0; + + _dirtyRect = Rect.Empty; + } + } + + public Rect SnapToDevicePixels(Rect rect) => SnapToDevicePixels(rect, Scaling); + + private static Rect SnapToDevicePixels(Rect rect, double scale) + { + return new Rect( + new Point( + Math.Floor(rect.X * scale) / scale, + Math.Floor(rect.Y * scale) / scale), + new Point( + Math.Ceiling(rect.Right * scale) / scale, + Math.Ceiling(rect.Bottom * scale) / scale)); + } + + public void AddDirtyRect(Rect rect) + { + if(rect.IsEmpty) + return; + var snapped = SnapToDevicePixels(rect, Scaling); + DebugEvents?.RectInvalidated(rect); + _dirtyRect = _dirtyRect.Union(snapped); + _redrawRequested = true; + } + + public void Invalidate() + { + _redrawRequested = true; + } + + public void Dispose() + { + if(_disposed) + return; + _disposed = true; + using (_compositor.GpuContext?.EnsureCurrent()) + { + if (_layer != null) + { + _layer.Dispose(); + _layer = null; + } + + _renderTarget?.Dispose(); + _renderTarget = null; + } + _compositor.RemoveCompositionTarget(this); + } + + public void AddVisual(ServerCompositionVisual visual) + { + if (_attachedVisuals.Add(visual) && IsEnabled) + visual.Activate(); + } + + public void RemoveVisual(ServerCompositionVisual visual) + { + if (_attachedVisuals.Remove(visual) && IsEnabled) + visual.Deactivate(); + if(visual.IsVisibleInFrame) + AddDirtyRect(visual.TransformedOwnContentBounds); + } + + public void EnqueueAdornerUpdate(ServerCompositionVisual visual) => _adornerUpdateQueue.Enqueue(visual); + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionVisual.DirtyProperties.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionVisual.DirtyProperties.cs new file mode 100644 index 0000000000..c5af74e2dd --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionVisual.DirtyProperties.cs @@ -0,0 +1,76 @@ +namespace Avalonia.Rendering.Composition.Server; + +partial class ServerCompositionVisual +{ + protected bool IsDirtyComposition; + private bool _combinedTransformDirty; + private bool _clipSizeDirty; + + private const CompositionVisualChangedFields CompositionFieldsMask + = CompositionVisualChangedFields.Opacity + | CompositionVisualChangedFields.OpacityAnimated + | CompositionVisualChangedFields.OpacityMaskBrush + | CompositionVisualChangedFields.Clip + | CompositionVisualChangedFields.ClipToBounds + | CompositionVisualChangedFields.ClipToBoundsAnimated + | CompositionVisualChangedFields.Size + | CompositionVisualChangedFields.SizeAnimated; + + private const CompositionVisualChangedFields CombinedTransformFieldsMask = + CompositionVisualChangedFields.Size + | CompositionVisualChangedFields.SizeAnimated + | CompositionVisualChangedFields.AnchorPoint + | CompositionVisualChangedFields.AnchorPointAnimated + | CompositionVisualChangedFields.CenterPoint + | CompositionVisualChangedFields.CenterPointAnimated + | CompositionVisualChangedFields.AdornedVisual + | CompositionVisualChangedFields.TransformMatrix + | CompositionVisualChangedFields.Scale + | CompositionVisualChangedFields.ScaleAnimated + | CompositionVisualChangedFields.RotationAngle + | CompositionVisualChangedFields.RotationAngleAnimated + | CompositionVisualChangedFields.Orientation + | CompositionVisualChangedFields.OrientationAnimated + | CompositionVisualChangedFields.Offset + | CompositionVisualChangedFields.OffsetAnimated; + + private const CompositionVisualChangedFields ClipSizeDirtyMask = + CompositionVisualChangedFields.Size + | CompositionVisualChangedFields.SizeAnimated + | CompositionVisualChangedFields.ClipToBounds + | CompositionVisualChangedFields.ClipToBoundsAnimated; + + partial void OnFieldsDeserialized(CompositionVisualChangedFields changed) + { + if ((changed & CompositionFieldsMask) != 0) + IsDirtyComposition = true; + if ((changed & CombinedTransformFieldsMask) != 0) + _combinedTransformDirty = true; + if ((changed & ClipSizeDirtyMask) != 0) + _clipSizeDirty = true; + } + + public override void NotifyAnimatedValueChanged(CompositionProperty offset) + { + base.NotifyAnimatedValueChanged(offset); + if (offset == s_IdOfClipToBoundsProperty + || offset == s_IdOfOpacityProperty + || offset == s_IdOfSizeProperty) + IsDirtyComposition = true; + + if (offset == s_IdOfSizeProperty + || offset == s_IdOfAnchorPointProperty + || offset == s_IdOfCenterPointProperty + || offset == s_IdOfAdornedVisualProperty + || offset == s_IdOfTransformMatrixProperty + || offset == s_IdOfScaleProperty + || offset == s_IdOfRotationAngleProperty + || offset == s_IdOfOrientationProperty + || offset == s_IdOfOffsetProperty) + _combinedTransformDirty = true; + + if (offset == s_IdOfClipToBoundsProperty + || offset == s_IdOfSizeProperty) + _clipSizeDirty = true; + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionVisual.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionVisual.cs new file mode 100644 index 0000000000..c0e487f209 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionVisual.cs @@ -0,0 +1,237 @@ +using System; +using System.Numerics; +using Avalonia.Media; +using Avalonia.Platform; +using Avalonia.Rendering.Composition.Animations; +using Avalonia.Rendering.Composition.Transport; +using Avalonia.Utilities; + +namespace Avalonia.Rendering.Composition.Server +{ + /// + /// Server-side counterpart. + /// Is responsible for computing the transformation matrix, for applying various visual + /// properties before calling visual-specific drawing code and for notifying the + /// for new dirty rects + /// + partial class ServerCompositionVisual : ServerObject + { + private bool _isDirtyForUpdate; + private Rect _oldOwnContentBounds; + private bool _isBackface; + private Rect? _transformedClipBounds; + private Rect _combinedTransformedClipBounds; + + protected virtual void RenderCore(CompositorDrawingContextProxy canvas, Rect currentTransformedClip) + { + + } + + public void Render(CompositorDrawingContextProxy canvas, Rect currentTransformedClip) + { + if(Visible == false || IsVisibleInFrame == false) + return; + if(Opacity == 0) + return; + + currentTransformedClip = currentTransformedClip.Intersect(_combinedTransformedClipBounds); + if(currentTransformedClip.IsEmpty) + return; + + Root!.RenderedVisuals++; + + var transform = GlobalTransformMatrix; + canvas.PostTransform = MatrixUtils.ToMatrix(transform); + canvas.Transform = Matrix.Identity; + if (Opacity != 1) + canvas.PushOpacity(Opacity); + var boundsRect = new Rect(new Size(Size.X, Size.Y)); + if(ClipToBounds) + canvas.PushClip(Root!.SnapToDevicePixels(boundsRect)); + if (Clip != null) + canvas.PushGeometryClip(Clip); + if(OpacityMaskBrush != null) + canvas.PushOpacityMask(OpacityMaskBrush, boundsRect); + + RenderCore(canvas, currentTransformedClip); + + // Hack to force invalidation of SKMatrix + canvas.PostTransform = MatrixUtils.ToMatrix(transform); + canvas.Transform = Matrix.Identity; + + if (OpacityMaskBrush != null) + canvas.PopOpacityMask(); + if (Clip != null) + canvas.PopGeometryClip(); + if (ClipToBounds) + canvas.PopClip(); + if(Opacity != 1) + canvas.PopOpacity(); + } + + private ReadbackData _readback0, _readback1, _readback2; + + /// + /// Obtains "readback" data - the data that is sent from the render thread to the UI thread + /// in non-blocking manner. Used mostly by hit-testing + /// + public ref ReadbackData GetReadback(int idx) + { + if (idx == 0) + return ref _readback0; + if (idx == 1) + return ref _readback1; + return ref _readback2; + } + + public Matrix4x4 CombinedTransformMatrix { get; private set; } = Matrix4x4.Identity; + public Matrix4x4 GlobalTransformMatrix { get; private set; } + + public virtual void Update(ServerCompositionTarget root) + { + if(Parent == null && Root == null) + return; + + var wasVisible = IsVisibleInFrame; + + // Calculate new parent-relative transform + if (_combinedTransformDirty) + { + CombinedTransformMatrix = MatrixUtils.ComputeTransform(Size, AnchorPoint, CenterPoint, + // HACK: Ignore RenderTransform set by the adorner layer + AdornedVisual != null ? Matrix4x4.Identity : TransformMatrix, + Scale, RotationAngle, Orientation, Offset); + _combinedTransformDirty = false; + } + + var parentTransform = (AdornedVisual ?? Parent)?.GlobalTransformMatrix ?? Matrix4x4.Identity; + + var newTransform = CombinedTransformMatrix * parentTransform; + + // Check if visual was moved and recalculate face orientation + var positionChanged = false; + if (GlobalTransformMatrix != newTransform) + { + _isBackface = Vector3.Transform( + new Vector3(0, 0, float.PositiveInfinity), GlobalTransformMatrix).Z <= 0; + positionChanged = true; + } + + var oldTransformedContentBounds = TransformedOwnContentBounds; + var oldCombinedTransformedClipBounds = _combinedTransformedClipBounds; + + if (_parent?.IsDirtyComposition == true) + { + IsDirtyComposition = true; + _isDirtyForUpdate = true; + } + + var invalidateOldBounds = _isDirtyForUpdate; + var invalidateNewBounds = _isDirtyForUpdate; + + GlobalTransformMatrix = newTransform; + + var ownBounds = OwnContentBounds; + if (ownBounds != _oldOwnContentBounds || positionChanged) + { + _oldOwnContentBounds = ownBounds; + if (ownBounds.IsEmpty) + TransformedOwnContentBounds = default; + else + TransformedOwnContentBounds = + ownBounds.TransformToAABB(MatrixUtils.ToMatrix(GlobalTransformMatrix)); + } + + if (_clipSizeDirty || positionChanged) + { + _transformedClipBounds = ClipToBounds + ? new Rect(new Size(Size.X, Size.Y)) + .TransformToAABB(MatrixUtils.ToMatrix(GlobalTransformMatrix)) + : null; + + _clipSizeDirty = false; + } + + _combinedTransformedClipBounds = Parent?._combinedTransformedClipBounds ?? new Rect(Root!.Size); + if (_transformedClipBounds != null) + _combinedTransformedClipBounds = _combinedTransformedClipBounds.Intersect(_transformedClipBounds.Value); + + EffectiveOpacity = Opacity * (Parent?.EffectiveOpacity ?? 1); + + IsVisibleInFrame = _parent?.IsVisibleInFrame != false && Visible && EffectiveOpacity > 0.04 && !_isBackface && + !_combinedTransformedClipBounds.IsEmpty; + + if (wasVisible != IsVisibleInFrame || positionChanged) + { + invalidateOldBounds |= wasVisible; + invalidateNewBounds |= IsVisibleInFrame; + } + + // Invalidate new bounds + if (invalidateNewBounds) + AddDirtyRect(TransformedOwnContentBounds.Intersect(_combinedTransformedClipBounds)); + + if (invalidateOldBounds) + AddDirtyRect(oldTransformedContentBounds.Intersect(oldCombinedTransformedClipBounds)); + + + _isDirtyForUpdate = false; + + // Update readback indices + var i = Root!.Readback; + ref var readback = ref GetReadback(i.WriteIndex); + readback.Revision = root.Revision; + readback.Matrix = GlobalTransformMatrix; + readback.TargetId = Root.Id; + readback.Visible = IsVisibleInFrame; + } + + void AddDirtyRect(Rect rc) + { + if(rc == Rect.Empty) + return; + Root?.AddDirtyRect(rc); + } + + /// + /// Data that can be read from the UI thread + /// + public struct ReadbackData + { + public Matrix4x4 Matrix; + public ulong Revision; + public long TargetId; + public bool Visible; + } + + partial void DeserializeChangesExtra(BatchStreamReader c) + { + ValuesInvalidated(); + } + + partial void OnRootChanging() + { + if (Root != null) + Root.RemoveVisual(this); + } + + partial void OnRootChanged() + { + if (Root != null) + Root.AddVisual(this); + } + + protected override void ValuesInvalidated() + { + _isDirtyForUpdate = true; + Root?.Invalidate(); + } + + public bool IsVisibleInFrame { get; set; } + public double EffectiveOpacity { get; set; } + public Rect TransformedOwnContentBounds { get; set; } + public virtual Rect OwnContentBounds => new Rect(0, 0, Size.X, Size.Y); + } + + +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositor.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositor.cs new file mode 100644 index 0000000000..564f792ebe --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositor.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using Avalonia.Platform; +using Avalonia.Rendering.Composition.Animations; +using Avalonia.Rendering.Composition.Expressions; +using Avalonia.Rendering.Composition.Transport; + +namespace Avalonia.Rendering.Composition.Server +{ + /// + /// Server-side counterpart of the . + /// 1) manages deserialization of changes received from the UI thread + /// 2) triggers animation ticks + /// 3) asks composition targets to render themselves + /// + internal class ServerCompositor : IRenderLoopTask + { + private readonly IRenderLoop _renderLoop; + private readonly Queue _batches = new Queue(); + public long LastBatchId { get; private set; } + public Stopwatch Clock { get; } = Stopwatch.StartNew(); + public TimeSpan ServerNow { get; private set; } + private List _activeTargets = new(); + private HashSet _activeAnimations = new(); + private List _animationsToUpdate = new(); + internal BatchStreamObjectPool BatchObjectPool; + internal BatchStreamMemoryPool BatchMemoryPool; + private object _lock = new object(); + public IPlatformGpuContext? GpuContext { get; } + + public ServerCompositor(IRenderLoop renderLoop, IPlatformGpu? platformGpu, + BatchStreamObjectPool batchObjectPool, BatchStreamMemoryPool batchMemoryPool) + { + GpuContext = platformGpu?.PrimaryContext; + _renderLoop = renderLoop; + BatchObjectPool = batchObjectPool; + BatchMemoryPool = batchMemoryPool; + _renderLoop.Add(this); + } + + public void EnqueueBatch(Batch batch) + { + lock (_batches) + _batches.Enqueue(batch); + } + + internal void UpdateServerTime() => ServerNow = Clock.Elapsed; + + List _reusableToCompleteList = new(); + void ApplyPendingBatches() + { + while (true) + { + Batch batch; + lock (_batches) + { + if(_batches.Count == 0) + break; + batch = _batches.Dequeue(); + } + + using (var stream = new BatchStreamReader(batch.Changes, BatchMemoryPool, BatchObjectPool)) + { + while (!stream.IsObjectEof) + { + var target = (ServerObject)stream.ReadObject()!; + target.DeserializeChanges(stream, batch); +#if DEBUG_COMPOSITOR_SERIALIZATION + if (stream.ReadObject() != BatchStreamDebugMarkers.ObjectEndMarker) + throw new InvalidOperationException( + $"Object {target.GetType()} failed to deserialize properly on object stream"); + if(stream.Read() != BatchStreamDebugMarkers.ObjectEndMagic) + throw new InvalidOperationException( + $"Object {target.GetType()} failed to deserialize properly on data stream"); +#endif + } + } + + _reusableToCompleteList.Add(batch); + LastBatchId = batch.SequenceId; + } + } + + void CompletePendingBatches() + { + foreach(var batch in _reusableToCompleteList) + batch.Complete(); + _reusableToCompleteList.Clear(); + } + + bool IRenderLoopTask.NeedsUpdate => false; + + void IRenderLoopTask.Update(TimeSpan time) + { + } + + public void Render() + { + lock (_lock) + { + RenderCore(); + } + } + + private void RenderCore() + { + ApplyPendingBatches(); + + foreach(var animation in _activeAnimations) + _animationsToUpdate.Add(animation); + + foreach(var animation in _animationsToUpdate) + animation.Invalidate(); + + _animationsToUpdate.Clear(); + + foreach (var t in _activeTargets) + t.Render(); + + CompletePendingBatches(); + } + + public void AddCompositionTarget(ServerCompositionTarget target) + { + _activeTargets.Add(target); + } + + public void RemoveCompositionTarget(ServerCompositionTarget target) + { + _activeTargets.Remove(target); + } + + public void AddToClock(IAnimationInstance animationInstance) => + _activeAnimations.Add(animationInstance); + + public void RemoveFromClock(IAnimationInstance animationInstance) => + _activeAnimations.Remove(animationInstance); + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerList.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerList.cs new file mode 100644 index 0000000000..39d6a8dc70 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerList.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using Avalonia.Rendering.Composition.Transport; + +namespace Avalonia.Rendering.Composition.Server +{ + /// + /// A server-side list container capable of receiving changes from the UI thread + /// Right now it's quite dumb since it always receives the full list + /// + class ServerList : ServerObject where T : ServerObject + { + public List List { get; } = new List(); + + protected override void DeserializeChangesCore(BatchStreamReader reader, TimeSpan commitedAt) + { + if (reader.Read() == 1) + { + List.Clear(); + var count = reader.Read(); + for (var c = 0; c < count; c++) + List.Add(reader.ReadObject()); + } + base.DeserializeChangesCore(reader, commitedAt); + } + + public override long LastChangedBy + { + get + { + var seq = base.LastChangedBy; + foreach (var i in List) + seq = Math.Max(i.LastChangedBy, seq); + return seq; + } + } + + public List.Enumerator GetEnumerator() => List.GetEnumerator(); + + public ServerList(ServerCompositor compositor) : base(compositor) + { + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerObject.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerObject.cs new file mode 100644 index 0000000000..93ea8e8dee --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerObject.cs @@ -0,0 +1,180 @@ +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using Avalonia.Rendering.Composition.Animations; +using Avalonia.Rendering.Composition.Expressions; +using Avalonia.Rendering.Composition.Transport; +using Avalonia.Utilities; + +namespace Avalonia.Rendering.Composition.Server +{ + /// + /// Server-side counterpart. + /// Is responsible for animation activation and invalidation + /// + internal abstract class ServerObject : IExpressionObject + { + public ServerCompositor Compositor { get; } + + public virtual long LastChangedBy => ItselfLastChangedBy; + public long ItselfLastChangedBy { get; private set; } + private uint _activationCount; + public bool IsActive => _activationCount != 0; + private InlineDictionary _subscriptions; + private InlineDictionary _animations; + + private class ServerObjectSubscriptionStore + { + public bool IsValid; + public RefTrackingDictionary? Subscribers; + + public void Invalidate() + { + if (IsValid) + return; + IsValid = false; + if (Subscribers != null) + foreach (var sub in Subscribers) + sub.Key.Invalidate(); + } + } + + public ServerObject(ServerCompositor compositor) + { + Compositor = compositor; + } + + public virtual ExpressionVariant GetPropertyForAnimation(string name) + { + return default; + } + + ExpressionVariant IExpressionObject.GetProperty(string name) => GetPropertyForAnimation(name); + + public void Activate() + { + _activationCount++; + if (_activationCount == 1) + Activated(); + } + + public void Deactivate() + { +#if DEBUG + if (_activationCount == 0) + throw new InvalidOperationException(); +#endif + _activationCount--; + if (_activationCount == 0) + Deactivated(); + } + + protected void Activated() + { + foreach(var kp in _animations) + kp.Value.Activate(); + } + + protected void Deactivated() + { + foreach(var kp in _animations) + kp.Value.Deactivate(); + } + + void InvalidateSubscriptions(CompositionProperty property) + { + if(_subscriptions.TryGetValue(property, out var subs)) + subs.Invalidate(); + } + + protected void SetValue(CompositionProperty prop, out T field, T value) + { + field = value; + InvalidateSubscriptions(prop); + } + + protected T GetValue(CompositionProperty prop, ref T field) + { + if (_subscriptions.TryGetValue(prop, out var subs)) + subs.IsValid = true; + return field; + } + + protected void SetAnimatedValue(CompositionProperty prop, ref T field, + TimeSpan commitedAt, IAnimationInstance animation) where T : struct + { + if (IsActive && _animations.TryGetValue(prop, out var oldAnimation)) + oldAnimation.Deactivate(); + _animations[prop] = animation; + + animation.Initialize(commitedAt, ExpressionVariant.Create(field), prop); + if(IsActive) + animation.Activate(); + + InvalidateSubscriptions(prop); + } + + protected void SetAnimatedValue(CompositionProperty property, out T field, T value) + { + if (_animations.TryGetAndRemoveValue(property, out var animation) && IsActive) + animation.Deactivate(); + field = value; + InvalidateSubscriptions(property); + } + + protected T GetAnimatedValue(CompositionProperty property, ref T field) where T : struct + { + if (_subscriptions.TryGetValue(property, out var subscriptions)) + subscriptions.IsValid = true; + + if (_animations.TryGetValue(property, out var animation)) + field = animation.Evaluate(Compositor.ServerNow, ExpressionVariant.Create(field)) + .CastOrDefault(); + + return field; + } + + public virtual void NotifyAnimatedValueChanged(CompositionProperty prop) + { + InvalidateSubscriptions(prop); + ValuesInvalidated(); + } + + protected virtual void ValuesInvalidated() + { + + } + + public void SubscribeToInvalidation(CompositionProperty member, IAnimationInstance animation) + { + if (!_subscriptions.TryGetValue(member, out var store)) + _subscriptions[member] = store = new ServerObjectSubscriptionStore(); + if (store.Subscribers == null) + store.Subscribers = new(); + store.Subscribers.AddRef(animation); + } + + public void UnsubscribeFromInvalidation(CompositionProperty member, IAnimationInstance animation) + { + if(_subscriptions.TryGetValue(member, out var store)) + store.Subscribers?.ReleaseRef(animation); + } + + public virtual CompositionProperty? GetCompositionProperty(string fieldName) => null; + + protected virtual void DeserializeChangesCore(BatchStreamReader reader, TimeSpan commitedAt) + { + if (this is IDisposable disp + && reader.Read() == 1) + disp.Dispose(); + } + + public void DeserializeChanges(BatchStreamReader reader, Batch batch) + { + DeserializeChangesCore(reader, batch.CommitedAt); + ValuesInvalidated(); + ItselfLastChangedBy = batch.SequenceId; + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Transport/Batch.cs b/src/Avalonia.Base/Rendering/Composition/Transport/Batch.cs new file mode 100644 index 0000000000..e69768d3bf --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Transport/Batch.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace Avalonia.Rendering.Composition.Transport +{ + /// + /// Represents a group of serialized changes from the UI thread to be atomically applied at the render thread + /// + internal class Batch + { + private static long _nextSequenceId = 1; + private static ConcurrentBag _pool = new(); + public long SequenceId { get; } + + public Batch() + { + SequenceId = Interlocked.Increment(ref _nextSequenceId); + if (!_pool.TryTake(out var lst)) + lst = new BatchStreamData(); + Changes = lst; + } + private TaskCompletionSource _tcs = new TaskCompletionSource(); + public BatchStreamData Changes { get; private set; } + public TimeSpan CommitedAt { get; set; } + + public void Complete() + { + _pool.Add(Changes); + Changes = null!; + + _tcs.TrySetResult(0); + } + + public Task Completed => _tcs.Task; + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Transport/BatchStream.cs b/src/Avalonia.Base/Rendering/Composition/Transport/BatchStream.cs new file mode 100644 index 0000000000..6db480a966 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Transport/BatchStream.cs @@ -0,0 +1,184 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; +using Avalonia.Rendering.Composition.Animations; +using Avalonia.Rendering.Composition.Server; + +namespace Avalonia.Rendering.Composition.Transport; + +/// +/// The batch data is separated into 2 "streams": +/// - objects: CLR reference types that are references to either server-side or common objects +/// - structs: blittable types like int, Matrix, Color +/// Each "stream" consists of memory segments that are pooled +/// +internal class BatchStreamData +{ + public Queue> Objects { get; } = new(); + public Queue> Structs { get; } = new(); +} + +public struct BatchStreamSegment +{ + public TData Data { get; set; } + public int ElementCount { get; set; } +} + +internal class BatchStreamWriter : IDisposable +{ + private readonly BatchStreamData _output; + private readonly BatchStreamMemoryPool _memoryPool; + private readonly BatchStreamObjectPool _objectPool; + + private BatchStreamSegment _currentObjectSegment; + private BatchStreamSegment _currentDataSegment; + + public BatchStreamWriter(BatchStreamData output, BatchStreamMemoryPool memoryPool, BatchStreamObjectPool objectPool) + { + _output = output; + _memoryPool = memoryPool; + _objectPool = objectPool; + } + + void CommitDataSegment() + { + if (_currentDataSegment.Data != IntPtr.Zero) + _output.Structs.Enqueue(_currentDataSegment); + _currentDataSegment = new (); + } + + void NextDataSegment() + { + CommitDataSegment(); + _currentDataSegment.Data = _memoryPool.Get(); + } + + void CommitObjectSegment() + { + if (_currentObjectSegment.Data != null) + _output.Objects.Enqueue(_currentObjectSegment!); + _currentObjectSegment = new(); + } + + void NextObjectSegment() + { + CommitObjectSegment(); + _currentObjectSegment.Data = _objectPool.Get(); + } + + public unsafe void Write(T item) where T : unmanaged + { + var size = Unsafe.SizeOf(); + if (_currentDataSegment.Data == IntPtr.Zero || _currentDataSegment.ElementCount + size > _memoryPool.BufferSize) + NextDataSegment(); + Unsafe.WriteUnaligned((byte*)_currentDataSegment.Data + _currentDataSegment.ElementCount, item); + _currentDataSegment.ElementCount += size; + } + + public void WriteObject(object? item) + { + if (_currentObjectSegment.Data == null || + _currentObjectSegment.ElementCount >= _currentObjectSegment.Data.Length) + NextObjectSegment(); + _currentObjectSegment.Data![_currentObjectSegment.ElementCount] = item; + _currentObjectSegment.ElementCount++; + } + + public void Dispose() + { + CommitDataSegment(); + CommitObjectSegment(); + } +} + +internal class BatchStreamReader : IDisposable +{ + private readonly BatchStreamData _input; + private readonly BatchStreamMemoryPool _memoryPool; + private readonly BatchStreamObjectPool _objectPool; + + private BatchStreamSegment _currentObjectSegment; + private BatchStreamSegment _currentDataSegment; + private int _memoryOffset, _objectOffset; + + public BatchStreamReader(BatchStreamData input, BatchStreamMemoryPool memoryPool, BatchStreamObjectPool objectPool) + { + _input = input; + _memoryPool = memoryPool; + _objectPool = objectPool; + } + + public unsafe T Read() where T : unmanaged + { + var size = Unsafe.SizeOf(); + if (_currentDataSegment.Data == IntPtr.Zero) + { + if (_input.Structs.Count == 0) + throw new EndOfStreamException(); + _currentDataSegment = _input.Structs.Dequeue(); + _memoryOffset = 0; + } + + if (_memoryOffset + size > _currentDataSegment.ElementCount) + throw new InvalidOperationException("Attempted to read more memory then left in the current segment"); + + var rv = Unsafe.ReadUnaligned((byte*)_currentDataSegment.Data + _memoryOffset); + _memoryOffset += size; + if (_memoryOffset == _currentDataSegment.ElementCount) + { + _memoryPool.Return(_currentDataSegment.Data); + _currentDataSegment = new(); + } + + return rv; + } + + public T ReadObject() where T : class? => (T)ReadObject()!; + + public object? ReadObject() + { + if (_currentObjectSegment.Data == null) + { + if (_input.Objects.Count == 0) + throw new EndOfStreamException(); + _currentObjectSegment = _input.Objects.Dequeue()!; + _objectOffset = 0; + } + + var rv = _currentObjectSegment.Data![_objectOffset]; + _objectOffset++; + if (_objectOffset == _currentObjectSegment.ElementCount) + { + _objectPool.Return(_currentObjectSegment.Data); + _currentObjectSegment = new(); + } + + return rv; + } + + public bool IsObjectEof => _currentObjectSegment.Data == null && _input.Objects.Count == 0; + + public bool IsStructEof => _currentDataSegment.Data == IntPtr.Zero && _input.Structs.Count == 0; + + public void Dispose() + { + if (_currentDataSegment.Data != IntPtr.Zero) + { + _memoryPool.Return(_currentDataSegment.Data); + _currentDataSegment = new(); + } + + while (_input.Structs.Count > 0) + _memoryPool.Return(_input.Structs.Dequeue().Data); + + if (_currentObjectSegment.Data != null) + { + _objectPool.Return(_currentObjectSegment.Data); + _currentObjectSegment = new(); + } + + while (_input.Objects.Count > 0) + _objectPool.Return(_input.Objects.Dequeue().Data); + } +} diff --git a/src/Avalonia.Base/Rendering/Composition/Transport/BatchStreamArrayPool.cs b/src/Avalonia.Base/Rendering/Composition/Transport/BatchStreamArrayPool.cs new file mode 100644 index 0000000000..b0a89c6f92 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Transport/BatchStreamArrayPool.cs @@ -0,0 +1,156 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using Avalonia.Platform; +using Avalonia.Threading; + +namespace Avalonia.Rendering.Composition.Transport; + +/// +/// A pool that keeps a number of elements that was used in the last 10 seconds +/// +internal abstract class BatchStreamPoolBase : IDisposable +{ + readonly Stack _pool = new(); + bool _disposed; + int _usage; + readonly int[] _usageStatistics = new int[10]; + int _usageStatisticsSlot; + bool _reclaimImmediately; + + public int CurrentUsage => _usage; + public int CurrentPool => _pool.Count; + + public BatchStreamPoolBase(bool needsFinalize, Action>? startTimer = null) + { + if(!needsFinalize) + GC.SuppressFinalize(needsFinalize); + + var updateRef = new WeakReference>(this); + if (AvaloniaLocator.Current.GetService() == null) + _reclaimImmediately = true; + else + StartUpdateTimer(startTimer, updateRef); + } + + static void StartUpdateTimer(Action>? startTimer, WeakReference> updateRef) + { + Func timerProc = () => + { + if (updateRef.TryGetTarget(out var target)) + { + target.UpdateStatistics(); + return true; + } + + return false; + }; + if (startTimer != null) + startTimer(timerProc); + else + DispatcherTimer.Run(timerProc, TimeSpan.FromSeconds(1)); + } + + private void UpdateStatistics() + { + lock (_pool) + { + var maximumUsage = _usageStatistics.Max(); + var recentlyUsedPooledSlots = maximumUsage - _usage; + var keepSlots = Math.Max(recentlyUsedPooledSlots, 10); + while (keepSlots < _pool.Count) + DestroyItem(_pool.Pop()); + + _usageStatisticsSlot = (_usageStatisticsSlot + 1) % _usageStatistics.Length; + _usageStatistics[_usageStatisticsSlot] = 0; + } + } + + protected abstract T CreateItem(); + + protected virtual void DestroyItem(T item) + { + + } + + public T Get() + { + lock (_pool) + { + _usage++; + if (_usageStatistics[_usageStatisticsSlot] < _usage) + _usageStatistics[_usageStatisticsSlot] = _usage; + + if (_pool.Count != 0) + return _pool.Pop(); + } + + return CreateItem(); + } + + public void Return(T item) + { + lock (_pool) + { + _usage--; + if (!_disposed && !_reclaimImmediately) + { + _pool.Push(item); + return; + } + } + + DestroyItem(item); + } + + public void Dispose() + { + lock (_pool) + { + _disposed = true; + foreach (var item in _pool) + DestroyItem(item); + _pool.Clear(); + } + } + + ~BatchStreamPoolBase() + { + Dispose(); + } +} + +internal sealed class BatchStreamObjectPool : BatchStreamPoolBase where T : class? +{ + public int ArraySize { get; } + + public BatchStreamObjectPool(int arraySize = 128, Action>? startTimer = null) : base(false, startTimer) + { + ArraySize = arraySize; + } + + protected override T[] CreateItem() + { + return new T[ArraySize]; + } + + protected override void DestroyItem(T[] item) + { + Array.Clear(item, 0, item.Length); + } +} + +internal sealed class BatchStreamMemoryPool : BatchStreamPoolBase +{ + public int BufferSize { get; } + + public BatchStreamMemoryPool(int bufferSize = 1024, Action>? startTimer = null) : base(true, startTimer) + { + BufferSize = bufferSize; + } + + protected override IntPtr CreateItem() => Marshal.AllocHGlobal(BufferSize); + + protected override void DestroyItem(IntPtr item) => Marshal.FreeHGlobal(item); +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Transport/BatchStreamDebugMarker.cs b/src/Avalonia.Base/Rendering/Composition/Transport/BatchStreamDebugMarker.cs new file mode 100644 index 0000000000..7d21b03f24 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Transport/BatchStreamDebugMarker.cs @@ -0,0 +1,9 @@ +using System; + +namespace Avalonia.Rendering.Composition.Transport; + +internal class BatchStreamDebugMarkers +{ + public static object ObjectEndMarker = new object(); + public static Guid ObjectEndMagic = Guid.NewGuid(); +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Transport/ServerListProxyHelper.cs b/src/Avalonia.Base/Rendering/Composition/Transport/ServerListProxyHelper.cs new file mode 100644 index 0000000000..e295c3c2c8 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Transport/ServerListProxyHelper.cs @@ -0,0 +1,98 @@ +using System.Collections; +using System.Collections.Generic; +using Avalonia.Rendering.Composition.Server; + +namespace Avalonia.Rendering.Composition.Transport +{ + /// + /// A helper class used from generated UI-thread-side collections of composition objects. + /// + // NOTE: This should probably be a base class since TServer isn't used anymore and it was the reason why + // it couldn't be exposed as a base class + class ServerListProxyHelper : IList + where TServer : ServerObject + where TClient : CompositionObject + { + private readonly IRegisterForSerialization _parent; + private bool _changed; + + public interface IRegisterForSerialization + { + void RegisterForSerialization(); + } + + public ServerListProxyHelper(IRegisterForSerialization parent) + { + _parent = parent; + } + + private readonly List _list = new List(); + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + public List.Enumerator GetEnumerator() => _list.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + + public void Add(TClient item) => Insert(_list.Count, item); + + public void Clear() + { + _list.Clear(); + _changed = true; + _parent.RegisterForSerialization(); + } + + public bool Contains(TClient item) => _list.Contains(item); + + public void CopyTo(TClient[] array, int arrayIndex) => _list.CopyTo(array, arrayIndex); + + public bool Remove(TClient item) + { + var idx = _list.IndexOf(item); + if (idx == -1) + return false; + RemoveAt(idx); + return true; + } + + public int Count => _list.Count; + public bool IsReadOnly => false; + public int IndexOf(TClient item) => _list.IndexOf(item); + + public void Insert(int index, TClient item) + { + _list.Insert(index, item); + _changed = true; + _parent.RegisterForSerialization(); + } + + public void RemoveAt(int index) + { + _list.RemoveAt(index); + _changed = true; + _parent.RegisterForSerialization(); + } + + public TClient this[int index] + { + get => _list[index]; + set + { + _list[index] = value; + _changed = true; + _parent.RegisterForSerialization(); + } + } + + public void Serialize(BatchStreamWriter writer) + { + writer.Write((byte)(_changed ? 1 : 0)); + if (_changed) + { + writer.Write(_list.Count); + foreach (var el in _list) + writer.WriteObject(el.Server); + } + _changed = false; + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/Visual.cs b/src/Avalonia.Base/Rendering/Composition/Visual.cs new file mode 100644 index 0000000000..7ebbb0aa96 --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/Visual.cs @@ -0,0 +1,56 @@ +using System; +using System.Numerics; +using Avalonia.Media; +using Avalonia.VisualTree; + +namespace Avalonia.Rendering.Composition +{ + /// + /// The base visual object in the composition visual hierarchy. + /// + public abstract partial class CompositionVisual + { + private IBrush? _opacityMask; + + private protected virtual void OnRootChangedCore() + { + } + + partial void OnRootChanged() => OnRootChangedCore(); + + partial void OnParentChanged() => Root = Parent?.Root; + + public IBrush? OpacityMask + { + get => _opacityMask; + set + { + if (_opacityMask == value) + return; + OpacityMaskBrush = (_opacityMask = value)?.ToImmutable(); + } + } + + internal Matrix4x4? TryGetServerGlobalTransform() + { + if (Root == null) + return null; + var i = Root.Server.Readback; + ref var readback = ref Server.GetReadback(i.ReadIndex); + + // CompositionVisual wasn't visible or wasn't even attached to the composition target during the lat frame + if (!readback.Visible || readback.Revision < i.ReadRevision) + return null; + + // CompositionVisual was reparented (potential race here) + if (readback.TargetId != Root.Server.Id) + return null; + + return readback.Matrix; + } + + internal object? Tag { get; set; } + + internal virtual bool HitTest(Point point, Func? filter) => true; + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/Composition/VisualCollection.cs b/src/Avalonia.Base/Rendering/Composition/VisualCollection.cs new file mode 100644 index 0000000000..60ebd9271c --- /dev/null +++ b/src/Avalonia.Base/Rendering/Composition/VisualCollection.cs @@ -0,0 +1,73 @@ +using System; +using Avalonia.Rendering.Composition.Server; + +namespace Avalonia.Rendering.Composition +{ + /// + /// A collection of CompositionVisual objects + /// + public partial class CompositionVisualCollection : CompositionObject + { + private CompositionVisual _owner; + internal CompositionVisualCollection(CompositionVisual parent, ServerCompositionVisualCollection server) : base(parent.Compositor, server) + { + _owner = parent; + InitializeDefaults(); + } + + public void InsertAbove(CompositionVisual newChild, CompositionVisual sibling) + { + var idx = _list.IndexOf(sibling); + if (idx == -1) + throw new InvalidOperationException(); + + Insert(idx + 1, newChild); + } + + public void InsertBelow(CompositionVisual newChild, CompositionVisual sibling) + { + var idx = _list.IndexOf(sibling); + if (idx == -1) + throw new InvalidOperationException(); + Insert(idx, newChild); + } + + public void InsertAtTop(CompositionVisual newChild) => Insert(_list.Count, newChild); + + public void InsertAtBottom(CompositionVisual newChild) => Insert(0, newChild); + + public void RemoveAll() => Clear(); + + partial void OnAdded(CompositionVisual item) => item.Parent = _owner; + + partial void OnBeforeReplace(CompositionVisual oldItem, CompositionVisual newItem) + { + if (oldItem != newItem) + OnBeforeAdded(newItem); + } + + partial void OnReplace(CompositionVisual oldItem, CompositionVisual newItem) + { + if (oldItem != newItem) + { + OnRemoved(oldItem); + OnAdded(newItem); + } + } + + partial void OnRemoved(CompositionVisual item) => item.Parent = null; + + partial void OnBeforeClear() + { + foreach (var i in this) + i.Parent = null; + } + + partial void OnBeforeAdded(CompositionVisual item) + { + if (item.Parent != null) + throw new InvalidOperationException("Visual already has a parent"); + item.Parent = item; + } + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Rendering/DefaultRenderTimer.cs b/src/Avalonia.Base/Rendering/DefaultRenderTimer.cs index 82d3892975..d0d3dd9715 100644 --- a/src/Avalonia.Base/Rendering/DefaultRenderTimer.cs +++ b/src/Avalonia.Base/Rendering/DefaultRenderTimer.cs @@ -59,6 +59,8 @@ namespace Avalonia.Rendering } } + public bool RunsInBackground => true; + /// /// Starts the timer. /// diff --git a/src/Avalonia.Base/Rendering/DeferredRenderer.cs b/src/Avalonia.Base/Rendering/DeferredRenderer.cs index 82be0a1a0f..4236763e3b 100644 --- a/src/Avalonia.Base/Rendering/DeferredRenderer.cs +++ b/src/Avalonia.Base/Rendering/DeferredRenderer.cs @@ -272,16 +272,18 @@ namespace Avalonia.Rendering } } + Scene? TryGetChildScene(IRef? op) => (op?.Item as BrushDrawOperation)?.Aux as Scene; + /// Size IVisualBrushRenderer.GetRenderTargetSize(IVisualBrush brush) { - return (_currentDraw?.Item as BrushDrawOperation)?.ChildScenes?[brush.Visual]?.Size ?? Size.Empty; + return TryGetChildScene(_currentDraw)?.Size ?? Size.Empty; } /// void IVisualBrushRenderer.RenderVisualBrush(IDrawingContextImpl context, IVisualBrush brush) { - var childScene = (_currentDraw?.Item as BrushDrawOperation)?.ChildScenes?[brush.Visual]; + var childScene = TryGetChildScene(_currentDraw); if (childScene != null) { diff --git a/src/Avalonia.Base/Rendering/IRenderLoop.cs b/src/Avalonia.Base/Rendering/IRenderLoop.cs index 9838967261..e500ecdf8b 100644 --- a/src/Avalonia.Base/Rendering/IRenderLoop.cs +++ b/src/Avalonia.Base/Rendering/IRenderLoop.cs @@ -27,5 +27,7 @@ namespace Avalonia.Rendering /// /// The update task. void Remove(IRenderLoopTask i); + + bool RunsInBackground { get; } } } diff --git a/src/Avalonia.Base/Rendering/IRenderTimer.cs b/src/Avalonia.Base/Rendering/IRenderTimer.cs index ee74c345be..07af7eeec8 100644 --- a/src/Avalonia.Base/Rendering/IRenderTimer.cs +++ b/src/Avalonia.Base/Rendering/IRenderTimer.cs @@ -18,5 +18,10 @@ namespace Avalonia.Rendering /// switch execution to the right thread. /// event Action Tick; + + /// + /// Indicates if the timer ticks on a non-UI thread + /// + bool RunsInBackground { get; } } } diff --git a/src/Avalonia.Base/Rendering/IRenderer.cs b/src/Avalonia.Base/Rendering/IRenderer.cs index e998f78d5c..8d6aabf440 100644 --- a/src/Avalonia.Base/Rendering/IRenderer.cs +++ b/src/Avalonia.Base/Rendering/IRenderer.cs @@ -1,6 +1,7 @@ using System; using Avalonia.VisualTree; using System.Collections.Generic; +using Avalonia.Rendering.Composition; namespace Avalonia.Rendering { @@ -87,4 +88,9 @@ namespace Avalonia.Rendering /// void Stop(); } + + public interface IRendererWithCompositor : IRenderer + { + Compositor Compositor { get; } + } } diff --git a/src/Avalonia.Base/Rendering/ImmediateRenderer.cs b/src/Avalonia.Base/Rendering/ImmediateRenderer.cs index 54b2ce5a25..79ef52586d 100644 --- a/src/Avalonia.Base/Rendering/ImmediateRenderer.cs +++ b/src/Avalonia.Base/Rendering/ImmediateRenderer.cs @@ -331,7 +331,11 @@ namespace Avalonia.Rendering if (_updateTransformedBounds) visual.TransformedBounds = transformed; - foreach (var child in visual.VisualChildren.OrderBy(x => x, ZIndexComparer.Instance)) + var childrenEnumerable = visual.HasNonUniformZIndexChildren + ? visual.VisualChildren.OrderBy(x => x, ZIndexComparer.Instance) + : (IEnumerable)visual.VisualChildren; + + foreach (var child in childrenEnumerable) { var childBounds = GetTransformedBounds(child); diff --git a/src/Avalonia.Base/Rendering/RenderLoop.cs b/src/Avalonia.Base/Rendering/RenderLoop.cs index a5d7e15f93..c66fec92aa 100644 --- a/src/Avalonia.Base/Rendering/RenderLoop.cs +++ b/src/Avalonia.Base/Rendering/RenderLoop.cs @@ -87,6 +87,8 @@ namespace Avalonia.Rendering } } + public bool RunsInBackground => Timer.RunsInBackground; + private void TimerTick(TimeSpan time) { if (Interlocked.CompareExchange(ref _inTick, 1, 0) == 0) diff --git a/src/Avalonia.Base/Rendering/SceneGraph/BrushDrawOperation.cs b/src/Avalonia.Base/Rendering/SceneGraph/BrushDrawOperation.cs index cd3dac699a..e81966ce81 100644 --- a/src/Avalonia.Base/Rendering/SceneGraph/BrushDrawOperation.cs +++ b/src/Avalonia.Base/Rendering/SceneGraph/BrushDrawOperation.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using Avalonia.Media; using Avalonia.VisualTree; @@ -9,14 +10,21 @@ namespace Avalonia.Rendering.SceneGraph /// internal abstract class BrushDrawOperation : DrawOperation { - public BrushDrawOperation(Rect bounds, Matrix transform) + public BrushDrawOperation(Rect bounds, Matrix transform, IDisposable? aux) : base(bounds, transform) { + Aux = aux; } /// - /// Gets a collection of child scenes that are needed to draw visual brushes. + /// Auxiliary data required to draw the brush /// - public abstract IDictionary? ChildScenes { get; } + public IDisposable? Aux { get; } + + public override void Dispose() + { + Aux?.Dispose(); + base.Dispose(); + } } } diff --git a/src/Avalonia.Base/Rendering/SceneGraph/DeferredDrawingContextImpl.cs b/src/Avalonia.Base/Rendering/SceneGraph/DeferredDrawingContextImpl.cs index 5225b85020..07082e4ac3 100644 --- a/src/Avalonia.Base/Rendering/SceneGraph/DeferredDrawingContextImpl.cs +++ b/src/Avalonia.Base/Rendering/SceneGraph/DeferredDrawingContextImpl.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Numerics; using Avalonia.Media; using Avalonia.Platform; using Avalonia.Utilities; @@ -456,7 +457,7 @@ namespace Avalonia.Rendering.SceneGraph return _drawOperationindex < _node!.DrawOperations.Count ? _node.DrawOperations[_drawOperationindex] as IRef : null; } - private IDictionary? CreateChildScene(IBrush? brush) + private IDisposable? CreateChildScene(IBrush? brush) { var visualBrush = brush as VisualBrush; @@ -469,7 +470,7 @@ namespace Avalonia.Rendering.SceneGraph (visual as IVisualBrushInitialize)?.EnsureInitialized(); var scene = new Scene(visual); _sceneBuilder.UpdateAll(scene); - return new Dictionary { { visualBrush.Visual, scene } }; + return scene; } } diff --git a/src/Avalonia.Base/Rendering/SceneGraph/EllipseNode.cs b/src/Avalonia.Base/Rendering/SceneGraph/EllipseNode.cs index c1fc6a81f6..4600653b9d 100644 --- a/src/Avalonia.Base/Rendering/SceneGraph/EllipseNode.cs +++ b/src/Avalonia.Base/Rendering/SceneGraph/EllipseNode.cs @@ -17,14 +17,13 @@ namespace Avalonia.Rendering.SceneGraph IBrush? brush, IPen? pen, Rect rect, - IDictionary? childScenes = null) - : base(rect.Inflate(pen?.Thickness ?? 0), transform) + IDisposable? aux = null) + : base(rect.Inflate(pen?.Thickness ?? 0), transform, aux) { Transform = transform; Brush = brush?.ToImmutable(); Pen = pen?.ToImmutable(); Rect = rect; - ChildScenes = childScenes; } /// @@ -47,8 +46,6 @@ namespace Avalonia.Rendering.SceneGraph /// public Rect Rect { get; } - public override IDictionary? ChildScenes { get; } - public bool Equals(Matrix transform, IBrush? brush, IPen? pen, Rect rect) { return transform == Transform && diff --git a/src/Avalonia.Base/Rendering/SceneGraph/GeometryNode.cs b/src/Avalonia.Base/Rendering/SceneGraph/GeometryNode.cs index 70748989d6..4b43f93aee 100644 --- a/src/Avalonia.Base/Rendering/SceneGraph/GeometryNode.cs +++ b/src/Avalonia.Base/Rendering/SceneGraph/GeometryNode.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using Avalonia.Media; using Avalonia.Media.Immutable; using Avalonia.Platform; @@ -23,14 +24,13 @@ namespace Avalonia.Rendering.SceneGraph IBrush? brush, IPen? pen, IGeometryImpl geometry, - IDictionary? childScenes = null) - : base(geometry.GetRenderBounds(pen).CalculateBoundsWithLineCaps(pen), transform) + IDisposable? aux) + : base(geometry.GetRenderBounds(pen).CalculateBoundsWithLineCaps(pen), transform, aux) { Transform = transform; Brush = brush?.ToImmutable(); Pen = pen?.ToImmutable(); Geometry = geometry; - ChildScenes = childScenes; } /// @@ -53,9 +53,6 @@ namespace Avalonia.Rendering.SceneGraph /// public IGeometryImpl Geometry { get; } - /// - public override IDictionary? ChildScenes { get; } - /// /// Determines if this draw operation equals another. /// diff --git a/src/Avalonia.Base/Rendering/SceneGraph/GlyphRunNode.cs b/src/Avalonia.Base/Rendering/SceneGraph/GlyphRunNode.cs index d6da087120..9199611ed6 100644 --- a/src/Avalonia.Base/Rendering/SceneGraph/GlyphRunNode.cs +++ b/src/Avalonia.Base/Rendering/SceneGraph/GlyphRunNode.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using Avalonia.Media; using Avalonia.Media.Immutable; @@ -23,13 +24,12 @@ namespace Avalonia.Rendering.SceneGraph Matrix transform, IBrush foreground, GlyphRun glyphRun, - IDictionary? childScenes = null) - : base(new Rect(glyphRun.Size), transform) + IDisposable? aux = null) + : base(new Rect(glyphRun.Size), transform, aux) { Transform = transform; Foreground = foreground.ToImmutable(); GlyphRun = glyphRun; - ChildScenes = childScenes; } /// @@ -47,9 +47,6 @@ namespace Avalonia.Rendering.SceneGraph /// public GlyphRun GlyphRun { get; } - /// - public override IDictionary? ChildScenes { get; } - /// public override void Render(IDrawingContextImpl context) { diff --git a/src/Avalonia.Base/Rendering/SceneGraph/LineNode.cs b/src/Avalonia.Base/Rendering/SceneGraph/LineNode.cs index a9e1ce8ed7..ee5ec0a5fc 100644 --- a/src/Avalonia.Base/Rendering/SceneGraph/LineNode.cs +++ b/src/Avalonia.Base/Rendering/SceneGraph/LineNode.cs @@ -25,14 +25,13 @@ namespace Avalonia.Rendering.SceneGraph IPen pen, Point p1, Point p2, - IDictionary? childScenes = null) - : base(LineBoundsHelper.CalculateBounds(p1, p2, pen), transform) + IDisposable? aux = null) + : base(LineBoundsHelper.CalculateBounds(p1, p2, pen), transform, aux) { Transform = transform; Pen = pen.ToImmutable(); P1 = p1; P2 = p2; - ChildScenes = childScenes; } /// @@ -55,9 +54,6 @@ namespace Avalonia.Rendering.SceneGraph /// public Point P2 { get; } - /// - public override IDictionary? ChildScenes { get; } - /// /// Determines if this draw operation equals another. /// diff --git a/src/Avalonia.Base/Rendering/SceneGraph/OpacityMaskNode.cs b/src/Avalonia.Base/Rendering/SceneGraph/OpacityMaskNode.cs index 4b6e7d2254..549c1fd7de 100644 --- a/src/Avalonia.Base/Rendering/SceneGraph/OpacityMaskNode.cs +++ b/src/Avalonia.Base/Rendering/SceneGraph/OpacityMaskNode.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using Avalonia.Media; using Avalonia.Platform; using Avalonia.VisualTree; @@ -17,12 +18,11 @@ namespace Avalonia.Rendering.SceneGraph /// The opacity mask to push. /// The bounds of the mask. /// Child scenes for drawing visual brushes. - public OpacityMaskNode(IBrush mask, Rect bounds, IDictionary? childScenes = null) - : base(Rect.Empty, Matrix.Identity) + public OpacityMaskNode(IBrush mask, Rect bounds, IDisposable? aux = null) + : base(Rect.Empty, Matrix.Identity, aux) { Mask = mask.ToImmutable(); MaskBounds = bounds; - ChildScenes = childScenes; } /// @@ -30,7 +30,7 @@ namespace Avalonia.Rendering.SceneGraph /// opacity mask pop. /// public OpacityMaskNode() - : base(Rect.Empty, Matrix.Identity) + : base(Rect.Empty, Matrix.Identity, null) { } @@ -44,8 +44,6 @@ namespace Avalonia.Rendering.SceneGraph /// public Rect? MaskBounds { get; } - /// - public override IDictionary? ChildScenes { get; } /// public override bool HitTest(Point p) => false; diff --git a/src/Avalonia.Base/Rendering/SceneGraph/RectangleNode.cs b/src/Avalonia.Base/Rendering/SceneGraph/RectangleNode.cs index 3279c3a549..7b79c446f9 100644 --- a/src/Avalonia.Base/Rendering/SceneGraph/RectangleNode.cs +++ b/src/Avalonia.Base/Rendering/SceneGraph/RectangleNode.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using Avalonia.Media; using Avalonia.Media.Immutable; using Avalonia.Platform; @@ -26,14 +27,13 @@ namespace Avalonia.Rendering.SceneGraph IPen? pen, RoundedRect rect, BoxShadows boxShadows, - IDictionary? childScenes = null) - : base(boxShadows.TransformBounds(rect.Rect).Inflate((pen?.Thickness ?? 0) / 2), transform) + IDisposable? aux = null) + : base(boxShadows.TransformBounds(rect.Rect).Inflate((pen?.Thickness ?? 0) / 2), transform, aux) { Transform = transform; Brush = brush?.ToImmutable(); Pen = pen?.ToImmutable(); Rect = rect; - ChildScenes = childScenes; BoxShadows = boxShadows; } @@ -62,9 +62,6 @@ namespace Avalonia.Rendering.SceneGraph /// public BoxShadows BoxShadows { get; } - /// - public override IDictionary? ChildScenes { get; } - /// /// Determines if this draw operation equals another. /// diff --git a/src/Avalonia.Base/Rendering/SceneGraph/SceneBuilder.cs b/src/Avalonia.Base/Rendering/SceneGraph/SceneBuilder.cs index e4d5a1ca68..0ceb44ed75 100644 --- a/src/Avalonia.Base/Rendering/SceneGraph/SceneBuilder.cs +++ b/src/Avalonia.Base/Rendering/SceneGraph/SceneBuilder.cs @@ -275,26 +275,36 @@ namespace Avalonia.Rendering.SceneGraph else if (visualChildren.Count > 1) { var count = visualChildren.Count; - var sortedChildren = new (IVisual visual, int index)[count]; - for (var i = 0; i < count; i++) + if (visual.HasNonUniformZIndexChildren) { - sortedChildren[i] = (visualChildren[i], i); - } - - // Regular Array.Sort is unstable, we need to provide indices as well to avoid reshuffling elements. - Array.Sort(sortedChildren, (lhs, rhs) => - { - var result = ZIndexComparer.Instance.Compare(lhs.visual, rhs.visual); - - return result == 0 ? lhs.index.CompareTo(rhs.index) : result; - }); - - foreach (var child in sortedChildren) - { - var childNode = GetOrCreateChildNode(scene, child.Item1, node); - Update(context, scene, (VisualNode)childNode, clip, forceRecurse); + var sortedChildren = new (IVisual visual, int index)[count]; + + for (var i = 0; i < count; i++) + { + sortedChildren[i] = (visualChildren[i], i); + } + + // Regular Array.Sort is unstable, we need to provide indices as well to avoid reshuffling elements. + Array.Sort(sortedChildren, (lhs, rhs) => + { + var result = ZIndexComparer.Instance.Compare(lhs.visual, rhs.visual); + + return result == 0 ? lhs.index.CompareTo(rhs.index) : result; + }); + + foreach (var child in sortedChildren) + { + var childNode = GetOrCreateChildNode(scene, child.Item1, node); + Update(context, scene, (VisualNode)childNode, clip, forceRecurse); + } } + else + foreach (var child in visualChildren) + { + var childNode = GetOrCreateChildNode(scene, child, node); + Update(context, scene, (VisualNode)childNode, clip, forceRecurse); + } } node.SubTreeUpdated = true; diff --git a/src/Avalonia.Base/Rendering/SleepLoopRenderTimer.cs b/src/Avalonia.Base/Rendering/SleepLoopRenderTimer.cs index 86595754e9..cd43a3ef20 100644 --- a/src/Avalonia.Base/Rendering/SleepLoopRenderTimer.cs +++ b/src/Avalonia.Base/Rendering/SleepLoopRenderTimer.cs @@ -43,6 +43,8 @@ namespace Avalonia.Rendering } } + public bool RunsInBackground => true; + void LoopProc() { var lastTick = _st.Elapsed; @@ -51,7 +53,7 @@ namespace Avalonia.Rendering var now = _st.Elapsed; var timeTillNextTick = lastTick + _timeBetweenTicks - now; if (timeTillNextTick.TotalMilliseconds > 1) Thread.Sleep(timeTillNextTick); - lastTick = now; + lastTick = now = _st.Elapsed; lock (_lock) { if (_count == 0) diff --git a/src/Avalonia.Base/Size.cs b/src/Avalonia.Base/Size.cs index 69c3ae7319..5f20206200 100644 --- a/src/Avalonia.Base/Size.cs +++ b/src/Avalonia.Base/Size.cs @@ -52,6 +52,17 @@ namespace Avalonia _width = width; _height = height; } + +#if !BUILDTASK + /// + /// Initializes a new instance of the structure. + /// + /// The vector to take values from. + public Size(System.Numerics.Vector2 vector2) : this(vector2.X, vector2.Y) + { + + } +#endif /// /// Gets the aspect ratio of the size. diff --git a/src/Avalonia.Base/Styling/Activators/StyleClassActivator.cs b/src/Avalonia.Base/Styling/Activators/StyleClassActivator.cs index 98d3f16a0a..3f70ff50b3 100644 --- a/src/Avalonia.Base/Styling/Activators/StyleClassActivator.cs +++ b/src/Avalonia.Base/Styling/Activators/StyleClassActivator.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Collections.Specialized; using Avalonia.Collections; +using Avalonia.Controls; #nullable enable @@ -10,21 +11,17 @@ namespace Avalonia.Styling.Activators /// An which is active when a set of classes match those on a /// control. /// - internal sealed class StyleClassActivator : StyleActivatorBase + internal sealed class StyleClassActivator : StyleActivatorBase, IClassesChangedListener { private readonly IList _match; - private readonly IAvaloniaReadOnlyList _classes; - private NotifyCollectionChangedEventHandler? _classesChangedHandler; + private readonly Classes _classes; - public StyleClassActivator(IAvaloniaReadOnlyList classes, IList match) + public StyleClassActivator(Classes classes, IList match) { _classes = classes; _match = match; } - private NotifyCollectionChangedEventHandler ClassesChangedHandler => - _classesChangedHandler ??= ClassesChanged; - public static bool AreClassesMatching(IReadOnlyList classes, IList toMatch) { int remainingMatches = toMatch.Count; @@ -55,23 +52,20 @@ namespace Avalonia.Styling.Activators return remainingMatches == 0; } - protected override void Initialize() + void IClassesChangedListener.Changed() { PublishNext(IsMatching()); - _classes.CollectionChanged += ClassesChangedHandler; } - protected override void Deinitialize() + protected override void Initialize() { - _classes.CollectionChanged -= ClassesChangedHandler; + PublishNext(IsMatching()); + _classes.AddListener(this); } - private void ClassesChanged(object? sender, NotifyCollectionChangedEventArgs e) + protected override void Deinitialize() { - if (e.Action != NotifyCollectionChangedAction.Move) - { - PublishNext(IsMatching()); - } + _classes.RemoveListener(this); } private bool IsMatching() => AreClassesMatching(_classes, _match); diff --git a/src/Avalonia.Base/Styling/TypeNameAndClassSelector.cs b/src/Avalonia.Base/Styling/TypeNameAndClassSelector.cs index 6681a7da36..94a6db41f6 100644 --- a/src/Avalonia.Base/Styling/TypeNameAndClassSelector.cs +++ b/src/Avalonia.Base/Styling/TypeNameAndClassSelector.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text; +using Avalonia.Controls; using Avalonia.Styling.Activators; #nullable enable @@ -125,7 +126,7 @@ namespace Avalonia.Styling { if (subscribe) { - var observable = new StyleClassActivator(control.Classes, _classes.Value); + var observable = new StyleClassActivator((Classes)control.Classes, _classes.Value); return new SelectorMatch(observable); } diff --git a/src/Avalonia.Base/Threading/DispatcherPriority.cs b/src/Avalonia.Base/Threading/DispatcherPriority.cs index a93e4f406d..b4bf603f74 100644 --- a/src/Avalonia.Base/Threading/DispatcherPriority.cs +++ b/src/Avalonia.Base/Threading/DispatcherPriority.cs @@ -62,10 +62,20 @@ namespace Avalonia.Threading /// public static readonly DispatcherPriority Render = new(5); + /// + /// The job will be processed with the same priority as composition batch commit. + /// + public static readonly DispatcherPriority CompositionBatch = new(6); + + /// + /// The job will be processed with the same priority as composition updates. + /// + public static readonly DispatcherPriority Composition = new(7); + /// /// The job will be processed with the same priority as render. /// - public static readonly DispatcherPriority Layout = new(6); + public static readonly DispatcherPriority Layout = new(8); /// /// The job will be processed with the same priority as data binding. @@ -75,7 +85,7 @@ namespace Avalonia.Threading /// /// The job will be processed before other asynchronous operations. /// - public static readonly DispatcherPriority Send = new(7); + public static readonly DispatcherPriority Send = new(9); /// /// Maximum possible priority diff --git a/src/Avalonia.Dialogs/ByteSizeHelper.cs b/src/Avalonia.Base/Utilities/ByteSizeHelper.cs similarity index 70% rename from src/Avalonia.Dialogs/ByteSizeHelper.cs rename to src/Avalonia.Base/Utilities/ByteSizeHelper.cs index d849e33399..edaf94231b 100644 --- a/src/Avalonia.Dialogs/ByteSizeHelper.cs +++ b/src/Avalonia.Base/Utilities/ByteSizeHelper.cs @@ -1,10 +1,11 @@ using System; -namespace Avalonia.Dialogs +namespace Avalonia.Utilities { internal static class ByteSizeHelper { - private const string formatTemplate = "{0}{1:0.#} {2}"; + private const string formatTemplateSeparated = "{0}{1:0.#} {2}"; + private const string formatTemplate = "{0}{1:0.#}{2}"; private static readonly string[] Prefixes = { @@ -19,11 +20,11 @@ namespace Avalonia.Dialogs "YB" }; - public static string ToString(ulong bytes) + public static string ToString(ulong bytes, bool separate) { if (bytes == 0) { - return string.Format(formatTemplate, null, 0, Prefixes[0]); + return string.Format(separate ? formatTemplateSeparated : formatTemplate, null, 0, Prefixes[0]); } var absSize = Math.Abs((double)bytes); diff --git a/src/Avalonia.Base/Utilities/MathUtilities.cs b/src/Avalonia.Base/Utilities/MathUtilities.cs index 596cbf1d7e..3d5be806e1 100644 --- a/src/Avalonia.Base/Utilities/MathUtilities.cs +++ b/src/Avalonia.Base/Utilities/MathUtilities.cs @@ -251,6 +251,20 @@ namespace Avalonia.Utilities return val; } } + + /// + /// Clamps a value between a minimum and maximum value. + /// + /// The value. + /// The minimum value. + /// The maximum value. + /// The clamped value. + public static float Clamp(float value, float min, float max) + { + var amax = Math.Max(min, max); + var amin = Math.Min(min, max); + return Math.Min(Math.Max(value, amin), amax); + } /// /// Clamps a value between a minimum and maximum value. diff --git a/src/Avalonia.Base/Utilities/Ref.cs b/src/Avalonia.Base/Utilities/Ref.cs index 7209f02720..95a1c23883 100644 --- a/src/Avalonia.Base/Utilities/Ref.cs +++ b/src/Avalonia.Base/Utilities/Ref.cs @@ -159,7 +159,7 @@ namespace Avalonia.Utilities ~Ref() { - _counter?.Release(); + Dispose(); } public T Item diff --git a/src/Avalonia.Base/Utilities/RefTrackingDictionary.cs b/src/Avalonia.Base/Utilities/RefTrackingDictionary.cs new file mode 100644 index 0000000000..9400e37f21 --- /dev/null +++ b/src/Avalonia.Base/Utilities/RefTrackingDictionary.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace Avalonia.Utilities; + +/// +/// Maintains a set of objects with reference counts +/// +internal class RefTrackingDictionary : Dictionary where TKey : class +{ + /// + /// Increase reference count for a key by 1. + /// + /// true if key was added to the dictionary, false otherwise + public bool AddRef(TKey key) + { +#if NET5_0_OR_GREATER + ref var count = ref CollectionsMarshal.GetValueRefOrAddDefault(this, key, out var _); + count++; +#else + TryGetValue(key, out var count); + count++; + this[key] = count; +#endif + return count == 1; + } + + /// + /// Decrease reference count for a key by 1. + /// + /// true if key was removed to the dictionary, false otherwise + public bool ReleaseRef(TKey key) + { +#if NET5_0_OR_GREATER + ref var count = ref CollectionsMarshal.GetValueRefOrNullRef(this, key); + if (Unsafe.IsNullRef(ref count)) +#if DEBUG + throw new InvalidOperationException("Attempting to release a non-referenced object"); +#else + return false; +#endif // DEBUG + count--; + if (count == 0) + { + Remove(key); + return true; + } + + return false; +#else + if (!TryGetValue(key, out var count)) +#if DEBUG + throw new InvalidOperationException("Attempting to release a non-referenced object"); +#else + return false; +#endif // DEBUG + count--; + if (count == 0) + { + Remove(key); + return true; + } + + this[key] = count; + return false; +#endif + } +} \ No newline at end of file diff --git a/src/Avalonia.Base/Utilities/SafeEnumerableList.cs b/src/Avalonia.Base/Utilities/SafeEnumerableList.cs new file mode 100644 index 0000000000..dd437d27be --- /dev/null +++ b/src/Avalonia.Base/Utilities/SafeEnumerableList.cs @@ -0,0 +1,89 @@ +using System.Collections; +using System.Collections.Generic; + +namespace Avalonia.Utilities +{ + /// + /// Implements a simple list which is safe to modify during enumeration. + /// + /// The item type. + /// + /// Implements a list which, when written to while enumerating, performs a copy of the list + /// items. Note this this class doesn't actually implement as it's not + /// currently needed - feel free to add missing methods etc. + /// + internal class SafeEnumerableList : IEnumerable + { + private List _list = new(); + private int _generation; + private int _enumCount = 0; + + public int Count => _list.Count; + internal List Inner => _list; + + public void Add(T item) => GetList().Add(item); + public bool Remove(T item) => GetList().Remove(item); + + public Enumerator GetEnumerator() => new(this, _list); + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + + private List GetList() + { + if (_enumCount > 0) + { + _list = new(_list); + ++_generation; + _enumCount = 0; + } + + return _list; + } + + public struct Enumerator : IEnumerator, IEnumerator + { + private readonly SafeEnumerableList _owner; + private readonly List _list; + private readonly int _generation; + private int _index; + private T? _current; + + internal Enumerator(SafeEnumerableList owner, List list) + { + _owner = owner; + _list = list; + _generation = owner._generation; + _index = 0; + _current = default; + ++_owner._enumCount; + } + + public void Dispose() + { + if (_owner._generation == _generation) + --_owner._enumCount; + } + + public bool MoveNext() + { + if (_index < _list.Count) + { + _current = _list[_index++]; + return true; + } + + _current = default; + return false; + } + + public T Current => _current!; + object? IEnumerator.Current => _current; + + void IEnumerator.Reset() + { + _index = 0; + _current = default; + } + } + } +} diff --git a/src/Avalonia.Base/Utilities/SmallDictionary.cs b/src/Avalonia.Base/Utilities/SmallDictionary.cs new file mode 100644 index 0000000000..7d6a21c136 --- /dev/null +++ b/src/Avalonia.Base/Utilities/SmallDictionary.cs @@ -0,0 +1,278 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; + +namespace Avalonia.Utilities; + +public struct InlineDictionary : IEnumerable> where TKey : class where TValue : class +{ + object? _data; + TValue? _value; + + void SetCore(TKey key, TValue value, bool overwrite) + { + if (key == null) + throw new ArgumentNullException(); + if (_data == null) + { + _data = key; + _value = value; + } + else if (_data is KeyValuePair[] arr) + { + var free = -1; + for (var c = 0; c < arr.Length; c++) + { + if (arr[c].Key == key) + { + if (overwrite) + { + arr[c] = new(key, value); + return; + } + else + throw new ArgumentException("Key already exists in dictionary"); + } + + if (arr[c].Key == null) + free = c; + } + + if (free != -1) + { + arr[free] = new KeyValuePair(key, value); + return; + } + + // Upgrade to dictionary + var newDic = new Dictionary(); + foreach (var kvp in arr) + newDic.Add(kvp.Key!, kvp.Value!); + newDic.Add(key, value); + _data = newDic; + } + else if (_data is Dictionary dic) + { + if (overwrite) + dic[key] = value; + else + dic.Add(key, value); + } + else + { + // We have a single element, upgrade to array + arr = new KeyValuePair[6]; + arr[0] = new KeyValuePair((TKey)_data, _value); + arr[1] = new KeyValuePair(key, value); + _data = arr; + _value = null; + } + } + + public void Add(TKey key, TValue value) => SetCore(key, value, false); + public void Set(TKey key, TValue value) => SetCore(key, value, true); + + public TValue this[TKey key] + { + get + { + if (TryGetValue(key, out var rv)) + return rv; + throw new KeyNotFoundException(); + } + set => Set(key, value); + } + + public bool Remove(TKey key) + { + if (_data == key) + { + _data = null; + _value = null; + return true; + } + else if (_data is KeyValuePair[] arr) + { + for (var c = 0; c < arr.Length; c++) + { + if (arr[c].Key == key) + { + arr[c] = default; + return true; + } + } + + return false; + } + else if (_data is Dictionary dic) + return dic.Remove(key); + + return false; + } + + public bool TryGetValue(TKey key, [MaybeNullWhen(false)]out TValue value) + { + if (_data == key) + { + value = _value!; + return true; + } + else if (_data is KeyValuePair[] arr) + { + for (var c = 0; c < arr.Length; c++) + { + if (arr[c].Key == key) + { + value = arr[c].Value!; + return true; + } + } + + value = null; + return false; + } + else if (_data is Dictionary dic) + return dic.TryGetValue(key, out value); + + value = null; + return false; + } + + + public bool TryGetAndRemoveValue(TKey key, [MaybeNullWhen(false)]out TValue value) + { + if (_data == key) + { + value = _value!; + _value = null; + _data = null; + return true; + } + else if (_data is KeyValuePair[] arr) + { + for (var c = 0; c < arr.Length; c++) + { + if (arr[c].Key == key) + { + value = arr[c].Value!; + arr[c] = default; + return true; + } + } + + value = null; + return false; + } + else if (_data is Dictionary dic) + { + if (!dic.TryGetValue(key, out value)) + return false; + dic.Remove(key); + } + + value = null; + return false; + } + + public TValue GetAndRemove(TKey key) + { + if (TryGetAndRemoveValue(key, out var v)) + return v; + throw new KeyNotFoundException(); + } + + public struct Enumerator : IEnumerator> + { + private Dictionary.Enumerator _inner; + private readonly KeyValuePair[]? _arr; + private KeyValuePair _first; + private int _index; + private Type _type; + enum Type + { + Empty, Single, Array, Dictionary + } + + public Enumerator(InlineDictionary parent) + { + _arr = null; + _first = default; + _index = -1; + _inner = default; + if (parent._data is Dictionary inner) + { + _inner = inner.GetEnumerator(); + _type = Type.Dictionary; + } + else if (parent._data is KeyValuePair[] arr) + { + _type = Type.Array; + _arr = arr; + } + else if (parent._data != null) + { + _type = Type.Single; + _first = new((TKey)parent._data!, parent._value!); + } + else + _type = Type.Empty; + + } + + public bool MoveNext() + { + if (_type == Type.Single) + { + if (_index != -1) + return false; + _index = 0; + } + else if (_type == Type.Array) + { + var next = _index + 1; + if (_arr!.Length - 1 < next || _arr[next].Key == null) + return false; + _index = next; + return true; + } + else if (_type == Type.Dictionary) + return _inner.MoveNext(); + + return false; + } + + public void Reset() + { + _index = -1; + if(_type == Type.Dictionary) + ((IEnumerator)_inner).Reset(); + } + + public KeyValuePair Current + { + get + { + if (_type == Type.Single) + return _first!; + if (_type == Type.Array) + return _arr![_index]!; + if (_type == Type.Dictionary) + return _inner.Current; + throw new InvalidOperationException(); + } + } + + object IEnumerator.Current => Current; + + public void Dispose() + { + } + } + + public Enumerator GetEnumerator() => new Enumerator(this); + + IEnumerator> IEnumerable>.GetEnumerator() => GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + +} diff --git a/src/Avalonia.Base/Visual.cs b/src/Avalonia.Base/Visual.cs index bdf8723b81..8feba116f0 100644 --- a/src/Avalonia.Base/Visual.cs +++ b/src/Avalonia.Base/Visual.cs @@ -1,3 +1,7 @@ + + +#nullable enable + using System; using System.Collections; using System.Collections.Specialized; @@ -8,11 +12,10 @@ using Avalonia.LogicalTree; using Avalonia.Media; using Avalonia.Metadata; using Avalonia.Rendering; +using Avalonia.Rendering.Composition; +using Avalonia.Rendering.Composition.Server; using Avalonia.Utilities; using Avalonia.VisualTree; - -#nullable enable - namespace Avalonia { /// @@ -288,6 +291,10 @@ namespace Avalonia /// protected IRenderRoot? VisualRoot => _visualRoot ?? (this as IRenderRoot); + internal CompositionDrawListVisual? CompositionVisual { get; private set; } + + public bool HasNonUniformZIndexChildren { get; private set; } + /// /// Gets a value indicating whether this control is attached to a visual root. /// @@ -434,10 +441,17 @@ namespace Avalonia } EnableTransitions(); + if (_visualRoot.Renderer is IRendererWithCompositor compositingRenderer) + { + AttachToCompositor(compositingRenderer.Compositor); + } OnAttachedToVisualTree(e); AttachedToVisualTree?.Invoke(this, e); InvalidateVisual(); + if (ZIndex != 0 && this.GetVisualParent() is Visual parent) + parent.HasNonUniformZIndexChildren = true; + var visualChildren = VisualChildren; if (visualChildren != null) @@ -454,6 +468,17 @@ namespace Avalonia } } + internal CompositionVisual AttachToCompositor(Compositor compositor) + { + if (CompositionVisual == null || CompositionVisual.Compositor != compositor) + { + CompositionVisual = new CompositionDrawListVisual(compositor, + new ServerCompositionDrawListVisual(compositor.Server, this), this); + } + + return CompositionVisual; + } + /// /// Calls the method /// for this control and all of its visual descendants. @@ -472,6 +497,12 @@ namespace Avalonia DisableTransitions(); OnDetachedFromVisualTree(e); + if (CompositionVisual != null) + { + CompositionVisual.DrawList = null; + CompositionVisual = null; + } + DetachedFromVisualTree?.Invoke(this, e); e.Root?.Renderer?.AddDirty(this); @@ -566,7 +597,7 @@ namespace Avalonia { newValue.Changed += sender.RenderTransformChanged; } - + sender.InvalidateVisual(); } } @@ -596,6 +627,9 @@ namespace Avalonia { var sender = e.Sender as IVisual; var parent = sender?.VisualParent; + if (sender?.ZIndex != 0 && parent is Visual parentVisual) + parentVisual.HasNonUniformZIndexChildren = true; + sender?.InvalidateVisual(); parent?.VisualRoot?.Renderer?.RecalculateChildren(parent); } diff --git a/src/Avalonia.Base/VisualTree/IVisual.cs b/src/Avalonia.Base/VisualTree/IVisual.cs index 3b053fab38..fdd2d187b8 100644 --- a/src/Avalonia.Base/VisualTree/IVisual.cs +++ b/src/Avalonia.Base/VisualTree/IVisual.cs @@ -79,6 +79,11 @@ namespace Avalonia.VisualTree /// Gets a value indicating whether to apply mirror transform on this control. /// bool HasMirrorTransform { get; } + + /// + /// Gets a value indicating whether to sort children when rendering this control + /// + bool HasNonUniformZIndexChildren { get; } /// /// Gets or sets the render transform of the control. diff --git a/src/Avalonia.Base/composition-schema.xml b/src/Avalonia.Base/composition-schema.xml new file mode 100644 index 0000000000..e0e177da44 --- /dev/null +++ b/src/Avalonia.Base/composition-schema.xml @@ -0,0 +1,46 @@ + + + System.Numerics + Avalonia.Rendering.Composition.Server + Avalonia.Rendering.Composition.Transport + Avalonia.Rendering.Composition.Animations + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Avalonia.Controls.ColorPicker/ColorPalettes/FlatColorPalette.cs b/src/Avalonia.Controls.ColorPicker/ColorPalettes/FlatColorPalette.cs new file mode 100644 index 0000000000..130d7e0edd --- /dev/null +++ b/src/Avalonia.Controls.ColorPicker/ColorPalettes/FlatColorPalette.cs @@ -0,0 +1,284 @@ +using Avalonia.Media; +using Avalonia.Utilities; + +namespace Avalonia.Controls +{ + /// + /// Implements a reduced flat design or flat UI color palette. + /// + /// + /// See: + /// - https://htmlcolorcodes.com/color-chart/ + /// - https://htmlcolorcodes.com/color-chart/flat-design-color-chart/ + /// - http://designmodo.github.io/Flat-UI/ + /// + /// The GitHub project is licensed as MIT: https://github.com/designmodo/Flat-UI. + /// + /// + public class FlatColorPalette : IColorPalette + { + // The full Flat UI color chart has 10 rows and 20 columns + // See: https://htmlcolorcodes.com/assets/downloads/flat-design-colors/flat-design-color-chart.png + // This is a reduced palette for usability + private static Color[,] colorChart = new Color[,] + { + // Pomegranate + { + Color.FromArgb(0xFF, 0xF9, 0xEB, 0xEA), + Color.FromArgb(0xFF, 0xE6, 0xB0, 0xAA), + Color.FromArgb(0xFF, 0xCD, 0x61, 0x55), + Color.FromArgb(0xFF, 0xA9, 0x32, 0x26), + Color.FromArgb(0xFF, 0x7B, 0x24, 0x1C), + }, + + // Amethyst + { + Color.FromArgb(0xFF, 0xF5, 0xEE, 0xF8), + Color.FromArgb(0xFF, 0xD7, 0xBD, 0xE2), + Color.FromArgb(0xFF, 0xAF, 0x7A, 0xC5), + Color.FromArgb(0xFF, 0x88, 0x4E, 0xA0), + Color.FromArgb(0xFF, 0x63, 0x39, 0x74), + }, + + // Belize Hole + { + Color.FromArgb(0xFF, 0xEA, 0xF2, 0xF8), + Color.FromArgb(0xFF, 0xA9, 0xCC, 0xE3), + Color.FromArgb(0xFF, 0x54, 0x99, 0xC7), + Color.FromArgb(0xFF, 0x24, 0x71, 0xA3), + Color.FromArgb(0xFF, 0x1A, 0x52, 0x76), + }, + + // Turquoise + { + Color.FromArgb(0xFF, 0xE8, 0xF8, 0xF5), + Color.FromArgb(0xFF, 0xA3, 0xE4, 0xD7), + Color.FromArgb(0xFF, 0x48, 0xC9, 0xB0), + Color.FromArgb(0xFF, 0x17, 0xA5, 0x89), + Color.FromArgb(0xFF, 0x11, 0x78, 0x64), + }, + + // Nephritis + { + Color.FromArgb(0xFF, 0xE9, 0xF7, 0xEF), + Color.FromArgb(0xFF, 0xA9, 0xDF, 0xBF), + Color.FromArgb(0xFF, 0x52, 0xBE, 0x80), + Color.FromArgb(0xFF, 0x22, 0x99, 0x54), + Color.FromArgb(0xFF, 0x19, 0x6F, 0x3D), + }, + + // Sunflower + { + Color.FromArgb(0xFF, 0xFE, 0xF9, 0xE7), + Color.FromArgb(0xFF, 0xF9, 0xE7, 0x9F), + Color.FromArgb(0xFF, 0xF4, 0xD0, 0x3F), + Color.FromArgb(0xFF, 0xD4, 0xAC, 0x0D), + Color.FromArgb(0xFF, 0x9A, 0x7D, 0x0A), + }, + + // Carrot + { + Color.FromArgb(0xFF, 0xFD, 0xF2, 0xE9), + Color.FromArgb(0xFF, 0xF5, 0xCB, 0xA7), + Color.FromArgb(0xFF, 0xEB, 0x98, 0x4E), + Color.FromArgb(0xFF, 0xCA, 0x6F, 0x1E), + Color.FromArgb(0xFF, 0x93, 0x51, 0x16), + }, + + // Clouds + { + Color.FromArgb(0xFF, 0xFD, 0xFE, 0xFE), + Color.FromArgb(0xFF, 0xF7, 0xF9, 0xF9), + Color.FromArgb(0xFF, 0xF0, 0xF3, 0xF4), + Color.FromArgb(0xFF, 0xD0, 0xD3, 0xD4), + Color.FromArgb(0xFF, 0x97, 0x9A, 0x9A), + }, + + // Concrete + { + Color.FromArgb(0xFF, 0xF4, 0xF6, 0xF6), + Color.FromArgb(0xFF, 0xD5, 0xDB, 0xDB), + Color.FromArgb(0xFF, 0xAA, 0xB7, 0xB8), + Color.FromArgb(0xFF, 0x83, 0x91, 0x92), + Color.FromArgb(0xFF, 0x5F, 0x6A, 0x6A), + }, + + // Wet Asphalt + { + Color.FromArgb(0xFF, 0xEB, 0xED, 0xEF), + Color.FromArgb(0xFF, 0xAE, 0xB6, 0xBF), + Color.FromArgb(0xFF, 0x5D, 0x6D, 0x7E), + Color.FromArgb(0xFF, 0x2E, 0x40, 0x53), + Color.FromArgb(0xFF, 0x21, 0x2F, 0x3C), + }, + }; + + /// + /// Gets the index of the default shade of colors in this palette. + /// + public const int DefaultShadeIndex = 2; + + /// + /// The index in the color palette of the 'Pomegranate' color. + /// This index can correspond to multiple color shades. + /// + public const int PomegranateIndex = 0; + + /// + /// The index in the color palette of the 'Amethyst' color. + /// This index can correspond to multiple color shades. + /// + public const int AmethystIndex = 1; + + /// + /// The index in the color palette of the 'BelizeHole' color. + /// This index can correspond to multiple color shades. + /// + public const int BelizeHoleIndex = 2; + + /// + /// The index in the color palette of the 'Turquoise' color. + /// This index can correspond to multiple color shades. + /// + public const int TurquoiseIndex = 3; + + /// + /// The index in the color palette of the 'Nephritis' color. + /// This index can correspond to multiple color shades. + /// + public const int NephritisIndex = 4; + + /// + /// The index in the color palette of the 'Sunflower' color. + /// This index can correspond to multiple color shades. + /// + public const int SunflowerIndex = 5; + + /// + /// The index in the color palette of the 'Carrot' color. + /// This index can correspond to multiple color shades. + /// + public const int CarrotIndex = 6; + + /// + /// The index in the color palette of the 'Clouds' color. + /// This index can correspond to multiple color shades. + /// + public const int CloudsIndex = 7; + + /// + /// The index in the color palette of the 'Concrete' color. + /// This index can correspond to multiple color shades. + /// + public const int ConcreteIndex = 8; + + /// + /// The index in the color palette of the 'WetAsphalt' color. + /// This index can correspond to multiple color shades. + /// + public const int WetAsphaltIndex = 9; + + /// + public int ColorCount + { + // Table is transposed compared to the reference chart + get => colorChart.GetLength(0); + } + + /// + public int ShadeCount + { + // Table is transposed compared to the reference chart + get => colorChart.GetLength(1); + } + + /// + /// Gets the palette defined color that has an ARGB value of #FFC0392B. + /// + public static Color Pomegranate + { + get => colorChart[PomegranateIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF9B59B6. + /// + public static Color Amethyst + { + get => colorChart[AmethystIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF2980B9. + /// + public static Color BelizeHole + { + get => colorChart[BelizeHoleIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF1ABC9C. + /// + public static Color Turquoise + { + get => colorChart[TurquoiseIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF27AE60. + /// + public static Color Nephritis + { + get => colorChart[NephritisIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FFF1C40F. + /// + public static Color Sunflower + { + get => colorChart[SunflowerIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FFE67E22. + /// + public static Color Carrot + { + get => colorChart[CarrotIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FFECF0F1. + /// + public static Color Clouds + { + get => colorChart[CloudsIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF95A5A6. + /// + public static Color Concrete + { + get => colorChart[ConcreteIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF34495E. + /// + public static Color WetAsphalt + { + get => colorChart[WetAsphaltIndex, DefaultShadeIndex]; + } + + /// + public Color GetColor(int colorIndex, int shadeIndex) + { + // Table is transposed compared to the reference chart + return colorChart[ + MathUtilities.Clamp(colorIndex, 0, colorChart.GetLength(0) - 1), + MathUtilities.Clamp(shadeIndex, 0, colorChart.GetLength(1) - 1)]; + } + } +} diff --git a/src/Avalonia.Controls.ColorPicker/ColorPalettes/FluentColorPalette.cs b/src/Avalonia.Controls.ColorPicker/ColorPalettes/FluentColorPalette.cs new file mode 100644 index 0000000000..013e69ce20 --- /dev/null +++ b/src/Avalonia.Controls.ColorPicker/ColorPalettes/FluentColorPalette.cs @@ -0,0 +1,136 @@ +using Avalonia.Media; +using Avalonia.Utilities; + +namespace Avalonia.Controls +{ + /// + /// Implements the standard Windows 10 color palette. + /// + public class FluentColorPalette : IColorPalette + { + // Values were taken from the Settings App, Personalization > Colors which match with + // https://docs.microsoft.com/en-us/windows/uwp/whats-new/windows-docs-december-2017 + // + // The default ordering and grouping of colors was undesirable so was modified. + // Colors were transposed: the colors in rows within the Settings app became columns here. + // This is because columns in an IColorPalette generally should contain different shades of + // the same color. In the settings app this concept is somewhat loosely reversed. + // The first 'column' ordering, after being transposed, was then reversed so 'red' colors + // were near to each other. + // + // This new ordering most closely follows the Windows standard while: + // + // 1. Keeping colors in a 'spectrum' order + // 2. Keeping like colors next to each both in rows and columns + // (which is unique for the windows palette). + // For example, similar red colors are next to each other in both + // rows within the same column and rows within the column next to it. + // This follows a 'snake-like' pattern as illustrated below. + // 3. A downside of this ordering is colors don't follow strict 'shades' + // as in other palettes. + // + // The colors will be displayed in the below pattern. + // This pattern follows a spectrum while keeping like-colors near to one + // another across both rows and columns. + // + // ┌Red───┐ ┌Blue──┐ ┌Gray──┐ + // │ │ │ │ │ | + // │ │ │ │ │ | + // Yellow └Violet┘ └Green─┘ Brown + + private static Color[,] colorChart = new Color[,] + { + { + // Ordering reversed for this section only + Color.FromArgb(255, 255, 67, 67), /* #FF4343 */ + Color.FromArgb(255, 209, 52, 56), /* #D13438 */ + Color.FromArgb(255, 239, 105, 80), /* #EF6950 */ + Color.FromArgb(255, 218, 59, 1), /* #DA3B01 */ + Color.FromArgb(255, 202, 80, 16), /* #CA5010 */ + Color.FromArgb(255, 247, 99, 12), /* #F7630C */ + Color.FromArgb(255, 255, 140, 0), /* #FF8C00 */ + Color.FromArgb(255, 255, 185, 0), /* #FFB900 */ + }, + { + Color.FromArgb(255, 231, 72, 86), /* #E74856 */ + Color.FromArgb(255, 232, 17, 35), /* #E81123 */ + Color.FromArgb(255, 234, 0, 94), /* #EA005E */ + Color.FromArgb(255, 195, 0, 82), /* #C30052 */ + Color.FromArgb(255, 227, 0, 140), /* #E3008C */ + Color.FromArgb(255, 191, 0, 119), /* #BF0077 */ + Color.FromArgb(255, 194, 57, 179), /* #C239B3 */ + Color.FromArgb(255, 154, 0, 137), /* #9A0089 */ + }, + { + Color.FromArgb(255, 0, 120, 215), /* #0078D7 */ + Color.FromArgb(255, 0, 99, 177), /* #0063B1 */ + Color.FromArgb(255, 142, 140, 216), /* #8E8CD8 */ + Color.FromArgb(255, 107, 105, 214), /* #6B69D6 */ + Color.FromArgb(255, 135, 100, 184), /* #8764B8 */ + Color.FromArgb(255, 116, 77, 169), /* #744DA9 */ + Color.FromArgb(255, 177, 70, 194), /* #B146C2 */ + Color.FromArgb(255, 136, 23, 152), /* #881798 */ + }, + { + Color.FromArgb(255, 0, 153, 188), /* #0099BC */ + Color.FromArgb(255, 45, 125, 154), /* #2D7D9A */ + Color.FromArgb(255, 0, 183, 195), /* #00B7C3 */ + Color.FromArgb(255, 3, 131, 135), /* #038387 */ + Color.FromArgb(255, 0, 178, 148), /* #00B294 */ + Color.FromArgb(255, 1, 133, 116), /* #018574 */ + Color.FromArgb(255, 0, 204, 106), /* #00CC6A */ + Color.FromArgb(255, 16, 137, 62), /* #10893E */ + }, + { + Color.FromArgb(255, 122, 117, 116), /* #7A7574 */ + Color.FromArgb(255, 93, 90, 80), /* #5D5A58 */ + Color.FromArgb(255, 104, 118, 138), /* #68768A */ + Color.FromArgb(255, 81, 92, 107), /* #515C6B */ + Color.FromArgb(255, 86, 124, 115), /* #567C73 */ + Color.FromArgb(255, 72, 104, 96), /* #486860 */ + Color.FromArgb(255, 73, 130, 5), /* #498205 */ + Color.FromArgb(255, 16, 124, 16), /* #107C10 */ + }, + { + Color.FromArgb(255, 118, 118, 118), /* #767676 */ + Color.FromArgb(255, 76, 74, 72), /* #4C4A48 */ + Color.FromArgb(255, 105, 121, 126), /* #69797E */ + Color.FromArgb(255, 74, 84, 89), /* #4A5459 */ + Color.FromArgb(255, 100, 124, 100), /* #647C64 */ + Color.FromArgb(255, 82, 94, 84), /* #525E54 */ + Color.FromArgb(255, 132, 117, 69), /* #847545 */ + Color.FromArgb(255, 126, 115, 95), /* #7E735F */ + } + }; + + /// + /// Gets the total number of colors in this palette. + /// A color is not necessarily a single value and may be composed of several shades. + /// This has little meaning in this palette as colors are not strictly separated. + /// + /// + public int ColorCount + { + get => colorChart.GetLength(0); + } + + /// + /// Gets the total number of shades for each color in this palette. + /// Shades are usually a variation of the color lightening or darkening it. + /// This has little meaning in this palette as colors are not strictly separated by shade. + /// + /// + public int ShadeCount + { + get => colorChart.GetLength(1); + } + + /// + public Color GetColor(int colorIndex, int shadeIndex) + { + return colorChart[ + MathUtilities.Clamp(colorIndex, 0, colorChart.GetLength(0) - 1), + MathUtilities.Clamp(shadeIndex, 0, colorChart.GetLength(1) - 1)]; + } + } +} diff --git a/src/Avalonia.Controls.ColorPicker/ColorPalettes/IColorPalette.cs b/src/Avalonia.Controls.ColorPicker/ColorPalettes/IColorPalette.cs new file mode 100644 index 0000000000..7c6ebc3f6a --- /dev/null +++ b/src/Avalonia.Controls.ColorPicker/ColorPalettes/IColorPalette.cs @@ -0,0 +1,38 @@ +using Avalonia.Media; + +namespace Avalonia.Controls +{ + /// + /// Interface to define a color palette. + /// + public interface IColorPalette + { + /// + /// Gets the total number of colors in this palette. + /// A color is not necessarily a single value and may be composed of several shades. + /// + /// + /// Represents total columns in a table. + /// + int ColorCount { get; } + + /// + /// Gets the total number of shades for each color in this palette. + /// Shades are usually a variation of the color lightening or darkening it. + /// + /// + /// Represents total rows in a table. + /// + int ShadeCount { get; } + + /// + /// Gets a color in the palette by index. + /// + /// The index of the color in the palette. + /// The index must be between zero and . + /// The index of the color shade in the palette. + /// The index must be between zero and . + /// The color at the specified index or an exception. + Color GetColor(int colorIndex, int shadeIndex); + } +} diff --git a/src/Avalonia.Controls.ColorPicker/ColorPalettes/SixteenColorPalette.cs b/src/Avalonia.Controls.ColorPicker/ColorPalettes/SixteenColorPalette.cs new file mode 100644 index 0000000000..f3abfdfd7f --- /dev/null +++ b/src/Avalonia.Controls.ColorPicker/ColorPalettes/SixteenColorPalette.cs @@ -0,0 +1,302 @@ +using Avalonia.Media; +using Avalonia.Utilities; + +namespace Avalonia.Controls +{ + /// + /// Implements the standard sixteen color palette from the HTML 4.01 specification. + /// + /// + /// See https://en.wikipedia.org/wiki/Web_colors#HTML_color_names. + /// + public class SixteenColorPalette : IColorPalette + { + // The 16 standard colors from HTML and early Windows computers + // https://en.wikipedia.org/wiki/List_of_software_palettes + // https://en.wikipedia.org/wiki/Web_colors#HTML_color_names + private static Color[,] colorChart = new Color[,] + { + { + Colors.White, + Colors.Silver + }, + { + Colors.Gray, + Colors.Black + }, + { + Colors.Red, + Colors.Maroon + }, + { + Colors.Yellow, + Colors.Olive + }, + { + Colors.Lime, + Colors.Green + }, + { + Colors.Aqua, + Colors.Teal + }, + { + Colors.Blue, + Colors.Navy + }, + { + Colors.Fuchsia, + Colors.Purple + } + }; + + /// + /// Gets the index of the default shade of colors in this palette. + /// + public const int DefaultShadeIndex = 0; + + /// + /// The index in the color palette of the 'White' color. + /// This index can correspond to multiple color shades. + /// + public const int WhiteIndex = 0; + + /// + /// The index in the color palette of the 'Silver' color. + /// This index can correspond to multiple color shades. + /// + public const int SilverIndex = 1; + + /// + /// The index in the color palette of the 'Gray' color. + /// This index can correspond to multiple color shades. + /// + public const int GrayIndex = 2; + + /// + /// The index in the color palette of the 'Black' color. + /// This index can correspond to multiple color shades. + /// + public const int BlackIndex = 3; + + /// + /// The index in the color palette of the 'Red' color. + /// This index can correspond to multiple color shades. + /// + public const int RedIndex = 4; + + /// + /// The index in the color palette of the 'Maroon' color. + /// This index can correspond to multiple color shades. + /// + public const int MaroonIndex = 5; + + /// + /// The index in the color palette of the 'Yellow' color. + /// This index can correspond to multiple color shades. + /// + public const int YellowIndex = 6; + + /// + /// The index in the color palette of the 'Olive' color. + /// This index can correspond to multiple color shades. + /// + public const int OliveIndex = 7; + + /// + /// The index in the color palette of the 'Lime' color. + /// This index can correspond to multiple color shades. + /// + public const int LimeIndex = 8; + + /// + /// The index in the color palette of the 'Green' color. + /// This index can correspond to multiple color shades. + /// + public const int GreenIndex = 9; + + /// + /// The index in the color palette of the 'Aqua' color. + /// This index can correspond to multiple color shades. + /// + public const int AquaIndex = 10; + + /// + /// The index in the color palette of the 'Teal' color. + /// This index can correspond to multiple color shades. + /// + public const int TealIndex = 11; + + /// + /// The index in the color palette of the 'Blue' color. + /// This index can correspond to multiple color shades. + /// + public const int BlueIndex = 12; + + /// + /// The index in the color palette of the 'Navy' color. + /// This index can correspond to multiple color shades. + /// + public const int NavyIndex = 13; + + /// + /// The index in the color palette of the 'Fuchsia' color. + /// This index can correspond to multiple color shades. + /// + public const int FuchsiaIndex = 14; + + /// + /// The index in the color palette of the 'Purple' color. + /// This index can correspond to multiple color shades. + /// + public const int PurpleIndex = 15; + + /// + public int ColorCount + { + get => colorChart.GetLength(0); + } + + /// + public int ShadeCount + { + get => colorChart.GetLength(1); + } + + /// + /// Gets the palette defined color that has an ARGB value of #FFFFFFFF. + /// + public static Color White + { + get => colorChart[WhiteIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FFC0C0C0. + /// + public static Color Silver + { + get => colorChart[SilverIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF808080. + /// + public static Color Gray + { + get => colorChart[GrayIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF000000. + /// + public static Color Black + { + get => colorChart[BlackIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FFFF0000. + /// + public static Color Red + { + get => colorChart[RedIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF800000. + /// + public static Color Maroon + { + get => colorChart[MaroonIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FFFFFF00. + /// + public static Color Yellow + { + get => colorChart[YellowIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF808000. + /// + public static Color Olive + { + get => colorChart[OliveIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF00FF00. + /// + public static Color Lime + { + get => colorChart[LimeIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF008000. + /// + public static Color Green + { + get => colorChart[GreenIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF00FFFF. + /// + public static Color Aqua + { + get => colorChart[AquaIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF008080. + /// + public static Color Teal + { + get => colorChart[TealIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF0000FF. + /// + public static Color Blue + { + get => colorChart[BlueIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF000080. + /// + public static Color Navy + { + get => colorChart[NavyIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FFFF00FF. + /// + public static Color Fuchsia + { + get => colorChart[FuchsiaIndex, DefaultShadeIndex]; + } + + /// + /// Gets the palette defined color that has an ARGB value of #FF800080. + /// + public static Color Purple + { + get => colorChart[PurpleIndex, DefaultShadeIndex]; + } + + /// + public Color GetColor(int colorIndex, int shadeIndex) + { + return colorChart[ + MathUtilities.Clamp(colorIndex, 0, colorChart.GetLength(0) - 1), + MathUtilities.Clamp(shadeIndex, 0, colorChart.GetLength(1) - 1)]; + } + } +} diff --git a/src/Avalonia.Controls.ColorPicker/ColorPicker/ColorPicker.cs b/src/Avalonia.Controls.ColorPicker/ColorPicker/ColorPicker.cs new file mode 100644 index 0000000000..39369bcbdb --- /dev/null +++ b/src/Avalonia.Controls.ColorPicker/ColorPicker/ColorPicker.cs @@ -0,0 +1,19 @@ +namespace Avalonia.Controls +{ + /// + /// Presents a color for user editing using a spectrum, palette and component sliders within a drop down. + /// Editing is available when the drop down flyout is opened; otherwise, only the preview color is shown. + /// + public class ColorPicker : ColorView + { + /// + /// Initializes a new instance of the class. + /// + public ColorPicker() : base() + { + // Completely ignore property changes here + // The ColorView in the control template is responsible to manage this + base.ignorePropertyChanged = true; + } + } +} diff --git a/src/Avalonia.Controls.ColorPicker/ColorPreviewer/ColorPreviewer.Properties.cs b/src/Avalonia.Controls.ColorPicker/ColorPreviewer/ColorPreviewer.Properties.cs index 0fa6ab8083..e1ffbb7eae 100644 --- a/src/Avalonia.Controls.ColorPicker/ColorPreviewer/ColorPreviewer.Properties.cs +++ b/src/Avalonia.Controls.ColorPicker/ColorPreviewer/ColorPreviewer.Properties.cs @@ -16,11 +16,11 @@ namespace Avalonia.Controls.Primitives defaultBindingMode: BindingMode.TwoWay); /// - /// Defines the property. + /// Defines the property. /// - public static readonly StyledProperty ShowAccentColorsProperty = + public static readonly StyledProperty IsAccentColorsVisibleProperty = AvaloniaProperty.Register( - nameof(ShowAccentColors), + nameof(IsAccentColorsVisible), true); /// @@ -38,13 +38,13 @@ namespace Avalonia.Controls.Primitives } /// - /// Gets or sets a value indicating whether accent colors are shown along + /// Gets or sets a value indicating whether accent colors are visible along /// with the preview color. /// - public bool ShowAccentColors + public bool IsAccentColorsVisible { - get => GetValue(ShowAccentColorsProperty); - set => SetValue(ShowAccentColorsProperty, value); + get => GetValue(IsAccentColorsVisibleProperty); + set => SetValue(IsAccentColorsVisibleProperty, value); } } } diff --git a/src/Avalonia.Controls.ColorPicker/ColorPreviewer/ColorPreviewer.cs b/src/Avalonia.Controls.ColorPicker/ColorPreviewer/ColorPreviewer.cs index d04ddf4bd6..6f49430505 100644 --- a/src/Avalonia.Controls.ColorPicker/ColorPreviewer/ColorPreviewer.cs +++ b/src/Avalonia.Controls.ColorPicker/ColorPreviewer/ColorPreviewer.cs @@ -10,10 +10,10 @@ namespace Avalonia.Controls.Primitives /// /// Presents a preview color with optional accent colors. /// - [TemplatePart(Name = nameof(AccentDec1Border), Type = typeof(Border))] - [TemplatePart(Name = nameof(AccentDec2Border), Type = typeof(Border))] - [TemplatePart(Name = nameof(AccentInc1Border), Type = typeof(Border))] - [TemplatePart(Name = nameof(AccentInc2Border), Type = typeof(Border))] + [TemplatePart("PART_AccentDecrement1Border", typeof(Border))] + [TemplatePart("PART_AccentDecrement2Border", typeof(Border))] + [TemplatePart("PART_AccentIncrement1Border", typeof(Border))] + [TemplatePart("PART_AccentIncrement2Border", typeof(Border))] public partial class ColorPreviewer : TemplatedControl { /// @@ -24,10 +24,11 @@ namespace Avalonia.Controls.Primitives private bool eventsConnected = false; - private Border? AccentDec1Border; - private Border? AccentDec2Border; - private Border? AccentInc1Border; - private Border? AccentInc2Border; + // XAML template parts + private Border? _accentDecrement1Border; + private Border? _accentDecrement2Border; + private Border? _accentIncrement1Border; + private Border? _accentIncrement2Border; /// /// Initializes a new instance of the class. @@ -45,20 +46,20 @@ namespace Avalonia.Controls.Primitives if (connected == true && eventsConnected == false) { // Add all events - if (AccentDec1Border != null) { AccentDec1Border.PointerPressed += AccentBorder_PointerPressed; } - if (AccentDec2Border != null) { AccentDec2Border.PointerPressed += AccentBorder_PointerPressed; } - if (AccentInc1Border != null) { AccentInc1Border.PointerPressed += AccentBorder_PointerPressed; } - if (AccentInc2Border != null) { AccentInc2Border.PointerPressed += AccentBorder_PointerPressed; } + if (_accentDecrement1Border != null) { _accentDecrement1Border.PointerPressed += AccentBorder_PointerPressed; } + if (_accentDecrement2Border != null) { _accentDecrement2Border.PointerPressed += AccentBorder_PointerPressed; } + if (_accentIncrement1Border != null) { _accentIncrement1Border.PointerPressed += AccentBorder_PointerPressed; } + if (_accentIncrement2Border != null) { _accentIncrement2Border.PointerPressed += AccentBorder_PointerPressed; } eventsConnected = true; } else if (connected == false && eventsConnected == true) { // Remove all events - if (AccentDec1Border != null) { AccentDec1Border.PointerPressed -= AccentBorder_PointerPressed; } - if (AccentDec2Border != null) { AccentDec2Border.PointerPressed -= AccentBorder_PointerPressed; } - if (AccentInc1Border != null) { AccentInc1Border.PointerPressed -= AccentBorder_PointerPressed; } - if (AccentInc2Border != null) { AccentInc2Border.PointerPressed -= AccentBorder_PointerPressed; } + if (_accentDecrement1Border != null) { _accentDecrement1Border.PointerPressed -= AccentBorder_PointerPressed; } + if (_accentDecrement2Border != null) { _accentDecrement2Border.PointerPressed -= AccentBorder_PointerPressed; } + if (_accentIncrement1Border != null) { _accentIncrement1Border.PointerPressed -= AccentBorder_PointerPressed; } + if (_accentIncrement2Border != null) { _accentIncrement2Border.PointerPressed -= AccentBorder_PointerPressed; } eventsConnected = false; } @@ -70,10 +71,10 @@ namespace Avalonia.Controls.Primitives // Remove any existing events present if the control was previously loaded then unloaded ConnectEvents(false); - AccentDec1Border = e.NameScope.Find(nameof(AccentDec1Border)); - AccentDec2Border = e.NameScope.Find(nameof(AccentDec2Border)); - AccentInc1Border = e.NameScope.Find(nameof(AccentInc1Border)); - AccentInc2Border = e.NameScope.Find(nameof(AccentInc2Border)); + _accentDecrement1Border = e.NameScope.Find("PART_AccentDecrement1Border"); + _accentDecrement2Border = e.NameScope.Find("PART_AccentDecrement2Border"); + _accentIncrement1Border = e.NameScope.Find("PART_AccentIncrement1Border"); + _accentIncrement2Border = e.NameScope.Find("PART_AccentIncrement2Border"); // Must connect after controls are found ConnectEvents(true); @@ -116,15 +117,15 @@ namespace Avalonia.Controls.Primitives // Get the value component delta try { - accentStep = int.Parse(border?.Tag?.ToString() ?? "", CultureInfo.InvariantCulture); + accentStep = int.Parse(border?.Tag?.ToString() ?? "0", CultureInfo.InvariantCulture); } catch { } - HsvColor newHsvColor = AccentColorConverter.GetAccent(hsvColor, accentStep); - HsvColor oldHsvColor = HsvColor; - - HsvColor = newHsvColor; - OnColorChanged(new ColorChangedEventArgs(oldHsvColor.ToRgb(), newHsvColor.ToRgb())); + if (accentStep != 0) + { + // ColorChanged will be invoked in OnPropertyChanged if the value is different + HsvColor = AccentColorConverter.GetAccent(hsvColor, accentStep); + } } } } diff --git a/src/Avalonia.Controls.ColorPicker/ColorSlider/ColorSlider.Properties.cs b/src/Avalonia.Controls.ColorPicker/ColorSlider/ColorSlider.Properties.cs index 31bd296288..e2a34a7f90 100644 --- a/src/Avalonia.Controls.ColorPicker/ColorSlider/ColorSlider.Properties.cs +++ b/src/Avalonia.Controls.ColorPicker/ColorSlider/ColorSlider.Properties.cs @@ -49,12 +49,12 @@ namespace Avalonia.Controls.Primitives true); /// - /// Defines the property. + /// Defines the property. /// - public static readonly StyledProperty IsAutoUpdatingEnabledProperty = + public static readonly StyledProperty IsRoundingEnabledProperty = AvaloniaProperty.Register( - nameof(IsAutoUpdatingEnabled), - true); + nameof(IsRoundingEnabled), + false); /// /// Defines the property. @@ -120,16 +120,16 @@ namespace Avalonia.Controls.Primitives } /// - /// Gets or sets a value indicating whether automatic background and foreground updates will be - /// calculated when the set color changes. + /// Gets or sets a value indicating whether rounding of color component values is enabled. /// /// - /// This can be disabled for performance reasons when working with multiple sliders. + /// This is applicable for the HSV color model only. The struct uses double + /// values while the struct uses byte. Only double types need rounding. /// - public bool IsAutoUpdatingEnabled + public bool IsRoundingEnabled { - get => GetValue(IsAutoUpdatingEnabledProperty); - set => SetValue(IsAutoUpdatingEnabledProperty, value); + get => GetValue(IsRoundingEnabledProperty); + set => SetValue(IsRoundingEnabledProperty, value); } /// diff --git a/src/Avalonia.Controls.ColorPicker/ColorSlider/ColorSlider.cs b/src/Avalonia.Controls.ColorPicker/ColorSlider/ColorSlider.cs index 3c38c6ed1b..b662d20223 100644 --- a/src/Avalonia.Controls.ColorPicker/ColorSlider/ColorSlider.cs +++ b/src/Avalonia.Controls.ColorPicker/ColorSlider/ColorSlider.cs @@ -20,8 +20,16 @@ namespace Avalonia.Controls.Primitives /// public event EventHandler? ColorChanged; - private const double MaxHue = 359.99999999999999999; // 17 decimal places - private bool disableUpdates = false; + /// + /// Defines the maximum hue component value + /// (other components are always 0..100 or 0.255). + /// + /// + /// This should match the default property. + /// + private const double MaxHue = 359; + + protected bool ignorePropertyChanged = false; /// /// Initializes a new instance of the class. @@ -107,21 +115,41 @@ namespace Avalonia.Controls.Primitives } } + /// + /// Rounds the component values of the given . + /// This is useful for user-display and to ensure a color matches user selection exactly. + /// + /// The to round component values for. + /// A new with rounded component values. + private HsvColor RoundComponentValues(HsvColor hsvColor) + { + return new HsvColor( + Math.Round(hsvColor.A, 2, MidpointRounding.AwayFromZero), + Math.Round(hsvColor.H, 0, MidpointRounding.AwayFromZero), + Math.Round(hsvColor.S, 2, MidpointRounding.AwayFromZero), + Math.Round(hsvColor.V, 2, MidpointRounding.AwayFromZero)); + } + /// /// Updates the slider property values by applying the current color. /// /// /// Warning: This will trigger property changed updates. - /// Consider using externally. + /// Consider using externally. /// private void SetColorToSliderValues() { - var hsvColor = HsvColor; - var rgbColor = Color; var component = ColorComponent; if (ColorModel == ColorModel.Hsva) { + var hsvColor = HsvColor; + + if (IsRoundingEnabled) + { + hsvColor = RoundComponentValues(hsvColor); + } + // Note: Components converted into a usable range for the user switch (component) { @@ -149,6 +177,8 @@ namespace Avalonia.Controls.Primitives } else { + var rgbColor = Color; + switch (component) { case ColorComponent.Alpha: @@ -183,13 +213,12 @@ namespace Avalonia.Controls.Primitives HsvColor hsvColor = new HsvColor(); Color rgbColor = new Color(); double sliderPercent = Value / (Maximum - Minimum); - - var baseHsvColor = HsvColor; - var baseRgbColor = Color; var component = ColorComponent; if (ColorModel == ColorModel.Hsva) { + var baseHsvColor = HsvColor; + switch (component) { case ColorComponent.Alpha: @@ -214,10 +243,12 @@ namespace Avalonia.Controls.Primitives } } - return (hsvColor.ToRgb(), hsvColor); + rgbColor = hsvColor.ToRgb(); } else { + var baseRgbColor = Color; + byte componentValue = Convert.ToByte(MathUtilities.Clamp(sliderPercent * 255, 0, 255)); switch (component) @@ -236,8 +267,15 @@ namespace Avalonia.Controls.Primitives break; } - return (rgbColor, rgbColor.ToHsv()); + hsvColor = rgbColor.ToHsv(); } + + if (IsRoundingEnabled) + { + hsvColor = RoundComponentValues(hsvColor); + } + + return (rgbColor, hsvColor); } /// @@ -306,7 +344,7 @@ namespace Avalonia.Controls.Primitives /// protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) { - if (disableUpdates) + if (ignorePropertyChanged) { base.OnPropertyChanged(change); return; @@ -315,54 +353,59 @@ namespace Avalonia.Controls.Primitives // Always keep the two color properties in sync if (change.Property == ColorProperty) { - disableUpdates = true; + ignorePropertyChanged = true; HsvColor = Color.ToHsv(); - if (IsAutoUpdatingEnabled) - { - SetColorToSliderValues(); - UpdateBackground(); - } - + SetColorToSliderValues(); + UpdateBackground(); UpdatePseudoClasses(); + OnColorChanged(new ColorChangedEventArgs( change.GetOldValue(), change.GetNewValue())); - disableUpdates = false; + ignorePropertyChanged = false; + } + else if (change.Property == ColorModelProperty) + { + ignorePropertyChanged = true; + + SetColorToSliderValues(); + UpdateBackground(); + UpdatePseudoClasses(); + + ignorePropertyChanged = false; } else if (change.Property == HsvColorProperty) { - disableUpdates = true; + ignorePropertyChanged = true; Color = HsvColor.ToRgb(); - if (IsAutoUpdatingEnabled) - { - SetColorToSliderValues(); - UpdateBackground(); - } - + SetColorToSliderValues(); + UpdateBackground(); UpdatePseudoClasses(); + OnColorChanged(new ColorChangedEventArgs( change.GetOldValue().ToRgb(), change.GetNewValue().ToRgb())); - disableUpdates = false; + ignorePropertyChanged = false; + } + else if (change.Property == IsRoundingEnabledProperty) + { + SetColorToSliderValues(); } else if (change.Property == BoundsProperty) { - if (IsAutoUpdatingEnabled) - { - UpdateBackground(); - } + UpdateBackground(); } else if (change.Property == ValueProperty || change.Property == MinimumProperty || change.Property == MaximumProperty) { - disableUpdates = true; + ignorePropertyChanged = true; Color oldColor = Color; (var color, var hsvColor) = GetColorFromSliderValues(); @@ -381,7 +424,7 @@ namespace Avalonia.Controls.Primitives UpdatePseudoClasses(); OnColorChanged(new ColorChangedEventArgs(oldColor, Color)); - disableUpdates = false; + ignorePropertyChanged = false; } base.OnPropertyChanged(change); diff --git a/src/Avalonia.Controls.ColorPicker/ColorSpectrum/ColorSpectrum.Properties.cs b/src/Avalonia.Controls.ColorPicker/ColorSpectrum/ColorSpectrum.Properties.cs index 587a89ee38..00d84f5dd3 100644 --- a/src/Avalonia.Controls.ColorPicker/ColorSpectrum/ColorSpectrum.Properties.cs +++ b/src/Avalonia.Controls.ColorPicker/ColorSpectrum/ColorSpectrum.Properties.cs @@ -97,7 +97,7 @@ namespace Avalonia.Controls.Primitives /// Gets or sets the currently selected color in the RGB color model. /// /// - /// For control authors use instead to avoid loss + /// For control authors, use instead to avoid loss /// of precision and color drifting. /// public Color Color diff --git a/src/Avalonia.Controls.ColorPicker/ColorSpectrum/ColorSpectrum.cs b/src/Avalonia.Controls.ColorPicker/ColorSpectrum/ColorSpectrum.cs index 7e6b70a146..bd44161a42 100644 --- a/src/Avalonia.Controls.ColorPicker/ColorSpectrum/ColorSpectrum.cs +++ b/src/Avalonia.Controls.ColorPicker/ColorSpectrum/ColorSpectrum.cs @@ -44,7 +44,6 @@ namespace Avalonia.Controls.Primitives private bool _updatingColor = false; private bool _updatingHsvColor = false; - private bool _isPointerOver = false; private bool _isPointerPressed = false; private bool _shouldShowLargeSelection = false; private List _hsvValues = new List(); @@ -851,7 +850,6 @@ namespace Avalonia.Controls.Primitives /// private void InputTarget_PointerEntered(object? sender, PointerEventArgs args) { - _isPointerOver = true; UpdatePseudoClasses(); args.Handled = true; } @@ -859,7 +857,6 @@ namespace Avalonia.Controls.Primitives /// private void InputTarget_PointerExited(object? sender, PointerEventArgs args) { - _isPointerOver = false; UpdatePseudoClasses(); args.Handled = true; } diff --git a/src/Avalonia.Controls.ColorPicker/ColorView/ColorView.Properties.cs b/src/Avalonia.Controls.ColorPicker/ColorView/ColorView.Properties.cs new file mode 100644 index 0000000000..b76059037b --- /dev/null +++ b/src/Avalonia.Controls.ColorPicker/ColorView/ColorView.Properties.cs @@ -0,0 +1,495 @@ +using System.Collections.Generic; +using Avalonia.Controls.Primitives; +using Avalonia.Data; +using Avalonia.Media; + +namespace Avalonia.Controls +{ + /// + public partial class ColorView + { + /// + /// Defines the property. + /// + public static readonly StyledProperty ColorProperty = + AvaloniaProperty.Register( + nameof(Color), + Colors.White, + defaultBindingMode: BindingMode.TwoWay, + coerce: CoerceColor) ; + + /// + /// Defines the property. + /// + public static readonly StyledProperty ColorModelProperty = + AvaloniaProperty.Register( + nameof(ColorModel), + ColorModel.Rgba); + + /// + /// Defines the property. + /// + public static readonly StyledProperty ColorSpectrumComponentsProperty = + AvaloniaProperty.Register( + nameof(ColorSpectrumComponents), + ColorSpectrumComponents.HueSaturation); + + /// + /// Defines the property. + /// + public static readonly StyledProperty ColorSpectrumShapeProperty = + AvaloniaProperty.Register( + nameof(ColorSpectrumShape), + ColorSpectrumShape.Box); + + /// + /// Defines the property. + /// + public static readonly StyledProperty HsvColorProperty = + AvaloniaProperty.Register( + nameof(HsvColor), + Colors.White.ToHsv(), + defaultBindingMode: BindingMode.TwoWay, + coerce: CoerceHsvColor); + + /// + /// Defines the property. + /// + public static readonly StyledProperty IsAccentColorsVisibleProperty = + AvaloniaProperty.Register( + nameof(IsAccentColorsVisible), + true); + + /// + /// Defines the property. + /// + public static readonly StyledProperty IsAlphaEnabledProperty = + AvaloniaProperty.Register( + nameof(IsAlphaEnabled), + true); + + /// + /// Defines the property. + /// + public static readonly StyledProperty IsAlphaVisibleProperty = + AvaloniaProperty.Register( + nameof(IsAlphaVisible), + true); + + /// + /// Defines the property. + /// + public static readonly StyledProperty IsColorComponentsVisibleProperty = + AvaloniaProperty.Register( + nameof(IsColorComponentsVisible), + true); + + /// + /// Defines the property. + /// + public static readonly StyledProperty IsColorModelVisibleProperty = + AvaloniaProperty.Register( + nameof(IsColorModelVisible), + true); + + /// + /// Defines the property. + /// + public static readonly StyledProperty IsColorPaletteVisibleProperty = + AvaloniaProperty.Register( + nameof(IsColorPaletteVisible), + true); + + /// + /// Defines the property. + /// + public static readonly StyledProperty IsColorPreviewVisibleProperty = + AvaloniaProperty.Register( + nameof(IsColorPreviewVisible), + true); + + /// + /// Defines the property. + /// + public static readonly StyledProperty IsColorSpectrumVisibleProperty = + AvaloniaProperty.Register( + nameof(IsColorSpectrumVisible), + true); + + /// + /// Defines the property. + /// + public static readonly StyledProperty IsColorSpectrumSliderVisibleProperty = + AvaloniaProperty.Register( + nameof(IsColorSpectrumSliderVisible), + true); + + /// + /// Defines the property. + /// + public static readonly StyledProperty IsComponentSliderVisibleProperty = + AvaloniaProperty.Register( + nameof(IsComponentSliderVisible), + true); + + /// + /// Defines the property. + /// + public static readonly StyledProperty IsComponentTextInputVisibleProperty = + AvaloniaProperty.Register( + nameof(IsComponentTextInputVisible), + true); + + /// + /// Defines the property. + /// + public static readonly StyledProperty IsHexInputVisibleProperty = + AvaloniaProperty.Register( + nameof(IsHexInputVisible), + true); + + /// + /// Defines the property. + /// + public static readonly StyledProperty MaxHueProperty = + AvaloniaProperty.Register( + nameof(MaxHue), + 359); + + /// + /// Defines the property. + /// + public static readonly StyledProperty MaxSaturationProperty = + AvaloniaProperty.Register( + nameof(MaxSaturation), + 100); + + /// + /// Defines the property. + /// + public static readonly StyledProperty MaxValueProperty = + AvaloniaProperty.Register( + nameof(MaxValue), + 100); + + /// + /// Defines the property. + /// + public static readonly StyledProperty MinHueProperty = + AvaloniaProperty.Register( + nameof(MinHue), + 0); + + /// + /// Defines the property. + /// + public static readonly StyledProperty MinSaturationProperty = + AvaloniaProperty.Register( + nameof(MinSaturation), + 0); + + /// + /// Defines the property. + /// + public static readonly StyledProperty MinValueProperty = + AvaloniaProperty.Register( + nameof(MinValue), + 0); + + /// + /// Defines the property. + /// + public static readonly StyledProperty?> PaletteColorsProperty = + AvaloniaProperty.Register?>( + nameof(PaletteColors), + null); + + /// + /// Defines the property. + /// + public static readonly StyledProperty PaletteColumnCountProperty = + AvaloniaProperty.Register( + nameof(PaletteColumnCount), + 4); + + /// + /// Defines the property. + /// + public static readonly StyledProperty PaletteProperty = + AvaloniaProperty.Register( + nameof(Palette), + null); + + /// + /// Defines the property. + /// + public static readonly StyledProperty SelectedIndexProperty = + AvaloniaProperty.Register( + nameof(SelectedIndex), + (int)ColorViewTab.Spectrum); + + /// + public Color Color + { + get => GetValue(ColorProperty); + set => SetValue(ColorProperty, value); + } + + /// + /// + /// This property is only applicable to the components tab. + /// The spectrum tab must always be in HSV and the palette tab contains only pre-defined colors. + /// + public ColorModel ColorModel + { + get => GetValue(ColorModelProperty); + set => SetValue(ColorModelProperty, value); + } + + /// + public ColorSpectrumComponents ColorSpectrumComponents + { + get => GetValue(ColorSpectrumComponentsProperty); + set => SetValue(ColorSpectrumComponentsProperty, value); + } + + /// + public ColorSpectrumShape ColorSpectrumShape + { + get => GetValue(ColorSpectrumShapeProperty); + set => SetValue(ColorSpectrumShapeProperty, value); + } + + /// + public HsvColor HsvColor + { + get => GetValue(HsvColorProperty); + set => SetValue(HsvColorProperty, value); + } + + /// + public bool IsAccentColorsVisible + { + get => GetValue(IsAccentColorsVisibleProperty); + set => SetValue(IsAccentColorsVisibleProperty, value); + } + + /// + /// Gets or sets a value indicating whether the alpha component is enabled. + /// When disabled (set to false) the alpha component will be fixed to maximum and + /// editing controls disabled. + /// + public bool IsAlphaEnabled + { + get => GetValue(IsAlphaEnabledProperty); + set => SetValue(IsAlphaEnabledProperty, value); + } + + /// + /// Gets or sets a value indicating whether the alpha component editing controls + /// (Slider(s) and TextBox) are visible. When hidden, the existing alpha component + /// value is maintained. + /// + /// + /// Note that also controls the alpha + /// component TextBox visibility. + /// + public bool IsAlphaVisible + { + get => GetValue(IsAlphaVisibleProperty); + set => SetValue(IsAlphaVisibleProperty, value); + } + + /// + /// Gets or sets a value indicating whether the color components tab/panel/page (subview) is visible. + /// + public bool IsColorComponentsVisible + { + get => GetValue(IsColorComponentsVisibleProperty); + set => SetValue(IsColorComponentsVisibleProperty, value); + } + + /// + /// Gets or sets a value indicating whether the active color model indicator/selector is visible. + /// + public bool IsColorModelVisible + { + get => GetValue(IsColorModelVisibleProperty); + set => SetValue(IsColorModelVisibleProperty, value); + } + + /// + /// Gets or sets a value indicating whether the color palette tab/panel/page (subview) is visible. + /// + public bool IsColorPaletteVisible + { + get => GetValue(IsColorPaletteVisibleProperty); + set => SetValue(IsColorPaletteVisibleProperty, value); + } + + /// + /// Gets or sets a value indicating whether the color preview is visible. + /// + /// + /// Note that accent color visibility is controlled separately by + /// . + /// + public bool IsColorPreviewVisible + { + get => GetValue(IsColorPreviewVisibleProperty); + set => SetValue(IsColorPreviewVisibleProperty, value); + } + + /// + /// Gets or sets a value indicating whether the color spectrum tab/panel/page (subview) is visible. + /// + public bool IsColorSpectrumVisible + { + get => GetValue(IsColorSpectrumVisibleProperty); + set => SetValue(IsColorSpectrumVisibleProperty, value); + } + + /// + /// Gets or sets a value indicating whether the color spectrum's third component slider + /// is visible. + /// + public bool IsColorSpectrumSliderVisible + { + get => GetValue(IsColorSpectrumSliderVisibleProperty); + set => SetValue(IsColorSpectrumSliderVisibleProperty, value); + } + + /// + /// Gets or sets a value indicating whether color component sliders are visible. + /// + /// + /// All color components are controlled by this property but alpha can also be + /// controlled with . + /// + public bool IsComponentSliderVisible + { + get => GetValue(IsComponentSliderVisibleProperty); + set => SetValue(IsComponentSliderVisibleProperty, value); + } + + /// + /// Gets or sets a value indicating whether color component text inputs are visible. + /// + /// + /// All color components are controlled by this property but alpha can also be + /// controlled with . + /// + public bool IsComponentTextInputVisible + { + get => GetValue(IsComponentTextInputVisibleProperty); + set => SetValue(IsComponentTextInputVisibleProperty, value); + } + + /// + /// Gets or sets a value indicating whether the hexadecimal color value text input + /// is visible. + /// + public bool IsHexInputVisible + { + get => GetValue(IsHexInputVisibleProperty); + set => SetValue(IsHexInputVisibleProperty, value); + } + + /// + public int MaxHue + { + get => GetValue(MaxHueProperty); + set => SetValue(MaxHueProperty, value); + } + + /// + public int MaxSaturation + { + get => GetValue(MaxSaturationProperty); + set => SetValue(MaxSaturationProperty, value); + } + + /// + public int MaxValue + { + get => GetValue(MaxValueProperty); + set => SetValue(MaxValueProperty, value); + } + + /// + public int MinHue + { + get => GetValue(MinHueProperty); + set => SetValue(MinHueProperty, value); + } + + /// + public int MinSaturation + { + get => GetValue(MinSaturationProperty); + set => SetValue(MinSaturationProperty, value); + } + + /// + public int MinValue + { + get => GetValue(MinValueProperty); + set => SetValue(MinValueProperty, value); + } + + /// + /// Gets or sets the collection of individual colors in the palette. + /// + /// + /// This is not commonly set manually. Instead, it should be set automatically by + /// providing an to the property. + ///

+ /// Also note that this property is what should be bound in the control template. + /// is too high-level to use on its own. + ///
+ public IEnumerable? PaletteColors + { + get => GetValue(PaletteColorsProperty); + set => SetValue(PaletteColorsProperty, value); + } + + /// + /// Gets or sets the number of colors in each row (section) of the color palette. + /// Within a standard palette, rows are shades and columns are colors. + /// + /// + /// This is not commonly set manually. Instead, it should be set automatically by + /// providing an to the property. + ///

+ /// Also note that this property is what should be bound in the control template. + /// is too high-level to use on its own. + ///
+ public int PaletteColumnCount + { + get => GetValue(PaletteColumnCountProperty); + set => SetValue(PaletteColumnCountProperty, value); + } + + /// + /// Gets or sets the color palette. + /// + /// + /// This will automatically set both and + /// overwriting any existing values. + /// + public IColorPalette? Palette + { + get => GetValue(PaletteProperty); + set => SetValue(PaletteProperty, value); + } + + /// + /// Gets or sets the index of the selected tab/panel/page (subview). + /// + public int SelectedIndex + { + get => GetValue(SelectedIndexProperty); + set => SetValue(SelectedIndexProperty, value); + } + } +} diff --git a/src/Avalonia.Controls.ColorPicker/ColorView/ColorView.cs b/src/Avalonia.Controls.ColorPicker/ColorView/ColorView.cs new file mode 100644 index 0000000000..89f1afb1ac --- /dev/null +++ b/src/Avalonia.Controls.ColorPicker/ColorView/ColorView.cs @@ -0,0 +1,379 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Globalization; +using Avalonia.Controls.Converters; +using Avalonia.Controls.Metadata; +using Avalonia.Controls.Presenters; +using Avalonia.Controls.Primitives; +using Avalonia.Media; +using Avalonia.Threading; +using Avalonia.VisualTree; + +namespace Avalonia.Controls +{ + /// + /// Presents a color for user editing using a spectrum, palette and component sliders. + /// + [TemplatePart("PART_HexTextBox", typeof(TextBox))] + [TemplatePart("PART_TabControl", typeof(TabControl))] + public partial class ColorView : TemplatedControl + { + /// + /// Event for when the selected color changes within the slider. + /// + public event EventHandler? ColorChanged; + + // XAML template parts + private TextBox? _hexTextBox; + private TabControl? _tabControl; + + private ColorToHexConverter colorToHexConverter = new ColorToHexConverter(); + protected bool ignorePropertyChanged = false; + + /// + /// Initializes a new instance of the class. + /// + public ColorView() : base() + { + } + + /// + /// Gets the value of the hex TextBox and sets it as the current . + /// If invalid, the TextBox hex text will revert back to the last valid color. + /// + private void GetColorFromHexTextBox() + { + if (_hexTextBox != null) + { + var convertedColor = colorToHexConverter.ConvertBack(_hexTextBox.Text, typeof(Color), null, CultureInfo.CurrentCulture); + + if (convertedColor is Color color) + { + Color = color; + } + + // Re-apply the hex value + // This ensure the hex color value is always valid and formatted correctly + SetColorToHexTextBox(); + } + } + + /// + /// Sets the current to the hex TextBox. + /// + private void SetColorToHexTextBox() + { + if (_hexTextBox != null) + { + _hexTextBox.Text = colorToHexConverter.Convert(Color, typeof(string), null, CultureInfo.CurrentCulture) as string; + } + } + + /// + /// Validates the tab/panel/page selection taking into account the visibility of each item + /// as well as the current selection. + /// + /// + /// Derived controls may re-implement this based on their default style / control template + /// and any specialized selection needs. + /// + protected virtual void ValidateSelection() + { + if (_tabControl != null && + _tabControl.Items != null) + { + // Determine the number of visible tab items + int numVisibleItems = 0; + foreach (var item in _tabControl.Items) + { + if (item is Control control && + control.IsVisible) + { + numVisibleItems++; + } + } + + // Verify the selection + if (numVisibleItems > 0) + { + object? selectedItem = null; + + if (_tabControl.SelectedItem == null && + _tabControl.ItemCount > 0) + { + // As a failsafe, forcefully select the first item + foreach (var item in _tabControl.Items) + { + selectedItem = item; + break; + } + } + else + { + selectedItem = _tabControl.SelectedItem; + } + + if (selectedItem is Control selectedControl && + selectedControl.IsVisible == false) + { + // Select the first visible item instead + foreach (var item in _tabControl.Items) + { + if (item is Control control && + control.IsVisible) + { + selectedItem = item; + break; + } + } + } + + _tabControl.SelectedItem = selectedItem; + _tabControl.IsVisible = true; + } + else + { + // Special case when all items are hidden + // If TabControl ever properly supports no selected item / + // all items hidden this can be removed + _tabControl.SelectedItem = null; + _tabControl.IsVisible = false; + } + + // Hide the "tab strip" if there is only one tab + // This allows, for example, to view only the palette + /* + var itemsPresenter = _tabControl.FindDescendantOfType(); + if (itemsPresenter != null) + { + if (numVisibleItems == 1) + { + itemsPresenter.IsVisible = false; + } + else + { + itemsPresenter.IsVisible = true; + } + } + */ + + // Note that if externally the SelectedIndex is set to 4 or something + // outside the valid range, the TabControl will ignore it and replace it + // with a valid SelectedIndex. This however is not propagated back through + // the TwoWay binding in the control template so the SelectedIndex and + // SelectedIndex become out of sync. + // + // The work-around for this is done here where SelectedIndex is forcefully + // synchronized with whatever the TabControl property value is. This is + // possible since selection validation is already done by this method. + SelectedIndex = _tabControl.SelectedIndex; + } + + return; + } + + /// + protected override void OnApplyTemplate(TemplateAppliedEventArgs e) + { + if (_hexTextBox != null) + { + _hexTextBox.KeyDown -= HexTextBox_KeyDown; + _hexTextBox.LostFocus -= HexTextBox_LostFocus; + } + + _hexTextBox = e.NameScope.Find("PART_HexTextBox"); + _tabControl = e.NameScope.Find("PART_TabControl"); + + SetColorToHexTextBox(); + + if (_hexTextBox != null) + { + _hexTextBox.KeyDown += HexTextBox_KeyDown; + _hexTextBox.LostFocus += HexTextBox_LostFocus; + } + + base.OnApplyTemplate(e); + ValidateSelection(); + } + + /// + protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) + { + if (ignorePropertyChanged) + { + base.OnPropertyChanged(change); + return; + } + + // Always keep the two color properties in sync + if (change.Property == ColorProperty) + { + ignorePropertyChanged = true; + + HsvColor = Color.ToHsv(); + SetColorToHexTextBox(); + + OnColorChanged(new ColorChangedEventArgs( + change.GetOldValue(), + change.GetNewValue())); + + ignorePropertyChanged = false; + } + else if (change.Property == HsvColorProperty) + { + ignorePropertyChanged = true; + + Color = HsvColor.ToRgb(); + SetColorToHexTextBox(); + + OnColorChanged(new ColorChangedEventArgs( + change.GetOldValue().ToRgb(), + change.GetNewValue().ToRgb())); + + ignorePropertyChanged = false; + } + else if (change.Property == PaletteProperty) + { + IColorPalette? palette = Palette; + + // Any custom palette change must be automatically synced with the + // bound properties controlling the palette grid + if (palette != null) + { + PaletteColumnCount = palette.ColorCount; + + List newPaletteColors = new List(); + for (int shadeIndex = 0; shadeIndex < palette.ShadeCount; shadeIndex++) + { + for (int colorIndex = 0; colorIndex < palette.ColorCount; colorIndex++) + { + newPaletteColors.Add(palette.GetColor(colorIndex, shadeIndex)); + } + } + + PaletteColors = newPaletteColors; + } + } + else if (change.Property == IsAlphaEnabledProperty) + { + // Manually coerce the HsvColor value + // (Color will be coerced automatically if HsvColor changes) + HsvColor = OnCoerceHsvColor(HsvColor); + } + else if (change.Property == IsColorComponentsVisibleProperty || + change.Property == IsColorPaletteVisibleProperty || + change.Property == IsColorSpectrumVisibleProperty) + { + // When the property changed notification is received here the visibility + // of individual tab items has not yet been updated through the bindings. + // Therefore, the validation is delayed until after bindings update. + Dispatcher.UIThread.Post(() => + { + ValidateSelection(); + }, DispatcherPriority.Background); + } + else if (change.Property == SelectedIndexProperty) + { + // Again, it is necessary to wait for the SelectedIndex value to + // be applied to the TabControl through binding before validation occurs. + Dispatcher.UIThread.Post(() => + { + ValidateSelection(); + }, DispatcherPriority.Background); + } + + base.OnPropertyChanged(change); + } + + /// + /// Called before the event occurs. + /// + /// The defining old/new colors. + protected virtual void OnColorChanged(ColorChangedEventArgs e) + { + ColorChanged?.Invoke(this, e); + } + + /// + /// Called when the property has to be coerced. + /// + /// The value to coerce. + protected virtual Color OnCoerceColor(Color value) + { + if (IsAlphaEnabled == false) + { + return new Color(255, value.R, value.G, value.B); + } + + return value; + } + + /// + /// Called when the property has to be coerced. + /// + /// The value to coerce. + protected virtual HsvColor OnCoerceHsvColor(HsvColor value) + { + if (IsAlphaEnabled == false) + { + return new HsvColor(1.0, value.H, value.S, value.V); + } + + return value; + } + + /// + /// Coerces/validates the property value. + /// + /// The instance. + /// The value to coerce. + /// The coerced/validated value. + private static Color CoerceColor(IAvaloniaObject instance, Color value) + { + if (instance is ColorView colorView) + { + return colorView.OnCoerceColor(value); + } + + return value; + } + + /// + /// Coerces/validates the property value. + /// + /// The instance. + /// The value to coerce. + /// The coerced/validated value. + private static HsvColor CoerceHsvColor(IAvaloniaObject instance, HsvColor value) + { + if (instance is ColorView colorView) + { + return colorView.OnCoerceHsvColor(value); + } + + return value; + } + + /// + /// Event handler for when a key is pressed within the Hex RGB value TextBox. + /// This is used to trigger re-evaluation of the color based on the TextBox value. + /// + private void HexTextBox_KeyDown(object? sender, Input.KeyEventArgs e) + { + if (e.Key == Input.Key.Enter) + { + GetColorFromHexTextBox(); + } + } + + /// + /// Event handler for when the Hex RGB value TextBox looses focus. + /// This is used to trigger re-evaluation of the color based on the TextBox value. + /// + private void HexTextBox_LostFocus(object? sender, Interactivity.RoutedEventArgs e) + { + GetColorFromHexTextBox(); + } + } +} diff --git a/src/Avalonia.Controls.ColorPicker/ColorView/ColorViewTab.cs b/src/Avalonia.Controls.ColorPicker/ColorView/ColorViewTab.cs new file mode 100644 index 0000000000..582653e295 --- /dev/null +++ b/src/Avalonia.Controls.ColorPicker/ColorView/ColorViewTab.cs @@ -0,0 +1,26 @@ +namespace Avalonia.Controls +{ + /// + /// Defines a specific tab/page (subview) within the . + /// + /// + /// This is indexed to match the default control template ordering. + /// + public enum ColorViewTab + { + /// + /// The color spectrum subview with a box/ring spectrum and sliders. + /// + Spectrum = 0, + + /// + /// The color palette subview with a grid of selectable colors. + /// + Palette = 1, + + /// + /// The components subview with sliders and numeric input boxes. + /// + Components = 2, + } +} diff --git a/src/Avalonia.Controls.ColorPicker/Converters/AccentColorConverter.cs b/src/Avalonia.Controls.ColorPicker/Converters/AccentColorConverter.cs index 4d05222e31..2c8e09adc9 100644 --- a/src/Avalonia.Controls.ColorPicker/Converters/AccentColorConverter.cs +++ b/src/Avalonia.Controls.ColorPicker/Converters/AccentColorConverter.cs @@ -7,8 +7,10 @@ namespace Avalonia.Controls.Primitives.Converters { /// /// Creates an accent color for a given base color value and step parameter. - /// This is a highly-specialized converter for the color picker. /// + /// + /// This is a highly-specialized converter for the color picker. + /// public class AccentColorConverter : IValueConverter { /// diff --git a/src/Avalonia.Controls.ColorPicker/Converters/ColorToHexConverter.cs b/src/Avalonia.Controls.ColorPicker/Converters/ColorToHexConverter.cs index 9b09073d9d..8d5f2332be 100644 --- a/src/Avalonia.Controls.ColorPicker/Converters/ColorToHexConverter.cs +++ b/src/Avalonia.Controls.ColorPicker/Converters/ColorToHexConverter.cs @@ -42,7 +42,7 @@ namespace Avalonia.Controls.Converters return AvaloniaProperty.UnsetValue; } - string hexColor = color.ToString(); + string hexColor = color.ToUint32().ToString("x8", CultureInfo.InvariantCulture).ToUpperInvariant(); if (includeSymbol == false) { diff --git a/src/Avalonia.Controls.ColorPicker/Converters/ContrastBrushConverter.cs b/src/Avalonia.Controls.ColorPicker/Converters/ContrastBrushConverter.cs new file mode 100644 index 0000000000..8b66b1a4e5 --- /dev/null +++ b/src/Avalonia.Controls.ColorPicker/Converters/ContrastBrushConverter.cs @@ -0,0 +1,87 @@ +using System; +using System.Globalization; +using Avalonia.Controls.Converters; +using Avalonia.Data.Converters; +using Avalonia.Media; + +namespace Avalonia.Controls.Primitives.Converters +{ + /// + /// Gets a , either black or white, depending on the luminance of the supplied color. + /// A default color supplied in the converter parameter may be returned if alpha is below the set threshold. + /// + /// + /// This is a highly-specialized converter for the color picker. + /// + public class ContrastBrushConverter : IValueConverter + { + private ToColorConverter toColorConverter = new ToColorConverter(); + + /// + /// Gets or sets the alpha channel threshold below which a default color is used instead of black/white. + /// + public byte AlphaThreshold { get; set; } = 128; + + /// + public object? Convert( + object? value, + Type targetType, + object? parameter, + CultureInfo culture) + { + Color comparisonColor; + Color? defaultColor = null; + + // Get the changing color to compare against + var convertedValue = toColorConverter.Convert(value, targetType, parameter, culture); + if (convertedValue is Color valueColor) + { + comparisonColor = valueColor; + } + else + { + // Invalid color value provided + return AvaloniaProperty.UnsetValue; + } + + // Get the default color when transparency is high + var convertedParameter = toColorConverter.Convert(parameter, targetType, parameter, culture); + if (convertedParameter is Color parameterColor) + { + defaultColor = parameterColor; + } + + if (comparisonColor.A < AlphaThreshold && + defaultColor.HasValue) + { + // If the transparency is less than the threshold, just use the default brush + // This can commonly be something like the TextControlForeground brush + return new SolidColorBrush(defaultColor.Value); + } + else + { + // Chose a white/black brush based on contrast to the base color + if (ColorHelper.GetRelativeLuminance(comparisonColor) <= 0.5) + { + // Dark color, return light for contrast + return new SolidColorBrush(Colors.White); + } + else + { + // Bright color, return dark for contrast + return new SolidColorBrush(Colors.Black); + } + } + } + + /// + public object? ConvertBack( + object? value, + Type targetType, + object? parameter, + CultureInfo culture) + { + return AvaloniaProperty.UnsetValue; + } + } +} diff --git a/src/Avalonia.Controls.ColorPicker/Converters/ThirdComponentConverter.cs b/src/Avalonia.Controls.ColorPicker/Converters/ThirdComponentConverter.cs index 220a993f99..11e33c74f0 100644 --- a/src/Avalonia.Controls.ColorPicker/Converters/ThirdComponentConverter.cs +++ b/src/Avalonia.Controls.ColorPicker/Converters/ThirdComponentConverter.cs @@ -7,8 +7,10 @@ namespace Avalonia.Controls.Primitives.Converters /// /// Gets the third corresponding with a given /// that represents the other two components. - /// This is a highly-specialized converter for the color picker. /// + /// + /// This is a highly-specialized converter for the color picker. + /// public class ThirdComponentConverter : IValueConverter { /// diff --git a/src/Avalonia.Controls.ColorPicker/Converters/ValueConverterGroup.cs b/src/Avalonia.Controls.ColorPicker/Converters/ValueConverterGroup.cs deleted file mode 100644 index 2710c220f4..0000000000 --- a/src/Avalonia.Controls.ColorPicker/Converters/ValueConverterGroup.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using Avalonia.Data.Converters; - -namespace Avalonia.Controls.Primitives.Converters -{ - /// - /// Converter to chain together multiple converters. - /// - public class ValueConverterGroup : List, IValueConverter - { - /// - /// - public object? Convert( - object? value, - Type targetType, - object? parameter, - CultureInfo culture) - { - object? curValue; - - curValue = value; - for (int i = 0; i < Count; i++) - { - curValue = this[i].Convert(curValue, targetType, parameter, culture); - } - - return curValue; - } - - /// - public object? ConvertBack( - object? value, - Type targetType, - object? parameter, - CultureInfo culture) - { - object? curValue; - - curValue = value; - for (int i = (Count - 1); i >= 0; i--) - { - curValue = this[i].ConvertBack(curValue, targetType, parameter, culture); - } - - return curValue; - } - } -} diff --git a/src/Avalonia.Controls.ColorPicker/Helpers/ColorHelper.cs b/src/Avalonia.Controls.ColorPicker/Helpers/ColorHelper.cs index 32a898ee71..7dc340ea16 100644 --- a/src/Avalonia.Controls.ColorPicker/Helpers/ColorHelper.cs +++ b/src/Avalonia.Controls.ColorPicker/Helpers/ColorHelper.cs @@ -64,6 +64,10 @@ namespace Avalonia.Controls.Primitives // It is also needlessly large as there are only ~140 known/named colors. // Therefore, rounding of the input color's component values is done to // reduce the color space into something more useful. + // + // The rounding value of 5 is specially chosen. + // It is a factor of 255 and therefore evenly divisible which improves + // the quality of the calculations. double rounding = 5; var roundedColor = new Color( 0xFF, diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Default/ColorPreviewer.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Default/ColorPreviewer.xaml index 15e5ca1655..c3bc7df4a4 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Default/ColorPreviewer.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Default/ColorPreviewer.xaml @@ -1,84 +1,100 @@  - - - - + + 80 + 40 diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Default/ColorSlider.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Default/ColorSlider.xaml index 19f10201a5..35cd7a9faa 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Default/ColorSlider.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Default/ColorSlider.xaml @@ -1,13 +1,7 @@  - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPreviewer.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPreviewer.xaml index cb764a738c..74f33d1258 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPreviewer.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorPreviewer.xaml @@ -1,84 +1,100 @@  - - - - + + 80 + 40 diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorSlider.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorSlider.xaml index 18a081721a..162ac372de 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorSlider.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/ColorSlider.xaml @@ -1,13 +1,7 @@  - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml index c25d79727f..186b6de9bc 100644 --- a/src/Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml +++ b/src/Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml @@ -1,8 +1,10 @@ + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:converters="using:Avalonia.Controls.Converters"> - + @@ -18,6 +20,16 @@ + + + + + + + + + + @@ -25,4 +37,8 @@ + + + + diff --git a/src/Avalonia.Controls.DataGrid/Collections/DataGridSortDescription.cs b/src/Avalonia.Controls.DataGrid/Collections/DataGridSortDescription.cs index ca6020128c..ff222658db 100644 --- a/src/Avalonia.Controls.DataGrid/Collections/DataGridSortDescription.cs +++ b/src/Avalonia.Controls.DataGrid/Collections/DataGridSortDescription.cs @@ -268,11 +268,11 @@ namespace Avalonia.Collections public static DataGridSortDescription FromComparer(IComparer comparer, ListSortDirection direction = ListSortDirection.Ascending) { - return new DataGridComparerSortDesctiption(comparer, direction); + return new DataGridComparerSortDescription(comparer, direction); } } - public class DataGridComparerSortDesctiption : DataGridSortDescription + public class DataGridComparerSortDescription : DataGridSortDescription { private readonly IComparer _innerComparer; private readonly ListSortDirection _direction; @@ -281,7 +281,7 @@ namespace Avalonia.Collections public IComparer SourceComparer => _innerComparer; public override IComparer Comparer => _comparer; public override ListSortDirection Direction => _direction; - public DataGridComparerSortDesctiption(IComparer comparer, ListSortDirection direction) + public DataGridComparerSortDescription(IComparer comparer, ListSortDirection direction) { _innerComparer = comparer; _direction = direction; @@ -300,7 +300,7 @@ namespace Avalonia.Collections public override DataGridSortDescription SwitchSortDirection() { var newDirection = _direction == ListSortDirection.Ascending ? ListSortDirection.Descending : ListSortDirection.Ascending; - return new DataGridComparerSortDesctiption(_innerComparer, newDirection); + return new DataGridComparerSortDescription(_innerComparer, newDirection); } } diff --git a/src/Avalonia.Controls.DataGrid/DataGrid.cs b/src/Avalonia.Controls.DataGrid/DataGrid.cs index aaac3f8f9c..d42468f47e 100644 --- a/src/Avalonia.Controls.DataGrid/DataGrid.cs +++ b/src/Avalonia.Controls.DataGrid/DataGrid.cs @@ -5990,15 +5990,14 @@ namespace Avalonia.Controls /// The formatted string. private string FormatClipboardContent(DataGridRowClipboardEventArgs e) { - StringBuilder text = new StringBuilder(); - for (int cellIndex = 0; cellIndex < e.ClipboardRowContent.Count; cellIndex++) - { - DataGridClipboardCellContent cellContent = e.ClipboardRowContent[cellIndex]; - if (cellContent != null) - { - text.Append(cellContent.Content); - } - if (cellIndex < e.ClipboardRowContent.Count - 1) + var text = new StringBuilder(); + var clipboardRowContent = e.ClipboardRowContent; + var numberOfItem = clipboardRowContent.Count; + for (int cellIndex = 0; cellIndex < numberOfItem; cellIndex++) + { + var cellContent = clipboardRowContent[cellIndex]; + text.Append(cellContent.Content); + if (cellIndex < numberOfItem - 1) { text.Append('\t'); } diff --git a/src/Avalonia.Controls.DataGrid/DataGridColumn.cs b/src/Avalonia.Controls.DataGrid/DataGridColumn.cs index c415f477d4..e57d6bbde2 100644 --- a/src/Avalonia.Controls.DataGrid/DataGridColumn.cs +++ b/src/Avalonia.Controls.DataGrid/DataGridColumn.cs @@ -1091,7 +1091,7 @@ namespace Avalonia.Controls { return OwningGrid.DataConnection.SortDescriptions - .OfType() + .OfType() .FirstOrDefault(s => s.SourceComparer == CustomSortComparer); } diff --git a/src/Avalonia.Controls.DataGrid/Primitives/DataGridRowsPresenter.cs b/src/Avalonia.Controls.DataGrid/Primitives/DataGridRowsPresenter.cs index 5d82689eff..d906cd359c 100644 --- a/src/Avalonia.Controls.DataGrid/Primitives/DataGridRowsPresenter.cs +++ b/src/Avalonia.Controls.DataGrid/Primitives/DataGridRowsPresenter.cs @@ -97,7 +97,7 @@ namespace Avalonia.Controls.Primitives OwningGrid.OnFillerColumnWidthNeeded(finalSize.Width); - double rowDesiredWidth = OwningGrid.ColumnsInternal.VisibleEdgedColumnsWidth + OwningGrid.ColumnsInternal.FillerColumn.FillerWidth; + double rowDesiredWidth = OwningGrid.RowHeadersDesiredWidth + OwningGrid.ColumnsInternal.VisibleEdgedColumnsWidth + OwningGrid.ColumnsInternal.FillerColumn.FillerWidth; double topEdge = -OwningGrid.NegVerticalOffset; foreach (Control element in OwningGrid.DisplayData.GetScrollingElements()) { diff --git a/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml b/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml index 2baa8c88c9..fb032fec3e 100644 --- a/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml +++ b/src/Avalonia.Controls.DataGrid/Themes/Fluent.xaml @@ -7,7 +7,7 @@ M1875 1011l-787 787v-1798h-128v1798l-787 -787l-90 90l941 941l941 -941z M1965 947l-941 -941l-941 941l90 90l787 -787v1798h128v-1798l787 787z M515 93l930 931l-930 931l90 90l1022 -1021l-1022 -1021z - M1939 1581l90 -90l-1005 -1005l-1005 1005l90 90l915 -915z + M109 486 19 576 1024 1581 2029 576 1939 486 1024 1401z @@ -499,12 +499,12 @@ diff --git a/src/Avalonia.Controls/Automation/Peers/ControlAutomationPeer.cs b/src/Avalonia.Controls/Automation/Peers/ControlAutomationPeer.cs index 28cb3e34b2..a93d3fa7dd 100644 --- a/src/Avalonia.Controls/Automation/Peers/ControlAutomationPeer.cs +++ b/src/Avalonia.Controls/Automation/Peers/ControlAutomationPeer.cs @@ -146,7 +146,7 @@ namespace Avalonia.Automation.Peers protected override string? GetAccessKeyCore() => AutomationProperties.GetAccessKey(Owner); protected override AutomationControlType GetAutomationControlTypeCore() => AutomationControlType.Custom; protected override string? GetAutomationIdCore() => AutomationProperties.GetAutomationId(Owner) ?? Owner.Name; - protected override Rect GetBoundingRectangleCore() => GetBounds(Owner.TransformedBounds); + protected override Rect GetBoundingRectangleCore() => GetBounds(Owner); protected override string GetClassNameCore() => Owner.GetType().Name; protected override bool HasKeyboardFocusCore() => Owner.IsFocused; protected override bool IsContentElementCore() => AutomationProperties.GetAccessibilityView(Owner) >= AccessibilityView.Content; @@ -160,9 +160,19 @@ namespace Avalonia.Automation.Peers return AutomationProperties.GetControlTypeOverride(Owner) ?? GetAutomationControlTypeCore(); } - private static Rect GetBounds(TransformedBounds? bounds) + private static Rect GetBounds(Control control) { - return bounds?.Bounds.TransformToAABB(bounds!.Value.Transform) ?? default; + var root = control.GetVisualRoot(); + + if (root is null) + return default; + + var transform = control.TransformToVisual(root); + + if (!transform.HasValue) + return default; + + return new Rect(control.Bounds.Size).TransformToAABB(transform.Value); } private void Initialize() @@ -182,12 +192,14 @@ namespace Avalonia.Automation.Peers if (parent is Control c) (GetOrCreate(c) as ControlAutomationPeer)?.InvalidateChildren(); } - else if (e.Property == Visual.TransformedBoundsProperty) + else if (e.Property == Visual.BoundsProperty || + e.Property == Visual.RenderTransformProperty || + e.Property == Visual.RenderTransformOriginProperty) { RaisePropertyChangedEvent( AutomationElementIdentifiers.BoundingRectangleProperty, - GetBounds((TransformedBounds?)e.OldValue), - GetBounds((TransformedBounds?)e.NewValue)); + null, + GetBounds(Owner)); } else if (e.Property == Visual.VisualParentProperty) { diff --git a/src/Avalonia.Controls/Converters/EnumToBoolConverter.cs b/src/Avalonia.Controls/Converters/EnumToBoolConverter.cs new file mode 100644 index 0000000000..ed3065809e --- /dev/null +++ b/src/Avalonia.Controls/Converters/EnumToBoolConverter.cs @@ -0,0 +1,56 @@ +using System; +using System.Globalization; +using Avalonia.Data; +using Avalonia.Data.Converters; + +namespace Avalonia.Controls.Converters +{ + /// + /// Converter to convert an enum value to bool by comparing to the given parameter. + /// Both value and parameter must be of the same enum type. + /// + /// + /// This converter is useful to enable binding of radio buttons with a selected enum value. + /// + public class EnumToBoolConverter : IValueConverter + { + /// + public object? Convert( + object? value, + Type targetType, + object? parameter, + CultureInfo culture) + { + if (value == null && + parameter == null) + { + return true; + } + else if (value == null || + parameter == null) + { + return false; + } + else + { + return value!.Equals(parameter); + } + } + + /// + public object? ConvertBack( + object? value, + Type targetType, + object? parameter, + CultureInfo culture) + { + if (value is bool boolValue && + boolValue == true) + { + return parameter; + } + + return BindingOperations.DoNothing; + } + } +} diff --git a/src/Avalonia.Controls/Converters/EnumValueEqualsConverter.cs b/src/Avalonia.Controls/Converters/EnumValueEqualsConverter.cs deleted file mode 100644 index 1a33a82ca4..0000000000 --- a/src/Avalonia.Controls/Converters/EnumValueEqualsConverter.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Globalization; -using Avalonia.Data.Converters; - -namespace Avalonia.Controls.Converters -{ - /// - /// Converter that checks if an enum value is equal to the given parameter enum value. - /// - public class EnumValueEqualsConverter : IValueConverter - { - /// - public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) - { - // Note: Unlike string comparisons, null/empty is not supported - // Both 'value' and 'parameter' must exist and if both are missing they are not considered equal - if (value != null && - parameter != null) - { - Type type = value.GetType(); - - if (type.IsEnum) - { - var valueStr = value?.ToString(); - var paramStr = parameter?.ToString(); - - if (string.Equals(valueStr, paramStr, StringComparison.OrdinalIgnoreCase)) - { - return true; - } - } - - /* - // TODO: When .net Standard 2.0 is no longer supported the code can be changed to below - // This is a little more type safe - if (type.IsEnum && - Enum.TryParse(type, value?.ToString(), true, out object? valueEnum) && - Enum.TryParse(type, parameter?.ToString(), true, out object? paramEnum)) - { - return valueEnum == paramEnum; - } - */ - } - - return false; - } - - /// - public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) - { - throw new System.NotImplementedException(); - } - } -} diff --git a/src/Avalonia.Controls/Converters/StringFormatConverter.cs b/src/Avalonia.Controls/Converters/StringFormatConverter.cs new file mode 100644 index 0000000000..ae920dac7e --- /dev/null +++ b/src/Avalonia.Controls/Converters/StringFormatConverter.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using Avalonia.Data; +using Avalonia.Data.Converters; + +namespace Avalonia.Controls.Converters; + +/// +/// Calls on the passed in values, where the first element in the list +/// is the string, and everything after it is passed into the object array in order. +/// +public class StringFormatConverter : IMultiValueConverter +{ + public object? Convert(IList values, Type targetType, object? parameter, CultureInfo culture) + { + try + { + return string.Format((string)values[0]!, values.Skip(1).ToArray()); + } + catch (Exception e) + { + return new BindingNotification(e, BindingErrorType.Error); + } + } +} diff --git a/src/Avalonia.Controls/Documents/Inline.cs b/src/Avalonia.Controls/Documents/Inline.cs index b400625903..47581e87f1 100644 --- a/src/Avalonia.Controls/Documents/Inline.cs +++ b/src/Avalonia.Controls/Documents/Inline.cs @@ -50,8 +50,38 @@ namespace Avalonia.Controls.Documents protected TextRunProperties CreateTextRunProperties() { - return new GenericTextRunProperties(new Typeface(FontFamily, FontStyle, FontWeight), FontSize, - TextDecorations, Foreground, Background, BaselineAlignment); + var textDecorations = TextDecorations; + var background = Background; + + if(Parent is Inline inline) + { + if(textDecorations == null) + { + textDecorations = inline.TextDecorations; + } + + if(background == null) + { + background = inline.Background; + } + } + + var fontStyle = FontStyle; + + if(Parent is Italic) + { + fontStyle = FontStyle.Italic; + } + + var fontWeight = FontWeight; + + if(Parent is Bold) + { + fontWeight = FontWeight.Bold; + } + + return new GenericTextRunProperties(new Typeface(FontFamily, fontStyle, fontWeight), FontSize, + textDecorations, Foreground, background, BaselineAlignment); } protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) diff --git a/src/Avalonia.Controls/Documents/InlineCollection.cs b/src/Avalonia.Controls/Documents/InlineCollection.cs index dc688fc359..565ed75ad9 100644 --- a/src/Avalonia.Controls/Documents/InlineCollection.cs +++ b/src/Avalonia.Controls/Documents/InlineCollection.cs @@ -14,7 +14,6 @@ namespace Avalonia.Controls.Documents { private ILogical? _parent; private IInlineHost? _inlineHost; - private string? _text = string.Empty; /// /// Initializes a new instance of the class. @@ -22,7 +21,7 @@ namespace Avalonia.Controls.Documents public InlineCollection() { ResetBehavior = ResetBehavior.Remove; - + this.ForEachItem( x => { @@ -36,16 +35,16 @@ namespace Avalonia.Controls.Documents x.InlineHost = InlineHost; Invalidate(); }, - () => throw new NotSupportedException()); + () => throw new NotSupportedException()); } - internal ILogical? Parent + internal ILogical? Parent { get => _parent; set { _parent = value; - + OnParentChanged(value); } } @@ -61,8 +60,6 @@ namespace Avalonia.Controls.Documents } } - public bool HasComplexContent => Count > 0; - /// /// Gets or adds the text held by the inlines collection. /// @@ -73,11 +70,6 @@ namespace Avalonia.Controls.Documents { get { - if (!HasComplexContent) - { - return _text; - } - var builder = new StringBuilder(); foreach (var inline in this) @@ -87,17 +79,7 @@ namespace Avalonia.Controls.Documents return builder.ToString(); } - set - { - if (HasComplexContent) - { - Add(new Run(value)); - } - else - { - _text = value; - } - } + } /// @@ -110,36 +92,46 @@ namespace Avalonia.Controls.Documents /// public void Add(string text) { - if (HasComplexContent) - { - Add(new Run(text)); - } - else - { - _text = text; - } + AddText(text); + } + + public override void Add(Inline inline) + { + OnAdd(); + + base.Add(inline); } public void Add(IControl child) { - var implicitRun = new InlineUIContainer(child); + OnAdd(); + + base.Add(new InlineUIContainer(child)); + } - Add(implicitRun); + private void AddText(string text) + { + if(Parent is RichTextBlock textBlock && !textBlock.HasComplexContent) + { + textBlock._text += text; + } + else + { + base.Add(new Run(text)); + } } - public override void Add(Inline item) + private void OnAdd() { - if (!HasComplexContent) + if (Parent is RichTextBlock textBlock) { - if (!string.IsNullOrEmpty(_text)) + if (!textBlock.HasComplexContent && !string.IsNullOrEmpty(textBlock._text)) { - base.Add(new Run(_text)); + base.Add(new Run(textBlock._text)); + + textBlock._text = null; } - - _text = null; } - - base.Add(item); } /// @@ -152,7 +144,7 @@ namespace Avalonia.Controls.Documents /// protected void Invalidate() { - if(InlineHost != null) + if (InlineHost != null) { InlineHost.Invalidate(); } @@ -162,7 +154,7 @@ namespace Avalonia.Controls.Documents private void OnParentChanged(ILogical? parent) { - foreach(var child in this) + foreach (var child in this) { ((ISetLogicalParent)child).SetParent(parent); } diff --git a/src/Avalonia.Controls/Documents/Span.cs b/src/Avalonia.Controls/Documents/Span.cs index c7289dbc3f..363ce1011b 100644 --- a/src/Avalonia.Controls/Documents/Span.cs +++ b/src/Avalonia.Controls/Documents/Span.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Text; using Avalonia.Media.TextFormatting; @@ -38,41 +37,17 @@ namespace Avalonia.Controls.Documents internal override void BuildTextRun(IList textRuns) { - if (Inlines.HasComplexContent) + foreach (var inline in Inlines) { - foreach (var inline in Inlines) - { - inline.BuildTextRun(textRuns); - } - } - else - { - if (Inlines.Text is string text) - { - var textRunProperties = CreateTextRunProperties(); - - var textCharacters = new TextCharacters(text.AsMemory(), textRunProperties); - - textRuns.Add(textCharacters); - } + inline.BuildTextRun(textRuns); } } internal override void AppendText(StringBuilder stringBuilder) { - if (Inlines.HasComplexContent) - { - foreach (var inline in Inlines) - { - inline.AppendText(stringBuilder); - } - } - else + foreach (var inline in Inlines) { - if (Inlines.Text is string text) - { - stringBuilder.Append(text); - } + inline.AppendText(stringBuilder); } } @@ -93,7 +68,7 @@ namespace Avalonia.Controls.Documents { base.OnInlineHostChanged(oldValue, newValue); - if(Inlines is not null) + if (Inlines is not null) { Inlines.InlineHost = newValue; } diff --git a/src/Avalonia.Controls/Documents/TextElement.cs b/src/Avalonia.Controls/Documents/TextElement.cs index 5bac3642ed..2034f05fc0 100644 --- a/src/Avalonia.Controls/Documents/TextElement.cs +++ b/src/Avalonia.Controls/Documents/TextElement.cs @@ -18,7 +18,7 @@ namespace Avalonia.Controls.Documents /// Defines the property. /// public static readonly AttachedProperty FontFamilyProperty = - AvaloniaProperty.RegisterAttached( + AvaloniaProperty.RegisterAttached( nameof(FontFamily), defaultValue: FontFamily.Default, inherits: true); @@ -27,7 +27,7 @@ namespace Avalonia.Controls.Documents /// Defines the property. /// public static readonly AttachedProperty FontSizeProperty = - AvaloniaProperty.RegisterAttached( + AvaloniaProperty.RegisterAttached( nameof(FontSize), defaultValue: 12, inherits: true); @@ -36,7 +36,7 @@ namespace Avalonia.Controls.Documents /// Defines the property. /// public static readonly AttachedProperty FontStyleProperty = - AvaloniaProperty.RegisterAttached( + AvaloniaProperty.RegisterAttached( nameof(FontStyle), inherits: true); @@ -44,7 +44,7 @@ namespace Avalonia.Controls.Documents /// Defines the property. /// public static readonly AttachedProperty FontWeightProperty = - AvaloniaProperty.RegisterAttached( + AvaloniaProperty.RegisterAttached( nameof(FontWeight), inherits: true, defaultValue: FontWeight.Normal); @@ -53,7 +53,7 @@ namespace Avalonia.Controls.Documents /// Defines the property. /// public static readonly AttachedProperty FontStretchProperty = - AvaloniaProperty.RegisterAttached( + AvaloniaProperty.RegisterAttached( nameof(FontStretch), inherits: true, defaultValue: FontStretch.Normal); @@ -62,7 +62,7 @@ namespace Avalonia.Controls.Documents /// Defines the property. /// public static readonly AttachedProperty ForegroundProperty = - AvaloniaProperty.RegisterAttached( + AvaloniaProperty.RegisterAttached( nameof(Foreground), Brushes.Black, inherits: true); diff --git a/src/Avalonia.Controls/Flyouts/MenuFlyoutPresenter.cs b/src/Avalonia.Controls/Flyouts/MenuFlyoutPresenter.cs index 6a7da87387..278e498a67 100644 --- a/src/Avalonia.Controls/Flyouts/MenuFlyoutPresenter.cs +++ b/src/Avalonia.Controls/Flyouts/MenuFlyoutPresenter.cs @@ -11,9 +11,14 @@ namespace Avalonia.Controls public MenuFlyoutPresenter() :base(new DefaultMenuInteractionHandler(true)) { + } + public MenuFlyoutPresenter(IMenuInteractionHandler menuInteractionHandler) + : base(menuInteractionHandler) + { } + public override void Close() { // DefaultMenuInteractionHandler calls this diff --git a/src/Avalonia.Controls/ItemsControl.cs b/src/Avalonia.Controls/ItemsControl.cs index 427f5c8a9b..345e7fcac8 100644 --- a/src/Avalonia.Controls/ItemsControl.cs +++ b/src/Avalonia.Controls/ItemsControl.cs @@ -523,25 +523,47 @@ namespace Avalonia.Controls IInputElement? from, bool wrap) { - IInputElement? result; - var c = from; + var current = from; - do + for (;;) { - result = container.GetControl(direction, c, wrap); + var result = container.GetControl(direction, current, wrap); - if (result != null && - result.Focusable && + if (result is null) + { + return null; + } + + if (result.Focusable && result.IsEffectivelyEnabled && result.IsEffectivelyVisible) { return result; } - c = result; - } while (c != null && c != from && direction != NavigationDirection.First && direction != NavigationDirection.Last); + current = result; - return null; + if (current == from) + { + return null; + } + + switch (direction) + { + //We did not find an enabled first item. Move downwards until we find one. + case NavigationDirection.First: + direction = NavigationDirection.Down; + from = result; + break; + + //We did not find an enabled last item. Move upwards until we find one. + case NavigationDirection.Last: + direction = NavigationDirection.Up; + from = result; + break; + + } + } } private void PresenterChildIndexChanged(object? sender, ChildIndexChangedEventArgs e) diff --git a/src/Avalonia.Controls/MenuBase.cs b/src/Avalonia.Controls/MenuBase.cs index 122d45d033..54cbc46a36 100644 --- a/src/Avalonia.Controls/MenuBase.cs +++ b/src/Avalonia.Controls/MenuBase.cs @@ -40,7 +40,7 @@ namespace Avalonia.Controls /// /// Initializes a new instance of the class. /// - public MenuBase() + protected MenuBase() { InteractionHandler = new DefaultMenuInteractionHandler(false); } @@ -49,7 +49,7 @@ namespace Avalonia.Controls /// Initializes a new instance of the class. /// /// The menu interaction handler. - public MenuBase(IMenuInteractionHandler interactionHandler) + protected MenuBase(IMenuInteractionHandler interactionHandler) { InteractionHandler = interactionHandler ?? throw new ArgumentNullException(nameof(interactionHandler)); } diff --git a/src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs b/src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs index 868cce879a..16aeb2f559 100644 --- a/src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs +++ b/src/Avalonia.Controls/Platform/DefaultMenuInteractionHandler.cs @@ -53,7 +53,7 @@ namespace Avalonia.Controls.Platform Menu.PointerPressed += PointerPressed; Menu.PointerReleased += PointerReleased; Menu.AddHandler(AccessKeyHandler.AccessKeyPressedEvent, AccessKeyPressed); - Menu.AddHandler(Avalonia.Controls.Menu.MenuOpenedEvent, MenuOpened); + Menu.AddHandler(MenuBase.MenuOpenedEvent, MenuOpened); Menu.AddHandler(MenuItem.PointerEnteredItemEvent, PointerEntered); Menu.AddHandler(MenuItem.PointerExitedItemEvent, PointerExited); Menu.AddHandler(InputElement.PointerMovedEvent, PointerMoved); @@ -89,7 +89,7 @@ namespace Avalonia.Controls.Platform Menu.PointerPressed -= PointerPressed; Menu.PointerReleased -= PointerReleased; Menu.RemoveHandler(AccessKeyHandler.AccessKeyPressedEvent, AccessKeyPressed); - Menu.RemoveHandler(Avalonia.Controls.Menu.MenuOpenedEvent, MenuOpened); + Menu.RemoveHandler(MenuBase.MenuOpenedEvent, MenuOpened); Menu.RemoveHandler(MenuItem.PointerEnteredItemEvent, PointerEntered); Menu.RemoveHandler(MenuItem.PointerExitedItemEvent, PointerExited); Menu.RemoveHandler(InputElement.PointerMovedEvent, PointerMoved); @@ -175,7 +175,11 @@ namespace Avalonia.Controls.Platform case Key.Left: { - if (item?.Parent is IMenuItem parent && !parent.IsTopLevel && parent.IsSubMenuOpen) + if (item is { IsSubMenuOpen: true, SelectedItem: null }) + { + item.Close(); + } + else if (item?.Parent is IMenuItem { IsTopLevel: false, IsSubMenuOpen: true } parent) { parent.Close(); parent.Focus(); diff --git a/src/Avalonia.Controls/Platform/ITopLevelImpl.cs b/src/Avalonia.Controls/Platform/ITopLevelImpl.cs index bd0339f525..6bb94c6070 100644 --- a/src/Avalonia.Controls/Platform/ITopLevelImpl.cs +++ b/src/Avalonia.Controls/Platform/ITopLevelImpl.cs @@ -6,7 +6,6 @@ using Avalonia.Input.Raw; using Avalonia.Layout; using Avalonia.Metadata; using Avalonia.Rendering; -using JetBrains.Annotations; namespace Avalonia.Platform { @@ -151,13 +150,7 @@ namespace Avalonia.Platform /// Gets or sets a method called when the input focus is lost. /// Action? LostFocus { get; set; } - - /// - /// Gets a mouse device associated with toplevel - /// - [CanBeNull] - IMouseDevice MouseDevice { get; } - + IPopupImpl? CreatePopup(); /// diff --git a/src/Avalonia.Controls/Primitives/AdornerLayer.cs b/src/Avalonia.Controls/Primitives/AdornerLayer.cs index 5ad4e39baf..57fb7226e8 100644 --- a/src/Avalonia.Controls/Primitives/AdornerLayer.cs +++ b/src/Avalonia.Controls/Primitives/AdornerLayer.cs @@ -164,6 +164,9 @@ namespace Avalonia.Controls.Primitives private void UpdateAdornedElement(Visual adorner, Visual? adorned) { + if (adorner.CompositionVisual != null) + adorner.CompositionVisual.AdornedVisual = adorned?.CompositionVisual; + var info = adorner.GetValue(s_adornedElementInfoProperty); if (info != null) @@ -184,11 +187,18 @@ namespace Avalonia.Controls.Primitives adorner.SetValue(s_adornedElementInfoProperty, info); } - info.Subscription = adorned.GetObservable(TransformedBoundsProperty).Subscribe(x => - { - info.Bounds = x; - InvalidateMeasure(); - }); + if (adorner.CompositionVisual != null) + info.Subscription = adorned.GetObservable(BoundsProperty).Subscribe(x => + { + info.Bounds = new TransformedBounds(new Rect(adorned.Bounds.Size), new Rect(adorned.Bounds.Size), Matrix.Identity); + InvalidateMeasure(); + }); + else + info.Subscription = adorned.GetObservable(TransformedBoundsProperty).Subscribe(x => + { + info.Bounds = x; + InvalidateMeasure(); + }); } } diff --git a/src/Avalonia.Controls/Primitives/PopupPositioning/IPopupPositioner.cs b/src/Avalonia.Controls/Primitives/PopupPositioning/IPopupPositioner.cs index 8d35a91e00..d8de813d47 100644 --- a/src/Avalonia.Controls/Primitives/PopupPositioning/IPopupPositioner.cs +++ b/src/Avalonia.Controls/Primitives/PopupPositioning/IPopupPositioner.cs @@ -45,6 +45,7 @@ Copyright © 2019 Nikita Tsukanov */ using System; +using Avalonia.Input; using Avalonia.Metadata; using Avalonia.VisualTree; using Avalonia.Media; @@ -452,16 +453,14 @@ namespace Avalonia.Controls.Primitives.PopupPositioning PopupPositionerConstraintAdjustment constraintAdjustment, Rect? rect, FlowDirection flowDirection) { - // We need a better way for tracking the last pointer position -#pragma warning disable CS0618 // Type or member is obsolete - var pointer = topLevel.PointToClient(topLevel.PlatformImpl?.MouseDevice.Position ?? default); -#pragma warning restore CS0618 // Type or member is obsolete - positionerParameters.Offset = offset; positionerParameters.ConstraintAdjustment = constraintAdjustment; if (placement == PlacementMode.Pointer) { - positionerParameters.AnchorRectangle = new Rect(pointer, new Size(1, 1)); + // We need a better way for tracking the last pointer position + var position = topLevel.PointToClient(topLevel.LastPointerPosition ?? default); + + positionerParameters.AnchorRectangle = new Rect(position, new Size(1, 1)); positionerParameters.Anchor = PopupAnchor.TopLeft; positionerParameters.Gravity = PopupGravity.BottomRight; } diff --git a/src/Avalonia.Controls/Primitives/TemplatedControl.cs b/src/Avalonia.Controls/Primitives/TemplatedControl.cs index 6349d1baeb..dc52cc3ae2 100644 --- a/src/Avalonia.Controls/Primitives/TemplatedControl.cs +++ b/src/Avalonia.Controls/Primitives/TemplatedControl.cs @@ -291,7 +291,9 @@ namespace Avalonia.Controls.Primitives // Existing code kinda expect to see a NameScope even if it's empty if (nameScope == null) + { nameScope = new NameScope(); + } var e = new TemplateAppliedEventArgs(nameScope); OnApplyTemplate(e); @@ -398,6 +400,7 @@ namespace Avalonia.Controls.Primitives /// Sets the TemplatedParent property for the created template children. /// /// The control. + /// The templated parent to apply. internal static void ApplyTemplatedParent(IStyledElement control, ITemplatedControl? templatedParent) { control.SetValue(TemplatedParentProperty, templatedParent); @@ -407,7 +410,7 @@ namespace Avalonia.Controls.Primitives for (var i = 0; i < count; i++) { - if (children[i] is IStyledElement child) + if (children[i] is IStyledElement child && child.TemplatedParent is null) { ApplyTemplatedParent(child, templatedParent); } diff --git a/src/Avalonia.Controls/ProgressBar.cs b/src/Avalonia.Controls/ProgressBar.cs index 1075328c67..d0e8e8f1a0 100644 --- a/src/Avalonia.Controls/ProgressBar.cs +++ b/src/Avalonia.Controls/ProgressBar.cs @@ -96,6 +96,7 @@ namespace Avalonia.Controls } } + private double _percentage; private double _indeterminateStartingOffset; private double _indeterminateEndingOffset; private Border? _indicator; @@ -106,9 +107,17 @@ namespace Avalonia.Controls public static readonly StyledProperty ShowProgressTextProperty = AvaloniaProperty.Register(nameof(ShowProgressText)); + public static readonly StyledProperty ProgressTextFormatProperty = + AvaloniaProperty.Register(nameof(ProgressTextFormat), "{1:0}%"); + public static readonly StyledProperty OrientationProperty = AvaloniaProperty.Register(nameof(Orientation), Orientation.Horizontal); + public static readonly DirectProperty PercentageProperty = + AvaloniaProperty.RegisterDirect( + nameof(Percentage), + o => o.Percentage); + [Obsolete("To be removed when Avalonia.Themes.Default is discontinued.")] public static readonly DirectProperty IndeterminateStartingOffsetProperty = AvaloniaProperty.RegisterDirect( @@ -123,6 +132,12 @@ namespace Avalonia.Controls p => p.IndeterminateEndingOffset, (p, o) => p.IndeterminateEndingOffset = o); + public double Percentage + { + get { return _percentage; } + private set { SetAndRaise(PercentageProperty, ref _percentage, value); } + } + [Obsolete("To be removed when Avalonia.Themes.Default is discontinued.")] public double IndeterminateStartingOffset { @@ -165,6 +180,12 @@ namespace Avalonia.Controls set => SetValue(ShowProgressTextProperty, value); } + public string ProgressTextFormat + { + get => GetValue(ProgressTextFormatProperty); + set => SetValue(ProgressTextFormatProperty, value); + } + public Orientation Orientation { get => GetValue(OrientationProperty); @@ -174,7 +195,7 @@ namespace Avalonia.Controls /// protected override Size ArrangeOverride(Size finalSize) { - UpdateIndicator(finalSize); + UpdateIndicator(); return base.ArrangeOverride(finalSize); } @@ -197,18 +218,21 @@ namespace Avalonia.Controls { _indicator = e.NameScope.Get("PART_Indicator"); - UpdateIndicator(Bounds.Size); + UpdateIndicator(); } - private void UpdateIndicator(Size bounds) + private void UpdateIndicator() { + // Gets the size of the parent indicator container + var barSize = _indicator?.Parent?.Bounds.Size ?? Bounds.Size; + if (_indicator != null) { if (IsIndeterminate) { // Pulled from ModernWPF. - var dim = Orientation == Orientation.Horizontal ? bounds.Width : bounds.Height; + var dim = Orientation == Orientation.Horizontal ? barSize.Width : barSize.Height; var barIndicatorWidth = dim * 0.4; // Indicator width at 40% of ProgressBar var barIndicatorWidth2 = dim * 0.6; // Indicator width at 60% of ProgressBar @@ -233,8 +257,8 @@ namespace Avalonia.Controls new Rect( padding.Left, padding.Top, - bounds.Width - (padding.Right + padding.Left), - bounds.Height - (padding.Bottom + padding.Top) + barSize.Width - (padding.Right + padding.Left), + barSize.Height - (padding.Bottom + padding.Top) )); } else @@ -242,16 +266,18 @@ namespace Avalonia.Controls double percent = Maximum == Minimum ? 1.0 : (Value - Minimum) / (Maximum - Minimum); if (Orientation == Orientation.Horizontal) - _indicator.Width = bounds.Width * percent; + _indicator.Width = barSize.Width * percent; else - _indicator.Height = bounds.Height * percent; + _indicator.Height = barSize.Height * percent; + + Percentage = percent * 100; } } } private void UpdateIndicatorWhenPropChanged(AvaloniaPropertyChangedEventArgs e) { - UpdateIndicator(Bounds.Size); + UpdateIndicator(); } private void UpdatePseudoClasses( diff --git a/src/Avalonia.Controls/Remote/Server/RemoteServerTopLevelImpl.cs b/src/Avalonia.Controls/Remote/Server/RemoteServerTopLevelImpl.cs index e800f2f4b0..3bc0593813 100644 --- a/src/Avalonia.Controls/Remote/Server/RemoteServerTopLevelImpl.cs +++ b/src/Avalonia.Controls/Remote/Server/RemoteServerTopLevelImpl.cs @@ -12,7 +12,6 @@ using Avalonia.Remote.Protocol; using Avalonia.Remote.Protocol.Input; using Avalonia.Remote.Protocol.Viewport; using Avalonia.Threading; -using InputModifiers = Avalonia.Input.InputModifiers; using Key = Avalonia.Input.Key; using PixelFormat = Avalonia.Platform.PixelFormat; using ProtocolPixelFormat = Avalonia.Remote.Protocol.Viewport.PixelFormat; diff --git a/src/Avalonia.Controls/Repeater/ItemsRepeater.cs b/src/Avalonia.Controls/Repeater/ItemsRepeater.cs index 3f42d95deb..ae663defd3 100644 --- a/src/Avalonia.Controls/Repeater/ItemsRepeater.cs +++ b/src/Avalonia.Controls/Repeater/ItemsRepeater.cs @@ -421,6 +421,7 @@ namespace Avalonia.Controls protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) { + base.OnAttachedToVisualTree(e); InvalidateMeasure(); _viewportManager.ResetScrollers(); } diff --git a/src/Avalonia.Controls/RichTextBlock.cs b/src/Avalonia.Controls/RichTextBlock.cs index 2b84113497..9b5afaef5d 100644 --- a/src/Avalonia.Controls/RichTextBlock.cs +++ b/src/Avalonia.Controls/RichTextBlock.cs @@ -170,6 +170,8 @@ namespace Avalonia.Controls remove => RemoveHandler(CopyingToClipboardEvent, value); } + internal bool HasComplexContent => Inlines.Count > 0; + /// /// Copies the current selection to the Clipboard. /// @@ -251,6 +253,30 @@ namespace Avalonia.Controls SelectionEnd = SelectionStart; } + protected void AddText(string? text) + { + if (string.IsNullOrEmpty(text)) + { + return; + } + + if (!HasComplexContent && string.IsNullOrEmpty(_text)) + { + _text = text; + } + else + { + if (!string.IsNullOrEmpty(_text)) + { + Inlines.Add(_text); + + _text = null; + } + + Inlines.Add(text); + } + } + protected override string? GetText() { return _text ?? Inlines.Text; @@ -259,17 +285,8 @@ namespace Avalonia.Controls protected override void SetText(string? text) { var oldValue = _text ?? Inlines?.Text; - - if (Inlines is not null && Inlines.HasComplexContent) - { - Inlines.Text = text; - - _text = null; - } - else - { - _text = text; - } + + AddText(text); RaisePropertyChanged(TextProperty, oldValue, text); } @@ -293,7 +310,7 @@ namespace Avalonia.Controls var inlines = Inlines; - if (inlines is not null && inlines.HasComplexContent) + if (HasComplexContent) { var textRuns = new List(); diff --git a/src/Avalonia.Controls/TextBlock.cs b/src/Avalonia.Controls/TextBlock.cs index 52261d1c76..80edaf4f26 100644 --- a/src/Avalonia.Controls/TextBlock.cs +++ b/src/Avalonia.Controls/TextBlock.cs @@ -4,6 +4,7 @@ using Avalonia.Controls.Documents; using Avalonia.Layout; using Avalonia.Media; using Avalonia.Media.TextFormatting; +using Avalonia.Metadata; using Avalonia.Utilities; namespace Avalonia.Controls @@ -11,7 +12,7 @@ namespace Avalonia.Controls /// /// A control that displays a block of text. /// - public class TextBlock : Control + public class TextBlock : Control, IAddChild { /// /// Defines the property. @@ -128,7 +129,7 @@ namespace Avalonia.Controls public static readonly StyledProperty TextDecorationsProperty = AvaloniaProperty.Register(nameof(TextDecorations)); - protected string? _text; + internal string? _text; protected TextLayout? _textLayout; protected Size _constraint; @@ -473,11 +474,6 @@ namespace Avalonia.Controls control.SetValue(MaxLinesProperty, maxLines); } - public void Add(string text) - { - _text = text; - } - /// /// Renders the to a drawing context. /// @@ -512,6 +508,11 @@ namespace Avalonia.Controls TextLayout.Draw(context, new Point(padding.Left, top)); } + void IAddChild.AddChild(string text) + { + _text = text; + } + protected virtual string? GetText() { return _text; diff --git a/src/Avalonia.Controls/TopLevel.cs b/src/Avalonia.Controls/TopLevel.cs index 5c5053b982..1c1df84431 100644 --- a/src/Avalonia.Controls/TopLevel.cs +++ b/src/Avalonia.Controls/TopLevel.cs @@ -285,6 +285,8 @@ namespace Avalonia.Controls /// public IRenderer Renderer { get; private set; } + internal PixelPoint? LastPointerPosition => _pointerOverPreProcessor?.LastPosition; + /// /// Gets the access key handler for the window. /// @@ -302,9 +304,6 @@ namespace Avalonia.Controls set { SetValue(PointerOverElementProperty, value); } } - /// - IMouseDevice? IInputRoot.MouseDevice => PlatformImpl?.MouseDevice; - /// /// Gets or sets a value indicating whether access keys are shown in the window. /// diff --git a/src/Avalonia.Controls/TrayIcon.cs b/src/Avalonia.Controls/TrayIcon.cs index 2ccb03e447..41a1abd838 100644 --- a/src/Avalonia.Controls/TrayIcon.cs +++ b/src/Avalonia.Controls/TrayIcon.cs @@ -61,6 +61,10 @@ namespace Avalonia.Controls args.NewValue.Value.CollectionChanged += Icons_CollectionChanged; } } + else + { + throw new InvalidOperationException("TrayIcon.Icons must be set on the Application."); + } }); var app = Application.Current ?? throw new InvalidOperationException("Application not yet initialized."); @@ -123,9 +127,9 @@ namespace Avalonia.Controls public static readonly StyledProperty IsVisibleProperty = Visual.IsVisibleProperty.AddOwner(); - public static void SetIcons(AvaloniaObject o, TrayIcons trayIcons) => o.SetValue(IconsProperty, trayIcons); + public static void SetIcons(Application o, TrayIcons trayIcons) => o.SetValue(IconsProperty, trayIcons); - public static TrayIcons GetIcons(AvaloniaObject o) => o.GetValue(IconsProperty); + public static TrayIcons GetIcons(Application o) => o.GetValue(IconsProperty); /// /// Gets or sets the property of a TrayIcon. @@ -189,7 +193,10 @@ namespace Avalonia.Controls var app = Application.Current ?? throw new InvalidOperationException("Application not yet initialized."); var trayIcons = GetIcons(app); - RemoveIcons(trayIcons); + if (trayIcons != null) + { + RemoveIcons(trayIcons); + } } private static void Icons_CollectionChanged(object? sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) diff --git a/src/Avalonia.Controls/Window.cs b/src/Avalonia.Controls/Window.cs index 2dd391945b..9b4bb51aca 100644 --- a/src/Avalonia.Controls/Window.cs +++ b/src/Avalonia.Controls/Window.cs @@ -681,8 +681,8 @@ namespace Avalonia.Controls IsVisible = true; var initialSize = new Size( - double.IsNaN(Width) ? ClientSize.Width : Width, - double.IsNaN(Height) ? ClientSize.Height : Height); + double.IsNaN(Width) ? Math.Max(MinWidth, ClientSize.Width) : Width, + double.IsNaN(Height) ? Math.Max(MinHeight, ClientSize.Height) : Height); if (initialSize != ClientSize) { diff --git a/src/Avalonia.DesignerSupport/Remote/HtmlTransport/webapp/package-lock.json b/src/Avalonia.DesignerSupport/Remote/HtmlTransport/webapp/package-lock.json index 403bb5a59a..2fbcbfdb6a 100644 --- a/src/Avalonia.DesignerSupport/Remote/HtmlTransport/webapp/package-lock.json +++ b/src/Avalonia.DesignerSupport/Remote/HtmlTransport/webapp/package-lock.json @@ -10,6 +10,55 @@ "integrity": "sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA==", "dev": true }, + "@jridgewell/gen-mapping": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", + "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true + }, + "@jridgewell/source-map": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", + "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/sourcemap-codec": { + "version": "1.4.14", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", + "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz", + "integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "@types/eslint": { "version": "8.4.1", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz", @@ -2136,6 +2185,12 @@ "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", "dev": true }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, "source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -2153,6 +2208,16 @@ "source-map-js": "^1.0.1" } }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, "string-template": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/string-template/-/string-template-0.2.1.tgz", @@ -2208,13 +2273,14 @@ "dev": true }, "terser": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz", - "integrity": "sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA==", + "version": "5.14.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz", + "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==", "dev": true, "requires": { + "@jridgewell/source-map": "^0.3.2", + "acorn": "^8.5.0", "commander": "^2.20.0", - "source-map": "~0.7.2", "source-map-support": "~0.5.20" }, "dependencies": { @@ -2223,30 +2289,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true - }, - "source-map": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", - "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", - "dev": true - }, - "source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } } } }, diff --git a/src/Avalonia.Diagnostics/Diagnostics/Controls/FilterTextBox.axaml b/src/Avalonia.Diagnostics/Diagnostics/Controls/FilterTextBox.axaml index b7995c38e3..a1a2ab34bf 100644 --- a/src/Avalonia.Diagnostics/Diagnostics/Controls/FilterTextBox.axaml +++ b/src/Avalonia.Diagnostics/Diagnostics/Controls/FilterTextBox.axaml @@ -19,7 +19,7 @@ Classes="textBoxClearButton" ToolTip.Tip="Clear" Cursor="Hand" - Command="{ReflectionBinding $parent[TextBox].Clear}" + Command="{Binding $parent[TextBox].Clear}" Opacity="0.5" /> _frozenPopupStates; private AvaloniaObject? _root; + private PixelPoint _lastPointerPosition; public MainWindow() { @@ -30,6 +32,10 @@ namespace Avalonia.Diagnostics.Views .OfType() .Where(x => x.Type == RawKeyEventType.KeyDown) .Subscribe(RawKeyDown); + _pointerSubscription = InputManager.Instance?.Process + .OfType() + .Subscribe(x => _lastPointerPosition = x.Root.PointToScreen(x.Position)); + _frozenPopupStates = new Dictionary(); @@ -84,6 +90,7 @@ namespace Avalonia.Diagnostics.Views { base.OnClosed(e); _keySubscription?.Dispose(); + _pointerSubscription?.Dispose(); foreach (var state in _frozenPopupStates) { @@ -108,9 +115,7 @@ namespace Avalonia.Diagnostics.Views private IControl? GetHoveredControl(TopLevel topLevel) { -#pragma warning disable CS0618 // Type or member is obsolete - var point = (topLevel as IInputRoot)?.MouseDevice?.GetPosition(topLevel) ?? default; -#pragma warning restore CS0618 // Type or member is obsolete + var point = topLevel.PointToClient(_lastPointerPosition); return (IControl?)topLevel.GetVisualsAt(point, x => { diff --git a/src/Avalonia.Dialogs/FileSizeStringConverter.cs b/src/Avalonia.Dialogs/FileSizeStringConverter.cs index c2cdf1e502..144f50fd9c 100644 --- a/src/Avalonia.Dialogs/FileSizeStringConverter.cs +++ b/src/Avalonia.Dialogs/FileSizeStringConverter.cs @@ -12,7 +12,7 @@ namespace Avalonia.Dialogs { if (value is long size && size > 0) { - return ByteSizeHelper.ToString((ulong)size); + return Avalonia.Utilities.ByteSizeHelper.ToString((ulong)size, true); } return ""; diff --git a/src/Avalonia.Dialogs/ManagedFileChooserSources.cs b/src/Avalonia.Dialogs/ManagedFileChooserSources.cs index a217a67bc6..a76a84ba5a 100644 --- a/src/Avalonia.Dialogs/ManagedFileChooserSources.cs +++ b/src/Avalonia.Dialogs/ManagedFileChooserSources.cs @@ -6,6 +6,7 @@ using System.Reactive.Linq; using System.Runtime.InteropServices; using Avalonia.Controls.Platform; using Avalonia.Threading; +using Avalonia.Utilities; namespace Avalonia.Dialogs { @@ -60,7 +61,7 @@ namespace Avalonia.Dialogs if (displayName == null & x.VolumeSizeBytes > 0) { - displayName = $"{ByteSizeHelper.ToString(x.VolumeSizeBytes)} Volume"; + displayName = $"{ByteSizeHelper.ToString(x.VolumeSizeBytes, true)} Volume"; }; try diff --git a/src/Avalonia.FreeDesktop/Avalonia.FreeDesktop.csproj b/src/Avalonia.FreeDesktop/Avalonia.FreeDesktop.csproj index a5cb207223..3b1c6cc7b1 100644 --- a/src/Avalonia.FreeDesktop/Avalonia.FreeDesktop.csproj +++ b/src/Avalonia.FreeDesktop/Avalonia.FreeDesktop.csproj @@ -5,6 +5,10 @@ enable + + + + diff --git a/src/Avalonia.FreeDesktop/DBusCallQueue.cs b/src/Avalonia.FreeDesktop/DBusCallQueue.cs index 5cd748be02..e7c07dcbf9 100644 --- a/src/Avalonia.FreeDesktop/DBusCallQueue.cs +++ b/src/Avalonia.FreeDesktop/DBusCallQueue.cs @@ -8,10 +8,9 @@ namespace Avalonia.FreeDesktop { private readonly Func _errorHandler; - class Item + record Item(Func Callback) { - public Func Callback; - public Action OnFinish; + public Action? OnFinish; } private Queue _q = new Queue(); private bool _processing; @@ -23,19 +22,15 @@ namespace Avalonia.FreeDesktop public void Enqueue(Func cb) { - _q.Enqueue(new Item - { - Callback = cb - }); + _q.Enqueue(new Item(cb)); Process(); } public Task EnqueueAsync(Func cb) { var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - _q.Enqueue(new Item + _q.Enqueue(new Item(cb) { - Callback = cb, OnFinish = e => { if (e == null) @@ -51,13 +46,12 @@ namespace Avalonia.FreeDesktop public Task EnqueueAsync(Func> cb) { var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - _q.Enqueue(new Item - { - Callback = async () => + _q.Enqueue(new Item(async () => { var res = await cb(); tcs.TrySetResult(res); - }, + }) + { OnFinish = e => { if (e != null) diff --git a/src/Avalonia.FreeDesktop/DBusHelper.cs b/src/Avalonia.FreeDesktop/DBusHelper.cs index 7204e51dbd..ef99838208 100644 --- a/src/Avalonia.FreeDesktop/DBusHelper.cs +++ b/src/Avalonia.FreeDesktop/DBusHelper.cs @@ -17,19 +17,18 @@ namespace Avalonia.FreeDesktop private readonly object _lock = new(); private SynchronizationContext? _ctx; - public override void Post(SendOrPostCallback d, object state) + public override void Post(SendOrPostCallback d, object? state) { lock (_lock) { if (_ctx is not null) _ctx?.Post(d, state); else - lock (_lock) - d(state); + d(state); } } - public override void Send(SendOrPostCallback d, object state) + public override void Send(SendOrPostCallback d, object? state) { lock (_lock) { diff --git a/src/Avalonia.FreeDesktop/DBusIme/DBusTextInputMethodBase.cs b/src/Avalonia.FreeDesktop/DBusIme/DBusTextInputMethodBase.cs index 864c579319..eef865d458 100644 --- a/src/Avalonia.FreeDesktop/DBusIme/DBusTextInputMethodBase.cs +++ b/src/Avalonia.FreeDesktop/DBusIme/DBusTextInputMethodBase.cs @@ -1,9 +1,7 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Reflection; using System.Threading.Tasks; -using Avalonia.FreeDesktop.DBusIme.Fcitx; using Avalonia.Input.Raw; using Avalonia.Input.TextInput; using Avalonia.Logging; @@ -26,7 +24,7 @@ namespace Avalonia.FreeDesktop.DBusIme return (im, im); } } - + internal abstract class DBusTextInputMethodBase : IX11InputMethodControl, ITextInputMethodImpl { private List _disposables = new List(); @@ -34,7 +32,7 @@ namespace Avalonia.FreeDesktop.DBusIme protected Connection Connection { get; } private readonly string[] _knownNames; private bool _connecting; - private string _currentName; + private string? _currentName; private DBusCallQueue _queue; private bool _controlActive, _windowActive; private bool? _imeActive; @@ -42,9 +40,9 @@ namespace Avalonia.FreeDesktop.DBusIme private PixelRect? _lastReportedRect; private double _scaling = 1; private PixelPoint _windowPosition; - + protected bool IsConnected => _currentName != null; - + public DBusTextInputMethodBase(Connection connection, params string[] knownNames) { _queue = new DBusCallQueue(QueueOnError); @@ -58,18 +56,18 @@ namespace Avalonia.FreeDesktop.DBusIme foreach (var name in _knownNames) _disposables.Add(await Connection.ResolveServiceOwnerAsync(name, OnNameChange)); } - + protected abstract Task Connect(string name); protected string GetAppName() => - Application.Current.Name ?? Assembly.GetEntryAssembly()?.GetName()?.Name ?? "Avalonia"; - + Application.Current?.Name ?? Assembly.GetEntryAssembly()?.GetName()?.Name ?? "Avalonia"; + private async void OnNameChange(ServiceOwnerChangedEventArgs args) { if (args.NewOwner != null && _currentName == null) { _onlineNamesQueue.Enqueue(args.ServiceName); - if(!_connecting) + if (!_connecting) { _connecting = true; try @@ -98,25 +96,25 @@ namespace Avalonia.FreeDesktop.DBusIme _connecting = false; } } - + } - + // IME has crashed if (args.NewOwner == null && args.ServiceName == _currentName) { _currentName = null; - foreach(var s in _disposables) + foreach (var s in _disposables) s.Dispose(); _disposables.Clear(); - + OnDisconnected(); Reset(); - + // Watch again Watch(); } } - + protected virtual Task Disconnect() { return Task.CompletedTask; @@ -124,7 +122,7 @@ namespace Avalonia.FreeDesktop.DBusIme protected virtual void OnDisconnected() { - + } protected virtual void Reset() @@ -149,10 +147,14 @@ namespace Avalonia.FreeDesktop.DBusIme OnDisconnected(); _currentName = null; } - + protected void Enqueue(Func cb) => _queue.Enqueue(cb); - protected void AddDisposable(IDisposable d) => _disposables.Add(d); + protected void AddDisposable(IDisposable? d) + { + if(d is { }) + _disposables.Add(d); + } public void Dispose() { @@ -198,7 +200,7 @@ namespace Avalonia.FreeDesktop.DBusIme UpdateActive(); } - void ITextInputMethodImpl.SetClient(ITextInputMethodClient client) + void ITextInputMethodImpl.SetClient(ITextInputMethodClient? client) { _controlActive = client is { }; UpdateActive(); @@ -225,7 +227,7 @@ namespace Avalonia.FreeDesktop.DBusIme } } - private Action _onCommit; + private Action? _onCommit; event Action IX11InputMethodControl.Commit { add => _onCommit += value; @@ -234,7 +236,7 @@ namespace Avalonia.FreeDesktop.DBusIme protected void FireCommit(string s) => _onCommit?.Invoke(s); - private Action _onForward; + private Action? _onForward; event Action IX11InputMethodControl.ForwardKey { add => _onForward += value; diff --git a/src/Avalonia.FreeDesktop/DBusIme/Fcitx/FcitxDBus.cs b/src/Avalonia.FreeDesktop/DBusIme/Fcitx/FcitxDBus.cs index 7ce2339763..06afacaa29 100644 --- a/src/Avalonia.FreeDesktop/DBusIme/Fcitx/FcitxDBus.cs +++ b/src/Avalonia.FreeDesktop/DBusIme/Fcitx/FcitxDBus.cs @@ -31,15 +31,15 @@ namespace Avalonia.FreeDesktop.DBusIme.Fcitx Task SetSurroundingTextPositionAsync(uint Cursor, uint Anchor); Task DestroyICAsync(); Task ProcessKeyEventAsync(uint Keyval, uint Keycode, uint State, int Type, uint Time); - Task WatchEnableIMAsync(Action handler, Action onError = null); - Task WatchCloseIMAsync(Action handler, Action onError = null); - Task WatchCommitStringAsync(Action handler, Action onError = null); - Task WatchCurrentIMAsync(Action<(string name, string uniqueName, string langCode)> handler, Action onError = null); - Task WatchUpdatePreeditAsync(Action<(string str, int cursorpos)> handler, Action onError = null); - Task WatchUpdateFormattedPreeditAsync(Action<((string, int)[] str, int cursorpos)> handler, Action onError = null); - Task WatchUpdateClientSideUIAsync(Action<(string auxup, string auxdown, string preedit, string candidateword, string imname, int cursorpos)> handler, Action onError = null); - Task WatchForwardKeyAsync(Action<(uint keyval, uint state, int type)> handler, Action onError = null); - Task WatchDeleteSurroundingTextAsync(Action<(int offset, uint nchar)> handler, Action onError = null); + Task WatchEnableIMAsync(Action handler, Action? onError = null); + Task WatchCloseIMAsync(Action handler, Action? onError = null); + Task WatchCommitStringAsync(Action handler, Action? onError = null); + Task WatchCurrentIMAsync(Action<(string name, string uniqueName, string langCode)> handler, Action? onError = null); + Task WatchUpdatePreeditAsync(Action<(string str, int cursorpos)> handler, Action? onError = null); + Task WatchUpdateFormattedPreeditAsync(Action<((string, int)[] str, int cursorpos)> handler, Action? onError = null); + Task WatchUpdateClientSideUIAsync(Action<(string auxup, string auxdown, string preedit, string candidateword, string imname, int cursorpos)> handler, Action? onError = null); + Task WatchForwardKeyAsync(Action<(uint keyval, uint state, int type)> handler, Action? onError = null); + Task WatchDeleteSurroundingTextAsync(Action<(int offset, uint nchar)> handler, Action? onError = null); } [DBusInterface("org.fcitx.Fcitx.InputContext1")] @@ -54,11 +54,11 @@ namespace Avalonia.FreeDesktop.DBusIme.Fcitx Task SetSurroundingTextPositionAsync(uint Cursor, uint Anchor); Task DestroyICAsync(); Task ProcessKeyEventAsync(uint Keyval, uint Keycode, uint State, bool Type, uint Time); - Task WatchCommitStringAsync(Action handler, Action onError = null); - Task WatchCurrentIMAsync(Action<(string name, string uniqueName, string langCode)> handler, Action onError = null); - Task WatchUpdateFormattedPreeditAsync(Action<((string, int)[] str, int cursorpos)> handler, Action onError = null); - Task WatchForwardKeyAsync(Action<(uint keyval, uint state, bool type)> handler, Action onError = null); - Task WatchDeleteSurroundingTextAsync(Action<(int offset, uint nchar)> handler, Action onError = null); + Task WatchCommitStringAsync(Action handler, Action? onError = null); + Task WatchCurrentIMAsync(Action<(string name, string uniqueName, string langCode)> handler, Action? onError = null); + Task WatchUpdateFormattedPreeditAsync(Action<((string, int)[] str, int cursorpos)> handler, Action? onError = null); + Task WatchForwardKeyAsync(Action<(uint keyval, uint state, bool type)> handler, Action? onError = null); + Task WatchDeleteSurroundingTextAsync(Action<(int offset, uint nchar)> handler, Action? onError = null); } [DBusInterface("org.fcitx.Fcitx.InputMethod1")] diff --git a/src/Avalonia.FreeDesktop/DBusIme/Fcitx/FcitxICWrapper.cs b/src/Avalonia.FreeDesktop/DBusIme/Fcitx/FcitxICWrapper.cs index a03ea213aa..6c503edb41 100644 --- a/src/Avalonia.FreeDesktop/DBusIme/Fcitx/FcitxICWrapper.cs +++ b/src/Avalonia.FreeDesktop/DBusIme/Fcitx/FcitxICWrapper.cs @@ -5,8 +5,8 @@ namespace Avalonia.FreeDesktop.DBusIme.Fcitx { internal class FcitxICWrapper { - private readonly IFcitxInputContext1 _modern; - private readonly IFcitxInputContext _old; + private readonly IFcitxInputContext1? _modern; + private readonly IFcitxInputContext? _old; public FcitxICWrapper(IFcitxInputContext old) { @@ -18,34 +18,37 @@ namespace Avalonia.FreeDesktop.DBusIme.Fcitx _modern = modern; } - public Task FocusInAsync() => _old?.FocusInAsync() ?? _modern.FocusInAsync(); + public Task FocusInAsync() => _old?.FocusInAsync() ?? _modern?.FocusInAsync() ?? Task.CompletedTask; - public Task FocusOutAsync() => _old?.FocusOutAsync() ?? _modern.FocusOutAsync(); + public Task FocusOutAsync() => _old?.FocusOutAsync() ?? _modern?.FocusOutAsync() ?? Task.CompletedTask; - public Task ResetAsync() => _old?.ResetAsync() ?? _modern.ResetAsync(); + public Task ResetAsync() => _old?.ResetAsync() ?? _modern?.ResetAsync() ?? Task.CompletedTask; public Task SetCursorRectAsync(int x, int y, int w, int h) => - _old?.SetCursorRectAsync(x, y, w, h) ?? _modern.SetCursorRectAsync(x, y, w, h); - public Task DestroyICAsync() => _old?.DestroyICAsync() ?? _modern.DestroyICAsync(); + _old?.SetCursorRectAsync(x, y, w, h) ?? _modern?.SetCursorRectAsync(x, y, w, h) ?? Task.CompletedTask; + public Task DestroyICAsync() => _old?.DestroyICAsync() ?? _modern?.DestroyICAsync() ?? Task.CompletedTask; public async Task ProcessKeyEventAsync(uint keyVal, uint keyCode, uint state, int type, uint time) { if(_old!=null) return await _old.ProcessKeyEventAsync(keyVal, keyCode, state, type, time) != 0; - return await _modern.ProcessKeyEventAsync(keyVal, keyCode, state, type > 0, time); + return await (_modern?.ProcessKeyEventAsync(keyVal, keyCode, state, type > 0, time) ?? Task.FromResult(false)); } - public Task WatchCommitStringAsync(Action handler) => - _old?.WatchCommitStringAsync(handler) ?? _modern.WatchCommitStringAsync(handler); + public Task WatchCommitStringAsync(Action handler) => + _old?.WatchCommitStringAsync(handler) + ?? _modern?.WatchCommitStringAsync(handler) + ?? Task.FromResult(default(IDisposable?)); - public Task WatchForwardKeyAsync(Action<(uint keyval, uint state, int type)> handler) + public Task WatchForwardKeyAsync(Action<(uint keyval, uint state, int type)> handler) { return _old?.WatchForwardKeyAsync(handler) - ?? _modern.WatchForwardKeyAsync(ev => - handler((ev.keyval, ev.state, ev.type ? 1 : 0))); + ?? _modern?.WatchForwardKeyAsync(ev => + handler((ev.keyval, ev.state, ev.type ? 1 : 0))) + ?? Task.FromResult(default(IDisposable?)); } public Task SetCapacityAsync(uint flags) => - _old?.SetCapacityAsync(flags) ?? _modern.SetCapabilityAsync(flags); + _old?.SetCapacityAsync(flags) ?? _modern?.SetCapabilityAsync(flags) ?? Task.CompletedTask; } } diff --git a/src/Avalonia.FreeDesktop/DBusIme/Fcitx/FcitxX11TextInputMethod.cs b/src/Avalonia.FreeDesktop/DBusIme/Fcitx/FcitxX11TextInputMethod.cs index 0b85965de7..791431dfa7 100644 --- a/src/Avalonia.FreeDesktop/DBusIme/Fcitx/FcitxX11TextInputMethod.cs +++ b/src/Avalonia.FreeDesktop/DBusIme/Fcitx/FcitxX11TextInputMethod.cs @@ -12,7 +12,7 @@ namespace Avalonia.FreeDesktop.DBusIme.Fcitx { internal class FcitxX11TextInputMethod : DBusTextInputMethodBase { - private FcitxICWrapper _context; + private FcitxICWrapper? _context; private FcitxCapabilityFlags? _lastReportedFlags; public FcitxX11TextInputMethod(Connection connection) : base(connection, @@ -49,7 +49,7 @@ namespace Avalonia.FreeDesktop.DBusIme.Fcitx return true; } - protected override Task Disconnect() => _context.DestroyICAsync(); + protected override Task Disconnect() => _context?.DestroyICAsync() ?? Task.CompletedTask; protected override void OnDisconnected() => _context = null; @@ -60,18 +60,18 @@ namespace Avalonia.FreeDesktop.DBusIme.Fcitx } protected override Task SetCursorRectCore(PixelRect cursorRect) => - _context.SetCursorRectAsync(cursorRect.X, cursorRect.Y, Math.Max(1, cursorRect.Width), - Math.Max(1, cursorRect.Height)); - - protected override Task SetActiveCore(bool active) - { - if (active) - return _context.FocusInAsync(); - else - return _context.FocusOutAsync(); - } + _context?.SetCursorRectAsync(cursorRect.X, cursorRect.Y, Math.Max(1, cursorRect.Width), + Math.Max(1, cursorRect.Height)) + ?? Task.CompletedTask; + + protected override Task SetActiveCore(bool active)=> (active + ? _context?.FocusInAsync() + : _context?.FocusOutAsync()) + ?? Task.CompletedTask; + - protected override Task ResetContextCore() => _context.ResetAsync(); + protected override Task ResetContextCore() => _context?.ResetAsync() + ?? Task.CompletedTask; protected override async Task HandleKeyCore(RawKeyEventArgs args, int keyVal, int keyCode) { @@ -88,9 +88,15 @@ namespace Avalonia.FreeDesktop.DBusIme.Fcitx var type = args.Type == RawKeyEventType.KeyDown ? FcitxKeyEventType.FCITX_PRESS_KEY : FcitxKeyEventType.FCITX_RELEASE_KEY; - - return await _context.ProcessKeyEventAsync((uint)keyVal, (uint)keyCode, (uint)state, (int)type, - (uint)args.Timestamp).ConfigureAwait(false); + if (_context is { }) + { + return await _context.ProcessKeyEventAsync((uint)keyVal, (uint)keyCode, (uint)state, (int)type, + (uint)args.Timestamp).ConfigureAwait(false); + } + else + { + return false; + } } public override void SetOptions(TextInputOptions options) => diff --git a/src/Avalonia.FreeDesktop/DBusIme/IBus/IBusDBus.cs b/src/Avalonia.FreeDesktop/DBusIme/IBus/IBusDBus.cs index 26c0d249f3..4ef034adb9 100644 --- a/src/Avalonia.FreeDesktop/DBusIme/IBus/IBusDBus.cs +++ b/src/Avalonia.FreeDesktop/DBusIme/IBus/IBusDBus.cs @@ -22,25 +22,25 @@ namespace Avalonia.FreeDesktop.DBusIme.IBus Task GetEngineAsync(); Task DestroyAsync(); Task SetSurroundingTextAsync(object Text, uint CursorPos, uint AnchorPos); - Task WatchCommitTextAsync(Action cb, Action onError = null); - Task WatchForwardKeyEventAsync(Action<(uint keyval, uint keycode, uint state)> handler, Action onError = null); - Task WatchRequireSurroundingTextAsync(Action handler, Action onError = null); - Task WatchDeleteSurroundingTextAsync(Action<(int offset, uint nchars)> handler, Action onError = null); - Task WatchUpdatePreeditTextAsync(Action<(object text, uint cursorPos, bool visible)> handler, Action onError = null); - Task WatchShowPreeditTextAsync(Action handler, Action onError = null); - Task WatchHidePreeditTextAsync(Action handler, Action onError = null); - Task WatchUpdateAuxiliaryTextAsync(Action<(object text, bool visible)> handler, Action onError = null); - Task WatchShowAuxiliaryTextAsync(Action handler, Action onError = null); - Task WatchHideAuxiliaryTextAsync(Action handler, Action onError = null); - Task WatchUpdateLookupTableAsync(Action<(object table, bool visible)> handler, Action onError = null); - Task WatchShowLookupTableAsync(Action handler, Action onError = null); - Task WatchHideLookupTableAsync(Action handler, Action onError = null); - Task WatchPageUpLookupTableAsync(Action handler, Action onError = null); - Task WatchPageDownLookupTableAsync(Action handler, Action onError = null); - Task WatchCursorUpLookupTableAsync(Action handler, Action onError = null); - Task WatchCursorDownLookupTableAsync(Action handler, Action onError = null); - Task WatchRegisterPropertiesAsync(Action handler, Action onError = null); - Task WatchUpdatePropertyAsync(Action handler, Action onError = null); + Task WatchCommitTextAsync(Action cb, Action? onError = null); + Task WatchForwardKeyEventAsync(Action<(uint keyval, uint keycode, uint state)> handler, Action? onError = null); + Task WatchRequireSurroundingTextAsync(Action handler, Action? onError = null); + Task WatchDeleteSurroundingTextAsync(Action<(int offset, uint nchars)> handler, Action? onError = null); + Task WatchUpdatePreeditTextAsync(Action<(object text, uint cursorPos, bool visible)> handler, Action? onError = null); + Task WatchShowPreeditTextAsync(Action handler, Action? onError = null); + Task WatchHidePreeditTextAsync(Action handler, Action? onError = null); + Task WatchUpdateAuxiliaryTextAsync(Action<(object text, bool visible)> handler, Action? onError = null); + Task WatchShowAuxiliaryTextAsync(Action handler, Action? onError = null); + Task WatchHideAuxiliaryTextAsync(Action handler, Action? onError = null); + Task WatchUpdateLookupTableAsync(Action<(object table, bool visible)> handler, Action? onError = null); + Task WatchShowLookupTableAsync(Action handler, Action? onError = null); + Task WatchHideLookupTableAsync(Action handler, Action? onError = null); + Task WatchPageUpLookupTableAsync(Action handler, Action? onError = null); + Task WatchPageDownLookupTableAsync(Action handler, Action? onError = null); + Task WatchCursorUpLookupTableAsync(Action handler, Action? onError = null); + Task WatchCursorDownLookupTableAsync(Action handler, Action? onError = null); + Task WatchRegisterPropertiesAsync(Action handler, Action? onError = null); + Task WatchUpdatePropertyAsync(Action handler, Action? onError = null); } diff --git a/src/Avalonia.FreeDesktop/DBusIme/IBus/IBusX11TextInputMethod.cs b/src/Avalonia.FreeDesktop/DBusIme/IBus/IBusX11TextInputMethod.cs index 1397eaa57b..2324ca44a7 100644 --- a/src/Avalonia.FreeDesktop/DBusIme/IBus/IBusX11TextInputMethod.cs +++ b/src/Avalonia.FreeDesktop/DBusIme/IBus/IBusX11TextInputMethod.cs @@ -9,7 +9,7 @@ namespace Avalonia.FreeDesktop.DBusIme.IBus { internal class IBusX11TextInputMethod : DBusTextInputMethodBase { - private IIBusInputContext _context; + private IIBusInputContext? _context; public IBusX11TextInputMethod(Connection connection) : base(connection, "org.freedesktop.portal.IBus") @@ -53,16 +53,16 @@ namespace Avalonia.FreeDesktop.DBusIme.IBus private void OnCommitText(object wtf) { // Hello darkness, my old friend - var prop = wtf.GetType().GetField("Item3"); - if (prop != null) + if (wtf.GetType().GetField("Item3") is { } prop) { - var text = (string)prop.GetValue(wtf); + var text = prop.GetValue(wtf) as string; if (!string.IsNullOrEmpty(text)) - FireCommit(text); + FireCommit(text!); } } - protected override Task Disconnect() => _context.DestroyAsync(); + protected override Task Disconnect() => _context?.DestroyAsync() + ?? Task.CompletedTask; protected override void OnDisconnected() { @@ -71,13 +71,15 @@ namespace Avalonia.FreeDesktop.DBusIme.IBus } protected override Task SetCursorRectCore(PixelRect rect) - => _context.SetCursorLocationAsync(rect.X, rect.Y, rect.Width, rect.Height); + => _context?.SetCursorLocationAsync(rect.X, rect.Y, rect.Width, rect.Height) + ?? Task.CompletedTask; protected override Task SetActiveCore(bool active) - => active ? _context.FocusInAsync() : _context.FocusOutAsync(); + => (active ? _context?.FocusInAsync() : _context?.FocusOutAsync()) + ?? Task.CompletedTask; protected override Task ResetContextCore() - => _context.ResetAsync(); + => _context?.ResetAsync() ?? Task.CompletedTask; protected override Task HandleKeyCore(RawKeyEventArgs args, int keyVal, int keyCode) { @@ -94,7 +96,15 @@ namespace Avalonia.FreeDesktop.DBusIme.IBus if (args.Type == RawKeyEventType.KeyUp) state |= IBusModifierMask.ReleaseMask; - return _context.ProcessKeyEventAsync((uint)keyVal, (uint)keyCode, (uint)state); + if(_context is { }) + { + return _context.ProcessKeyEventAsync((uint)keyVal, (uint)keyCode, (uint)state); + } + else + { + return Task.FromResult(false); + } + } public override void SetOptions(TextInputOptions options) diff --git a/src/Avalonia.FreeDesktop/DBusIme/X11DBusImeHelper.cs b/src/Avalonia.FreeDesktop/DBusIme/X11DBusImeHelper.cs index 7f71ecf0ff..86978c8b60 100644 --- a/src/Avalonia.FreeDesktop/DBusIme/X11DBusImeHelper.cs +++ b/src/Avalonia.FreeDesktop/DBusIme/X11DBusImeHelper.cs @@ -17,7 +17,7 @@ namespace Avalonia.FreeDesktop.DBusIme new DBusInputMethodFactory(_ => new IBusX11TextInputMethod(conn)) }; - static Func DetectInputMethod() + static Func? DetectInputMethod() { foreach (var name in new[] { "AVALONIA_IM_MODULE", "GTK_IM_MODULE", "QT_IM_MODULE" }) { diff --git a/src/Avalonia.FreeDesktop/DBusMenu.cs b/src/Avalonia.FreeDesktop/DBusMenu.cs index 7180345386..3a1c65e7c9 100644 --- a/src/Avalonia.FreeDesktop/DBusMenu.cs +++ b/src/Avalonia.FreeDesktop/DBusMenu.cs @@ -28,18 +28,18 @@ namespace Avalonia.FreeDesktop.DBusMenu Task EventGroupAsync((int id, string eventId, object data, uint timestamp)[] events); Task AboutToShowAsync(int Id); Task<(int[] updatesNeeded, int[] idErrors)> AboutToShowGroupAsync(int[] Ids); - Task WatchItemsPropertiesUpdatedAsync(Action<((int, IDictionary)[] updatedProps, (int, string[])[] removedProps)> handler, Action onError = null); - Task WatchLayoutUpdatedAsync(Action<(uint revision, int parent)> handler, Action onError = null); - Task WatchItemActivationRequestedAsync(Action<(int id, uint timestamp)> handler, Action onError = null); + Task WatchItemsPropertiesUpdatedAsync(Action<((int, IDictionary)[] updatedProps, (int, string[])[] removedProps)> handler, Action? onError = null); + Task WatchLayoutUpdatedAsync(Action<(uint revision, int parent)> handler, Action? onError = null); + Task WatchItemActivationRequestedAsync(Action<(int id, uint timestamp)> handler, Action? onError = null); } [Dictionary] class DBusMenuProperties { public uint Version { get; set; } = default (uint); - public string TextDirection { get; set; } = default (string); - public string Status { get; set; } = default (string); - public string[] IconThemePath { get; set; } = default (string[]); + public string? TextDirection { get; set; } = default (string); + public string? Status { get; set; } = default (string); + public string[]? IconThemePath { get; set; } = default (string[]); } @@ -50,7 +50,7 @@ namespace Avalonia.FreeDesktop.DBusMenu Task UnregisterWindowAsync(uint WindowId); Task<(string service, ObjectPath menuObjectPath)> GetMenuForWindowAsync(uint WindowId); Task<(uint, string, ObjectPath)[]> GetMenusAsync(); - Task WatchWindowRegisteredAsync(Action<(uint windowId, string service, ObjectPath menuObjectPath)> handler, Action onError = null); - Task WatchWindowUnregisteredAsync(Action handler, Action onError = null); + Task WatchWindowRegisteredAsync(Action<(uint windowId, string service, ObjectPath menuObjectPath)> handler, Action? onError = null); + Task WatchWindowUnregisteredAsync(Action handler, Action? onError = null); } } diff --git a/src/Avalonia.FreeDesktop/DBusMenuExporter.cs b/src/Avalonia.FreeDesktop/DBusMenuExporter.cs index 206c24ad5e..c0511420a6 100644 --- a/src/Avalonia.FreeDesktop/DBusMenuExporter.cs +++ b/src/Avalonia.FreeDesktop/DBusMenuExporter.cs @@ -17,7 +17,7 @@ namespace Avalonia.FreeDesktop { public class DBusMenuExporter { - public static ITopLevelNativeMenuExporter TryCreateTopLevelNativeMenu(IntPtr xid) + public static ITopLevelNativeMenuExporter? TryCreateTopLevelNativeMenu(IntPtr xid) { if (DBusHelper.Connection == null) return null; @@ -37,10 +37,10 @@ namespace Avalonia.FreeDesktop { private readonly Connection _dbus; private readonly uint _xid; - private IRegistrar _registrar; + private IRegistrar? _registrar; private bool _disposed; private uint _revision = 1; - private NativeMenu _menu; + private NativeMenu? _menu; private readonly Dictionary _idsToItems = new Dictionary(); private readonly Dictionary _itemsToIds = new Dictionary(); private readonly HashSet _menus = new HashSet(); @@ -73,10 +73,10 @@ namespace Avalonia.FreeDesktop if (_appMenu) { await _dbus.RegisterObjectAsync(this); - _registrar = DBusHelper.Connection.CreateProxy( + _registrar = DBusHelper.Connection?.CreateProxy( "com.canonical.AppMenu.Registrar", "/com/canonical/AppMenu/Registrar"); - if (!_disposed) + if (!_disposed && _registrar is { }) await _registrar.RegisterWindowAsync(_xid, ObjectPath); } else @@ -109,9 +109,9 @@ namespace Avalonia.FreeDesktop public bool IsNativeMenuExported { get; private set; } - public event EventHandler OnIsNativeMenuExportedChanged; + public event EventHandler? OnIsNativeMenuExportedChanged; - public void SetNativeMenu(NativeMenu menu) + public void SetNativeMenu(NativeMenu? menu) { if (menu == null) menu = new NativeMenu(); @@ -153,7 +153,7 @@ namespace Avalonia.FreeDesktop Dispatcher.UIThread.Post(DoLayoutReset, DispatcherPriority.Background); } - private (NativeMenuItemBase item, NativeMenu menu) GetMenu(int id) + private (NativeMenuItemBase? item, NativeMenu? menu) GetMenu(int id) { if (id == 0) return (null, _menu); @@ -161,7 +161,7 @@ namespace Avalonia.FreeDesktop return (item, (item as NativeMenuItem)?.Menu); } - private void EnsureSubscribed(NativeMenu menu) + private void EnsureSubscribed(NativeMenu? menu) { if(menu!=null && _menus.Add(menu)) ((INotifyCollectionChanged)menu.Items).CollectionChanged += OnMenuItemsChanged; @@ -180,12 +180,12 @@ namespace Avalonia.FreeDesktop return id; } - private void OnMenuItemsChanged(object sender, NotifyCollectionChangedEventArgs e) + private void OnMenuItemsChanged(object? sender, NotifyCollectionChangedEventArgs e) { QueueReset(); } - private void OnItemPropertyChanged(object sender, AvaloniaPropertyChangedEventArgs e) + private void OnItemPropertyChanged(object? sender, AvaloniaPropertyChangedEventArgs e) { QueueReset(); } @@ -216,7 +216,7 @@ namespace Avalonia.FreeDesktop "type", "label", "enabled", "visible", "shortcut", "toggle-type", "children-display", "toggle-state", "icon-data" }; - object GetProperty((NativeMenuItemBase item, NativeMenu menu) i, string name) + object? GetProperty((NativeMenuItemBase? item, NativeMenu? menu) i, string name) { var (it, menu) = i; @@ -302,7 +302,7 @@ namespace Avalonia.FreeDesktop } private List> _reusablePropertyList = new List>(); - KeyValuePair[] GetProperties((NativeMenuItemBase item, NativeMenu menu) i, string[] names) + KeyValuePair[] GetProperties((NativeMenuItemBase? item, NativeMenu? menu) i, string[] names) { if (names?.Length > 0 != true) names = AllProperties; @@ -336,7 +336,7 @@ namespace Avalonia.FreeDesktop return Task.FromResult(rv); } - (int, KeyValuePair[], object[]) GetLayout(NativeMenuItemBase item, NativeMenu menu, int depth, string[] propertyNames) + (int, KeyValuePair[], object[]) GetLayout(NativeMenuItemBase? item, NativeMenu? menu, int depth, string[] propertyNames) { var id = item == null ? 0 : GetId(item); var props = GetProperties((item, menu), propertyNames); @@ -414,22 +414,22 @@ namespace Avalonia.FreeDesktop private event Action<((int, IDictionary)[] updatedProps, (int, string[])[] removedProps)> ItemsPropertiesUpdated { add { } remove { } } - private event Action<(uint revision, int parent)> LayoutUpdated; + private event Action<(uint revision, int parent)>? LayoutUpdated; private event Action<(int id, uint timestamp)> ItemActivationRequested { add { } remove { } } private event Action PropertiesChanged { add { } remove { } } - async Task IDBusMenu.WatchItemsPropertiesUpdatedAsync(Action<((int, IDictionary)[] updatedProps, (int, string[])[] removedProps)> handler, Action onError) + async Task IDBusMenu.WatchItemsPropertiesUpdatedAsync(Action<((int, IDictionary)[] updatedProps, (int, string[])[] removedProps)> handler, Action? onError) { ItemsPropertiesUpdated += handler; return Disposable.Create(() => ItemsPropertiesUpdated -= handler); } - async Task IDBusMenu.WatchLayoutUpdatedAsync(Action<(uint revision, int parent)> handler, Action onError) + async Task IDBusMenu.WatchLayoutUpdatedAsync(Action<(uint revision, int parent)> handler, Action? onError) { LayoutUpdated += handler; return Disposable.Create(() => LayoutUpdated -= handler); } - async Task IDBusMenu.WatchItemActivationRequestedAsync(Action<(int id, uint timestamp)> handler, Action onError) + async Task IDBusMenu.WatchItemActivationRequestedAsync(Action<(int id, uint timestamp)> handler, Action? onError) { ItemActivationRequested+= handler; return Disposable.Create(() => ItemActivationRequested -= handler); diff --git a/src/Avalonia.FreeDesktop/DBusRequest.cs b/src/Avalonia.FreeDesktop/DBusRequest.cs index 940a476916..d84905324f 100644 --- a/src/Avalonia.FreeDesktop/DBusRequest.cs +++ b/src/Avalonia.FreeDesktop/DBusRequest.cs @@ -11,6 +11,6 @@ namespace Avalonia.FreeDesktop internal interface IRequest : IDBusObject { Task CloseAsync(); - Task WatchResponseAsync(Action<(uint response, IDictionary results)> handler, Action onError = null); + Task WatchResponseAsync(Action<(uint response, IDictionary results)> handler, Action? onError = null); } } diff --git a/src/Avalonia.FreeDesktop/DBusSystemDialog.cs b/src/Avalonia.FreeDesktop/DBusSystemDialog.cs index c17d5b993c..7974069184 100644 --- a/src/Avalonia.FreeDesktop/DBusSystemDialog.cs +++ b/src/Avalonia.FreeDesktop/DBusSystemDialog.cs @@ -15,27 +15,26 @@ namespace Avalonia.FreeDesktop { internal class DBusSystemDialog : BclStorageProvider { - private static readonly Lazy s_fileChooser = new(() => + private static readonly Lazy s_fileChooser = new(() => DBusHelper.Connection? + .CreateProxy("org.freedesktop.portal.Desktop", "/org/freedesktop/portal/desktop")); + + internal static async Task TryCreate(IPlatformHandle handle) { - var fileChooser = DBusHelper.Connection?.CreateProxy("org.freedesktop.portal.Desktop", "/org/freedesktop/portal/desktop"); - if (fileChooser is null) - return null; - try + if (handle.HandleDescriptor == "XID" && s_fileChooser.Value is { } fileChooser) { - _ = fileChooser.GetVersionAsync(); - return fileChooser; - } - catch (Exception e) - { - Logger.TryGet(LogEventLevel.Error, LogArea.X11Platform)?.Log(null, $"Unable to connect to org.freedesktop.portal.Desktop: {e.Message}"); - return null; + try + { + await fileChooser.GetVersionAsync(); + return new DBusSystemDialog(fileChooser, handle); + } + catch (Exception e) + { + Logger.TryGet(LogEventLevel.Error, LogArea.X11Platform)?.Log(null, $"Unable to connect to org.freedesktop.portal.Desktop: {e.Message}"); + return null; + } } - }); - internal static DBusSystemDialog? TryCreate(IPlatformHandle handle) - { - return handle.HandleDescriptor == "XID" && s_fileChooser.Value is { } fileChooser - ? new DBusSystemDialog(fileChooser, handle) : null; + return null; } private readonly IFileChooser _fileChooser; diff --git a/src/Avalonia.FreeDesktop/LinuxMountedVolumeInfoProvider.cs b/src/Avalonia.FreeDesktop/LinuxMountedVolumeInfoProvider.cs index d68c02bfd6..b69ea68a76 100644 --- a/src/Avalonia.FreeDesktop/LinuxMountedVolumeInfoProvider.cs +++ b/src/Avalonia.FreeDesktop/LinuxMountedVolumeInfoProvider.cs @@ -10,7 +10,7 @@ namespace Avalonia.FreeDesktop public IDisposable Listen(ObservableCollection mountedDrives) { Contract.Requires(mountedDrives != null); - return new LinuxMountedVolumeInfoListener(ref mountedDrives); + return new LinuxMountedVolumeInfoListener(ref mountedDrives!); } } } diff --git a/src/Avalonia.Headless.Vnc/HeadlessVncPlatformExtensions.cs b/src/Avalonia.Headless.Vnc/HeadlessVncPlatformExtensions.cs index bd215296c8..cc7d5ef30d 100644 --- a/src/Avalonia.Headless.Vnc/HeadlessVncPlatformExtensions.cs +++ b/src/Avalonia.Headless.Vnc/HeadlessVncPlatformExtensions.cs @@ -20,7 +20,11 @@ namespace Avalonia var tcpServer = new TcpListener(host == null ? IPAddress.Loopback : IPAddress.Parse(host), port); tcpServer.Start(); return builder - .UseHeadless(false) + .UseHeadless(new AvaloniaHeadlessPlatformOptions + { + UseCompositor = true, + UseHeadlessDrawing = false + }) .AfterSetup(_ => { var lt = ((IClassicDesktopStyleApplicationLifetime)builder.Instance.ApplicationLifetime); diff --git a/src/Avalonia.Headless/AvaloniaHeadlessPlatform.cs b/src/Avalonia.Headless/AvaloniaHeadlessPlatform.cs index 8e83b0c7b6..4fcec6fd52 100644 --- a/src/Avalonia.Headless/AvaloniaHeadlessPlatform.cs +++ b/src/Avalonia.Headless/AvaloniaHeadlessPlatform.cs @@ -7,12 +7,14 @@ using Avalonia.Input; using Avalonia.Input.Platform; using Avalonia.Platform; using Avalonia.Rendering; +using Avalonia.Rendering.Composition; using Avalonia.Threading; namespace Avalonia.Headless { public static class AvaloniaHeadlessPlatform { + internal static Compositor Compositor { get; private set; } class RenderTimer : DefaultRenderTimer { private readonly int _framesPerSecond; @@ -55,7 +57,7 @@ namespace Avalonia.Headless public ITrayIconImpl CreateTrayIcon() => null; } - internal static void Initialize() + internal static void Initialize(AvaloniaHeadlessPlatformOptions opts) { AvaloniaLocator.CurrentMutable .Bind().ToConstant(new HeadlessPlatformThreadingInterface()) @@ -70,6 +72,8 @@ namespace Avalonia.Headless .Bind().ToSingleton() .Bind().ToConstant(new HeadlessWindowingPlatform()) .Bind().ToSingleton(); + if (opts.UseCompositor) + Compositor = new Compositor(AvaloniaLocator.Current.GetRequiredService(), null); } @@ -81,15 +85,21 @@ namespace Avalonia.Headless } } - + + public class AvaloniaHeadlessPlatformOptions + { + public bool UseCompositor { get; set; } = true; + public bool UseHeadlessDrawing { get; set; } = true; + } + public static class AvaloniaHeadlessPlatformExtensions { - public static T UseHeadless(this T builder, bool headlessDrawing = true) + public static T UseHeadless(this T builder, AvaloniaHeadlessPlatformOptions opts) where T : AppBuilderBase, new() { - if (headlessDrawing) + if(opts.UseHeadlessDrawing) builder.UseRenderingSubsystem(HeadlessPlatformRenderInterface.Initialize, "Headless"); - return builder.UseWindowingSubsystem(AvaloniaHeadlessPlatform.Initialize, "Headless"); + return builder.UseWindowingSubsystem(() => AvaloniaHeadlessPlatform.Initialize(opts), "Headless"); } } } diff --git a/src/Avalonia.Headless/HeadlessPlatformRenderInterface.cs b/src/Avalonia.Headless/HeadlessPlatformRenderInterface.cs index 059a9a4e8f..5576368240 100644 --- a/src/Avalonia.Headless/HeadlessPlatformRenderInterface.cs +++ b/src/Avalonia.Headless/HeadlessPlatformRenderInterface.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Numerics; using System.Runtime.InteropServices; using Avalonia.Media; using Avalonia.Platform; @@ -349,6 +350,7 @@ namespace Avalonia.Headless } public Matrix Transform { get; set; } + public void Clear(Color color) { @@ -416,7 +418,6 @@ namespace Avalonia.Headless public void DrawLine(IPen pen, Point p1, Point p2) { - throw new NotImplementedException(); } public void DrawGeometry(IBrush brush, IPen pen, IGeometryImpl geometry) diff --git a/src/Avalonia.Headless/HeadlessWindowImpl.cs b/src/Avalonia.Headless/HeadlessWindowImpl.cs index 6fbdf8dffd..742df3324b 100644 --- a/src/Avalonia.Headless/HeadlessWindowImpl.cs +++ b/src/Avalonia.Headless/HeadlessWindowImpl.cs @@ -12,6 +12,7 @@ using Avalonia.Media.Imaging; using Avalonia.Platform; using Avalonia.Platform.Storage; using Avalonia.Rendering; +using Avalonia.Rendering.Composition; using Avalonia.Threading; using Avalonia.Utilities; @@ -54,7 +55,9 @@ namespace Avalonia.Headless public Action ScalingChanged { get; set; } public IRenderer CreateRenderer(IRenderRoot root) - => new DeferredRenderer(root, AvaloniaLocator.Current.GetService()); + => AvaloniaHeadlessPlatform.Compositor != null + ? new CompositingRenderer(root, AvaloniaHeadlessPlatform.Compositor) + : new DeferredRenderer(root, AvaloniaLocator.Current.GetRequiredService()); public void Invalidate(Rect rect) { diff --git a/src/Avalonia.Native/AvaloniaNativePlatform.cs b/src/Avalonia.Native/AvaloniaNativePlatform.cs index 6cbe888d9b..b45fe5559b 100644 --- a/src/Avalonia.Native/AvaloniaNativePlatform.cs +++ b/src/Avalonia.Native/AvaloniaNativePlatform.cs @@ -8,6 +8,8 @@ using Avalonia.Native.Interop; using Avalonia.OpenGL; using Avalonia.Platform; using Avalonia.Rendering; +using Avalonia.Rendering.Composition; +using JetBrains.Annotations; namespace Avalonia.Native { @@ -21,6 +23,7 @@ namespace Avalonia.Native static extern IntPtr CreateAvaloniaNative(); internal static readonly KeyboardDevice KeyboardDevice = new KeyboardDevice(); + [CanBeNull] internal static Compositor Compositor { get; private set; } public Size DoubleClickSize => new Size(4, 4); @@ -110,7 +113,6 @@ namespace Avalonia.Native .Bind().ToConstant(this) .Bind().ToConstant(this) .Bind().ToConstant(new ClipboardImpl(_factory.CreateClipboard())) - .Bind().ToConstant(new RenderLoop()) .Bind().ToConstant(new DefaultRenderTimer(60)) .Bind().ToConstant(new PlatformHotkeyConfiguration(KeyModifiers.Meta, wholeWordTextActionModifiers: KeyModifiers.Alt)) .Bind().ToConstant(new MacOSMountedVolumeInfoProvider()) @@ -118,24 +120,36 @@ namespace Avalonia.Native .Bind().ToConstant(applicationPlatform) .Bind().ToConstant(new MacOSNativeMenuCommands(_factory.CreateApplicationCommands())); + var renderLoop = new RenderLoop(); + AvaloniaLocator.CurrentMutable.Bind().ToConstant(renderLoop); + var hotkeys = AvaloniaLocator.Current.GetService(); hotkeys.MoveCursorToTheStartOfLine.Add(new KeyGesture(Key.Left, hotkeys.CommandModifiers)); hotkeys.MoveCursorToTheStartOfLineWithSelection.Add(new KeyGesture(Key.Left, hotkeys.CommandModifiers | hotkeys.SelectionModifiers)); hotkeys.MoveCursorToTheEndOfLine.Add(new KeyGesture(Key.Right, hotkeys.CommandModifiers)); hotkeys.MoveCursorToTheEndOfLineWithSelection.Add(new KeyGesture(Key.Right, hotkeys.CommandModifiers | hotkeys.SelectionModifiers)); - + if (_options.UseGpu) { try { - AvaloniaLocator.CurrentMutable.Bind() - .ToConstant(_platformGl = new AvaloniaNativePlatformOpenGlInterface(_factory.ObtainGlDisplay())); + _platformGl = new AvaloniaNativePlatformOpenGlInterface(_factory.ObtainGlDisplay()); + AvaloniaLocator.CurrentMutable + .Bind().ToConstant(_platformGl) + .Bind().ToConstant(_platformGl); + } catch (Exception) { // ignored } } + + + if (_options.UseDeferredRendering && _options.UseCompositor) + { + Compositor = new Compositor(renderLoop, _platformGl); + } } public ITrayIconImpl CreateTrayIcon() diff --git a/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs b/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs index 10619d675b..61889aa9e4 100644 --- a/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs +++ b/src/Avalonia.Native/AvaloniaNativePlatformExtensions.cs @@ -39,6 +39,11 @@ namespace Avalonia /// Immediate re-renders the whole scene when some element is changed on the scene. Deferred re-renders only changed elements. /// public bool UseDeferredRendering { get; set; } = true; + + /// + /// Enables new compositing rendering with UWP-like API + /// + public bool UseCompositor { get; set; } = true; /// /// Determines whether to use GPU for rendering in your project. The default value is true. diff --git a/src/Avalonia.Native/AvaloniaNativePlatformOpenGlInterface.cs b/src/Avalonia.Native/AvaloniaNativePlatformOpenGlInterface.cs index 3b3d8836fd..14d27a90e9 100644 --- a/src/Avalonia.Native/AvaloniaNativePlatformOpenGlInterface.cs +++ b/src/Avalonia.Native/AvaloniaNativePlatformOpenGlInterface.cs @@ -3,6 +3,7 @@ using Avalonia.OpenGL; using Avalonia.Native.Interop; using System.Drawing; using Avalonia.OpenGL.Surfaces; +using Avalonia.Platform; using Avalonia.Threading; namespace Avalonia.Native @@ -37,6 +38,7 @@ namespace Avalonia.Native internal GlContext MainContext { get; } public IGlContext PrimaryContext => MainContext; + IPlatformGpuContext IPlatformGpu.PrimaryContext => PrimaryContext; public bool CanShareContexts => true; public bool CanCreateContexts => true; diff --git a/src/Avalonia.Native/WindowImplBase.cs b/src/Avalonia.Native/WindowImplBase.cs index bb0af0151e..34de439c94 100644 --- a/src/Avalonia.Native/WindowImplBase.cs +++ b/src/Avalonia.Native/WindowImplBase.cs @@ -13,6 +13,7 @@ using Avalonia.OpenGL; using Avalonia.Platform; using Avalonia.Platform.Storage; using Avalonia.Rendering; +using Avalonia.Rendering.Composition; using Avalonia.Threading; namespace Avalonia.Native @@ -366,13 +367,18 @@ namespace Avalonia.Native public IRenderer CreateRenderer(IRenderRoot root) { + var customRendererFactory = AvaloniaLocator.Current.GetService(); + var loop = AvaloniaLocator.Current.GetService(); + if (customRendererFactory != null) + return customRendererFactory.Create(root, loop); + if (_deferredRendering) { - var loop = AvaloniaLocator.Current.GetService(); - var customRendererFactory = AvaloniaLocator.Current.GetService(); - - if (customRendererFactory != null) - return customRendererFactory.Create(root, loop); + if (AvaloniaNativePlatform.Compositor != null) + return new CompositingRenderer(root, AvaloniaNativePlatform.Compositor) + { + RenderOnlyOnRenderThread = false + }; return new DeferredRenderer(root, loop); } diff --git a/src/Avalonia.OpenGL/Egl/EglConsts.cs b/src/Avalonia.OpenGL/Egl/EglConsts.cs index 530d3401f6..1268845f0f 100644 --- a/src/Avalonia.OpenGL/Egl/EglConsts.cs +++ b/src/Avalonia.OpenGL/Egl/EglConsts.cs @@ -4,212 +4,212 @@ namespace Avalonia.OpenGL.Egl { public static class EglConsts { - public const int EGL_ALPHA_SIZE = 0x3021; - public const int EGL_BAD_ACCESS = 0x3002; - public const int EGL_BAD_ALLOC = 0x3003; - public const int EGL_BAD_ATTRIBUTE = 0x3004; - public const int EGL_BAD_CONFIG = 0x3005; - public const int EGL_BAD_CONTEXT = 0x3006; - public const int EGL_BAD_CURRENT_SURFACE = 0x3007; - public const int EGL_BAD_DISPLAY = 0x3008; - public const int EGL_BAD_MATCH = 0x3009; - public const int EGL_BAD_NATIVE_PIXMAP = 0x300A; - public const int EGL_BAD_NATIVE_WINDOW = 0x300B; - public const int EGL_BAD_PARAMETER = 0x300C; - public const int EGL_BAD_SURFACE = 0x300D; - public const int EGL_BLUE_SIZE = 0x3022; - public const int EGL_BUFFER_SIZE = 0x3020; - public const int EGL_CONFIG_CAVEAT = 0x3027; - public const int EGL_CONFIG_ID = 0x3028; - public const int EGL_CORE_NATIVE_ENGINE = 0x305B; - public const int EGL_DEPTH_SIZE = 0x3025; - public const int EGL_DONT_CARE = -1; - public const int EGL_DRAW = 0x3059; - public const int EGL_EXTENSIONS = 0x3055; - public const int EGL_FALSE = 0; - public const int EGL_GREEN_SIZE = 0x3023; - public const int EGL_HEIGHT = 0x3056; - public const int EGL_LARGEST_PBUFFER = 0x3058; - public const int EGL_LEVEL = 0x3029; - public const int EGL_MAX_PBUFFER_HEIGHT = 0x302A; - public const int EGL_MAX_PBUFFER_PIXELS = 0x302B; - public const int EGL_MAX_PBUFFER_WIDTH = 0x302C; - public const int EGL_NATIVE_RENDERABLE = 0x302D; - public const int EGL_NATIVE_VISUAL_ID = 0x302E; - public const int EGL_NATIVE_VISUAL_TYPE = 0x302F; - public const int EGL_NONE = 0x3038; - public const int EGL_NON_CONFORMANT_CONFIG = 0x3051; - public const int EGL_NOT_INITIALIZED = 0x3001; - public const int EGL_NO_CONTEXT = 0; - public const int EGL_NO_DISPLAY = 0; - public const int EGL_NO_SURFACE = 0; - public const int EGL_PBUFFER_BIT = 0x0001; - public const int EGL_PIXMAP_BIT = 0x0002; - public const int EGL_READ = 0x305A; - public const int EGL_RED_SIZE = 0x3024; - public const int EGL_SAMPLES = 0x3031; - public const int EGL_SAMPLE_BUFFERS = 0x3032; - public const int EGL_SLOW_CONFIG = 0x3050; - public const int EGL_STENCIL_SIZE = 0x3026; - public const int EGL_SUCCESS = 0x3000; - public const int EGL_SURFACE_TYPE = 0x3033; - public const int EGL_TRANSPARENT_BLUE_VALUE = 0x3035; - public const int EGL_TRANSPARENT_GREEN_VALUE = 0x3036; - public const int EGL_TRANSPARENT_RED_VALUE = 0x3037; - public const int EGL_TRANSPARENT_RGB = 0x3052; - public const int EGL_TRANSPARENT_TYPE = 0x3034; - public const int EGL_TRUE = 1; - public const int EGL_VENDOR = 0x3053; - public const int EGL_VERSION = 0x3054; - public const int EGL_WIDTH = 0x3057; - public const int EGL_WINDOW_BIT = 0x0004; + public const int EGL_ALPHA_SIZE = 0x3021; + public const int EGL_BAD_ACCESS = 0x3002; + public const int EGL_BAD_ALLOC = 0x3003; + public const int EGL_BAD_ATTRIBUTE = 0x3004; + public const int EGL_BAD_CONFIG = 0x3005; + public const int EGL_BAD_CONTEXT = 0x3006; + public const int EGL_BAD_CURRENT_SURFACE = 0x3007; + public const int EGL_BAD_DISPLAY = 0x3008; + public const int EGL_BAD_MATCH = 0x3009; + public const int EGL_BAD_NATIVE_PIXMAP = 0x300A; + public const int EGL_BAD_NATIVE_WINDOW = 0x300B; + public const int EGL_BAD_PARAMETER = 0x300C; + public const int EGL_BAD_SURFACE = 0x300D; + public const int EGL_BLUE_SIZE = 0x3022; +// public const int EGL_BUFFER_SIZE = 0x3020; +// public const int EGL_CONFIG_CAVEAT = 0x3027; +// public const int EGL_CONFIG_ID = 0x3028; + public const int EGL_CORE_NATIVE_ENGINE = 0x305B; + public const int EGL_DEPTH_SIZE = 0x3025; +// public const int EGL_DONT_CARE = -1; + public const int EGL_DRAW = 0x3059; + public const int EGL_EXTENSIONS = 0x3055; + public const int EGL_FALSE = 0; + public const int EGL_GREEN_SIZE = 0x3023; + public const int EGL_HEIGHT = 0x3056; +// public const int EGL_LARGEST_PBUFFER = 0x3058; +// public const int EGL_LEVEL = 0x3029; +// public const int EGL_MAX_PBUFFER_HEIGHT = 0x302A; +// public const int EGL_MAX_PBUFFER_PIXELS = 0x302B; +// public const int EGL_MAX_PBUFFER_WIDTH = 0x302C; +// public const int EGL_NATIVE_RENDERABLE = 0x302D; +// public const int EGL_NATIVE_VISUAL_ID = 0x302E; +// public const int EGL_NATIVE_VISUAL_TYPE = 0x302F; + public const int EGL_NONE = 0x3038; +// public const int EGL_NON_CONFORMANT_CONFIG = 0x3051; + public const int EGL_NOT_INITIALIZED = 0x3001; + public const int EGL_NO_CONTEXT = 0; + public const int EGL_NO_DISPLAY = 0; + public const int EGL_NO_SURFACE = 0; + public const int EGL_PBUFFER_BIT = 0x0001; +// public const int EGL_PIXMAP_BIT = 0x0002; + public const int EGL_READ = 0x305A; + public const int EGL_RED_SIZE = 0x3024; + public const int EGL_SAMPLES = 0x3031; +// public const int EGL_SAMPLE_BUFFERS = 0x3032; +// public const int EGL_SLOW_CONFIG = 0x3050; + public const int EGL_STENCIL_SIZE = 0x3026; + public const int EGL_SUCCESS = 0x3000; + public const int EGL_SURFACE_TYPE = 0x3033; +// public const int EGL_TRANSPARENT_BLUE_VALUE = 0x3035; +// public const int EGL_TRANSPARENT_GREEN_VALUE = 0x3036; +// public const int EGL_TRANSPARENT_RED_VALUE = 0x3037; +// public const int EGL_TRANSPARENT_RGB = 0x3052; +// public const int EGL_TRANSPARENT_TYPE = 0x3034; + public const int EGL_TRUE = 1; +// public const int EGL_VENDOR = 0x3053; +// public const int EGL_VERSION = 0x3054; + public const int EGL_WIDTH = 0x3057; + public const int EGL_WINDOW_BIT = 0x0004; - public const int EGL_BACK_BUFFER = 0x3084; - public const int EGL_BIND_TO_TEXTURE_RGB = 0x3039; - public const int EGL_BIND_TO_TEXTURE_RGBA = 0x303A; - public const int EGL_CONTEXT_LOST = 0x300E; - public const int EGL_MIN_SWAP_INTERVAL = 0x303B; - public const int EGL_MAX_SWAP_INTERVAL = 0x303C; - public const int EGL_MIPMAP_TEXTURE = 0x3082; - public const int EGL_MIPMAP_LEVEL = 0x3083; - public const int EGL_NO_TEXTURE = 0x305C; - public const int EGL_TEXTURE_2D = 0x305F; - public const int EGL_TEXTURE_FORMAT = 0x3080; - public const int EGL_TEXTURE_RGB = 0x305D; - public const int EGL_TEXTURE_RGBA = 0x305E; - public const int EGL_TEXTURE_TARGET = 0x3081; +// public const int EGL_BACK_BUFFER = 0x3084; +// public const int EGL_BIND_TO_TEXTURE_RGB = 0x3039; +// public const int EGL_BIND_TO_TEXTURE_RGBA = 0x303A; + public const int EGL_CONTEXT_LOST = 0x300E; +// public const int EGL_MIN_SWAP_INTERVAL = 0x303B; +// public const int EGL_MAX_SWAP_INTERVAL = 0x303C; +// public const int EGL_MIPMAP_TEXTURE = 0x3082; +// public const int EGL_MIPMAP_LEVEL = 0x3083; +// public const int EGL_NO_TEXTURE = 0x305C; +// public const int EGL_TEXTURE_2D = 0x305F; +// public const int EGL_TEXTURE_FORMAT = 0x3080; +// public const int EGL_TEXTURE_RGB = 0x305D; +// public const int EGL_TEXTURE_RGBA = 0x305E; +// public const int EGL_TEXTURE_TARGET = 0x3081; - public const int EGL_ALPHA_FORMAT = 0x3088; - public const int EGL_ALPHA_FORMAT_NONPRE = 0x308B; - public const int EGL_ALPHA_FORMAT_PRE = 0x308C; - public const int EGL_ALPHA_MASK_SIZE = 0x303E; - public const int EGL_BUFFER_PRESERVED = 0x3094; - public const int EGL_BUFFER_DESTROYED = 0x3095; - public const int EGL_CLIENT_APIS = 0x308D; - public const int EGL_COLORSPACE = 0x3087; - public const int EGL_COLORSPACE_sRGB = 0x3089; - public const int EGL_COLORSPACE_LINEAR = 0x308A; - public const int EGL_COLOR_BUFFER_TYPE = 0x303F; - public const int EGL_CONTEXT_CLIENT_TYPE = 0x3097; - public const int EGL_DISPLAY_SCALING = 10000; - public const int EGL_HORIZONTAL_RESOLUTION = 0x3090; - public const int EGL_LUMINANCE_BUFFER = 0x308F; - public const int EGL_LUMINANCE_SIZE = 0x303D; - public const int EGL_OPENGL_ES_BIT = 0x0001; - public const int EGL_OPENVG_BIT = 0x0002; - public const int EGL_OPENGL_ES_API = 0x30A0; - public const int EGL_OPENVG_API = 0x30A1; - public const int EGL_OPENVG_IMAGE = 0x3096; - public const int EGL_PIXEL_ASPECT_RATIO = 0x3092; - public const int EGL_RENDERABLE_TYPE = 0x3040; - public const int EGL_RENDER_BUFFER = 0x3086; - public const int EGL_RGB_BUFFER = 0x308E; - public const int EGL_SINGLE_BUFFER = 0x3085; - public const int EGL_SWAP_BEHAVIOR = 0x3093; - public const int EGL_UNKNOWN = -1; - public const int EGL_VERTICAL_RESOLUTION = 0x3091; - public const int EGL_CONFORMANT = 0x3042; - public const int EGL_CONTEXT_CLIENT_VERSION = 0x3098; - public const int EGL_MATCH_NATIVE_PIXMAP = 0x3041; - public const int EGL_OPENGL_ES2_BIT = 0x0004; - public const int EGL_VG_ALPHA_FORMAT = 0x3088; - public const int EGL_VG_ALPHA_FORMAT_NONPRE = 0x308B; - public const int EGL_VG_ALPHA_FORMAT_PRE = 0x308C; - public const int EGL_VG_ALPHA_FORMAT_PRE_BIT = 0x0040; - public const int EGL_VG_COLORSPACE = 0x3087; - public const int EGL_VG_COLORSPACE_sRGB = 0x3089; - public const int EGL_VG_COLORSPACE_LINEAR = 0x308A; - public const int EGL_VG_COLORSPACE_LINEAR_BIT = 0x0020; - public const int EGL_DEFAULT_DISPLAY = 0; - public const int EGL_MULTISAMPLE_RESOLVE_BOX_BIT = 0x0200; - public const int EGL_MULTISAMPLE_RESOLVE = 0x3099; - public const int EGL_MULTISAMPLE_RESOLVE_DEFAULT = 0x309A; - public const int EGL_MULTISAMPLE_RESOLVE_BOX = 0x309B; - public const int EGL_OPENGL_API = 0x30A2; - public const int EGL_OPENGL_BIT = 0x0008; - public const int EGL_SWAP_BEHAVIOR_PRESERVED_BIT = 0x0400; - public const int EGL_CONTEXT_MAJOR_VERSION = 0x3098; - public const int EGL_CONTEXT_MINOR_VERSION = 0x30FB; - public const int EGL_CONTEXT_OPENGL_PROFILE_MASK = 0x30FD; - public const int EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY = 0x31BD; - public const int EGL_NO_RESET_NOTIFICATION = 0x31BE; - public const int EGL_LOSE_CONTEXT_ON_RESET = 0x31BF; - public const int EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT = 0x00000001; - public const int EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT = 0x00000002; - public const int EGL_CONTEXT_OPENGL_DEBUG = 0x31B0; - public const int EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE = 0x31B1; - public const int EGL_CONTEXT_OPENGL_ROBUST_ACCESS = 0x31B2; - public const int EGL_OPENGL_ES3_BIT = 0x00000040; - public const int EGL_CL_EVENT_HANDLE = 0x309C; - public const int EGL_SYNC_CL_EVENT = 0x30FE; - public const int EGL_SYNC_CL_EVENT_COMPLETE = 0x30FF; - public const int EGL_SYNC_PRIOR_COMMANDS_COMPLETE = 0x30F0; - public const int EGL_SYNC_TYPE = 0x30F7; - public const int EGL_SYNC_STATUS = 0x30F1; - public const int EGL_SYNC_CONDITION = 0x30F8; - public const int EGL_SIGNALED = 0x30F2; - public const int EGL_UNSIGNALED = 0x30F3; +// public const int EGL_ALPHA_FORMAT = 0x3088; +// public const int EGL_ALPHA_FORMAT_NONPRE = 0x308B; +// public const int EGL_ALPHA_FORMAT_PRE = 0x308C; +// public const int EGL_ALPHA_MASK_SIZE = 0x303E; +// public const int EGL_BUFFER_PRESERVED = 0x3094; +// public const int EGL_BUFFER_DESTROYED = 0x3095; +// public const int EGL_CLIENT_APIS = 0x308D; +// public const int EGL_COLORSPACE = 0x3087; +// public const int EGL_COLORSPACE_sRGB = 0x3089; +// public const int EGL_COLORSPACE_LINEAR = 0x308A; +// public const int EGL_COLOR_BUFFER_TYPE = 0x303F; +// public const int EGL_CONTEXT_CLIENT_TYPE = 0x3097; +// public const int EGL_DISPLAY_SCALING = 10000; +// public const int EGL_HORIZONTAL_RESOLUTION = 0x3090; +// public const int EGL_LUMINANCE_BUFFER = 0x308F; +// public const int EGL_LUMINANCE_SIZE = 0x303D; + public const int EGL_OPENGL_ES_BIT = 0x0001; +// public const int EGL_OPENVG_BIT = 0x0002; + public const int EGL_OPENGL_ES_API = 0x30A0; +// public const int EGL_OPENVG_API = 0x30A1; +// public const int EGL_OPENVG_IMAGE = 0x3096; +// public const int EGL_PIXEL_ASPECT_RATIO = 0x3092; + public const int EGL_RENDERABLE_TYPE = 0x3040; +// public const int EGL_RENDER_BUFFER = 0x3086; +// public const int EGL_RGB_BUFFER = 0x308E; +// public const int EGL_SINGLE_BUFFER = 0x3085; +// public const int EGL_SWAP_BEHAVIOR = 0x3093; +// public const int EGL_UNKNOWN = -1; +// public const int EGL_VERTICAL_RESOLUTION = 0x3091; +// public const int EGL_CONFORMANT = 0x3042; +// public const int EGL_CONTEXT_CLIENT_VERSION = 0x3098; +// public const int EGL_MATCH_NATIVE_PIXMAP = 0x3041; + public const int EGL_OPENGL_ES2_BIT = 0x0004; +// public const int EGL_VG_ALPHA_FORMAT = 0x3088; +// public const int EGL_VG_ALPHA_FORMAT_NONPRE = 0x308B; +// public const int EGL_VG_ALPHA_FORMAT_PRE = 0x308C; +// public const int EGL_VG_ALPHA_FORMAT_PRE_BIT = 0x0040; +// public const int EGL_VG_COLORSPACE = 0x3087; +// public const int EGL_VG_COLORSPACE_sRGB = 0x3089; +// public const int EGL_VG_COLORSPACE_LINEAR = 0x308A; +// public const int EGL_VG_COLORSPACE_LINEAR_BIT = 0x0020; +// public const int EGL_DEFAULT_DISPLAY = 0; +// public const int EGL_MULTISAMPLE_RESOLVE_BOX_BIT = 0x0200; +// public const int EGL_MULTISAMPLE_RESOLVE = 0x3099; +// public const int EGL_MULTISAMPLE_RESOLVE_DEFAULT = 0x309A; +// public const int EGL_MULTISAMPLE_RESOLVE_BOX = 0x309B; +// public const int EGL_OPENGL_API = 0x30A2; +// public const int EGL_OPENGL_BIT = 0x0008; +// public const int EGL_SWAP_BEHAVIOR_PRESERVED_BIT = 0x0400; + public const int EGL_CONTEXT_MAJOR_VERSION = 0x3098; + public const int EGL_CONTEXT_MINOR_VERSION = 0x30FB; +// public const int EGL_CONTEXT_OPENGL_PROFILE_MASK = 0x30FD; +// public const int EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY = 0x31BD; +// public const int EGL_NO_RESET_NOTIFICATION = 0x31BE; +// public const int EGL_LOSE_CONTEXT_ON_RESET = 0x31BF; +// public const int EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT = 0x00000001; +// public const int EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT = 0x00000002; +// public const int EGL_CONTEXT_OPENGL_DEBUG = 0x31B0; +// public const int EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE = 0x31B1; +// public const int EGL_CONTEXT_OPENGL_ROBUST_ACCESS = 0x31B2; + public const int EGL_OPENGL_ES3_BIT = 0x00000040; +// public const int EGL_CL_EVENT_HANDLE = 0x309C; +// public const int EGL_SYNC_CL_EVENT = 0x30FE; +// public const int EGL_SYNC_CL_EVENT_COMPLETE = 0x30FF; +// public const int EGL_SYNC_PRIOR_COMMANDS_COMPLETE = 0x30F0; +// public const int EGL_SYNC_TYPE = 0x30F7; +// public const int EGL_SYNC_STATUS = 0x30F1; +// public const int EGL_SYNC_CONDITION = 0x30F8; +// public const int EGL_SIGNALED = 0x30F2; +// public const int EGL_UNSIGNALED = 0x30F3; - public const int EGL_SYNC_FLUSH_COMMANDS_BIT = 0x0001; +// public const int EGL_SYNC_FLUSH_COMMANDS_BIT = 0x0001; - public const int EGL_TIMEOUT_EXPIRED = 0x30F5; - public const int EGL_CONDITION_SATISFIED = 0x30F6; - public const int EGL_NO_SYNC = 0; - public const int EGL_SYNC_FENCE = 0x30F9; - public const int EGL_GL_COLORSPACE = 0x309D; - public const int EGL_GL_COLORSPACE_SRGB = 0x3089; - public const int EGL_GL_COLORSPACE_LINEAR = 0x308A; - public const int EGL_GL_RENDERBUFFER = 0x30B9; - public const int EGL_GL_TEXTURE_2D = 0x30B1; - public const int EGL_GL_TEXTURE_LEVEL = 0x30BC; - public const int EGL_GL_TEXTURE_3D = 0x30B2; - public const int EGL_GL_TEXTURE_ZOFFSET = 0x30BD; - public const int EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x30B3; - public const int EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x30B4; - public const int EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x30B5; - public const int EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x30B6; - public const int EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x30B7; - public const int EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x30B8; - public const int EGL_IMAGE_PRESERVED = 0x30D2; - public const int EGL_NO_IMAGE = 0; +// public const int EGL_TIMEOUT_EXPIRED = 0x30F5; +// public const int EGL_CONDITION_SATISFIED = 0x30F6; +// public const int EGL_NO_SYNC = 0; +// public const int EGL_SYNC_FENCE = 0x30F9; +// public const int EGL_GL_COLORSPACE = 0x309D; +// public const int EGL_GL_COLORSPACE_SRGB = 0x3089; +// public const int EGL_GL_COLORSPACE_LINEAR = 0x308A; +// public const int EGL_GL_RENDERBUFFER = 0x30B9; +// public const int EGL_GL_TEXTURE_2D = 0x30B1; +// public const int EGL_GL_TEXTURE_LEVEL = 0x30BC; +// public const int EGL_GL_TEXTURE_3D = 0x30B2; +// public const int EGL_GL_TEXTURE_ZOFFSET = 0x30BD; +// public const int EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x30B3; +// public const int EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x30B4; +// public const int EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x30B5; +// public const int EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x30B6; +// public const int EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x30B7; +// public const int EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x30B8; +// public const int EGL_IMAGE_PRESERVED = 0x30D2; +// public const int EGL_NO_IMAGE = 0; - public const int EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE = 0x3207; - public const int EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE = 0x3208; + public const int EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE = 0x3207; + public const int EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE = 0x3208; //EGL_ANGLE_platform_angle - public const int EGL_PLATFORM_ANGLE_ANGLE = 0x3202; - public const int EGL_PLATFORM_ANGLE_TYPE_ANGLE = 0x3203; - public const int EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE = 0x3204; - public const int EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE = 0x3205; - public const int EGL_PLATFORM_ANGLE_DEBUG_LAYERS_ENABLED = 0x3451; - public const int EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE = 0x3206; - public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE = 0x320A; - public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE = 0x345E; + public const int EGL_PLATFORM_ANGLE_ANGLE = 0x3202; + public const int EGL_PLATFORM_ANGLE_TYPE_ANGLE = 0x3203; +// public const int EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE = 0x3204; +// public const int EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE = 0x3205; +// public const int EGL_PLATFORM_ANGLE_DEBUG_LAYERS_ENABLED = 0x3451; +// public const int EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE = 0x3206; +// public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE = 0x320A; +// public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE = 0x345E; - public const int EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE = 0x320D; - public const int EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE = 0x320E; +// public const int EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE = 0x320D; +// public const int EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE = 0x320E; //EGL_ANGLE_platform_angle_d3d - public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE = 0x3209; - public const int EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE = 0x320F; - public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_D3D_WARP_ANGLE = 0x320B; - public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_D3D_REFERENCE_ANGLE = 0x320C; +// public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE = 0x3209; +// public const int EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE = 0x320F; +// public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_D3D_WARP_ANGLE = 0x320B; +// public const int EGL_PLATFORM_ANGLE_DEVICE_TYPE_D3D_REFERENCE_ANGLE = 0x320C; //EXT_device_query - public const int EGL_DEVICE_EXT = 0x322C; + public const int EGL_DEVICE_EXT = 0x322C; //ANGLE_device_d3d - public const int EGL_D3D9_DEVICE_ANGLE = 0x33A0; - public const int EGL_D3D11_DEVICE_ANGLE = 0x33A1; + public const int EGL_D3D9_DEVICE_ANGLE = 0x33A0; + public const int EGL_D3D11_DEVICE_ANGLE = 0x33A1; - public const int EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE = 0x3200; - public const int EGL_D3D_TEXTURE_ANGLE = 0x33A3; + public const int EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE = 0x3200; + public const int EGL_D3D_TEXTURE_ANGLE = 0x33A3; - public const int EGL_TEXTURE_OFFSET_X_ANGLE = 0x3490; - public const int EGL_TEXTURE_OFFSET_Y_ANGLE = 0x3491; + public const int EGL_TEXTURE_OFFSET_X_ANGLE = 0x3490; + public const int EGL_TEXTURE_OFFSET_Y_ANGLE = 0x3491; - public const int EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE = 0x33A6; + public const int EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE = 0x33A6; } } diff --git a/src/Avalonia.OpenGL/Egl/EglPlatformOpenGlInterface.cs b/src/Avalonia.OpenGL/Egl/EglPlatformOpenGlInterface.cs index 476f65a774..a6d8c1e98d 100644 --- a/src/Avalonia.OpenGL/Egl/EglPlatformOpenGlInterface.cs +++ b/src/Avalonia.OpenGL/Egl/EglPlatformOpenGlInterface.cs @@ -1,5 +1,6 @@ using System; using Avalonia.Logging; +using Avalonia.Platform; using static Avalonia.OpenGL.Egl.EglConsts; namespace Avalonia.OpenGL.Egl @@ -12,6 +13,7 @@ namespace Avalonia.OpenGL.Egl public EglContext PrimaryEglContext { get; } public IGlContext PrimaryContext => PrimaryEglContext; + IPlatformGpuContext IPlatformGpu.PrimaryContext => PrimaryContext; public EglPlatformOpenGlInterface(EglDisplay display) { diff --git a/src/Avalonia.OpenGL/GlConsts.cs b/src/Avalonia.OpenGL/GlConsts.cs index 2a6aa0d14d..3fdc147701 100644 --- a/src/Avalonia.OpenGL/GlConsts.cs +++ b/src/Avalonia.OpenGL/GlConsts.cs @@ -1,457 +1,456 @@ -// ReSharper disable UnusedMember.Global // ReSharper disable IdentifierTypo namespace Avalonia.OpenGL { public static class GlConsts { - public const int GL_BYTE = 0x1400; +// public const int GL_BYTE = 0x1400 public const int GL_UNSIGNED_BYTE = 0x1401; - public const int GL_SHORT = 0x1402; +// public const int GL_SHORT = 0x1402; public const int GL_UNSIGNED_SHORT = 0x1403; - public const int GL_INT = 0x1404; - public const int GL_UNSIGNED_INT = 0x1405; +// public const int GL_INT = 0x1404; +// public const int GL_UNSIGNED_INT = 0x1405; public const int GL_FLOAT = 0x1406; - public const int GL_2_BYTES = 0x1407; - public const int GL_3_BYTES = 0x1408; - public const int GL_4_BYTES = 0x1409; - public const int GL_DOUBLE = 0x140A; - public const int GL_POINTS = 0x0000; - public const int GL_LINES = 0x0001; - public const int GL_LINE_LOOP = 0x0002; - public const int GL_LINE_STRIP = 0x0003; +// public const int GL_2_BYTES = 0x1407; +// public const int GL_3_BYTES = 0x1408; +// public const int GL_4_BYTES = 0x1409; +// public const int GL_DOUBLE = 0x140A; +// public const int GL_POINTS = 0x0000; +// public const int GL_LINES = 0x0001; +// public const int GL_LINE_LOOP = 0x0002; +// public const int GL_LINE_STRIP = 0x0003; public const int GL_TRIANGLES = 0x0004; - public const int GL_TRIANGLE_STRIP = 0x0005; - public const int GL_TRIANGLE_FAN = 0x0006; - public const int GL_QUADS = 0x0007; - public const int GL_QUAD_STRIP = 0x0008; - public const int GL_POLYGON = 0x0009; - public const int GL_VERTEX_ARRAY = 0x8074; - public const int GL_NORMAL_ARRAY = 0x8075; - public const int GL_COLOR_ARRAY = 0x8076; - public const int GL_INDEX_ARRAY = 0x8077; - public const int GL_TEXTURE_COORD_ARRAY = 0x8078; - public const int GL_EDGE_FLAG_ARRAY = 0x8079; - public const int GL_VERTEX_ARRAY_SIZE = 0x807A; - public const int GL_VERTEX_ARRAY_TYPE = 0x807B; - public const int GL_VERTEX_ARRAY_STRIDE = 0x807C; - public const int GL_NORMAL_ARRAY_TYPE = 0x807E; - public const int GL_NORMAL_ARRAY_STRIDE = 0x807F; - public const int GL_COLOR_ARRAY_SIZE = 0x8081; - public const int GL_COLOR_ARRAY_TYPE = 0x8082; - public const int GL_COLOR_ARRAY_STRIDE = 0x8083; - public const int GL_INDEX_ARRAY_TYPE = 0x8085; - public const int GL_INDEX_ARRAY_STRIDE = 0x8086; - public const int GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088; - public const int GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089; - public const int GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A; - public const int GL_EDGE_FLAG_ARRAY_STRIDE = 0x808C; - public const int GL_VERTEX_ARRAY_POINTER = 0x808E; - public const int GL_NORMAL_ARRAY_POINTER = 0x808F; - public const int GL_COLOR_ARRAY_POINTER = 0x8090; - public const int GL_INDEX_ARRAY_POINTER = 0x8091; - public const int GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092; - public const int GL_EDGE_FLAG_ARRAY_POINTER = 0x8093; - public const int GL_V2F = 0x2A20; - public const int GL_V3F = 0x2A21; - public const int GL_C4UB_V2F = 0x2A22; - public const int GL_C4UB_V3F = 0x2A23; - public const int GL_C3F_V3F = 0x2A24; - public const int GL_N3F_V3F = 0x2A25; - public const int GL_C4F_N3F_V3F = 0x2A26; - public const int GL_T2F_V3F = 0x2A27; - public const int GL_T4F_V4F = 0x2A28; - public const int GL_T2F_C4UB_V3F = 0x2A29; - public const int GL_T2F_C3F_V3F = 0x2A2A; - public const int GL_T2F_N3F_V3F = 0x2A2B; - public const int GL_T2F_C4F_N3F_V3F = 0x2A2C; - public const int GL_T4F_C4F_N3F_V4F = 0x2A2D; - public const int GL_MATRIX_MODE = 0x0BA0; - public const int GL_MODELVIEW = 0x1700; - public const int GL_PROJECTION = 0x1701; - public const int GL_TEXTURE = 0x1702; - public const int GL_POINT_SMOOTH = 0x0B10; - public const int GL_POINT_SIZE = 0x0B11; - public const int GL_POINT_SIZE_GRANULARITY = 0x0B13; - public const int GL_POINT_SIZE_RANGE = 0x0B12; - public const int GL_LINE_SMOOTH = 0x0B20; - public const int GL_LINE_STIPPLE = 0x0B24; - public const int GL_LINE_STIPPLE_PATTERN = 0x0B25; - public const int GL_LINE_STIPPLE_REPEAT = 0x0B26; - public const int GL_LINE_WIDTH = 0x0B21; - public const int GL_LINE_WIDTH_GRANULARITY = 0x0B23; - public const int GL_LINE_WIDTH_RANGE = 0x0B22; - public const int GL_POINT = 0x1B00; - public const int GL_LINE = 0x1B01; - public const int GL_FILL = 0x1B02; - public const int GL_CW = 0x0900; - public const int GL_CCW = 0x0901; - public const int GL_FRONT = 0x0404; - public const int GL_BACK = 0x0405; - public const int GL_POLYGON_MODE = 0x0B40; - public const int GL_POLYGON_SMOOTH = 0x0B41; - public const int GL_POLYGON_STIPPLE = 0x0B42; - public const int GL_EDGE_FLAG = 0x0B43; - public const int GL_CULL_FACE = 0x0B44; - public const int GL_CULL_FACE_MODE = 0x0B45; - public const int GL_FRONT_FACE = 0x0B46; - public const int GL_POLYGON_OFFSET_FACTOR = 0x8038; - public const int GL_POLYGON_OFFSET_UNITS = 0x2A00; - public const int GL_POLYGON_OFFSET_POINT = 0x2A01; - public const int GL_POLYGON_OFFSET_LINE = 0x2A02; - public const int GL_POLYGON_OFFSET_FILL = 0x8037; - public const int GL_COMPILE = 0x1300; - public const int GL_COMPILE_AND_EXECUTE = 0x1301; - public const int GL_LIST_BASE = 0x0B32; - public const int GL_LIST_INDEX = 0x0B33; - public const int GL_LIST_MODE = 0x0B30; - public const int GL_NEVER = 0x0200; - public const int GL_LESS = 0x0201; - public const int GL_EQUAL = 0x0202; - public const int GL_LEQUAL = 0x0203; - public const int GL_GREATER = 0x0204; - public const int GL_NOTEQUAL = 0x0205; - public const int GL_GEQUAL = 0x0206; - public const int GL_ALWAYS = 0x0207; +// public const int GL_TRIANGLE_STRIP = 0x0005; +// public const int GL_TRIANGLE_FAN = 0x0006; +// public const int GL_QUADS = 0x0007; +// public const int GL_QUAD_STRIP = 0x0008; +// public const int GL_POLYGON = 0x0009; +// public const int GL_VERTEX_ARRAY = 0x8074; +// public const int GL_NORMAL_ARRAY = 0x8075; +// public const int GL_COLOR_ARRAY = 0x8076; +// public const int GL_INDEX_ARRAY = 0x8077; +// public const int GL_TEXTURE_COORD_ARRAY = 0x8078; +// public const int GL_EDGE_FLAG_ARRAY = 0x8079; +// public const int GL_VERTEX_ARRAY_SIZE = 0x807A; +// public const int GL_VERTEX_ARRAY_TYPE = 0x807B; +// public const int GL_VERTEX_ARRAY_STRIDE = 0x807C; +// public const int GL_NORMAL_ARRAY_TYPE = 0x807E; +// public const int GL_NORMAL_ARRAY_STRIDE = 0x807F; +// public const int GL_COLOR_ARRAY_SIZE = 0x8081; +// public const int GL_COLOR_ARRAY_TYPE = 0x8082; +// public const int GL_COLOR_ARRAY_STRIDE = 0x8083; +// public const int GL_INDEX_ARRAY_TYPE = 0x8085; +// public const int GL_INDEX_ARRAY_STRIDE = 0x8086; +// public const int GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088; +// public const int GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089; +// public const int GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A; +// public const int GL_EDGE_FLAG_ARRAY_STRIDE = 0x808C; +// public const int GL_VERTEX_ARRAY_POINTER = 0x808E; +// public const int GL_NORMAL_ARRAY_POINTER = 0x808F; +// public const int GL_COLOR_ARRAY_POINTER = 0x8090; +// public const int GL_INDEX_ARRAY_POINTER = 0x8091; +// public const int GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092; +// public const int GL_EDGE_FLAG_ARRAY_POINTER = 0x8093; +// public const int GL_V2F = 0x2A20; +// public const int GL_V3F = 0x2A21; +// public const int GL_C4UB_V2F = 0x2A22; +// public const int GL_C4UB_V3F = 0x2A23; +// public const int GL_C3F_V3F = 0x2A24; +// public const int GL_N3F_V3F = 0x2A25; +// public const int GL_C4F_N3F_V3F = 0x2A26; +// public const int GL_T2F_V3F = 0x2A27; +// public const int GL_T4F_V4F = 0x2A28; +// public const int GL_T2F_C4UB_V3F = 0x2A29; +// public const int GL_T2F_C3F_V3F = 0x2A2A; +// public const int GL_T2F_N3F_V3F = 0x2A2B; +// public const int GL_T2F_C4F_N3F_V3F = 0x2A2C; +// public const int GL_T4F_C4F_N3F_V4F = 0x2A2D; +// public const int GL_MATRIX_MODE = 0x0BA0; +// public const int GL_MODELVIEW = 0x1700; +// public const int GL_PROJECTION = 0x1701; +// public const int GL_TEXTURE = 0x1702; +// public const int GL_POINT_SMOOTH = 0x0B10; +// public const int GL_POINT_SIZE = 0x0B11; +// public const int GL_POINT_SIZE_GRANULARITY = 0x0B13; +// public const int GL_POINT_SIZE_RANGE = 0x0B12; +// public const int GL_LINE_SMOOTH = 0x0B20; +// public const int GL_LINE_STIPPLE = 0x0B24; +// public const int GL_LINE_STIPPLE_PATTERN = 0x0B25; +// public const int GL_LINE_STIPPLE_REPEAT = 0x0B26; +// public const int GL_LINE_WIDTH = 0x0B21; +// public const int GL_LINE_WIDTH_GRANULARITY = 0x0B23; +// public const int GL_LINE_WIDTH_RANGE = 0x0B22; +// public const int GL_POINT = 0x1B00; +// public const int GL_LINE = 0x1B01; +// public const int GL_FILL = 0x1B02; +// public const int GL_CW = 0x0900; +// public const int GL_CCW = 0x0901; +// public const int GL_FRONT = 0x0404; +// public const int GL_BACK = 0x0405; +// public const int GL_POLYGON_MODE = 0x0B40; +// public const int GL_POLYGON_SMOOTH = 0x0B41; +// public const int GL_POLYGON_STIPPLE = 0x0B42; +// public const int GL_EDGE_FLAG = 0x0B43; +// public const int GL_CULL_FACE = 0x0B44; +// public const int GL_CULL_FACE_MODE = 0x0B45; +// public const int GL_FRONT_FACE = 0x0B46; +// public const int GL_POLYGON_OFFSET_FACTOR = 0x8038; +// public const int GL_POLYGON_OFFSET_UNITS = 0x2A00; +// public const int GL_POLYGON_OFFSET_POINT = 0x2A01; +// public const int GL_POLYGON_OFFSET_LINE = 0x2A02; +// public const int GL_POLYGON_OFFSET_FILL = 0x8037; +// public const int GL_COMPILE = 0x1300; +// public const int GL_COMPILE_AND_EXECUTE = 0x1301; +// public const int GL_LIST_BASE = 0x0B32; +// public const int GL_LIST_INDEX = 0x0B33; +// public const int GL_LIST_MODE = 0x0B30; +// public const int GL_NEVER = 0x0200; +// public const int GL_LESS = 0x0201; +// public const int GL_EQUAL = 0x0202; +// public const int GL_LEQUAL = 0x0203; +// public const int GL_GREATER = 0x0204; +// public const int GL_NOTEQUAL = 0x0205; +// public const int GL_GEQUAL = 0x0206; +// public const int GL_ALWAYS = 0x0207; public const int GL_DEPTH_TEST = 0x0B71; - public const int GL_DEPTH_BITS = 0x0D56; - public const int GL_DEPTH_CLEAR_VALUE = 0x0B73; - public const int GL_DEPTH_FUNC = 0x0B74; - public const int GL_DEPTH_RANGE = 0x0B70; - public const int GL_DEPTH_WRITEMASK = 0x0B72; +// public const int GL_DEPTH_BITS = 0x0D56; +// public const int GL_DEPTH_CLEAR_VALUE = 0x0B73; +// public const int GL_DEPTH_FUNC = 0x0B74; +// public const int GL_DEPTH_RANGE = 0x0B70; +// public const int GL_DEPTH_WRITEMASK = 0x0B72; public const int GL_DEPTH_COMPONENT = 0x1902; - public const int GL_LIGHTING = 0x0B50; - public const int GL_LIGHT0 = 0x4000; - public const int GL_LIGHT1 = 0x4001; - public const int GL_LIGHT2 = 0x4002; - public const int GL_LIGHT3 = 0x4003; - public const int GL_LIGHT4 = 0x4004; - public const int GL_LIGHT5 = 0x4005; - public const int GL_LIGHT6 = 0x4006; - public const int GL_LIGHT7 = 0x4007; - public const int GL_SPOT_EXPONENT = 0x1205; - public const int GL_SPOT_CUTOFF = 0x1206; - public const int GL_CONSTANT_ATTENUATION = 0x1207; - public const int GL_LINEAR_ATTENUATION = 0x1208; - public const int GL_QUADRATIC_ATTENUATION = 0x1209; - public const int GL_AMBIENT = 0x1200; - public const int GL_DIFFUSE = 0x1201; - public const int GL_SPECULAR = 0x1202; - public const int GL_SHININESS = 0x1601; - public const int GL_EMISSION = 0x1600; - public const int GL_POSITION = 0x1203; - public const int GL_SPOT_DIRECTION = 0x1204; - public const int GL_AMBIENT_AND_DIFFUSE = 0x1602; - public const int GL_COLOR_INDEXES = 0x1603; - public const int GL_LIGHT_MODEL_TWO_SIDE = 0x0B52; - public const int GL_LIGHT_MODEL_LOCAL_VIEWER = 0x0B51; - public const int GL_LIGHT_MODEL_AMBIENT = 0x0B53; - public const int GL_FRONT_AND_BACK = 0x0408; - public const int GL_SHADE_MODEL = 0x0B54; - public const int GL_FLAT = 0x1D00; - public const int GL_SMOOTH = 0x1D01; - public const int GL_COLOR_MATERIAL = 0x0B57; - public const int GL_COLOR_MATERIAL_FACE = 0x0B55; - public const int GL_COLOR_MATERIAL_PARAMETER = 0x0B56; - public const int GL_NORMALIZE = 0x0BA1; - public const int GL_CLIP_PLANE0 = 0x3000; - public const int GL_CLIP_PLANE1 = 0x3001; - public const int GL_CLIP_PLANE2 = 0x3002; - public const int GL_CLIP_PLANE3 = 0x3003; - public const int GL_CLIP_PLANE4 = 0x3004; - public const int GL_CLIP_PLANE5 = 0x3005; - public const int GL_ACCUM_RED_BITS = 0x0D58; - public const int GL_ACCUM_GREEN_BITS = 0x0D59; - public const int GL_ACCUM_BLUE_BITS = 0x0D5A; - public const int GL_ACCUM_ALPHA_BITS = 0x0D5B; - public const int GL_ACCUM_CLEAR_VALUE = 0x0B80; - public const int GL_ACCUM = 0x0100; - public const int GL_ADD = 0x0104; - public const int GL_LOAD = 0x0101; - public const int GL_MULT = 0x0103; - public const int GL_RETURN = 0x0102; - public const int GL_ALPHA_TEST = 0x0BC0; - public const int GL_ALPHA_TEST_REF = 0x0BC2; - public const int GL_ALPHA_TEST_FUNC = 0x0BC1; - public const int GL_BLEND = 0x0BE2; - public const int GL_BLEND_SRC = 0x0BE1; - public const int GL_BLEND_DST = 0x0BE0; - public const int GL_SRC_COLOR = 0x0300; - public const int GL_ONE_MINUS_SRC_COLOR = 0x0301; - public const int GL_SRC_ALPHA = 0x0302; - public const int GL_ONE_MINUS_SRC_ALPHA = 0x0303; - public const int GL_DST_ALPHA = 0x0304; - public const int GL_ONE_MINUS_DST_ALPHA = 0x0305; - public const int GL_DST_COLOR = 0x0306; - public const int GL_ONE_MINUS_DST_COLOR = 0x0307; - public const int GL_SRC_ALPHA_SATURATE = 0x0308; - public const int GL_FEEDBACK = 0x1C01; - public const int GL_RENDER = 0x1C00; - public const int GL_SELECT = 0x1C02; - public const int GL_2D = 0x0600; - public const int GL_3D = 0x0601; - public const int GL_3D_COLOR = 0x0602; - public const int GL_3D_COLOR_TEXTURE = 0x0603; - public const int GL_4D_COLOR_TEXTURE = 0x0604; - public const int GL_POINT_TOKEN = 0x0701; - public const int GL_LINE_TOKEN = 0x0702; - public const int GL_LINE_RESET_TOKEN = 0x0707; - public const int GL_POLYGON_TOKEN = 0x0703; - public const int GL_BITMAP_TOKEN = 0x0704; - public const int GL_DRAW_PIXEL_TOKEN = 0x0705; - public const int GL_COPY_PIXEL_TOKEN = 0x0706; - public const int GL_PASS_THROUGH_TOKEN = 0x0700; - public const int GL_FEEDBACK_BUFFER_POINTER = 0x0DF0; - public const int GL_FEEDBACK_BUFFER_SIZE = 0x0DF1; - public const int GL_FEEDBACK_BUFFER_TYPE = 0x0DF2; - public const int GL_SELECTION_BUFFER_POINTER = 0x0DF3; - public const int GL_SELECTION_BUFFER_SIZE = 0x0DF4; - public const int GL_FOG = 0x0B60; - public const int GL_FOG_MODE = 0x0B65; - public const int GL_FOG_DENSITY = 0x0B62; - public const int GL_FOG_COLOR = 0x0B66; - public const int GL_FOG_INDEX = 0x0B61; - public const int GL_FOG_START = 0x0B63; - public const int GL_FOG_END = 0x0B64; +// public const int GL_LIGHTING = 0x0B50; +// public const int GL_LIGHT0 = 0x4000; +// public const int GL_LIGHT1 = 0x4001; +// public const int GL_LIGHT2 = 0x4002; +// public const int GL_LIGHT3 = 0x4003; +// public const int GL_LIGHT4 = 0x4004; +// public const int GL_LIGHT5 = 0x4005; +// public const int GL_LIGHT6 = 0x4006; +// public const int GL_LIGHT7 = 0x4007; +// public const int GL_SPOT_EXPONENT = 0x1205; +// public const int GL_SPOT_CUTOFF = 0x1206; +// public const int GL_CONSTANT_ATTENUATION = 0x1207; +// public const int GL_LINEAR_ATTENUATION = 0x1208; +// public const int GL_QUADRATIC_ATTENUATION = 0x1209; +// public const int GL_AMBIENT = 0x1200; +// public const int GL_DIFFUSE = 0x1201; +// public const int GL_SPECULAR = 0x1202; +// public const int GL_SHININESS = 0x1601; +// public const int GL_EMISSION = 0x1600; +// public const int GL_POSITION = 0x1203; +// public const int GL_SPOT_DIRECTION = 0x1204; +// public const int GL_AMBIENT_AND_DIFFUSE = 0x1602; +// public const int GL_COLOR_INDEXES = 0x1603; +// public const int GL_LIGHT_MODEL_TWO_SIDE = 0x0B52; +// public const int GL_LIGHT_MODEL_LOCAL_VIEWER = 0x0B51; +// public const int GL_LIGHT_MODEL_AMBIENT = 0x0B53; +// public const int GL_FRONT_AND_BACK = 0x0408; +// public const int GL_SHADE_MODEL = 0x0B54; +// public const int GL_FLAT = 0x1D00; +// public const int GL_SMOOTH = 0x1D01; +// public const int GL_COLOR_MATERIAL = 0x0B57; +// public const int GL_COLOR_MATERIAL_FACE = 0x0B55; +// public const int GL_COLOR_MATERIAL_PARAMETER = 0x0B56; +// public const int GL_NORMALIZE = 0x0BA1; +// public const int GL_CLIP_PLANE0 = 0x3000; +// public const int GL_CLIP_PLANE1 = 0x3001; +// public const int GL_CLIP_PLANE2 = 0x3002; +// public const int GL_CLIP_PLANE3 = 0x3003; +// public const int GL_CLIP_PLANE4 = 0x3004; +// public const int GL_CLIP_PLANE5 = 0x3005; +// public const int GL_ACCUM_RED_BITS = 0x0D58; +// public const int GL_ACCUM_GREEN_BITS = 0x0D59; +// public const int GL_ACCUM_BLUE_BITS = 0x0D5A; +// public const int GL_ACCUM_ALPHA_BITS = 0x0D5B; +// public const int GL_ACCUM_CLEAR_VALUE = 0x0B80; +// public const int GL_ACCUM = 0x0100; +// public const int GL_ADD = 0x0104; +// public const int GL_LOAD = 0x0101; +// public const int GL_MULT = 0x0103; +// public const int GL_RETURN = 0x0102; +// public const int GL_ALPHA_TEST = 0x0BC0; +// public const int GL_ALPHA_TEST_REF = 0x0BC2; +// public const int GL_ALPHA_TEST_FUNC = 0x0BC1; +// public const int GL_BLEND = 0x0BE2; +// public const int GL_BLEND_SRC = 0x0BE1; +// public const int GL_BLEND_DST = 0x0BE0; +// public const int GL_SRC_COLOR = 0x0300; +// public const int GL_ONE_MINUS_SRC_COLOR = 0x0301; +// public const int GL_SRC_ALPHA = 0x0302; +// public const int GL_ONE_MINUS_SRC_ALPHA = 0x0303; +// public const int GL_DST_ALPHA = 0x0304; +// public const int GL_ONE_MINUS_DST_ALPHA = 0x0305; +// public const int GL_DST_COLOR = 0x0306; +// public const int GL_ONE_MINUS_DST_COLOR = 0x0307; +// public const int GL_SRC_ALPHA_SATURATE = 0x0308; +// public const int GL_FEEDBACK = 0x1C01; +// public const int GL_RENDER = 0x1C00; +// public const int GL_SELECT = 0x1C02; +// public const int GL_2D = 0x0600; +// public const int GL_3D = 0x0601; +// public const int GL_3D_COLOR = 0x0602; +// public const int GL_3D_COLOR_TEXTURE = 0x0603; +// public const int GL_4D_COLOR_TEXTURE = 0x0604; +// public const int GL_POINT_TOKEN = 0x0701; +// public const int GL_LINE_TOKEN = 0x0702; +// public const int GL_LINE_RESET_TOKEN = 0x0707; +// public const int GL_POLYGON_TOKEN = 0x0703; +// public const int GL_BITMAP_TOKEN = 0x0704; +// public const int GL_DRAW_PIXEL_TOKEN = 0x0705; +// public const int GL_COPY_PIXEL_TOKEN = 0x0706; +// public const int GL_PASS_THROUGH_TOKEN = 0x0700; +// public const int GL_FEEDBACK_BUFFER_POINTER = 0x0DF0; +// public const int GL_FEEDBACK_BUFFER_SIZE = 0x0DF1; +// public const int GL_FEEDBACK_BUFFER_TYPE = 0x0DF2; +// public const int GL_SELECTION_BUFFER_POINTER = 0x0DF3; +// public const int GL_SELECTION_BUFFER_SIZE = 0x0DF4; +// public const int GL_FOG = 0x0B60; +// public const int GL_FOG_MODE = 0x0B65; +// public const int GL_FOG_DENSITY = 0x0B62; +// public const int GL_FOG_COLOR = 0x0B66; +// public const int GL_FOG_INDEX = 0x0B61; +// public const int GL_FOG_START = 0x0B63; +// public const int GL_FOG_END = 0x0B64; public const int GL_LINEAR = 0x2601; - public const int GL_EXP = 0x0800; - public const int GL_EXP2 = 0x0801; - public const int GL_LOGIC_OP = 0x0BF1; - public const int GL_INDEX_LOGIC_OP = 0x0BF1; - public const int GL_COLOR_LOGIC_OP = 0x0BF2; - public const int GL_LOGIC_OP_MODE = 0x0BF0; - public const int GL_CLEAR = 0x1500; - public const int GL_SET = 0x150F; - public const int GL_COPY = 0x1503; - public const int GL_COPY_INVERTED = 0x150C; - public const int GL_NOOP = 0x1505; - public const int GL_INVERT = 0x150A; - public const int GL_AND = 0x1501; - public const int GL_NAND = 0x150E; - public const int GL_OR = 0x1507; - public const int GL_NOR = 0x1508; - public const int GL_XOR = 0x1506; - public const int GL_EQUIV = 0x1509; - public const int GL_AND_REVERSE = 0x1502; - public const int GL_AND_INVERTED = 0x1504; - public const int GL_OR_REVERSE = 0x150B; - public const int GL_OR_INVERTED = 0x150D; +// public const int GL_EXP = 0x0800; +// public const int GL_EXP2 = 0x0801; +// public const int GL_LOGIC_OP = 0x0BF1; +// public const int GL_INDEX_LOGIC_OP = 0x0BF1; +// public const int GL_COLOR_LOGIC_OP = 0x0BF2; +// public const int GL_LOGIC_OP_MODE = 0x0BF0; +// public const int GL_CLEAR = 0x1500; +// public const int GL_SET = 0x150F; +// public const int GL_COPY = 0x1503; +// public const int GL_COPY_INVERTED = 0x150C; +// public const int GL_NOOP = 0x1505; +// public const int GL_INVERT = 0x150A; +// public const int GL_AND = 0x1501; +// public const int GL_NAND = 0x150E; +// public const int GL_OR = 0x1507; +// public const int GL_NOR = 0x1508; +// public const int GL_XOR = 0x1506; +// public const int GL_EQUIV = 0x1509; +// public const int GL_AND_REVERSE = 0x1502; +// public const int GL_AND_INVERTED = 0x1504; +// public const int GL_OR_REVERSE = 0x150B; +// public const int GL_OR_INVERTED = 0x150D; public const int GL_STENCIL_BITS = 0x0D57; - public const int GL_STENCIL_TEST = 0x0B90; - public const int GL_STENCIL_CLEAR_VALUE = 0x0B91; - public const int GL_STENCIL_FUNC = 0x0B92; - public const int GL_STENCIL_VALUE_MASK = 0x0B93; - public const int GL_STENCIL_FAIL = 0x0B94; - public const int GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95; - public const int GL_STENCIL_PASS_DEPTH_PASS = 0x0B96; - public const int GL_STENCIL_REF = 0x0B97; - public const int GL_STENCIL_WRITEMASK = 0x0B98; - public const int GL_STENCIL_INDEX = 0x1901; - public const int GL_KEEP = 0x1E00; - public const int GL_REPLACE = 0x1E01; - public const int GL_INCR = 0x1E02; - public const int GL_DECR = 0x1E03; - public const int GL_LEFT = 0x0406; - public const int GL_RIGHT = 0x0407; - public const int GL_FRONT_LEFT = 0x0400; - public const int GL_FRONT_RIGHT = 0x0401; - public const int GL_BACK_LEFT = 0x0402; - public const int GL_BACK_RIGHT = 0x0403; - public const int GL_AUX0 = 0x0409; - public const int GL_AUX1 = 0x040A; - public const int GL_AUX2 = 0x040B; - public const int GL_AUX3 = 0x040C; - public const int GL_COLOR_INDEX = 0x1900; - public const int GL_RED = 0x1903; - public const int GL_GREEN = 0x1904; - public const int GL_BLUE = 0x1905; - public const int GL_ALPHA = 0x1906; - public const int GL_LUMINANCE = 0x1909; - public const int GL_LUMINANCE_ALPHA = 0x190A; - public const int GL_ALPHA_BITS = 0x0D55; - public const int GL_RED_BITS = 0x0D52; - public const int GL_GREEN_BITS = 0x0D53; - public const int GL_BLUE_BITS = 0x0D54; - public const int GL_INDEX_BITS = 0x0D51; - public const int GL_SUBPIXEL_BITS = 0x0D50; - public const int GL_AUX_BUFFERS = 0x0C00; - public const int GL_READ_BUFFER = 0x0C02; - public const int GL_DRAW_BUFFER = 0x0C01; - public const int GL_DOUBLEBUFFER = 0x0C32; - public const int GL_STEREO = 0x0C33; - public const int GL_BITMAP = 0x1A00; - public const int GL_COLOR = 0x1800; - public const int GL_DEPTH = 0x1801; - public const int GL_STENCIL = 0x1802; - public const int GL_DITHER = 0x0BD0; - public const int GL_RGB = 0x1907; +// public const int GL_STENCIL_TEST = 0x0B90; +// public const int GL_STENCIL_CLEAR_VALUE = 0x0B91; +// public const int GL_STENCIL_FUNC = 0x0B92; +// public const int GL_STENCIL_VALUE_MASK = 0x0B93; +// public const int GL_STENCIL_FAIL = 0x0B94; +// public const int GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95; +// public const int GL_STENCIL_PASS_DEPTH_PASS = 0x0B96; +// public const int GL_STENCIL_REF = 0x0B97; +// public const int GL_STENCIL_WRITEMASK = 0x0B98; +// public const int GL_STENCIL_INDEX = 0x1901; +// public const int GL_KEEP = 0x1E00; +// public const int GL_REPLACE = 0x1E01; +// public const int GL_INCR = 0x1E02; +// public const int GL_DECR = 0x1E03; +// public const int GL_LEFT = 0x0406; +// public const int GL_RIGHT = 0x0407; +// public const int GL_FRONT_LEFT = 0x0400; +// public const int GL_FRONT_RIGHT = 0x0401; +// public const int GL_BACK_LEFT = 0x0402; +// public const int GL_BACK_RIGHT = 0x0403; +// public const int GL_AUX0 = 0x0409; +// public const int GL_AUX1 = 0x040A; +// public const int GL_AUX2 = 0x040B; +// public const int GL_AUX3 = 0x040C; +// public const int GL_COLOR_INDEX = 0x1900; +// public const int GL_RED = 0x1903; +// public const int GL_GREEN = 0x1904; +// public const int GL_BLUE = 0x1905; +// public const int GL_ALPHA = 0x1906; +// public const int GL_LUMINANCE = 0x1909; +// public const int GL_LUMINANCE_ALPHA = 0x190A; +// public const int GL_ALPHA_BITS = 0x0D55; +// public const int GL_RED_BITS = 0x0D52; +// public const int GL_GREEN_BITS = 0x0D53; +// public const int GL_BLUE_BITS = 0x0D54; +// public const int GL_INDEX_BITS = 0x0D51; +// public const int GL_SUBPIXEL_BITS = 0x0D50; +// public const int GL_AUX_BUFFERS = 0x0C00; +// public const int GL_READ_BUFFER = 0x0C02; +// public const int GL_DRAW_BUFFER = 0x0C01; +// public const int GL_DOUBLEBUFFER = 0x0C32; +// public const int GL_STEREO = 0x0C33; +// public const int GL_BITMAP = 0x1A00; +// public const int GL_COLOR = 0x1800; +// public const int GL_DEPTH = 0x1801; +// public const int GL_STENCIL = 0x1802; +// public const int GL_DITHER = 0x0BD0; +// public const int GL_RGB = 0x1907; public const int GL_RGBA = 0x1908; - public const int GL_MAX_LIST_NESTING = 0x0B31; - public const int GL_MAX_EVAL_ORDER = 0x0D30; - public const int GL_MAX_LIGHTS = 0x0D31; - public const int GL_MAX_CLIP_PLANES = 0x0D32; - public const int GL_MAX_TEXTURE_SIZE = 0x0D33; - public const int GL_MAX_PIXEL_MAP_TABLE = 0x0D34; - public const int GL_MAX_ATTRIB_STACK_DEPTH = 0x0D35; - public const int GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36; - public const int GL_MAX_NAME_STACK_DEPTH = 0x0D37; - public const int GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38; - public const int GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39; - public const int GL_MAX_VIEWPORT_DIMS = 0x0D3A; - public const int GL_MAX_CLIENT_ATTRIB_STACK_DEPTH = 0x0D3B; - public const int GL_ATTRIB_STACK_DEPTH = 0x0BB0; - public const int GL_CLIENT_ATTRIB_STACK_DEPTH = 0x0BB1; - public const int GL_COLOR_CLEAR_VALUE = 0x0C22; - public const int GL_COLOR_WRITEMASK = 0x0C23; - public const int GL_CURRENT_INDEX = 0x0B01; - public const int GL_CURRENT_COLOR = 0x0B00; - public const int GL_CURRENT_NORMAL = 0x0B02; - public const int GL_CURRENT_RASTER_COLOR = 0x0B04; - public const int GL_CURRENT_RASTER_DISTANCE = 0x0B09; - public const int GL_CURRENT_RASTER_INDEX = 0x0B05; - public const int GL_CURRENT_RASTER_POSITION = 0x0B07; - public const int GL_CURRENT_RASTER_TEXTURE_COORDS = 0x0B06; - public const int GL_CURRENT_RASTER_POSITION_VALID = 0x0B08; - public const int GL_CURRENT_TEXTURE_COORDS = 0x0B03; - public const int GL_INDEX_CLEAR_VALUE = 0x0C20; - public const int GL_INDEX_MODE = 0x0C30; - public const int GL_INDEX_WRITEMASK = 0x0C21; - public const int GL_MODELVIEW_MATRIX = 0x0BA6; - public const int GL_MODELVIEW_STACK_DEPTH = 0x0BA3; - public const int GL_NAME_STACK_DEPTH = 0x0D70; - public const int GL_PROJECTION_MATRIX = 0x0BA7; - public const int GL_PROJECTION_STACK_DEPTH = 0x0BA4; - public const int GL_RENDER_MODE = 0x0C40; - public const int GL_RGBA_MODE = 0x0C31; - public const int GL_TEXTURE_MATRIX = 0x0BA8; - public const int GL_TEXTURE_STACK_DEPTH = 0x0BA5; - public const int GL_VIEWPORT = 0x0BA2; - public const int GL_AUTO_NORMAL = 0x0D80; - public const int GL_MAP1_COLOR_4 = 0x0D90; - public const int GL_MAP1_INDEX = 0x0D91; - public const int GL_MAP1_NORMAL = 0x0D92; - public const int GL_MAP1_TEXTURE_COORD_1 = 0x0D93; - public const int GL_MAP1_TEXTURE_COORD_2 = 0x0D94; - public const int GL_MAP1_TEXTURE_COORD_3 = 0x0D95; - public const int GL_MAP1_TEXTURE_COORD_4 = 0x0D96; - public const int GL_MAP1_VERTEX_3 = 0x0D97; - public const int GL_MAP1_VERTEX_4 = 0x0D98; - public const int GL_MAP2_COLOR_4 = 0x0DB0; - public const int GL_MAP2_INDEX = 0x0DB1; - public const int GL_MAP2_NORMAL = 0x0DB2; - public const int GL_MAP2_TEXTURE_COORD_1 = 0x0DB3; - public const int GL_MAP2_TEXTURE_COORD_2 = 0x0DB4; - public const int GL_MAP2_TEXTURE_COORD_3 = 0x0DB5; - public const int GL_MAP2_TEXTURE_COORD_4 = 0x0DB6; - public const int GL_MAP2_VERTEX_3 = 0x0DB7; - public const int GL_MAP2_VERTEX_4 = 0x0DB8; - public const int GL_MAP1_GRID_DOMAIN = 0x0DD0; - public const int GL_MAP1_GRID_SEGMENTS = 0x0DD1; - public const int GL_MAP2_GRID_DOMAIN = 0x0DD2; - public const int GL_MAP2_GRID_SEGMENTS = 0x0DD3; - public const int GL_COEFF = 0x0A00; - public const int GL_ORDER = 0x0A01; - public const int GL_DOMAIN = 0x0A02; - public const int GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50; - public const int GL_POINT_SMOOTH_HINT = 0x0C51; - public const int GL_LINE_SMOOTH_HINT = 0x0C52; - public const int GL_POLYGON_SMOOTH_HINT = 0x0C53; - public const int GL_FOG_HINT = 0x0C54; - public const int GL_DONT_CARE = 0x1100; - public const int GL_FASTEST = 0x1101; - public const int GL_NICEST = 0x1102; - public const int GL_SCISSOR_BOX = 0x0C10; - public const int GL_SCISSOR_TEST = 0x0C11; - public const int GL_MAP_COLOR = 0x0D10; - public const int GL_MAP_STENCIL = 0x0D11; - public const int GL_INDEX_SHIFT = 0x0D12; - public const int GL_INDEX_OFFSET = 0x0D13; - public const int GL_RED_SCALE = 0x0D14; - public const int GL_RED_BIAS = 0x0D15; - public const int GL_GREEN_SCALE = 0x0D18; - public const int GL_GREEN_BIAS = 0x0D19; - public const int GL_BLUE_SCALE = 0x0D1A; - public const int GL_BLUE_BIAS = 0x0D1B; - public const int GL_ALPHA_SCALE = 0x0D1C; - public const int GL_ALPHA_BIAS = 0x0D1D; - public const int GL_DEPTH_SCALE = 0x0D1E; - public const int GL_DEPTH_BIAS = 0x0D1F; - public const int GL_PIXEL_MAP_S_TO_S_SIZE = 0x0CB1; - public const int GL_PIXEL_MAP_I_TO_I_SIZE = 0x0CB0; - public const int GL_PIXEL_MAP_I_TO_R_SIZE = 0x0CB2; - public const int GL_PIXEL_MAP_I_TO_G_SIZE = 0x0CB3; - public const int GL_PIXEL_MAP_I_TO_B_SIZE = 0x0CB4; - public const int GL_PIXEL_MAP_I_TO_A_SIZE = 0x0CB5; - public const int GL_PIXEL_MAP_R_TO_R_SIZE = 0x0CB6; - public const int GL_PIXEL_MAP_G_TO_G_SIZE = 0x0CB7; - public const int GL_PIXEL_MAP_B_TO_B_SIZE = 0x0CB8; - public const int GL_PIXEL_MAP_A_TO_A_SIZE = 0x0CB9; - public const int GL_PIXEL_MAP_S_TO_S = 0x0C71; - public const int GL_PIXEL_MAP_I_TO_I = 0x0C70; - public const int GL_PIXEL_MAP_I_TO_R = 0x0C72; - public const int GL_PIXEL_MAP_I_TO_G = 0x0C73; - public const int GL_PIXEL_MAP_I_TO_B = 0x0C74; - public const int GL_PIXEL_MAP_I_TO_A = 0x0C75; - public const int GL_PIXEL_MAP_R_TO_R = 0x0C76; - public const int GL_PIXEL_MAP_G_TO_G = 0x0C77; - public const int GL_PIXEL_MAP_B_TO_B = 0x0C78; - public const int GL_PIXEL_MAP_A_TO_A = 0x0C79; - public const int GL_PACK_ALIGNMENT = 0x0D05; - public const int GL_PACK_LSB_FIRST = 0x0D01; - public const int GL_PACK_ROW_LENGTH = 0x0D02; - public const int GL_PACK_SKIP_PIXELS = 0x0D04; - public const int GL_PACK_SKIP_ROWS = 0x0D03; - public const int GL_PACK_SWAP_BYTES = 0x0D00; - public const int GL_UNPACK_ALIGNMENT = 0x0CF5; - public const int GL_UNPACK_LSB_FIRST = 0x0CF1; - public const int GL_UNPACK_ROW_LENGTH = 0x0CF2; - public const int GL_UNPACK_SKIP_PIXELS = 0x0CF4; - public const int GL_UNPACK_SKIP_ROWS = 0x0CF3; - public const int GL_UNPACK_SWAP_BYTES = 0x0CF0; - public const int GL_ZOOM_X = 0x0D16; - public const int GL_ZOOM_Y = 0x0D17; - public const int GL_TEXTURE_ENV = 0x2300; - public const int GL_TEXTURE_ENV_MODE = 0x2200; - public const int GL_TEXTURE_1D = 0x0DE0; +// public const int GL_MAX_LIST_NESTING = 0x0B31; +// public const int GL_MAX_EVAL_ORDER = 0x0D30; +// public const int GL_MAX_LIGHTS = 0x0D31; +// public const int GL_MAX_CLIP_PLANES = 0x0D32; +// public const int GL_MAX_TEXTURE_SIZE = 0x0D33; +// public const int GL_MAX_PIXEL_MAP_TABLE = 0x0D34; +// public const int GL_MAX_ATTRIB_STACK_DEPTH = 0x0D35; +// public const int GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36; +// public const int GL_MAX_NAME_STACK_DEPTH = 0x0D37; +// public const int GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38; +// public const int GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39; +// public const int GL_MAX_VIEWPORT_DIMS = 0x0D3A; +// public const int GL_MAX_CLIENT_ATTRIB_STACK_DEPTH = 0x0D3B; +// public const int GL_ATTRIB_STACK_DEPTH = 0x0BB0; +// public const int GL_CLIENT_ATTRIB_STACK_DEPTH = 0x0BB1; +// public const int GL_COLOR_CLEAR_VALUE = 0x0C22; +// public const int GL_COLOR_WRITEMASK = 0x0C23; +// public const int GL_CURRENT_INDEX = 0x0B01; +// public const int GL_CURRENT_COLOR = 0x0B00; +// public const int GL_CURRENT_NORMAL = 0x0B02; +// public const int GL_CURRENT_RASTER_COLOR = 0x0B04; +// public const int GL_CURRENT_RASTER_DISTANCE = 0x0B09; +// public const int GL_CURRENT_RASTER_INDEX = 0x0B05; +// public const int GL_CURRENT_RASTER_POSITION = 0x0B07; +// public const int GL_CURRENT_RASTER_TEXTURE_COORDS = 0x0B06; +// public const int GL_CURRENT_RASTER_POSITION_VALID = 0x0B08; +// public const int GL_CURRENT_TEXTURE_COORDS = 0x0B03; +// public const int GL_INDEX_CLEAR_VALUE = 0x0C20; +// public const int GL_INDEX_MODE = 0x0C30; +// public const int GL_INDEX_WRITEMASK = 0x0C21; +// public const int GL_MODELVIEW_MATRIX = 0x0BA6; +// public const int GL_MODELVIEW_STACK_DEPTH = 0x0BA3; +// public const int GL_NAME_STACK_DEPTH = 0x0D70; +// public const int GL_PROJECTION_MATRIX = 0x0BA7; +// public const int GL_PROJECTION_STACK_DEPTH = 0x0BA4; +// public const int GL_RENDER_MODE = 0x0C40; +// public const int GL_RGBA_MODE = 0x0C31; +// public const int GL_TEXTURE_MATRIX = 0x0BA8; +// public const int GL_TEXTURE_STACK_DEPTH = 0x0BA5; +// public const int GL_VIEWPORT = 0x0BA2; +// public const int GL_AUTO_NORMAL = 0x0D80; +// public const int GL_MAP1_COLOR_4 = 0x0D90; +// public const int GL_MAP1_INDEX = 0x0D91; +// public const int GL_MAP1_NORMAL = 0x0D92; +// public const int GL_MAP1_TEXTURE_COORD_1 = 0x0D93; +// public const int GL_MAP1_TEXTURE_COORD_2 = 0x0D94; +// public const int GL_MAP1_TEXTURE_COORD_3 = 0x0D95; +// public const int GL_MAP1_TEXTURE_COORD_4 = 0x0D96; +// public const int GL_MAP1_VERTEX_3 = 0x0D97; +// public const int GL_MAP1_VERTEX_4 = 0x0D98; +// public const int GL_MAP2_COLOR_4 = 0x0DB0; +// public const int GL_MAP2_INDEX = 0x0DB1; +// public const int GL_MAP2_NORMAL = 0x0DB2; +// public const int GL_MAP2_TEXTURE_COORD_1 = 0x0DB3; +// public const int GL_MAP2_TEXTURE_COORD_2 = 0x0DB4; +// public const int GL_MAP2_TEXTURE_COORD_3 = 0x0DB5; +// public const int GL_MAP2_TEXTURE_COORD_4 = 0x0DB6; +// public const int GL_MAP2_VERTEX_3 = 0x0DB7; +// public const int GL_MAP2_VERTEX_4 = 0x0DB8; +// public const int GL_MAP1_GRID_DOMAIN = 0x0DD0; +// public const int GL_MAP1_GRID_SEGMENTS = 0x0DD1; +// public const int GL_MAP2_GRID_DOMAIN = 0x0DD2; +// public const int GL_MAP2_GRID_SEGMENTS = 0x0DD3; +// public const int GL_COEFF = 0x0A00; +// public const int GL_ORDER = 0x0A01; +// public const int GL_DOMAIN = 0x0A02; +// public const int GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50; +// public const int GL_POINT_SMOOTH_HINT = 0x0C51; +// public const int GL_LINE_SMOOTH_HINT = 0x0C52; +// public const int GL_POLYGON_SMOOTH_HINT = 0x0C53; +// public const int GL_FOG_HINT = 0x0C54; +// public const int GL_DONT_CARE = 0x1100; +// public const int GL_FASTEST = 0x1101; +// public const int GL_NICEST = 0x1102; +// public const int GL_SCISSOR_BOX = 0x0C10; +// public const int GL_SCISSOR_TEST = 0x0C11; +// public const int GL_MAP_COLOR = 0x0D10; +// public const int GL_MAP_STENCIL = 0x0D11; +// public const int GL_INDEX_SHIFT = 0x0D12; +// public const int GL_INDEX_OFFSET = 0x0D13; +// public const int GL_RED_SCALE = 0x0D14; +// public const int GL_RED_BIAS = 0x0D15; +// public const int GL_GREEN_SCALE = 0x0D18; +// public const int GL_GREEN_BIAS = 0x0D19; +// public const int GL_BLUE_SCALE = 0x0D1A; +// public const int GL_BLUE_BIAS = 0x0D1B; +// public const int GL_ALPHA_SCALE = 0x0D1C; +// public const int GL_ALPHA_BIAS = 0x0D1D; +// public const int GL_DEPTH_SCALE = 0x0D1E; +// public const int GL_DEPTH_BIAS = 0x0D1F; +// public const int GL_PIXEL_MAP_S_TO_S_SIZE = 0x0CB1; +// public const int GL_PIXEL_MAP_I_TO_I_SIZE = 0x0CB0; +// public const int GL_PIXEL_MAP_I_TO_R_SIZE = 0x0CB2; +// public const int GL_PIXEL_MAP_I_TO_G_SIZE = 0x0CB3; +// public const int GL_PIXEL_MAP_I_TO_B_SIZE = 0x0CB4; +// public const int GL_PIXEL_MAP_I_TO_A_SIZE = 0x0CB5; +// public const int GL_PIXEL_MAP_R_TO_R_SIZE = 0x0CB6; +// public const int GL_PIXEL_MAP_G_TO_G_SIZE = 0x0CB7; +// public const int GL_PIXEL_MAP_B_TO_B_SIZE = 0x0CB8; +// public const int GL_PIXEL_MAP_A_TO_A_SIZE = 0x0CB9; +// public const int GL_PIXEL_MAP_S_TO_S = 0x0C71; +// public const int GL_PIXEL_MAP_I_TO_I = 0x0C70; +// public const int GL_PIXEL_MAP_I_TO_R = 0x0C72; +// public const int GL_PIXEL_MAP_I_TO_G = 0x0C73; +// public const int GL_PIXEL_MAP_I_TO_B = 0x0C74; +// public const int GL_PIXEL_MAP_I_TO_A = 0x0C75; +// public const int GL_PIXEL_MAP_R_TO_R = 0x0C76; +// public const int GL_PIXEL_MAP_G_TO_G = 0x0C77; +// public const int GL_PIXEL_MAP_B_TO_B = 0x0C78; +// public const int GL_PIXEL_MAP_A_TO_A = 0x0C79; +// public const int GL_PACK_ALIGNMENT = 0x0D05; +// public const int GL_PACK_LSB_FIRST = 0x0D01; +// public const int GL_PACK_ROW_LENGTH = 0x0D02; +// public const int GL_PACK_SKIP_PIXELS = 0x0D04; +// public const int GL_PACK_SKIP_ROWS = 0x0D03; +// public const int GL_PACK_SWAP_BYTES = 0x0D00; +// public const int GL_UNPACK_ALIGNMENT = 0x0CF5; +// public const int GL_UNPACK_LSB_FIRST = 0x0CF1; +// public const int GL_UNPACK_ROW_LENGTH = 0x0CF2; +// public const int GL_UNPACK_SKIP_PIXELS = 0x0CF4; +// public const int GL_UNPACK_SKIP_ROWS = 0x0CF3; +// public const int GL_UNPACK_SWAP_BYTES = 0x0CF0; +// public const int GL_ZOOM_X = 0x0D16; +// public const int GL_ZOOM_Y = 0x0D17; +// public const int GL_TEXTURE_ENV = 0x2300; +// public const int GL_TEXTURE_ENV_MODE = 0x2200; +// public const int GL_TEXTURE_1D = 0x0DE0; public const int GL_TEXTURE_2D = 0x0DE1; - public const int GL_TEXTURE_WRAP_S = 0x2802; - public const int GL_TEXTURE_WRAP_T = 0x2803; +// public const int GL_TEXTURE_WRAP_S = 0x2802; +// public const int GL_TEXTURE_WRAP_T = 0x2803; public const int GL_TEXTURE_MAG_FILTER = 0x2800; public const int GL_TEXTURE_MIN_FILTER = 0x2801; - public const int GL_TEXTURE_ENV_COLOR = 0x2201; - public const int GL_TEXTURE_GEN_S = 0x0C60; - public const int GL_TEXTURE_GEN_T = 0x0C61; - public const int GL_TEXTURE_GEN_R = 0x0C62; - public const int GL_TEXTURE_GEN_Q = 0x0C63; - public const int GL_TEXTURE_GEN_MODE = 0x2500; - public const int GL_TEXTURE_BORDER_COLOR = 0x1004; - public const int GL_TEXTURE_WIDTH = 0x1000; - public const int GL_TEXTURE_HEIGHT = 0x1001; - public const int GL_TEXTURE_BORDER = 0x1005; - public const int GL_TEXTURE_COMPONENTS = 0x1003; - public const int GL_TEXTURE_RED_SIZE = 0x805C; - public const int GL_TEXTURE_GREEN_SIZE = 0x805D; - public const int GL_TEXTURE_BLUE_SIZE = 0x805E; - public const int GL_TEXTURE_ALPHA_SIZE = 0x805F; - public const int GL_TEXTURE_LUMINANCE_SIZE = 0x8060; - public const int GL_TEXTURE_INTENSITY_SIZE = 0x8061; - public const int GL_NEAREST_MIPMAP_NEAREST = 0x2700; - public const int GL_NEAREST_MIPMAP_LINEAR = 0x2702; - public const int GL_LINEAR_MIPMAP_NEAREST = 0x2701; - public const int GL_LINEAR_MIPMAP_LINEAR = 0x2703; - public const int GL_OBJECT_LINEAR = 0x2401; - public const int GL_OBJECT_PLANE = 0x2501; - public const int GL_EYE_LINEAR = 0x2400; - public const int GL_EYE_PLANE = 0x2502; - public const int GL_SPHERE_MAP = 0x2402; - public const int GL_DECAL = 0x2101; - public const int GL_MODULATE = 0x2100; +// public const int GL_TEXTURE_ENV_COLOR = 0x2201; +// public const int GL_TEXTURE_GEN_S = 0x0C60; +// public const int GL_TEXTURE_GEN_T = 0x0C61; +// public const int GL_TEXTURE_GEN_R = 0x0C62; +// public const int GL_TEXTURE_GEN_Q = 0x0C63; +// public const int GL_TEXTURE_GEN_MODE = 0x2500; +// public const int GL_TEXTURE_BORDER_COLOR = 0x1004; +// public const int GL_TEXTURE_WIDTH = 0x1000; +// public const int GL_TEXTURE_HEIGHT = 0x1001; +// public const int GL_TEXTURE_BORDER = 0x1005; +// public const int GL_TEXTURE_COMPONENTS = 0x1003; +// public const int GL_TEXTURE_RED_SIZE = 0x805C; +// public const int GL_TEXTURE_GREEN_SIZE = 0x805D; +// public const int GL_TEXTURE_BLUE_SIZE = 0x805E; +// public const int GL_TEXTURE_ALPHA_SIZE = 0x805F; +// public const int GL_TEXTURE_LUMINANCE_SIZE = 0x8060; +// public const int GL_TEXTURE_INTENSITY_SIZE = 0x8061; +// public const int GL_NEAREST_MIPMAP_NEAREST = 0x2700; +// public const int GL_NEAREST_MIPMAP_LINEAR = 0x2702; +// public const int GL_LINEAR_MIPMAP_NEAREST = 0x2701; +// public const int GL_LINEAR_MIPMAP_LINEAR = 0x2703; +// public const int GL_OBJECT_LINEAR = 0x2401; +// public const int GL_OBJECT_PLANE = 0x2501; +// public const int GL_EYE_LINEAR = 0x2400; +// public const int GL_EYE_PLANE = 0x2502; +// public const int GL_SPHERE_MAP = 0x2402; +// public const int GL_DECAL = 0x2101; +// public const int GL_MODULATE = 0x2100; public const int GL_NEAREST = 0x2600; - public const int GL_REPEAT = 0x2901; - public const int GL_CLAMP = 0x2900; - public const int GL_S = 0x2000; - public const int GL_T = 0x2001; - public const int GL_R = 0x2002; - public const int GL_Q = 0x2003; +// public const int GL_REPEAT = 0x2901; +// public const int GL_CLAMP = 0x2900; +// public const int GL_S = 0x2000; +// public const int GL_T = 0x2001; +// public const int GL_R = 0x2002; +// public const int GL_Q = 0x2003; public const int GL_VENDOR = 0x1F00; public const int GL_RENDERER = 0x1F01; public const int GL_VERSION = 0x1F02; @@ -465,5000 +464,5000 @@ namespace Avalonia.OpenGL public const int GL_OUT_OF_MEMORY = 0x0505; public const int GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506; public const int GL_CONTEXT_LOST = 0x0507; - public const int GL_CURRENT_BIT = 0x00000001; - public const int GL_POINT_BIT = 0x00000002; - public const int GL_LINE_BIT = 0x00000004; - public const int GL_POLYGON_BIT = 0x00000008; - public const int GL_POLYGON_STIPPLE_BIT = 0x00000010; - public const int GL_PIXEL_MODE_BIT = 0x00000020; - public const int GL_LIGHTING_BIT = 0x00000040; - public const int GL_FOG_BIT = 0x00000080; +// public const int GL_CURRENT_BIT = 0x00000001; +// public const int GL_POINT_BIT = 0x00000002; +// public const int GL_LINE_BIT = 0x00000004; +// public const int GL_POLYGON_BIT = 0x00000008; +// public const int GL_POLYGON_STIPPLE_BIT = 0x00000010; +// public const int GL_PIXEL_MODE_BIT = 0x00000020; +// public const int GL_LIGHTING_BIT = 0x00000040; +// public const int GL_FOG_BIT = 0x00000080; public const int GL_DEPTH_BUFFER_BIT = 0x00000100; - public const int GL_ACCUM_BUFFER_BIT = 0x00000200; +// public const int GL_ACCUM_BUFFER_BIT = 0x00000200; public const int GL_STENCIL_BUFFER_BIT = 0x00000400; - public const int GL_VIEWPORT_BIT = 0x00000800; - public const int GL_TRANSFORM_BIT = 0x00001000; - public const int GL_ENABLE_BIT = 0x00002000; +// public const int GL_VIEWPORT_BIT = 0x00000800; +// public const int GL_TRANSFORM_BIT = 0x00001000; +// public const int GL_ENABLE_BIT = 0x00002000; public const int GL_COLOR_BUFFER_BIT = 0x00004000; - public const int GL_HINT_BIT = 0x00008000; - public const int GL_EVAL_BIT = 0x00010000; - public const int GL_LIST_BIT = 0x00020000; - public const int GL_TEXTURE_BIT = 0x00040000; - public const int GL_SCISSOR_BIT = 0x00080000; - public const int GL_ALL_ATTRIB_BITS = -1; - public const int GL_PROXY_TEXTURE_1D = 0x8063; - public const int GL_PROXY_TEXTURE_2D = 0x8064; - public const int GL_TEXTURE_PRIORITY = 0x8066; - public const int GL_TEXTURE_RESIDENT = 0x8067; - public const int GL_TEXTURE_BINDING_1D = 0x8068; +// public const int GL_HINT_BIT = 0x00008000; +// public const int GL_EVAL_BIT = 0x00010000; +// public const int GL_LIST_BIT = 0x00020000; +// public const int GL_TEXTURE_BIT = 0x00040000; +// public const int GL_SCISSOR_BIT = 0x00080000; +// public const int GL_ALL_ATTRIB_BITS = -1; +// public const int GL_PROXY_TEXTURE_1D = 0x8063; +// public const int GL_PROXY_TEXTURE_2D = 0x8064; +// public const int GL_TEXTURE_PRIORITY = 0x8066; +// public const int GL_TEXTURE_RESIDENT = 0x8067; +// public const int GL_TEXTURE_BINDING_1D = 0x8068; public const int GL_TEXTURE_BINDING_2D = 0x8069; - public const int GL_TEXTURE_INTERNAL_FORMAT = 0x1003; - public const int GL_ALPHA4 = 0x803B; - public const int GL_ALPHA8 = 0x803C; - public const int GL_ALPHA12 = 0x803D; - public const int GL_ALPHA16 = 0x803E; - public const int GL_LUMINANCE4 = 0x803F; - public const int GL_LUMINANCE8 = 0x8040; - public const int GL_LUMINANCE12 = 0x8041; - public const int GL_LUMINANCE16 = 0x8042; - public const int GL_LUMINANCE4_ALPHA4 = 0x8043; - public const int GL_LUMINANCE6_ALPHA2 = 0x8044; - public const int GL_LUMINANCE8_ALPHA8 = 0x8045; - public const int GL_LUMINANCE12_ALPHA4 = 0x8046; - public const int GL_LUMINANCE12_ALPHA12 = 0x8047; - public const int GL_LUMINANCE16_ALPHA16 = 0x8048; - public const int GL_INTENSITY = 0x8049; - public const int GL_INTENSITY4 = 0x804A; - public const int GL_INTENSITY8 = 0x804B; - public const int GL_INTENSITY12 = 0x804C; - public const int GL_INTENSITY16 = 0x804D; - public const int GL_R3_G3_B2 = 0x2A10; - public const int GL_RGB4 = 0x804F; - public const int GL_RGB5 = 0x8050; - public const int GL_RGB8 = 0x8051; - public const int GL_RGB10 = 0x8052; - public const int GL_RGB12 = 0x8053; - public const int GL_RGB16 = 0x8054; - public const int GL_RGBA2 = 0x8055; - public const int GL_RGBA4 = 0x8056; - public const int GL_RGB5_A1 = 0x8057; +// public const int GL_TEXTURE_INTERNAL_FORMAT = 0x1003; +// public const int GL_ALPHA4 = 0x803B; +// public const int GL_ALPHA8 = 0x803C; +// public const int GL_ALPHA12 = 0x803D; +// public const int GL_ALPHA16 = 0x803E; +// public const int GL_LUMINANCE4 = 0x803F; +// public const int GL_LUMINANCE8 = 0x8040; +// public const int GL_LUMINANCE12 = 0x8041; +// public const int GL_LUMINANCE16 = 0x8042; +// public const int GL_LUMINANCE4_ALPHA4 = 0x8043; +// public const int GL_LUMINANCE6_ALPHA2 = 0x8044; +// public const int GL_LUMINANCE8_ALPHA8 = 0x8045; +// public const int GL_LUMINANCE12_ALPHA4 = 0x8046; +// public const int GL_LUMINANCE12_ALPHA12 = 0x8047; +// public const int GL_LUMINANCE16_ALPHA16 = 0x8048; +// public const int GL_INTENSITY = 0x8049; +// public const int GL_INTENSITY4 = 0x804A; +// public const int GL_INTENSITY8 = 0x804B; +// public const int GL_INTENSITY12 = 0x804C; +// public const int GL_INTENSITY16 = 0x804D; +// public const int GL_R3_G3_B2 = 0x2A10; +// public const int GL_RGB4 = 0x804F; +// public const int GL_RGB5 = 0x8050; +// public const int GL_RGB8 = 0x8051; +// public const int GL_RGB10 = 0x8052; +// public const int GL_RGB12 = 0x8053; +// public const int GL_RGB16 = 0x8054; +// public const int GL_RGBA2 = 0x8055; +// public const int GL_RGBA4 = 0x8056; +// public const int GL_RGB5_A1 = 0x8057; public const int GL_RGBA8 = 0x8058; - public const int GL_RGB10_A2 = 0x8059; - public const int GL_RGBA12 = 0x805A; - public const int GL_RGBA16 = 0x805B; - public const int GL_CLIENT_PIXEL_STORE_BIT = 0x00000001; - public const int GL_CLIENT_VERTEX_ARRAY_BIT = 0x00000002; - public const int GL_ALL_CLIENT_ATTRIB_BITS = -1; - public const int GL_CLIENT_ALL_ATTRIB_BITS = -1; - public const int GL_RESCALE_NORMAL = 0x803A; - public const int GL_CLAMP_TO_EDGE = 0x812F; - public const int GL_MAX_ELEMENTS_VERTICES = 0x80E8; - public const int GL_MAX_ELEMENTS_INDICES = 0x80E9; - public const int GL_BGR = 0x80E0; - public const int GL_BGRA = 0x80E1; - public const int GL_UNSIGNED_BYTE_3_3_2 = 0x8032; - public const int GL_UNSIGNED_BYTE_2_3_3_REV = 0x8362; - public const int GL_UNSIGNED_SHORT_5_6_5 = 0x8363; - public const int GL_UNSIGNED_SHORT_5_6_5_REV = 0x8364; - public const int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033; - public const int GL_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365; - public const int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034; - public const int GL_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366; - public const int GL_UNSIGNED_INT_8_8_8_8 = 0x8035; - public const int GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367; - public const int GL_UNSIGNED_INT_10_10_10_2 = 0x8036; - public const int GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368; - public const int GL_LIGHT_MODEL_COLOR_CONTROL = 0x81F8; - public const int GL_SINGLE_COLOR = 0x81F9; - public const int GL_SEPARATE_SPECULAR_COLOR = 0x81FA; - public const int GL_TEXTURE_MIN_LOD = 0x813A; - public const int GL_TEXTURE_MAX_LOD = 0x813B; - public const int GL_TEXTURE_BASE_LEVEL = 0x813C; - public const int GL_TEXTURE_MAX_LEVEL = 0x813D; - public const int GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12; - public const int GL_SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13; - public const int GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22; - public const int GL_SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23; - public const int GL_ALIASED_POINT_SIZE_RANGE = 0x846D; - public const int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E; - public const int GL_PACK_SKIP_IMAGES = 0x806B; - public const int GL_PACK_IMAGE_HEIGHT = 0x806C; - public const int GL_UNPACK_SKIP_IMAGES = 0x806D; - public const int GL_UNPACK_IMAGE_HEIGHT = 0x806E; - public const int GL_TEXTURE_3D = 0x806F; - public const int GL_PROXY_TEXTURE_3D = 0x8070; - public const int GL_TEXTURE_DEPTH = 0x8071; - public const int GL_TEXTURE_WRAP_R = 0x8072; - public const int GL_MAX_3D_TEXTURE_SIZE = 0x8073; - public const int GL_TEXTURE_BINDING_3D = 0x806A; - public const int GL_CONSTANT_COLOR = 0x8001; - public const int GL_ONE_MINUS_CONSTANT_COLOR = 0x8002; - public const int GL_CONSTANT_ALPHA = 0x8003; - public const int GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004; - public const int GL_COLOR_TABLE = 0x80D0; - public const int GL_POST_CONVOLUTION_COLOR_TABLE = 0x80D1; - public const int GL_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D2; - public const int GL_PROXY_COLOR_TABLE = 0x80D3; - public const int GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = 0x80D4; - public const int GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D5; - public const int GL_COLOR_TABLE_SCALE = 0x80D6; - public const int GL_COLOR_TABLE_BIAS = 0x80D7; - public const int GL_COLOR_TABLE_FORMAT = 0x80D8; - public const int GL_COLOR_TABLE_WIDTH = 0x80D9; - public const int GL_COLOR_TABLE_RED_SIZE = 0x80DA; - public const int GL_COLOR_TABLE_GREEN_SIZE = 0x80DB; - public const int GL_COLOR_TABLE_BLUE_SIZE = 0x80DC; - public const int GL_COLOR_TABLE_ALPHA_SIZE = 0x80DD; - public const int GL_COLOR_TABLE_LUMINANCE_SIZE = 0x80DE; - public const int GL_COLOR_TABLE_INTENSITY_SIZE = 0x80DF; - public const int GL_CONVOLUTION_1D = 0x8010; - public const int GL_CONVOLUTION_2D = 0x8011; - public const int GL_SEPARABLE_2D = 0x8012; - public const int GL_CONVOLUTION_BORDER_MODE = 0x8013; - public const int GL_CONVOLUTION_FILTER_SCALE = 0x8014; - public const int GL_CONVOLUTION_FILTER_BIAS = 0x8015; - public const int GL_REDUCE = 0x8016; - public const int GL_CONVOLUTION_FORMAT = 0x8017; - public const int GL_CONVOLUTION_WIDTH = 0x8018; - public const int GL_CONVOLUTION_HEIGHT = 0x8019; - public const int GL_MAX_CONVOLUTION_WIDTH = 0x801A; - public const int GL_MAX_CONVOLUTION_HEIGHT = 0x801B; - public const int GL_POST_CONVOLUTION_RED_SCALE = 0x801C; - public const int GL_POST_CONVOLUTION_GREEN_SCALE = 0x801D; - public const int GL_POST_CONVOLUTION_BLUE_SCALE = 0x801E; - public const int GL_POST_CONVOLUTION_ALPHA_SCALE = 0x801F; - public const int GL_POST_CONVOLUTION_RED_BIAS = 0x8020; - public const int GL_POST_CONVOLUTION_GREEN_BIAS = 0x8021; - public const int GL_POST_CONVOLUTION_BLUE_BIAS = 0x8022; - public const int GL_POST_CONVOLUTION_ALPHA_BIAS = 0x8023; - public const int GL_CONSTANT_BORDER = 0x8151; - public const int GL_REPLICATE_BORDER = 0x8153; - public const int GL_CONVOLUTION_BORDER_COLOR = 0x8154; - public const int GL_COLOR_MATRIX = 0x80B1; - public const int GL_COLOR_MATRIX_STACK_DEPTH = 0x80B2; - public const int GL_MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3; - public const int GL_POST_COLOR_MATRIX_RED_SCALE = 0x80B4; - public const int GL_POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5; - public const int GL_POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6; - public const int GL_POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7; - public const int GL_POST_COLOR_MATRIX_RED_BIAS = 0x80B8; - public const int GL_POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9; - public const int GL_POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA; - public const int GL_POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB; - public const int GL_HISTOGRAM = 0x8024; - public const int GL_PROXY_HISTOGRAM = 0x8025; - public const int GL_HISTOGRAM_WIDTH = 0x8026; - public const int GL_HISTOGRAM_FORMAT = 0x8027; - public const int GL_HISTOGRAM_RED_SIZE = 0x8028; - public const int GL_HISTOGRAM_GREEN_SIZE = 0x8029; - public const int GL_HISTOGRAM_BLUE_SIZE = 0x802A; - public const int GL_HISTOGRAM_ALPHA_SIZE = 0x802B; - public const int GL_HISTOGRAM_LUMINANCE_SIZE = 0x802C; - public const int GL_HISTOGRAM_SINK = 0x802D; - public const int GL_MINMAX = 0x802E; - public const int GL_MINMAX_FORMAT = 0x802F; - public const int GL_MINMAX_SINK = 0x8030; - public const int GL_TABLE_TOO_LARGE = 0x8031; - public const int GL_BLEND_EQUATION = 0x8009; - public const int GL_MIN = 0x8007; - public const int GL_MAX = 0x8008; - public const int GL_FUNC_ADD = 0x8006; - public const int GL_FUNC_SUBTRACT = 0x800A; - public const int GL_FUNC_REVERSE_SUBTRACT = 0x800B; - public const int GL_BLEND_COLOR = 0x8005; +// public const int GL_RGB10_A2 = 0x8059; +// public const int GL_RGBA12 = 0x805A; +// public const int GL_RGBA16 = 0x805B; +// public const int GL_CLIENT_PIXEL_STORE_BIT = 0x00000001; +// public const int GL_CLIENT_VERTEX_ARRAY_BIT = 0x00000002; +// public const int GL_ALL_CLIENT_ATTRIB_BITS = -1; +// public const int GL_CLIENT_ALL_ATTRIB_BITS = -1; +// public const int GL_RESCALE_NORMAL = 0x803A; +// public const int GL_CLAMP_TO_EDGE = 0x812F; +// public const int GL_MAX_ELEMENTS_VERTICES = 0x80E8; +// public const int GL_MAX_ELEMENTS_INDICES = 0x80E9; +// public const int GL_BGR = 0x80E0; +// public const int GL_BGRA = 0x80E1; +// public const int GL_UNSIGNED_BYTE_3_3_2 = 0x8032; +// public const int GL_UNSIGNED_BYTE_2_3_3_REV = 0x8362; +// public const int GL_UNSIGNED_SHORT_5_6_5 = 0x8363; +// public const int GL_UNSIGNED_SHORT_5_6_5_REV = 0x8364; +// public const int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033; +// public const int GL_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365; +// public const int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034; +// public const int GL_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366; +// public const int GL_UNSIGNED_INT_8_8_8_8 = 0x8035; +// public const int GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367; +// public const int GL_UNSIGNED_INT_10_10_10_2 = 0x8036; +// public const int GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368; +// public const int GL_LIGHT_MODEL_COLOR_CONTROL = 0x81F8; +// public const int GL_SINGLE_COLOR = 0x81F9; +// public const int GL_SEPARATE_SPECULAR_COLOR = 0x81FA; +// public const int GL_TEXTURE_MIN_LOD = 0x813A; +// public const int GL_TEXTURE_MAX_LOD = 0x813B; +// public const int GL_TEXTURE_BASE_LEVEL = 0x813C; +// public const int GL_TEXTURE_MAX_LEVEL = 0x813D; +// public const int GL_SMOOTH_POINT_SIZE_RANGE = 0x0B12; +// public const int GL_SMOOTH_POINT_SIZE_GRANULARITY = 0x0B13; +// public const int GL_SMOOTH_LINE_WIDTH_RANGE = 0x0B22; +// public const int GL_SMOOTH_LINE_WIDTH_GRANULARITY = 0x0B23; +// public const int GL_ALIASED_POINT_SIZE_RANGE = 0x846D; +// public const int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E; +// public const int GL_PACK_SKIP_IMAGES = 0x806B; +// public const int GL_PACK_IMAGE_HEIGHT = 0x806C; +// public const int GL_UNPACK_SKIP_IMAGES = 0x806D; +// public const int GL_UNPACK_IMAGE_HEIGHT = 0x806E; +// public const int GL_TEXTURE_3D = 0x806F; +// public const int GL_PROXY_TEXTURE_3D = 0x8070; +// public const int GL_TEXTURE_DEPTH = 0x8071; +// public const int GL_TEXTURE_WRAP_R = 0x8072; +// public const int GL_MAX_3D_TEXTURE_SIZE = 0x8073; +// public const int GL_TEXTURE_BINDING_3D = 0x806A; +// public const int GL_CONSTANT_COLOR = 0x8001; +// public const int GL_ONE_MINUS_CONSTANT_COLOR = 0x8002; +// public const int GL_CONSTANT_ALPHA = 0x8003; +// public const int GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004; +// public const int GL_COLOR_TABLE = 0x80D0; +// public const int GL_POST_CONVOLUTION_COLOR_TABLE = 0x80D1; +// public const int GL_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D2; +// public const int GL_PROXY_COLOR_TABLE = 0x80D3; +// public const int GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = 0x80D4; +// public const int GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D5; +// public const int GL_COLOR_TABLE_SCALE = 0x80D6; +// public const int GL_COLOR_TABLE_BIAS = 0x80D7; +// public const int GL_COLOR_TABLE_FORMAT = 0x80D8; +// public const int GL_COLOR_TABLE_WIDTH = 0x80D9; +// public const int GL_COLOR_TABLE_RED_SIZE = 0x80DA; +// public const int GL_COLOR_TABLE_GREEN_SIZE = 0x80DB; +// public const int GL_COLOR_TABLE_BLUE_SIZE = 0x80DC; +// public const int GL_COLOR_TABLE_ALPHA_SIZE = 0x80DD; +// public const int GL_COLOR_TABLE_LUMINANCE_SIZE = 0x80DE; +// public const int GL_COLOR_TABLE_INTENSITY_SIZE = 0x80DF; +// public const int GL_CONVOLUTION_1D = 0x8010; +// public const int GL_CONVOLUTION_2D = 0x8011; +// public const int GL_SEPARABLE_2D = 0x8012; +// public const int GL_CONVOLUTION_BORDER_MODE = 0x8013; +// public const int GL_CONVOLUTION_FILTER_SCALE = 0x8014; +// public const int GL_CONVOLUTION_FILTER_BIAS = 0x8015; +// public const int GL_REDUCE = 0x8016; +// public const int GL_CONVOLUTION_FORMAT = 0x8017; +// public const int GL_CONVOLUTION_WIDTH = 0x8018; +// public const int GL_CONVOLUTION_HEIGHT = 0x8019; +// public const int GL_MAX_CONVOLUTION_WIDTH = 0x801A; +// public const int GL_MAX_CONVOLUTION_HEIGHT = 0x801B; +// public const int GL_POST_CONVOLUTION_RED_SCALE = 0x801C; +// public const int GL_POST_CONVOLUTION_GREEN_SCALE = 0x801D; +// public const int GL_POST_CONVOLUTION_BLUE_SCALE = 0x801E; +// public const int GL_POST_CONVOLUTION_ALPHA_SCALE = 0x801F; +// public const int GL_POST_CONVOLUTION_RED_BIAS = 0x8020; +// public const int GL_POST_CONVOLUTION_GREEN_BIAS = 0x8021; +// public const int GL_POST_CONVOLUTION_BLUE_BIAS = 0x8022; +// public const int GL_POST_CONVOLUTION_ALPHA_BIAS = 0x8023; +// public const int GL_CONSTANT_BORDER = 0x8151; +// public const int GL_REPLICATE_BORDER = 0x8153; +// public const int GL_CONVOLUTION_BORDER_COLOR = 0x8154; +// public const int GL_COLOR_MATRIX = 0x80B1; +// public const int GL_COLOR_MATRIX_STACK_DEPTH = 0x80B2; +// public const int GL_MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3; +// public const int GL_POST_COLOR_MATRIX_RED_SCALE = 0x80B4; +// public const int GL_POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5; +// public const int GL_POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6; +// public const int GL_POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7; +// public const int GL_POST_COLOR_MATRIX_RED_BIAS = 0x80B8; +// public const int GL_POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9; +// public const int GL_POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA; +// public const int GL_POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB; +// public const int GL_HISTOGRAM = 0x8024; +// public const int GL_PROXY_HISTOGRAM = 0x8025; +// public const int GL_HISTOGRAM_WIDTH = 0x8026; +// public const int GL_HISTOGRAM_FORMAT = 0x8027; +// public const int GL_HISTOGRAM_RED_SIZE = 0x8028; +// public const int GL_HISTOGRAM_GREEN_SIZE = 0x8029; +// public const int GL_HISTOGRAM_BLUE_SIZE = 0x802A; +// public const int GL_HISTOGRAM_ALPHA_SIZE = 0x802B; +// public const int GL_HISTOGRAM_LUMINANCE_SIZE = 0x802C; +// public const int GL_HISTOGRAM_SINK = 0x802D; +// public const int GL_MINMAX = 0x802E; +// public const int GL_MINMAX_FORMAT = 0x802F; +// public const int GL_MINMAX_SINK = 0x8030; +// public const int GL_TABLE_TOO_LARGE = 0x8031; +// public const int GL_BLEND_EQUATION = 0x8009; +// public const int GL_MIN = 0x8007; +// public const int GL_MAX = 0x8008; +// public const int GL_FUNC_ADD = 0x8006; +// public const int GL_FUNC_SUBTRACT = 0x800A; +// public const int GL_FUNC_REVERSE_SUBTRACT = 0x800B; +// public const int GL_BLEND_COLOR = 0x8005; public const int GL_TEXTURE0 = 0x84C0; - public const int GL_TEXTURE1 = 0x84C1; - public const int GL_TEXTURE2 = 0x84C2; - public const int GL_TEXTURE3 = 0x84C3; - public const int GL_TEXTURE4 = 0x84C4; - public const int GL_TEXTURE5 = 0x84C5; - public const int GL_TEXTURE6 = 0x84C6; - public const int GL_TEXTURE7 = 0x84C7; - public const int GL_TEXTURE8 = 0x84C8; - public const int GL_TEXTURE9 = 0x84C9; - public const int GL_TEXTURE10 = 0x84CA; - public const int GL_TEXTURE11 = 0x84CB; - public const int GL_TEXTURE12 = 0x84CC; - public const int GL_TEXTURE13 = 0x84CD; - public const int GL_TEXTURE14 = 0x84CE; - public const int GL_TEXTURE15 = 0x84CF; - public const int GL_TEXTURE16 = 0x84D0; - public const int GL_TEXTURE17 = 0x84D1; - public const int GL_TEXTURE18 = 0x84D2; - public const int GL_TEXTURE19 = 0x84D3; - public const int GL_TEXTURE20 = 0x84D4; - public const int GL_TEXTURE21 = 0x84D5; - public const int GL_TEXTURE22 = 0x84D6; - public const int GL_TEXTURE23 = 0x84D7; - public const int GL_TEXTURE24 = 0x84D8; - public const int GL_TEXTURE25 = 0x84D9; - public const int GL_TEXTURE26 = 0x84DA; - public const int GL_TEXTURE27 = 0x84DB; - public const int GL_TEXTURE28 = 0x84DC; - public const int GL_TEXTURE29 = 0x84DD; - public const int GL_TEXTURE30 = 0x84DE; - public const int GL_TEXTURE31 = 0x84DF; +// public const int GL_TEXTURE1 = 0x84C1; +// public const int GL_TEXTURE2 = 0x84C2; +// public const int GL_TEXTURE3 = 0x84C3; +// public const int GL_TEXTURE4 = 0x84C4; +// public const int GL_TEXTURE5 = 0x84C5; +// public const int GL_TEXTURE6 = 0x84C6; +// public const int GL_TEXTURE7 = 0x84C7; +// public const int GL_TEXTURE8 = 0x84C8; +// public const int GL_TEXTURE9 = 0x84C9; +// public const int GL_TEXTURE10 = 0x84CA; +// public const int GL_TEXTURE11 = 0x84CB; +// public const int GL_TEXTURE12 = 0x84CC; +// public const int GL_TEXTURE13 = 0x84CD; +// public const int GL_TEXTURE14 = 0x84CE; +// public const int GL_TEXTURE15 = 0x84CF; +// public const int GL_TEXTURE16 = 0x84D0; +// public const int GL_TEXTURE17 = 0x84D1; +// public const int GL_TEXTURE18 = 0x84D2; +// public const int GL_TEXTURE19 = 0x84D3; +// public const int GL_TEXTURE20 = 0x84D4; +// public const int GL_TEXTURE21 = 0x84D5; +// public const int GL_TEXTURE22 = 0x84D6; +// public const int GL_TEXTURE23 = 0x84D7; +// public const int GL_TEXTURE24 = 0x84D8; +// public const int GL_TEXTURE25 = 0x84D9; +// public const int GL_TEXTURE26 = 0x84DA; +// public const int GL_TEXTURE27 = 0x84DB; +// public const int GL_TEXTURE28 = 0x84DC; +// public const int GL_TEXTURE29 = 0x84DD; +// public const int GL_TEXTURE30 = 0x84DE; +// public const int GL_TEXTURE31 = 0x84DF; public const int GL_ACTIVE_TEXTURE = 0x84E0; - public const int GL_CLIENT_ACTIVE_TEXTURE = 0x84E1; - public const int GL_MAX_TEXTURE_UNITS = 0x84E2; - public const int GL_NORMAL_MAP = 0x8511; - public const int GL_REFLECTION_MAP = 0x8512; - public const int GL_TEXTURE_CUBE_MAP = 0x8513; - public const int GL_TEXTURE_BINDING_CUBE_MAP = 0x8514; - public const int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; - public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; - public const int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; - public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; - public const int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; - public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; - public const int GL_PROXY_TEXTURE_CUBE_MAP = 0x851B; - public const int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; - public const int GL_COMPRESSED_ALPHA = 0x84E9; - public const int GL_COMPRESSED_LUMINANCE = 0x84EA; - public const int GL_COMPRESSED_LUMINANCE_ALPHA = 0x84EB; - public const int GL_COMPRESSED_INTENSITY = 0x84EC; - public const int GL_COMPRESSED_RGB = 0x84ED; - public const int GL_COMPRESSED_RGBA = 0x84EE; - public const int GL_TEXTURE_COMPRESSION_HINT = 0x84EF; - public const int GL_TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0; - public const int GL_TEXTURE_COMPRESSED = 0x86A1; - public const int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2; - public const int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3; - public const int GL_MULTISAMPLE = 0x809D; - public const int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E; - public const int GL_SAMPLE_ALPHA_TO_ONE = 0x809F; - public const int GL_SAMPLE_COVERAGE = 0x80A0; - public const int GL_SAMPLE_BUFFERS = 0x80A8; +// public const int GL_CLIENT_ACTIVE_TEXTURE = 0x84E1; +// public const int GL_MAX_TEXTURE_UNITS = 0x84E2; +// public const int GL_NORMAL_MAP = 0x8511; +// public const int GL_REFLECTION_MAP = 0x8512; +// public const int GL_TEXTURE_CUBE_MAP = 0x8513; +// public const int GL_TEXTURE_BINDING_CUBE_MAP = 0x8514; +// public const int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; +// public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; +// public const int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; +// public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; +// public const int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; +// public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; +// public const int GL_PROXY_TEXTURE_CUBE_MAP = 0x851B; +// public const int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; +// public const int GL_COMPRESSED_ALPHA = 0x84E9; +// public const int GL_COMPRESSED_LUMINANCE = 0x84EA; +// public const int GL_COMPRESSED_LUMINANCE_ALPHA = 0x84EB; +// public const int GL_COMPRESSED_INTENSITY = 0x84EC; +// public const int GL_COMPRESSED_RGB = 0x84ED; +// public const int GL_COMPRESSED_RGBA = 0x84EE; +// public const int GL_TEXTURE_COMPRESSION_HINT = 0x84EF; +// public const int GL_TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0; +// public const int GL_TEXTURE_COMPRESSED = 0x86A1; +// public const int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2; +// public const int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3; +// public const int GL_MULTISAMPLE = 0x809D; +// public const int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E; +// public const int GL_SAMPLE_ALPHA_TO_ONE = 0x809F; +// public const int GL_SAMPLE_COVERAGE = 0x80A0; +// public const int GL_SAMPLE_BUFFERS = 0x80A8; public const int GL_SAMPLES = 0x80A9; - public const int GL_SAMPLE_COVERAGE_VALUE = 0x80AA; - public const int GL_SAMPLE_COVERAGE_INVERT = 0x80AB; - public const int GL_MULTISAMPLE_BIT = 0x20000000; - public const int GL_TRANSPOSE_MODELVIEW_MATRIX = 0x84E3; - public const int GL_TRANSPOSE_PROJECTION_MATRIX = 0x84E4; - public const int GL_TRANSPOSE_TEXTURE_MATRIX = 0x84E5; - public const int GL_TRANSPOSE_COLOR_MATRIX = 0x84E6; - public const int GL_COMBINE = 0x8570; - public const int GL_COMBINE_RGB = 0x8571; - public const int GL_COMBINE_ALPHA = 0x8572; - public const int GL_SOURCE0_RGB = 0x8580; - public const int GL_SOURCE1_RGB = 0x8581; - public const int GL_SOURCE2_RGB = 0x8582; - public const int GL_SOURCE0_ALPHA = 0x8588; - public const int GL_SOURCE1_ALPHA = 0x8589; - public const int GL_SOURCE2_ALPHA = 0x858A; - public const int GL_OPERAND0_RGB = 0x8590; - public const int GL_OPERAND1_RGB = 0x8591; - public const int GL_OPERAND2_RGB = 0x8592; - public const int GL_OPERAND0_ALPHA = 0x8598; - public const int GL_OPERAND1_ALPHA = 0x8599; - public const int GL_OPERAND2_ALPHA = 0x859A; - public const int GL_RGB_SCALE = 0x8573; - public const int GL_ADD_SIGNED = 0x8574; - public const int GL_INTERPOLATE = 0x8575; - public const int GL_SUBTRACT = 0x84E7; - public const int GL_CONSTANT = 0x8576; - public const int GL_PRIMARY_COLOR = 0x8577; - public const int GL_PREVIOUS = 0x8578; - public const int GL_DOT3_RGB = 0x86AE; - public const int GL_DOT3_RGBA = 0x86AF; - public const int GL_CLAMP_TO_BORDER = 0x812D; - public const int GL_TEXTURE0_ARB = 0x84C0; - public const int GL_TEXTURE1_ARB = 0x84C1; - public const int GL_TEXTURE2_ARB = 0x84C2; - public const int GL_TEXTURE3_ARB = 0x84C3; - public const int GL_TEXTURE4_ARB = 0x84C4; - public const int GL_TEXTURE5_ARB = 0x84C5; - public const int GL_TEXTURE6_ARB = 0x84C6; - public const int GL_TEXTURE7_ARB = 0x84C7; - public const int GL_TEXTURE8_ARB = 0x84C8; - public const int GL_TEXTURE9_ARB = 0x84C9; - public const int GL_TEXTURE10_ARB = 0x84CA; - public const int GL_TEXTURE11_ARB = 0x84CB; - public const int GL_TEXTURE12_ARB = 0x84CC; - public const int GL_TEXTURE13_ARB = 0x84CD; - public const int GL_TEXTURE14_ARB = 0x84CE; - public const int GL_TEXTURE15_ARB = 0x84CF; - public const int GL_TEXTURE16_ARB = 0x84D0; - public const int GL_TEXTURE17_ARB = 0x84D1; - public const int GL_TEXTURE18_ARB = 0x84D2; - public const int GL_TEXTURE19_ARB = 0x84D3; - public const int GL_TEXTURE20_ARB = 0x84D4; - public const int GL_TEXTURE21_ARB = 0x84D5; - public const int GL_TEXTURE22_ARB = 0x84D6; - public const int GL_TEXTURE23_ARB = 0x84D7; - public const int GL_TEXTURE24_ARB = 0x84D8; - public const int GL_TEXTURE25_ARB = 0x84D9; - public const int GL_TEXTURE26_ARB = 0x84DA; - public const int GL_TEXTURE27_ARB = 0x84DB; - public const int GL_TEXTURE28_ARB = 0x84DC; - public const int GL_TEXTURE29_ARB = 0x84DD; - public const int GL_TEXTURE30_ARB = 0x84DE; - public const int GL_TEXTURE31_ARB = 0x84DF; - public const int GL_ACTIVE_TEXTURE_ARB = 0x84E0; - public const int GL_CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1; - public const int GL_MAX_TEXTURE_UNITS_ARB = 0x84E2; - public const int GL_DEPTH_STENCIL_MESA = 0x8750; - public const int GL_UNSIGNED_INT_24_8_MESA = 0x8751; - public const int GL_UNSIGNED_INT_8_24_REV_MESA = 0x8752; - public const int GL_UNSIGNED_SHORT_15_1_MESA = 0x8753; - public const int GL_UNSIGNED_SHORT_1_15_REV_MESA = 0x8754; - public const int GL_ALPHA_BLEND_EQUATION_ATI = 0x883D; +// public const int GL_SAMPLE_COVERAGE_VALUE = 0x80AA; +// public const int GL_SAMPLE_COVERAGE_INVERT = 0x80AB; +// public const int GL_MULTISAMPLE_BIT = 0x20000000; +// public const int GL_TRANSPOSE_MODELVIEW_MATRIX = 0x84E3; +// public const int GL_TRANSPOSE_PROJECTION_MATRIX = 0x84E4; +// public const int GL_TRANSPOSE_TEXTURE_MATRIX = 0x84E5; +// public const int GL_TRANSPOSE_COLOR_MATRIX = 0x84E6; +// public const int GL_COMBINE = 0x8570; +// public const int GL_COMBINE_RGB = 0x8571; +// public const int GL_COMBINE_ALPHA = 0x8572; +// public const int GL_SOURCE0_RGB = 0x8580; +// public const int GL_SOURCE1_RGB = 0x8581; +// public const int GL_SOURCE2_RGB = 0x8582; +// public const int GL_SOURCE0_ALPHA = 0x8588; +// public const int GL_SOURCE1_ALPHA = 0x8589; +// public const int GL_SOURCE2_ALPHA = 0x858A; +// public const int GL_OPERAND0_RGB = 0x8590; +// public const int GL_OPERAND1_RGB = 0x8591; +// public const int GL_OPERAND2_RGB = 0x8592; +// public const int GL_OPERAND0_ALPHA = 0x8598; +// public const int GL_OPERAND1_ALPHA = 0x8599; +// public const int GL_OPERAND2_ALPHA = 0x859A; +// public const int GL_RGB_SCALE = 0x8573; +// public const int GL_ADD_SIGNED = 0x8574; +// public const int GL_INTERPOLATE = 0x8575; +// public const int GL_SUBTRACT = 0x84E7; +// public const int GL_CONSTANT = 0x8576; +// public const int GL_PRIMARY_COLOR = 0x8577; +// public const int GL_PREVIOUS = 0x8578; +// public const int GL_DOT3_RGB = 0x86AE; +// public const int GL_DOT3_RGBA = 0x86AF; +// public const int GL_CLAMP_TO_BORDER = 0x812D; +// public const int GL_TEXTURE0_ARB = 0x84C0; +// public const int GL_TEXTURE1_ARB = 0x84C1; +// public const int GL_TEXTURE2_ARB = 0x84C2; +// public const int GL_TEXTURE3_ARB = 0x84C3; +// public const int GL_TEXTURE4_ARB = 0x84C4; +// public const int GL_TEXTURE5_ARB = 0x84C5; +// public const int GL_TEXTURE6_ARB = 0x84C6; +// public const int GL_TEXTURE7_ARB = 0x84C7; +// public const int GL_TEXTURE8_ARB = 0x84C8; +// public const int GL_TEXTURE9_ARB = 0x84C9; +// public const int GL_TEXTURE10_ARB = 0x84CA; +// public const int GL_TEXTURE11_ARB = 0x84CB; +// public const int GL_TEXTURE12_ARB = 0x84CC; +// public const int GL_TEXTURE13_ARB = 0x84CD; +// public const int GL_TEXTURE14_ARB = 0x84CE; +// public const int GL_TEXTURE15_ARB = 0x84CF; +// public const int GL_TEXTURE16_ARB = 0x84D0; +// public const int GL_TEXTURE17_ARB = 0x84D1; +// public const int GL_TEXTURE18_ARB = 0x84D2; +// public const int GL_TEXTURE19_ARB = 0x84D3; +// public const int GL_TEXTURE20_ARB = 0x84D4; +// public const int GL_TEXTURE21_ARB = 0x84D5; +// public const int GL_TEXTURE22_ARB = 0x84D6; +// public const int GL_TEXTURE23_ARB = 0x84D7; +// public const int GL_TEXTURE24_ARB = 0x84D8; +// public const int GL_TEXTURE25_ARB = 0x84D9; +// public const int GL_TEXTURE26_ARB = 0x84DA; +// public const int GL_TEXTURE27_ARB = 0x84DB; +// public const int GL_TEXTURE28_ARB = 0x84DC; +// public const int GL_TEXTURE29_ARB = 0x84DD; +// public const int GL_TEXTURE30_ARB = 0x84DE; +// public const int GL_TEXTURE31_ARB = 0x84DF; +// public const int GL_ACTIVE_TEXTURE_ARB = 0x84E0; +// public const int GL_CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1; +// public const int GL_MAX_TEXTURE_UNITS_ARB = 0x84E2; +// public const int GL_DEPTH_STENCIL_MESA = 0x8750; +// public const int GL_UNSIGNED_INT_24_8_MESA = 0x8751; +// public const int GL_UNSIGNED_INT_8_24_REV_MESA = 0x8752; +// public const int GL_UNSIGNED_SHORT_15_1_MESA = 0x8753; +// public const int GL_UNSIGNED_SHORT_1_15_REV_MESA = 0x8754; +// public const int GL_ALPHA_BLEND_EQUATION_ATI = 0x883D; // glext.h - public const int GL_BLEND_DST_RGB = 0x80C8; - public const int GL_BLEND_SRC_RGB = 0x80C9; - public const int GL_BLEND_DST_ALPHA = 0x80CA; - public const int GL_BLEND_SRC_ALPHA = 0x80CB; - public const int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128; +// public const int GL_BLEND_DST_RGB = 0x80C8; +// public const int GL_BLEND_SRC_RGB = 0x80C9; +// public const int GL_BLEND_DST_ALPHA = 0x80CA; +// public const int GL_BLEND_SRC_ALPHA = 0x80CB; +// public const int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128; public const int GL_DEPTH_COMPONENT16 = 0x81A5; - public const int GL_DEPTH_COMPONENT24 = 0x81A6; - public const int GL_DEPTH_COMPONENT32 = 0x81A7; - public const int GL_MIRRORED_REPEAT = 0x8370; - public const int GL_MAX_TEXTURE_LOD_BIAS = 0x84FD; - public const int GL_TEXTURE_LOD_BIAS = 0x8501; - public const int GL_INCR_WRAP = 0x8507; - public const int GL_DECR_WRAP = 0x8508; - public const int GL_TEXTURE_DEPTH_SIZE = 0x884A; - public const int GL_TEXTURE_COMPARE_MODE = 0x884C; - public const int GL_TEXTURE_COMPARE_FUNC = 0x884D; - public const int GL_POINT_SIZE_MIN = 0x8126; - public const int GL_POINT_SIZE_MAX = 0x8127; - public const int GL_POINT_DISTANCE_ATTENUATION = 0x8129; - public const int GL_GENERATE_MIPMAP = 0x8191; - public const int GL_GENERATE_MIPMAP_HINT = 0x8192; - public const int GL_FOG_COORDINATE_SOURCE = 0x8450; - public const int GL_FOG_COORDINATE = 0x8451; - public const int GL_FRAGMENT_DEPTH = 0x8452; - public const int GL_CURRENT_FOG_COORDINATE = 0x8453; - public const int GL_FOG_COORDINATE_ARRAY_TYPE = 0x8454; - public const int GL_FOG_COORDINATE_ARRAY_STRIDE = 0x8455; - public const int GL_FOG_COORDINATE_ARRAY_POINTER = 0x8456; - public const int GL_FOG_COORDINATE_ARRAY = 0x8457; - public const int GL_COLOR_SUM = 0x8458; - public const int GL_CURRENT_SECONDARY_COLOR = 0x8459; - public const int GL_SECONDARY_COLOR_ARRAY_SIZE = 0x845A; - public const int GL_SECONDARY_COLOR_ARRAY_TYPE = 0x845B; - public const int GL_SECONDARY_COLOR_ARRAY_STRIDE = 0x845C; - public const int GL_SECONDARY_COLOR_ARRAY_POINTER = 0x845D; - public const int GL_SECONDARY_COLOR_ARRAY = 0x845E; - public const int GL_TEXTURE_FILTER_CONTROL = 0x8500; - public const int GL_DEPTH_TEXTURE_MODE = 0x884B; - public const int GL_COMPARE_R_TO_TEXTURE = 0x884E; - public const int GL_BUFFER_SIZE = 0x8764; - public const int GL_BUFFER_USAGE = 0x8765; - public const int GL_QUERY_COUNTER_BITS = 0x8864; - public const int GL_CURRENT_QUERY = 0x8865; - public const int GL_QUERY_RESULT = 0x8866; - public const int GL_QUERY_RESULT_AVAILABLE = 0x8867; +// public const int GL_DEPTH_COMPONENT24 = 0x81A6; +// public const int GL_DEPTH_COMPONENT32 = 0x81A7; +// public const int GL_MIRRORED_REPEAT = 0x8370; +// public const int GL_MAX_TEXTURE_LOD_BIAS = 0x84FD; +// public const int GL_TEXTURE_LOD_BIAS = 0x8501; +// public const int GL_INCR_WRAP = 0x8507; +// public const int GL_DECR_WRAP = 0x8508; +// public const int GL_TEXTURE_DEPTH_SIZE = 0x884A; +// public const int GL_TEXTURE_COMPARE_MODE = 0x884C; +// public const int GL_TEXTURE_COMPARE_FUNC = 0x884D; +// public const int GL_POINT_SIZE_MIN = 0x8126; +// public const int GL_POINT_SIZE_MAX = 0x8127; +// public const int GL_POINT_DISTANCE_ATTENUATION = 0x8129; +// public const int GL_GENERATE_MIPMAP = 0x8191; +// public const int GL_GENERATE_MIPMAP_HINT = 0x8192; +// public const int GL_FOG_COORDINATE_SOURCE = 0x8450; +// public const int GL_FOG_COORDINATE = 0x8451; +// public const int GL_FRAGMENT_DEPTH = 0x8452; +// public const int GL_CURRENT_FOG_COORDINATE = 0x8453; +// public const int GL_FOG_COORDINATE_ARRAY_TYPE = 0x8454; +// public const int GL_FOG_COORDINATE_ARRAY_STRIDE = 0x8455; +// public const int GL_FOG_COORDINATE_ARRAY_POINTER = 0x8456; +// public const int GL_FOG_COORDINATE_ARRAY = 0x8457; +// public const int GL_COLOR_SUM = 0x8458; +// public const int GL_CURRENT_SECONDARY_COLOR = 0x8459; +// public const int GL_SECONDARY_COLOR_ARRAY_SIZE = 0x845A; +// public const int GL_SECONDARY_COLOR_ARRAY_TYPE = 0x845B; +// public const int GL_SECONDARY_COLOR_ARRAY_STRIDE = 0x845C; +// public const int GL_SECONDARY_COLOR_ARRAY_POINTER = 0x845D; +// public const int GL_SECONDARY_COLOR_ARRAY = 0x845E; +// public const int GL_TEXTURE_FILTER_CONTROL = 0x8500; +// public const int GL_DEPTH_TEXTURE_MODE = 0x884B; +// public const int GL_COMPARE_R_TO_TEXTURE = 0x884E; +// public const int GL_BUFFER_SIZE = 0x8764; +// public const int GL_BUFFER_USAGE = 0x8765; +// public const int GL_QUERY_COUNTER_BITS = 0x8864; +// public const int GL_CURRENT_QUERY = 0x8865; +// public const int GL_QUERY_RESULT = 0x8866; +// public const int GL_QUERY_RESULT_AVAILABLE = 0x8867; public const int GL_ARRAY_BUFFER = 0x8892; public const int GL_ELEMENT_ARRAY_BUFFER = 0x8893; - public const int GL_ARRAY_BUFFER_BINDING = 0x8894; - public const int GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; - public const int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; - public const int GL_READ_ONLY = 0x88B8; - public const int GL_WRITE_ONLY = 0x88B9; - public const int GL_READ_WRITE = 0x88BA; - public const int GL_BUFFER_ACCESS = 0x88BB; - public const int GL_BUFFER_MAPPED = 0x88BC; - public const int GL_BUFFER_MAP_POINTER = 0x88BD; - public const int GL_STREAM_DRAW = 0x88E0; - public const int GL_STREAM_READ = 0x88E1; - public const int GL_STREAM_COPY = 0x88E2; +// public const int GL_ARRAY_BUFFER_BINDING = 0x8894; +// public const int GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; +// public const int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; +// public const int GL_READ_ONLY = 0x88B8; +// public const int GL_WRITE_ONLY = 0x88B9; +// public const int GL_READ_WRITE = 0x88BA; +// public const int GL_BUFFER_ACCESS = 0x88BB; +// public const int GL_BUFFER_MAPPED = 0x88BC; +// public const int GL_BUFFER_MAP_POINTER = 0x88BD; +// public const int GL_STREAM_DRAW = 0x88E0; +// public const int GL_STREAM_READ = 0x88E1; +// public const int GL_STREAM_COPY = 0x88E2; public const int GL_STATIC_DRAW = 0x88E4; - public const int GL_STATIC_READ = 0x88E5; - public const int GL_STATIC_COPY = 0x88E6; - public const int GL_DYNAMIC_DRAW = 0x88E8; - public const int GL_DYNAMIC_READ = 0x88E9; - public const int GL_DYNAMIC_COPY = 0x88EA; - public const int GL_SAMPLES_PASSED = 0x8914; - public const int GL_SRC1_ALPHA = 0x8589; - public const int GL_VERTEX_ARRAY_BUFFER_BINDING = 0x8896; - public const int GL_NORMAL_ARRAY_BUFFER_BINDING = 0x8897; - public const int GL_COLOR_ARRAY_BUFFER_BINDING = 0x8898; - public const int GL_INDEX_ARRAY_BUFFER_BINDING = 0x8899; - public const int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = 0x889A; - public const int GL_EDGE_FLAG_ARRAY_BUFFER_BINDING = 0x889B; - public const int GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING = 0x889C; - public const int GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING = 0x889D; - public const int GL_WEIGHT_ARRAY_BUFFER_BINDING = 0x889E; - public const int GL_FOG_COORD_SRC = 0x8450; - public const int GL_FOG_COORD = 0x8451; - public const int GL_CURRENT_FOG_COORD = 0x8453; - public const int GL_FOG_COORD_ARRAY_TYPE = 0x8454; - public const int GL_FOG_COORD_ARRAY_STRIDE = 0x8455; - public const int GL_FOG_COORD_ARRAY_POINTER = 0x8456; - public const int GL_FOG_COORD_ARRAY = 0x8457; - public const int GL_FOG_COORD_ARRAY_BUFFER_BINDING = 0x889D; - public const int GL_SRC0_RGB = 0x8580; - public const int GL_SRC1_RGB = 0x8581; - public const int GL_SRC2_RGB = 0x8582; - public const int GL_SRC0_ALPHA = 0x8588; - public const int GL_SRC2_ALPHA = 0x858A; - public const int GL_BLEND_EQUATION_RGB = 0x8009; - public const int GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; - public const int GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; - public const int GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; - public const int GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; - public const int GL_CURRENT_VERTEX_ATTRIB = 0x8626; - public const int GL_VERTEX_PROGRAM_POINT_SIZE = 0x8642; - public const int GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; - public const int GL_STENCIL_BACK_FUNC = 0x8800; - public const int GL_STENCIL_BACK_FAIL = 0x8801; - public const int GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; - public const int GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; - public const int GL_MAX_DRAW_BUFFERS = 0x8824; - public const int GL_DRAW_BUFFER0 = 0x8825; - public const int GL_DRAW_BUFFER1 = 0x8826; - public const int GL_DRAW_BUFFER2 = 0x8827; - public const int GL_DRAW_BUFFER3 = 0x8828; - public const int GL_DRAW_BUFFER4 = 0x8829; - public const int GL_DRAW_BUFFER5 = 0x882A; - public const int GL_DRAW_BUFFER6 = 0x882B; - public const int GL_DRAW_BUFFER7 = 0x882C; - public const int GL_DRAW_BUFFER8 = 0x882D; - public const int GL_DRAW_BUFFER9 = 0x882E; - public const int GL_DRAW_BUFFER10 = 0x882F; - public const int GL_DRAW_BUFFER11 = 0x8830; - public const int GL_DRAW_BUFFER12 = 0x8831; - public const int GL_DRAW_BUFFER13 = 0x8832; - public const int GL_DRAW_BUFFER14 = 0x8833; - public const int GL_DRAW_BUFFER15 = 0x8834; - public const int GL_BLEND_EQUATION_ALPHA = 0x883D; - public const int GL_MAX_VERTEX_ATTRIBS = 0x8869; - public const int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; - public const int GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872; +// public const int GL_STATIC_READ = 0x88E5; +// public const int GL_STATIC_COPY = 0x88E6; +// public const int GL_DYNAMIC_DRAW = 0x88E8; +// public const int GL_DYNAMIC_READ = 0x88E9; +// public const int GL_DYNAMIC_COPY = 0x88EA; +// public const int GL_SAMPLES_PASSED = 0x8914; +// public const int GL_SRC1_ALPHA = 0x8589; +// public const int GL_VERTEX_ARRAY_BUFFER_BINDING = 0x8896; +// public const int GL_NORMAL_ARRAY_BUFFER_BINDING = 0x8897; +// public const int GL_COLOR_ARRAY_BUFFER_BINDING = 0x8898; +// public const int GL_INDEX_ARRAY_BUFFER_BINDING = 0x8899; +// public const int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = 0x889A; +// public const int GL_EDGE_FLAG_ARRAY_BUFFER_BINDING = 0x889B; +// public const int GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING = 0x889C; +// public const int GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING = 0x889D; +// public const int GL_WEIGHT_ARRAY_BUFFER_BINDING = 0x889E; +// public const int GL_FOG_COORD_SRC = 0x8450; +// public const int GL_FOG_COORD = 0x8451; +// public const int GL_CURRENT_FOG_COORD = 0x8453; +// public const int GL_FOG_COORD_ARRAY_TYPE = 0x8454; +// public const int GL_FOG_COORD_ARRAY_STRIDE = 0x8455; +// public const int GL_FOG_COORD_ARRAY_POINTER = 0x8456; +// public const int GL_FOG_COORD_ARRAY = 0x8457; +// public const int GL_FOG_COORD_ARRAY_BUFFER_BINDING = 0x889D; +// public const int GL_SRC0_RGB = 0x8580; +// public const int GL_SRC1_RGB = 0x8581; +// public const int GL_SRC2_RGB = 0x8582; +// public const int GL_SRC0_ALPHA = 0x8588; +// public const int GL_SRC2_ALPHA = 0x858A; +// public const int GL_BLEND_EQUATION_RGB = 0x8009; +// public const int GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; +// public const int GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; +// public const int GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; +// public const int GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; +// public const int GL_CURRENT_VERTEX_ATTRIB = 0x8626; +// public const int GL_VERTEX_PROGRAM_POINT_SIZE = 0x8642; +// public const int GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; +// public const int GL_STENCIL_BACK_FUNC = 0x8800; +// public const int GL_STENCIL_BACK_FAIL = 0x8801; +// public const int GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; +// public const int GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; +// public const int GL_MAX_DRAW_BUFFERS = 0x8824; +// public const int GL_DRAW_BUFFER0 = 0x8825; +// public const int GL_DRAW_BUFFER1 = 0x8826; +// public const int GL_DRAW_BUFFER2 = 0x8827; +// public const int GL_DRAW_BUFFER3 = 0x8828; +// public const int GL_DRAW_BUFFER4 = 0x8829; +// public const int GL_DRAW_BUFFER5 = 0x882A; +// public const int GL_DRAW_BUFFER6 = 0x882B; +// public const int GL_DRAW_BUFFER7 = 0x882C; +// public const int GL_DRAW_BUFFER8 = 0x882D; +// public const int GL_DRAW_BUFFER9 = 0x882E; +// public const int GL_DRAW_BUFFER10 = 0x882F; +// public const int GL_DRAW_BUFFER11 = 0x8830; +// public const int GL_DRAW_BUFFER12 = 0x8831; +// public const int GL_DRAW_BUFFER13 = 0x8832; +// public const int GL_DRAW_BUFFER14 = 0x8833; +// public const int GL_DRAW_BUFFER15 = 0x8834; +// public const int GL_BLEND_EQUATION_ALPHA = 0x883D; +// public const int GL_MAX_VERTEX_ATTRIBS = 0x8869; +// public const int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; +// public const int GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872; public const int GL_FRAGMENT_SHADER = 0x8B30; public const int GL_VERTEX_SHADER = 0x8B31; - public const int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49; - public const int GL_MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A; - public const int GL_MAX_VARYING_FLOATS = 0x8B4B; - public const int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; - public const int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; - public const int GL_SHADER_TYPE = 0x8B4F; - public const int GL_FLOAT_VEC2 = 0x8B50; - public const int GL_FLOAT_VEC3 = 0x8B51; - public const int GL_FLOAT_VEC4 = 0x8B52; - public const int GL_INT_VEC2 = 0x8B53; - public const int GL_INT_VEC3 = 0x8B54; - public const int GL_INT_VEC4 = 0x8B55; - public const int GL_BOOL = 0x8B56; - public const int GL_BOOL_VEC2 = 0x8B57; - public const int GL_BOOL_VEC3 = 0x8B58; - public const int GL_BOOL_VEC4 = 0x8B59; - public const int GL_FLOAT_MAT2 = 0x8B5A; - public const int GL_FLOAT_MAT3 = 0x8B5B; - public const int GL_FLOAT_MAT4 = 0x8B5C; - public const int GL_SAMPLER_1D = 0x8B5D; - public const int GL_SAMPLER_2D = 0x8B5E; - public const int GL_SAMPLER_3D = 0x8B5F; - public const int GL_SAMPLER_CUBE = 0x8B60; - public const int GL_SAMPLER_1D_SHADOW = 0x8B61; - public const int GL_SAMPLER_2D_SHADOW = 0x8B62; - public const int GL_DELETE_STATUS = 0x8B80; +// public const int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49; +// public const int GL_MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A; +// public const int GL_MAX_VARYING_FLOATS = 0x8B4B; +// public const int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; +// public const int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; +// public const int GL_SHADER_TYPE = 0x8B4F; +// public const int GL_FLOAT_VEC2 = 0x8B50; +// public const int GL_FLOAT_VEC3 = 0x8B51; +// public const int GL_FLOAT_VEC4 = 0x8B52; +// public const int GL_INT_VEC2 = 0x8B53; +// public const int GL_INT_VEC3 = 0x8B54; +// public const int GL_INT_VEC4 = 0x8B55; +// public const int GL_BOOL = 0x8B56; +// public const int GL_BOOL_VEC2 = 0x8B57; +// public const int GL_BOOL_VEC3 = 0x8B58; +// public const int GL_BOOL_VEC4 = 0x8B59; +// public const int GL_FLOAT_MAT2 = 0x8B5A; +// public const int GL_FLOAT_MAT3 = 0x8B5B; +// public const int GL_FLOAT_MAT4 = 0x8B5C; +// public const int GL_SAMPLER_1D = 0x8B5D; +// public const int GL_SAMPLER_2D = 0x8B5E; +// public const int GL_SAMPLER_3D = 0x8B5F; +// public const int GL_SAMPLER_CUBE = 0x8B60; +// public const int GL_SAMPLER_1D_SHADOW = 0x8B61; +// public const int GL_SAMPLER_2D_SHADOW = 0x8B62; +// public const int GL_DELETE_STATUS = 0x8B80; public const int GL_COMPILE_STATUS = 0x8B81; public const int GL_LINK_STATUS = 0x8B82; - public const int GL_VALIDATE_STATUS = 0x8B83; +// public const int GL_VALIDATE_STATUS = 0x8B83; public const int GL_INFO_LOG_LENGTH = 0x8B84; - public const int GL_ATTACHED_SHADERS = 0x8B85; - public const int GL_ACTIVE_UNIFORMS = 0x8B86; - public const int GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87; - public const int GL_SHADER_SOURCE_LENGTH = 0x8B88; - public const int GL_ACTIVE_ATTRIBUTES = 0x8B89; - public const int GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A; - public const int GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B; - public const int GL_SHADING_LANGUAGE_VERSION = 0x8B8C; - public const int GL_CURRENT_PROGRAM = 0x8B8D; - public const int GL_POINT_SPRITE_COORD_ORIGIN = 0x8CA0; - public const int GL_LOWER_LEFT = 0x8CA1; - public const int GL_UPPER_LEFT = 0x8CA2; - public const int GL_STENCIL_BACK_REF = 0x8CA3; - public const int GL_STENCIL_BACK_VALUE_MASK = 0x8CA4; - public const int GL_STENCIL_BACK_WRITEMASK = 0x8CA5; - public const int GL_VERTEX_PROGRAM_TWO_SIDE = 0x8643; - public const int GL_POINT_SPRITE = 0x8861; - public const int GL_COORD_REPLACE = 0x8862; - public const int GL_MAX_TEXTURE_COORDS = 0x8871; - public const int GL_VERSION_2_1 = 1; - public const int GL_PIXEL_PACK_BUFFER = 0x88EB; - public const int GL_PIXEL_UNPACK_BUFFER = 0x88EC; - public const int GL_PIXEL_PACK_BUFFER_BINDING = 0x88ED; - public const int GL_PIXEL_UNPACK_BUFFER_BINDING = 0x88EF; - public const int GL_FLOAT_MAT2x3 = 0x8B65; - public const int GL_FLOAT_MAT2x4 = 0x8B66; - public const int GL_FLOAT_MAT3x2 = 0x8B67; - public const int GL_FLOAT_MAT3x4 = 0x8B68; - public const int GL_FLOAT_MAT4x2 = 0x8B69; - public const int GL_FLOAT_MAT4x3 = 0x8B6A; - public const int GL_SRGB = 0x8C40; - public const int GL_SRGB8 = 0x8C41; - public const int GL_SRGB_ALPHA = 0x8C42; - public const int GL_SRGB8_ALPHA8 = 0x8C43; - public const int GL_COMPRESSED_SRGB = 0x8C48; - public const int GL_COMPRESSED_SRGB_ALPHA = 0x8C49; - public const int GL_CURRENT_RASTER_SECONDARY_COLOR = 0x845F; - public const int GL_SLUMINANCE_ALPHA = 0x8C44; - public const int GL_SLUMINANCE8_ALPHA8 = 0x8C45; - public const int GL_SLUMINANCE = 0x8C46; - public const int GL_SLUMINANCE8 = 0x8C47; - public const int GL_COMPRESSED_SLUMINANCE = 0x8C4A; - public const int GL_COMPRESSED_SLUMINANCE_ALPHA = 0x8C4B; - public const int GL_VERSION_3_0 = 1; - public const int GL_COMPARE_REF_TO_TEXTURE = 0x884E; - public const int GL_CLIP_DISTANCE0 = 0x3000; - public const int GL_CLIP_DISTANCE1 = 0x3001; - public const int GL_CLIP_DISTANCE2 = 0x3002; - public const int GL_CLIP_DISTANCE3 = 0x3003; - public const int GL_CLIP_DISTANCE4 = 0x3004; - public const int GL_CLIP_DISTANCE5 = 0x3005; - public const int GL_CLIP_DISTANCE6 = 0x3006; - public const int GL_CLIP_DISTANCE7 = 0x3007; - public const int GL_MAX_CLIP_DISTANCES = 0x0D32; +// public const int GL_ATTACHED_SHADERS = 0x8B85; +// public const int GL_ACTIVE_UNIFORMS = 0x8B86; +// public const int GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87; +// public const int GL_SHADER_SOURCE_LENGTH = 0x8B88; +// public const int GL_ACTIVE_ATTRIBUTES = 0x8B89; +// public const int GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A; +// public const int GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B; +// public const int GL_SHADING_LANGUAGE_VERSION = 0x8B8C; +// public const int GL_CURRENT_PROGRAM = 0x8B8D; +// public const int GL_POINT_SPRITE_COORD_ORIGIN = 0x8CA0; +// public const int GL_LOWER_LEFT = 0x8CA1; +// public const int GL_UPPER_LEFT = 0x8CA2; +// public const int GL_STENCIL_BACK_REF = 0x8CA3; +// public const int GL_STENCIL_BACK_VALUE_MASK = 0x8CA4; +// public const int GL_STENCIL_BACK_WRITEMASK = 0x8CA5; +// public const int GL_VERTEX_PROGRAM_TWO_SIDE = 0x8643; +// public const int GL_POINT_SPRITE = 0x8861; +// public const int GL_COORD_REPLACE = 0x8862; +// public const int GL_MAX_TEXTURE_COORDS = 0x8871; +// public const int GL_VERSION_2_1 = 1; +// public const int GL_PIXEL_PACK_BUFFER = 0x88EB; +// public const int GL_PIXEL_UNPACK_BUFFER = 0x88EC; +// public const int GL_PIXEL_PACK_BUFFER_BINDING = 0x88ED; +// public const int GL_PIXEL_UNPACK_BUFFER_BINDING = 0x88EF; +// public const int GL_FLOAT_MAT2x3 = 0x8B65; +// public const int GL_FLOAT_MAT2x4 = 0x8B66; +// public const int GL_FLOAT_MAT3x2 = 0x8B67; +// public const int GL_FLOAT_MAT3x4 = 0x8B68; +// public const int GL_FLOAT_MAT4x2 = 0x8B69; +// public const int GL_FLOAT_MAT4x3 = 0x8B6A; +// public const int GL_SRGB = 0x8C40; +// public const int GL_SRGB8 = 0x8C41; +// public const int GL_SRGB_ALPHA = 0x8C42; +// public const int GL_SRGB8_ALPHA8 = 0x8C43; +// public const int GL_COMPRESSED_SRGB = 0x8C48; +// public const int GL_COMPRESSED_SRGB_ALPHA = 0x8C49; +// public const int GL_CURRENT_RASTER_SECONDARY_COLOR = 0x845F; +// public const int GL_SLUMINANCE_ALPHA = 0x8C44; +// public const int GL_SLUMINANCE8_ALPHA8 = 0x8C45; +// public const int GL_SLUMINANCE = 0x8C46; +// public const int GL_SLUMINANCE8 = 0x8C47; +// public const int GL_COMPRESSED_SLUMINANCE = 0x8C4A; +// public const int GL_COMPRESSED_SLUMINANCE_ALPHA = 0x8C4B; +// public const int GL_VERSION_3_0 = 1; +// public const int GL_COMPARE_REF_TO_TEXTURE = 0x884E; +// public const int GL_CLIP_DISTANCE0 = 0x3000; +// public const int GL_CLIP_DISTANCE1 = 0x3001; +// public const int GL_CLIP_DISTANCE2 = 0x3002; +// public const int GL_CLIP_DISTANCE3 = 0x3003; +// public const int GL_CLIP_DISTANCE4 = 0x3004; +// public const int GL_CLIP_DISTANCE5 = 0x3005; +// public const int GL_CLIP_DISTANCE6 = 0x3006; +// public const int GL_CLIP_DISTANCE7 = 0x3007; +// public const int GL_MAX_CLIP_DISTANCES = 0x0D32; public const int GL_MAJOR_VERSION = 0x821B; public const int GL_MINOR_VERSION = 0x821C; public const int GL_NUM_EXTENSIONS = 0x821D; - public const int GL_CONTEXT_FLAGS = 0x821E; - public const int GL_COMPRESSED_RED = 0x8225; - public const int GL_COMPRESSED_RG = 0x8226; - public const int GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x00000001; - public const int GL_RGBA32F = 0x8814; - public const int GL_RGB32F = 0x8815; - public const int GL_RGBA16F = 0x881A; - public const int GL_RGB16F = 0x881B; - public const int GL_VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD; - public const int GL_MAX_ARRAY_TEXTURE_LAYERS = 0x88FF; - public const int GL_MIN_PROGRAM_TEXEL_OFFSET = 0x8904; - public const int GL_MAX_PROGRAM_TEXEL_OFFSET = 0x8905; - public const int GL_CLAMP_READ_COLOR = 0x891C; - public const int GL_FIXED_ONLY = 0x891D; - public const int GL_MAX_VARYING_COMPONENTS = 0x8B4B; - public const int GL_TEXTURE_1D_ARRAY = 0x8C18; - public const int GL_PROXY_TEXTURE_1D_ARRAY = 0x8C19; - public const int GL_TEXTURE_2D_ARRAY = 0x8C1A; - public const int GL_PROXY_TEXTURE_2D_ARRAY = 0x8C1B; - public const int GL_TEXTURE_BINDING_1D_ARRAY = 0x8C1C; - public const int GL_TEXTURE_BINDING_2D_ARRAY = 0x8C1D; - public const int GL_R11F_G11F_B10F = 0x8C3A; - public const int GL_UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B; - public const int GL_RGB9_E5 = 0x8C3D; - public const int GL_UNSIGNED_INT_5_9_9_9_REV = 0x8C3E; - public const int GL_TEXTURE_SHARED_SIZE = 0x8C3F; - public const int GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F; - public const int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80; - public const int GL_TRANSFORM_FEEDBACK_VARYINGS = 0x8C83; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85; - public const int GL_PRIMITIVES_GENERATED = 0x8C87; - public const int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88; - public const int GL_RASTERIZER_DISCARD = 0x8C89; - public const int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A; - public const int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B; - public const int GL_INTERLEAVED_ATTRIBS = 0x8C8C; - public const int GL_SEPARATE_ATTRIBS = 0x8C8D; - public const int GL_TRANSFORM_FEEDBACK_BUFFER = 0x8C8E; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F; - public const int GL_RGBA32UI = 0x8D70; - public const int GL_RGB32UI = 0x8D71; - public const int GL_RGBA16UI = 0x8D76; - public const int GL_RGB16UI = 0x8D77; - public const int GL_RGBA8UI = 0x8D7C; - public const int GL_RGB8UI = 0x8D7D; - public const int GL_RGBA32I = 0x8D82; - public const int GL_RGB32I = 0x8D83; - public const int GL_RGBA16I = 0x8D88; - public const int GL_RGB16I = 0x8D89; - public const int GL_RGBA8I = 0x8D8E; - public const int GL_RGB8I = 0x8D8F; - public const int GL_RED_INTEGER = 0x8D94; - public const int GL_GREEN_INTEGER = 0x8D95; - public const int GL_BLUE_INTEGER = 0x8D96; - public const int GL_RGB_INTEGER = 0x8D98; - public const int GL_RGBA_INTEGER = 0x8D99; - public const int GL_BGR_INTEGER = 0x8D9A; - public const int GL_BGRA_INTEGER = 0x8D9B; - public const int GL_SAMPLER_1D_ARRAY = 0x8DC0; - public const int GL_SAMPLER_2D_ARRAY = 0x8DC1; - public const int GL_SAMPLER_1D_ARRAY_SHADOW = 0x8DC3; - public const int GL_SAMPLER_2D_ARRAY_SHADOW = 0x8DC4; - public const int GL_SAMPLER_CUBE_SHADOW = 0x8DC5; - public const int GL_UNSIGNED_INT_VEC2 = 0x8DC6; - public const int GL_UNSIGNED_INT_VEC3 = 0x8DC7; - public const int GL_UNSIGNED_INT_VEC4 = 0x8DC8; - public const int GL_INT_SAMPLER_1D = 0x8DC9; - public const int GL_INT_SAMPLER_2D = 0x8DCA; - public const int GL_INT_SAMPLER_3D = 0x8DCB; - public const int GL_INT_SAMPLER_CUBE = 0x8DCC; - public const int GL_INT_SAMPLER_1D_ARRAY = 0x8DCE; - public const int GL_INT_SAMPLER_2D_ARRAY = 0x8DCF; - public const int GL_UNSIGNED_INT_SAMPLER_1D = 0x8DD1; - public const int GL_UNSIGNED_INT_SAMPLER_2D = 0x8DD2; - public const int GL_UNSIGNED_INT_SAMPLER_3D = 0x8DD3; - public const int GL_UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4; - public const int GL_UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6; - public const int GL_UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7; - public const int GL_QUERY_WAIT = 0x8E13; - public const int GL_QUERY_NO_WAIT = 0x8E14; - public const int GL_QUERY_BY_REGION_WAIT = 0x8E15; - public const int GL_QUERY_BY_REGION_NO_WAIT = 0x8E16; - public const int GL_BUFFER_ACCESS_FLAGS = 0x911F; - public const int GL_BUFFER_MAP_LENGTH = 0x9120; - public const int GL_BUFFER_MAP_OFFSET = 0x9121; - public const int GL_DEPTH_COMPONENT32F = 0x8CAC; - public const int GL_DEPTH32F_STENCIL8 = 0x8CAD; - public const int GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD; - public const int GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210; - public const int GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211; - public const int GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212; - public const int GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213; - public const int GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214; - public const int GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215; - public const int GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216; - public const int GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217; - public const int GL_FRAMEBUFFER_DEFAULT = 0x8218; - public const int GL_FRAMEBUFFER_UNDEFINED = 0x8219; - public const int GL_DEPTH_STENCIL_ATTACHMENT = 0x821A; - public const int GL_MAX_RENDERBUFFER_SIZE = 0x84E8; +// public const int GL_CONTEXT_FLAGS = 0x821E; +// public const int GL_COMPRESSED_RED = 0x8225; +// public const int GL_COMPRESSED_RG = 0x8226; +// public const int GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x00000001; +// public const int GL_RGBA32F = 0x8814; +// public const int GL_RGB32F = 0x8815; +// public const int GL_RGBA16F = 0x881A; +// public const int GL_RGB16F = 0x881B; +// public const int GL_VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD; +// public const int GL_MAX_ARRAY_TEXTURE_LAYERS = 0x88FF; +// public const int GL_MIN_PROGRAM_TEXEL_OFFSET = 0x8904; +// public const int GL_MAX_PROGRAM_TEXEL_OFFSET = 0x8905; +// public const int GL_CLAMP_READ_COLOR = 0x891C; +// public const int GL_FIXED_ONLY = 0x891D; +// public const int GL_MAX_VARYING_COMPONENTS = 0x8B4B; +// public const int GL_TEXTURE_1D_ARRAY = 0x8C18; +// public const int GL_PROXY_TEXTURE_1D_ARRAY = 0x8C19; +// public const int GL_TEXTURE_2D_ARRAY = 0x8C1A; +// public const int GL_PROXY_TEXTURE_2D_ARRAY = 0x8C1B; +// public const int GL_TEXTURE_BINDING_1D_ARRAY = 0x8C1C; +// public const int GL_TEXTURE_BINDING_2D_ARRAY = 0x8C1D; +// public const int GL_R11F_G11F_B10F = 0x8C3A; +// public const int GL_UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B; +// public const int GL_RGB9_E5 = 0x8C3D; +// public const int GL_UNSIGNED_INT_5_9_9_9_REV = 0x8C3E; +// public const int GL_TEXTURE_SHARED_SIZE = 0x8C3F; +// public const int GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F; +// public const int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80; +// public const int GL_TRANSFORM_FEEDBACK_VARYINGS = 0x8C83; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85; +// public const int GL_PRIMITIVES_GENERATED = 0x8C87; +// public const int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88; +// public const int GL_RASTERIZER_DISCARD = 0x8C89; +// public const int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A; +// public const int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B; +// public const int GL_INTERLEAVED_ATTRIBS = 0x8C8C; +// public const int GL_SEPARATE_ATTRIBS = 0x8C8D; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER = 0x8C8E; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F; +// public const int GL_RGBA32UI = 0x8D70; +// public const int GL_RGB32UI = 0x8D71; +// public const int GL_RGBA16UI = 0x8D76; +// public const int GL_RGB16UI = 0x8D77; +// public const int GL_RGBA8UI = 0x8D7C; +// public const int GL_RGB8UI = 0x8D7D; +// public const int GL_RGBA32I = 0x8D82; +// public const int GL_RGB32I = 0x8D83; +// public const int GL_RGBA16I = 0x8D88; +// public const int GL_RGB16I = 0x8D89; +// public const int GL_RGBA8I = 0x8D8E; +// public const int GL_RGB8I = 0x8D8F; +// public const int GL_RED_INTEGER = 0x8D94; +// public const int GL_GREEN_INTEGER = 0x8D95; +// public const int GL_BLUE_INTEGER = 0x8D96; +// public const int GL_RGB_INTEGER = 0x8D98; +// public const int GL_RGBA_INTEGER = 0x8D99; +// public const int GL_BGR_INTEGER = 0x8D9A; +// public const int GL_BGRA_INTEGER = 0x8D9B; +// public const int GL_SAMPLER_1D_ARRAY = 0x8DC0; +// public const int GL_SAMPLER_2D_ARRAY = 0x8DC1; +// public const int GL_SAMPLER_1D_ARRAY_SHADOW = 0x8DC3; +// public const int GL_SAMPLER_2D_ARRAY_SHADOW = 0x8DC4; +// public const int GL_SAMPLER_CUBE_SHADOW = 0x8DC5; +// public const int GL_UNSIGNED_INT_VEC2 = 0x8DC6; +// public const int GL_UNSIGNED_INT_VEC3 = 0x8DC7; +// public const int GL_UNSIGNED_INT_VEC4 = 0x8DC8; +// public const int GL_INT_SAMPLER_1D = 0x8DC9; +// public const int GL_INT_SAMPLER_2D = 0x8DCA; +// public const int GL_INT_SAMPLER_3D = 0x8DCB; +// public const int GL_INT_SAMPLER_CUBE = 0x8DCC; +// public const int GL_INT_SAMPLER_1D_ARRAY = 0x8DCE; +// public const int GL_INT_SAMPLER_2D_ARRAY = 0x8DCF; +// public const int GL_UNSIGNED_INT_SAMPLER_1D = 0x8DD1; +// public const int GL_UNSIGNED_INT_SAMPLER_2D = 0x8DD2; +// public const int GL_UNSIGNED_INT_SAMPLER_3D = 0x8DD3; +// public const int GL_UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4; +// public const int GL_UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6; +// public const int GL_UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7; +// public const int GL_QUERY_WAIT = 0x8E13; +// public const int GL_QUERY_NO_WAIT = 0x8E14; +// public const int GL_QUERY_BY_REGION_WAIT = 0x8E15; +// public const int GL_QUERY_BY_REGION_NO_WAIT = 0x8E16; +// public const int GL_BUFFER_ACCESS_FLAGS = 0x911F; +// public const int GL_BUFFER_MAP_LENGTH = 0x9120; +// public const int GL_BUFFER_MAP_OFFSET = 0x9121; +// public const int GL_DEPTH_COMPONENT32F = 0x8CAC; +// public const int GL_DEPTH32F_STENCIL8 = 0x8CAD; +// public const int GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD; +// public const int GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210; +// public const int GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211; +// public const int GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212; +// public const int GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213; +// public const int GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214; +// public const int GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215; +// public const int GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216; +// public const int GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217; +// public const int GL_FRAMEBUFFER_DEFAULT = 0x8218; +// public const int GL_FRAMEBUFFER_UNDEFINED = 0x8219; +// public const int GL_DEPTH_STENCIL_ATTACHMENT = 0x821A; +// public const int GL_MAX_RENDERBUFFER_SIZE = 0x84E8; public const int GL_DEPTH_STENCIL = 0x84F9; - public const int GL_UNSIGNED_INT_24_8 = 0x84FA; +// public const int GL_UNSIGNED_INT_24_8 = 0x84FA; public const int GL_DEPTH24_STENCIL8 = 0x88F0; - public const int GL_TEXTURE_STENCIL_SIZE = 0x88F1; - public const int GL_TEXTURE_RED_TYPE = 0x8C10; - public const int GL_TEXTURE_GREEN_TYPE = 0x8C11; - public const int GL_TEXTURE_BLUE_TYPE = 0x8C12; - public const int GL_TEXTURE_ALPHA_TYPE = 0x8C13; - public const int GL_TEXTURE_DEPTH_TYPE = 0x8C16; - public const int GL_UNSIGNED_NORMALIZED = 0x8C17; +// public const int GL_TEXTURE_STENCIL_SIZE = 0x88F1; +// public const int GL_TEXTURE_RED_TYPE = 0x8C10; +// public const int GL_TEXTURE_GREEN_TYPE = 0x8C11; +// public const int GL_TEXTURE_BLUE_TYPE = 0x8C12; +// public const int GL_TEXTURE_ALPHA_TYPE = 0x8C13; +// public const int GL_TEXTURE_DEPTH_TYPE = 0x8C16; +// public const int GL_UNSIGNED_NORMALIZED = 0x8C17; public const int GL_FRAMEBUFFER_BINDING = 0x8CA6; - public const int GL_DRAW_FRAMEBUFFER_BINDING = 0x8CA6; +// public const int GL_DRAW_FRAMEBUFFER_BINDING = 0x8CA6; public const int GL_RENDERBUFFER_BINDING = 0x8CA7; public const int GL_READ_FRAMEBUFFER = 0x8CA8; public const int GL_DRAW_FRAMEBUFFER = 0x8CA9; public const int GL_READ_FRAMEBUFFER_BINDING = 0x8CAA; - public const int GL_RENDERBUFFER_SAMPLES = 0x8CAB; - public const int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0; - public const int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1; - public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2; - public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3; - public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4; +// public const int GL_RENDERBUFFER_SAMPLES = 0x8CAB; +// public const int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0; +// public const int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1; +// public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2; +// public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3; +// public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4; public const int GL_FRAMEBUFFER_COMPLETE = 0x8CD5; - public const int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; - public const int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; - public const int GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB; - public const int GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC; - public const int GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD; - public const int GL_MAX_COLOR_ATTACHMENTS = 0x8CDF; +// public const int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; +// public const int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; +// public const int GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB; +// public const int GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC; +// public const int GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD; +// public const int GL_MAX_COLOR_ATTACHMENTS = 0x8CDF; public const int GL_COLOR_ATTACHMENT0 = 0x8CE0; - public const int GL_COLOR_ATTACHMENT1 = 0x8CE1; - public const int GL_COLOR_ATTACHMENT2 = 0x8CE2; - public const int GL_COLOR_ATTACHMENT3 = 0x8CE3; - public const int GL_COLOR_ATTACHMENT4 = 0x8CE4; - public const int GL_COLOR_ATTACHMENT5 = 0x8CE5; - public const int GL_COLOR_ATTACHMENT6 = 0x8CE6; - public const int GL_COLOR_ATTACHMENT7 = 0x8CE7; - public const int GL_COLOR_ATTACHMENT8 = 0x8CE8; - public const int GL_COLOR_ATTACHMENT9 = 0x8CE9; - public const int GL_COLOR_ATTACHMENT10 = 0x8CEA; - public const int GL_COLOR_ATTACHMENT11 = 0x8CEB; - public const int GL_COLOR_ATTACHMENT12 = 0x8CEC; - public const int GL_COLOR_ATTACHMENT13 = 0x8CED; - public const int GL_COLOR_ATTACHMENT14 = 0x8CEE; - public const int GL_COLOR_ATTACHMENT15 = 0x8CEF; - public const int GL_COLOR_ATTACHMENT16 = 0x8CF0; - public const int GL_COLOR_ATTACHMENT17 = 0x8CF1; - public const int GL_COLOR_ATTACHMENT18 = 0x8CF2; - public const int GL_COLOR_ATTACHMENT19 = 0x8CF3; - public const int GL_COLOR_ATTACHMENT20 = 0x8CF4; - public const int GL_COLOR_ATTACHMENT21 = 0x8CF5; - public const int GL_COLOR_ATTACHMENT22 = 0x8CF6; - public const int GL_COLOR_ATTACHMENT23 = 0x8CF7; - public const int GL_COLOR_ATTACHMENT24 = 0x8CF8; - public const int GL_COLOR_ATTACHMENT25 = 0x8CF9; - public const int GL_COLOR_ATTACHMENT26 = 0x8CFA; - public const int GL_COLOR_ATTACHMENT27 = 0x8CFB; - public const int GL_COLOR_ATTACHMENT28 = 0x8CFC; - public const int GL_COLOR_ATTACHMENT29 = 0x8CFD; - public const int GL_COLOR_ATTACHMENT30 = 0x8CFE; - public const int GL_COLOR_ATTACHMENT31 = 0x8CFF; +// public const int GL_COLOR_ATTACHMENT1 = 0x8CE1; +// public const int GL_COLOR_ATTACHMENT2 = 0x8CE2; +// public const int GL_COLOR_ATTACHMENT3 = 0x8CE3; +// public const int GL_COLOR_ATTACHMENT4 = 0x8CE4; +// public const int GL_COLOR_ATTACHMENT5 = 0x8CE5; +// public const int GL_COLOR_ATTACHMENT6 = 0x8CE6; +// public const int GL_COLOR_ATTACHMENT7 = 0x8CE7; +// public const int GL_COLOR_ATTACHMENT8 = 0x8CE8; +// public const int GL_COLOR_ATTACHMENT9 = 0x8CE9; +// public const int GL_COLOR_ATTACHMENT10 = 0x8CEA; +// public const int GL_COLOR_ATTACHMENT11 = 0x8CEB; +// public const int GL_COLOR_ATTACHMENT12 = 0x8CEC; +// public const int GL_COLOR_ATTACHMENT13 = 0x8CED; +// public const int GL_COLOR_ATTACHMENT14 = 0x8CEE; +// public const int GL_COLOR_ATTACHMENT15 = 0x8CEF; +// public const int GL_COLOR_ATTACHMENT16 = 0x8CF0; +// public const int GL_COLOR_ATTACHMENT17 = 0x8CF1; +// public const int GL_COLOR_ATTACHMENT18 = 0x8CF2; +// public const int GL_COLOR_ATTACHMENT19 = 0x8CF3; +// public const int GL_COLOR_ATTACHMENT20 = 0x8CF4; +// public const int GL_COLOR_ATTACHMENT21 = 0x8CF5; +// public const int GL_COLOR_ATTACHMENT22 = 0x8CF6; +// public const int GL_COLOR_ATTACHMENT23 = 0x8CF7; +// public const int GL_COLOR_ATTACHMENT24 = 0x8CF8; +// public const int GL_COLOR_ATTACHMENT25 = 0x8CF9; +// public const int GL_COLOR_ATTACHMENT26 = 0x8CFA; +// public const int GL_COLOR_ATTACHMENT27 = 0x8CFB; +// public const int GL_COLOR_ATTACHMENT28 = 0x8CFC; +// public const int GL_COLOR_ATTACHMENT29 = 0x8CFD; +// public const int GL_COLOR_ATTACHMENT30 = 0x8CFE; +// public const int GL_COLOR_ATTACHMENT31 = 0x8CFF; public const int GL_DEPTH_ATTACHMENT = 0x8D00; public const int GL_STENCIL_ATTACHMENT = 0x8D20; public const int GL_FRAMEBUFFER = 0x8D40; public const int GL_RENDERBUFFER = 0x8D41; public const int GL_RENDERBUFFER_WIDTH = 0x8D42; public const int GL_RENDERBUFFER_HEIGHT = 0x8D43; - public const int GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44; - public const int GL_STENCIL_INDEX1 = 0x8D46; - public const int GL_STENCIL_INDEX4 = 0x8D47; +// public const int GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44; +// public const int GL_STENCIL_INDEX1 = 0x8D46; +// public const int GL_STENCIL_INDEX4 = 0x8D47; public const int GL_STENCIL_INDEX8 = 0x8D48; - public const int GL_STENCIL_INDEX16 = 0x8D49; - public const int GL_RENDERBUFFER_RED_SIZE = 0x8D50; - public const int GL_RENDERBUFFER_GREEN_SIZE = 0x8D51; - public const int GL_RENDERBUFFER_BLUE_SIZE = 0x8D52; - public const int GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53; - public const int GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54; - public const int GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55; - public const int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56; - public const int GL_MAX_SAMPLES = 0x8D57; - public const int GL_INDEX = 0x8222; - public const int GL_TEXTURE_LUMINANCE_TYPE = 0x8C14; - public const int GL_TEXTURE_INTENSITY_TYPE = 0x8C15; - public const int GL_FRAMEBUFFER_SRGB = 0x8DB9; - public const int GL_HALF_FLOAT = 0x140B; - public const int GL_MAP_READ_BIT = 0x0001; - public const int GL_MAP_WRITE_BIT = 0x0002; - public const int GL_MAP_INVALIDATE_RANGE_BIT = 0x0004; - public const int GL_MAP_INVALIDATE_BUFFER_BIT = 0x0008; - public const int GL_MAP_FLUSH_EXPLICIT_BIT = 0x0010; - public const int GL_MAP_UNSYNCHRONIZED_BIT = 0x0020; - public const int GL_COMPRESSED_RED_RGTC1 = 0x8DBB; - public const int GL_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC; - public const int GL_COMPRESSED_RG_RGTC2 = 0x8DBD; - public const int GL_COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE; - public const int GL_RG = 0x8227; - public const int GL_RG_INTEGER = 0x8228; - public const int GL_R8 = 0x8229; - public const int GL_R16 = 0x822A; - public const int GL_RG8 = 0x822B; - public const int GL_RG16 = 0x822C; - public const int GL_R16F = 0x822D; - public const int GL_R32F = 0x822E; - public const int GL_RG16F = 0x822F; - public const int GL_RG32F = 0x8230; - public const int GL_R8I = 0x8231; - public const int GL_R8UI = 0x8232; - public const int GL_R16I = 0x8233; - public const int GL_R16UI = 0x8234; - public const int GL_R32I = 0x8235; - public const int GL_R32UI = 0x8236; - public const int GL_RG8I = 0x8237; - public const int GL_RG8UI = 0x8238; - public const int GL_RG16I = 0x8239; - public const int GL_RG16UI = 0x823A; - public const int GL_RG32I = 0x823B; - public const int GL_RG32UI = 0x823C; - public const int GL_VERTEX_ARRAY_BINDING = 0x85B5; - public const int GL_CLAMP_VERTEX_COLOR = 0x891A; - public const int GL_CLAMP_FRAGMENT_COLOR = 0x891B; - public const int GL_ALPHA_INTEGER = 0x8D97; - public const int GL_VERSION_3_1 = 1; - public const int GL_SAMPLER_2D_RECT = 0x8B63; - public const int GL_SAMPLER_2D_RECT_SHADOW = 0x8B64; - public const int GL_SAMPLER_BUFFER = 0x8DC2; - public const int GL_INT_SAMPLER_2D_RECT = 0x8DCD; - public const int GL_INT_SAMPLER_BUFFER = 0x8DD0; - public const int GL_UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5; - public const int GL_UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8; - public const int GL_TEXTURE_BUFFER = 0x8C2A; - public const int GL_MAX_TEXTURE_BUFFER_SIZE = 0x8C2B; - public const int GL_TEXTURE_BINDING_BUFFER = 0x8C2C; - public const int GL_TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D; - public const int GL_TEXTURE_RECTANGLE = 0x84F5; - public const int GL_TEXTURE_BINDING_RECTANGLE = 0x84F6; - public const int GL_PROXY_TEXTURE_RECTANGLE = 0x84F7; - public const int GL_MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8; - public const int GL_R8_SNORM = 0x8F94; - public const int GL_RG8_SNORM = 0x8F95; - public const int GL_RGB8_SNORM = 0x8F96; - public const int GL_RGBA8_SNORM = 0x8F97; - public const int GL_R16_SNORM = 0x8F98; - public const int GL_RG16_SNORM = 0x8F99; - public const int GL_RGB16_SNORM = 0x8F9A; - public const int GL_RGBA16_SNORM = 0x8F9B; - public const int GL_SIGNED_NORMALIZED = 0x8F9C; - public const int GL_PRIMITIVE_RESTART = 0x8F9D; - public const int GL_PRIMITIVE_RESTART_INDEX = 0x8F9E; - public const int GL_COPY_READ_BUFFER = 0x8F36; - public const int GL_COPY_WRITE_BUFFER = 0x8F37; - public const int GL_UNIFORM_BUFFER = 0x8A11; - public const int GL_UNIFORM_BUFFER_BINDING = 0x8A28; - public const int GL_UNIFORM_BUFFER_START = 0x8A29; - public const int GL_UNIFORM_BUFFER_SIZE = 0x8A2A; - public const int GL_MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B; - public const int GL_MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C; - public const int GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D; - public const int GL_MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E; - public const int GL_MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F; - public const int GL_MAX_UNIFORM_BLOCK_SIZE = 0x8A30; - public const int GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31; - public const int GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32; - public const int GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33; - public const int GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34; - public const int GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35; - public const int GL_ACTIVE_UNIFORM_BLOCKS = 0x8A36; - public const int GL_UNIFORM_TYPE = 0x8A37; - public const int GL_UNIFORM_SIZE = 0x8A38; - public const int GL_UNIFORM_NAME_LENGTH = 0x8A39; - public const int GL_UNIFORM_BLOCK_INDEX = 0x8A3A; - public const int GL_UNIFORM_OFFSET = 0x8A3B; - public const int GL_UNIFORM_ARRAY_STRIDE = 0x8A3C; - public const int GL_UNIFORM_MATRIX_STRIDE = 0x8A3D; - public const int GL_UNIFORM_IS_ROW_MAJOR = 0x8A3E; - public const int GL_UNIFORM_BLOCK_BINDING = 0x8A3F; - public const int GL_UNIFORM_BLOCK_DATA_SIZE = 0x8A40; - public const int GL_UNIFORM_BLOCK_NAME_LENGTH = 0x8A41; - public const int GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42; - public const int GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43; - public const int GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44; - public const int GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45; - public const int GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46; - public const int GL_INVALID_INDEX = -1; - public const int GL_VERSION_3_2 = 1; - public const int GL_CONTEXT_CORE_PROFILE_BIT = 0x00000001; - public const int GL_CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002; - public const int GL_LINES_ADJACENCY = 0x000A; - public const int GL_LINE_STRIP_ADJACENCY = 0x000B; - public const int GL_TRIANGLES_ADJACENCY = 0x000C; - public const int GL_TRIANGLE_STRIP_ADJACENCY = 0x000D; - public const int GL_PROGRAM_POINT_SIZE = 0x8642; - public const int GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29; - public const int GL_FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7; - public const int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8; - public const int GL_GEOMETRY_SHADER = 0x8DD9; - public const int GL_GEOMETRY_VERTICES_OUT = 0x8916; - public const int GL_GEOMETRY_INPUT_TYPE = 0x8917; - public const int GL_GEOMETRY_OUTPUT_TYPE = 0x8918; - public const int GL_MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF; - public const int GL_MAX_GEOMETRY_OUTPUT_VERTICES = 0x8DE0; - public const int GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1; - public const int GL_MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122; - public const int GL_MAX_GEOMETRY_INPUT_COMPONENTS = 0x9123; - public const int GL_MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124; - public const int GL_MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125; - public const int GL_CONTEXT_PROFILE_MASK = 0x9126; - public const int GL_DEPTH_CLAMP = 0x864F; - public const int GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C; - public const int GL_FIRST_VERTEX_CONVENTION = 0x8E4D; - public const int GL_LAST_VERTEX_CONVENTION = 0x8E4E; - public const int GL_PROVOKING_VERTEX = 0x8E4F; - public const int GL_TEXTURE_CUBE_MAP_SEAMLESS = 0x884F; - public const int GL_MAX_SERVER_WAIT_TIMEOUT = 0x9111; - public const int GL_OBJECT_TYPE = 0x9112; - public const int GL_SYNC_CONDITION = 0x9113; - public const int GL_SYNC_STATUS = 0x9114; - public const int GL_SYNC_FLAGS = 0x9115; - public const int GL_SYNC_FENCE = 0x9116; - public const int GL_SYNC_GPU_COMMANDS_COMPLETE = 0x9117; - public const int GL_UNSIGNALED = 0x9118; - public const int GL_SIGNALED = 0x9119; - public const int GL_ALREADY_SIGNALED = 0x911A; - public const int GL_TIMEOUT_EXPIRED = 0x911B; - public const int GL_CONDITION_SATISFIED = 0x911C; - public const int GL_WAIT_FAILED = 0x911D; - public const int GL_SYNC_FLUSH_COMMANDS_BIT = 0x00000001; - public const int GL_SAMPLE_POSITION = 0x8E50; - public const int GL_SAMPLE_MASK = 0x8E51; - public const int GL_SAMPLE_MASK_VALUE = 0x8E52; - public const int GL_MAX_SAMPLE_MASK_WORDS = 0x8E59; - public const int GL_TEXTURE_2D_MULTISAMPLE = 0x9100; - public const int GL_PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101; - public const int GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102; - public const int GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103; - public const int GL_TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104; - public const int GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105; - public const int GL_TEXTURE_SAMPLES = 0x9106; - public const int GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107; - public const int GL_SAMPLER_2D_MULTISAMPLE = 0x9108; - public const int GL_INT_SAMPLER_2D_MULTISAMPLE = 0x9109; - public const int GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A; - public const int GL_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B; - public const int GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C; - public const int GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D; - public const int GL_MAX_COLOR_TEXTURE_SAMPLES = 0x910E; - public const int GL_MAX_DEPTH_TEXTURE_SAMPLES = 0x910F; - public const int GL_MAX_INTEGER_SAMPLES = 0x9110; - public const int GL_VERSION_3_3 = 1; - public const int GL_VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE; - public const int GL_SRC1_COLOR = 0x88F9; - public const int GL_ONE_MINUS_SRC1_COLOR = 0x88FA; - public const int GL_ONE_MINUS_SRC1_ALPHA = 0x88FB; - public const int GL_MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC; - public const int GL_ANY_SAMPLES_PASSED = 0x8C2F; - public const int GL_SAMPLER_BINDING = 0x8919; - public const int GL_RGB10_A2UI = 0x906F; - public const int GL_TEXTURE_SWIZZLE_R = 0x8E42; - public const int GL_TEXTURE_SWIZZLE_G = 0x8E43; - public const int GL_TEXTURE_SWIZZLE_B = 0x8E44; - public const int GL_TEXTURE_SWIZZLE_A = 0x8E45; - public const int GL_TEXTURE_SWIZZLE_RGBA = 0x8E46; - public const int GL_TIME_ELAPSED = 0x88BF; - public const int GL_TIMESTAMP = 0x8E28; - public const int GL_INT_2_10_10_10_REV = 0x8D9F; - public const int GL_VERSION_4_0 = 1; - public const int GL_SAMPLE_SHADING = 0x8C36; - public const int GL_MIN_SAMPLE_SHADING_VALUE = 0x8C37; - public const int GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5E; - public const int GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5F; - public const int GL_TEXTURE_CUBE_MAP_ARRAY = 0x9009; - public const int GL_TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A; - public const int GL_PROXY_TEXTURE_CUBE_MAP_ARRAY = 0x900B; - public const int GL_SAMPLER_CUBE_MAP_ARRAY = 0x900C; - public const int GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW = 0x900D; - public const int GL_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900E; - public const int GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900F; - public const int GL_DRAW_INDIRECT_BUFFER = 0x8F3F; - public const int GL_DRAW_INDIRECT_BUFFER_BINDING = 0x8F43; - public const int GL_GEOMETRY_SHADER_INVOCATIONS = 0x887F; - public const int GL_MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A; - public const int GL_MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B; - public const int GL_MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C; - public const int GL_FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D; - public const int GL_MAX_VERTEX_STREAMS = 0x8E71; - public const int GL_DOUBLE_VEC2 = 0x8FFC; - public const int GL_DOUBLE_VEC3 = 0x8FFD; - public const int GL_DOUBLE_VEC4 = 0x8FFE; - public const int GL_DOUBLE_MAT2 = 0x8F46; - public const int GL_DOUBLE_MAT3 = 0x8F47; - public const int GL_DOUBLE_MAT4 = 0x8F48; - public const int GL_DOUBLE_MAT2x3 = 0x8F49; - public const int GL_DOUBLE_MAT2x4 = 0x8F4A; - public const int GL_DOUBLE_MAT3x2 = 0x8F4B; - public const int GL_DOUBLE_MAT3x4 = 0x8F4C; - public const int GL_DOUBLE_MAT4x2 = 0x8F4D; - public const int GL_DOUBLE_MAT4x3 = 0x8F4E; - public const int GL_ACTIVE_SUBROUTINES = 0x8DE5; - public const int GL_ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6; - public const int GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47; - public const int GL_ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48; - public const int GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49; - public const int GL_MAX_SUBROUTINES = 0x8DE7; - public const int GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8; - public const int GL_NUM_COMPATIBLE_SUBROUTINES = 0x8E4A; - public const int GL_COMPATIBLE_SUBROUTINES = 0x8E4B; - public const int GL_PATCHES = 0x000E; - public const int GL_PATCH_VERTICES = 0x8E72; - public const int GL_PATCH_DEFAULT_INNER_LEVEL = 0x8E73; - public const int GL_PATCH_DEFAULT_OUTER_LEVEL = 0x8E74; - public const int GL_TESS_CONTROL_OUTPUT_VERTICES = 0x8E75; - public const int GL_TESS_GEN_MODE = 0x8E76; - public const int GL_TESS_GEN_SPACING = 0x8E77; - public const int GL_TESS_GEN_VERTEX_ORDER = 0x8E78; - public const int GL_TESS_GEN_POINT_MODE = 0x8E79; - public const int GL_ISOLINES = 0x8E7A; - public const int GL_FRACTIONAL_ODD = 0x8E7B; - public const int GL_FRACTIONAL_EVEN = 0x8E7C; - public const int GL_MAX_PATCH_VERTICES = 0x8E7D; - public const int GL_MAX_TESS_GEN_LEVEL = 0x8E7E; - public const int GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F; - public const int GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80; - public const int GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81; - public const int GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82; - public const int GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83; - public const int GL_MAX_TESS_PATCH_COMPONENTS = 0x8E84; - public const int GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85; - public const int GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86; - public const int GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89; - public const int GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A; - public const int GL_MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C; - public const int GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D; - public const int GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E; - public const int GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F; - public const int GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0; - public const int GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1; - public const int GL_TESS_EVALUATION_SHADER = 0x8E87; - public const int GL_TESS_CONTROL_SHADER = 0x8E88; - public const int GL_TRANSFORM_FEEDBACK = 0x8E22; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24; - public const int GL_TRANSFORM_FEEDBACK_BINDING = 0x8E25; - public const int GL_MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70; - public const int GL_VERSION_4_1 = 1; - public const int GL_FIXED = 0x140C; - public const int GL_IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A; - public const int GL_IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; - public const int GL_LOW_FLOAT = 0x8DF0; - public const int GL_MEDIUM_FLOAT = 0x8DF1; - public const int GL_HIGH_FLOAT = 0x8DF2; - public const int GL_LOW_INT = 0x8DF3; - public const int GL_MEDIUM_INT = 0x8DF4; - public const int GL_HIGH_INT = 0x8DF5; - public const int GL_SHADER_COMPILER = 0x8DFA; - public const int GL_SHADER_BINARY_FORMATS = 0x8DF8; - public const int GL_NUM_SHADER_BINARY_FORMATS = 0x8DF9; - public const int GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; - public const int GL_MAX_VARYING_VECTORS = 0x8DFC; - public const int GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; - public const int GL_RGB565 = 0x8D62; - public const int GL_PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257; - public const int GL_PROGRAM_BINARY_LENGTH = 0x8741; - public const int GL_NUM_PROGRAM_BINARY_FORMATS = 0x87FE; - public const int GL_PROGRAM_BINARY_FORMATS = 0x87FF; - public const int GL_VERTEX_SHADER_BIT = 0x00000001; - public const int GL_FRAGMENT_SHADER_BIT = 0x00000002; - public const int GL_GEOMETRY_SHADER_BIT = 0x00000004; - public const int GL_TESS_CONTROL_SHADER_BIT = 0x00000008; - public const int GL_TESS_EVALUATION_SHADER_BIT = 0x00000010; - public const int GL_ALL_SHADER_BITS = -1; - public const int GL_PROGRAM_SEPARABLE = 0x8258; - public const int GL_ACTIVE_PROGRAM = 0x8259; - public const int GL_PROGRAM_PIPELINE_BINDING = 0x825A; - public const int GL_MAX_VIEWPORTS = 0x825B; - public const int GL_VIEWPORT_SUBPIXEL_BITS = 0x825C; - public const int GL_VIEWPORT_BOUNDS_RANGE = 0x825D; - public const int GL_LAYER_PROVOKING_VERTEX = 0x825E; - public const int GL_VIEWPORT_INDEX_PROVOKING_VERTEX = 0x825F; - public const int GL_UNDEFINED_VERTEX = 0x8260; - public const int GL_VERSION_4_2 = 1; - public const int GL_COPY_READ_BUFFER_BINDING = 0x8F36; - public const int GL_COPY_WRITE_BUFFER_BINDING = 0x8F37; - public const int GL_TRANSFORM_FEEDBACK_ACTIVE = 0x8E24; - public const int GL_TRANSFORM_FEEDBACK_PAUSED = 0x8E23; - public const int GL_UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127; - public const int GL_UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128; - public const int GL_UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129; - public const int GL_UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A; - public const int GL_PACK_COMPRESSED_BLOCK_WIDTH = 0x912B; - public const int GL_PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C; - public const int GL_PACK_COMPRESSED_BLOCK_DEPTH = 0x912D; - public const int GL_PACK_COMPRESSED_BLOCK_SIZE = 0x912E; - public const int GL_NUM_SAMPLE_COUNTS = 0x9380; - public const int GL_MIN_MAP_BUFFER_ALIGNMENT = 0x90BC; - public const int GL_ATOMIC_COUNTER_BUFFER = 0x92C0; - public const int GL_ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1; - public const int GL_ATOMIC_COUNTER_BUFFER_START = 0x92C2; - public const int GL_ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3; - public const int GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4; - public const int GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5; - public const int GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6; - public const int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7; - public const int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8; - public const int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9; - public const int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA; - public const int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB; - public const int GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC; - public const int GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD; - public const int GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE; - public const int GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF; - public const int GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0; - public const int GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1; - public const int GL_MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2; - public const int GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3; - public const int GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4; - public const int GL_MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5; - public const int GL_MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6; - public const int GL_MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7; - public const int GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8; - public const int GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC; - public const int GL_ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9; - public const int GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA; - public const int GL_UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB; - public const int GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001; - public const int GL_ELEMENT_ARRAY_BARRIER_BIT = 0x00000002; - public const int GL_UNIFORM_BARRIER_BIT = 0x00000004; - public const int GL_TEXTURE_FETCH_BARRIER_BIT = 0x00000008; - public const int GL_SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020; - public const int GL_COMMAND_BARRIER_BIT = 0x00000040; - public const int GL_PIXEL_BUFFER_BARRIER_BIT = 0x00000080; - public const int GL_TEXTURE_UPDATE_BARRIER_BIT = 0x00000100; - public const int GL_BUFFER_UPDATE_BARRIER_BIT = 0x00000200; - public const int GL_FRAMEBUFFER_BARRIER_BIT = 0x00000400; - public const int GL_TRANSFORM_FEEDBACK_BARRIER_BIT = 0x00000800; - public const int GL_ATOMIC_COUNTER_BARRIER_BIT = 0x00001000; - public const int GL_ALL_BARRIER_BITS = -1; - public const int GL_MAX_IMAGE_UNITS = 0x8F38; - public const int GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39; - public const int GL_IMAGE_BINDING_NAME = 0x8F3A; - public const int GL_IMAGE_BINDING_LEVEL = 0x8F3B; - public const int GL_IMAGE_BINDING_LAYERED = 0x8F3C; - public const int GL_IMAGE_BINDING_LAYER = 0x8F3D; - public const int GL_IMAGE_BINDING_ACCESS = 0x8F3E; - public const int GL_IMAGE_1D = 0x904C; - public const int GL_IMAGE_2D = 0x904D; - public const int GL_IMAGE_3D = 0x904E; - public const int GL_IMAGE_2D_RECT = 0x904F; - public const int GL_IMAGE_CUBE = 0x9050; - public const int GL_IMAGE_BUFFER = 0x9051; - public const int GL_IMAGE_1D_ARRAY = 0x9052; - public const int GL_IMAGE_2D_ARRAY = 0x9053; - public const int GL_IMAGE_CUBE_MAP_ARRAY = 0x9054; - public const int GL_IMAGE_2D_MULTISAMPLE = 0x9055; - public const int GL_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9056; - public const int GL_INT_IMAGE_1D = 0x9057; - public const int GL_INT_IMAGE_2D = 0x9058; - public const int GL_INT_IMAGE_3D = 0x9059; - public const int GL_INT_IMAGE_2D_RECT = 0x905A; - public const int GL_INT_IMAGE_CUBE = 0x905B; - public const int GL_INT_IMAGE_BUFFER = 0x905C; - public const int GL_INT_IMAGE_1D_ARRAY = 0x905D; - public const int GL_INT_IMAGE_2D_ARRAY = 0x905E; - public const int GL_INT_IMAGE_CUBE_MAP_ARRAY = 0x905F; - public const int GL_INT_IMAGE_2D_MULTISAMPLE = 0x9060; - public const int GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061; - public const int GL_UNSIGNED_INT_IMAGE_1D = 0x9062; - public const int GL_UNSIGNED_INT_IMAGE_2D = 0x9063; - public const int GL_UNSIGNED_INT_IMAGE_3D = 0x9064; - public const int GL_UNSIGNED_INT_IMAGE_2D_RECT = 0x9065; - public const int GL_UNSIGNED_INT_IMAGE_CUBE = 0x9066; - public const int GL_UNSIGNED_INT_IMAGE_BUFFER = 0x9067; - public const int GL_UNSIGNED_INT_IMAGE_1D_ARRAY = 0x9068; - public const int GL_UNSIGNED_INT_IMAGE_2D_ARRAY = 0x9069; - public const int GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A; - public const int GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B; - public const int GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C; - public const int GL_MAX_IMAGE_SAMPLES = 0x906D; - public const int GL_IMAGE_BINDING_FORMAT = 0x906E; - public const int GL_IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7; - public const int GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8; - public const int GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9; - public const int GL_MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA; - public const int GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB; - public const int GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC; - public const int GL_MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD; - public const int GL_MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE; - public const int GL_MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF; - public const int GL_COMPRESSED_RGBA_BPTC_UNORM = 0x8E8C; - public const int GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D; - public const int GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E; - public const int GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F; - public const int GL_TEXTURE_IMMUTABLE_FORMAT = 0x912F; - public const int GL_VERSION_4_3 = 1; - public const int GL_NUM_SHADING_LANGUAGE_VERSIONS = 0x82E9; - public const int GL_VERTEX_ATTRIB_ARRAY_LONG = 0x874E; - public const int GL_COMPRESSED_RGB8_ETC2 = 0x9274; - public const int GL_COMPRESSED_SRGB8_ETC2 = 0x9275; - public const int GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276; - public const int GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277; - public const int GL_COMPRESSED_RGBA8_ETC2_EAC = 0x9278; - public const int GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279; - public const int GL_COMPRESSED_R11_EAC = 0x9270; - public const int GL_COMPRESSED_SIGNED_R11_EAC = 0x9271; - public const int GL_COMPRESSED_RG11_EAC = 0x9272; - public const int GL_COMPRESSED_SIGNED_RG11_EAC = 0x9273; - public const int GL_PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69; - public const int GL_ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A; - public const int GL_MAX_ELEMENT_INDEX = 0x8D6B; - public const int GL_COMPUTE_SHADER = 0x91B9; - public const int GL_MAX_COMPUTE_UNIFORM_BLOCKS = 0x91BB; - public const int GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 0x91BC; - public const int GL_MAX_COMPUTE_IMAGE_UNIFORMS = 0x91BD; - public const int GL_MAX_COMPUTE_SHARED_MEMORY_SIZE = 0x8262; - public const int GL_MAX_COMPUTE_UNIFORM_COMPONENTS = 0x8263; - public const int GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 0x8264; - public const int GL_MAX_COMPUTE_ATOMIC_COUNTERS = 0x8265; - public const int GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 0x8266; - public const int GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 0x90EB; - public const int GL_MAX_COMPUTE_WORK_GROUP_COUNT = 0x91BE; - public const int GL_MAX_COMPUTE_WORK_GROUP_SIZE = 0x91BF; - public const int GL_COMPUTE_WORK_GROUP_SIZE = 0x8267; - public const int GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 0x90EC; - public const int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 0x90ED; - public const int GL_DISPATCH_INDIRECT_BUFFER = 0x90EE; - public const int GL_DISPATCH_INDIRECT_BUFFER_BINDING = 0x90EF; - public const int GL_COMPUTE_SHADER_BIT = 0x00000020; - public const int GL_DEBUG_OUTPUT_SYNCHRONOUS = 0x8242; - public const int GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243; - public const int GL_DEBUG_CALLBACK_FUNCTION = 0x8244; - public const int GL_DEBUG_CALLBACK_USER_PARAM = 0x8245; - public const int GL_DEBUG_SOURCE_API = 0x8246; - public const int GL_DEBUG_SOURCE_WINDOW_SYSTEM = 0x8247; - public const int GL_DEBUG_SOURCE_SHADER_COMPILER = 0x8248; - public const int GL_DEBUG_SOURCE_THIRD_PARTY = 0x8249; - public const int GL_DEBUG_SOURCE_APPLICATION = 0x824A; - public const int GL_DEBUG_SOURCE_OTHER = 0x824B; - public const int GL_DEBUG_TYPE_ERROR = 0x824C; - public const int GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D; - public const int GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR = 0x824E; - public const int GL_DEBUG_TYPE_PORTABILITY = 0x824F; - public const int GL_DEBUG_TYPE_PERFORMANCE = 0x8250; - public const int GL_DEBUG_TYPE_OTHER = 0x8251; - public const int GL_MAX_DEBUG_MESSAGE_LENGTH = 0x9143; - public const int GL_MAX_DEBUG_LOGGED_MESSAGES = 0x9144; - public const int GL_DEBUG_LOGGED_MESSAGES = 0x9145; - public const int GL_DEBUG_SEVERITY_HIGH = 0x9146; - public const int GL_DEBUG_SEVERITY_MEDIUM = 0x9147; - public const int GL_DEBUG_SEVERITY_LOW = 0x9148; - public const int GL_DEBUG_TYPE_MARKER = 0x8268; - public const int GL_DEBUG_TYPE_PUSH_GROUP = 0x8269; - public const int GL_DEBUG_TYPE_POP_GROUP = 0x826A; - public const int GL_DEBUG_SEVERITY_NOTIFICATION = 0x826B; - public const int GL_MAX_DEBUG_GROUP_STACK_DEPTH = 0x826C; - public const int GL_DEBUG_GROUP_STACK_DEPTH = 0x826D; - public const int GL_BUFFER = 0x82E0; - public const int GL_SHADER = 0x82E1; - public const int GL_PROGRAM = 0x82E2; - public const int GL_QUERY = 0x82E3; - public const int GL_PROGRAM_PIPELINE = 0x82E4; - public const int GL_SAMPLER = 0x82E6; - public const int GL_MAX_LABEL_LENGTH = 0x82E8; - public const int GL_DEBUG_OUTPUT = 0x92E0; - public const int GL_CONTEXT_FLAG_DEBUG_BIT = 0x00000002; - public const int GL_MAX_UNIFORM_LOCATIONS = 0x826E; - public const int GL_FRAMEBUFFER_DEFAULT_WIDTH = 0x9310; - public const int GL_FRAMEBUFFER_DEFAULT_HEIGHT = 0x9311; - public const int GL_FRAMEBUFFER_DEFAULT_LAYERS = 0x9312; - public const int GL_FRAMEBUFFER_DEFAULT_SAMPLES = 0x9313; - public const int GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 0x9314; - public const int GL_MAX_FRAMEBUFFER_WIDTH = 0x9315; - public const int GL_MAX_FRAMEBUFFER_HEIGHT = 0x9316; - public const int GL_MAX_FRAMEBUFFER_LAYERS = 0x9317; - public const int GL_MAX_FRAMEBUFFER_SAMPLES = 0x9318; - public const int GL_INTERNALFORMAT_SUPPORTED = 0x826F; - public const int GL_INTERNALFORMAT_PREFERRED = 0x8270; - public const int GL_INTERNALFORMAT_RED_SIZE = 0x8271; - public const int GL_INTERNALFORMAT_GREEN_SIZE = 0x8272; - public const int GL_INTERNALFORMAT_BLUE_SIZE = 0x8273; - public const int GL_INTERNALFORMAT_ALPHA_SIZE = 0x8274; - public const int GL_INTERNALFORMAT_DEPTH_SIZE = 0x8275; - public const int GL_INTERNALFORMAT_STENCIL_SIZE = 0x8276; - public const int GL_INTERNALFORMAT_SHARED_SIZE = 0x8277; - public const int GL_INTERNALFORMAT_RED_TYPE = 0x8278; - public const int GL_INTERNALFORMAT_GREEN_TYPE = 0x8279; - public const int GL_INTERNALFORMAT_BLUE_TYPE = 0x827A; - public const int GL_INTERNALFORMAT_ALPHA_TYPE = 0x827B; - public const int GL_INTERNALFORMAT_DEPTH_TYPE = 0x827C; - public const int GL_INTERNALFORMAT_STENCIL_TYPE = 0x827D; - public const int GL_MAX_WIDTH = 0x827E; - public const int GL_MAX_HEIGHT = 0x827F; - public const int GL_MAX_DEPTH = 0x8280; - public const int GL_MAX_LAYERS = 0x8281; - public const int GL_MAX_COMBINED_DIMENSIONS = 0x8282; - public const int GL_COLOR_COMPONENTS = 0x8283; - public const int GL_DEPTH_COMPONENTS = 0x8284; - public const int GL_STENCIL_COMPONENTS = 0x8285; - public const int GL_COLOR_RENDERABLE = 0x8286; - public const int GL_DEPTH_RENDERABLE = 0x8287; - public const int GL_STENCIL_RENDERABLE = 0x8288; - public const int GL_FRAMEBUFFER_RENDERABLE = 0x8289; - public const int GL_FRAMEBUFFER_RENDERABLE_LAYERED = 0x828A; - public const int GL_FRAMEBUFFER_BLEND = 0x828B; - public const int GL_READ_PIXELS = 0x828C; - public const int GL_READ_PIXELS_FORMAT = 0x828D; - public const int GL_READ_PIXELS_TYPE = 0x828E; - public const int GL_TEXTURE_IMAGE_FORMAT = 0x828F; - public const int GL_TEXTURE_IMAGE_TYPE = 0x8290; - public const int GL_GET_TEXTURE_IMAGE_FORMAT = 0x8291; - public const int GL_GET_TEXTURE_IMAGE_TYPE = 0x8292; - public const int GL_MIPMAP = 0x8293; - public const int GL_MANUAL_GENERATE_MIPMAP = 0x8294; - public const int GL_AUTO_GENERATE_MIPMAP = 0x8295; - public const int GL_COLOR_ENCODING = 0x8296; - public const int GL_SRGB_READ = 0x8297; - public const int GL_SRGB_WRITE = 0x8298; - public const int GL_FILTER = 0x829A; - public const int GL_VERTEX_TEXTURE = 0x829B; - public const int GL_TESS_CONTROL_TEXTURE = 0x829C; - public const int GL_TESS_EVALUATION_TEXTURE = 0x829D; - public const int GL_GEOMETRY_TEXTURE = 0x829E; - public const int GL_FRAGMENT_TEXTURE = 0x829F; - public const int GL_COMPUTE_TEXTURE = 0x82A0; - public const int GL_TEXTURE_SHADOW = 0x82A1; - public const int GL_TEXTURE_GATHER = 0x82A2; - public const int GL_TEXTURE_GATHER_SHADOW = 0x82A3; - public const int GL_SHADER_IMAGE_LOAD = 0x82A4; - public const int GL_SHADER_IMAGE_STORE = 0x82A5; - public const int GL_SHADER_IMAGE_ATOMIC = 0x82A6; - public const int GL_IMAGE_TEXEL_SIZE = 0x82A7; - public const int GL_IMAGE_COMPATIBILITY_CLASS = 0x82A8; - public const int GL_IMAGE_PIXEL_FORMAT = 0x82A9; - public const int GL_IMAGE_PIXEL_TYPE = 0x82AA; - public const int GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 0x82AC; - public const int GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 0x82AD; - public const int GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 0x82AE; - public const int GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 0x82AF; - public const int GL_TEXTURE_COMPRESSED_BLOCK_WIDTH = 0x82B1; - public const int GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT = 0x82B2; - public const int GL_TEXTURE_COMPRESSED_BLOCK_SIZE = 0x82B3; - public const int GL_CLEAR_BUFFER = 0x82B4; - public const int GL_TEXTURE_VIEW = 0x82B5; - public const int GL_VIEW_COMPATIBILITY_CLASS = 0x82B6; - public const int GL_FULL_SUPPORT = 0x82B7; - public const int GL_CAVEAT_SUPPORT = 0x82B8; - public const int GL_IMAGE_CLASS_4_X_32 = 0x82B9; - public const int GL_IMAGE_CLASS_2_X_32 = 0x82BA; - public const int GL_IMAGE_CLASS_1_X_32 = 0x82BB; - public const int GL_IMAGE_CLASS_4_X_16 = 0x82BC; - public const int GL_IMAGE_CLASS_2_X_16 = 0x82BD; - public const int GL_IMAGE_CLASS_1_X_16 = 0x82BE; - public const int GL_IMAGE_CLASS_4_X_8 = 0x82BF; - public const int GL_IMAGE_CLASS_2_X_8 = 0x82C0; - public const int GL_IMAGE_CLASS_1_X_8 = 0x82C1; - public const int GL_IMAGE_CLASS_11_11_10 = 0x82C2; - public const int GL_IMAGE_CLASS_10_10_10_2 = 0x82C3; - public const int GL_VIEW_CLASS_128_BITS = 0x82C4; - public const int GL_VIEW_CLASS_96_BITS = 0x82C5; - public const int GL_VIEW_CLASS_64_BITS = 0x82C6; - public const int GL_VIEW_CLASS_48_BITS = 0x82C7; - public const int GL_VIEW_CLASS_32_BITS = 0x82C8; - public const int GL_VIEW_CLASS_24_BITS = 0x82C9; - public const int GL_VIEW_CLASS_16_BITS = 0x82CA; - public const int GL_VIEW_CLASS_8_BITS = 0x82CB; - public const int GL_VIEW_CLASS_S3TC_DXT1_RGB = 0x82CC; - public const int GL_VIEW_CLASS_S3TC_DXT1_RGBA = 0x82CD; - public const int GL_VIEW_CLASS_S3TC_DXT3_RGBA = 0x82CE; - public const int GL_VIEW_CLASS_S3TC_DXT5_RGBA = 0x82CF; - public const int GL_VIEW_CLASS_RGTC1_RED = 0x82D0; - public const int GL_VIEW_CLASS_RGTC2_RG = 0x82D1; - public const int GL_VIEW_CLASS_BPTC_UNORM = 0x82D2; - public const int GL_VIEW_CLASS_BPTC_FLOAT = 0x82D3; - public const int GL_UNIFORM = 0x92E1; - public const int GL_UNIFORM_BLOCK = 0x92E2; - public const int GL_PROGRAM_INPUT = 0x92E3; - public const int GL_PROGRAM_OUTPUT = 0x92E4; - public const int GL_BUFFER_VARIABLE = 0x92E5; - public const int GL_SHADER_STORAGE_BLOCK = 0x92E6; - public const int GL_VERTEX_SUBROUTINE = 0x92E8; - public const int GL_TESS_CONTROL_SUBROUTINE = 0x92E9; - public const int GL_TESS_EVALUATION_SUBROUTINE = 0x92EA; - public const int GL_GEOMETRY_SUBROUTINE = 0x92EB; - public const int GL_FRAGMENT_SUBROUTINE = 0x92EC; - public const int GL_COMPUTE_SUBROUTINE = 0x92ED; - public const int GL_VERTEX_SUBROUTINE_UNIFORM = 0x92EE; - public const int GL_TESS_CONTROL_SUBROUTINE_UNIFORM = 0x92EF; - public const int GL_TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0; - public const int GL_GEOMETRY_SUBROUTINE_UNIFORM = 0x92F1; - public const int GL_FRAGMENT_SUBROUTINE_UNIFORM = 0x92F2; - public const int GL_COMPUTE_SUBROUTINE_UNIFORM = 0x92F3; - public const int GL_TRANSFORM_FEEDBACK_VARYING = 0x92F4; - public const int GL_ACTIVE_RESOURCES = 0x92F5; - public const int GL_MAX_NAME_LENGTH = 0x92F6; - public const int GL_MAX_NUM_ACTIVE_VARIABLES = 0x92F7; - public const int GL_MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8; - public const int GL_NAME_LENGTH = 0x92F9; - public const int GL_TYPE = 0x92FA; - public const int GL_ARRAY_SIZE = 0x92FB; - public const int GL_OFFSET = 0x92FC; - public const int GL_BLOCK_INDEX = 0x92FD; - public const int GL_ARRAY_STRIDE = 0x92FE; - public const int GL_MATRIX_STRIDE = 0x92FF; - public const int GL_IS_ROW_MAJOR = 0x9300; - public const int GL_ATOMIC_COUNTER_BUFFER_INDEX = 0x9301; - public const int GL_BUFFER_BINDING = 0x9302; - public const int GL_BUFFER_DATA_SIZE = 0x9303; - public const int GL_NUM_ACTIVE_VARIABLES = 0x9304; - public const int GL_ACTIVE_VARIABLES = 0x9305; - public const int GL_REFERENCED_BY_VERTEX_SHADER = 0x9306; - public const int GL_REFERENCED_BY_TESS_CONTROL_SHADER = 0x9307; - public const int GL_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308; - public const int GL_REFERENCED_BY_GEOMETRY_SHADER = 0x9309; - public const int GL_REFERENCED_BY_FRAGMENT_SHADER = 0x930A; - public const int GL_REFERENCED_BY_COMPUTE_SHADER = 0x930B; - public const int GL_TOP_LEVEL_ARRAY_SIZE = 0x930C; - public const int GL_TOP_LEVEL_ARRAY_STRIDE = 0x930D; - public const int GL_LOCATION = 0x930E; - public const int GL_LOCATION_INDEX = 0x930F; - public const int GL_IS_PER_PATCH = 0x92E7; - public const int GL_SHADER_STORAGE_BUFFER = 0x90D2; - public const int GL_SHADER_STORAGE_BUFFER_BINDING = 0x90D3; - public const int GL_SHADER_STORAGE_BUFFER_START = 0x90D4; - public const int GL_SHADER_STORAGE_BUFFER_SIZE = 0x90D5; - public const int GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0x90D6; - public const int GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 0x90D7; - public const int GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 0x90D8; - public const int GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 0x90D9; - public const int GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 0x90DA; - public const int GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 0x90DB; - public const int GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS = 0x90DC; - public const int GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS = 0x90DD; - public const int GL_MAX_SHADER_STORAGE_BLOCK_SIZE = 0x90DE; - public const int GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 0x90DF; - public const int GL_SHADER_STORAGE_BARRIER_BIT = 0x00002000; - public const int GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 0x8F39; - public const int GL_DEPTH_STENCIL_TEXTURE_MODE = 0x90EA; - public const int GL_TEXTURE_BUFFER_OFFSET = 0x919D; - public const int GL_TEXTURE_BUFFER_SIZE = 0x919E; - public const int GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT = 0x919F; - public const int GL_TEXTURE_VIEW_MIN_LEVEL = 0x82DB; - public const int GL_TEXTURE_VIEW_NUM_LEVELS = 0x82DC; - public const int GL_TEXTURE_VIEW_MIN_LAYER = 0x82DD; - public const int GL_TEXTURE_VIEW_NUM_LAYERS = 0x82DE; - public const int GL_TEXTURE_IMMUTABLE_LEVELS = 0x82DF; - public const int GL_VERTEX_ATTRIB_BINDING = 0x82D4; - public const int GL_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D5; - public const int GL_VERTEX_BINDING_DIVISOR = 0x82D6; - public const int GL_VERTEX_BINDING_OFFSET = 0x82D7; - public const int GL_VERTEX_BINDING_STRIDE = 0x82D8; - public const int GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D9; - public const int GL_MAX_VERTEX_ATTRIB_BINDINGS = 0x82DA; - public const int GL_VERTEX_BINDING_BUFFER = 0x8F4F; - public const int GL_DISPLAY_LIST = 0x82E7; - public const int GL_VERSION_4_4 = 1; - public const int GL_MAX_VERTEX_ATTRIB_STRIDE = 0x82E5; - public const int GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = 0x8221; - public const int GL_TEXTURE_BUFFER_BINDING = 0x8C2A; - public const int GL_MAP_PERSISTENT_BIT = 0x0040; - public const int GL_MAP_COHERENT_BIT = 0x0080; - public const int GL_DYNAMIC_STORAGE_BIT = 0x0100; - public const int GL_CLIENT_STORAGE_BIT = 0x0200; - public const int GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT = 0x00004000; - public const int GL_BUFFER_IMMUTABLE_STORAGE = 0x821F; - public const int GL_BUFFER_STORAGE_FLAGS = 0x8220; - public const int GL_CLEAR_TEXTURE = 0x9365; - public const int GL_LOCATION_COMPONENT = 0x934A; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_INDEX = 0x934B; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE = 0x934C; - public const int GL_QUERY_BUFFER = 0x9192; - public const int GL_QUERY_BUFFER_BARRIER_BIT = 0x00008000; - public const int GL_QUERY_BUFFER_BINDING = 0x9193; - public const int GL_QUERY_RESULT_NO_WAIT = 0x9194; - public const int GL_MIRROR_CLAMP_TO_EDGE = 0x8743; - public const int GL_NEGATIVE_ONE_TO_ONE = 0x935E; - public const int GL_ZERO_TO_ONE = 0x935F; - public const int GL_CLIP_ORIGIN = 0x935C; - public const int GL_CLIP_DEPTH_MODE = 0x935D; - public const int GL_QUERY_WAIT_INVERTED = 0x8E17; - public const int GL_QUERY_NO_WAIT_INVERTED = 0x8E18; - public const int GL_QUERY_BY_REGION_WAIT_INVERTED = 0x8E19; - public const int GL_QUERY_BY_REGION_NO_WAIT_INVERTED = 0x8E1A; - public const int GL_MAX_CULL_DISTANCES = 0x82F9; - public const int GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 0x82FA; - public const int GL_TEXTURE_TARGET = 0x1006; - public const int GL_QUERY_TARGET = 0x82EA; - public const int GL_GUILTY_CONTEXT_RESET = 0x8253; - public const int GL_INNOCENT_CONTEXT_RESET = 0x8254; - public const int GL_UNKNOWN_CONTEXT_RESET = 0x8255; - public const int GL_RESET_NOTIFICATION_STRATEGY = 0x8256; - public const int GL_LOSE_CONTEXT_ON_RESET = 0x8252; - public const int GL_NO_RESET_NOTIFICATION = 0x8261; - public const int GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT = 0x00000004; - public const int GL_CONTEXT_RELEASE_BEHAVIOR = 0x82FB; - public const int GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82FC; - public const int GL_VERSION_4_6 = 1; - public const int GL_SHADER_BINARY_FORMAT_SPIR_V = 0x9551; - public const int GL_SPIR_V_BINARY = 0x9552; - public const int GL_PARAMETER_BUFFER = 0x80EE; - public const int GL_PARAMETER_BUFFER_BINDING = 0x80EF; - public const int GL_CONTEXT_FLAG_NO_ERROR_BIT = 0x00000008; - public const int GL_VERTICES_SUBMITTED = 0x82EE; - public const int GL_PRIMITIVES_SUBMITTED = 0x82EF; - public const int GL_VERTEX_SHADER_INVOCATIONS = 0x82F0; - public const int GL_TESS_CONTROL_SHADER_PATCHES = 0x82F1; - public const int GL_TESS_EVALUATION_SHADER_INVOCATIONS = 0x82F2; - public const int GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED = 0x82F3; - public const int GL_FRAGMENT_SHADER_INVOCATIONS = 0x82F4; - public const int GL_COMPUTE_SHADER_INVOCATIONS = 0x82F5; - public const int GL_CLIPPING_INPUT_PRIMITIVES = 0x82F6; - public const int GL_CLIPPING_OUTPUT_PRIMITIVES = 0x82F7; - public const int GL_POLYGON_OFFSET_CLAMP = 0x8E1B; - public const int GL_SPIR_V_EXTENSIONS = 0x9553; - public const int GL_NUM_SPIR_V_EXTENSIONS = 0x9554; - public const int GL_TEXTURE_MAX_ANISOTROPY = 0x84FE; - public const int GL_MAX_TEXTURE_MAX_ANISOTROPY = 0x84FF; - public const int GL_TRANSFORM_FEEDBACK_OVERFLOW = 0x82EC; - public const int GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW = 0x82ED; - public const int GL_ARB_ES2_compatibility = 1; - public const int GL_ARB_ES3_1_compatibility = 1; - public const int GL_ARB_ES3_2_compatibility = 1; - public const int GL_PRIMITIVE_BOUNDING_BOX_ARB = 0x92BE; - public const int GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB = 0x9381; - public const int GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB = 0x9382; - public const int GL_ARB_ES3_compatibility = 1; - public const int GL_ARB_arrays_of_arrays = 1; - public const int GL_ARB_base_instance = 1; - public const int GL_ARB_bindless_texture = 1; - public const int GL_UNSIGNED_INT64_ARB = 0x140F; - public const int GL_ARB_blend_func_extended = 1; - public const int GL_ARB_buffer_storage = 1; - public const int GL_ARB_cl_event = 1; - public const int GL_SYNC_CL_EVENT_ARB = 0x8240; - public const int GL_SYNC_CL_EVENT_COMPLETE_ARB = 0x8241; - public const int GL_ARB_clear_buffer_object = 1; - public const int GL_ARB_clear_texture = 1; - public const int GL_ARB_clip_control = 1; - public const int GL_ARB_color_buffer_float = 1; - public const int GL_RGBA_FLOAT_MODE_ARB = 0x8820; - public const int GL_CLAMP_VERTEX_COLOR_ARB = 0x891A; - public const int GL_CLAMP_FRAGMENT_COLOR_ARB = 0x891B; - public const int GL_CLAMP_READ_COLOR_ARB = 0x891C; - public const int GL_FIXED_ONLY_ARB = 0x891D; - public const int GL_ARB_compatibility = 1; - public const int GL_ARB_compressed_texture_pixel_storage = 1; - public const int GL_ARB_compute_shader = 1; - public const int GL_ARB_compute_variable_group_size = 1; - public const int GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB = 0x9344; - public const int GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB = 0x90EB; - public const int GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB = 0x9345; - public const int GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB = 0x91BF; - public const int GL_ARB_conditional_render_inverted = 1; - public const int GL_ARB_conservative_depth = 1; - public const int GL_ARB_copy_buffer = 1; - public const int GL_ARB_copy_image = 1; - public const int GL_ARB_cull_distance = 1; - public const int GL_ARB_debug_output = 1; - public const int GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB = 0x8242; - public const int GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB = 0x8243; - public const int GL_DEBUG_CALLBACK_FUNCTION_ARB = 0x8244; - public const int GL_DEBUG_CALLBACK_USER_PARAM_ARB = 0x8245; - public const int GL_DEBUG_SOURCE_API_ARB = 0x8246; - public const int GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB = 0x8247; - public const int GL_DEBUG_SOURCE_SHADER_COMPILER_ARB = 0x8248; - public const int GL_DEBUG_SOURCE_THIRD_PARTY_ARB = 0x8249; - public const int GL_DEBUG_SOURCE_APPLICATION_ARB = 0x824A; - public const int GL_DEBUG_SOURCE_OTHER_ARB = 0x824B; - public const int GL_DEBUG_TYPE_ERROR_ARB = 0x824C; - public const int GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB = 0x824D; - public const int GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB = 0x824E; - public const int GL_DEBUG_TYPE_PORTABILITY_ARB = 0x824F; - public const int GL_DEBUG_TYPE_PERFORMANCE_ARB = 0x8250; - public const int GL_DEBUG_TYPE_OTHER_ARB = 0x8251; - public const int GL_MAX_DEBUG_MESSAGE_LENGTH_ARB = 0x9143; - public const int GL_MAX_DEBUG_LOGGED_MESSAGES_ARB = 0x9144; - public const int GL_DEBUG_LOGGED_MESSAGES_ARB = 0x9145; - public const int GL_DEBUG_SEVERITY_HIGH_ARB = 0x9146; - public const int GL_DEBUG_SEVERITY_MEDIUM_ARB = 0x9147; - public const int GL_DEBUG_SEVERITY_LOW_ARB = 0x9148; - public const int GL_ARB_depth_buffer_float = 1; - public const int GL_ARB_depth_clamp = 1; - public const int GL_ARB_depth_texture = 1; - public const int GL_DEPTH_COMPONENT16_ARB = 0x81A5; - public const int GL_DEPTH_COMPONENT24_ARB = 0x81A6; - public const int GL_DEPTH_COMPONENT32_ARB = 0x81A7; - public const int GL_TEXTURE_DEPTH_SIZE_ARB = 0x884A; - public const int GL_DEPTH_TEXTURE_MODE_ARB = 0x884B; - public const int GL_ARB_derivative_control = 1; - public const int GL_ARB_direct_state_access = 1; - public const int GL_ARB_draw_buffers = 1; - public const int GL_MAX_DRAW_BUFFERS_ARB = 0x8824; - public const int GL_DRAW_BUFFER0_ARB = 0x8825; - public const int GL_DRAW_BUFFER1_ARB = 0x8826; - public const int GL_DRAW_BUFFER2_ARB = 0x8827; - public const int GL_DRAW_BUFFER3_ARB = 0x8828; - public const int GL_DRAW_BUFFER4_ARB = 0x8829; - public const int GL_DRAW_BUFFER5_ARB = 0x882A; - public const int GL_DRAW_BUFFER6_ARB = 0x882B; - public const int GL_DRAW_BUFFER7_ARB = 0x882C; - public const int GL_DRAW_BUFFER8_ARB = 0x882D; - public const int GL_DRAW_BUFFER9_ARB = 0x882E; - public const int GL_DRAW_BUFFER10_ARB = 0x882F; - public const int GL_DRAW_BUFFER11_ARB = 0x8830; - public const int GL_DRAW_BUFFER12_ARB = 0x8831; - public const int GL_DRAW_BUFFER13_ARB = 0x8832; - public const int GL_DRAW_BUFFER14_ARB = 0x8833; - public const int GL_DRAW_BUFFER15_ARB = 0x8834; - public const int GL_ARB_draw_buffers_blend = 1; - public const int GL_ARB_draw_elements_base_vertex = 1; - public const int GL_ARB_draw_indirect = 1; - public const int GL_ARB_draw_instanced = 1; - public const int GL_ARB_enhanced_layouts = 1; - public const int GL_ARB_explicit_attrib_location = 1; - public const int GL_ARB_explicit_uniform_location = 1; - public const int GL_ARB_fragment_coord_conventions = 1; - public const int GL_ARB_fragment_layer_viewport = 1; - public const int GL_ARB_fragment_program = 1; - public const int GL_FRAGMENT_PROGRAM_ARB = 0x8804; - public const int GL_PROGRAM_FORMAT_ASCII_ARB = 0x8875; - public const int GL_PROGRAM_LENGTH_ARB = 0x8627; - public const int GL_PROGRAM_FORMAT_ARB = 0x8876; - public const int GL_PROGRAM_BINDING_ARB = 0x8677; - public const int GL_PROGRAM_INSTRUCTIONS_ARB = 0x88A0; - public const int GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1; - public const int GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2; - public const int GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3; - public const int GL_PROGRAM_TEMPORARIES_ARB = 0x88A4; - public const int GL_MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5; - public const int GL_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6; - public const int GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7; - public const int GL_PROGRAM_PARAMETERS_ARB = 0x88A8; - public const int GL_MAX_PROGRAM_PARAMETERS_ARB = 0x88A9; - public const int GL_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA; - public const int GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB; - public const int GL_PROGRAM_ATTRIBS_ARB = 0x88AC; - public const int GL_MAX_PROGRAM_ATTRIBS_ARB = 0x88AD; - public const int GL_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE; - public const int GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF; - public const int GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4; - public const int GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5; - public const int GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6; - public const int GL_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x8805; - public const int GL_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x8806; - public const int GL_PROGRAM_TEX_INDIRECTIONS_ARB = 0x8807; - public const int GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x8808; - public const int GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x8809; - public const int GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x880A; - public const int GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x880B; - public const int GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x880C; - public const int GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 0x880D; - public const int GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x880E; - public const int GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F; - public const int GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x8810; - public const int GL_PROGRAM_STRING_ARB = 0x8628; - public const int GL_PROGRAM_ERROR_POSITION_ARB = 0x864B; - public const int GL_CURRENT_MATRIX_ARB = 0x8641; - public const int GL_TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7; - public const int GL_CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640; - public const int GL_MAX_PROGRAM_MATRICES_ARB = 0x862F; - public const int GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E; - public const int GL_MAX_TEXTURE_COORDS_ARB = 0x8871; - public const int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872; - public const int GL_PROGRAM_ERROR_STRING_ARB = 0x8874; - public const int GL_MATRIX0_ARB = 0x88C0; - public const int GL_MATRIX1_ARB = 0x88C1; - public const int GL_MATRIX2_ARB = 0x88C2; - public const int GL_MATRIX3_ARB = 0x88C3; - public const int GL_MATRIX4_ARB = 0x88C4; - public const int GL_MATRIX5_ARB = 0x88C5; - public const int GL_MATRIX6_ARB = 0x88C6; - public const int GL_MATRIX7_ARB = 0x88C7; - public const int GL_MATRIX8_ARB = 0x88C8; - public const int GL_MATRIX9_ARB = 0x88C9; - public const int GL_MATRIX10_ARB = 0x88CA; - public const int GL_MATRIX11_ARB = 0x88CB; - public const int GL_MATRIX12_ARB = 0x88CC; - public const int GL_MATRIX13_ARB = 0x88CD; - public const int GL_MATRIX14_ARB = 0x88CE; - public const int GL_MATRIX15_ARB = 0x88CF; - public const int GL_MATRIX16_ARB = 0x88D0; - public const int GL_MATRIX17_ARB = 0x88D1; - public const int GL_MATRIX18_ARB = 0x88D2; - public const int GL_MATRIX19_ARB = 0x88D3; - public const int GL_MATRIX20_ARB = 0x88D4; - public const int GL_MATRIX21_ARB = 0x88D5; - public const int GL_MATRIX22_ARB = 0x88D6; - public const int GL_MATRIX23_ARB = 0x88D7; - public const int GL_MATRIX24_ARB = 0x88D8; - public const int GL_MATRIX25_ARB = 0x88D9; - public const int GL_MATRIX26_ARB = 0x88DA; - public const int GL_MATRIX27_ARB = 0x88DB; - public const int GL_MATRIX28_ARB = 0x88DC; - public const int GL_MATRIX29_ARB = 0x88DD; - public const int GL_MATRIX30_ARB = 0x88DE; - public const int GL_MATRIX31_ARB = 0x88DF; - public const int GL_ARB_fragment_program_shadow = 1; - public const int GL_ARB_fragment_shader = 1; - public const int GL_FRAGMENT_SHADER_ARB = 0x8B30; - public const int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB = 0x8B49; - public const int GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB = 0x8B8B; - public const int GL_ARB_fragment_shader_interlock = 1; - public const int GL_ARB_framebuffer_no_attachments = 1; - public const int GL_ARB_framebuffer_object = 1; - public const int GL_ARB_framebuffer_sRGB = 1; - public const int GL_ARB_geometry_shader4 = 1; - public const int GL_LINES_ADJACENCY_ARB = 0x000A; - public const int GL_LINE_STRIP_ADJACENCY_ARB = 0x000B; - public const int GL_TRIANGLES_ADJACENCY_ARB = 0x000C; - public const int GL_TRIANGLE_STRIP_ADJACENCY_ARB = 0x000D; - public const int GL_PROGRAM_POINT_SIZE_ARB = 0x8642; - public const int GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB = 0x8C29; - public const int GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB = 0x8DA7; - public const int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB = 0x8DA8; - public const int GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB = 0x8DA9; - public const int GL_GEOMETRY_SHADER_ARB = 0x8DD9; - public const int GL_GEOMETRY_VERTICES_OUT_ARB = 0x8DDA; - public const int GL_GEOMETRY_INPUT_TYPE_ARB = 0x8DDB; - public const int GL_GEOMETRY_OUTPUT_TYPE_ARB = 0x8DDC; - public const int GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB = 0x8DDD; - public const int GL_MAX_VERTEX_VARYING_COMPONENTS_ARB = 0x8DDE; - public const int GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB = 0x8DDF; - public const int GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB = 0x8DE0; - public const int GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB = 0x8DE1; - public const int GL_ARB_get_program_binary = 1; - public const int GL_ARB_get_texture_sub_image = 1; - public const int GL_ARB_gl_spirv = 1; - public const int GL_SHADER_BINARY_FORMAT_SPIR_V_ARB = 0x9551; - public const int GL_SPIR_V_BINARY_ARB = 0x9552; - public const int GL_ARB_gpu_shader5 = 1; - public const int GL_ARB_gpu_shader_fp64 = 1; - public const int GL_ARB_gpu_shader_int64 = 1; - public const int GL_INT64_ARB = 0x140E; - public const int GL_INT64_VEC2_ARB = 0x8FE9; - public const int GL_INT64_VEC3_ARB = 0x8FEA; - public const int GL_INT64_VEC4_ARB = 0x8FEB; - public const int GL_UNSIGNED_INT64_VEC2_ARB = 0x8FF5; - public const int GL_UNSIGNED_INT64_VEC3_ARB = 0x8FF6; - public const int GL_UNSIGNED_INT64_VEC4_ARB = 0x8FF7; - public const int GL_ARB_half_float_pixel = 1; - public const int GL_HALF_FLOAT_ARB = 0x140B; - public const int GL_ARB_half_float_vertex = 1; - public const int GL_ARB_imaging = 1; - public const int GL_ARB_indirect_parameters = 1; - public const int GL_PARAMETER_BUFFER_ARB = 0x80EE; - public const int GL_PARAMETER_BUFFER_BINDING_ARB = 0x80EF; - public const int GL_ARB_instanced_arrays = 1; - public const int GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB = 0x88FE; - public const int GL_ARB_internalformat_query = 1; - public const int GL_ARB_internalformat_query2 = 1; - public const int GL_SRGB_DECODE_ARB = 0x8299; - public const int GL_ARB_invalidate_subdata = 1; - public const int GL_ARB_map_buffer_alignment = 1; - public const int GL_ARB_map_buffer_range = 1; - public const int GL_ARB_matrix_palette = 1; - public const int GL_MATRIX_PALETTE_ARB = 0x8840; - public const int GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = 0x8841; - public const int GL_MAX_PALETTE_MATRICES_ARB = 0x8842; - public const int GL_CURRENT_PALETTE_MATRIX_ARB = 0x8843; - public const int GL_MATRIX_INDEX_ARRAY_ARB = 0x8844; - public const int GL_CURRENT_MATRIX_INDEX_ARB = 0x8845; - public const int GL_MATRIX_INDEX_ARRAY_SIZE_ARB = 0x8846; - public const int GL_MATRIX_INDEX_ARRAY_TYPE_ARB = 0x8847; - public const int GL_MATRIX_INDEX_ARRAY_STRIDE_ARB = 0x8848; - public const int GL_MATRIX_INDEX_ARRAY_POINTER_ARB = 0x8849; - public const int GL_ARB_multi_bind = 1; - public const int GL_ARB_multi_draw_indirect = 1; - public const int GL_ARB_multisample = 1; - public const int GL_MULTISAMPLE_ARB = 0x809D; - public const int GL_SAMPLE_ALPHA_TO_COVERAGE_ARB = 0x809E; - public const int GL_SAMPLE_ALPHA_TO_ONE_ARB = 0x809F; - public const int GL_SAMPLE_COVERAGE_ARB = 0x80A0; - public const int GL_SAMPLE_BUFFERS_ARB = 0x80A8; - public const int GL_SAMPLES_ARB = 0x80A9; - public const int GL_SAMPLE_COVERAGE_VALUE_ARB = 0x80AA; - public const int GL_SAMPLE_COVERAGE_INVERT_ARB = 0x80AB; - public const int GL_MULTISAMPLE_BIT_ARB = 0x20000000; - public const int GL_ARB_occlusion_query = 1; - public const int GL_QUERY_COUNTER_BITS_ARB = 0x8864; - public const int GL_CURRENT_QUERY_ARB = 0x8865; - public const int GL_QUERY_RESULT_ARB = 0x8866; - public const int GL_QUERY_RESULT_AVAILABLE_ARB = 0x8867; - public const int GL_SAMPLES_PASSED_ARB = 0x8914; - public const int GL_ARB_occlusion_query2 = 1; - public const int GL_ARB_parallel_shader_compile = 1; - public const int GL_MAX_SHADER_COMPILER_THREADS_ARB = 0x91B0; - public const int GL_COMPLETION_STATUS_ARB = 0x91B1; - public const int GL_ARB_pipeline_statistics_query = 1; - public const int GL_VERTICES_SUBMITTED_ARB = 0x82EE; - public const int GL_PRIMITIVES_SUBMITTED_ARB = 0x82EF; - public const int GL_VERTEX_SHADER_INVOCATIONS_ARB = 0x82F0; - public const int GL_TESS_CONTROL_SHADER_PATCHES_ARB = 0x82F1; - public const int GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB = 0x82F2; - public const int GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB = 0x82F3; - public const int GL_FRAGMENT_SHADER_INVOCATIONS_ARB = 0x82F4; - public const int GL_COMPUTE_SHADER_INVOCATIONS_ARB = 0x82F5; - public const int GL_CLIPPING_INPUT_PRIMITIVES_ARB = 0x82F6; - public const int GL_CLIPPING_OUTPUT_PRIMITIVES_ARB = 0x82F7; - public const int GL_ARB_pixel_buffer_object = 1; - public const int GL_PIXEL_PACK_BUFFER_ARB = 0x88EB; - public const int GL_PIXEL_UNPACK_BUFFER_ARB = 0x88EC; - public const int GL_PIXEL_PACK_BUFFER_BINDING_ARB = 0x88ED; - public const int GL_PIXEL_UNPACK_BUFFER_BINDING_ARB = 0x88EF; - public const int GL_ARB_point_parameters = 1; - public const int GL_POINT_SIZE_MIN_ARB = 0x8126; - public const int GL_POINT_SIZE_MAX_ARB = 0x8127; - public const int GL_POINT_FADE_THRESHOLD_SIZE_ARB = 0x8128; - public const int GL_POINT_DISTANCE_ATTENUATION_ARB = 0x8129; - public const int GL_ARB_point_sprite = 1; - public const int GL_POINT_SPRITE_ARB = 0x8861; - public const int GL_COORD_REPLACE_ARB = 0x8862; - public const int GL_ARB_polygon_offset_clamp = 1; - public const int GL_ARB_post_depth_coverage = 1; - public const int GL_ARB_program_interface_query = 1; - public const int GL_ARB_provoking_vertex = 1; - public const int GL_ARB_query_buffer_object = 1; - public const int GL_ARB_robust_buffer_access_behavior = 1; - public const int GL_ARB_robustness = 1; - public const int GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB = 0x00000004; - public const int GL_LOSE_CONTEXT_ON_RESET_ARB = 0x8252; - public const int GL_GUILTY_CONTEXT_RESET_ARB = 0x8253; - public const int GL_INNOCENT_CONTEXT_RESET_ARB = 0x8254; - public const int GL_UNKNOWN_CONTEXT_RESET_ARB = 0x8255; - public const int GL_RESET_NOTIFICATION_STRATEGY_ARB = 0x8256; - public const int GL_NO_RESET_NOTIFICATION_ARB = 0x8261; - public const int GL_ARB_robustness_isolation = 1; - public const int GL_ARB_sample_locations = 1; - public const int GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB = 0x933D; - public const int GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB = 0x933E; - public const int GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB = 0x933F; - public const int GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB = 0x9340; - public const int GL_SAMPLE_LOCATION_ARB = 0x8E50; - public const int GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB = 0x9341; - public const int GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB = 0x9342; - public const int GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB = 0x9343; - public const int GL_ARB_sample_shading = 1; - public const int GL_SAMPLE_SHADING_ARB = 0x8C36; - public const int GL_MIN_SAMPLE_SHADING_VALUE_ARB = 0x8C37; - public const int GL_ARB_sampler_objects = 1; - public const int GL_ARB_seamless_cube_map = 1; - public const int GL_ARB_seamless_cubemap_per_texture = 1; - public const int GL_ARB_separate_shader_objects = 1; - public const int GL_ARB_shader_atomic_counter_ops = 1; - public const int GL_ARB_shader_atomic_counters = 1; - public const int GL_ARB_shader_ballot = 1; - public const int GL_ARB_shader_bit_encoding = 1; - public const int GL_ARB_shader_clock = 1; - public const int GL_ARB_shader_draw_parameters = 1; - public const int GL_ARB_shader_group_vote = 1; - public const int GL_ARB_shader_image_load_store = 1; - public const int GL_ARB_shader_image_size = 1; - public const int GL_ARB_shader_objects = 1; - public const int GL_PROGRAM_OBJECT_ARB = 0x8B40; - public const int GL_SHADER_OBJECT_ARB = 0x8B48; - public const int GL_OBJECT_TYPE_ARB = 0x8B4E; - public const int GL_OBJECT_SUBTYPE_ARB = 0x8B4F; - public const int GL_FLOAT_VEC2_ARB = 0x8B50; - public const int GL_FLOAT_VEC3_ARB = 0x8B51; - public const int GL_FLOAT_VEC4_ARB = 0x8B52; - public const int GL_INT_VEC2_ARB = 0x8B53; - public const int GL_INT_VEC3_ARB = 0x8B54; - public const int GL_INT_VEC4_ARB = 0x8B55; - public const int GL_BOOL_ARB = 0x8B56; - public const int GL_BOOL_VEC2_ARB = 0x8B57; - public const int GL_BOOL_VEC3_ARB = 0x8B58; - public const int GL_BOOL_VEC4_ARB = 0x8B59; - public const int GL_FLOAT_MAT2_ARB = 0x8B5A; - public const int GL_FLOAT_MAT3_ARB = 0x8B5B; - public const int GL_FLOAT_MAT4_ARB = 0x8B5C; - public const int GL_SAMPLER_1D_ARB = 0x8B5D; - public const int GL_SAMPLER_2D_ARB = 0x8B5E; - public const int GL_SAMPLER_3D_ARB = 0x8B5F; - public const int GL_SAMPLER_CUBE_ARB = 0x8B60; - public const int GL_SAMPLER_1D_SHADOW_ARB = 0x8B61; - public const int GL_SAMPLER_2D_SHADOW_ARB = 0x8B62; - public const int GL_SAMPLER_2D_RECT_ARB = 0x8B63; - public const int GL_SAMPLER_2D_RECT_SHADOW_ARB = 0x8B64; - public const int GL_OBJECT_DELETE_STATUS_ARB = 0x8B80; - public const int GL_OBJECT_COMPILE_STATUS_ARB = 0x8B81; - public const int GL_OBJECT_LINK_STATUS_ARB = 0x8B82; - public const int GL_OBJECT_VALIDATE_STATUS_ARB = 0x8B83; - public const int GL_OBJECT_INFO_LOG_LENGTH_ARB = 0x8B84; - public const int GL_OBJECT_ATTACHED_OBJECTS_ARB = 0x8B85; - public const int GL_OBJECT_ACTIVE_UNIFORMS_ARB = 0x8B86; - public const int GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB = 0x8B87; - public const int GL_OBJECT_SHADER_SOURCE_LENGTH_ARB = 0x8B88; - public const int GL_ARB_shader_precision = 1; - public const int GL_ARB_shader_stencil_export = 1; - public const int GL_ARB_shader_storage_buffer_object = 1; - public const int GL_ARB_shader_subroutine = 1; - public const int GL_ARB_shader_texture_image_samples = 1; - public const int GL_ARB_shader_texture_lod = 1; - public const int GL_ARB_shader_viewport_layer_array = 1; - public const int GL_ARB_shading_language_100 = 1; - public const int GL_SHADING_LANGUAGE_VERSION_ARB = 0x8B8C; - public const int GL_ARB_shading_language_420pack = 1; - public const int GL_ARB_shading_language_include = 1; - public const int GL_SHADER_INCLUDE_ARB = 0x8DAE; - public const int GL_NAMED_STRING_LENGTH_ARB = 0x8DE9; - public const int GL_NAMED_STRING_TYPE_ARB = 0x8DEA; - public const int GL_ARB_shading_language_packing = 1; - public const int GL_ARB_shadow = 1; - public const int GL_TEXTURE_COMPARE_MODE_ARB = 0x884C; - public const int GL_TEXTURE_COMPARE_FUNC_ARB = 0x884D; - public const int GL_COMPARE_R_TO_TEXTURE_ARB = 0x884E; - public const int GL_ARB_shadow_ambient = 1; - public const int GL_TEXTURE_COMPARE_FAIL_VALUE_ARB = 0x80BF; - public const int GL_ARB_sparse_buffer = 1; - public const int GL_SPARSE_STORAGE_BIT_ARB = 0x0400; - public const int GL_SPARSE_BUFFER_PAGE_SIZE_ARB = 0x82F8; - public const int GL_ARB_sparse_texture = 1; - public const int GL_TEXTURE_SPARSE_ARB = 0x91A6; - public const int GL_VIRTUAL_PAGE_SIZE_INDEX_ARB = 0x91A7; - public const int GL_NUM_SPARSE_LEVELS_ARB = 0x91AA; - public const int GL_NUM_VIRTUAL_PAGE_SIZES_ARB = 0x91A8; - public const int GL_VIRTUAL_PAGE_SIZE_X_ARB = 0x9195; - public const int GL_VIRTUAL_PAGE_SIZE_Y_ARB = 0x9196; - public const int GL_VIRTUAL_PAGE_SIZE_Z_ARB = 0x9197; - public const int GL_MAX_SPARSE_TEXTURE_SIZE_ARB = 0x9198; - public const int GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB = 0x9199; - public const int GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB = 0x919A; - public const int GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB = 0x91A9; - public const int GL_ARB_sparse_texture2 = 1; - public const int GL_ARB_sparse_texture_clamp = 1; - public const int GL_ARB_spirv_extensions = 1; - public const int GL_ARB_stencil_texturing = 1; - public const int GL_ARB_sync = 1; - public const int GL_ARB_tessellation_shader = 1; - public const int GL_ARB_texture_barrier = 1; - public const int GL_ARB_texture_border_clamp = 1; - public const int GL_CLAMP_TO_BORDER_ARB = 0x812D; - public const int GL_ARB_texture_buffer_object = 1; - public const int GL_TEXTURE_BUFFER_ARB = 0x8C2A; - public const int GL_MAX_TEXTURE_BUFFER_SIZE_ARB = 0x8C2B; - public const int GL_TEXTURE_BINDING_BUFFER_ARB = 0x8C2C; - public const int GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB = 0x8C2D; - public const int GL_TEXTURE_BUFFER_FORMAT_ARB = 0x8C2E; - public const int GL_ARB_texture_buffer_object_rgb32 = 1; - public const int GL_ARB_texture_buffer_range = 1; - public const int GL_ARB_texture_compression = 1; - public const int GL_COMPRESSED_ALPHA_ARB = 0x84E9; - public const int GL_COMPRESSED_LUMINANCE_ARB = 0x84EA; - public const int GL_COMPRESSED_LUMINANCE_ALPHA_ARB = 0x84EB; - public const int GL_COMPRESSED_INTENSITY_ARB = 0x84EC; - public const int GL_COMPRESSED_RGB_ARB = 0x84ED; - public const int GL_COMPRESSED_RGBA_ARB = 0x84EE; - public const int GL_TEXTURE_COMPRESSION_HINT_ARB = 0x84EF; - public const int GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB = 0x86A0; - public const int GL_TEXTURE_COMPRESSED_ARB = 0x86A1; - public const int GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A2; - public const int GL_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3; - public const int GL_ARB_texture_compression_bptc = 1; - public const int GL_COMPRESSED_RGBA_BPTC_UNORM_ARB = 0x8E8C; - public const int GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB = 0x8E8D; - public const int GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB = 0x8E8E; - public const int GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB = 0x8E8F; - public const int GL_ARB_texture_compression_rgtc = 1; - public const int GL_ARB_texture_cube_map = 1; - public const int GL_NORMAL_MAP_ARB = 0x8511; - public const int GL_REFLECTION_MAP_ARB = 0x8512; - public const int GL_TEXTURE_CUBE_MAP_ARB = 0x8513; - public const int GL_TEXTURE_BINDING_CUBE_MAP_ARB = 0x8514; - public const int GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x8515; - public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x8516; - public const int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x8517; - public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x8518; - public const int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x8519; - public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x851A; - public const int GL_PROXY_TEXTURE_CUBE_MAP_ARB = 0x851B; - public const int GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 0x851C; - public const int GL_ARB_texture_cube_map_array = 1; - public const int GL_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x9009; - public const int GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB = 0x900A; - public const int GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x900B; - public const int GL_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900C; - public const int GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB = 0x900D; - public const int GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900E; - public const int GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900F; - public const int GL_ARB_texture_env_add = 1; - public const int GL_ARB_texture_env_combine = 1; - public const int GL_COMBINE_ARB = 0x8570; - public const int GL_COMBINE_RGB_ARB = 0x8571; - public const int GL_COMBINE_ALPHA_ARB = 0x8572; - public const int GL_SOURCE0_RGB_ARB = 0x8580; - public const int GL_SOURCE1_RGB_ARB = 0x8581; - public const int GL_SOURCE2_RGB_ARB = 0x8582; - public const int GL_SOURCE0_ALPHA_ARB = 0x8588; - public const int GL_SOURCE1_ALPHA_ARB = 0x8589; - public const int GL_SOURCE2_ALPHA_ARB = 0x858A; - public const int GL_OPERAND0_RGB_ARB = 0x8590; - public const int GL_OPERAND1_RGB_ARB = 0x8591; - public const int GL_OPERAND2_RGB_ARB = 0x8592; - public const int GL_OPERAND0_ALPHA_ARB = 0x8598; - public const int GL_OPERAND1_ALPHA_ARB = 0x8599; - public const int GL_OPERAND2_ALPHA_ARB = 0x859A; - public const int GL_RGB_SCALE_ARB = 0x8573; - public const int GL_ADD_SIGNED_ARB = 0x8574; - public const int GL_INTERPOLATE_ARB = 0x8575; - public const int GL_SUBTRACT_ARB = 0x84E7; - public const int GL_CONSTANT_ARB = 0x8576; - public const int GL_PRIMARY_COLOR_ARB = 0x8577; - public const int GL_PREVIOUS_ARB = 0x8578; - public const int GL_ARB_texture_env_crossbar = 1; - public const int GL_ARB_texture_env_dot3 = 1; - public const int GL_DOT3_RGB_ARB = 0x86AE; - public const int GL_DOT3_RGBA_ARB = 0x86AF; - public const int GL_ARB_texture_filter_anisotropic = 1; - public const int GL_ARB_texture_filter_minmax = 1; - public const int GL_TEXTURE_REDUCTION_MODE_ARB = 0x9366; - public const int GL_WEIGHTED_AVERAGE_ARB = 0x9367; - public const int GL_ARB_texture_float = 1; - public const int GL_TEXTURE_RED_TYPE_ARB = 0x8C10; - public const int GL_TEXTURE_GREEN_TYPE_ARB = 0x8C11; - public const int GL_TEXTURE_BLUE_TYPE_ARB = 0x8C12; - public const int GL_TEXTURE_ALPHA_TYPE_ARB = 0x8C13; - public const int GL_TEXTURE_LUMINANCE_TYPE_ARB = 0x8C14; - public const int GL_TEXTURE_INTENSITY_TYPE_ARB = 0x8C15; - public const int GL_TEXTURE_DEPTH_TYPE_ARB = 0x8C16; - public const int GL_UNSIGNED_NORMALIZED_ARB = 0x8C17; - public const int GL_RGBA32F_ARB = 0x8814; - public const int GL_RGB32F_ARB = 0x8815; - public const int GL_ALPHA32F_ARB = 0x8816; - public const int GL_INTENSITY32F_ARB = 0x8817; - public const int GL_LUMINANCE32F_ARB = 0x8818; - public const int GL_LUMINANCE_ALPHA32F_ARB = 0x8819; - public const int GL_RGBA16F_ARB = 0x881A; - public const int GL_RGB16F_ARB = 0x881B; - public const int GL_ALPHA16F_ARB = 0x881C; - public const int GL_INTENSITY16F_ARB = 0x881D; - public const int GL_LUMINANCE16F_ARB = 0x881E; - public const int GL_LUMINANCE_ALPHA16F_ARB = 0x881F; - public const int GL_ARB_texture_gather = 1; - public const int GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5E; - public const int GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5F; - public const int GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB = 0x8F9F; - public const int GL_ARB_texture_mirror_clamp_to_edge = 1; - public const int GL_ARB_texture_mirrored_repeat = 1; - public const int GL_MIRRORED_REPEAT_ARB = 0x8370; - public const int GL_ARB_texture_multisample = 1; - public const int GL_ARB_texture_non_power_of_two = 1; - public const int GL_ARB_texture_query_levels = 1; - public const int GL_ARB_texture_query_lod = 1; - public const int GL_ARB_texture_rectangle = 1; - public const int GL_TEXTURE_RECTANGLE_ARB = 0x84F5; - public const int GL_TEXTURE_BINDING_RECTANGLE_ARB = 0x84F6; - public const int GL_PROXY_TEXTURE_RECTANGLE_ARB = 0x84F7; - public const int GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB = 0x84F8; - public const int GL_ARB_texture_rg = 1; - public const int GL_ARB_texture_rgb10_a2ui = 1; - public const int GL_ARB_texture_stencil8 = 1; - public const int GL_ARB_texture_storage = 1; - public const int GL_ARB_texture_storage_multisample = 1; - public const int GL_ARB_texture_swizzle = 1; - public const int GL_ARB_texture_view = 1; - public const int GL_ARB_timer_query = 1; - public const int GL_ARB_transform_feedback2 = 1; - public const int GL_ARB_transform_feedback3 = 1; - public const int GL_ARB_transform_feedback_instanced = 1; - public const int GL_ARB_transform_feedback_overflow_query = 1; - public const int GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB = 0x82EC; - public const int GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB = 0x82ED; - public const int GL_ARB_transpose_matrix = 1; - public const int GL_TRANSPOSE_MODELVIEW_MATRIX_ARB = 0x84E3; - public const int GL_TRANSPOSE_PROJECTION_MATRIX_ARB = 0x84E4; - public const int GL_TRANSPOSE_TEXTURE_MATRIX_ARB = 0x84E5; - public const int GL_TRANSPOSE_COLOR_MATRIX_ARB = 0x84E6; - public const int GL_ARB_uniform_buffer_object = 1; - public const int GL_ARB_vertex_array_bgra = 1; - public const int GL_ARB_vertex_array_object = 1; - public const int GL_ARB_vertex_attrib_64bit = 1; - public const int GL_ARB_vertex_attrib_binding = 1; - public const int GL_ARB_vertex_blend = 1; - public const int GL_MAX_VERTEX_UNITS_ARB = 0x86A4; - public const int GL_ACTIVE_VERTEX_UNITS_ARB = 0x86A5; - public const int GL_WEIGHT_SUM_UNITY_ARB = 0x86A6; - public const int GL_VERTEX_BLEND_ARB = 0x86A7; - public const int GL_CURRENT_WEIGHT_ARB = 0x86A8; - public const int GL_WEIGHT_ARRAY_TYPE_ARB = 0x86A9; - public const int GL_WEIGHT_ARRAY_STRIDE_ARB = 0x86AA; - public const int GL_WEIGHT_ARRAY_SIZE_ARB = 0x86AB; - public const int GL_WEIGHT_ARRAY_POINTER_ARB = 0x86AC; - public const int GL_WEIGHT_ARRAY_ARB = 0x86AD; - public const int GL_MODELVIEW0_ARB = 0x1700; - public const int GL_MODELVIEW1_ARB = 0x850A; - public const int GL_MODELVIEW2_ARB = 0x8722; - public const int GL_MODELVIEW3_ARB = 0x8723; - public const int GL_MODELVIEW4_ARB = 0x8724; - public const int GL_MODELVIEW5_ARB = 0x8725; - public const int GL_MODELVIEW6_ARB = 0x8726; - public const int GL_MODELVIEW7_ARB = 0x8727; - public const int GL_MODELVIEW8_ARB = 0x8728; - public const int GL_MODELVIEW9_ARB = 0x8729; - public const int GL_MODELVIEW10_ARB = 0x872A; - public const int GL_MODELVIEW11_ARB = 0x872B; - public const int GL_MODELVIEW12_ARB = 0x872C; - public const int GL_MODELVIEW13_ARB = 0x872D; - public const int GL_MODELVIEW14_ARB = 0x872E; - public const int GL_MODELVIEW15_ARB = 0x872F; - public const int GL_MODELVIEW16_ARB = 0x8730; - public const int GL_MODELVIEW17_ARB = 0x8731; - public const int GL_MODELVIEW18_ARB = 0x8732; - public const int GL_MODELVIEW19_ARB = 0x8733; - public const int GL_MODELVIEW20_ARB = 0x8734; - public const int GL_MODELVIEW21_ARB = 0x8735; - public const int GL_MODELVIEW22_ARB = 0x8736; - public const int GL_MODELVIEW23_ARB = 0x8737; - public const int GL_MODELVIEW24_ARB = 0x8738; - public const int GL_MODELVIEW25_ARB = 0x8739; - public const int GL_MODELVIEW26_ARB = 0x873A; - public const int GL_MODELVIEW27_ARB = 0x873B; - public const int GL_MODELVIEW28_ARB = 0x873C; - public const int GL_MODELVIEW29_ARB = 0x873D; - public const int GL_MODELVIEW30_ARB = 0x873E; - public const int GL_MODELVIEW31_ARB = 0x873F; - public const int GL_ARB_vertex_buffer_object = 1; - public const int GL_BUFFER_SIZE_ARB = 0x8764; - public const int GL_BUFFER_USAGE_ARB = 0x8765; - public const int GL_ARRAY_BUFFER_ARB = 0x8892; - public const int GL_ELEMENT_ARRAY_BUFFER_ARB = 0x8893; - public const int GL_ARRAY_BUFFER_BINDING_ARB = 0x8894; - public const int GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB = 0x8895; - public const int GL_VERTEX_ARRAY_BUFFER_BINDING_ARB = 0x8896; - public const int GL_NORMAL_ARRAY_BUFFER_BINDING_ARB = 0x8897; - public const int GL_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x8898; - public const int GL_INDEX_ARRAY_BUFFER_BINDING_ARB = 0x8899; - public const int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB = 0x889A; - public const int GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB = 0x889B; - public const int GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x889C; - public const int GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB = 0x889D; - public const int GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB = 0x889E; - public const int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB = 0x889F; - public const int GL_READ_ONLY_ARB = 0x88B8; - public const int GL_WRITE_ONLY_ARB = 0x88B9; - public const int GL_READ_WRITE_ARB = 0x88BA; - public const int GL_BUFFER_ACCESS_ARB = 0x88BB; - public const int GL_BUFFER_MAPPED_ARB = 0x88BC; - public const int GL_BUFFER_MAP_POINTER_ARB = 0x88BD; - public const int GL_STREAM_DRAW_ARB = 0x88E0; - public const int GL_STREAM_READ_ARB = 0x88E1; - public const int GL_STREAM_COPY_ARB = 0x88E2; - public const int GL_STATIC_DRAW_ARB = 0x88E4; - public const int GL_STATIC_READ_ARB = 0x88E5; - public const int GL_STATIC_COPY_ARB = 0x88E6; - public const int GL_DYNAMIC_DRAW_ARB = 0x88E8; - public const int GL_DYNAMIC_READ_ARB = 0x88E9; - public const int GL_DYNAMIC_COPY_ARB = 0x88EA; - public const int GL_ARB_vertex_program = 1; - public const int GL_COLOR_SUM_ARB = 0x8458; - public const int GL_VERTEX_PROGRAM_ARB = 0x8620; - public const int GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622; - public const int GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623; - public const int GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624; - public const int GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625; - public const int GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626; - public const int GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642; - public const int GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643; - public const int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645; - public const int GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869; - public const int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A; - public const int GL_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B0; - public const int GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B1; - public const int GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B2; - public const int GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B3; - public const int GL_ARB_vertex_shader = 1; - public const int GL_VERTEX_SHADER_ARB = 0x8B31; - public const int GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB = 0x8B4A; - public const int GL_MAX_VARYING_FLOATS_ARB = 0x8B4B; - public const int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = 0x8B4C; - public const int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB = 0x8B4D; - public const int GL_OBJECT_ACTIVE_ATTRIBUTES_ARB = 0x8B89; - public const int GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB = 0x8B8A; - public const int GL_ARB_vertex_type_10f_11f_11f_rev = 1; - public const int GL_ARB_vertex_type_2_10_10_10_rev = 1; - public const int GL_ARB_viewport_array = 1; - public const int GL_ARB_window_pos = 1; - public const int GL_KHR_blend_equation_advanced = 1; - public const int GL_MULTIPLY_KHR = 0x9294; - public const int GL_SCREEN_KHR = 0x9295; - public const int GL_OVERLAY_KHR = 0x9296; - public const int GL_DARKEN_KHR = 0x9297; - public const int GL_LIGHTEN_KHR = 0x9298; - public const int GL_COLORDODGE_KHR = 0x9299; - public const int GL_COLORBURN_KHR = 0x929A; - public const int GL_HARDLIGHT_KHR = 0x929B; - public const int GL_SOFTLIGHT_KHR = 0x929C; - public const int GL_DIFFERENCE_KHR = 0x929E; - public const int GL_EXCLUSION_KHR = 0x92A0; - public const int GL_HSL_HUE_KHR = 0x92AD; - public const int GL_HSL_SATURATION_KHR = 0x92AE; - public const int GL_HSL_COLOR_KHR = 0x92AF; - public const int GL_HSL_LUMINOSITY_KHR = 0x92B0; - public const int GL_KHR_blend_equation_advanced_coherent = 1; - public const int GL_BLEND_ADVANCED_COHERENT_KHR = 0x9285; - public const int GL_KHR_context_flush_control = 1; - public const int GL_KHR_debug = 1; - public const int GL_KHR_no_error = 1; - public const int GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR = 0x00000008; - public const int GL_KHR_parallel_shader_compile = 1; - public const int GL_MAX_SHADER_COMPILER_THREADS_KHR = 0x91B0; - public const int GL_COMPLETION_STATUS_KHR = 0x91B1; - public const int GL_KHR_robust_buffer_access_behavior = 1; - public const int GL_KHR_robustness = 1; - public const int GL_CONTEXT_ROBUST_ACCESS = 0x90F3; - public const int GL_KHR_texture_compression_astc_hdr = 1; - public const int GL_COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0; - public const int GL_COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1; - public const int GL_COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2; - public const int GL_COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3; - public const int GL_COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4; - public const int GL_COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5; - public const int GL_COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6; - public const int GL_COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7; - public const int GL_COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8; - public const int GL_COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9; - public const int GL_COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA; - public const int GL_COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB; - public const int GL_COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC; - public const int GL_COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD; - public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0; - public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1; - public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2; - public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3; - public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4; - public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5; - public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6; - public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7; - public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8; - public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9; - public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA; - public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB; - public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC; - public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD; - public const int GL_KHR_texture_compression_astc_ldr = 1; - public const int GL_KHR_texture_compression_astc_sliced_3d = 1; - public const int GL_OES_byte_coordinates = 1; - public const int GL_OES_compressed_paletted_texture = 1; - public const int GL_PALETTE4_RGB8_OES = 0x8B90; - public const int GL_PALETTE4_RGBA8_OES = 0x8B91; - public const int GL_PALETTE4_R5_G6_B5_OES = 0x8B92; - public const int GL_PALETTE4_RGBA4_OES = 0x8B93; - public const int GL_PALETTE4_RGB5_A1_OES = 0x8B94; - public const int GL_PALETTE8_RGB8_OES = 0x8B95; - public const int GL_PALETTE8_RGBA8_OES = 0x8B96; - public const int GL_PALETTE8_R5_G6_B5_OES = 0x8B97; - public const int GL_PALETTE8_RGBA4_OES = 0x8B98; - public const int GL_PALETTE8_RGB5_A1_OES = 0x8B99; - public const int GL_OES_fixed_point = 1; - public const int GL_FIXED_OES = 0x140C; - public const int GL_OES_query_matrix = 1; - public const int GL_OES_read_format = 1; - public const int GL_IMPLEMENTATION_COLOR_READ_TYPE_OES = 0x8B9A; - public const int GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES = 0x8B9B; - public const int GL_OES_single_precision = 1; - public const int GL_3DFX_multisample = 1; - public const int GL_MULTISAMPLE_3DFX = 0x86B2; - public const int GL_SAMPLE_BUFFERS_3DFX = 0x86B3; - public const int GL_SAMPLES_3DFX = 0x86B4; - public const int GL_MULTISAMPLE_BIT_3DFX = 0x20000000; - public const int GL_3DFX_tbuffer = 1; - public const int GL_3DFX_texture_compression_FXT1 = 1; - public const int GL_COMPRESSED_RGB_FXT1_3DFX = 0x86B0; - public const int GL_COMPRESSED_RGBA_FXT1_3DFX = 0x86B1; - public const int GL_AMD_blend_minmax_factor = 1; - public const int GL_FACTOR_MIN_AMD = 0x901C; - public const int GL_FACTOR_MAX_AMD = 0x901D; - public const int GL_AMD_conservative_depth = 1; - public const int GL_AMD_debug_output = 1; - public const int GL_MAX_DEBUG_MESSAGE_LENGTH_AMD = 0x9143; - public const int GL_MAX_DEBUG_LOGGED_MESSAGES_AMD = 0x9144; - public const int GL_DEBUG_LOGGED_MESSAGES_AMD = 0x9145; - public const int GL_DEBUG_SEVERITY_HIGH_AMD = 0x9146; - public const int GL_DEBUG_SEVERITY_MEDIUM_AMD = 0x9147; - public const int GL_DEBUG_SEVERITY_LOW_AMD = 0x9148; - public const int GL_DEBUG_CATEGORY_API_ERROR_AMD = 0x9149; - public const int GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD = 0x914A; - public const int GL_DEBUG_CATEGORY_DEPRECATION_AMD = 0x914B; - public const int GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD = 0x914C; - public const int GL_DEBUG_CATEGORY_PERFORMANCE_AMD = 0x914D; - public const int GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD = 0x914E; - public const int GL_DEBUG_CATEGORY_APPLICATION_AMD = 0x914F; - public const int GL_DEBUG_CATEGORY_OTHER_AMD = 0x9150; - public const int GL_AMD_depth_clamp_separate = 1; - public const int GL_DEPTH_CLAMP_NEAR_AMD = 0x901E; - public const int GL_DEPTH_CLAMP_FAR_AMD = 0x901F; - public const int GL_AMD_draw_buffers_blend = 1; - public const int GL_AMD_framebuffer_multisample_advanced = 1; - public const int GL_RENDERBUFFER_STORAGE_SAMPLES_AMD = 0x91B2; - public const int GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD = 0x91B3; - public const int GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD = 0x91B4; - public const int GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD = 0x91B5; - public const int GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B6; - public const int GL_SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B7; - public const int GL_AMD_framebuffer_sample_positions = 1; - public const int GL_SUBSAMPLE_DISTANCE_AMD = 0x883F; - public const int GL_PIXELS_PER_SAMPLE_PATTERN_X_AMD = 0x91AE; - public const int GL_PIXELS_PER_SAMPLE_PATTERN_Y_AMD = 0x91AF; - public const int GL_ALL_PIXELS_AMD = -1; - public const int GL_AMD_gcn_shader = 1; - public const int GL_AMD_gpu_shader_half_float = 1; - public const int GL_FLOAT16_NV = 0x8FF8; - public const int GL_FLOAT16_VEC2_NV = 0x8FF9; - public const int GL_FLOAT16_VEC3_NV = 0x8FFA; - public const int GL_FLOAT16_VEC4_NV = 0x8FFB; - public const int GL_FLOAT16_MAT2_AMD = 0x91C5; - public const int GL_FLOAT16_MAT3_AMD = 0x91C6; - public const int GL_FLOAT16_MAT4_AMD = 0x91C7; - public const int GL_FLOAT16_MAT2x3_AMD = 0x91C8; - public const int GL_FLOAT16_MAT2x4_AMD = 0x91C9; - public const int GL_FLOAT16_MAT3x2_AMD = 0x91CA; - public const int GL_FLOAT16_MAT3x4_AMD = 0x91CB; - public const int GL_FLOAT16_MAT4x2_AMD = 0x91CC; - public const int GL_FLOAT16_MAT4x3_AMD = 0x91CD; - public const int GL_AMD_gpu_shader_int16 = 1; - public const int GL_AMD_gpu_shader_int64 = 1; - public const int GL_INT64_NV = 0x140E; - public const int GL_UNSIGNED_INT64_NV = 0x140F; - public const int GL_INT8_NV = 0x8FE0; - public const int GL_INT8_VEC2_NV = 0x8FE1; - public const int GL_INT8_VEC3_NV = 0x8FE2; - public const int GL_INT8_VEC4_NV = 0x8FE3; - public const int GL_INT16_NV = 0x8FE4; - public const int GL_INT16_VEC2_NV = 0x8FE5; - public const int GL_INT16_VEC3_NV = 0x8FE6; - public const int GL_INT16_VEC4_NV = 0x8FE7; - public const int GL_INT64_VEC2_NV = 0x8FE9; - public const int GL_INT64_VEC3_NV = 0x8FEA; - public const int GL_INT64_VEC4_NV = 0x8FEB; - public const int GL_UNSIGNED_INT8_NV = 0x8FEC; - public const int GL_UNSIGNED_INT8_VEC2_NV = 0x8FED; - public const int GL_UNSIGNED_INT8_VEC3_NV = 0x8FEE; - public const int GL_UNSIGNED_INT8_VEC4_NV = 0x8FEF; - public const int GL_UNSIGNED_INT16_NV = 0x8FF0; - public const int GL_UNSIGNED_INT16_VEC2_NV = 0x8FF1; - public const int GL_UNSIGNED_INT16_VEC3_NV = 0x8FF2; - public const int GL_UNSIGNED_INT16_VEC4_NV = 0x8FF3; - public const int GL_UNSIGNED_INT64_VEC2_NV = 0x8FF5; - public const int GL_UNSIGNED_INT64_VEC3_NV = 0x8FF6; - public const int GL_UNSIGNED_INT64_VEC4_NV = 0x8FF7; - public const int GL_AMD_interleaved_elements = 1; - public const int GL_VERTEX_ELEMENT_SWIZZLE_AMD = 0x91A4; - public const int GL_VERTEX_ID_SWIZZLE_AMD = 0x91A5; - public const int GL_AMD_multi_draw_indirect = 1; - public const int GL_AMD_name_gen_delete = 1; - public const int GL_DATA_BUFFER_AMD = 0x9151; - public const int GL_PERFORMANCE_MONITOR_AMD = 0x9152; - public const int GL_QUERY_OBJECT_AMD = 0x9153; - public const int GL_VERTEX_ARRAY_OBJECT_AMD = 0x9154; - public const int GL_SAMPLER_OBJECT_AMD = 0x9155; - public const int GL_AMD_occlusion_query_event = 1; - public const int GL_OCCLUSION_QUERY_EVENT_MASK_AMD = 0x874F; - public const int GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD = 0x00000001; - public const int GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD = 0x00000002; - public const int GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD = 0x00000004; - public const int GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD = 0x00000008; - public const int GL_QUERY_ALL_EVENT_BITS_AMD = -1; - public const int GL_AMD_performance_monitor = 1; - public const int GL_COUNTER_TYPE_AMD = 0x8BC0; - public const int GL_COUNTER_RANGE_AMD = 0x8BC1; - public const int GL_UNSIGNED_INT64_AMD = 0x8BC2; - public const int GL_PERCENTAGE_AMD = 0x8BC3; - public const int GL_PERFMON_RESULT_AVAILABLE_AMD = 0x8BC4; - public const int GL_PERFMON_RESULT_SIZE_AMD = 0x8BC5; - public const int GL_PERFMON_RESULT_AMD = 0x8BC6; - public const int GL_AMD_pinned_memory = 1; - public const int GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD = 0x9160; - public const int GL_AMD_query_buffer_object = 1; - public const int GL_QUERY_BUFFER_AMD = 0x9192; - public const int GL_QUERY_BUFFER_BINDING_AMD = 0x9193; - public const int GL_QUERY_RESULT_NO_WAIT_AMD = 0x9194; - public const int GL_AMD_sample_positions = 1; - public const int GL_AMD_seamless_cubemap_per_texture = 1; - public const int GL_AMD_shader_atomic_counter_ops = 1; - public const int GL_AMD_shader_ballot = 1; - public const int GL_AMD_shader_explicit_vertex_parameter = 1; - public const int GL_AMD_shader_gpu_shader_half_float_fetch = 1; - public const int GL_AMD_shader_image_load_store_lod = 1; - public const int GL_AMD_shader_stencil_export = 1; - public const int GL_AMD_shader_trinary_minmax = 1; - public const int GL_AMD_sparse_texture = 1; - public const int GL_VIRTUAL_PAGE_SIZE_X_AMD = 0x9195; - public const int GL_VIRTUAL_PAGE_SIZE_Y_AMD = 0x9196; - public const int GL_VIRTUAL_PAGE_SIZE_Z_AMD = 0x9197; - public const int GL_MAX_SPARSE_TEXTURE_SIZE_AMD = 0x9198; - public const int GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD = 0x9199; - public const int GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS = 0x919A; - public const int GL_MIN_SPARSE_LEVEL_AMD = 0x919B; - public const int GL_MIN_LOD_WARNING_AMD = 0x919C; - public const int GL_TEXTURE_STORAGE_SPARSE_BIT_AMD = 0x00000001; - public const int GL_AMD_stencil_operation_extended = 1; - public const int GL_SET_AMD = 0x874A; - public const int GL_REPLACE_VALUE_AMD = 0x874B; - public const int GL_STENCIL_OP_VALUE_AMD = 0x874C; - public const int GL_STENCIL_BACK_OP_VALUE_AMD = 0x874D; - public const int GL_AMD_texture_gather_bias_lod = 1; - public const int GL_AMD_texture_texture4 = 1; - public const int GL_AMD_transform_feedback3_lines_triangles = 1; - public const int GL_AMD_transform_feedback4 = 1; - public const int GL_STREAM_RASTERIZATION_AMD = 0x91A0; - public const int GL_AMD_vertex_shader_layer = 1; - public const int GL_AMD_vertex_shader_tessellator = 1; - public const int GL_SAMPLER_BUFFER_AMD = 0x9001; - public const int GL_INT_SAMPLER_BUFFER_AMD = 0x9002; - public const int GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD = 0x9003; - public const int GL_TESSELLATION_MODE_AMD = 0x9004; - public const int GL_TESSELLATION_FACTOR_AMD = 0x9005; - public const int GL_DISCRETE_AMD = 0x9006; - public const int GL_CONTINUOUS_AMD = 0x9007; - public const int GL_AMD_vertex_shader_viewport_index = 1; - public const int GL_APPLE_aux_depth_stencil = 1; - public const int GL_AUX_DEPTH_STENCIL_APPLE = 0x8A14; - public const int GL_APPLE_client_storage = 1; - public const int GL_UNPACK_CLIENT_STORAGE_APPLE = 0x85B2; - public const int GL_APPLE_element_array = 1; - public const int GL_ELEMENT_ARRAY_APPLE = 0x8A0C; - public const int GL_ELEMENT_ARRAY_TYPE_APPLE = 0x8A0D; - public const int GL_ELEMENT_ARRAY_POINTER_APPLE = 0x8A0E; - public const int GL_APPLE_fence = 1; - public const int GL_DRAW_PIXELS_APPLE = 0x8A0A; - public const int GL_FENCE_APPLE = 0x8A0B; - public const int GL_APPLE_float_pixels = 1; - public const int GL_HALF_APPLE = 0x140B; - public const int GL_RGBA_FLOAT32_APPLE = 0x8814; - public const int GL_RGB_FLOAT32_APPLE = 0x8815; - public const int GL_ALPHA_FLOAT32_APPLE = 0x8816; - public const int GL_INTENSITY_FLOAT32_APPLE = 0x8817; - public const int GL_LUMINANCE_FLOAT32_APPLE = 0x8818; - public const int GL_LUMINANCE_ALPHA_FLOAT32_APPLE = 0x8819; - public const int GL_RGBA_FLOAT16_APPLE = 0x881A; - public const int GL_RGB_FLOAT16_APPLE = 0x881B; - public const int GL_ALPHA_FLOAT16_APPLE = 0x881C; - public const int GL_INTENSITY_FLOAT16_APPLE = 0x881D; - public const int GL_LUMINANCE_FLOAT16_APPLE = 0x881E; - public const int GL_LUMINANCE_ALPHA_FLOAT16_APPLE = 0x881F; - public const int GL_COLOR_FLOAT_APPLE = 0x8A0F; - public const int GL_APPLE_flush_buffer_range = 1; - public const int GL_BUFFER_SERIALIZED_MODIFY_APPLE = 0x8A12; - public const int GL_BUFFER_FLUSHING_UNMAP_APPLE = 0x8A13; - public const int GL_APPLE_object_purgeable = 1; - public const int GL_BUFFER_OBJECT_APPLE = 0x85B3; - public const int GL_RELEASED_APPLE = 0x8A19; - public const int GL_VOLATILE_APPLE = 0x8A1A; - public const int GL_RETAINED_APPLE = 0x8A1B; - public const int GL_UNDEFINED_APPLE = 0x8A1C; - public const int GL_PURGEABLE_APPLE = 0x8A1D; - public const int GL_APPLE_rgb_422 = 1; - public const int GL_RGB_422_APPLE = 0x8A1F; - public const int GL_UNSIGNED_SHORT_8_8_APPLE = 0x85BA; - public const int GL_UNSIGNED_SHORT_8_8_REV_APPLE = 0x85BB; - public const int GL_RGB_RAW_422_APPLE = 0x8A51; - public const int GL_APPLE_row_bytes = 1; - public const int GL_PACK_ROW_BYTES_APPLE = 0x8A15; - public const int GL_UNPACK_ROW_BYTES_APPLE = 0x8A16; - public const int GL_APPLE_specular_vector = 1; - public const int GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE = 0x85B0; - public const int GL_APPLE_texture_range = 1; - public const int GL_TEXTURE_RANGE_LENGTH_APPLE = 0x85B7; - public const int GL_TEXTURE_RANGE_POINTER_APPLE = 0x85B8; - public const int GL_TEXTURE_STORAGE_HINT_APPLE = 0x85BC; - public const int GL_STORAGE_PRIVATE_APPLE = 0x85BD; - public const int GL_STORAGE_CACHED_APPLE = 0x85BE; - public const int GL_STORAGE_SHARED_APPLE = 0x85BF; - public const int GL_APPLE_transform_hint = 1; - public const int GL_TRANSFORM_HINT_APPLE = 0x85B1; - public const int GL_APPLE_vertex_array_object = 1; - public const int GL_VERTEX_ARRAY_BINDING_APPLE = 0x85B5; - public const int GL_APPLE_vertex_array_range = 1; - public const int GL_VERTEX_ARRAY_RANGE_APPLE = 0x851D; - public const int GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE = 0x851E; - public const int GL_VERTEX_ARRAY_STORAGE_HINT_APPLE = 0x851F; - public const int GL_VERTEX_ARRAY_RANGE_POINTER_APPLE = 0x8521; - public const int GL_STORAGE_CLIENT_APPLE = 0x85B4; - public const int GL_APPLE_vertex_program_evaluators = 1; - public const int GL_VERTEX_ATTRIB_MAP1_APPLE = 0x8A00; - public const int GL_VERTEX_ATTRIB_MAP2_APPLE = 0x8A01; - public const int GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE = 0x8A02; - public const int GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE = 0x8A03; - public const int GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE = 0x8A04; - public const int GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE = 0x8A05; - public const int GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE = 0x8A06; - public const int GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE = 0x8A07; - public const int GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE = 0x8A08; - public const int GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE = 0x8A09; - public const int GL_APPLE_ycbcr_422 = 1; - public const int GL_YCBCR_422_APPLE = 0x85B9; - public const int GL_ATI_draw_buffers = 1; - public const int GL_MAX_DRAW_BUFFERS_ATI = 0x8824; - public const int GL_DRAW_BUFFER0_ATI = 0x8825; - public const int GL_DRAW_BUFFER1_ATI = 0x8826; - public const int GL_DRAW_BUFFER2_ATI = 0x8827; - public const int GL_DRAW_BUFFER3_ATI = 0x8828; - public const int GL_DRAW_BUFFER4_ATI = 0x8829; - public const int GL_DRAW_BUFFER5_ATI = 0x882A; - public const int GL_DRAW_BUFFER6_ATI = 0x882B; - public const int GL_DRAW_BUFFER7_ATI = 0x882C; - public const int GL_DRAW_BUFFER8_ATI = 0x882D; - public const int GL_DRAW_BUFFER9_ATI = 0x882E; - public const int GL_DRAW_BUFFER10_ATI = 0x882F; - public const int GL_DRAW_BUFFER11_ATI = 0x8830; - public const int GL_DRAW_BUFFER12_ATI = 0x8831; - public const int GL_DRAW_BUFFER13_ATI = 0x8832; - public const int GL_DRAW_BUFFER14_ATI = 0x8833; - public const int GL_DRAW_BUFFER15_ATI = 0x8834; - public const int GL_ATI_element_array = 1; - public const int GL_ELEMENT_ARRAY_ATI = 0x8768; - public const int GL_ELEMENT_ARRAY_TYPE_ATI = 0x8769; - public const int GL_ELEMENT_ARRAY_POINTER_ATI = 0x876A; - public const int GL_ATI_envmap_bumpmap = 1; - public const int GL_BUMP_ROT_MATRIX_ATI = 0x8775; - public const int GL_BUMP_ROT_MATRIX_SIZE_ATI = 0x8776; - public const int GL_BUMP_NUM_TEX_UNITS_ATI = 0x8777; - public const int GL_BUMP_TEX_UNITS_ATI = 0x8778; - public const int GL_DUDV_ATI = 0x8779; - public const int GL_DU8DV8_ATI = 0x877A; - public const int GL_BUMP_ENVMAP_ATI = 0x877B; - public const int GL_BUMP_TARGET_ATI = 0x877C; - public const int GL_ATI_fragment_shader = 1; - public const int GL_FRAGMENT_SHADER_ATI = 0x8920; - public const int GL_REG_0_ATI = 0x8921; - public const int GL_REG_1_ATI = 0x8922; - public const int GL_REG_2_ATI = 0x8923; - public const int GL_REG_3_ATI = 0x8924; - public const int GL_REG_4_ATI = 0x8925; - public const int GL_REG_5_ATI = 0x8926; - public const int GL_REG_6_ATI = 0x8927; - public const int GL_REG_7_ATI = 0x8928; - public const int GL_REG_8_ATI = 0x8929; - public const int GL_REG_9_ATI = 0x892A; - public const int GL_REG_10_ATI = 0x892B; - public const int GL_REG_11_ATI = 0x892C; - public const int GL_REG_12_ATI = 0x892D; - public const int GL_REG_13_ATI = 0x892E; - public const int GL_REG_14_ATI = 0x892F; - public const int GL_REG_15_ATI = 0x8930; - public const int GL_REG_16_ATI = 0x8931; - public const int GL_REG_17_ATI = 0x8932; - public const int GL_REG_18_ATI = 0x8933; - public const int GL_REG_19_ATI = 0x8934; - public const int GL_REG_20_ATI = 0x8935; - public const int GL_REG_21_ATI = 0x8936; - public const int GL_REG_22_ATI = 0x8937; - public const int GL_REG_23_ATI = 0x8938; - public const int GL_REG_24_ATI = 0x8939; - public const int GL_REG_25_ATI = 0x893A; - public const int GL_REG_26_ATI = 0x893B; - public const int GL_REG_27_ATI = 0x893C; - public const int GL_REG_28_ATI = 0x893D; - public const int GL_REG_29_ATI = 0x893E; - public const int GL_REG_30_ATI = 0x893F; - public const int GL_REG_31_ATI = 0x8940; - public const int GL_CON_0_ATI = 0x8941; - public const int GL_CON_1_ATI = 0x8942; - public const int GL_CON_2_ATI = 0x8943; - public const int GL_CON_3_ATI = 0x8944; - public const int GL_CON_4_ATI = 0x8945; - public const int GL_CON_5_ATI = 0x8946; - public const int GL_CON_6_ATI = 0x8947; - public const int GL_CON_7_ATI = 0x8948; - public const int GL_CON_8_ATI = 0x8949; - public const int GL_CON_9_ATI = 0x894A; - public const int GL_CON_10_ATI = 0x894B; - public const int GL_CON_11_ATI = 0x894C; - public const int GL_CON_12_ATI = 0x894D; - public const int GL_CON_13_ATI = 0x894E; - public const int GL_CON_14_ATI = 0x894F; - public const int GL_CON_15_ATI = 0x8950; - public const int GL_CON_16_ATI = 0x8951; - public const int GL_CON_17_ATI = 0x8952; - public const int GL_CON_18_ATI = 0x8953; - public const int GL_CON_19_ATI = 0x8954; - public const int GL_CON_20_ATI = 0x8955; - public const int GL_CON_21_ATI = 0x8956; - public const int GL_CON_22_ATI = 0x8957; - public const int GL_CON_23_ATI = 0x8958; - public const int GL_CON_24_ATI = 0x8959; - public const int GL_CON_25_ATI = 0x895A; - public const int GL_CON_26_ATI = 0x895B; - public const int GL_CON_27_ATI = 0x895C; - public const int GL_CON_28_ATI = 0x895D; - public const int GL_CON_29_ATI = 0x895E; - public const int GL_CON_30_ATI = 0x895F; - public const int GL_CON_31_ATI = 0x8960; - public const int GL_MOV_ATI = 0x8961; - public const int GL_ADD_ATI = 0x8963; - public const int GL_MUL_ATI = 0x8964; - public const int GL_SUB_ATI = 0x8965; - public const int GL_DOT3_ATI = 0x8966; - public const int GL_DOT4_ATI = 0x8967; - public const int GL_MAD_ATI = 0x8968; - public const int GL_LERP_ATI = 0x8969; - public const int GL_CND_ATI = 0x896A; - public const int GL_CND0_ATI = 0x896B; - public const int GL_DOT2_ADD_ATI = 0x896C; - public const int GL_SECONDARY_INTERPOLATOR_ATI = 0x896D; - public const int GL_NUM_FRAGMENT_REGISTERS_ATI = 0x896E; - public const int GL_NUM_FRAGMENT_CONSTANTS_ATI = 0x896F; - public const int GL_NUM_PASSES_ATI = 0x8970; - public const int GL_NUM_INSTRUCTIONS_PER_PASS_ATI = 0x8971; - public const int GL_NUM_INSTRUCTIONS_TOTAL_ATI = 0x8972; - public const int GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI = 0x8973; - public const int GL_NUM_LOOPBACK_COMPONENTS_ATI = 0x8974; - public const int GL_COLOR_ALPHA_PAIRING_ATI = 0x8975; - public const int GL_SWIZZLE_STR_ATI = 0x8976; - public const int GL_SWIZZLE_STQ_ATI = 0x8977; - public const int GL_SWIZZLE_STR_DR_ATI = 0x8978; - public const int GL_SWIZZLE_STQ_DQ_ATI = 0x8979; - public const int GL_SWIZZLE_STRQ_ATI = 0x897A; - public const int GL_SWIZZLE_STRQ_DQ_ATI = 0x897B; - public const int GL_RED_BIT_ATI = 0x00000001; - public const int GL_GREEN_BIT_ATI = 0x00000002; - public const int GL_BLUE_BIT_ATI = 0x00000004; - public const int GL_2X_BIT_ATI = 0x00000001; - public const int GL_4X_BIT_ATI = 0x00000002; - public const int GL_8X_BIT_ATI = 0x00000004; - public const int GL_HALF_BIT_ATI = 0x00000008; - public const int GL_QUARTER_BIT_ATI = 0x00000010; - public const int GL_EIGHTH_BIT_ATI = 0x00000020; - public const int GL_SATURATE_BIT_ATI = 0x00000040; - public const int GL_COMP_BIT_ATI = 0x00000002; - public const int GL_NEGATE_BIT_ATI = 0x00000004; - public const int GL_BIAS_BIT_ATI = 0x00000008; - public const int GL_ATI_map_object_buffer = 1; - public const int GL_ATI_meminfo = 1; - public const int GL_VBO_FREE_MEMORY_ATI = 0x87FB; - public const int GL_TEXTURE_FREE_MEMORY_ATI = 0x87FC; - public const int GL_RENDERBUFFER_FREE_MEMORY_ATI = 0x87FD; - public const int GL_ATI_pixel_format_float = 1; - public const int GL_RGBA_FLOAT_MODE_ATI = 0x8820; - public const int GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI = 0x8835; - public const int GL_ATI_pn_triangles = 1; - public const int GL_PN_TRIANGLES_ATI = 0x87F0; - public const int GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F1; - public const int GL_PN_TRIANGLES_POINT_MODE_ATI = 0x87F2; - public const int GL_PN_TRIANGLES_NORMAL_MODE_ATI = 0x87F3; - public const int GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F4; - public const int GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI = 0x87F5; - public const int GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI = 0x87F6; - public const int GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI = 0x87F7; - public const int GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI = 0x87F8; - public const int GL_ATI_separate_stencil = 1; - public const int GL_STENCIL_BACK_FUNC_ATI = 0x8800; - public const int GL_STENCIL_BACK_FAIL_ATI = 0x8801; - public const int GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI = 0x8802; - public const int GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI = 0x8803; - public const int GL_ATI_text_fragment_shader = 1; - public const int GL_TEXT_FRAGMENT_SHADER_ATI = 0x8200; - public const int GL_ATI_texture_env_combine3 = 1; - public const int GL_MODULATE_ADD_ATI = 0x8744; - public const int GL_MODULATE_SIGNED_ADD_ATI = 0x8745; - public const int GL_MODULATE_SUBTRACT_ATI = 0x8746; - public const int GL_ATI_texture_float = 1; - public const int GL_RGBA_FLOAT32_ATI = 0x8814; - public const int GL_RGB_FLOAT32_ATI = 0x8815; - public const int GL_ALPHA_FLOAT32_ATI = 0x8816; - public const int GL_INTENSITY_FLOAT32_ATI = 0x8817; - public const int GL_LUMINANCE_FLOAT32_ATI = 0x8818; - public const int GL_LUMINANCE_ALPHA_FLOAT32_ATI = 0x8819; - public const int GL_RGBA_FLOAT16_ATI = 0x881A; - public const int GL_RGB_FLOAT16_ATI = 0x881B; - public const int GL_ALPHA_FLOAT16_ATI = 0x881C; - public const int GL_INTENSITY_FLOAT16_ATI = 0x881D; - public const int GL_LUMINANCE_FLOAT16_ATI = 0x881E; - public const int GL_LUMINANCE_ALPHA_FLOAT16_ATI = 0x881F; - public const int GL_ATI_texture_mirror_once = 1; - public const int GL_MIRROR_CLAMP_ATI = 0x8742; - public const int GL_MIRROR_CLAMP_TO_EDGE_ATI = 0x8743; - public const int GL_ATI_vertex_array_object = 1; - public const int GL_STATIC_ATI = 0x8760; - public const int GL_DYNAMIC_ATI = 0x8761; - public const int GL_PRESERVE_ATI = 0x8762; - public const int GL_DISCARD_ATI = 0x8763; - public const int GL_OBJECT_BUFFER_SIZE_ATI = 0x8764; - public const int GL_OBJECT_BUFFER_USAGE_ATI = 0x8765; - public const int GL_ARRAY_OBJECT_BUFFER_ATI = 0x8766; - public const int GL_ARRAY_OBJECT_OFFSET_ATI = 0x8767; - public const int GL_ATI_vertex_attrib_array_object = 1; - public const int GL_ATI_vertex_streams = 1; - public const int GL_MAX_VERTEX_STREAMS_ATI = 0x876B; - public const int GL_VERTEX_STREAM0_ATI = 0x876C; - public const int GL_VERTEX_STREAM1_ATI = 0x876D; - public const int GL_VERTEX_STREAM2_ATI = 0x876E; - public const int GL_VERTEX_STREAM3_ATI = 0x876F; - public const int GL_VERTEX_STREAM4_ATI = 0x8770; - public const int GL_VERTEX_STREAM5_ATI = 0x8771; - public const int GL_VERTEX_STREAM6_ATI = 0x8772; - public const int GL_VERTEX_STREAM7_ATI = 0x8773; - public const int GL_VERTEX_SOURCE_ATI = 0x8774; - public const int GL_EXT_422_pixels = 1; - public const int GL_422_EXT = 0x80CC; - public const int GL_422_REV_EXT = 0x80CD; - public const int GL_422_AVERAGE_EXT = 0x80CE; - public const int GL_422_REV_AVERAGE_EXT = 0x80CF; - public const int GL_EXT_EGL_image_storage = 1; - public const int GL_EXT_abgr = 1; - public const int GL_ABGR_EXT = 0x8000; - public const int GL_EXT_bgra = 1; - public const int GL_BGR_EXT = 0x80E0; - public const int GL_BGRA_EXT = 0x80E1; - public const int GL_EXT_bindable_uniform = 1; - public const int GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT = 0x8DE2; - public const int GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT = 0x8DE3; - public const int GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT = 0x8DE4; - public const int GL_MAX_BINDABLE_UNIFORM_SIZE_EXT = 0x8DED; - public const int GL_UNIFORM_BUFFER_EXT = 0x8DEE; - public const int GL_UNIFORM_BUFFER_BINDING_EXT = 0x8DEF; - public const int GL_EXT_blend_color = 1; - public const int GL_CONSTANT_COLOR_EXT = 0x8001; - public const int GL_ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002; - public const int GL_CONSTANT_ALPHA_EXT = 0x8003; - public const int GL_ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004; - public const int GL_BLEND_COLOR_EXT = 0x8005; - public const int GL_EXT_blend_equation_separate = 1; - public const int GL_BLEND_EQUATION_RGB_EXT = 0x8009; - public const int GL_BLEND_EQUATION_ALPHA_EXT = 0x883D; - public const int GL_EXT_blend_func_separate = 1; - public const int GL_BLEND_DST_RGB_EXT = 0x80C8; - public const int GL_BLEND_SRC_RGB_EXT = 0x80C9; - public const int GL_BLEND_DST_ALPHA_EXT = 0x80CA; - public const int GL_BLEND_SRC_ALPHA_EXT = 0x80CB; - public const int GL_EXT_blend_logic_op = 1; - public const int GL_EXT_blend_minmax = 1; - public const int GL_MIN_EXT = 0x8007; - public const int GL_MAX_EXT = 0x8008; - public const int GL_FUNC_ADD_EXT = 0x8006; - public const int GL_BLEND_EQUATION_EXT = 0x8009; - public const int GL_EXT_blend_subtract = 1; - public const int GL_FUNC_SUBTRACT_EXT = 0x800A; - public const int GL_FUNC_REVERSE_SUBTRACT_EXT = 0x800B; - public const int GL_EXT_clip_volume_hint = 1; - public const int GL_CLIP_VOLUME_CLIPPING_HINT_EXT = 0x80F0; - public const int GL_EXT_cmyka = 1; - public const int GL_CMYK_EXT = 0x800C; - public const int GL_CMYKA_EXT = 0x800D; - public const int GL_PACK_CMYK_HINT_EXT = 0x800E; - public const int GL_UNPACK_CMYK_HINT_EXT = 0x800F; - public const int GL_EXT_color_subtable = 1; - public const int GL_EXT_compiled_vertex_array = 1; - public const int GL_ARRAY_ELEMENT_LOCK_FIRST_EXT = 0x81A8; - public const int GL_ARRAY_ELEMENT_LOCK_COUNT_EXT = 0x81A9; - public const int GL_EXT_convolution = 1; - public const int GL_CONVOLUTION_1D_EXT = 0x8010; - public const int GL_CONVOLUTION_2D_EXT = 0x8011; - public const int GL_SEPARABLE_2D_EXT = 0x8012; - public const int GL_CONVOLUTION_BORDER_MODE_EXT = 0x8013; - public const int GL_CONVOLUTION_FILTER_SCALE_EXT = 0x8014; - public const int GL_CONVOLUTION_FILTER_BIAS_EXT = 0x8015; - public const int GL_REDUCE_EXT = 0x8016; - public const int GL_CONVOLUTION_FORMAT_EXT = 0x8017; - public const int GL_CONVOLUTION_WIDTH_EXT = 0x8018; - public const int GL_CONVOLUTION_HEIGHT_EXT = 0x8019; - public const int GL_MAX_CONVOLUTION_WIDTH_EXT = 0x801A; - public const int GL_MAX_CONVOLUTION_HEIGHT_EXT = 0x801B; - public const int GL_POST_CONVOLUTION_RED_SCALE_EXT = 0x801C; - public const int GL_POST_CONVOLUTION_GREEN_SCALE_EXT = 0x801D; - public const int GL_POST_CONVOLUTION_BLUE_SCALE_EXT = 0x801E; - public const int GL_POST_CONVOLUTION_ALPHA_SCALE_EXT = 0x801F; - public const int GL_POST_CONVOLUTION_RED_BIAS_EXT = 0x8020; - public const int GL_POST_CONVOLUTION_GREEN_BIAS_EXT = 0x8021; - public const int GL_POST_CONVOLUTION_BLUE_BIAS_EXT = 0x8022; - public const int GL_POST_CONVOLUTION_ALPHA_BIAS_EXT = 0x8023; - public const int GL_EXT_coordinate_frame = 1; - public const int GL_TANGENT_ARRAY_EXT = 0x8439; - public const int GL_BINORMAL_ARRAY_EXT = 0x843A; - public const int GL_CURRENT_TANGENT_EXT = 0x843B; - public const int GL_CURRENT_BINORMAL_EXT = 0x843C; - public const int GL_TANGENT_ARRAY_TYPE_EXT = 0x843E; - public const int GL_TANGENT_ARRAY_STRIDE_EXT = 0x843F; - public const int GL_BINORMAL_ARRAY_TYPE_EXT = 0x8440; - public const int GL_BINORMAL_ARRAY_STRIDE_EXT = 0x8441; - public const int GL_TANGENT_ARRAY_POINTER_EXT = 0x8442; - public const int GL_BINORMAL_ARRAY_POINTER_EXT = 0x8443; - public const int GL_MAP1_TANGENT_EXT = 0x8444; - public const int GL_MAP2_TANGENT_EXT = 0x8445; - public const int GL_MAP1_BINORMAL_EXT = 0x8446; - public const int GL_MAP2_BINORMAL_EXT = 0x8447; - public const int GL_EXT_copy_texture = 1; - public const int GL_EXT_cull_vertex = 1; - public const int GL_CULL_VERTEX_EXT = 0x81AA; - public const int GL_CULL_VERTEX_EYE_POSITION_EXT = 0x81AB; - public const int GL_CULL_VERTEX_OBJECT_POSITION_EXT = 0x81AC; - public const int GL_EXT_debug_label = 1; - public const int GL_PROGRAM_PIPELINE_OBJECT_EXT = 0x8A4F; - public const int GL_PROGRAM_OBJECT_EXT = 0x8B40; - public const int GL_SHADER_OBJECT_EXT = 0x8B48; - public const int GL_BUFFER_OBJECT_EXT = 0x9151; - public const int GL_QUERY_OBJECT_EXT = 0x9153; - public const int GL_VERTEX_ARRAY_OBJECT_EXT = 0x9154; - public const int GL_EXT_debug_marker = 1; - public const int GL_EXT_depth_bounds_test = 1; - public const int GL_DEPTH_BOUNDS_TEST_EXT = 0x8890; - public const int GL_DEPTH_BOUNDS_EXT = 0x8891; - public const int GL_EXT_direct_state_access = 1; - public const int GL_PROGRAM_MATRIX_EXT = 0x8E2D; - public const int GL_TRANSPOSE_PROGRAM_MATRIX_EXT = 0x8E2E; - public const int GL_PROGRAM_MATRIX_STACK_DEPTH_EXT = 0x8E2F; - public const int GL_EXT_draw_buffers2 = 1; - public const int GL_EXT_draw_instanced = 1; - public const int GL_EXT_draw_range_elements = 1; - public const int GL_MAX_ELEMENTS_VERTICES_EXT = 0x80E8; - public const int GL_MAX_ELEMENTS_INDICES_EXT = 0x80E9; - public const int GL_EXT_external_buffer = 1; - public const int GL_EXT_fog_coord = 1; - public const int GL_FOG_COORDINATE_SOURCE_EXT = 0x8450; - public const int GL_FOG_COORDINATE_EXT = 0x8451; - public const int GL_FRAGMENT_DEPTH_EXT = 0x8452; - public const int GL_CURRENT_FOG_COORDINATE_EXT = 0x8453; - public const int GL_FOG_COORDINATE_ARRAY_TYPE_EXT = 0x8454; - public const int GL_FOG_COORDINATE_ARRAY_STRIDE_EXT = 0x8455; - public const int GL_FOG_COORDINATE_ARRAY_POINTER_EXT = 0x8456; - public const int GL_FOG_COORDINATE_ARRAY_EXT = 0x8457; - public const int GL_EXT_framebuffer_blit = 1; - public const int GL_READ_FRAMEBUFFER_EXT = 0x8CA8; - public const int GL_DRAW_FRAMEBUFFER_EXT = 0x8CA9; - public const int GL_DRAW_FRAMEBUFFER_BINDING_EXT = 0x8CA6; - public const int GL_READ_FRAMEBUFFER_BINDING_EXT = 0x8CAA; - public const int GL_EXT_framebuffer_multisample = 1; - public const int GL_RENDERBUFFER_SAMPLES_EXT = 0x8CAB; - public const int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT = 0x8D56; - public const int GL_MAX_SAMPLES_EXT = 0x8D57; - public const int GL_EXT_framebuffer_multisample_blit_scaled = 1; - public const int GL_SCALED_RESOLVE_FASTEST_EXT = 0x90BA; - public const int GL_SCALED_RESOLVE_NICEST_EXT = 0x90BB; - public const int GL_EXT_framebuffer_object = 1; - public const int GL_INVALID_FRAMEBUFFER_OPERATION_EXT = 0x0506; - public const int GL_MAX_RENDERBUFFER_SIZE_EXT = 0x84E8; - public const int GL_FRAMEBUFFER_BINDING_EXT = 0x8CA6; - public const int GL_RENDERBUFFER_BINDING_EXT = 0x8CA7; - public const int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT = 0x8CD0; - public const int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT = 0x8CD1; - public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT = 0x8CD2; - public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT = 0x8CD3; - public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT = 0x8CD4; - public const int GL_FRAMEBUFFER_COMPLETE_EXT = 0x8CD5; - public const int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT = 0x8CD6; - public const int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT = 0x8CD7; - public const int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT = 0x8CD9; - public const int GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT = 0x8CDA; - public const int GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT = 0x8CDB; - public const int GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT = 0x8CDC; - public const int GL_FRAMEBUFFER_UNSUPPORTED_EXT = 0x8CDD; - public const int GL_MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF; - public const int GL_COLOR_ATTACHMENT0_EXT = 0x8CE0; - public const int GL_COLOR_ATTACHMENT1_EXT = 0x8CE1; - public const int GL_COLOR_ATTACHMENT2_EXT = 0x8CE2; - public const int GL_COLOR_ATTACHMENT3_EXT = 0x8CE3; - public const int GL_COLOR_ATTACHMENT4_EXT = 0x8CE4; - public const int GL_COLOR_ATTACHMENT5_EXT = 0x8CE5; - public const int GL_COLOR_ATTACHMENT6_EXT = 0x8CE6; - public const int GL_COLOR_ATTACHMENT7_EXT = 0x8CE7; - public const int GL_COLOR_ATTACHMENT8_EXT = 0x8CE8; - public const int GL_COLOR_ATTACHMENT9_EXT = 0x8CE9; - public const int GL_COLOR_ATTACHMENT10_EXT = 0x8CEA; - public const int GL_COLOR_ATTACHMENT11_EXT = 0x8CEB; - public const int GL_COLOR_ATTACHMENT12_EXT = 0x8CEC; - public const int GL_COLOR_ATTACHMENT13_EXT = 0x8CED; - public const int GL_COLOR_ATTACHMENT14_EXT = 0x8CEE; - public const int GL_COLOR_ATTACHMENT15_EXT = 0x8CEF; - public const int GL_DEPTH_ATTACHMENT_EXT = 0x8D00; - public const int GL_STENCIL_ATTACHMENT_EXT = 0x8D20; - public const int GL_FRAMEBUFFER_EXT = 0x8D40; - public const int GL_RENDERBUFFER_EXT = 0x8D41; - public const int GL_RENDERBUFFER_WIDTH_EXT = 0x8D42; - public const int GL_RENDERBUFFER_HEIGHT_EXT = 0x8D43; - public const int GL_RENDERBUFFER_INTERNAL_FORMAT_EXT = 0x8D44; - public const int GL_STENCIL_INDEX1_EXT = 0x8D46; - public const int GL_STENCIL_INDEX4_EXT = 0x8D47; - public const int GL_STENCIL_INDEX8_EXT = 0x8D48; - public const int GL_STENCIL_INDEX16_EXT = 0x8D49; - public const int GL_RENDERBUFFER_RED_SIZE_EXT = 0x8D50; - public const int GL_RENDERBUFFER_GREEN_SIZE_EXT = 0x8D51; - public const int GL_RENDERBUFFER_BLUE_SIZE_EXT = 0x8D52; - public const int GL_RENDERBUFFER_ALPHA_SIZE_EXT = 0x8D53; - public const int GL_RENDERBUFFER_DEPTH_SIZE_EXT = 0x8D54; - public const int GL_RENDERBUFFER_STENCIL_SIZE_EXT = 0x8D55; - public const int GL_EXT_framebuffer_sRGB = 1; - public const int GL_FRAMEBUFFER_SRGB_EXT = 0x8DB9; - public const int GL_FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x8DBA; - public const int GL_EXT_geometry_shader4 = 1; - public const int GL_GEOMETRY_SHADER_EXT = 0x8DD9; - public const int GL_GEOMETRY_VERTICES_OUT_EXT = 0x8DDA; - public const int GL_GEOMETRY_INPUT_TYPE_EXT = 0x8DDB; - public const int GL_GEOMETRY_OUTPUT_TYPE_EXT = 0x8DDC; - public const int GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT = 0x8C29; - public const int GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT = 0x8DDD; - public const int GL_MAX_VERTEX_VARYING_COMPONENTS_EXT = 0x8DDE; - public const int GL_MAX_VARYING_COMPONENTS_EXT = 0x8B4B; - public const int GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT = 0x8DDF; - public const int GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT = 0x8DE0; - public const int GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT = 0x8DE1; - public const int GL_LINES_ADJACENCY_EXT = 0x000A; - public const int GL_LINE_STRIP_ADJACENCY_EXT = 0x000B; - public const int GL_TRIANGLES_ADJACENCY_EXT = 0x000C; - public const int GL_TRIANGLE_STRIP_ADJACENCY_EXT = 0x000D; - public const int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT = 0x8DA8; - public const int GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT = 0x8DA9; - public const int GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT = 0x8DA7; - public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT = 0x8CD4; - public const int GL_PROGRAM_POINT_SIZE_EXT = 0x8642; - public const int GL_EXT_gpu_program_parameters = 1; - public const int GL_EXT_gpu_shader4 = 1; - public const int GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT = 0x88FD; - public const int GL_SAMPLER_1D_ARRAY_EXT = 0x8DC0; - public const int GL_SAMPLER_2D_ARRAY_EXT = 0x8DC1; - public const int GL_SAMPLER_BUFFER_EXT = 0x8DC2; - public const int GL_SAMPLER_1D_ARRAY_SHADOW_EXT = 0x8DC3; - public const int GL_SAMPLER_2D_ARRAY_SHADOW_EXT = 0x8DC4; - public const int GL_SAMPLER_CUBE_SHADOW_EXT = 0x8DC5; - public const int GL_UNSIGNED_INT_VEC2_EXT = 0x8DC6; - public const int GL_UNSIGNED_INT_VEC3_EXT = 0x8DC7; - public const int GL_UNSIGNED_INT_VEC4_EXT = 0x8DC8; - public const int GL_INT_SAMPLER_1D_EXT = 0x8DC9; - public const int GL_INT_SAMPLER_2D_EXT = 0x8DCA; - public const int GL_INT_SAMPLER_3D_EXT = 0x8DCB; - public const int GL_INT_SAMPLER_CUBE_EXT = 0x8DCC; - public const int GL_INT_SAMPLER_2D_RECT_EXT = 0x8DCD; - public const int GL_INT_SAMPLER_1D_ARRAY_EXT = 0x8DCE; - public const int GL_INT_SAMPLER_2D_ARRAY_EXT = 0x8DCF; - public const int GL_INT_SAMPLER_BUFFER_EXT = 0x8DD0; - public const int GL_UNSIGNED_INT_SAMPLER_1D_EXT = 0x8DD1; - public const int GL_UNSIGNED_INT_SAMPLER_2D_EXT = 0x8DD2; - public const int GL_UNSIGNED_INT_SAMPLER_3D_EXT = 0x8DD3; - public const int GL_UNSIGNED_INT_SAMPLER_CUBE_EXT = 0x8DD4; - public const int GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT = 0x8DD5; - public const int GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT = 0x8DD6; - public const int GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT = 0x8DD7; - public const int GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT = 0x8DD8; - public const int GL_MIN_PROGRAM_TEXEL_OFFSET_EXT = 0x8904; - public const int GL_MAX_PROGRAM_TEXEL_OFFSET_EXT = 0x8905; - public const int GL_EXT_histogram = 1; - public const int GL_HISTOGRAM_EXT = 0x8024; - public const int GL_PROXY_HISTOGRAM_EXT = 0x8025; - public const int GL_HISTOGRAM_WIDTH_EXT = 0x8026; - public const int GL_HISTOGRAM_FORMAT_EXT = 0x8027; - public const int GL_HISTOGRAM_RED_SIZE_EXT = 0x8028; - public const int GL_HISTOGRAM_GREEN_SIZE_EXT = 0x8029; - public const int GL_HISTOGRAM_BLUE_SIZE_EXT = 0x802A; - public const int GL_HISTOGRAM_ALPHA_SIZE_EXT = 0x802B; - public const int GL_HISTOGRAM_LUMINANCE_SIZE_EXT = 0x802C; - public const int GL_HISTOGRAM_SINK_EXT = 0x802D; - public const int GL_MINMAX_EXT = 0x802E; - public const int GL_MINMAX_FORMAT_EXT = 0x802F; - public const int GL_MINMAX_SINK_EXT = 0x8030; - public const int GL_TABLE_TOO_LARGE_EXT = 0x8031; - public const int GL_EXT_index_array_formats = 1; - public const int GL_IUI_V2F_EXT = 0x81AD; - public const int GL_IUI_V3F_EXT = 0x81AE; - public const int GL_IUI_N3F_V2F_EXT = 0x81AF; - public const int GL_IUI_N3F_V3F_EXT = 0x81B0; - public const int GL_T2F_IUI_V2F_EXT = 0x81B1; - public const int GL_T2F_IUI_V3F_EXT = 0x81B2; - public const int GL_T2F_IUI_N3F_V2F_EXT = 0x81B3; - public const int GL_T2F_IUI_N3F_V3F_EXT = 0x81B4; - public const int GL_EXT_index_func = 1; - public const int GL_INDEX_TEST_EXT = 0x81B5; - public const int GL_INDEX_TEST_FUNC_EXT = 0x81B6; - public const int GL_INDEX_TEST_REF_EXT = 0x81B7; - public const int GL_EXT_index_material = 1; - public const int GL_INDEX_MATERIAL_EXT = 0x81B8; - public const int GL_INDEX_MATERIAL_PARAMETER_EXT = 0x81B9; - public const int GL_INDEX_MATERIAL_FACE_EXT = 0x81BA; - public const int GL_EXT_index_texture = 1; - public const int GL_EXT_light_texture = 1; - public const int GL_FRAGMENT_MATERIAL_EXT = 0x8349; - public const int GL_FRAGMENT_NORMAL_EXT = 0x834A; - public const int GL_FRAGMENT_COLOR_EXT = 0x834C; - public const int GL_ATTENUATION_EXT = 0x834D; - public const int GL_SHADOW_ATTENUATION_EXT = 0x834E; - public const int GL_TEXTURE_APPLICATION_MODE_EXT = 0x834F; - public const int GL_TEXTURE_LIGHT_EXT = 0x8350; - public const int GL_TEXTURE_MATERIAL_FACE_EXT = 0x8351; - public const int GL_TEXTURE_MATERIAL_PARAMETER_EXT = 0x8352; - public const int GL_EXT_memory_object = 1; - public const int GL_TEXTURE_TILING_EXT = 0x9580; - public const int GL_DEDICATED_MEMORY_OBJECT_EXT = 0x9581; - public const int GL_PROTECTED_MEMORY_OBJECT_EXT = 0x959B; - public const int GL_NUM_TILING_TYPES_EXT = 0x9582; - public const int GL_TILING_TYPES_EXT = 0x9583; - public const int GL_OPTIMAL_TILING_EXT = 0x9584; - public const int GL_LINEAR_TILING_EXT = 0x9585; - public const int GL_NUM_DEVICE_UUIDS_EXT = 0x9596; - public const int GL_DEVICE_UUID_EXT = 0x9597; - public const int GL_DRIVER_UUID_EXT = 0x9598; - public const int GL_UUID_SIZE_EXT = 16; - public const int GL_EXT_memory_object_fd = 1; - public const int GL_HANDLE_TYPE_OPAQUE_FD_EXT = 0x9586; - public const int GL_EXT_memory_object_win32 = 1; - public const int GL_HANDLE_TYPE_OPAQUE_WIN32_EXT = 0x9587; - public const int GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT = 0x9588; - public const int GL_DEVICE_LUID_EXT = 0x9599; - public const int GL_DEVICE_NODE_MASK_EXT = 0x959A; - public const int GL_LUID_SIZE_EXT = 8; - public const int GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT = 0x9589; - public const int GL_HANDLE_TYPE_D3D12_RESOURCE_EXT = 0x958A; - public const int GL_HANDLE_TYPE_D3D11_IMAGE_EXT = 0x958B; - public const int GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT = 0x958C; - public const int GL_EXT_misc_attribute = 1; - public const int GL_EXT_multi_draw_arrays = 1; - public const int GL_EXT_multisample = 1; - public const int GL_MULTISAMPLE_EXT = 0x809D; - public const int GL_SAMPLE_ALPHA_TO_MASK_EXT = 0x809E; - public const int GL_SAMPLE_ALPHA_TO_ONE_EXT = 0x809F; - public const int GL_SAMPLE_MASK_EXT = 0x80A0; - public const int GL_1PASS_EXT = 0x80A1; - public const int GL_2PASS_0_EXT = 0x80A2; - public const int GL_2PASS_1_EXT = 0x80A3; - public const int GL_4PASS_0_EXT = 0x80A4; - public const int GL_4PASS_1_EXT = 0x80A5; - public const int GL_4PASS_2_EXT = 0x80A6; - public const int GL_4PASS_3_EXT = 0x80A7; - public const int GL_SAMPLE_BUFFERS_EXT = 0x80A8; - public const int GL_SAMPLES_EXT = 0x80A9; - public const int GL_SAMPLE_MASK_VALUE_EXT = 0x80AA; - public const int GL_SAMPLE_MASK_INVERT_EXT = 0x80AB; - public const int GL_SAMPLE_PATTERN_EXT = 0x80AC; - public const int GL_MULTISAMPLE_BIT_EXT = 0x20000000; - public const int GL_EXT_packed_depth_stencil = 1; - public const int GL_DEPTH_STENCIL_EXT = 0x84F9; - public const int GL_UNSIGNED_INT_24_8_EXT = 0x84FA; - public const int GL_DEPTH24_STENCIL8_EXT = 0x88F0; - public const int GL_TEXTURE_STENCIL_SIZE_EXT = 0x88F1; - public const int GL_EXT_packed_float = 1; - public const int GL_R11F_G11F_B10F_EXT = 0x8C3A; - public const int GL_UNSIGNED_INT_10F_11F_11F_REV_EXT = 0x8C3B; - public const int GL_RGBA_SIGNED_COMPONENTS_EXT = 0x8C3C; - public const int GL_EXT_packed_pixels = 1; - public const int GL_UNSIGNED_BYTE_3_3_2_EXT = 0x8032; - public const int GL_UNSIGNED_SHORT_4_4_4_4_EXT = 0x8033; - public const int GL_UNSIGNED_SHORT_5_5_5_1_EXT = 0x8034; - public const int GL_UNSIGNED_INT_8_8_8_8_EXT = 0x8035; - public const int GL_UNSIGNED_INT_10_10_10_2_EXT = 0x8036; - public const int GL_EXT_paletted_texture = 1; - public const int GL_COLOR_INDEX1_EXT = 0x80E2; - public const int GL_COLOR_INDEX2_EXT = 0x80E3; - public const int GL_COLOR_INDEX4_EXT = 0x80E4; - public const int GL_COLOR_INDEX8_EXT = 0x80E5; - public const int GL_COLOR_INDEX12_EXT = 0x80E6; - public const int GL_COLOR_INDEX16_EXT = 0x80E7; - public const int GL_TEXTURE_INDEX_SIZE_EXT = 0x80ED; - public const int GL_EXT_pixel_buffer_object = 1; - public const int GL_PIXEL_PACK_BUFFER_EXT = 0x88EB; - public const int GL_PIXEL_UNPACK_BUFFER_EXT = 0x88EC; - public const int GL_PIXEL_PACK_BUFFER_BINDING_EXT = 0x88ED; - public const int GL_PIXEL_UNPACK_BUFFER_BINDING_EXT = 0x88EF; - public const int GL_EXT_pixel_transform = 1; - public const int GL_PIXEL_TRANSFORM_2D_EXT = 0x8330; - public const int GL_PIXEL_MAG_FILTER_EXT = 0x8331; - public const int GL_PIXEL_MIN_FILTER_EXT = 0x8332; - public const int GL_PIXEL_CUBIC_WEIGHT_EXT = 0x8333; - public const int GL_CUBIC_EXT = 0x8334; - public const int GL_AVERAGE_EXT = 0x8335; - public const int GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8336; - public const int GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8337; - public const int GL_PIXEL_TRANSFORM_2D_MATRIX_EXT = 0x8338; - public const int GL_EXT_pixel_transform_color_table = 1; - public const int GL_EXT_point_parameters = 1; - public const int GL_POINT_SIZE_MIN_EXT = 0x8126; - public const int GL_POINT_SIZE_MAX_EXT = 0x8127; - public const int GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128; - public const int GL_DISTANCE_ATTENUATION_EXT = 0x8129; - public const int GL_EXT_polygon_offset = 1; - public const int GL_POLYGON_OFFSET_EXT = 0x8037; - public const int GL_POLYGON_OFFSET_FACTOR_EXT = 0x8038; - public const int GL_POLYGON_OFFSET_BIAS_EXT = 0x8039; - public const int GL_EXT_polygon_offset_clamp = 1; - public const int GL_POLYGON_OFFSET_CLAMP_EXT = 0x8E1B; - public const int GL_EXT_post_depth_coverage = 1; - public const int GL_EXT_provoking_vertex = 1; - public const int GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT = 0x8E4C; - public const int GL_FIRST_VERTEX_CONVENTION_EXT = 0x8E4D; - public const int GL_LAST_VERTEX_CONVENTION_EXT = 0x8E4E; - public const int GL_PROVOKING_VERTEX_EXT = 0x8E4F; - public const int GL_EXT_raster_multisample = 1; - public const int GL_RASTER_MULTISAMPLE_EXT = 0x9327; - public const int GL_RASTER_SAMPLES_EXT = 0x9328; - public const int GL_MAX_RASTER_SAMPLES_EXT = 0x9329; - public const int GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT = 0x932A; - public const int GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT = 0x932B; - public const int GL_EFFECTIVE_RASTER_SAMPLES_EXT = 0x932C; - public const int GL_EXT_rescale_normal = 1; - public const int GL_RESCALE_NORMAL_EXT = 0x803A; - public const int GL_EXT_secondary_color = 1; - public const int GL_COLOR_SUM_EXT = 0x8458; - public const int GL_CURRENT_SECONDARY_COLOR_EXT = 0x8459; - public const int GL_SECONDARY_COLOR_ARRAY_SIZE_EXT = 0x845A; - public const int GL_SECONDARY_COLOR_ARRAY_TYPE_EXT = 0x845B; - public const int GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT = 0x845C; - public const int GL_SECONDARY_COLOR_ARRAY_POINTER_EXT = 0x845D; - public const int GL_SECONDARY_COLOR_ARRAY_EXT = 0x845E; - public const int GL_EXT_semaphore = 1; - public const int GL_LAYOUT_GENERAL_EXT = 0x958D; - public const int GL_LAYOUT_COLOR_ATTACHMENT_EXT = 0x958E; - public const int GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT = 0x958F; - public const int GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT = 0x9590; - public const int GL_LAYOUT_SHADER_READ_ONLY_EXT = 0x9591; - public const int GL_LAYOUT_TRANSFER_SRC_EXT = 0x9592; - public const int GL_LAYOUT_TRANSFER_DST_EXT = 0x9593; - public const int GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT = 0x9530; - public const int GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT = 0x9531; - public const int GL_EXT_semaphore_fd = 1; - public const int GL_EXT_semaphore_win32 = 1; - public const int GL_HANDLE_TYPE_D3D12_FENCE_EXT = 0x9594; - public const int GL_D3D12_FENCE_VALUE_EXT = 0x9595; - public const int GL_EXT_separate_shader_objects = 1; - public const int GL_ACTIVE_PROGRAM_EXT = 0x8B8D; - public const int GL_EXT_separate_specular_color = 1; - public const int GL_LIGHT_MODEL_COLOR_CONTROL_EXT = 0x81F8; - public const int GL_SINGLE_COLOR_EXT = 0x81F9; - public const int GL_SEPARATE_SPECULAR_COLOR_EXT = 0x81FA; - public const int GL_EXT_shader_framebuffer_fetch = 1; - public const int GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT = 0x8A52; - public const int GL_EXT_shader_framebuffer_fetch_non_coherent = 1; - public const int GL_EXT_shader_image_load_formatted = 1; - public const int GL_EXT_shader_image_load_store = 1; - public const int GL_MAX_IMAGE_UNITS_EXT = 0x8F38; - public const int GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT = 0x8F39; - public const int GL_IMAGE_BINDING_NAME_EXT = 0x8F3A; - public const int GL_IMAGE_BINDING_LEVEL_EXT = 0x8F3B; - public const int GL_IMAGE_BINDING_LAYERED_EXT = 0x8F3C; - public const int GL_IMAGE_BINDING_LAYER_EXT = 0x8F3D; - public const int GL_IMAGE_BINDING_ACCESS_EXT = 0x8F3E; - public const int GL_IMAGE_1D_EXT = 0x904C; - public const int GL_IMAGE_2D_EXT = 0x904D; - public const int GL_IMAGE_3D_EXT = 0x904E; - public const int GL_IMAGE_2D_RECT_EXT = 0x904F; - public const int GL_IMAGE_CUBE_EXT = 0x9050; - public const int GL_IMAGE_BUFFER_EXT = 0x9051; - public const int GL_IMAGE_1D_ARRAY_EXT = 0x9052; - public const int GL_IMAGE_2D_ARRAY_EXT = 0x9053; - public const int GL_IMAGE_CUBE_MAP_ARRAY_EXT = 0x9054; - public const int GL_IMAGE_2D_MULTISAMPLE_EXT = 0x9055; - public const int GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9056; - public const int GL_INT_IMAGE_1D_EXT = 0x9057; - public const int GL_INT_IMAGE_2D_EXT = 0x9058; - public const int GL_INT_IMAGE_3D_EXT = 0x9059; - public const int GL_INT_IMAGE_2D_RECT_EXT = 0x905A; - public const int GL_INT_IMAGE_CUBE_EXT = 0x905B; - public const int GL_INT_IMAGE_BUFFER_EXT = 0x905C; - public const int GL_INT_IMAGE_1D_ARRAY_EXT = 0x905D; - public const int GL_INT_IMAGE_2D_ARRAY_EXT = 0x905E; - public const int GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x905F; - public const int GL_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x9060; - public const int GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9061; - public const int GL_UNSIGNED_INT_IMAGE_1D_EXT = 0x9062; - public const int GL_UNSIGNED_INT_IMAGE_2D_EXT = 0x9063; - public const int GL_UNSIGNED_INT_IMAGE_3D_EXT = 0x9064; - public const int GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT = 0x9065; - public const int GL_UNSIGNED_INT_IMAGE_CUBE_EXT = 0x9066; - public const int GL_UNSIGNED_INT_IMAGE_BUFFER_EXT = 0x9067; - public const int GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT = 0x9068; - public const int GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT = 0x9069; - public const int GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x906A; - public const int GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x906B; - public const int GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x906C; - public const int GL_MAX_IMAGE_SAMPLES_EXT = 0x906D; - public const int GL_IMAGE_BINDING_FORMAT_EXT = 0x906E; - public const int GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT = 0x00000001; - public const int GL_ELEMENT_ARRAY_BARRIER_BIT_EXT = 0x00000002; - public const int GL_UNIFORM_BARRIER_BIT_EXT = 0x00000004; - public const int GL_TEXTURE_FETCH_BARRIER_BIT_EXT = 0x00000008; - public const int GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT = 0x00000020; - public const int GL_COMMAND_BARRIER_BIT_EXT = 0x00000040; - public const int GL_PIXEL_BUFFER_BARRIER_BIT_EXT = 0x00000080; - public const int GL_TEXTURE_UPDATE_BARRIER_BIT_EXT = 0x00000100; - public const int GL_BUFFER_UPDATE_BARRIER_BIT_EXT = 0x00000200; - public const int GL_FRAMEBUFFER_BARRIER_BIT_EXT = 0x00000400; - public const int GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT = 0x00000800; - public const int GL_ATOMIC_COUNTER_BARRIER_BIT_EXT = 0x00001000; - public const int GL_ALL_BARRIER_BITS_EXT = -1; - public const int GL_EXT_shader_integer_mix = 1; - public const int GL_EXT_shadow_funcs = 1; - public const int GL_EXT_shared_texture_palette = 1; - public const int GL_SHARED_TEXTURE_PALETTE_EXT = 0x81FB; - public const int GL_EXT_sparse_texture2 = 1; - public const int GL_EXT_stencil_clear_tag = 1; - public const int GL_STENCIL_TAG_BITS_EXT = 0x88F2; - public const int GL_STENCIL_CLEAR_TAG_VALUE_EXT = 0x88F3; - public const int GL_EXT_stencil_two_side = 1; - public const int GL_STENCIL_TEST_TWO_SIDE_EXT = 0x8910; - public const int GL_ACTIVE_STENCIL_FACE_EXT = 0x8911; - public const int GL_EXT_stencil_wrap = 1; - public const int GL_INCR_WRAP_EXT = 0x8507; - public const int GL_DECR_WRAP_EXT = 0x8508; - public const int GL_EXT_subtexture = 1; - public const int GL_EXT_texture = 1; - public const int GL_ALPHA4_EXT = 0x803B; - public const int GL_ALPHA8_EXT = 0x803C; - public const int GL_ALPHA12_EXT = 0x803D; - public const int GL_ALPHA16_EXT = 0x803E; - public const int GL_LUMINANCE4_EXT = 0x803F; - public const int GL_LUMINANCE8_EXT = 0x8040; - public const int GL_LUMINANCE12_EXT = 0x8041; - public const int GL_LUMINANCE16_EXT = 0x8042; - public const int GL_LUMINANCE4_ALPHA4_EXT = 0x8043; - public const int GL_LUMINANCE6_ALPHA2_EXT = 0x8044; - public const int GL_LUMINANCE8_ALPHA8_EXT = 0x8045; - public const int GL_LUMINANCE12_ALPHA4_EXT = 0x8046; - public const int GL_LUMINANCE12_ALPHA12_EXT = 0x8047; - public const int GL_LUMINANCE16_ALPHA16_EXT = 0x8048; - public const int GL_INTENSITY_EXT = 0x8049; - public const int GL_INTENSITY4_EXT = 0x804A; - public const int GL_INTENSITY8_EXT = 0x804B; - public const int GL_INTENSITY12_EXT = 0x804C; - public const int GL_INTENSITY16_EXT = 0x804D; - public const int GL_RGB2_EXT = 0x804E; - public const int GL_RGB4_EXT = 0x804F; - public const int GL_RGB5_EXT = 0x8050; - public const int GL_RGB8_EXT = 0x8051; - public const int GL_RGB10_EXT = 0x8052; - public const int GL_RGB12_EXT = 0x8053; - public const int GL_RGB16_EXT = 0x8054; - public const int GL_RGBA2_EXT = 0x8055; - public const int GL_RGBA4_EXT = 0x8056; - public const int GL_RGB5_A1_EXT = 0x8057; - public const int GL_RGBA8_EXT = 0x8058; - public const int GL_RGB10_A2_EXT = 0x8059; - public const int GL_RGBA12_EXT = 0x805A; - public const int GL_RGBA16_EXT = 0x805B; - public const int GL_TEXTURE_RED_SIZE_EXT = 0x805C; - public const int GL_TEXTURE_GREEN_SIZE_EXT = 0x805D; - public const int GL_TEXTURE_BLUE_SIZE_EXT = 0x805E; - public const int GL_TEXTURE_ALPHA_SIZE_EXT = 0x805F; - public const int GL_TEXTURE_LUMINANCE_SIZE_EXT = 0x8060; - public const int GL_TEXTURE_INTENSITY_SIZE_EXT = 0x8061; - public const int GL_REPLACE_EXT = 0x8062; - public const int GL_PROXY_TEXTURE_1D_EXT = 0x8063; - public const int GL_PROXY_TEXTURE_2D_EXT = 0x8064; - public const int GL_TEXTURE_TOO_LARGE_EXT = 0x8065; - public const int GL_EXT_texture3D = 1; - public const int GL_PACK_SKIP_IMAGES_EXT = 0x806B; - public const int GL_PACK_IMAGE_HEIGHT_EXT = 0x806C; - public const int GL_UNPACK_SKIP_IMAGES_EXT = 0x806D; - public const int GL_UNPACK_IMAGE_HEIGHT_EXT = 0x806E; - public const int GL_TEXTURE_3D_EXT = 0x806F; - public const int GL_PROXY_TEXTURE_3D_EXT = 0x8070; - public const int GL_TEXTURE_DEPTH_EXT = 0x8071; - public const int GL_TEXTURE_WRAP_R_EXT = 0x8072; - public const int GL_MAX_3D_TEXTURE_SIZE_EXT = 0x8073; - public const int GL_EXT_texture_array = 1; - public const int GL_TEXTURE_1D_ARRAY_EXT = 0x8C18; - public const int GL_PROXY_TEXTURE_1D_ARRAY_EXT = 0x8C19; - public const int GL_TEXTURE_2D_ARRAY_EXT = 0x8C1A; - public const int GL_PROXY_TEXTURE_2D_ARRAY_EXT = 0x8C1B; - public const int GL_TEXTURE_BINDING_1D_ARRAY_EXT = 0x8C1C; - public const int GL_TEXTURE_BINDING_2D_ARRAY_EXT = 0x8C1D; - public const int GL_MAX_ARRAY_TEXTURE_LAYERS_EXT = 0x88FF; - public const int GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT = 0x884E; - public const int GL_EXT_texture_buffer_object = 1; - public const int GL_TEXTURE_BUFFER_EXT = 0x8C2A; - public const int GL_MAX_TEXTURE_BUFFER_SIZE_EXT = 0x8C2B; - public const int GL_TEXTURE_BINDING_BUFFER_EXT = 0x8C2C; - public const int GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT = 0x8C2D; - public const int GL_TEXTURE_BUFFER_FORMAT_EXT = 0x8C2E; - public const int GL_EXT_texture_compression_latc = 1; - public const int GL_COMPRESSED_LUMINANCE_LATC1_EXT = 0x8C70; - public const int GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT = 0x8C71; - public const int GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C72; - public const int GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C73; - public const int GL_EXT_texture_compression_rgtc = 1; - public const int GL_COMPRESSED_RED_RGTC1_EXT = 0x8DBB; - public const int GL_COMPRESSED_SIGNED_RED_RGTC1_EXT = 0x8DBC; - public const int GL_COMPRESSED_RED_GREEN_RGTC2_EXT = 0x8DBD; - public const int GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 0x8DBE; - public const int GL_EXT_texture_compression_s3tc = 1; - public const int GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0; - public const int GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1; - public const int GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2; - public const int GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3; - public const int GL_EXT_texture_cube_map = 1; - public const int GL_NORMAL_MAP_EXT = 0x8511; - public const int GL_REFLECTION_MAP_EXT = 0x8512; - public const int GL_TEXTURE_CUBE_MAP_EXT = 0x8513; - public const int GL_TEXTURE_BINDING_CUBE_MAP_EXT = 0x8514; - public const int GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT = 0x8515; - public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT = 0x8516; - public const int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT = 0x8517; - public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT = 0x8518; - public const int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT = 0x8519; - public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT = 0x851A; - public const int GL_PROXY_TEXTURE_CUBE_MAP_EXT = 0x851B; - public const int GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT = 0x851C; - public const int GL_EXT_texture_env_add = 1; - public const int GL_EXT_texture_env_combine = 1; - public const int GL_COMBINE_EXT = 0x8570; - public const int GL_COMBINE_RGB_EXT = 0x8571; - public const int GL_COMBINE_ALPHA_EXT = 0x8572; - public const int GL_RGB_SCALE_EXT = 0x8573; - public const int GL_ADD_SIGNED_EXT = 0x8574; - public const int GL_INTERPOLATE_EXT = 0x8575; - public const int GL_CONSTANT_EXT = 0x8576; - public const int GL_PRIMARY_COLOR_EXT = 0x8577; - public const int GL_PREVIOUS_EXT = 0x8578; - public const int GL_SOURCE0_RGB_EXT = 0x8580; - public const int GL_SOURCE1_RGB_EXT = 0x8581; - public const int GL_SOURCE2_RGB_EXT = 0x8582; - public const int GL_SOURCE0_ALPHA_EXT = 0x8588; - public const int GL_SOURCE1_ALPHA_EXT = 0x8589; - public const int GL_SOURCE2_ALPHA_EXT = 0x858A; - public const int GL_OPERAND0_RGB_EXT = 0x8590; - public const int GL_OPERAND1_RGB_EXT = 0x8591; - public const int GL_OPERAND2_RGB_EXT = 0x8592; - public const int GL_OPERAND0_ALPHA_EXT = 0x8598; - public const int GL_OPERAND1_ALPHA_EXT = 0x8599; - public const int GL_OPERAND2_ALPHA_EXT = 0x859A; - public const int GL_EXT_texture_env_dot3 = 1; - public const int GL_DOT3_RGB_EXT = 0x8740; - public const int GL_DOT3_RGBA_EXT = 0x8741; - public const int GL_EXT_texture_filter_anisotropic = 1; - public const int GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE; - public const int GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF; - public const int GL_EXT_texture_filter_minmax = 1; - public const int GL_TEXTURE_REDUCTION_MODE_EXT = 0x9366; - public const int GL_WEIGHTED_AVERAGE_EXT = 0x9367; - public const int GL_EXT_texture_integer = 1; - public const int GL_RGBA32UI_EXT = 0x8D70; - public const int GL_RGB32UI_EXT = 0x8D71; - public const int GL_ALPHA32UI_EXT = 0x8D72; - public const int GL_INTENSITY32UI_EXT = 0x8D73; - public const int GL_LUMINANCE32UI_EXT = 0x8D74; - public const int GL_LUMINANCE_ALPHA32UI_EXT = 0x8D75; - public const int GL_RGBA16UI_EXT = 0x8D76; - public const int GL_RGB16UI_EXT = 0x8D77; - public const int GL_ALPHA16UI_EXT = 0x8D78; - public const int GL_INTENSITY16UI_EXT = 0x8D79; - public const int GL_LUMINANCE16UI_EXT = 0x8D7A; - public const int GL_LUMINANCE_ALPHA16UI_EXT = 0x8D7B; - public const int GL_RGBA8UI_EXT = 0x8D7C; - public const int GL_RGB8UI_EXT = 0x8D7D; - public const int GL_ALPHA8UI_EXT = 0x8D7E; - public const int GL_INTENSITY8UI_EXT = 0x8D7F; - public const int GL_LUMINANCE8UI_EXT = 0x8D80; - public const int GL_LUMINANCE_ALPHA8UI_EXT = 0x8D81; - public const int GL_RGBA32I_EXT = 0x8D82; - public const int GL_RGB32I_EXT = 0x8D83; - public const int GL_ALPHA32I_EXT = 0x8D84; - public const int GL_INTENSITY32I_EXT = 0x8D85; - public const int GL_LUMINANCE32I_EXT = 0x8D86; - public const int GL_LUMINANCE_ALPHA32I_EXT = 0x8D87; - public const int GL_RGBA16I_EXT = 0x8D88; - public const int GL_RGB16I_EXT = 0x8D89; - public const int GL_ALPHA16I_EXT = 0x8D8A; - public const int GL_INTENSITY16I_EXT = 0x8D8B; - public const int GL_LUMINANCE16I_EXT = 0x8D8C; - public const int GL_LUMINANCE_ALPHA16I_EXT = 0x8D8D; - public const int GL_RGBA8I_EXT = 0x8D8E; - public const int GL_RGB8I_EXT = 0x8D8F; - public const int GL_ALPHA8I_EXT = 0x8D90; - public const int GL_INTENSITY8I_EXT = 0x8D91; - public const int GL_LUMINANCE8I_EXT = 0x8D92; - public const int GL_LUMINANCE_ALPHA8I_EXT = 0x8D93; - public const int GL_RED_INTEGER_EXT = 0x8D94; - public const int GL_GREEN_INTEGER_EXT = 0x8D95; - public const int GL_BLUE_INTEGER_EXT = 0x8D96; - public const int GL_ALPHA_INTEGER_EXT = 0x8D97; - public const int GL_RGB_INTEGER_EXT = 0x8D98; - public const int GL_RGBA_INTEGER_EXT = 0x8D99; - public const int GL_BGR_INTEGER_EXT = 0x8D9A; - public const int GL_BGRA_INTEGER_EXT = 0x8D9B; - public const int GL_LUMINANCE_INTEGER_EXT = 0x8D9C; - public const int GL_LUMINANCE_ALPHA_INTEGER_EXT = 0x8D9D; - public const int GL_RGBA_INTEGER_MODE_EXT = 0x8D9E; - public const int GL_EXT_texture_lod_bias = 1; - public const int GL_MAX_TEXTURE_LOD_BIAS_EXT = 0x84FD; - public const int GL_TEXTURE_FILTER_CONTROL_EXT = 0x8500; - public const int GL_TEXTURE_LOD_BIAS_EXT = 0x8501; - public const int GL_EXT_texture_mirror_clamp = 1; - public const int GL_MIRROR_CLAMP_EXT = 0x8742; - public const int GL_MIRROR_CLAMP_TO_EDGE_EXT = 0x8743; - public const int GL_MIRROR_CLAMP_TO_BORDER_EXT = 0x8912; - public const int GL_EXT_texture_object = 1; - public const int GL_TEXTURE_PRIORITY_EXT = 0x8066; - public const int GL_TEXTURE_RESIDENT_EXT = 0x8067; - public const int GL_TEXTURE_1D_BINDING_EXT = 0x8068; - public const int GL_TEXTURE_2D_BINDING_EXT = 0x8069; - public const int GL_TEXTURE_3D_BINDING_EXT = 0x806A; - public const int GL_EXT_texture_perturb_normal = 1; - public const int GL_PERTURB_EXT = 0x85AE; - public const int GL_TEXTURE_NORMAL_EXT = 0x85AF; - public const int GL_EXT_texture_sRGB = 1; - public const int GL_SRGB_EXT = 0x8C40; - public const int GL_SRGB8_EXT = 0x8C41; - public const int GL_SRGB_ALPHA_EXT = 0x8C42; - public const int GL_SRGB8_ALPHA8_EXT = 0x8C43; - public const int GL_SLUMINANCE_ALPHA_EXT = 0x8C44; - public const int GL_SLUMINANCE8_ALPHA8_EXT = 0x8C45; - public const int GL_SLUMINANCE_EXT = 0x8C46; - public const int GL_SLUMINANCE8_EXT = 0x8C47; - public const int GL_COMPRESSED_SRGB_EXT = 0x8C48; - public const int GL_COMPRESSED_SRGB_ALPHA_EXT = 0x8C49; - public const int GL_COMPRESSED_SLUMINANCE_EXT = 0x8C4A; - public const int GL_COMPRESSED_SLUMINANCE_ALPHA_EXT = 0x8C4B; - public const int GL_COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C; - public const int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D; - public const int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E; - public const int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F; - public const int GL_EXT_texture_sRGB_decode = 1; - public const int GL_TEXTURE_SRGB_DECODE_EXT = 0x8A48; - public const int GL_DECODE_EXT = 0x8A49; - public const int GL_SKIP_DECODE_EXT = 0x8A4A; - public const int GL_EXT_texture_shared_exponent = 1; - public const int GL_RGB9_E5_EXT = 0x8C3D; - public const int GL_UNSIGNED_INT_5_9_9_9_REV_EXT = 0x8C3E; - public const int GL_TEXTURE_SHARED_SIZE_EXT = 0x8C3F; - public const int GL_EXT_texture_snorm = 1; - public const int GL_ALPHA_SNORM = 0x9010; - public const int GL_LUMINANCE_SNORM = 0x9011; - public const int GL_LUMINANCE_ALPHA_SNORM = 0x9012; - public const int GL_INTENSITY_SNORM = 0x9013; - public const int GL_ALPHA8_SNORM = 0x9014; - public const int GL_LUMINANCE8_SNORM = 0x9015; - public const int GL_LUMINANCE8_ALPHA8_SNORM = 0x9016; - public const int GL_INTENSITY8_SNORM = 0x9017; - public const int GL_ALPHA16_SNORM = 0x9018; - public const int GL_LUMINANCE16_SNORM = 0x9019; - public const int GL_LUMINANCE16_ALPHA16_SNORM = 0x901A; - public const int GL_INTENSITY16_SNORM = 0x901B; - public const int GL_RED_SNORM = 0x8F90; - public const int GL_RG_SNORM = 0x8F91; - public const int GL_RGB_SNORM = 0x8F92; - public const int GL_RGBA_SNORM = 0x8F93; - public const int GL_EXT_texture_swizzle = 1; - public const int GL_TEXTURE_SWIZZLE_R_EXT = 0x8E42; - public const int GL_TEXTURE_SWIZZLE_G_EXT = 0x8E43; - public const int GL_TEXTURE_SWIZZLE_B_EXT = 0x8E44; - public const int GL_TEXTURE_SWIZZLE_A_EXT = 0x8E45; - public const int GL_TEXTURE_SWIZZLE_RGBA_EXT = 0x8E46; - public const int GL_EXT_timer_query = 1; - public const int GL_TIME_ELAPSED_EXT = 0x88BF; - public const int GL_EXT_transform_feedback = 1; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_EXT = 0x8C8E; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT = 0x8C84; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT = 0x8C85; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT = 0x8C8F; - public const int GL_INTERLEAVED_ATTRIBS_EXT = 0x8C8C; - public const int GL_SEPARATE_ATTRIBS_EXT = 0x8C8D; - public const int GL_PRIMITIVES_GENERATED_EXT = 0x8C87; - public const int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT = 0x8C88; - public const int GL_RASTERIZER_DISCARD_EXT = 0x8C89; - public const int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT = 0x8C8A; - public const int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT = 0x8C8B; - public const int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT = 0x8C80; - public const int GL_TRANSFORM_FEEDBACK_VARYINGS_EXT = 0x8C83; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT = 0x8C7F; - public const int GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT = 0x8C76; - public const int GL_EXT_vertex_array = 1; - public const int GL_VERTEX_ARRAY_EXT = 0x8074; - public const int GL_NORMAL_ARRAY_EXT = 0x8075; - public const int GL_COLOR_ARRAY_EXT = 0x8076; - public const int GL_INDEX_ARRAY_EXT = 0x8077; - public const int GL_TEXTURE_COORD_ARRAY_EXT = 0x8078; - public const int GL_EDGE_FLAG_ARRAY_EXT = 0x8079; - public const int GL_VERTEX_ARRAY_SIZE_EXT = 0x807A; - public const int GL_VERTEX_ARRAY_TYPE_EXT = 0x807B; - public const int GL_VERTEX_ARRAY_STRIDE_EXT = 0x807C; - public const int GL_VERTEX_ARRAY_COUNT_EXT = 0x807D; - public const int GL_NORMAL_ARRAY_TYPE_EXT = 0x807E; - public const int GL_NORMAL_ARRAY_STRIDE_EXT = 0x807F; - public const int GL_NORMAL_ARRAY_COUNT_EXT = 0x8080; - public const int GL_COLOR_ARRAY_SIZE_EXT = 0x8081; - public const int GL_COLOR_ARRAY_TYPE_EXT = 0x8082; - public const int GL_COLOR_ARRAY_STRIDE_EXT = 0x8083; - public const int GL_COLOR_ARRAY_COUNT_EXT = 0x8084; - public const int GL_INDEX_ARRAY_TYPE_EXT = 0x8085; - public const int GL_INDEX_ARRAY_STRIDE_EXT = 0x8086; - public const int GL_INDEX_ARRAY_COUNT_EXT = 0x8087; - public const int GL_TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088; - public const int GL_TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089; - public const int GL_TEXTURE_COORD_ARRAY_STRIDE_EXT = 0x808A; - public const int GL_TEXTURE_COORD_ARRAY_COUNT_EXT = 0x808B; - public const int GL_EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C; - public const int GL_EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D; - public const int GL_VERTEX_ARRAY_POINTER_EXT = 0x808E; - public const int GL_NORMAL_ARRAY_POINTER_EXT = 0x808F; - public const int GL_COLOR_ARRAY_POINTER_EXT = 0x8090; - public const int GL_INDEX_ARRAY_POINTER_EXT = 0x8091; - public const int GL_TEXTURE_COORD_ARRAY_POINTER_EXT = 0x8092; - public const int GL_EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093; - public const int GL_EXT_vertex_array_bgra = 1; - public const int GL_EXT_vertex_attrib_64bit = 1; - public const int GL_DOUBLE_VEC2_EXT = 0x8FFC; - public const int GL_DOUBLE_VEC3_EXT = 0x8FFD; - public const int GL_DOUBLE_VEC4_EXT = 0x8FFE; - public const int GL_DOUBLE_MAT2_EXT = 0x8F46; - public const int GL_DOUBLE_MAT3_EXT = 0x8F47; - public const int GL_DOUBLE_MAT4_EXT = 0x8F48; - public const int GL_DOUBLE_MAT2x3_EXT = 0x8F49; - public const int GL_DOUBLE_MAT2x4_EXT = 0x8F4A; - public const int GL_DOUBLE_MAT3x2_EXT = 0x8F4B; - public const int GL_DOUBLE_MAT3x4_EXT = 0x8F4C; - public const int GL_DOUBLE_MAT4x2_EXT = 0x8F4D; - public const int GL_DOUBLE_MAT4x3_EXT = 0x8F4E; - public const int GL_EXT_vertex_shader = 1; - public const int GL_VERTEX_SHADER_EXT = 0x8780; - public const int GL_VERTEX_SHADER_BINDING_EXT = 0x8781; - public const int GL_OP_INDEX_EXT = 0x8782; - public const int GL_OP_NEGATE_EXT = 0x8783; - public const int GL_OP_DOT3_EXT = 0x8784; - public const int GL_OP_DOT4_EXT = 0x8785; - public const int GL_OP_MUL_EXT = 0x8786; - public const int GL_OP_ADD_EXT = 0x8787; - public const int GL_OP_MADD_EXT = 0x8788; - public const int GL_OP_FRAC_EXT = 0x8789; - public const int GL_OP_MAX_EXT = 0x878A; - public const int GL_OP_MIN_EXT = 0x878B; - public const int GL_OP_SET_GE_EXT = 0x878C; - public const int GL_OP_SET_LT_EXT = 0x878D; - public const int GL_OP_CLAMP_EXT = 0x878E; - public const int GL_OP_FLOOR_EXT = 0x878F; - public const int GL_OP_ROUND_EXT = 0x8790; - public const int GL_OP_EXP_BASE_2_EXT = 0x8791; - public const int GL_OP_LOG_BASE_2_EXT = 0x8792; - public const int GL_OP_POWER_EXT = 0x8793; - public const int GL_OP_RECIP_EXT = 0x8794; - public const int GL_OP_RECIP_SQRT_EXT = 0x8795; - public const int GL_OP_SUB_EXT = 0x8796; - public const int GL_OP_CROSS_PRODUCT_EXT = 0x8797; - public const int GL_OP_MULTIPLY_MATRIX_EXT = 0x8798; - public const int GL_OP_MOV_EXT = 0x8799; - public const int GL_OUTPUT_VERTEX_EXT = 0x879A; - public const int GL_OUTPUT_COLOR0_EXT = 0x879B; - public const int GL_OUTPUT_COLOR1_EXT = 0x879C; - public const int GL_OUTPUT_TEXTURE_COORD0_EXT = 0x879D; - public const int GL_OUTPUT_TEXTURE_COORD1_EXT = 0x879E; - public const int GL_OUTPUT_TEXTURE_COORD2_EXT = 0x879F; - public const int GL_OUTPUT_TEXTURE_COORD3_EXT = 0x87A0; - public const int GL_OUTPUT_TEXTURE_COORD4_EXT = 0x87A1; - public const int GL_OUTPUT_TEXTURE_COORD5_EXT = 0x87A2; - public const int GL_OUTPUT_TEXTURE_COORD6_EXT = 0x87A3; - public const int GL_OUTPUT_TEXTURE_COORD7_EXT = 0x87A4; - public const int GL_OUTPUT_TEXTURE_COORD8_EXT = 0x87A5; - public const int GL_OUTPUT_TEXTURE_COORD9_EXT = 0x87A6; - public const int GL_OUTPUT_TEXTURE_COORD10_EXT = 0x87A7; - public const int GL_OUTPUT_TEXTURE_COORD11_EXT = 0x87A8; - public const int GL_OUTPUT_TEXTURE_COORD12_EXT = 0x87A9; - public const int GL_OUTPUT_TEXTURE_COORD13_EXT = 0x87AA; - public const int GL_OUTPUT_TEXTURE_COORD14_EXT = 0x87AB; - public const int GL_OUTPUT_TEXTURE_COORD15_EXT = 0x87AC; - public const int GL_OUTPUT_TEXTURE_COORD16_EXT = 0x87AD; - public const int GL_OUTPUT_TEXTURE_COORD17_EXT = 0x87AE; - public const int GL_OUTPUT_TEXTURE_COORD18_EXT = 0x87AF; - public const int GL_OUTPUT_TEXTURE_COORD19_EXT = 0x87B0; - public const int GL_OUTPUT_TEXTURE_COORD20_EXT = 0x87B1; - public const int GL_OUTPUT_TEXTURE_COORD21_EXT = 0x87B2; - public const int GL_OUTPUT_TEXTURE_COORD22_EXT = 0x87B3; - public const int GL_OUTPUT_TEXTURE_COORD23_EXT = 0x87B4; - public const int GL_OUTPUT_TEXTURE_COORD24_EXT = 0x87B5; - public const int GL_OUTPUT_TEXTURE_COORD25_EXT = 0x87B6; - public const int GL_OUTPUT_TEXTURE_COORD26_EXT = 0x87B7; - public const int GL_OUTPUT_TEXTURE_COORD27_EXT = 0x87B8; - public const int GL_OUTPUT_TEXTURE_COORD28_EXT = 0x87B9; - public const int GL_OUTPUT_TEXTURE_COORD29_EXT = 0x87BA; - public const int GL_OUTPUT_TEXTURE_COORD30_EXT = 0x87BB; - public const int GL_OUTPUT_TEXTURE_COORD31_EXT = 0x87BC; - public const int GL_OUTPUT_FOG_EXT = 0x87BD; - public const int GL_SCALAR_EXT = 0x87BE; - public const int GL_VECTOR_EXT = 0x87BF; - public const int GL_MATRIX_EXT = 0x87C0; - public const int GL_VARIANT_EXT = 0x87C1; - public const int GL_INVARIANT_EXT = 0x87C2; - public const int GL_LOCAL_CONSTANT_EXT = 0x87C3; - public const int GL_LOCAL_EXT = 0x87C4; - public const int GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87C5; - public const int GL_MAX_VERTEX_SHADER_VARIANTS_EXT = 0x87C6; - public const int GL_MAX_VERTEX_SHADER_INVARIANTS_EXT = 0x87C7; - public const int GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87C8; - public const int GL_MAX_VERTEX_SHADER_LOCALS_EXT = 0x87C9; - public const int GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CA; - public const int GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT = 0x87CB; - public const int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87CC; - public const int GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT = 0x87CD; - public const int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT = 0x87CE; - public const int GL_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CF; - public const int GL_VERTEX_SHADER_VARIANTS_EXT = 0x87D0; - public const int GL_VERTEX_SHADER_INVARIANTS_EXT = 0x87D1; - public const int GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87D2; - public const int GL_VERTEX_SHADER_LOCALS_EXT = 0x87D3; - public const int GL_VERTEX_SHADER_OPTIMIZED_EXT = 0x87D4; - public const int GL_X_EXT = 0x87D5; - public const int GL_Y_EXT = 0x87D6; - public const int GL_Z_EXT = 0x87D7; - public const int GL_W_EXT = 0x87D8; - public const int GL_NEGATIVE_X_EXT = 0x87D9; - public const int GL_NEGATIVE_Y_EXT = 0x87DA; - public const int GL_NEGATIVE_Z_EXT = 0x87DB; - public const int GL_NEGATIVE_W_EXT = 0x87DC; - public const int GL_ZERO_EXT = 0x87DD; - public const int GL_ONE_EXT = 0x87DE; - public const int GL_NEGATIVE_ONE_EXT = 0x87DF; - public const int GL_NORMALIZED_RANGE_EXT = 0x87E0; - public const int GL_FULL_RANGE_EXT = 0x87E1; - public const int GL_CURRENT_VERTEX_EXT = 0x87E2; - public const int GL_MVP_MATRIX_EXT = 0x87E3; - public const int GL_VARIANT_VALUE_EXT = 0x87E4; - public const int GL_VARIANT_DATATYPE_EXT = 0x87E5; - public const int GL_VARIANT_ARRAY_STRIDE_EXT = 0x87E6; - public const int GL_VARIANT_ARRAY_TYPE_EXT = 0x87E7; - public const int GL_VARIANT_ARRAY_EXT = 0x87E8; - public const int GL_VARIANT_ARRAY_POINTER_EXT = 0x87E9; - public const int GL_INVARIANT_VALUE_EXT = 0x87EA; - public const int GL_INVARIANT_DATATYPE_EXT = 0x87EB; - public const int GL_LOCAL_CONSTANT_VALUE_EXT = 0x87EC; - public const int GL_LOCAL_CONSTANT_DATATYPE_EXT = 0x87ED; - public const int GL_EXT_vertex_weighting = 1; - public const int GL_MODELVIEW0_STACK_DEPTH_EXT = 0x0BA3; - public const int GL_MODELVIEW1_STACK_DEPTH_EXT = 0x8502; - public const int GL_MODELVIEW0_MATRIX_EXT = 0x0BA6; - public const int GL_MODELVIEW1_MATRIX_EXT = 0x8506; - public const int GL_VERTEX_WEIGHTING_EXT = 0x8509; - public const int GL_MODELVIEW0_EXT = 0x1700; - public const int GL_MODELVIEW1_EXT = 0x850A; - public const int GL_CURRENT_VERTEX_WEIGHT_EXT = 0x850B; - public const int GL_VERTEX_WEIGHT_ARRAY_EXT = 0x850C; - public const int GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT = 0x850D; - public const int GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT = 0x850E; - public const int GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT = 0x850F; - public const int GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT = 0x8510; - public const int GL_EXT_win32_keyed_mutex = 1; - public const int GL_EXT_window_rectangles = 1; - public const int GL_INCLUSIVE_EXT = 0x8F10; - public const int GL_EXCLUSIVE_EXT = 0x8F11; - public const int GL_WINDOW_RECTANGLE_EXT = 0x8F12; - public const int GL_WINDOW_RECTANGLE_MODE_EXT = 0x8F13; - public const int GL_MAX_WINDOW_RECTANGLES_EXT = 0x8F14; - public const int GL_NUM_WINDOW_RECTANGLES_EXT = 0x8F15; - public const int GL_EXT_x11_sync_object = 1; - public const int GL_SYNC_X11_FENCE_EXT = 0x90E1; - public const int GL_GREMEDY_frame_terminator = 1; - public const int GL_GREMEDY_string_marker = 1; - public const int GL_HP_convolution_border_modes = 1; - public const int GL_IGNORE_BORDER_HP = 0x8150; - public const int GL_CONSTANT_BORDER_HP = 0x8151; - public const int GL_REPLICATE_BORDER_HP = 0x8153; - public const int GL_CONVOLUTION_BORDER_COLOR_HP = 0x8154; - public const int GL_HP_image_transform = 1; - public const int GL_IMAGE_SCALE_X_HP = 0x8155; - public const int GL_IMAGE_SCALE_Y_HP = 0x8156; - public const int GL_IMAGE_TRANSLATE_X_HP = 0x8157; - public const int GL_IMAGE_TRANSLATE_Y_HP = 0x8158; - public const int GL_IMAGE_ROTATE_ANGLE_HP = 0x8159; - public const int GL_IMAGE_ROTATE_ORIGIN_X_HP = 0x815A; - public const int GL_IMAGE_ROTATE_ORIGIN_Y_HP = 0x815B; - public const int GL_IMAGE_MAG_FILTER_HP = 0x815C; - public const int GL_IMAGE_MIN_FILTER_HP = 0x815D; - public const int GL_IMAGE_CUBIC_WEIGHT_HP = 0x815E; - public const int GL_CUBIC_HP = 0x815F; - public const int GL_AVERAGE_HP = 0x8160; - public const int GL_IMAGE_TRANSFORM_2D_HP = 0x8161; - public const int GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8162; - public const int GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8163; - public const int GL_HP_occlusion_test = 1; - public const int GL_OCCLUSION_TEST_HP = 0x8165; - public const int GL_OCCLUSION_TEST_RESULT_HP = 0x8166; - public const int GL_HP_texture_lighting = 1; - public const int GL_TEXTURE_LIGHTING_MODE_HP = 0x8167; - public const int GL_TEXTURE_POST_SPECULAR_HP = 0x8168; - public const int GL_TEXTURE_PRE_SPECULAR_HP = 0x8169; - public const int GL_IBM_cull_vertex = 1; - public const int GL_CULL_VERTEX_IBM = 103050; - public const int GL_IBM_multimode_draw_arrays = 1; - public const int GL_IBM_rasterpos_clip = 1; - public const int GL_RASTER_POSITION_UNCLIPPED_IBM = 0x19262; - public const int GL_IBM_static_data = 1; - public const int GL_ALL_STATIC_DATA_IBM = 103060; - public const int GL_STATIC_VERTEX_ARRAY_IBM = 103061; - public const int GL_IBM_texture_mirrored_repeat = 1; - public const int GL_MIRRORED_REPEAT_IBM = 0x8370; - public const int GL_IBM_vertex_array_lists = 1; - public const int GL_VERTEX_ARRAY_LIST_IBM = 103070; - public const int GL_NORMAL_ARRAY_LIST_IBM = 103071; - public const int GL_COLOR_ARRAY_LIST_IBM = 103072; - public const int GL_INDEX_ARRAY_LIST_IBM = 103073; - public const int GL_TEXTURE_COORD_ARRAY_LIST_IBM = 103074; - public const int GL_EDGE_FLAG_ARRAY_LIST_IBM = 103075; - public const int GL_FOG_COORDINATE_ARRAY_LIST_IBM = 103076; - public const int GL_SECONDARY_COLOR_ARRAY_LIST_IBM = 103077; - public const int GL_VERTEX_ARRAY_LIST_STRIDE_IBM = 103080; - public const int GL_NORMAL_ARRAY_LIST_STRIDE_IBM = 103081; - public const int GL_COLOR_ARRAY_LIST_STRIDE_IBM = 103082; - public const int GL_INDEX_ARRAY_LIST_STRIDE_IBM = 103083; - public const int GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM = 103084; - public const int GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM = 103085; - public const int GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM = 103086; - public const int GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM = 103087; - public const int GL_INGR_blend_func_separate = 1; - public const int GL_INGR_color_clamp = 1; - public const int GL_RED_MIN_CLAMP_INGR = 0x8560; - public const int GL_GREEN_MIN_CLAMP_INGR = 0x8561; - public const int GL_BLUE_MIN_CLAMP_INGR = 0x8562; - public const int GL_ALPHA_MIN_CLAMP_INGR = 0x8563; - public const int GL_RED_MAX_CLAMP_INGR = 0x8564; - public const int GL_GREEN_MAX_CLAMP_INGR = 0x8565; - public const int GL_BLUE_MAX_CLAMP_INGR = 0x8566; - public const int GL_ALPHA_MAX_CLAMP_INGR = 0x8567; - public const int GL_INGR_interlace_read = 1; - public const int GL_INTERLACE_READ_INGR = 0x8568; - public const int GL_INTEL_blackhole_render = 1; - public const int GL_BLACKHOLE_RENDER_INTEL = 0x83FC; - public const int GL_INTEL_conservative_rasterization = 1; - public const int GL_CONSERVATIVE_RASTERIZATION_INTEL = 0x83FE; - public const int GL_INTEL_fragment_shader_ordering = 1; - public const int GL_INTEL_framebuffer_CMAA = 1; - public const int GL_INTEL_map_texture = 1; - public const int GL_TEXTURE_MEMORY_LAYOUT_INTEL = 0x83FF; - public const int GL_LAYOUT_DEFAULT_INTEL = 0; - public const int GL_LAYOUT_LINEAR_INTEL = 1; - public const int GL_LAYOUT_LINEAR_CPU_CACHED_INTEL = 2; - public const int GL_INTEL_parallel_arrays = 1; - public const int GL_PARALLEL_ARRAYS_INTEL = 0x83F4; - public const int GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F5; - public const int GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F6; - public const int GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F7; - public const int GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F8; - public const int GL_INTEL_performance_query = 1; - public const int GL_PERFQUERY_SINGLE_CONTEXT_INTEL = 0x00000000; - public const int GL_PERFQUERY_GLOBAL_CONTEXT_INTEL = 0x00000001; - public const int GL_PERFQUERY_WAIT_INTEL = 0x83FB; - public const int GL_PERFQUERY_FLUSH_INTEL = 0x83FA; - public const int GL_PERFQUERY_DONOT_FLUSH_INTEL = 0x83F9; - public const int GL_PERFQUERY_COUNTER_EVENT_INTEL = 0x94F0; - public const int GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL = 0x94F1; - public const int GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL = 0x94F2; - public const int GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL = 0x94F3; - public const int GL_PERFQUERY_COUNTER_RAW_INTEL = 0x94F4; - public const int GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL = 0x94F5; - public const int GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL = 0x94F8; - public const int GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL = 0x94F9; - public const int GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL = 0x94FA; - public const int GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL = 0x94FB; - public const int GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL = 0x94FC; - public const int GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL = 0x94FD; - public const int GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL = 0x94FE; - public const int GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL = 0x94FF; - public const int GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL = 0x9500; - public const int GL_MESAX_texture_stack = 1; - public const int GL_TEXTURE_1D_STACK_MESAX = 0x8759; - public const int GL_TEXTURE_2D_STACK_MESAX = 0x875A; - public const int GL_PROXY_TEXTURE_1D_STACK_MESAX = 0x875B; - public const int GL_PROXY_TEXTURE_2D_STACK_MESAX = 0x875C; - public const int GL_TEXTURE_1D_STACK_BINDING_MESAX = 0x875D; - public const int GL_TEXTURE_2D_STACK_BINDING_MESAX = 0x875E; - public const int GL_MESA_pack_invert = 1; - public const int GL_PACK_INVERT_MESA = 0x8758; - public const int GL_MESA_program_binary_formats = 1; - public const int GL_PROGRAM_BINARY_FORMAT_MESA = 0x875F; - public const int GL_MESA_resize_buffers = 1; - public const int GL_MESA_shader_integer_functions = 1; - public const int GL_MESA_tile_raster_order = 1; - public const int GL_TILE_RASTER_ORDER_FIXED_MESA = 0x8BB8; - public const int GL_TILE_RASTER_ORDER_INCREASING_X_MESA = 0x8BB9; - public const int GL_TILE_RASTER_ORDER_INCREASING_Y_MESA = 0x8BBA; - public const int GL_MESA_window_pos = 1; - public const int GL_MESA_ycbcr_texture = 1; - public const int GL_UNSIGNED_SHORT_8_8_MESA = 0x85BA; - public const int GL_UNSIGNED_SHORT_8_8_REV_MESA = 0x85BB; - public const int GL_YCBCR_MESA = 0x8757; - public const int GL_NVX_blend_equation_advanced_multi_draw_buffers = 1; - public const int GL_NVX_conditional_render = 1; - public const int GL_NVX_gpu_memory_info = 1; - public const int GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = 0x9047; - public const int GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = 0x9048; - public const int GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = 0x9049; - public const int GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX = 0x904A; - public const int GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX = 0x904B; - public const int GL_NVX_linked_gpu_multicast = 1; - public const int GL_LGPU_SEPARATE_STORAGE_BIT_NVX = 0x0800; - public const int GL_MAX_LGPU_GPUS_NVX = 0x92BA; - public const int GL_NV_alpha_to_coverage_dither_control = 1; - public const int GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV = 0x934D; - public const int GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV = 0x934E; - public const int GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV = 0x934F; - public const int GL_ALPHA_TO_COVERAGE_DITHER_MODE_NV = 0x92BF; - public const int GL_NV_bindless_multi_draw_indirect = 1; - public const int GL_NV_bindless_multi_draw_indirect_count = 1; - public const int GL_NV_bindless_texture = 1; - public const int GL_NV_blend_equation_advanced = 1; - public const int GL_BLEND_OVERLAP_NV = 0x9281; - public const int GL_BLEND_PREMULTIPLIED_SRC_NV = 0x9280; - public const int GL_BLUE_NV = 0x1905; - public const int GL_COLORBURN_NV = 0x929A; - public const int GL_COLORDODGE_NV = 0x9299; - public const int GL_CONJOINT_NV = 0x9284; - public const int GL_CONTRAST_NV = 0x92A1; - public const int GL_DARKEN_NV = 0x9297; - public const int GL_DIFFERENCE_NV = 0x929E; - public const int GL_DISJOINT_NV = 0x9283; - public const int GL_DST_ATOP_NV = 0x928F; - public const int GL_DST_IN_NV = 0x928B; - public const int GL_DST_NV = 0x9287; - public const int GL_DST_OUT_NV = 0x928D; - public const int GL_DST_OVER_NV = 0x9289; - public const int GL_EXCLUSION_NV = 0x92A0; - public const int GL_GREEN_NV = 0x1904; - public const int GL_HARDLIGHT_NV = 0x929B; - public const int GL_HARDMIX_NV = 0x92A9; - public const int GL_HSL_COLOR_NV = 0x92AF; - public const int GL_HSL_HUE_NV = 0x92AD; - public const int GL_HSL_LUMINOSITY_NV = 0x92B0; - public const int GL_HSL_SATURATION_NV = 0x92AE; - public const int GL_INVERT_OVG_NV = 0x92B4; - public const int GL_INVERT_RGB_NV = 0x92A3; - public const int GL_LIGHTEN_NV = 0x9298; - public const int GL_LINEARBURN_NV = 0x92A5; - public const int GL_LINEARDODGE_NV = 0x92A4; - public const int GL_LINEARLIGHT_NV = 0x92A7; - public const int GL_MINUS_CLAMPED_NV = 0x92B3; - public const int GL_MINUS_NV = 0x929F; - public const int GL_MULTIPLY_NV = 0x9294; - public const int GL_OVERLAY_NV = 0x9296; - public const int GL_PINLIGHT_NV = 0x92A8; - public const int GL_PLUS_CLAMPED_ALPHA_NV = 0x92B2; - public const int GL_PLUS_CLAMPED_NV = 0x92B1; - public const int GL_PLUS_DARKER_NV = 0x9292; - public const int GL_PLUS_NV = 0x9291; - public const int GL_RED_NV = 0x1903; - public const int GL_SCREEN_NV = 0x9295; - public const int GL_SOFTLIGHT_NV = 0x929C; - public const int GL_SRC_ATOP_NV = 0x928E; - public const int GL_SRC_IN_NV = 0x928A; - public const int GL_SRC_NV = 0x9286; - public const int GL_SRC_OUT_NV = 0x928C; - public const int GL_SRC_OVER_NV = 0x9288; - public const int GL_UNCORRELATED_NV = 0x9282; - public const int GL_VIVIDLIGHT_NV = 0x92A6; - public const int GL_XOR_NV = 0x1506; - public const int GL_NV_blend_equation_advanced_coherent = 1; - public const int GL_BLEND_ADVANCED_COHERENT_NV = 0x9285; - public const int GL_NV_blend_minmax_factor = 1; - public const int GL_NV_blend_square = 1; - public const int GL_NV_clip_space_w_scaling = 1; - public const int GL_VIEWPORT_POSITION_W_SCALE_NV = 0x937C; - public const int GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV = 0x937D; - public const int GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV = 0x937E; - public const int GL_NV_command_list = 1; - public const int GL_TERMINATE_SEQUENCE_COMMAND_NV = 0x0000; - public const int GL_NOP_COMMAND_NV = 0x0001; - public const int GL_DRAW_ELEMENTS_COMMAND_NV = 0x0002; - public const int GL_DRAW_ARRAYS_COMMAND_NV = 0x0003; - public const int GL_DRAW_ELEMENTS_STRIP_COMMAND_NV = 0x0004; - public const int GL_DRAW_ARRAYS_STRIP_COMMAND_NV = 0x0005; - public const int GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV = 0x0006; - public const int GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV = 0x0007; - public const int GL_ELEMENT_ADDRESS_COMMAND_NV = 0x0008; - public const int GL_ATTRIBUTE_ADDRESS_COMMAND_NV = 0x0009; - public const int GL_UNIFORM_ADDRESS_COMMAND_NV = 0x000A; - public const int GL_BLEND_COLOR_COMMAND_NV = 0x000B; - public const int GL_STENCIL_REF_COMMAND_NV = 0x000C; - public const int GL_LINE_WIDTH_COMMAND_NV = 0x000D; - public const int GL_POLYGON_OFFSET_COMMAND_NV = 0x000E; - public const int GL_ALPHA_REF_COMMAND_NV = 0x000F; - public const int GL_VIEWPORT_COMMAND_NV = 0x0010; - public const int GL_SCISSOR_COMMAND_NV = 0x0011; - public const int GL_FRONT_FACE_COMMAND_NV = 0x0012; - public const int GL_NV_compute_program5 = 1; - public const int GL_COMPUTE_PROGRAM_NV = 0x90FB; - public const int GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV = 0x90FC; - public const int GL_NV_conditional_render = 1; - public const int GL_QUERY_WAIT_NV = 0x8E13; - public const int GL_QUERY_NO_WAIT_NV = 0x8E14; - public const int GL_QUERY_BY_REGION_WAIT_NV = 0x8E15; - public const int GL_QUERY_BY_REGION_NO_WAIT_NV = 0x8E16; - public const int GL_NV_conservative_raster = 1; - public const int GL_CONSERVATIVE_RASTERIZATION_NV = 0x9346; - public const int GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV = 0x9347; - public const int GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV = 0x9348; - public const int GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV = 0x9349; - public const int GL_NV_conservative_raster_dilate = 1; - public const int GL_CONSERVATIVE_RASTER_DILATE_NV = 0x9379; - public const int GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV = 0x937A; - public const int GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV = 0x937B; - public const int GL_NV_conservative_raster_pre_snap = 1; - public const int GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV = 0x9550; - public const int GL_NV_conservative_raster_pre_snap_triangles = 1; - public const int GL_CONSERVATIVE_RASTER_MODE_NV = 0x954D; - public const int GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV = 0x954E; - public const int GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV = 0x954F; - public const int GL_NV_conservative_raster_underestimation = 1; - public const int GL_NV_copy_depth_to_color = 1; - public const int GL_DEPTH_STENCIL_TO_RGBA_NV = 0x886E; - public const int GL_DEPTH_STENCIL_TO_BGRA_NV = 0x886F; - public const int GL_NV_copy_image = 1; - public const int GL_NV_deep_texture3D = 1; - public const int GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV = 0x90D0; - public const int GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV = 0x90D1; - public const int GL_NV_depth_buffer_float = 1; - public const int GL_DEPTH_COMPONENT32F_NV = 0x8DAB; - public const int GL_DEPTH32F_STENCIL8_NV = 0x8DAC; - public const int GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV = 0x8DAD; - public const int GL_DEPTH_BUFFER_FLOAT_MODE_NV = 0x8DAF; - public const int GL_NV_depth_clamp = 1; - public const int GL_DEPTH_CLAMP_NV = 0x864F; - public const int GL_NV_draw_texture = 1; - public const int GL_NV_draw_vulkan_image = 1; - public const int GL_NV_evaluators = 1; - public const int GL_EVAL_2D_NV = 0x86C0; - public const int GL_EVAL_TRIANGULAR_2D_NV = 0x86C1; - public const int GL_MAP_TESSELLATION_NV = 0x86C2; - public const int GL_MAP_ATTRIB_U_ORDER_NV = 0x86C3; - public const int GL_MAP_ATTRIB_V_ORDER_NV = 0x86C4; - public const int GL_EVAL_FRACTIONAL_TESSELLATION_NV = 0x86C5; - public const int GL_EVAL_VERTEX_ATTRIB0_NV = 0x86C6; - public const int GL_EVAL_VERTEX_ATTRIB1_NV = 0x86C7; - public const int GL_EVAL_VERTEX_ATTRIB2_NV = 0x86C8; - public const int GL_EVAL_VERTEX_ATTRIB3_NV = 0x86C9; - public const int GL_EVAL_VERTEX_ATTRIB4_NV = 0x86CA; - public const int GL_EVAL_VERTEX_ATTRIB5_NV = 0x86CB; - public const int GL_EVAL_VERTEX_ATTRIB6_NV = 0x86CC; - public const int GL_EVAL_VERTEX_ATTRIB7_NV = 0x86CD; - public const int GL_EVAL_VERTEX_ATTRIB8_NV = 0x86CE; - public const int GL_EVAL_VERTEX_ATTRIB9_NV = 0x86CF; - public const int GL_EVAL_VERTEX_ATTRIB10_NV = 0x86D0; - public const int GL_EVAL_VERTEX_ATTRIB11_NV = 0x86D1; - public const int GL_EVAL_VERTEX_ATTRIB12_NV = 0x86D2; - public const int GL_EVAL_VERTEX_ATTRIB13_NV = 0x86D3; - public const int GL_EVAL_VERTEX_ATTRIB14_NV = 0x86D4; - public const int GL_EVAL_VERTEX_ATTRIB15_NV = 0x86D5; - public const int GL_MAX_MAP_TESSELLATION_NV = 0x86D6; - public const int GL_MAX_RATIONAL_EVAL_ORDER_NV = 0x86D7; - public const int GL_NV_explicit_multisample = 1; - public const int GL_SAMPLE_POSITION_NV = 0x8E50; - public const int GL_SAMPLE_MASK_NV = 0x8E51; - public const int GL_SAMPLE_MASK_VALUE_NV = 0x8E52; - public const int GL_TEXTURE_BINDING_RENDERBUFFER_NV = 0x8E53; - public const int GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV = 0x8E54; - public const int GL_TEXTURE_RENDERBUFFER_NV = 0x8E55; - public const int GL_SAMPLER_RENDERBUFFER_NV = 0x8E56; - public const int GL_INT_SAMPLER_RENDERBUFFER_NV = 0x8E57; - public const int GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV = 0x8E58; - public const int GL_MAX_SAMPLE_MASK_WORDS_NV = 0x8E59; - public const int GL_NV_fence = 1; - public const int GL_ALL_COMPLETED_NV = 0x84F2; - public const int GL_FENCE_STATUS_NV = 0x84F3; - public const int GL_FENCE_CONDITION_NV = 0x84F4; - public const int GL_NV_fill_rectangle = 1; - public const int GL_FILL_RECTANGLE_NV = 0x933C; - public const int GL_NV_float_buffer = 1; - public const int GL_FLOAT_R_NV = 0x8880; - public const int GL_FLOAT_RG_NV = 0x8881; - public const int GL_FLOAT_RGB_NV = 0x8882; - public const int GL_FLOAT_RGBA_NV = 0x8883; - public const int GL_FLOAT_R16_NV = 0x8884; - public const int GL_FLOAT_R32_NV = 0x8885; - public const int GL_FLOAT_RG16_NV = 0x8886; - public const int GL_FLOAT_RG32_NV = 0x8887; - public const int GL_FLOAT_RGB16_NV = 0x8888; - public const int GL_FLOAT_RGB32_NV = 0x8889; - public const int GL_FLOAT_RGBA16_NV = 0x888A; - public const int GL_FLOAT_RGBA32_NV = 0x888B; - public const int GL_TEXTURE_FLOAT_COMPONENTS_NV = 0x888C; - public const int GL_FLOAT_CLEAR_COLOR_VALUE_NV = 0x888D; - public const int GL_FLOAT_RGBA_MODE_NV = 0x888E; - public const int GL_NV_fog_distance = 1; - public const int GL_FOG_DISTANCE_MODE_NV = 0x855A; - public const int GL_EYE_RADIAL_NV = 0x855B; - public const int GL_EYE_PLANE_ABSOLUTE_NV = 0x855C; - public const int GL_NV_fragment_coverage_to_color = 1; - public const int GL_FRAGMENT_COVERAGE_TO_COLOR_NV = 0x92DD; - public const int GL_FRAGMENT_COVERAGE_COLOR_NV = 0x92DE; - public const int GL_NV_fragment_program = 1; - public const int GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV = 0x8868; - public const int GL_FRAGMENT_PROGRAM_NV = 0x8870; - public const int GL_MAX_TEXTURE_COORDS_NV = 0x8871; - public const int GL_MAX_TEXTURE_IMAGE_UNITS_NV = 0x8872; - public const int GL_FRAGMENT_PROGRAM_BINDING_NV = 0x8873; - public const int GL_PROGRAM_ERROR_STRING_NV = 0x8874; - public const int GL_NV_fragment_program2 = 1; - public const int GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV = 0x88F4; - public const int GL_MAX_PROGRAM_CALL_DEPTH_NV = 0x88F5; - public const int GL_MAX_PROGRAM_IF_DEPTH_NV = 0x88F6; - public const int GL_MAX_PROGRAM_LOOP_DEPTH_NV = 0x88F7; - public const int GL_MAX_PROGRAM_LOOP_COUNT_NV = 0x88F8; - public const int GL_NV_fragment_program4 = 1; - public const int GL_NV_fragment_program_option = 1; - public const int GL_NV_fragment_shader_interlock = 1; - public const int GL_NV_framebuffer_mixed_samples = 1; - public const int GL_COVERAGE_MODULATION_TABLE_NV = 0x9331; - public const int GL_COLOR_SAMPLES_NV = 0x8E20; - public const int GL_DEPTH_SAMPLES_NV = 0x932D; - public const int GL_STENCIL_SAMPLES_NV = 0x932E; - public const int GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV = 0x932F; - public const int GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV = 0x9330; - public const int GL_COVERAGE_MODULATION_NV = 0x9332; - public const int GL_COVERAGE_MODULATION_TABLE_SIZE_NV = 0x9333; - public const int GL_NV_framebuffer_multisample_coverage = 1; - public const int GL_RENDERBUFFER_COVERAGE_SAMPLES_NV = 0x8CAB; - public const int GL_RENDERBUFFER_COLOR_SAMPLES_NV = 0x8E10; - public const int GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV = 0x8E11; - public const int GL_MULTISAMPLE_COVERAGE_MODES_NV = 0x8E12; - public const int GL_NV_geometry_program4 = 1; - public const int GL_GEOMETRY_PROGRAM_NV = 0x8C26; - public const int GL_MAX_PROGRAM_OUTPUT_VERTICES_NV = 0x8C27; - public const int GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV = 0x8C28; - public const int GL_NV_geometry_shader4 = 1; - public const int GL_NV_geometry_shader_passthrough = 1; - public const int GL_NV_gpu_multicast = 1; - public const int GL_PER_GPU_STORAGE_BIT_NV = 0x0800; - public const int GL_MULTICAST_GPUS_NV = 0x92BA; - public const int GL_RENDER_GPU_MASK_NV = 0x9558; - public const int GL_PER_GPU_STORAGE_NV = 0x9548; - public const int GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9549; - public const int GL_NV_gpu_program4 = 1; - public const int GL_MIN_PROGRAM_TEXEL_OFFSET_NV = 0x8904; - public const int GL_MAX_PROGRAM_TEXEL_OFFSET_NV = 0x8905; - public const int GL_PROGRAM_ATTRIB_COMPONENTS_NV = 0x8906; - public const int GL_PROGRAM_RESULT_COMPONENTS_NV = 0x8907; - public const int GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV = 0x8908; - public const int GL_MAX_PROGRAM_RESULT_COMPONENTS_NV = 0x8909; - public const int GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV = 0x8DA5; - public const int GL_MAX_PROGRAM_GENERIC_RESULTS_NV = 0x8DA6; - public const int GL_NV_gpu_program5 = 1; - public const int GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV = 0x8E5A; - public const int GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5B; - public const int GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5C; - public const int GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV = 0x8E5D; - public const int GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV = 0x8E5E; - public const int GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV = 0x8E5F; - public const int GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV = 0x8F44; - public const int GL_MAX_PROGRAM_SUBROUTINE_NUM_NV = 0x8F45; - public const int GL_NV_gpu_program5_mem_extended = 1; - public const int GL_NV_gpu_shader5 = 1; - public const int GL_NV_half_float = 1; - public const int GL_HALF_FLOAT_NV = 0x140B; - public const int GL_NV_internalformat_sample_query = 1; - public const int GL_MULTISAMPLES_NV = 0x9371; - public const int GL_SUPERSAMPLE_SCALE_X_NV = 0x9372; - public const int GL_SUPERSAMPLE_SCALE_Y_NV = 0x9373; - public const int GL_CONFORMANT_NV = 0x9374; - public const int GL_NV_light_max_exponent = 1; - public const int GL_MAX_SHININESS_NV = 0x8504; - public const int GL_MAX_SPOT_EXPONENT_NV = 0x8505; - public const int GL_NV_multisample_coverage = 1; - public const int GL_NV_multisample_filter_hint = 1; - public const int GL_MULTISAMPLE_FILTER_HINT_NV = 0x8534; - public const int GL_NV_occlusion_query = 1; - public const int GL_PIXEL_COUNTER_BITS_NV = 0x8864; - public const int GL_CURRENT_OCCLUSION_QUERY_ID_NV = 0x8865; - public const int GL_PIXEL_COUNT_NV = 0x8866; - public const int GL_PIXEL_COUNT_AVAILABLE_NV = 0x8867; - public const int GL_NV_packed_depth_stencil = 1; - public const int GL_DEPTH_STENCIL_NV = 0x84F9; - public const int GL_UNSIGNED_INT_24_8_NV = 0x84FA; - public const int GL_NV_parameter_buffer_object = 1; - public const int GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV = 0x8DA0; - public const int GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV = 0x8DA1; - public const int GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA2; - public const int GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA3; - public const int GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA4; - public const int GL_NV_parameter_buffer_object2 = 1; - public const int GL_NV_path_rendering = 1; - public const int GL_PATH_FORMAT_SVG_NV = 0x9070; - public const int GL_PATH_FORMAT_PS_NV = 0x9071; - public const int GL_STANDARD_FONT_NAME_NV = 0x9072; - public const int GL_SYSTEM_FONT_NAME_NV = 0x9073; - public const int GL_FILE_NAME_NV = 0x9074; - public const int GL_PATH_STROKE_WIDTH_NV = 0x9075; - public const int GL_PATH_END_CAPS_NV = 0x9076; - public const int GL_PATH_INITIAL_END_CAP_NV = 0x9077; - public const int GL_PATH_TERMINAL_END_CAP_NV = 0x9078; - public const int GL_PATH_JOIN_STYLE_NV = 0x9079; - public const int GL_PATH_MITER_LIMIT_NV = 0x907A; - public const int GL_PATH_DASH_CAPS_NV = 0x907B; - public const int GL_PATH_INITIAL_DASH_CAP_NV = 0x907C; - public const int GL_PATH_TERMINAL_DASH_CAP_NV = 0x907D; - public const int GL_PATH_DASH_OFFSET_NV = 0x907E; - public const int GL_PATH_CLIENT_LENGTH_NV = 0x907F; - public const int GL_PATH_FILL_MODE_NV = 0x9080; - public const int GL_PATH_FILL_MASK_NV = 0x9081; - public const int GL_PATH_FILL_COVER_MODE_NV = 0x9082; - public const int GL_PATH_STROKE_COVER_MODE_NV = 0x9083; - public const int GL_PATH_STROKE_MASK_NV = 0x9084; - public const int GL_COUNT_UP_NV = 0x9088; - public const int GL_COUNT_DOWN_NV = 0x9089; - public const int GL_PATH_OBJECT_BOUNDING_BOX_NV = 0x908A; - public const int GL_CONVEX_HULL_NV = 0x908B; - public const int GL_BOUNDING_BOX_NV = 0x908D; - public const int GL_TRANSLATE_X_NV = 0x908E; - public const int GL_TRANSLATE_Y_NV = 0x908F; - public const int GL_TRANSLATE_2D_NV = 0x9090; - public const int GL_TRANSLATE_3D_NV = 0x9091; - public const int GL_AFFINE_2D_NV = 0x9092; - public const int GL_AFFINE_3D_NV = 0x9094; - public const int GL_TRANSPOSE_AFFINE_2D_NV = 0x9096; - public const int GL_TRANSPOSE_AFFINE_3D_NV = 0x9098; - public const int GL_UTF8_NV = 0x909A; - public const int GL_UTF16_NV = 0x909B; - public const int GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV = 0x909C; - public const int GL_PATH_COMMAND_COUNT_NV = 0x909D; - public const int GL_PATH_COORD_COUNT_NV = 0x909E; - public const int GL_PATH_DASH_ARRAY_COUNT_NV = 0x909F; - public const int GL_PATH_COMPUTED_LENGTH_NV = 0x90A0; - public const int GL_PATH_FILL_BOUNDING_BOX_NV = 0x90A1; - public const int GL_PATH_STROKE_BOUNDING_BOX_NV = 0x90A2; - public const int GL_SQUARE_NV = 0x90A3; - public const int GL_ROUND_NV = 0x90A4; - public const int GL_TRIANGULAR_NV = 0x90A5; - public const int GL_BEVEL_NV = 0x90A6; - public const int GL_MITER_REVERT_NV = 0x90A7; - public const int GL_MITER_TRUNCATE_NV = 0x90A8; - public const int GL_SKIP_MISSING_GLYPH_NV = 0x90A9; - public const int GL_USE_MISSING_GLYPH_NV = 0x90AA; - public const int GL_PATH_ERROR_POSITION_NV = 0x90AB; - public const int GL_ACCUM_ADJACENT_PAIRS_NV = 0x90AD; - public const int GL_ADJACENT_PAIRS_NV = 0x90AE; - public const int GL_FIRST_TO_REST_NV = 0x90AF; - public const int GL_PATH_GEN_MODE_NV = 0x90B0; - public const int GL_PATH_GEN_COEFF_NV = 0x90B1; - public const int GL_PATH_GEN_COMPONENTS_NV = 0x90B3; - public const int GL_PATH_STENCIL_FUNC_NV = 0x90B7; - public const int GL_PATH_STENCIL_REF_NV = 0x90B8; - public const int GL_PATH_STENCIL_VALUE_MASK_NV = 0x90B9; - public const int GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV = 0x90BD; - public const int GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV = 0x90BE; - public const int GL_PATH_COVER_DEPTH_FUNC_NV = 0x90BF; - public const int GL_PATH_DASH_OFFSET_RESET_NV = 0x90B4; - public const int GL_MOVE_TO_RESETS_NV = 0x90B5; - public const int GL_MOVE_TO_CONTINUES_NV = 0x90B6; - public const int GL_CLOSE_PATH_NV = 0x00; - public const int GL_MOVE_TO_NV = 0x02; - public const int GL_RELATIVE_MOVE_TO_NV = 0x03; - public const int GL_LINE_TO_NV = 0x04; - public const int GL_RELATIVE_LINE_TO_NV = 0x05; - public const int GL_HORIZONTAL_LINE_TO_NV = 0x06; - public const int GL_RELATIVE_HORIZONTAL_LINE_TO_NV = 0x07; - public const int GL_VERTICAL_LINE_TO_NV = 0x08; - public const int GL_RELATIVE_VERTICAL_LINE_TO_NV = 0x09; - public const int GL_QUADRATIC_CURVE_TO_NV = 0x0A; - public const int GL_RELATIVE_QUADRATIC_CURVE_TO_NV = 0x0B; - public const int GL_CUBIC_CURVE_TO_NV = 0x0C; - public const int GL_RELATIVE_CUBIC_CURVE_TO_NV = 0x0D; - public const int GL_SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0E; - public const int GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0F; - public const int GL_SMOOTH_CUBIC_CURVE_TO_NV = 0x10; - public const int GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV = 0x11; - public const int GL_SMALL_CCW_ARC_TO_NV = 0x12; - public const int GL_RELATIVE_SMALL_CCW_ARC_TO_NV = 0x13; - public const int GL_SMALL_CW_ARC_TO_NV = 0x14; - public const int GL_RELATIVE_SMALL_CW_ARC_TO_NV = 0x15; - public const int GL_LARGE_CCW_ARC_TO_NV = 0x16; - public const int GL_RELATIVE_LARGE_CCW_ARC_TO_NV = 0x17; - public const int GL_LARGE_CW_ARC_TO_NV = 0x18; - public const int GL_RELATIVE_LARGE_CW_ARC_TO_NV = 0x19; - public const int GL_RESTART_PATH_NV = 0xF0; - public const int GL_DUP_FIRST_CUBIC_CURVE_TO_NV = 0xF2; - public const int GL_DUP_LAST_CUBIC_CURVE_TO_NV = 0xF4; - public const int GL_RECT_NV = 0xF6; - public const int GL_CIRCULAR_CCW_ARC_TO_NV = 0xF8; - public const int GL_CIRCULAR_CW_ARC_TO_NV = 0xFA; - public const int GL_CIRCULAR_TANGENT_ARC_TO_NV = 0xFC; - public const int GL_ARC_TO_NV = 0xFE; - public const int GL_RELATIVE_ARC_TO_NV = 0xFF; - public const int GL_BOLD_BIT_NV = 0x01; - public const int GL_ITALIC_BIT_NV = 0x02; - public const int GL_GLYPH_WIDTH_BIT_NV = 0x01; - public const int GL_GLYPH_HEIGHT_BIT_NV = 0x02; - public const int GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV = 0x04; - public const int GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV = 0x08; - public const int GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV = 0x10; - public const int GL_GLYPH_VERTICAL_BEARING_X_BIT_NV = 0x20; - public const int GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV = 0x40; - public const int GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV = 0x80; - public const int GL_GLYPH_HAS_KERNING_BIT_NV = 0x100; - public const int GL_FONT_X_MIN_BOUNDS_BIT_NV = 0x00010000; - public const int GL_FONT_Y_MIN_BOUNDS_BIT_NV = 0x00020000; - public const int GL_FONT_X_MAX_BOUNDS_BIT_NV = 0x00040000; - public const int GL_FONT_Y_MAX_BOUNDS_BIT_NV = 0x00080000; - public const int GL_FONT_UNITS_PER_EM_BIT_NV = 0x00100000; - public const int GL_FONT_ASCENDER_BIT_NV = 0x00200000; - public const int GL_FONT_DESCENDER_BIT_NV = 0x00400000; - public const int GL_FONT_HEIGHT_BIT_NV = 0x00800000; - public const int GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV = 0x01000000; - public const int GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV = 0x02000000; - public const int GL_FONT_UNDERLINE_POSITION_BIT_NV = 0x04000000; - public const int GL_FONT_UNDERLINE_THICKNESS_BIT_NV = 0x08000000; - public const int GL_FONT_HAS_KERNING_BIT_NV = 0x10000000; - public const int GL_ROUNDED_RECT_NV = 0xE8; - public const int GL_RELATIVE_ROUNDED_RECT_NV = 0xE9; - public const int GL_ROUNDED_RECT2_NV = 0xEA; - public const int GL_RELATIVE_ROUNDED_RECT2_NV = 0xEB; - public const int GL_ROUNDED_RECT4_NV = 0xEC; - public const int GL_RELATIVE_ROUNDED_RECT4_NV = 0xED; - public const int GL_ROUNDED_RECT8_NV = 0xEE; - public const int GL_RELATIVE_ROUNDED_RECT8_NV = 0xEF; - public const int GL_RELATIVE_RECT_NV = 0xF7; - public const int GL_FONT_GLYPHS_AVAILABLE_NV = 0x9368; - public const int GL_FONT_TARGET_UNAVAILABLE_NV = 0x9369; - public const int GL_FONT_UNAVAILABLE_NV = 0x936A; - public const int GL_FONT_UNINTELLIGIBLE_NV = 0x936B; - public const int GL_CONIC_CURVE_TO_NV = 0x1A; - public const int GL_RELATIVE_CONIC_CURVE_TO_NV = 0x1B; - public const int GL_FONT_NUM_GLYPH_INDICES_BIT_NV = 0x20000000; - public const int GL_STANDARD_FONT_FORMAT_NV = 0x936C; - public const int GL_2_BYTES_NV = 0x1407; - public const int GL_3_BYTES_NV = 0x1408; - public const int GL_4_BYTES_NV = 0x1409; - public const int GL_EYE_LINEAR_NV = 0x2400; - public const int GL_OBJECT_LINEAR_NV = 0x2401; - public const int GL_CONSTANT_NV = 0x8576; - public const int GL_PATH_FOG_GEN_MODE_NV = 0x90AC; - public const int GL_PRIMARY_COLOR_NV = 0x852C; - public const int GL_SECONDARY_COLOR_NV = 0x852D; - public const int GL_PATH_GEN_COLOR_FORMAT_NV = 0x90B2; - public const int GL_PATH_PROJECTION_NV = 0x1701; - public const int GL_PATH_MODELVIEW_NV = 0x1700; - public const int GL_PATH_MODELVIEW_STACK_DEPTH_NV = 0x0BA3; - public const int GL_PATH_MODELVIEW_MATRIX_NV = 0x0BA6; - public const int GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV = 0x0D36; - public const int GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV = 0x84E3; - public const int GL_PATH_PROJECTION_STACK_DEPTH_NV = 0x0BA4; - public const int GL_PATH_PROJECTION_MATRIX_NV = 0x0BA7; - public const int GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV = 0x0D38; - public const int GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV = 0x84E4; - public const int GL_FRAGMENT_INPUT_NV = 0x936D; - public const int GL_NV_path_rendering_shared_edge = 1; - public const int GL_SHARED_EDGE_NV = 0xC0; - public const int GL_NV_pixel_data_range = 1; - public const int GL_WRITE_PIXEL_DATA_RANGE_NV = 0x8878; - public const int GL_READ_PIXEL_DATA_RANGE_NV = 0x8879; - public const int GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV = 0x887A; - public const int GL_READ_PIXEL_DATA_RANGE_LENGTH_NV = 0x887B; - public const int GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV = 0x887C; - public const int GL_READ_PIXEL_DATA_RANGE_POINTER_NV = 0x887D; - public const int GL_NV_point_sprite = 1; - public const int GL_POINT_SPRITE_NV = 0x8861; - public const int GL_COORD_REPLACE_NV = 0x8862; - public const int GL_POINT_SPRITE_R_MODE_NV = 0x8863; - public const int GL_NV_present_video = 1; - public const int GL_FRAME_NV = 0x8E26; - public const int GL_FIELDS_NV = 0x8E27; - public const int GL_CURRENT_TIME_NV = 0x8E28; - public const int GL_NUM_FILL_STREAMS_NV = 0x8E29; - public const int GL_PRESENT_TIME_NV = 0x8E2A; - public const int GL_PRESENT_DURATION_NV = 0x8E2B; - public const int GL_NV_primitive_restart = 1; - public const int GL_PRIMITIVE_RESTART_NV = 0x8558; - public const int GL_PRIMITIVE_RESTART_INDEX_NV = 0x8559; - public const int GL_NV_query_resource = 1; - public const int GL_QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV = 0x9540; - public const int GL_QUERY_RESOURCE_MEMTYPE_VIDMEM_NV = 0x9542; - public const int GL_QUERY_RESOURCE_SYS_RESERVED_NV = 0x9544; - public const int GL_QUERY_RESOURCE_TEXTURE_NV = 0x9545; - public const int GL_QUERY_RESOURCE_RENDERBUFFER_NV = 0x9546; - public const int GL_QUERY_RESOURCE_BUFFEROBJECT_NV = 0x9547; - public const int GL_NV_query_resource_tag = 1; - public const int GL_NV_register_combiners = 1; - public const int GL_REGISTER_COMBINERS_NV = 0x8522; - public const int GL_VARIABLE_A_NV = 0x8523; - public const int GL_VARIABLE_B_NV = 0x8524; - public const int GL_VARIABLE_C_NV = 0x8525; - public const int GL_VARIABLE_D_NV = 0x8526; - public const int GL_VARIABLE_E_NV = 0x8527; - public const int GL_VARIABLE_F_NV = 0x8528; - public const int GL_VARIABLE_G_NV = 0x8529; - public const int GL_CONSTANT_COLOR0_NV = 0x852A; - public const int GL_CONSTANT_COLOR1_NV = 0x852B; - public const int GL_SPARE0_NV = 0x852E; - public const int GL_SPARE1_NV = 0x852F; - public const int GL_DISCARD_NV = 0x8530; - public const int GL_E_TIMES_F_NV = 0x8531; - public const int GL_SPARE0_PLUS_SECONDARY_COLOR_NV = 0x8532; - public const int GL_UNSIGNED_IDENTITY_NV = 0x8536; - public const int GL_UNSIGNED_INVERT_NV = 0x8537; - public const int GL_EXPAND_NORMAL_NV = 0x8538; - public const int GL_EXPAND_NEGATE_NV = 0x8539; - public const int GL_HALF_BIAS_NORMAL_NV = 0x853A; - public const int GL_HALF_BIAS_NEGATE_NV = 0x853B; - public const int GL_SIGNED_IDENTITY_NV = 0x853C; - public const int GL_SIGNED_NEGATE_NV = 0x853D; - public const int GL_SCALE_BY_TWO_NV = 0x853E; - public const int GL_SCALE_BY_FOUR_NV = 0x853F; - public const int GL_SCALE_BY_ONE_HALF_NV = 0x8540; - public const int GL_BIAS_BY_NEGATIVE_ONE_HALF_NV = 0x8541; - public const int GL_COMBINER_INPUT_NV = 0x8542; - public const int GL_COMBINER_MAPPING_NV = 0x8543; - public const int GL_COMBINER_COMPONENT_USAGE_NV = 0x8544; - public const int GL_COMBINER_AB_DOT_PRODUCT_NV = 0x8545; - public const int GL_COMBINER_CD_DOT_PRODUCT_NV = 0x8546; - public const int GL_COMBINER_MUX_SUM_NV = 0x8547; - public const int GL_COMBINER_SCALE_NV = 0x8548; - public const int GL_COMBINER_BIAS_NV = 0x8549; - public const int GL_COMBINER_AB_OUTPUT_NV = 0x854A; - public const int GL_COMBINER_CD_OUTPUT_NV = 0x854B; - public const int GL_COMBINER_SUM_OUTPUT_NV = 0x854C; - public const int GL_MAX_GENERAL_COMBINERS_NV = 0x854D; - public const int GL_NUM_GENERAL_COMBINERS_NV = 0x854E; - public const int GL_COLOR_SUM_CLAMP_NV = 0x854F; - public const int GL_COMBINER0_NV = 0x8550; - public const int GL_COMBINER1_NV = 0x8551; - public const int GL_COMBINER2_NV = 0x8552; - public const int GL_COMBINER3_NV = 0x8553; - public const int GL_COMBINER4_NV = 0x8554; - public const int GL_COMBINER5_NV = 0x8555; - public const int GL_COMBINER6_NV = 0x8556; - public const int GL_COMBINER7_NV = 0x8557; - public const int GL_NV_register_combiners2 = 1; - public const int GL_PER_STAGE_CONSTANTS_NV = 0x8535; - public const int GL_NV_robustness_video_memory_purge = 1; - public const int GL_PURGED_CONTEXT_RESET_NV = 0x92BB; - public const int GL_NV_sample_locations = 1; - public const int GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV = 0x933D; - public const int GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV = 0x933E; - public const int GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV = 0x933F; - public const int GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV = 0x9340; - public const int GL_SAMPLE_LOCATION_NV = 0x8E50; - public const int GL_PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9341; - public const int GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV = 0x9342; - public const int GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV = 0x9343; - public const int GL_NV_sample_mask_override_coverage = 1; - public const int GL_NV_shader_atomic_counters = 1; - public const int GL_NV_shader_atomic_float = 1; - public const int GL_NV_shader_atomic_float64 = 1; - public const int GL_NV_shader_atomic_fp16_vector = 1; - public const int GL_NV_shader_atomic_int64 = 1; - public const int GL_NV_shader_buffer_load = 1; - public const int GL_BUFFER_GPU_ADDRESS_NV = 0x8F1D; - public const int GL_GPU_ADDRESS_NV = 0x8F34; - public const int GL_MAX_SHADER_BUFFER_ADDRESS_NV = 0x8F35; - public const int GL_NV_shader_buffer_store = 1; - public const int GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV = 0x00000010; - public const int GL_NV_shader_storage_buffer_object = 1; - public const int GL_NV_shader_thread_group = 1; - public const int GL_WARP_SIZE_NV = 0x9339; - public const int GL_WARPS_PER_SM_NV = 0x933A; - public const int GL_SM_COUNT_NV = 0x933B; - public const int GL_NV_shader_thread_shuffle = 1; - public const int GL_NV_stereo_view_rendering = 1; - public const int GL_NV_tessellation_program5 = 1; - public const int GL_MAX_PROGRAM_PATCH_ATTRIBS_NV = 0x86D8; - public const int GL_TESS_CONTROL_PROGRAM_NV = 0x891E; - public const int GL_TESS_EVALUATION_PROGRAM_NV = 0x891F; - public const int GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV = 0x8C74; - public const int GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV = 0x8C75; - public const int GL_NV_texgen_emboss = 1; - public const int GL_EMBOSS_LIGHT_NV = 0x855D; - public const int GL_EMBOSS_CONSTANT_NV = 0x855E; - public const int GL_EMBOSS_MAP_NV = 0x855F; - public const int GL_NV_texgen_reflection = 1; - public const int GL_NORMAL_MAP_NV = 0x8511; - public const int GL_REFLECTION_MAP_NV = 0x8512; - public const int GL_NV_texture_barrier = 1; - public const int GL_NV_texture_compression_vtc = 1; - public const int GL_NV_texture_env_combine4 = 1; - public const int GL_COMBINE4_NV = 0x8503; - public const int GL_SOURCE3_RGB_NV = 0x8583; - public const int GL_SOURCE3_ALPHA_NV = 0x858B; - public const int GL_OPERAND3_RGB_NV = 0x8593; - public const int GL_OPERAND3_ALPHA_NV = 0x859B; - public const int GL_NV_texture_expand_normal = 1; - public const int GL_TEXTURE_UNSIGNED_REMAP_MODE_NV = 0x888F; - public const int GL_NV_texture_multisample = 1; - public const int GL_TEXTURE_COVERAGE_SAMPLES_NV = 0x9045; - public const int GL_TEXTURE_COLOR_SAMPLES_NV = 0x9046; - public const int GL_NV_texture_rectangle = 1; - public const int GL_TEXTURE_RECTANGLE_NV = 0x84F5; - public const int GL_TEXTURE_BINDING_RECTANGLE_NV = 0x84F6; - public const int GL_PROXY_TEXTURE_RECTANGLE_NV = 0x84F7; - public const int GL_MAX_RECTANGLE_TEXTURE_SIZE_NV = 0x84F8; - public const int GL_NV_texture_rectangle_compressed = 1; - public const int GL_NV_texture_shader = 1; - public const int GL_OFFSET_TEXTURE_RECTANGLE_NV = 0x864C; - public const int GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV = 0x864D; - public const int GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV = 0x864E; - public const int GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV = 0x86D9; - public const int GL_UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA; - public const int GL_UNSIGNED_INT_8_8_S8_S8_REV_NV = 0x86DB; - public const int GL_DSDT_MAG_INTENSITY_NV = 0x86DC; - public const int GL_SHADER_CONSISTENT_NV = 0x86DD; - public const int GL_TEXTURE_SHADER_NV = 0x86DE; - public const int GL_SHADER_OPERATION_NV = 0x86DF; - public const int GL_CULL_MODES_NV = 0x86E0; - public const int GL_OFFSET_TEXTURE_MATRIX_NV = 0x86E1; - public const int GL_OFFSET_TEXTURE_SCALE_NV = 0x86E2; - public const int GL_OFFSET_TEXTURE_BIAS_NV = 0x86E3; - public const int GL_OFFSET_TEXTURE_2D_MATRIX_NV = 0x86E1; - public const int GL_OFFSET_TEXTURE_2D_SCALE_NV = 0x86E2; - public const int GL_OFFSET_TEXTURE_2D_BIAS_NV = 0x86E3; - public const int GL_PREVIOUS_TEXTURE_INPUT_NV = 0x86E4; - public const int GL_CONST_EYE_NV = 0x86E5; - public const int GL_PASS_THROUGH_NV = 0x86E6; - public const int GL_CULL_FRAGMENT_NV = 0x86E7; - public const int GL_OFFSET_TEXTURE_2D_NV = 0x86E8; - public const int GL_DEPENDENT_AR_TEXTURE_2D_NV = 0x86E9; - public const int GL_DEPENDENT_GB_TEXTURE_2D_NV = 0x86EA; - public const int GL_DOT_PRODUCT_NV = 0x86EC; - public const int GL_DOT_PRODUCT_DEPTH_REPLACE_NV = 0x86ED; - public const int GL_DOT_PRODUCT_TEXTURE_2D_NV = 0x86EE; - public const int GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV = 0x86F0; - public const int GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = 0x86F1; - public const int GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV = 0x86F2; - public const int GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV = 0x86F3; - public const int GL_HILO_NV = 0x86F4; - public const int GL_DSDT_NV = 0x86F5; - public const int GL_DSDT_MAG_NV = 0x86F6; - public const int GL_DSDT_MAG_VIB_NV = 0x86F7; - public const int GL_HILO16_NV = 0x86F8; - public const int GL_SIGNED_HILO_NV = 0x86F9; - public const int GL_SIGNED_HILO16_NV = 0x86FA; - public const int GL_SIGNED_RGBA_NV = 0x86FB; - public const int GL_SIGNED_RGBA8_NV = 0x86FC; - public const int GL_SIGNED_RGB_NV = 0x86FE; - public const int GL_SIGNED_RGB8_NV = 0x86FF; - public const int GL_SIGNED_LUMINANCE_NV = 0x8701; - public const int GL_SIGNED_LUMINANCE8_NV = 0x8702; - public const int GL_SIGNED_LUMINANCE_ALPHA_NV = 0x8703; - public const int GL_SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704; - public const int GL_SIGNED_ALPHA_NV = 0x8705; - public const int GL_SIGNED_ALPHA8_NV = 0x8706; - public const int GL_SIGNED_INTENSITY_NV = 0x8707; - public const int GL_SIGNED_INTENSITY8_NV = 0x8708; - public const int GL_DSDT8_NV = 0x8709; - public const int GL_DSDT8_MAG8_NV = 0x870A; - public const int GL_DSDT8_MAG8_INTENSITY8_NV = 0x870B; - public const int GL_SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C; - public const int GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV = 0x870D; - public const int GL_HI_SCALE_NV = 0x870E; - public const int GL_LO_SCALE_NV = 0x870F; - public const int GL_DS_SCALE_NV = 0x8710; - public const int GL_DT_SCALE_NV = 0x8711; - public const int GL_MAGNITUDE_SCALE_NV = 0x8712; - public const int GL_VIBRANCE_SCALE_NV = 0x8713; - public const int GL_HI_BIAS_NV = 0x8714; - public const int GL_LO_BIAS_NV = 0x8715; - public const int GL_DS_BIAS_NV = 0x8716; - public const int GL_DT_BIAS_NV = 0x8717; - public const int GL_MAGNITUDE_BIAS_NV = 0x8718; - public const int GL_VIBRANCE_BIAS_NV = 0x8719; - public const int GL_TEXTURE_BORDER_VALUES_NV = 0x871A; - public const int GL_TEXTURE_HI_SIZE_NV = 0x871B; - public const int GL_TEXTURE_LO_SIZE_NV = 0x871C; - public const int GL_TEXTURE_DS_SIZE_NV = 0x871D; - public const int GL_TEXTURE_DT_SIZE_NV = 0x871E; - public const int GL_TEXTURE_MAG_SIZE_NV = 0x871F; - public const int GL_NV_texture_shader2 = 1; - public const int GL_DOT_PRODUCT_TEXTURE_3D_NV = 0x86EF; - public const int GL_NV_texture_shader3 = 1; - public const int GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV = 0x8850; - public const int GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = 0x8851; - public const int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8852; - public const int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = 0x8853; - public const int GL_OFFSET_HILO_TEXTURE_2D_NV = 0x8854; - public const int GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV = 0x8855; - public const int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = 0x8856; - public const int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8857; - public const int GL_DEPENDENT_HILO_TEXTURE_2D_NV = 0x8858; - public const int GL_DEPENDENT_RGB_TEXTURE_3D_NV = 0x8859; - public const int GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = 0x885A; - public const int GL_DOT_PRODUCT_PASS_THROUGH_NV = 0x885B; - public const int GL_DOT_PRODUCT_TEXTURE_1D_NV = 0x885C; - public const int GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = 0x885D; - public const int GL_HILO8_NV = 0x885E; - public const int GL_SIGNED_HILO8_NV = 0x885F; - public const int GL_FORCE_BLUE_TO_ONE_NV = 0x8860; - public const int GL_NV_transform_feedback = 1; - public const int GL_BACK_PRIMARY_COLOR_NV = 0x8C77; - public const int GL_BACK_SECONDARY_COLOR_NV = 0x8C78; - public const int GL_TEXTURE_COORD_NV = 0x8C79; - public const int GL_CLIP_DISTANCE_NV = 0x8C7A; - public const int GL_VERTEX_ID_NV = 0x8C7B; - public const int GL_PRIMITIVE_ID_NV = 0x8C7C; - public const int GL_GENERIC_ATTRIB_NV = 0x8C7D; - public const int GL_TRANSFORM_FEEDBACK_ATTRIBS_NV = 0x8C7E; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV = 0x8C7F; - public const int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV = 0x8C80; - public const int GL_ACTIVE_VARYINGS_NV = 0x8C81; - public const int GL_ACTIVE_VARYING_MAX_LENGTH_NV = 0x8C82; - public const int GL_TRANSFORM_FEEDBACK_VARYINGS_NV = 0x8C83; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_START_NV = 0x8C84; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV = 0x8C85; - public const int GL_TRANSFORM_FEEDBACK_RECORD_NV = 0x8C86; - public const int GL_PRIMITIVES_GENERATED_NV = 0x8C87; - public const int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV = 0x8C88; - public const int GL_RASTERIZER_DISCARD_NV = 0x8C89; - public const int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV = 0x8C8A; - public const int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = 0x8C8B; - public const int GL_INTERLEAVED_ATTRIBS_NV = 0x8C8C; - public const int GL_SEPARATE_ATTRIBS_NV = 0x8C8D; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_NV = 0x8C8E; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV = 0x8C8F; - public const int GL_LAYER_NV = 0x8DAA; - public const int GL_NEXT_BUFFER_NV = -2; - public const int GL_SKIP_COMPONENTS4_NV = -3; - public const int GL_SKIP_COMPONENTS3_NV = -4; - public const int GL_SKIP_COMPONENTS2_NV = -5; - public const int GL_SKIP_COMPONENTS1_NV = -6; - public const int GL_NV_transform_feedback2 = 1; - public const int GL_TRANSFORM_FEEDBACK_NV = 0x8E22; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV = 0x8E23; - public const int GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV = 0x8E24; - public const int GL_TRANSFORM_FEEDBACK_BINDING_NV = 0x8E25; - public const int GL_NV_uniform_buffer_unified_memory = 1; - public const int GL_UNIFORM_BUFFER_UNIFIED_NV = 0x936E; - public const int GL_UNIFORM_BUFFER_ADDRESS_NV = 0x936F; - public const int GL_UNIFORM_BUFFER_LENGTH_NV = 0x9370; - public const int GL_NV_vdpau_interop = 1; - public const int GL_SURFACE_STATE_NV = 0x86EB; - public const int GL_SURFACE_REGISTERED_NV = 0x86FD; - public const int GL_SURFACE_MAPPED_NV = 0x8700; - public const int GL_WRITE_DISCARD_NV = 0x88BE; - public const int GL_NV_vertex_array_range = 1; - public const int GL_VERTEX_ARRAY_RANGE_NV = 0x851D; - public const int GL_VERTEX_ARRAY_RANGE_LENGTH_NV = 0x851E; - public const int GL_VERTEX_ARRAY_RANGE_VALID_NV = 0x851F; - public const int GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV = 0x8520; - public const int GL_VERTEX_ARRAY_RANGE_POINTER_NV = 0x8521; - public const int GL_NV_vertex_array_range2 = 1; - public const int GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV = 0x8533; - public const int GL_NV_vertex_attrib_integer_64bit = 1; - public const int GL_NV_vertex_buffer_unified_memory = 1; - public const int GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV = 0x8F1E; - public const int GL_ELEMENT_ARRAY_UNIFIED_NV = 0x8F1F; - public const int GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV = 0x8F20; - public const int GL_VERTEX_ARRAY_ADDRESS_NV = 0x8F21; - public const int GL_NORMAL_ARRAY_ADDRESS_NV = 0x8F22; - public const int GL_COLOR_ARRAY_ADDRESS_NV = 0x8F23; - public const int GL_INDEX_ARRAY_ADDRESS_NV = 0x8F24; - public const int GL_TEXTURE_COORD_ARRAY_ADDRESS_NV = 0x8F25; - public const int GL_EDGE_FLAG_ARRAY_ADDRESS_NV = 0x8F26; - public const int GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV = 0x8F27; - public const int GL_FOG_COORD_ARRAY_ADDRESS_NV = 0x8F28; - public const int GL_ELEMENT_ARRAY_ADDRESS_NV = 0x8F29; - public const int GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV = 0x8F2A; - public const int GL_VERTEX_ARRAY_LENGTH_NV = 0x8F2B; - public const int GL_NORMAL_ARRAY_LENGTH_NV = 0x8F2C; - public const int GL_COLOR_ARRAY_LENGTH_NV = 0x8F2D; - public const int GL_INDEX_ARRAY_LENGTH_NV = 0x8F2E; - public const int GL_TEXTURE_COORD_ARRAY_LENGTH_NV = 0x8F2F; - public const int GL_EDGE_FLAG_ARRAY_LENGTH_NV = 0x8F30; - public const int GL_SECONDARY_COLOR_ARRAY_LENGTH_NV = 0x8F31; - public const int GL_FOG_COORD_ARRAY_LENGTH_NV = 0x8F32; - public const int GL_ELEMENT_ARRAY_LENGTH_NV = 0x8F33; - public const int GL_DRAW_INDIRECT_UNIFIED_NV = 0x8F40; - public const int GL_DRAW_INDIRECT_ADDRESS_NV = 0x8F41; - public const int GL_DRAW_INDIRECT_LENGTH_NV = 0x8F42; - public const int GL_NV_vertex_program = 1; - public const int GL_VERTEX_PROGRAM_NV = 0x8620; - public const int GL_VERTEX_STATE_PROGRAM_NV = 0x8621; - public const int GL_ATTRIB_ARRAY_SIZE_NV = 0x8623; - public const int GL_ATTRIB_ARRAY_STRIDE_NV = 0x8624; - public const int GL_ATTRIB_ARRAY_TYPE_NV = 0x8625; - public const int GL_CURRENT_ATTRIB_NV = 0x8626; - public const int GL_PROGRAM_LENGTH_NV = 0x8627; - public const int GL_PROGRAM_STRING_NV = 0x8628; - public const int GL_MODELVIEW_PROJECTION_NV = 0x8629; - public const int GL_IDENTITY_NV = 0x862A; - public const int GL_INVERSE_NV = 0x862B; - public const int GL_TRANSPOSE_NV = 0x862C; - public const int GL_INVERSE_TRANSPOSE_NV = 0x862D; - public const int GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E; - public const int GL_MAX_TRACK_MATRICES_NV = 0x862F; - public const int GL_MATRIX0_NV = 0x8630; - public const int GL_MATRIX1_NV = 0x8631; - public const int GL_MATRIX2_NV = 0x8632; - public const int GL_MATRIX3_NV = 0x8633; - public const int GL_MATRIX4_NV = 0x8634; - public const int GL_MATRIX5_NV = 0x8635; - public const int GL_MATRIX6_NV = 0x8636; - public const int GL_MATRIX7_NV = 0x8637; - public const int GL_CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640; - public const int GL_CURRENT_MATRIX_NV = 0x8641; - public const int GL_VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642; - public const int GL_VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643; - public const int GL_PROGRAM_PARAMETER_NV = 0x8644; - public const int GL_ATTRIB_ARRAY_POINTER_NV = 0x8645; - public const int GL_PROGRAM_TARGET_NV = 0x8646; - public const int GL_PROGRAM_RESIDENT_NV = 0x8647; - public const int GL_TRACK_MATRIX_NV = 0x8648; - public const int GL_TRACK_MATRIX_TRANSFORM_NV = 0x8649; - public const int GL_VERTEX_PROGRAM_BINDING_NV = 0x864A; - public const int GL_PROGRAM_ERROR_POSITION_NV = 0x864B; - public const int GL_VERTEX_ATTRIB_ARRAY0_NV = 0x8650; - public const int GL_VERTEX_ATTRIB_ARRAY1_NV = 0x8651; - public const int GL_VERTEX_ATTRIB_ARRAY2_NV = 0x8652; - public const int GL_VERTEX_ATTRIB_ARRAY3_NV = 0x8653; - public const int GL_VERTEX_ATTRIB_ARRAY4_NV = 0x8654; - public const int GL_VERTEX_ATTRIB_ARRAY5_NV = 0x8655; - public const int GL_VERTEX_ATTRIB_ARRAY6_NV = 0x8656; - public const int GL_VERTEX_ATTRIB_ARRAY7_NV = 0x8657; - public const int GL_VERTEX_ATTRIB_ARRAY8_NV = 0x8658; - public const int GL_VERTEX_ATTRIB_ARRAY9_NV = 0x8659; - public const int GL_VERTEX_ATTRIB_ARRAY10_NV = 0x865A; - public const int GL_VERTEX_ATTRIB_ARRAY11_NV = 0x865B; - public const int GL_VERTEX_ATTRIB_ARRAY12_NV = 0x865C; - public const int GL_VERTEX_ATTRIB_ARRAY13_NV = 0x865D; - public const int GL_VERTEX_ATTRIB_ARRAY14_NV = 0x865E; - public const int GL_VERTEX_ATTRIB_ARRAY15_NV = 0x865F; - public const int GL_MAP1_VERTEX_ATTRIB0_4_NV = 0x8660; - public const int GL_MAP1_VERTEX_ATTRIB1_4_NV = 0x8661; - public const int GL_MAP1_VERTEX_ATTRIB2_4_NV = 0x8662; - public const int GL_MAP1_VERTEX_ATTRIB3_4_NV = 0x8663; - public const int GL_MAP1_VERTEX_ATTRIB4_4_NV = 0x8664; - public const int GL_MAP1_VERTEX_ATTRIB5_4_NV = 0x8665; - public const int GL_MAP1_VERTEX_ATTRIB6_4_NV = 0x8666; - public const int GL_MAP1_VERTEX_ATTRIB7_4_NV = 0x8667; - public const int GL_MAP1_VERTEX_ATTRIB8_4_NV = 0x8668; - public const int GL_MAP1_VERTEX_ATTRIB9_4_NV = 0x8669; - public const int GL_MAP1_VERTEX_ATTRIB10_4_NV = 0x866A; - public const int GL_MAP1_VERTEX_ATTRIB11_4_NV = 0x866B; - public const int GL_MAP1_VERTEX_ATTRIB12_4_NV = 0x866C; - public const int GL_MAP1_VERTEX_ATTRIB13_4_NV = 0x866D; - public const int GL_MAP1_VERTEX_ATTRIB14_4_NV = 0x866E; - public const int GL_MAP1_VERTEX_ATTRIB15_4_NV = 0x866F; - public const int GL_MAP2_VERTEX_ATTRIB0_4_NV = 0x8670; - public const int GL_MAP2_VERTEX_ATTRIB1_4_NV = 0x8671; - public const int GL_MAP2_VERTEX_ATTRIB2_4_NV = 0x8672; - public const int GL_MAP2_VERTEX_ATTRIB3_4_NV = 0x8673; - public const int GL_MAP2_VERTEX_ATTRIB4_4_NV = 0x8674; - public const int GL_MAP2_VERTEX_ATTRIB5_4_NV = 0x8675; - public const int GL_MAP2_VERTEX_ATTRIB6_4_NV = 0x8676; - public const int GL_MAP2_VERTEX_ATTRIB7_4_NV = 0x8677; - public const int GL_MAP2_VERTEX_ATTRIB8_4_NV = 0x8678; - public const int GL_MAP2_VERTEX_ATTRIB9_4_NV = 0x8679; - public const int GL_MAP2_VERTEX_ATTRIB10_4_NV = 0x867A; - public const int GL_MAP2_VERTEX_ATTRIB11_4_NV = 0x867B; - public const int GL_MAP2_VERTEX_ATTRIB12_4_NV = 0x867C; - public const int GL_MAP2_VERTEX_ATTRIB13_4_NV = 0x867D; - public const int GL_MAP2_VERTEX_ATTRIB14_4_NV = 0x867E; - public const int GL_MAP2_VERTEX_ATTRIB15_4_NV = 0x867F; - public const int GL_NV_vertex_program1_1 = 1; - public const int GL_NV_vertex_program2 = 1; - public const int GL_NV_vertex_program2_option = 1; - public const int GL_NV_vertex_program3 = 1; - public const int GL_NV_vertex_program4 = 1; - public const int GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV = 0x88FD; - public const int GL_NV_video_capture = 1; - public const int GL_VIDEO_BUFFER_NV = 0x9020; - public const int GL_VIDEO_BUFFER_BINDING_NV = 0x9021; - public const int GL_FIELD_UPPER_NV = 0x9022; - public const int GL_FIELD_LOWER_NV = 0x9023; - public const int GL_NUM_VIDEO_CAPTURE_STREAMS_NV = 0x9024; - public const int GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV = 0x9025; - public const int GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV = 0x9026; - public const int GL_LAST_VIDEO_CAPTURE_STATUS_NV = 0x9027; - public const int GL_VIDEO_BUFFER_PITCH_NV = 0x9028; - public const int GL_VIDEO_COLOR_CONVERSION_MATRIX_NV = 0x9029; - public const int GL_VIDEO_COLOR_CONVERSION_MAX_NV = 0x902A; - public const int GL_VIDEO_COLOR_CONVERSION_MIN_NV = 0x902B; - public const int GL_VIDEO_COLOR_CONVERSION_OFFSET_NV = 0x902C; - public const int GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV = 0x902D; - public const int GL_PARTIAL_SUCCESS_NV = 0x902E; - public const int GL_SUCCESS_NV = 0x902F; - public const int GL_FAILURE_NV = 0x9030; - public const int GL_YCBYCR8_422_NV = 0x9031; - public const int GL_YCBAYCR8A_4224_NV = 0x9032; - public const int GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV = 0x9033; - public const int GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV = 0x9034; - public const int GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV = 0x9035; - public const int GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV = 0x9036; - public const int GL_Z4Y12Z4CB12Z4CR12_444_NV = 0x9037; - public const int GL_VIDEO_CAPTURE_FRAME_WIDTH_NV = 0x9038; - public const int GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV = 0x9039; - public const int GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV = 0x903A; - public const int GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV = 0x903B; - public const int GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV = 0x903C; - public const int GL_NV_viewport_array2 = 1; - public const int GL_NV_viewport_swizzle = 1; - public const int GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV = 0x9350; - public const int GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV = 0x9351; - public const int GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV = 0x9352; - public const int GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV = 0x9353; - public const int GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV = 0x9354; - public const int GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV = 0x9355; - public const int GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV = 0x9356; - public const int GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV = 0x9357; - public const int GL_VIEWPORT_SWIZZLE_X_NV = 0x9358; - public const int GL_VIEWPORT_SWIZZLE_Y_NV = 0x9359; - public const int GL_VIEWPORT_SWIZZLE_Z_NV = 0x935A; - public const int GL_VIEWPORT_SWIZZLE_W_NV = 0x935B; - public const int GL_OML_interlace = 1; - public const int GL_INTERLACE_OML = 0x8980; - public const int GL_INTERLACE_READ_OML = 0x8981; - public const int GL_OML_resample = 1; - public const int GL_PACK_RESAMPLE_OML = 0x8984; - public const int GL_UNPACK_RESAMPLE_OML = 0x8985; - public const int GL_RESAMPLE_REPLICATE_OML = 0x8986; - public const int GL_RESAMPLE_ZERO_FILL_OML = 0x8987; - public const int GL_RESAMPLE_AVERAGE_OML = 0x8988; - public const int GL_RESAMPLE_DECIMATE_OML = 0x8989; - public const int GL_OML_subsample = 1; - public const int GL_FORMAT_SUBSAMPLE_24_24_OML = 0x8982; - public const int GL_FORMAT_SUBSAMPLE_244_244_OML = 0x8983; - public const int GL_OVR_multiview = 1; - public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR = 0x9630; - public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR = 0x9632; - public const int GL_MAX_VIEWS_OVR = 0x9631; - public const int GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR = 0x9633; - public const int GL_OVR_multiview2 = 1; - public const int GL_PGI_misc_hints = 1; - public const int GL_PREFER_DOUBLEBUFFER_HINT_PGI = 0x1A1F8; - public const int GL_CONSERVE_MEMORY_HINT_PGI = 0x1A1FD; - public const int GL_RECLAIM_MEMORY_HINT_PGI = 0x1A1FE; - public const int GL_NATIVE_GRAPHICS_HANDLE_PGI = 0x1A202; - public const int GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI = 0x1A203; - public const int GL_NATIVE_GRAPHICS_END_HINT_PGI = 0x1A204; - public const int GL_ALWAYS_FAST_HINT_PGI = 0x1A20C; - public const int GL_ALWAYS_SOFT_HINT_PGI = 0x1A20D; - public const int GL_ALLOW_DRAW_OBJ_HINT_PGI = 0x1A20E; - public const int GL_ALLOW_DRAW_WIN_HINT_PGI = 0x1A20F; - public const int GL_ALLOW_DRAW_FRG_HINT_PGI = 0x1A210; - public const int GL_ALLOW_DRAW_MEM_HINT_PGI = 0x1A211; - public const int GL_STRICT_DEPTHFUNC_HINT_PGI = 0x1A216; - public const int GL_STRICT_LIGHTING_HINT_PGI = 0x1A217; - public const int GL_STRICT_SCISSOR_HINT_PGI = 0x1A218; - public const int GL_FULL_STIPPLE_HINT_PGI = 0x1A219; - public const int GL_CLIP_NEAR_HINT_PGI = 0x1A220; - public const int GL_CLIP_FAR_HINT_PGI = 0x1A221; - public const int GL_WIDE_LINE_HINT_PGI = 0x1A222; - public const int GL_BACK_NORMALS_HINT_PGI = 0x1A223; - public const int GL_PGI_vertex_hints = 1; - public const int GL_VERTEX_DATA_HINT_PGI = 0x1A22A; - public const int GL_VERTEX_CONSISTENT_HINT_PGI = 0x1A22B; - public const int GL_MATERIAL_SIDE_HINT_PGI = 0x1A22C; - public const int GL_MAX_VERTEX_HINT_PGI = 0x1A22D; - public const int GL_COLOR3_BIT_PGI = 0x00010000; - public const int GL_COLOR4_BIT_PGI = 0x00020000; - public const int GL_EDGEFLAG_BIT_PGI = 0x00040000; - public const int GL_INDEX_BIT_PGI = 0x00080000; - public const int GL_MAT_AMBIENT_BIT_PGI = 0x00100000; - public const int GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI = 0x00200000; - public const int GL_MAT_DIFFUSE_BIT_PGI = 0x00400000; - public const int GL_MAT_EMISSION_BIT_PGI = 0x00800000; - public const int GL_MAT_COLOR_INDEXES_BIT_PGI = 0x01000000; - public const int GL_MAT_SHININESS_BIT_PGI = 0x02000000; - public const int GL_MAT_SPECULAR_BIT_PGI = 0x04000000; - public const int GL_NORMAL_BIT_PGI = 0x08000000; - public const int GL_TEXCOORD1_BIT_PGI = 0x10000000; - public const int GL_TEXCOORD2_BIT_PGI = 0x20000000; - public const int GL_TEXCOORD3_BIT_PGI = 0x40000000; - public const int GL_TEXCOORD4_BIT_PGI = unchecked((int)0x80000000); - public const int GL_VERTEX23_BIT_PGI = 0x00000004; - public const int GL_VERTEX4_BIT_PGI = 0x00000008; - public const int GL_REND_screen_coordinates = 1; - public const int GL_SCREEN_COORDINATES_REND = 0x8490; - public const int GL_INVERTED_SCREEN_W_REND = 0x8491; - public const int GL_S3_s3tc = 1; - public const int GL_RGB_S3TC = 0x83A0; - public const int GL_RGB4_S3TC = 0x83A1; - public const int GL_RGBA_S3TC = 0x83A2; - public const int GL_RGBA4_S3TC = 0x83A3; - public const int GL_RGBA_DXT5_S3TC = 0x83A4; - public const int GL_RGBA4_DXT5_S3TC = 0x83A5; - public const int GL_SGIS_detail_texture = 1; - public const int GL_DETAIL_TEXTURE_2D_SGIS = 0x8095; - public const int GL_DETAIL_TEXTURE_2D_BINDING_SGIS = 0x8096; - public const int GL_LINEAR_DETAIL_SGIS = 0x8097; - public const int GL_LINEAR_DETAIL_ALPHA_SGIS = 0x8098; - public const int GL_LINEAR_DETAIL_COLOR_SGIS = 0x8099; - public const int GL_DETAIL_TEXTURE_LEVEL_SGIS = 0x809A; - public const int GL_DETAIL_TEXTURE_MODE_SGIS = 0x809B; - public const int GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS = 0x809C; - public const int GL_SGIS_fog_function = 1; - public const int GL_FOG_FUNC_SGIS = 0x812A; - public const int GL_FOG_FUNC_POINTS_SGIS = 0x812B; - public const int GL_MAX_FOG_FUNC_POINTS_SGIS = 0x812C; - public const int GL_SGIS_generate_mipmap = 1; - public const int GL_GENERATE_MIPMAP_SGIS = 0x8191; - public const int GL_GENERATE_MIPMAP_HINT_SGIS = 0x8192; - public const int GL_SGIS_multisample = 1; - public const int GL_MULTISAMPLE_SGIS = 0x809D; - public const int GL_SAMPLE_ALPHA_TO_MASK_SGIS = 0x809E; - public const int GL_SAMPLE_ALPHA_TO_ONE_SGIS = 0x809F; - public const int GL_SAMPLE_MASK_SGIS = 0x80A0; - public const int GL_1PASS_SGIS = 0x80A1; - public const int GL_2PASS_0_SGIS = 0x80A2; - public const int GL_2PASS_1_SGIS = 0x80A3; - public const int GL_4PASS_0_SGIS = 0x80A4; - public const int GL_4PASS_1_SGIS = 0x80A5; - public const int GL_4PASS_2_SGIS = 0x80A6; - public const int GL_4PASS_3_SGIS = 0x80A7; - public const int GL_SAMPLE_BUFFERS_SGIS = 0x80A8; - public const int GL_SAMPLES_SGIS = 0x80A9; - public const int GL_SAMPLE_MASK_VALUE_SGIS = 0x80AA; - public const int GL_SAMPLE_MASK_INVERT_SGIS = 0x80AB; - public const int GL_SAMPLE_PATTERN_SGIS = 0x80AC; - public const int GL_SGIS_pixel_texture = 1; - public const int GL_PIXEL_TEXTURE_SGIS = 0x8353; - public const int GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS = 0x8354; - public const int GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS = 0x8355; - public const int GL_PIXEL_GROUP_COLOR_SGIS = 0x8356; - public const int GL_SGIS_point_line_texgen = 1; - public const int GL_EYE_DISTANCE_TO_POINT_SGIS = 0x81F0; - public const int GL_OBJECT_DISTANCE_TO_POINT_SGIS = 0x81F1; - public const int GL_EYE_DISTANCE_TO_LINE_SGIS = 0x81F2; - public const int GL_OBJECT_DISTANCE_TO_LINE_SGIS = 0x81F3; - public const int GL_EYE_POINT_SGIS = 0x81F4; - public const int GL_OBJECT_POINT_SGIS = 0x81F5; - public const int GL_EYE_LINE_SGIS = 0x81F6; - public const int GL_OBJECT_LINE_SGIS = 0x81F7; - public const int GL_SGIS_point_parameters = 1; - public const int GL_POINT_SIZE_MIN_SGIS = 0x8126; - public const int GL_POINT_SIZE_MAX_SGIS = 0x8127; - public const int GL_POINT_FADE_THRESHOLD_SIZE_SGIS = 0x8128; - public const int GL_DISTANCE_ATTENUATION_SGIS = 0x8129; - public const int GL_SGIS_sharpen_texture = 1; - public const int GL_LINEAR_SHARPEN_SGIS = 0x80AD; - public const int GL_LINEAR_SHARPEN_ALPHA_SGIS = 0x80AE; - public const int GL_LINEAR_SHARPEN_COLOR_SGIS = 0x80AF; - public const int GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS = 0x80B0; - public const int GL_SGIS_texture4D = 1; - public const int GL_PACK_SKIP_VOLUMES_SGIS = 0x8130; - public const int GL_PACK_IMAGE_DEPTH_SGIS = 0x8131; - public const int GL_UNPACK_SKIP_VOLUMES_SGIS = 0x8132; - public const int GL_UNPACK_IMAGE_DEPTH_SGIS = 0x8133; - public const int GL_TEXTURE_4D_SGIS = 0x8134; - public const int GL_PROXY_TEXTURE_4D_SGIS = 0x8135; - public const int GL_TEXTURE_4DSIZE_SGIS = 0x8136; - public const int GL_TEXTURE_WRAP_Q_SGIS = 0x8137; - public const int GL_MAX_4D_TEXTURE_SIZE_SGIS = 0x8138; - public const int GL_TEXTURE_4D_BINDING_SGIS = 0x814F; - public const int GL_SGIS_texture_border_clamp = 1; - public const int GL_CLAMP_TO_BORDER_SGIS = 0x812D; - public const int GL_SGIS_texture_color_mask = 1; - public const int GL_TEXTURE_COLOR_WRITEMASK_SGIS = 0x81EF; - public const int GL_SGIS_texture_edge_clamp = 1; - public const int GL_CLAMP_TO_EDGE_SGIS = 0x812F; - public const int GL_SGIS_texture_filter4 = 1; - public const int GL_FILTER4_SGIS = 0x8146; - public const int GL_TEXTURE_FILTER4_SIZE_SGIS = 0x8147; - public const int GL_SGIS_texture_lod = 1; - public const int GL_TEXTURE_MIN_LOD_SGIS = 0x813A; - public const int GL_TEXTURE_MAX_LOD_SGIS = 0x813B; - public const int GL_TEXTURE_BASE_LEVEL_SGIS = 0x813C; - public const int GL_TEXTURE_MAX_LEVEL_SGIS = 0x813D; - public const int GL_SGIS_texture_select = 1; - public const int GL_DUAL_ALPHA4_SGIS = 0x8110; - public const int GL_DUAL_ALPHA8_SGIS = 0x8111; - public const int GL_DUAL_ALPHA12_SGIS = 0x8112; - public const int GL_DUAL_ALPHA16_SGIS = 0x8113; - public const int GL_DUAL_LUMINANCE4_SGIS = 0x8114; - public const int GL_DUAL_LUMINANCE8_SGIS = 0x8115; - public const int GL_DUAL_LUMINANCE12_SGIS = 0x8116; - public const int GL_DUAL_LUMINANCE16_SGIS = 0x8117; - public const int GL_DUAL_INTENSITY4_SGIS = 0x8118; - public const int GL_DUAL_INTENSITY8_SGIS = 0x8119; - public const int GL_DUAL_INTENSITY12_SGIS = 0x811A; - public const int GL_DUAL_INTENSITY16_SGIS = 0x811B; - public const int GL_DUAL_LUMINANCE_ALPHA4_SGIS = 0x811C; - public const int GL_DUAL_LUMINANCE_ALPHA8_SGIS = 0x811D; - public const int GL_QUAD_ALPHA4_SGIS = 0x811E; - public const int GL_QUAD_ALPHA8_SGIS = 0x811F; - public const int GL_QUAD_LUMINANCE4_SGIS = 0x8120; - public const int GL_QUAD_LUMINANCE8_SGIS = 0x8121; - public const int GL_QUAD_INTENSITY4_SGIS = 0x8122; - public const int GL_QUAD_INTENSITY8_SGIS = 0x8123; - public const int GL_DUAL_TEXTURE_SELECT_SGIS = 0x8124; - public const int GL_QUAD_TEXTURE_SELECT_SGIS = 0x8125; - public const int GL_SGIX_async = 1; - public const int GL_ASYNC_MARKER_SGIX = 0x8329; - public const int GL_SGIX_async_histogram = 1; - public const int GL_ASYNC_HISTOGRAM_SGIX = 0x832C; - public const int GL_MAX_ASYNC_HISTOGRAM_SGIX = 0x832D; - public const int GL_SGIX_async_pixel = 1; - public const int GL_ASYNC_TEX_IMAGE_SGIX = 0x835C; - public const int GL_ASYNC_DRAW_PIXELS_SGIX = 0x835D; - public const int GL_ASYNC_READ_PIXELS_SGIX = 0x835E; - public const int GL_MAX_ASYNC_TEX_IMAGE_SGIX = 0x835F; - public const int GL_MAX_ASYNC_DRAW_PIXELS_SGIX = 0x8360; - public const int GL_MAX_ASYNC_READ_PIXELS_SGIX = 0x8361; - public const int GL_SGIX_blend_alpha_minmax = 1; - public const int GL_ALPHA_MIN_SGIX = 0x8320; - public const int GL_ALPHA_MAX_SGIX = 0x8321; - public const int GL_SGIX_calligraphic_fragment = 1; - public const int GL_CALLIGRAPHIC_FRAGMENT_SGIX = 0x8183; - public const int GL_SGIX_clipmap = 1; - public const int GL_LINEAR_CLIPMAP_LINEAR_SGIX = 0x8170; - public const int GL_TEXTURE_CLIPMAP_CENTER_SGIX = 0x8171; - public const int GL_TEXTURE_CLIPMAP_FRAME_SGIX = 0x8172; - public const int GL_TEXTURE_CLIPMAP_OFFSET_SGIX = 0x8173; - public const int GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX = 0x8174; - public const int GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX = 0x8175; - public const int GL_TEXTURE_CLIPMAP_DEPTH_SGIX = 0x8176; - public const int GL_MAX_CLIPMAP_DEPTH_SGIX = 0x8177; - public const int GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX = 0x8178; - public const int GL_NEAREST_CLIPMAP_NEAREST_SGIX = 0x844D; - public const int GL_NEAREST_CLIPMAP_LINEAR_SGIX = 0x844E; - public const int GL_LINEAR_CLIPMAP_NEAREST_SGIX = 0x844F; - public const int GL_SGIX_convolution_accuracy = 1; - public const int GL_CONVOLUTION_HINT_SGIX = 0x8316; - public const int GL_SGIX_depth_pass_instrument = 1; - public const int GL_SGIX_depth_texture = 1; - public const int GL_DEPTH_COMPONENT16_SGIX = 0x81A5; - public const int GL_DEPTH_COMPONENT24_SGIX = 0x81A6; - public const int GL_DEPTH_COMPONENT32_SGIX = 0x81A7; - public const int GL_SGIX_flush_raster = 1; - public const int GL_SGIX_fog_offset = 1; - public const int GL_FOG_OFFSET_SGIX = 0x8198; - public const int GL_FOG_OFFSET_VALUE_SGIX = 0x8199; - public const int GL_SGIX_fragment_lighting = 1; - public const int GL_FRAGMENT_LIGHTING_SGIX = 0x8400; - public const int GL_FRAGMENT_COLOR_MATERIAL_SGIX = 0x8401; - public const int GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX = 0x8402; - public const int GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX = 0x8403; - public const int GL_MAX_FRAGMENT_LIGHTS_SGIX = 0x8404; - public const int GL_MAX_ACTIVE_LIGHTS_SGIX = 0x8405; - public const int GL_CURRENT_RASTER_NORMAL_SGIX = 0x8406; - public const int GL_LIGHT_ENV_MODE_SGIX = 0x8407; - public const int GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX = 0x8408; - public const int GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX = 0x8409; - public const int GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX = 0x840A; - public const int GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX = 0x840B; - public const int GL_FRAGMENT_LIGHT0_SGIX = 0x840C; - public const int GL_FRAGMENT_LIGHT1_SGIX = 0x840D; - public const int GL_FRAGMENT_LIGHT2_SGIX = 0x840E; - public const int GL_FRAGMENT_LIGHT3_SGIX = 0x840F; - public const int GL_FRAGMENT_LIGHT4_SGIX = 0x8410; - public const int GL_FRAGMENT_LIGHT5_SGIX = 0x8411; - public const int GL_FRAGMENT_LIGHT6_SGIX = 0x8412; - public const int GL_FRAGMENT_LIGHT7_SGIX = 0x8413; - public const int GL_SGIX_framezoom = 1; - public const int GL_FRAMEZOOM_SGIX = 0x818B; - public const int GL_FRAMEZOOM_FACTOR_SGIX = 0x818C; - public const int GL_MAX_FRAMEZOOM_FACTOR_SGIX = 0x818D; - public const int GL_SGIX_igloo_interface = 1; - public const int GL_SGIX_instruments = 1; - public const int GL_INSTRUMENT_BUFFER_POINTER_SGIX = 0x8180; - public const int GL_INSTRUMENT_MEASUREMENTS_SGIX = 0x8181; - public const int GL_SGIX_interlace = 1; - public const int GL_INTERLACE_SGIX = 0x8094; - public const int GL_SGIX_ir_instrument1 = 1; - public const int GL_IR_INSTRUMENT1_SGIX = 0x817F; - public const int GL_SGIX_list_priority = 1; - public const int GL_LIST_PRIORITY_SGIX = 0x8182; - public const int GL_SGIX_pixel_texture = 1; - public const int GL_PIXEL_TEX_GEN_SGIX = 0x8139; - public const int GL_PIXEL_TEX_GEN_MODE_SGIX = 0x832B; - public const int GL_SGIX_pixel_tiles = 1; - public const int GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX = 0x813E; - public const int GL_PIXEL_TILE_CACHE_INCREMENT_SGIX = 0x813F; - public const int GL_PIXEL_TILE_WIDTH_SGIX = 0x8140; - public const int GL_PIXEL_TILE_HEIGHT_SGIX = 0x8141; - public const int GL_PIXEL_TILE_GRID_WIDTH_SGIX = 0x8142; - public const int GL_PIXEL_TILE_GRID_HEIGHT_SGIX = 0x8143; - public const int GL_PIXEL_TILE_GRID_DEPTH_SGIX = 0x8144; - public const int GL_PIXEL_TILE_CACHE_SIZE_SGIX = 0x8145; - public const int GL_SGIX_polynomial_ffd = 1; - public const int GL_TEXTURE_DEFORMATION_BIT_SGIX = 0x00000001; - public const int GL_GEOMETRY_DEFORMATION_BIT_SGIX = 0x00000002; - public const int GL_GEOMETRY_DEFORMATION_SGIX = 0x8194; - public const int GL_TEXTURE_DEFORMATION_SGIX = 0x8195; - public const int GL_DEFORMATIONS_MASK_SGIX = 0x8196; - public const int GL_MAX_DEFORMATION_ORDER_SGIX = 0x8197; - public const int GL_SGIX_reference_plane = 1; - public const int GL_REFERENCE_PLANE_SGIX = 0x817D; - public const int GL_REFERENCE_PLANE_EQUATION_SGIX = 0x817E; - public const int GL_SGIX_resample = 1; - public const int GL_PACK_RESAMPLE_SGIX = 0x842E; - public const int GL_UNPACK_RESAMPLE_SGIX = 0x842F; - public const int GL_RESAMPLE_REPLICATE_SGIX = 0x8433; - public const int GL_RESAMPLE_ZERO_FILL_SGIX = 0x8434; - public const int GL_RESAMPLE_DECIMATE_SGIX = 0x8430; - public const int GL_SGIX_scalebias_hint = 1; - public const int GL_SCALEBIAS_HINT_SGIX = 0x8322; - public const int GL_SGIX_shadow = 1; - public const int GL_TEXTURE_COMPARE_SGIX = 0x819A; - public const int GL_TEXTURE_COMPARE_OPERATOR_SGIX = 0x819B; - public const int GL_TEXTURE_LEQUAL_R_SGIX = 0x819C; - public const int GL_TEXTURE_GEQUAL_R_SGIX = 0x819D; - public const int GL_SGIX_shadow_ambient = 1; - public const int GL_SHADOW_AMBIENT_SGIX = 0x80BF; - public const int GL_SGIX_sprite = 1; - public const int GL_SPRITE_SGIX = 0x8148; - public const int GL_SPRITE_MODE_SGIX = 0x8149; - public const int GL_SPRITE_AXIS_SGIX = 0x814A; - public const int GL_SPRITE_TRANSLATION_SGIX = 0x814B; - public const int GL_SPRITE_AXIAL_SGIX = 0x814C; - public const int GL_SPRITE_OBJECT_ALIGNED_SGIX = 0x814D; - public const int GL_SPRITE_EYE_ALIGNED_SGIX = 0x814E; - public const int GL_SGIX_subsample = 1; - public const int GL_PACK_SUBSAMPLE_RATE_SGIX = 0x85A0; - public const int GL_UNPACK_SUBSAMPLE_RATE_SGIX = 0x85A1; - public const int GL_PIXEL_SUBSAMPLE_4444_SGIX = 0x85A2; - public const int GL_PIXEL_SUBSAMPLE_2424_SGIX = 0x85A3; - public const int GL_PIXEL_SUBSAMPLE_4242_SGIX = 0x85A4; - public const int GL_SGIX_tag_sample_buffer = 1; - public const int GL_SGIX_texture_add_env = 1; - public const int GL_TEXTURE_ENV_BIAS_SGIX = 0x80BE; - public const int GL_SGIX_texture_coordinate_clamp = 1; - public const int GL_TEXTURE_MAX_CLAMP_S_SGIX = 0x8369; - public const int GL_TEXTURE_MAX_CLAMP_T_SGIX = 0x836A; - public const int GL_TEXTURE_MAX_CLAMP_R_SGIX = 0x836B; - public const int GL_SGIX_texture_lod_bias = 1; - public const int GL_TEXTURE_LOD_BIAS_S_SGIX = 0x818E; - public const int GL_TEXTURE_LOD_BIAS_T_SGIX = 0x818F; - public const int GL_TEXTURE_LOD_BIAS_R_SGIX = 0x8190; - public const int GL_SGIX_texture_multi_buffer = 1; - public const int GL_TEXTURE_MULTI_BUFFER_HINT_SGIX = 0x812E; - public const int GL_SGIX_texture_scale_bias = 1; - public const int GL_POST_TEXTURE_FILTER_BIAS_SGIX = 0x8179; - public const int GL_POST_TEXTURE_FILTER_SCALE_SGIX = 0x817A; - public const int GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX = 0x817B; - public const int GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX = 0x817C; - public const int GL_SGIX_vertex_preclip = 1; - public const int GL_VERTEX_PRECLIP_SGIX = 0x83EE; - public const int GL_VERTEX_PRECLIP_HINT_SGIX = 0x83EF; - public const int GL_SGIX_ycrcb = 1; - public const int GL_YCRCB_422_SGIX = 0x81BB; - public const int GL_YCRCB_444_SGIX = 0x81BC; - public const int GL_SGIX_ycrcb_subsample = 1; - public const int GL_SGIX_ycrcba = 1; - public const int GL_YCRCB_SGIX = 0x8318; - public const int GL_YCRCBA_SGIX = 0x8319; - public const int GL_SGI_color_matrix = 1; - public const int GL_COLOR_MATRIX_SGI = 0x80B1; - public const int GL_COLOR_MATRIX_STACK_DEPTH_SGI = 0x80B2; - public const int GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI = 0x80B3; - public const int GL_POST_COLOR_MATRIX_RED_SCALE_SGI = 0x80B4; - public const int GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI = 0x80B5; - public const int GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI = 0x80B6; - public const int GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI = 0x80B7; - public const int GL_POST_COLOR_MATRIX_RED_BIAS_SGI = 0x80B8; - public const int GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI = 0x80B9; - public const int GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI = 0x80BA; - public const int GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI = 0x80BB; - public const int GL_SGI_color_table = 1; - public const int GL_COLOR_TABLE_SGI = 0x80D0; - public const int GL_POST_CONVOLUTION_COLOR_TABLE_SGI = 0x80D1; - public const int GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI = 0x80D2; - public const int GL_PROXY_COLOR_TABLE_SGI = 0x80D3; - public const int GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI = 0x80D4; - public const int GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI = 0x80D5; - public const int GL_COLOR_TABLE_SCALE_SGI = 0x80D6; - public const int GL_COLOR_TABLE_BIAS_SGI = 0x80D7; - public const int GL_COLOR_TABLE_FORMAT_SGI = 0x80D8; - public const int GL_COLOR_TABLE_WIDTH_SGI = 0x80D9; - public const int GL_COLOR_TABLE_RED_SIZE_SGI = 0x80DA; - public const int GL_COLOR_TABLE_GREEN_SIZE_SGI = 0x80DB; - public const int GL_COLOR_TABLE_BLUE_SIZE_SGI = 0x80DC; - public const int GL_COLOR_TABLE_ALPHA_SIZE_SGI = 0x80DD; - public const int GL_COLOR_TABLE_LUMINANCE_SIZE_SGI = 0x80DE; - public const int GL_COLOR_TABLE_INTENSITY_SIZE_SGI = 0x80DF; - public const int GL_SGI_texture_color_table = 1; - public const int GL_TEXTURE_COLOR_TABLE_SGI = 0x80BC; - public const int GL_PROXY_TEXTURE_COLOR_TABLE_SGI = 0x80BD; - public const int GL_SUNX_constant_data = 1; - public const int GL_UNPACK_CONSTANT_DATA_SUNX = 0x81D5; - public const int GL_TEXTURE_CONSTANT_DATA_SUNX = 0x81D6; - public const int GL_SUN_convolution_border_modes = 1; - public const int GL_WRAP_BORDER_SUN = 0x81D4; - public const int GL_SUN_global_alpha = 1; - public const int GL_GLOBAL_ALPHA_SUN = 0x81D9; - public const int GL_GLOBAL_ALPHA_FACTOR_SUN = 0x81DA; - public const int GL_SUN_mesh_array = 1; - public const int GL_QUAD_MESH_SUN = 0x8614; - public const int GL_TRIANGLE_MESH_SUN = 0x8615; - public const int GL_SUN_slice_accum = 1; - public const int GL_SLICE_ACCUM_SUN = 0x85CC; - public const int GL_SUN_triangle_list = 1; - public const int GL_RESTART_SUN = 0x0001; - public const int GL_REPLACE_MIDDLE_SUN = 0x0002; - public const int GL_REPLACE_OLDEST_SUN = 0x0003; - public const int GL_TRIANGLE_LIST_SUN = 0x81D7; - public const int GL_REPLACEMENT_CODE_SUN = 0x81D8; - public const int GL_REPLACEMENT_CODE_ARRAY_SUN = 0x85C0; - public const int GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN = 0x85C1; - public const int GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN = 0x85C2; - public const int GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN = 0x85C3; - public const int GL_R1UI_V3F_SUN = 0x85C4; - public const int GL_R1UI_C4UB_V3F_SUN = 0x85C5; - public const int GL_R1UI_C3F_V3F_SUN = 0x85C6; - public const int GL_R1UI_N3F_V3F_SUN = 0x85C7; - public const int GL_R1UI_C4F_N3F_V3F_SUN = 0x85C8; - public const int GL_R1UI_T2F_V3F_SUN = 0x85C9; - public const int GL_R1UI_T2F_N3F_V3F_SUN = 0x85CA; - public const int GL_R1UI_T2F_C4F_N3F_V3F_SUN = 0x85CB; - public const int GL_SUN_vertex = 1; - public const int GL_WIN_phong_shading = 1; - public const int GL_PHONG_WIN = 0x80EA; - public const int GL_PHONG_HINT_WIN = 0x80EB; - public const int GL_WIN_specular_fog = 1; - public const int GL_FOG_SPECULAR_TEXTURE_WIN = 0x80EC; +// public const int GL_STENCIL_INDEX16 = 0x8D49; +// public const int GL_RENDERBUFFER_RED_SIZE = 0x8D50; +// public const int GL_RENDERBUFFER_GREEN_SIZE = 0x8D51; +// public const int GL_RENDERBUFFER_BLUE_SIZE = 0x8D52; +// public const int GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53; +// public const int GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54; +// public const int GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55; +// public const int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56; +// public const int GL_MAX_SAMPLES = 0x8D57; +// public const int GL_INDEX = 0x8222; +// public const int GL_TEXTURE_LUMINANCE_TYPE = 0x8C14; +// public const int GL_TEXTURE_INTENSITY_TYPE = 0x8C15; +// public const int GL_FRAMEBUFFER_SRGB = 0x8DB9; +// public const int GL_HALF_FLOAT = 0x140B; +// public const int GL_MAP_READ_BIT = 0x0001; +// public const int GL_MAP_WRITE_BIT = 0x0002; +// public const int GL_MAP_INVALIDATE_RANGE_BIT = 0x0004; +// public const int GL_MAP_INVALIDATE_BUFFER_BIT = 0x0008; +// public const int GL_MAP_FLUSH_EXPLICIT_BIT = 0x0010; +// public const int GL_MAP_UNSYNCHRONIZED_BIT = 0x0020; +// public const int GL_COMPRESSED_RED_RGTC1 = 0x8DBB; +// public const int GL_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC; +// public const int GL_COMPRESSED_RG_RGTC2 = 0x8DBD; +// public const int GL_COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE; +// public const int GL_RG = 0x8227; +// public const int GL_RG_INTEGER = 0x8228; +// public const int GL_R8 = 0x8229; +// public const int GL_R16 = 0x822A; +// public const int GL_RG8 = 0x822B; +// public const int GL_RG16 = 0x822C; +// public const int GL_R16F = 0x822D; +// public const int GL_R32F = 0x822E; +// public const int GL_RG16F = 0x822F; +// public const int GL_RG32F = 0x8230; +// public const int GL_R8I = 0x8231; +// public const int GL_R8UI = 0x8232; +// public const int GL_R16I = 0x8233; +// public const int GL_R16UI = 0x8234; +// public const int GL_R32I = 0x8235; +// public const int GL_R32UI = 0x8236; +// public const int GL_RG8I = 0x8237; +// public const int GL_RG8UI = 0x8238; +// public const int GL_RG16I = 0x8239; +// public const int GL_RG16UI = 0x823A; +// public const int GL_RG32I = 0x823B; +// public const int GL_RG32UI = 0x823C; +// public const int GL_VERTEX_ARRAY_BINDING = 0x85B5; +// public const int GL_CLAMP_VERTEX_COLOR = 0x891A; +// public const int GL_CLAMP_FRAGMENT_COLOR = 0x891B; +// public const int GL_ALPHA_INTEGER = 0x8D97; +// public const int GL_VERSION_3_1 = 1; +// public const int GL_SAMPLER_2D_RECT = 0x8B63; +// public const int GL_SAMPLER_2D_RECT_SHADOW = 0x8B64; +// public const int GL_SAMPLER_BUFFER = 0x8DC2; +// public const int GL_INT_SAMPLER_2D_RECT = 0x8DCD; +// public const int GL_INT_SAMPLER_BUFFER = 0x8DD0; +// public const int GL_UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5; +// public const int GL_UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8; +// public const int GL_TEXTURE_BUFFER = 0x8C2A; +// public const int GL_MAX_TEXTURE_BUFFER_SIZE = 0x8C2B; +// public const int GL_TEXTURE_BINDING_BUFFER = 0x8C2C; +// public const int GL_TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D; +// public const int GL_TEXTURE_RECTANGLE = 0x84F5; +// public const int GL_TEXTURE_BINDING_RECTANGLE = 0x84F6; +// public const int GL_PROXY_TEXTURE_RECTANGLE = 0x84F7; +// public const int GL_MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8; +// public const int GL_R8_SNORM = 0x8F94; +// public const int GL_RG8_SNORM = 0x8F95; +// public const int GL_RGB8_SNORM = 0x8F96; +// public const int GL_RGBA8_SNORM = 0x8F97; +// public const int GL_R16_SNORM = 0x8F98; +// public const int GL_RG16_SNORM = 0x8F99; +// public const int GL_RGB16_SNORM = 0x8F9A; +// public const int GL_RGBA16_SNORM = 0x8F9B; +// public const int GL_SIGNED_NORMALIZED = 0x8F9C; +// public const int GL_PRIMITIVE_RESTART = 0x8F9D; +// public const int GL_PRIMITIVE_RESTART_INDEX = 0x8F9E; +// public const int GL_COPY_READ_BUFFER = 0x8F36; +// public const int GL_COPY_WRITE_BUFFER = 0x8F37; +// public const int GL_UNIFORM_BUFFER = 0x8A11; +// public const int GL_UNIFORM_BUFFER_BINDING = 0x8A28; +// public const int GL_UNIFORM_BUFFER_START = 0x8A29; +// public const int GL_UNIFORM_BUFFER_SIZE = 0x8A2A; +// public const int GL_MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B; +// public const int GL_MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C; +// public const int GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D; +// public const int GL_MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E; +// public const int GL_MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F; +// public const int GL_MAX_UNIFORM_BLOCK_SIZE = 0x8A30; +// public const int GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31; +// public const int GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32; +// public const int GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33; +// public const int GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34; +// public const int GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35; +// public const int GL_ACTIVE_UNIFORM_BLOCKS = 0x8A36; +// public const int GL_UNIFORM_TYPE = 0x8A37; +// public const int GL_UNIFORM_SIZE = 0x8A38; +// public const int GL_UNIFORM_NAME_LENGTH = 0x8A39; +// public const int GL_UNIFORM_BLOCK_INDEX = 0x8A3A; +// public const int GL_UNIFORM_OFFSET = 0x8A3B; +// public const int GL_UNIFORM_ARRAY_STRIDE = 0x8A3C; +// public const int GL_UNIFORM_MATRIX_STRIDE = 0x8A3D; +// public const int GL_UNIFORM_IS_ROW_MAJOR = 0x8A3E; +// public const int GL_UNIFORM_BLOCK_BINDING = 0x8A3F; +// public const int GL_UNIFORM_BLOCK_DATA_SIZE = 0x8A40; +// public const int GL_UNIFORM_BLOCK_NAME_LENGTH = 0x8A41; +// public const int GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42; +// public const int GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43; +// public const int GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44; +// public const int GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45; +// public const int GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46; +// public const int GL_INVALID_INDEX = -1; +// public const int GL_VERSION_3_2 = 1; +// public const int GL_CONTEXT_CORE_PROFILE_BIT = 0x00000001; +// public const int GL_CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x00000002; +// public const int GL_LINES_ADJACENCY = 0x000A; +// public const int GL_LINE_STRIP_ADJACENCY = 0x000B; +// public const int GL_TRIANGLES_ADJACENCY = 0x000C; +// public const int GL_TRIANGLE_STRIP_ADJACENCY = 0x000D; +// public const int GL_PROGRAM_POINT_SIZE = 0x8642; +// public const int GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29; +// public const int GL_FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7; +// public const int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8; +// public const int GL_GEOMETRY_SHADER = 0x8DD9; +// public const int GL_GEOMETRY_VERTICES_OUT = 0x8916; +// public const int GL_GEOMETRY_INPUT_TYPE = 0x8917; +// public const int GL_GEOMETRY_OUTPUT_TYPE = 0x8918; +// public const int GL_MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF; +// public const int GL_MAX_GEOMETRY_OUTPUT_VERTICES = 0x8DE0; +// public const int GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1; +// public const int GL_MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122; +// public const int GL_MAX_GEOMETRY_INPUT_COMPONENTS = 0x9123; +// public const int GL_MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124; +// public const int GL_MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125; +// public const int GL_CONTEXT_PROFILE_MASK = 0x9126; +// public const int GL_DEPTH_CLAMP = 0x864F; +// public const int GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C; +// public const int GL_FIRST_VERTEX_CONVENTION = 0x8E4D; +// public const int GL_LAST_VERTEX_CONVENTION = 0x8E4E; +// public const int GL_PROVOKING_VERTEX = 0x8E4F; +// public const int GL_TEXTURE_CUBE_MAP_SEAMLESS = 0x884F; +// public const int GL_MAX_SERVER_WAIT_TIMEOUT = 0x9111; +// public const int GL_OBJECT_TYPE = 0x9112; +// public const int GL_SYNC_CONDITION = 0x9113; +// public const int GL_SYNC_STATUS = 0x9114; +// public const int GL_SYNC_FLAGS = 0x9115; +// public const int GL_SYNC_FENCE = 0x9116; +// public const int GL_SYNC_GPU_COMMANDS_COMPLETE = 0x9117; +// public const int GL_UNSIGNALED = 0x9118; +// public const int GL_SIGNALED = 0x9119; +// public const int GL_ALREADY_SIGNALED = 0x911A; +// public const int GL_TIMEOUT_EXPIRED = 0x911B; +// public const int GL_CONDITION_SATISFIED = 0x911C; +// public const int GL_WAIT_FAILED = 0x911D; +// public const int GL_SYNC_FLUSH_COMMANDS_BIT = 0x00000001; +// public const int GL_SAMPLE_POSITION = 0x8E50; +// public const int GL_SAMPLE_MASK = 0x8E51; +// public const int GL_SAMPLE_MASK_VALUE = 0x8E52; +// public const int GL_MAX_SAMPLE_MASK_WORDS = 0x8E59; +// public const int GL_TEXTURE_2D_MULTISAMPLE = 0x9100; +// public const int GL_PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101; +// public const int GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102; +// public const int GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103; +// public const int GL_TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104; +// public const int GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105; +// public const int GL_TEXTURE_SAMPLES = 0x9106; +// public const int GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107; +// public const int GL_SAMPLER_2D_MULTISAMPLE = 0x9108; +// public const int GL_INT_SAMPLER_2D_MULTISAMPLE = 0x9109; +// public const int GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A; +// public const int GL_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B; +// public const int GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C; +// public const int GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D; +// public const int GL_MAX_COLOR_TEXTURE_SAMPLES = 0x910E; +// public const int GL_MAX_DEPTH_TEXTURE_SAMPLES = 0x910F; +// public const int GL_MAX_INTEGER_SAMPLES = 0x9110; +// public const int GL_VERSION_3_3 = 1; +// public const int GL_VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE; +// public const int GL_SRC1_COLOR = 0x88F9; +// public const int GL_ONE_MINUS_SRC1_COLOR = 0x88FA; +// public const int GL_ONE_MINUS_SRC1_ALPHA = 0x88FB; +// public const int GL_MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC; +// public const int GL_ANY_SAMPLES_PASSED = 0x8C2F; +// public const int GL_SAMPLER_BINDING = 0x8919; +// public const int GL_RGB10_A2UI = 0x906F; +// public const int GL_TEXTURE_SWIZZLE_R = 0x8E42; +// public const int GL_TEXTURE_SWIZZLE_G = 0x8E43; +// public const int GL_TEXTURE_SWIZZLE_B = 0x8E44; +// public const int GL_TEXTURE_SWIZZLE_A = 0x8E45; +// public const int GL_TEXTURE_SWIZZLE_RGBA = 0x8E46; +// public const int GL_TIME_ELAPSED = 0x88BF; +// public const int GL_TIMESTAMP = 0x8E28; +// public const int GL_INT_2_10_10_10_REV = 0x8D9F; +// public const int GL_VERSION_4_0 = 1; +// public const int GL_SAMPLE_SHADING = 0x8C36; +// public const int GL_MIN_SAMPLE_SHADING_VALUE = 0x8C37; +// public const int GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5E; +// public const int GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5F; +// public const int GL_TEXTURE_CUBE_MAP_ARRAY = 0x9009; +// public const int GL_TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A; +// public const int GL_PROXY_TEXTURE_CUBE_MAP_ARRAY = 0x900B; +// public const int GL_SAMPLER_CUBE_MAP_ARRAY = 0x900C; +// public const int GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW = 0x900D; +// public const int GL_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900E; +// public const int GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900F; +// public const int GL_DRAW_INDIRECT_BUFFER = 0x8F3F; +// public const int GL_DRAW_INDIRECT_BUFFER_BINDING = 0x8F43; +// public const int GL_GEOMETRY_SHADER_INVOCATIONS = 0x887F; +// public const int GL_MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A; +// public const int GL_MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B; +// public const int GL_MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C; +// public const int GL_FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D; +// public const int GL_MAX_VERTEX_STREAMS = 0x8E71; +// public const int GL_DOUBLE_VEC2 = 0x8FFC; +// public const int GL_DOUBLE_VEC3 = 0x8FFD; +// public const int GL_DOUBLE_VEC4 = 0x8FFE; +// public const int GL_DOUBLE_MAT2 = 0x8F46; +// public const int GL_DOUBLE_MAT3 = 0x8F47; +// public const int GL_DOUBLE_MAT4 = 0x8F48; +// public const int GL_DOUBLE_MAT2x3 = 0x8F49; +// public const int GL_DOUBLE_MAT2x4 = 0x8F4A; +// public const int GL_DOUBLE_MAT3x2 = 0x8F4B; +// public const int GL_DOUBLE_MAT3x4 = 0x8F4C; +// public const int GL_DOUBLE_MAT4x2 = 0x8F4D; +// public const int GL_DOUBLE_MAT4x3 = 0x8F4E; +// public const int GL_ACTIVE_SUBROUTINES = 0x8DE5; +// public const int GL_ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6; +// public const int GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47; +// public const int GL_ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48; +// public const int GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49; +// public const int GL_MAX_SUBROUTINES = 0x8DE7; +// public const int GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8; +// public const int GL_NUM_COMPATIBLE_SUBROUTINES = 0x8E4A; +// public const int GL_COMPATIBLE_SUBROUTINES = 0x8E4B; +// public const int GL_PATCHES = 0x000E; +// public const int GL_PATCH_VERTICES = 0x8E72; +// public const int GL_PATCH_DEFAULT_INNER_LEVEL = 0x8E73; +// public const int GL_PATCH_DEFAULT_OUTER_LEVEL = 0x8E74; +// public const int GL_TESS_CONTROL_OUTPUT_VERTICES = 0x8E75; +// public const int GL_TESS_GEN_MODE = 0x8E76; +// public const int GL_TESS_GEN_SPACING = 0x8E77; +// public const int GL_TESS_GEN_VERTEX_ORDER = 0x8E78; +// public const int GL_TESS_GEN_POINT_MODE = 0x8E79; +// public const int GL_ISOLINES = 0x8E7A; +// public const int GL_FRACTIONAL_ODD = 0x8E7B; +// public const int GL_FRACTIONAL_EVEN = 0x8E7C; +// public const int GL_MAX_PATCH_VERTICES = 0x8E7D; +// public const int GL_MAX_TESS_GEN_LEVEL = 0x8E7E; +// public const int GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F; +// public const int GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80; +// public const int GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81; +// public const int GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82; +// public const int GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83; +// public const int GL_MAX_TESS_PATCH_COMPONENTS = 0x8E84; +// public const int GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85; +// public const int GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86; +// public const int GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89; +// public const int GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A; +// public const int GL_MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C; +// public const int GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D; +// public const int GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E; +// public const int GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F; +// public const int GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0; +// public const int GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1; +// public const int GL_TESS_EVALUATION_SHADER = 0x8E87; +// public const int GL_TESS_CONTROL_SHADER = 0x8E88; +// public const int GL_TRANSFORM_FEEDBACK = 0x8E22; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24; +// public const int GL_TRANSFORM_FEEDBACK_BINDING = 0x8E25; +// public const int GL_MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70; +// public const int GL_VERSION_4_1 = 1; +// public const int GL_FIXED = 0x140C; +// public const int GL_IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A; +// public const int GL_IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; +// public const int GL_LOW_FLOAT = 0x8DF0; +// public const int GL_MEDIUM_FLOAT = 0x8DF1; +// public const int GL_HIGH_FLOAT = 0x8DF2; +// public const int GL_LOW_INT = 0x8DF3; +// public const int GL_MEDIUM_INT = 0x8DF4; +// public const int GL_HIGH_INT = 0x8DF5; +// public const int GL_SHADER_COMPILER = 0x8DFA; +// public const int GL_SHADER_BINARY_FORMATS = 0x8DF8; +// public const int GL_NUM_SHADER_BINARY_FORMATS = 0x8DF9; +// public const int GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; +// public const int GL_MAX_VARYING_VECTORS = 0x8DFC; +// public const int GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; +// public const int GL_RGB565 = 0x8D62; +// public const int GL_PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257; +// public const int GL_PROGRAM_BINARY_LENGTH = 0x8741; +// public const int GL_NUM_PROGRAM_BINARY_FORMATS = 0x87FE; +// public const int GL_PROGRAM_BINARY_FORMATS = 0x87FF; +// public const int GL_VERTEX_SHADER_BIT = 0x00000001; +// public const int GL_FRAGMENT_SHADER_BIT = 0x00000002; +// public const int GL_GEOMETRY_SHADER_BIT = 0x00000004; +// public const int GL_TESS_CONTROL_SHADER_BIT = 0x00000008; +// public const int GL_TESS_EVALUATION_SHADER_BIT = 0x00000010; +// public const int GL_ALL_SHADER_BITS = -1; +// public const int GL_PROGRAM_SEPARABLE = 0x8258; +// public const int GL_ACTIVE_PROGRAM = 0x8259; +// public const int GL_PROGRAM_PIPELINE_BINDING = 0x825A; +// public const int GL_MAX_VIEWPORTS = 0x825B; +// public const int GL_VIEWPORT_SUBPIXEL_BITS = 0x825C; +// public const int GL_VIEWPORT_BOUNDS_RANGE = 0x825D; +// public const int GL_LAYER_PROVOKING_VERTEX = 0x825E; +// public const int GL_VIEWPORT_INDEX_PROVOKING_VERTEX = 0x825F; +// public const int GL_UNDEFINED_VERTEX = 0x8260; +// public const int GL_VERSION_4_2 = 1; +// public const int GL_COPY_READ_BUFFER_BINDING = 0x8F36; +// public const int GL_COPY_WRITE_BUFFER_BINDING = 0x8F37; +// public const int GL_TRANSFORM_FEEDBACK_ACTIVE = 0x8E24; +// public const int GL_TRANSFORM_FEEDBACK_PAUSED = 0x8E23; +// public const int GL_UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127; +// public const int GL_UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128; +// public const int GL_UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129; +// public const int GL_UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A; +// public const int GL_PACK_COMPRESSED_BLOCK_WIDTH = 0x912B; +// public const int GL_PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C; +// public const int GL_PACK_COMPRESSED_BLOCK_DEPTH = 0x912D; +// public const int GL_PACK_COMPRESSED_BLOCK_SIZE = 0x912E; +// public const int GL_NUM_SAMPLE_COUNTS = 0x9380; +// public const int GL_MIN_MAP_BUFFER_ALIGNMENT = 0x90BC; +// public const int GL_ATOMIC_COUNTER_BUFFER = 0x92C0; +// public const int GL_ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1; +// public const int GL_ATOMIC_COUNTER_BUFFER_START = 0x92C2; +// public const int GL_ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3; +// public const int GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4; +// public const int GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5; +// public const int GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6; +// public const int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7; +// public const int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8; +// public const int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9; +// public const int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA; +// public const int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB; +// public const int GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC; +// public const int GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD; +// public const int GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE; +// public const int GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF; +// public const int GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0; +// public const int GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1; +// public const int GL_MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2; +// public const int GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3; +// public const int GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4; +// public const int GL_MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5; +// public const int GL_MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6; +// public const int GL_MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7; +// public const int GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8; +// public const int GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC; +// public const int GL_ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9; +// public const int GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA; +// public const int GL_UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB; +// public const int GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001; +// public const int GL_ELEMENT_ARRAY_BARRIER_BIT = 0x00000002; +// public const int GL_UNIFORM_BARRIER_BIT = 0x00000004; +// public const int GL_TEXTURE_FETCH_BARRIER_BIT = 0x00000008; +// public const int GL_SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020; +// public const int GL_COMMAND_BARRIER_BIT = 0x00000040; +// public const int GL_PIXEL_BUFFER_BARRIER_BIT = 0x00000080; +// public const int GL_TEXTURE_UPDATE_BARRIER_BIT = 0x00000100; +// public const int GL_BUFFER_UPDATE_BARRIER_BIT = 0x00000200; +// public const int GL_FRAMEBUFFER_BARRIER_BIT = 0x00000400; +// public const int GL_TRANSFORM_FEEDBACK_BARRIER_BIT = 0x00000800; +// public const int GL_ATOMIC_COUNTER_BARRIER_BIT = 0x00001000; +// public const int GL_ALL_BARRIER_BITS = -1; +// public const int GL_MAX_IMAGE_UNITS = 0x8F38; +// public const int GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39; +// public const int GL_IMAGE_BINDING_NAME = 0x8F3A; +// public const int GL_IMAGE_BINDING_LEVEL = 0x8F3B; +// public const int GL_IMAGE_BINDING_LAYERED = 0x8F3C; +// public const int GL_IMAGE_BINDING_LAYER = 0x8F3D; +// public const int GL_IMAGE_BINDING_ACCESS = 0x8F3E; +// public const int GL_IMAGE_1D = 0x904C; +// public const int GL_IMAGE_2D = 0x904D; +// public const int GL_IMAGE_3D = 0x904E; +// public const int GL_IMAGE_2D_RECT = 0x904F; +// public const int GL_IMAGE_CUBE = 0x9050; +// public const int GL_IMAGE_BUFFER = 0x9051; +// public const int GL_IMAGE_1D_ARRAY = 0x9052; +// public const int GL_IMAGE_2D_ARRAY = 0x9053; +// public const int GL_IMAGE_CUBE_MAP_ARRAY = 0x9054; +// public const int GL_IMAGE_2D_MULTISAMPLE = 0x9055; +// public const int GL_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9056; +// public const int GL_INT_IMAGE_1D = 0x9057; +// public const int GL_INT_IMAGE_2D = 0x9058; +// public const int GL_INT_IMAGE_3D = 0x9059; +// public const int GL_INT_IMAGE_2D_RECT = 0x905A; +// public const int GL_INT_IMAGE_CUBE = 0x905B; +// public const int GL_INT_IMAGE_BUFFER = 0x905C; +// public const int GL_INT_IMAGE_1D_ARRAY = 0x905D; +// public const int GL_INT_IMAGE_2D_ARRAY = 0x905E; +// public const int GL_INT_IMAGE_CUBE_MAP_ARRAY = 0x905F; +// public const int GL_INT_IMAGE_2D_MULTISAMPLE = 0x9060; +// public const int GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061; +// public const int GL_UNSIGNED_INT_IMAGE_1D = 0x9062; +// public const int GL_UNSIGNED_INT_IMAGE_2D = 0x9063; +// public const int GL_UNSIGNED_INT_IMAGE_3D = 0x9064; +// public const int GL_UNSIGNED_INT_IMAGE_2D_RECT = 0x9065; +// public const int GL_UNSIGNED_INT_IMAGE_CUBE = 0x9066; +// public const int GL_UNSIGNED_INT_IMAGE_BUFFER = 0x9067; +// public const int GL_UNSIGNED_INT_IMAGE_1D_ARRAY = 0x9068; +// public const int GL_UNSIGNED_INT_IMAGE_2D_ARRAY = 0x9069; +// public const int GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A; +// public const int GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B; +// public const int GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C; +// public const int GL_MAX_IMAGE_SAMPLES = 0x906D; +// public const int GL_IMAGE_BINDING_FORMAT = 0x906E; +// public const int GL_IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7; +// public const int GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8; +// public const int GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9; +// public const int GL_MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA; +// public const int GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB; +// public const int GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC; +// public const int GL_MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD; +// public const int GL_MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE; +// public const int GL_MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF; +// public const int GL_COMPRESSED_RGBA_BPTC_UNORM = 0x8E8C; +// public const int GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D; +// public const int GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E; +// public const int GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F; +// public const int GL_TEXTURE_IMMUTABLE_FORMAT = 0x912F; +// public const int GL_VERSION_4_3 = 1; +// public const int GL_NUM_SHADING_LANGUAGE_VERSIONS = 0x82E9; +// public const int GL_VERTEX_ATTRIB_ARRAY_LONG = 0x874E; +// public const int GL_COMPRESSED_RGB8_ETC2 = 0x9274; +// public const int GL_COMPRESSED_SRGB8_ETC2 = 0x9275; +// public const int GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276; +// public const int GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277; +// public const int GL_COMPRESSED_RGBA8_ETC2_EAC = 0x9278; +// public const int GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279; +// public const int GL_COMPRESSED_R11_EAC = 0x9270; +// public const int GL_COMPRESSED_SIGNED_R11_EAC = 0x9271; +// public const int GL_COMPRESSED_RG11_EAC = 0x9272; +// public const int GL_COMPRESSED_SIGNED_RG11_EAC = 0x9273; +// public const int GL_PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69; +// public const int GL_ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A; +// public const int GL_MAX_ELEMENT_INDEX = 0x8D6B; +// public const int GL_COMPUTE_SHADER = 0x91B9; +// public const int GL_MAX_COMPUTE_UNIFORM_BLOCKS = 0x91BB; +// public const int GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 0x91BC; +// public const int GL_MAX_COMPUTE_IMAGE_UNIFORMS = 0x91BD; +// public const int GL_MAX_COMPUTE_SHARED_MEMORY_SIZE = 0x8262; +// public const int GL_MAX_COMPUTE_UNIFORM_COMPONENTS = 0x8263; +// public const int GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 0x8264; +// public const int GL_MAX_COMPUTE_ATOMIC_COUNTERS = 0x8265; +// public const int GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 0x8266; +// public const int GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 0x90EB; +// public const int GL_MAX_COMPUTE_WORK_GROUP_COUNT = 0x91BE; +// public const int GL_MAX_COMPUTE_WORK_GROUP_SIZE = 0x91BF; +// public const int GL_COMPUTE_WORK_GROUP_SIZE = 0x8267; +// public const int GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 0x90EC; +// public const int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 0x90ED; +// public const int GL_DISPATCH_INDIRECT_BUFFER = 0x90EE; +// public const int GL_DISPATCH_INDIRECT_BUFFER_BINDING = 0x90EF; +// public const int GL_COMPUTE_SHADER_BIT = 0x00000020; +// public const int GL_DEBUG_OUTPUT_SYNCHRONOUS = 0x8242; +// public const int GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243; +// public const int GL_DEBUG_CALLBACK_FUNCTION = 0x8244; +// public const int GL_DEBUG_CALLBACK_USER_PARAM = 0x8245; +// public const int GL_DEBUG_SOURCE_API = 0x8246; +// public const int GL_DEBUG_SOURCE_WINDOW_SYSTEM = 0x8247; +// public const int GL_DEBUG_SOURCE_SHADER_COMPILER = 0x8248; +// public const int GL_DEBUG_SOURCE_THIRD_PARTY = 0x8249; +// public const int GL_DEBUG_SOURCE_APPLICATION = 0x824A; +// public const int GL_DEBUG_SOURCE_OTHER = 0x824B; +// public const int GL_DEBUG_TYPE_ERROR = 0x824C; +// public const int GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D; +// public const int GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR = 0x824E; +// public const int GL_DEBUG_TYPE_PORTABILITY = 0x824F; +// public const int GL_DEBUG_TYPE_PERFORMANCE = 0x8250; +// public const int GL_DEBUG_TYPE_OTHER = 0x8251; +// public const int GL_MAX_DEBUG_MESSAGE_LENGTH = 0x9143; +// public const int GL_MAX_DEBUG_LOGGED_MESSAGES = 0x9144; +// public const int GL_DEBUG_LOGGED_MESSAGES = 0x9145; +// public const int GL_DEBUG_SEVERITY_HIGH = 0x9146; +// public const int GL_DEBUG_SEVERITY_MEDIUM = 0x9147; +// public const int GL_DEBUG_SEVERITY_LOW = 0x9148; +// public const int GL_DEBUG_TYPE_MARKER = 0x8268; +// public const int GL_DEBUG_TYPE_PUSH_GROUP = 0x8269; +// public const int GL_DEBUG_TYPE_POP_GROUP = 0x826A; +// public const int GL_DEBUG_SEVERITY_NOTIFICATION = 0x826B; +// public const int GL_MAX_DEBUG_GROUP_STACK_DEPTH = 0x826C; +// public const int GL_DEBUG_GROUP_STACK_DEPTH = 0x826D; +// public const int GL_BUFFER = 0x82E0; +// public const int GL_SHADER = 0x82E1; +// public const int GL_PROGRAM = 0x82E2; +// public const int GL_QUERY = 0x82E3; +// public const int GL_PROGRAM_PIPELINE = 0x82E4; +// public const int GL_SAMPLER = 0x82E6; +// public const int GL_MAX_LABEL_LENGTH = 0x82E8; +// public const int GL_DEBUG_OUTPUT = 0x92E0; +// public const int GL_CONTEXT_FLAG_DEBUG_BIT = 0x00000002; +// public const int GL_MAX_UNIFORM_LOCATIONS = 0x826E; +// public const int GL_FRAMEBUFFER_DEFAULT_WIDTH = 0x9310; +// public const int GL_FRAMEBUFFER_DEFAULT_HEIGHT = 0x9311; +// public const int GL_FRAMEBUFFER_DEFAULT_LAYERS = 0x9312; +// public const int GL_FRAMEBUFFER_DEFAULT_SAMPLES = 0x9313; +// public const int GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 0x9314; +// public const int GL_MAX_FRAMEBUFFER_WIDTH = 0x9315; +// public const int GL_MAX_FRAMEBUFFER_HEIGHT = 0x9316; +// public const int GL_MAX_FRAMEBUFFER_LAYERS = 0x9317; +// public const int GL_MAX_FRAMEBUFFER_SAMPLES = 0x9318; +// public const int GL_INTERNALFORMAT_SUPPORTED = 0x826F; +// public const int GL_INTERNALFORMAT_PREFERRED = 0x8270; +// public const int GL_INTERNALFORMAT_RED_SIZE = 0x8271; +// public const int GL_INTERNALFORMAT_GREEN_SIZE = 0x8272; +// public const int GL_INTERNALFORMAT_BLUE_SIZE = 0x8273; +// public const int GL_INTERNALFORMAT_ALPHA_SIZE = 0x8274; +// public const int GL_INTERNALFORMAT_DEPTH_SIZE = 0x8275; +// public const int GL_INTERNALFORMAT_STENCIL_SIZE = 0x8276; +// public const int GL_INTERNALFORMAT_SHARED_SIZE = 0x8277; +// public const int GL_INTERNALFORMAT_RED_TYPE = 0x8278; +// public const int GL_INTERNALFORMAT_GREEN_TYPE = 0x8279; +// public const int GL_INTERNALFORMAT_BLUE_TYPE = 0x827A; +// public const int GL_INTERNALFORMAT_ALPHA_TYPE = 0x827B; +// public const int GL_INTERNALFORMAT_DEPTH_TYPE = 0x827C; +// public const int GL_INTERNALFORMAT_STENCIL_TYPE = 0x827D; +// public const int GL_MAX_WIDTH = 0x827E; +// public const int GL_MAX_HEIGHT = 0x827F; +// public const int GL_MAX_DEPTH = 0x8280; +// public const int GL_MAX_LAYERS = 0x8281; +// public const int GL_MAX_COMBINED_DIMENSIONS = 0x8282; +// public const int GL_COLOR_COMPONENTS = 0x8283; +// public const int GL_DEPTH_COMPONENTS = 0x8284; +// public const int GL_STENCIL_COMPONENTS = 0x8285; +// public const int GL_COLOR_RENDERABLE = 0x8286; +// public const int GL_DEPTH_RENDERABLE = 0x8287; +// public const int GL_STENCIL_RENDERABLE = 0x8288; +// public const int GL_FRAMEBUFFER_RENDERABLE = 0x8289; +// public const int GL_FRAMEBUFFER_RENDERABLE_LAYERED = 0x828A; +// public const int GL_FRAMEBUFFER_BLEND = 0x828B; +// public const int GL_READ_PIXELS = 0x828C; +// public const int GL_READ_PIXELS_FORMAT = 0x828D; +// public const int GL_READ_PIXELS_TYPE = 0x828E; +// public const int GL_TEXTURE_IMAGE_FORMAT = 0x828F; +// public const int GL_TEXTURE_IMAGE_TYPE = 0x8290; +// public const int GL_GET_TEXTURE_IMAGE_FORMAT = 0x8291; +// public const int GL_GET_TEXTURE_IMAGE_TYPE = 0x8292; +// public const int GL_MIPMAP = 0x8293; +// public const int GL_MANUAL_GENERATE_MIPMAP = 0x8294; +// public const int GL_AUTO_GENERATE_MIPMAP = 0x8295; +// public const int GL_COLOR_ENCODING = 0x8296; +// public const int GL_SRGB_READ = 0x8297; +// public const int GL_SRGB_WRITE = 0x8298; +// public const int GL_FILTER = 0x829A; +// public const int GL_VERTEX_TEXTURE = 0x829B; +// public const int GL_TESS_CONTROL_TEXTURE = 0x829C; +// public const int GL_TESS_EVALUATION_TEXTURE = 0x829D; +// public const int GL_GEOMETRY_TEXTURE = 0x829E; +// public const int GL_FRAGMENT_TEXTURE = 0x829F; +// public const int GL_COMPUTE_TEXTURE = 0x82A0; +// public const int GL_TEXTURE_SHADOW = 0x82A1; +// public const int GL_TEXTURE_GATHER = 0x82A2; +// public const int GL_TEXTURE_GATHER_SHADOW = 0x82A3; +// public const int GL_SHADER_IMAGE_LOAD = 0x82A4; +// public const int GL_SHADER_IMAGE_STORE = 0x82A5; +// public const int GL_SHADER_IMAGE_ATOMIC = 0x82A6; +// public const int GL_IMAGE_TEXEL_SIZE = 0x82A7; +// public const int GL_IMAGE_COMPATIBILITY_CLASS = 0x82A8; +// public const int GL_IMAGE_PIXEL_FORMAT = 0x82A9; +// public const int GL_IMAGE_PIXEL_TYPE = 0x82AA; +// public const int GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 0x82AC; +// public const int GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 0x82AD; +// public const int GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 0x82AE; +// public const int GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 0x82AF; +// public const int GL_TEXTURE_COMPRESSED_BLOCK_WIDTH = 0x82B1; +// public const int GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT = 0x82B2; +// public const int GL_TEXTURE_COMPRESSED_BLOCK_SIZE = 0x82B3; +// public const int GL_CLEAR_BUFFER = 0x82B4; +// public const int GL_TEXTURE_VIEW = 0x82B5; +// public const int GL_VIEW_COMPATIBILITY_CLASS = 0x82B6; +// public const int GL_FULL_SUPPORT = 0x82B7; +// public const int GL_CAVEAT_SUPPORT = 0x82B8; +// public const int GL_IMAGE_CLASS_4_X_32 = 0x82B9; +// public const int GL_IMAGE_CLASS_2_X_32 = 0x82BA; +// public const int GL_IMAGE_CLASS_1_X_32 = 0x82BB; +// public const int GL_IMAGE_CLASS_4_X_16 = 0x82BC; +// public const int GL_IMAGE_CLASS_2_X_16 = 0x82BD; +// public const int GL_IMAGE_CLASS_1_X_16 = 0x82BE; +// public const int GL_IMAGE_CLASS_4_X_8 = 0x82BF; +// public const int GL_IMAGE_CLASS_2_X_8 = 0x82C0; +// public const int GL_IMAGE_CLASS_1_X_8 = 0x82C1; +// public const int GL_IMAGE_CLASS_11_11_10 = 0x82C2; +// public const int GL_IMAGE_CLASS_10_10_10_2 = 0x82C3; +// public const int GL_VIEW_CLASS_128_BITS = 0x82C4; +// public const int GL_VIEW_CLASS_96_BITS = 0x82C5; +// public const int GL_VIEW_CLASS_64_BITS = 0x82C6; +// public const int GL_VIEW_CLASS_48_BITS = 0x82C7; +// public const int GL_VIEW_CLASS_32_BITS = 0x82C8; +// public const int GL_VIEW_CLASS_24_BITS = 0x82C9; +// public const int GL_VIEW_CLASS_16_BITS = 0x82CA; +// public const int GL_VIEW_CLASS_8_BITS = 0x82CB; +// public const int GL_VIEW_CLASS_S3TC_DXT1_RGB = 0x82CC; +// public const int GL_VIEW_CLASS_S3TC_DXT1_RGBA = 0x82CD; +// public const int GL_VIEW_CLASS_S3TC_DXT3_RGBA = 0x82CE; +// public const int GL_VIEW_CLASS_S3TC_DXT5_RGBA = 0x82CF; +// public const int GL_VIEW_CLASS_RGTC1_RED = 0x82D0; +// public const int GL_VIEW_CLASS_RGTC2_RG = 0x82D1; +// public const int GL_VIEW_CLASS_BPTC_UNORM = 0x82D2; +// public const int GL_VIEW_CLASS_BPTC_FLOAT = 0x82D3; +// public const int GL_UNIFORM = 0x92E1; +// public const int GL_UNIFORM_BLOCK = 0x92E2; +// public const int GL_PROGRAM_INPUT = 0x92E3; +// public const int GL_PROGRAM_OUTPUT = 0x92E4; +// public const int GL_BUFFER_VARIABLE = 0x92E5; +// public const int GL_SHADER_STORAGE_BLOCK = 0x92E6; +// public const int GL_VERTEX_SUBROUTINE = 0x92E8; +// public const int GL_TESS_CONTROL_SUBROUTINE = 0x92E9; +// public const int GL_TESS_EVALUATION_SUBROUTINE = 0x92EA; +// public const int GL_GEOMETRY_SUBROUTINE = 0x92EB; +// public const int GL_FRAGMENT_SUBROUTINE = 0x92EC; +// public const int GL_COMPUTE_SUBROUTINE = 0x92ED; +// public const int GL_VERTEX_SUBROUTINE_UNIFORM = 0x92EE; +// public const int GL_TESS_CONTROL_SUBROUTINE_UNIFORM = 0x92EF; +// public const int GL_TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0; +// public const int GL_GEOMETRY_SUBROUTINE_UNIFORM = 0x92F1; +// public const int GL_FRAGMENT_SUBROUTINE_UNIFORM = 0x92F2; +// public const int GL_COMPUTE_SUBROUTINE_UNIFORM = 0x92F3; +// public const int GL_TRANSFORM_FEEDBACK_VARYING = 0x92F4; +// public const int GL_ACTIVE_RESOURCES = 0x92F5; +// public const int GL_MAX_NAME_LENGTH = 0x92F6; +// public const int GL_MAX_NUM_ACTIVE_VARIABLES = 0x92F7; +// public const int GL_MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8; +// public const int GL_NAME_LENGTH = 0x92F9; +// public const int GL_TYPE = 0x92FA; +// public const int GL_ARRAY_SIZE = 0x92FB; +// public const int GL_OFFSET = 0x92FC; +// public const int GL_BLOCK_INDEX = 0x92FD; +// public const int GL_ARRAY_STRIDE = 0x92FE; +// public const int GL_MATRIX_STRIDE = 0x92FF; +// public const int GL_IS_ROW_MAJOR = 0x9300; +// public const int GL_ATOMIC_COUNTER_BUFFER_INDEX = 0x9301; +// public const int GL_BUFFER_BINDING = 0x9302; +// public const int GL_BUFFER_DATA_SIZE = 0x9303; +// public const int GL_NUM_ACTIVE_VARIABLES = 0x9304; +// public const int GL_ACTIVE_VARIABLES = 0x9305; +// public const int GL_REFERENCED_BY_VERTEX_SHADER = 0x9306; +// public const int GL_REFERENCED_BY_TESS_CONTROL_SHADER = 0x9307; +// public const int GL_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308; +// public const int GL_REFERENCED_BY_GEOMETRY_SHADER = 0x9309; +// public const int GL_REFERENCED_BY_FRAGMENT_SHADER = 0x930A; +// public const int GL_REFERENCED_BY_COMPUTE_SHADER = 0x930B; +// public const int GL_TOP_LEVEL_ARRAY_SIZE = 0x930C; +// public const int GL_TOP_LEVEL_ARRAY_STRIDE = 0x930D; +// public const int GL_LOCATION = 0x930E; +// public const int GL_LOCATION_INDEX = 0x930F; +// public const int GL_IS_PER_PATCH = 0x92E7; +// public const int GL_SHADER_STORAGE_BUFFER = 0x90D2; +// public const int GL_SHADER_STORAGE_BUFFER_BINDING = 0x90D3; +// public const int GL_SHADER_STORAGE_BUFFER_START = 0x90D4; +// public const int GL_SHADER_STORAGE_BUFFER_SIZE = 0x90D5; +// public const int GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0x90D6; +// public const int GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 0x90D7; +// public const int GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 0x90D8; +// public const int GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 0x90D9; +// public const int GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 0x90DA; +// public const int GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 0x90DB; +// public const int GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS = 0x90DC; +// public const int GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS = 0x90DD; +// public const int GL_MAX_SHADER_STORAGE_BLOCK_SIZE = 0x90DE; +// public const int GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 0x90DF; +// public const int GL_SHADER_STORAGE_BARRIER_BIT = 0x00002000; +// public const int GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 0x8F39; +// public const int GL_DEPTH_STENCIL_TEXTURE_MODE = 0x90EA; +// public const int GL_TEXTURE_BUFFER_OFFSET = 0x919D; +// public const int GL_TEXTURE_BUFFER_SIZE = 0x919E; +// public const int GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT = 0x919F; +// public const int GL_TEXTURE_VIEW_MIN_LEVEL = 0x82DB; +// public const int GL_TEXTURE_VIEW_NUM_LEVELS = 0x82DC; +// public const int GL_TEXTURE_VIEW_MIN_LAYER = 0x82DD; +// public const int GL_TEXTURE_VIEW_NUM_LAYERS = 0x82DE; +// public const int GL_TEXTURE_IMMUTABLE_LEVELS = 0x82DF; +// public const int GL_VERTEX_ATTRIB_BINDING = 0x82D4; +// public const int GL_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D5; +// public const int GL_VERTEX_BINDING_DIVISOR = 0x82D6; +// public const int GL_VERTEX_BINDING_OFFSET = 0x82D7; +// public const int GL_VERTEX_BINDING_STRIDE = 0x82D8; +// public const int GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D9; +// public const int GL_MAX_VERTEX_ATTRIB_BINDINGS = 0x82DA; +// public const int GL_VERTEX_BINDING_BUFFER = 0x8F4F; +// public const int GL_DISPLAY_LIST = 0x82E7; +// public const int GL_VERSION_4_4 = 1; +// public const int GL_MAX_VERTEX_ATTRIB_STRIDE = 0x82E5; +// public const int GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = 0x8221; +// public const int GL_TEXTURE_BUFFER_BINDING = 0x8C2A; +// public const int GL_MAP_PERSISTENT_BIT = 0x0040; +// public const int GL_MAP_COHERENT_BIT = 0x0080; +// public const int GL_DYNAMIC_STORAGE_BIT = 0x0100; +// public const int GL_CLIENT_STORAGE_BIT = 0x0200; +// public const int GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT = 0x00004000; +// public const int GL_BUFFER_IMMUTABLE_STORAGE = 0x821F; +// public const int GL_BUFFER_STORAGE_FLAGS = 0x8220; +// public const int GL_CLEAR_TEXTURE = 0x9365; +// public const int GL_LOCATION_COMPONENT = 0x934A; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_INDEX = 0x934B; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE = 0x934C; +// public const int GL_QUERY_BUFFER = 0x9192; +// public const int GL_QUERY_BUFFER_BARRIER_BIT = 0x00008000; +// public const int GL_QUERY_BUFFER_BINDING = 0x9193; +// public const int GL_QUERY_RESULT_NO_WAIT = 0x9194; +// public const int GL_MIRROR_CLAMP_TO_EDGE = 0x8743; +// public const int GL_NEGATIVE_ONE_TO_ONE = 0x935E; +// public const int GL_ZERO_TO_ONE = 0x935F; +// public const int GL_CLIP_ORIGIN = 0x935C; +// public const int GL_CLIP_DEPTH_MODE = 0x935D; +// public const int GL_QUERY_WAIT_INVERTED = 0x8E17; +// public const int GL_QUERY_NO_WAIT_INVERTED = 0x8E18; +// public const int GL_QUERY_BY_REGION_WAIT_INVERTED = 0x8E19; +// public const int GL_QUERY_BY_REGION_NO_WAIT_INVERTED = 0x8E1A; +// public const int GL_MAX_CULL_DISTANCES = 0x82F9; +// public const int GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 0x82FA; +// public const int GL_TEXTURE_TARGET = 0x1006; +// public const int GL_QUERY_TARGET = 0x82EA; +// public const int GL_GUILTY_CONTEXT_RESET = 0x8253; +// public const int GL_INNOCENT_CONTEXT_RESET = 0x8254; +// public const int GL_UNKNOWN_CONTEXT_RESET = 0x8255; +// public const int GL_RESET_NOTIFICATION_STRATEGY = 0x8256; +// public const int GL_LOSE_CONTEXT_ON_RESET = 0x8252; +// public const int GL_NO_RESET_NOTIFICATION = 0x8261; +// public const int GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT = 0x00000004; +// public const int GL_CONTEXT_RELEASE_BEHAVIOR = 0x82FB; +// public const int GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82FC; +// public const int GL_VERSION_4_6 = 1; +// public const int GL_SHADER_BINARY_FORMAT_SPIR_V = 0x9551; +// public const int GL_SPIR_V_BINARY = 0x9552; +// public const int GL_PARAMETER_BUFFER = 0x80EE; +// public const int GL_PARAMETER_BUFFER_BINDING = 0x80EF; +// public const int GL_CONTEXT_FLAG_NO_ERROR_BIT = 0x00000008; +// public const int GL_VERTICES_SUBMITTED = 0x82EE; +// public const int GL_PRIMITIVES_SUBMITTED = 0x82EF; +// public const int GL_VERTEX_SHADER_INVOCATIONS = 0x82F0; +// public const int GL_TESS_CONTROL_SHADER_PATCHES = 0x82F1; +// public const int GL_TESS_EVALUATION_SHADER_INVOCATIONS = 0x82F2; +// public const int GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED = 0x82F3; +// public const int GL_FRAGMENT_SHADER_INVOCATIONS = 0x82F4; +// public const int GL_COMPUTE_SHADER_INVOCATIONS = 0x82F5; +// public const int GL_CLIPPING_INPUT_PRIMITIVES = 0x82F6; +// public const int GL_CLIPPING_OUTPUT_PRIMITIVES = 0x82F7; +// public const int GL_POLYGON_OFFSET_CLAMP = 0x8E1B; +// public const int GL_SPIR_V_EXTENSIONS = 0x9553; +// public const int GL_NUM_SPIR_V_EXTENSIONS = 0x9554; +// public const int GL_TEXTURE_MAX_ANISOTROPY = 0x84FE; +// public const int GL_MAX_TEXTURE_MAX_ANISOTROPY = 0x84FF; +// public const int GL_TRANSFORM_FEEDBACK_OVERFLOW = 0x82EC; +// public const int GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW = 0x82ED; +// public const int GL_ARB_ES2_compatibility = 1; +// public const int GL_ARB_ES3_1_compatibility = 1; +// public const int GL_ARB_ES3_2_compatibility = 1; +// public const int GL_PRIMITIVE_BOUNDING_BOX_ARB = 0x92BE; +// public const int GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB = 0x9381; +// public const int GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB = 0x9382; +// public const int GL_ARB_ES3_compatibility = 1; +// public const int GL_ARB_arrays_of_arrays = 1; +// public const int GL_ARB_base_instance = 1; +// public const int GL_ARB_bindless_texture = 1; +// public const int GL_UNSIGNED_INT64_ARB = 0x140F; +// public const int GL_ARB_blend_func_extended = 1; +// public const int GL_ARB_buffer_storage = 1; +// public const int GL_ARB_cl_event = 1; +// public const int GL_SYNC_CL_EVENT_ARB = 0x8240; +// public const int GL_SYNC_CL_EVENT_COMPLETE_ARB = 0x8241; +// public const int GL_ARB_clear_buffer_object = 1; +// public const int GL_ARB_clear_texture = 1; +// public const int GL_ARB_clip_control = 1; +// public const int GL_ARB_color_buffer_float = 1; +// public const int GL_RGBA_FLOAT_MODE_ARB = 0x8820; +// public const int GL_CLAMP_VERTEX_COLOR_ARB = 0x891A; +// public const int GL_CLAMP_FRAGMENT_COLOR_ARB = 0x891B; +// public const int GL_CLAMP_READ_COLOR_ARB = 0x891C; +// public const int GL_FIXED_ONLY_ARB = 0x891D; +// public const int GL_ARB_compatibility = 1; +// public const int GL_ARB_compressed_texture_pixel_storage = 1; +// public const int GL_ARB_compute_shader = 1; +// public const int GL_ARB_compute_variable_group_size = 1; +// public const int GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB = 0x9344; +// public const int GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB = 0x90EB; +// public const int GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB = 0x9345; +// public const int GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB = 0x91BF; +// public const int GL_ARB_conditional_render_inverted = 1; +// public const int GL_ARB_conservative_depth = 1; +// public const int GL_ARB_copy_buffer = 1; +// public const int GL_ARB_copy_image = 1; +// public const int GL_ARB_cull_distance = 1; +// public const int GL_ARB_debug_output = 1; +// public const int GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB = 0x8242; +// public const int GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB = 0x8243; +// public const int GL_DEBUG_CALLBACK_FUNCTION_ARB = 0x8244; +// public const int GL_DEBUG_CALLBACK_USER_PARAM_ARB = 0x8245; +// public const int GL_DEBUG_SOURCE_API_ARB = 0x8246; +// public const int GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB = 0x8247; +// public const int GL_DEBUG_SOURCE_SHADER_COMPILER_ARB = 0x8248; +// public const int GL_DEBUG_SOURCE_THIRD_PARTY_ARB = 0x8249; +// public const int GL_DEBUG_SOURCE_APPLICATION_ARB = 0x824A; +// public const int GL_DEBUG_SOURCE_OTHER_ARB = 0x824B; +// public const int GL_DEBUG_TYPE_ERROR_ARB = 0x824C; +// public const int GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB = 0x824D; +// public const int GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB = 0x824E; +// public const int GL_DEBUG_TYPE_PORTABILITY_ARB = 0x824F; +// public const int GL_DEBUG_TYPE_PERFORMANCE_ARB = 0x8250; +// public const int GL_DEBUG_TYPE_OTHER_ARB = 0x8251; +// public const int GL_MAX_DEBUG_MESSAGE_LENGTH_ARB = 0x9143; +// public const int GL_MAX_DEBUG_LOGGED_MESSAGES_ARB = 0x9144; +// public const int GL_DEBUG_LOGGED_MESSAGES_ARB = 0x9145; +// public const int GL_DEBUG_SEVERITY_HIGH_ARB = 0x9146; +// public const int GL_DEBUG_SEVERITY_MEDIUM_ARB = 0x9147; +// public const int GL_DEBUG_SEVERITY_LOW_ARB = 0x9148; +// public const int GL_ARB_depth_buffer_float = 1; +// public const int GL_ARB_depth_clamp = 1; +// public const int GL_ARB_depth_texture = 1; +// public const int GL_DEPTH_COMPONENT16_ARB = 0x81A5; +// public const int GL_DEPTH_COMPONENT24_ARB = 0x81A6; +// public const int GL_DEPTH_COMPONENT32_ARB = 0x81A7; +// public const int GL_TEXTURE_DEPTH_SIZE_ARB = 0x884A; +// public const int GL_DEPTH_TEXTURE_MODE_ARB = 0x884B; +// public const int GL_ARB_derivative_control = 1; +// public const int GL_ARB_direct_state_access = 1; +// public const int GL_ARB_draw_buffers = 1; +// public const int GL_MAX_DRAW_BUFFERS_ARB = 0x8824; +// public const int GL_DRAW_BUFFER0_ARB = 0x8825; +// public const int GL_DRAW_BUFFER1_ARB = 0x8826; +// public const int GL_DRAW_BUFFER2_ARB = 0x8827; +// public const int GL_DRAW_BUFFER3_ARB = 0x8828; +// public const int GL_DRAW_BUFFER4_ARB = 0x8829; +// public const int GL_DRAW_BUFFER5_ARB = 0x882A; +// public const int GL_DRAW_BUFFER6_ARB = 0x882B; +// public const int GL_DRAW_BUFFER7_ARB = 0x882C; +// public const int GL_DRAW_BUFFER8_ARB = 0x882D; +// public const int GL_DRAW_BUFFER9_ARB = 0x882E; +// public const int GL_DRAW_BUFFER10_ARB = 0x882F; +// public const int GL_DRAW_BUFFER11_ARB = 0x8830; +// public const int GL_DRAW_BUFFER12_ARB = 0x8831; +// public const int GL_DRAW_BUFFER13_ARB = 0x8832; +// public const int GL_DRAW_BUFFER14_ARB = 0x8833; +// public const int GL_DRAW_BUFFER15_ARB = 0x8834; +// public const int GL_ARB_draw_buffers_blend = 1; +// public const int GL_ARB_draw_elements_base_vertex = 1; +// public const int GL_ARB_draw_indirect = 1; +// public const int GL_ARB_draw_instanced = 1; +// public const int GL_ARB_enhanced_layouts = 1; +// public const int GL_ARB_explicit_attrib_location = 1; +// public const int GL_ARB_explicit_uniform_location = 1; +// public const int GL_ARB_fragment_coord_conventions = 1; +// public const int GL_ARB_fragment_layer_viewport = 1; +// public const int GL_ARB_fragment_program = 1; +// public const int GL_FRAGMENT_PROGRAM_ARB = 0x8804; +// public const int GL_PROGRAM_FORMAT_ASCII_ARB = 0x8875; +// public const int GL_PROGRAM_LENGTH_ARB = 0x8627; +// public const int GL_PROGRAM_FORMAT_ARB = 0x8876; +// public const int GL_PROGRAM_BINDING_ARB = 0x8677; +// public const int GL_PROGRAM_INSTRUCTIONS_ARB = 0x88A0; +// public const int GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1; +// public const int GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2; +// public const int GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3; +// public const int GL_PROGRAM_TEMPORARIES_ARB = 0x88A4; +// public const int GL_MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5; +// public const int GL_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6; +// public const int GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7; +// public const int GL_PROGRAM_PARAMETERS_ARB = 0x88A8; +// public const int GL_MAX_PROGRAM_PARAMETERS_ARB = 0x88A9; +// public const int GL_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA; +// public const int GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB; +// public const int GL_PROGRAM_ATTRIBS_ARB = 0x88AC; +// public const int GL_MAX_PROGRAM_ATTRIBS_ARB = 0x88AD; +// public const int GL_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE; +// public const int GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF; +// public const int GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4; +// public const int GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5; +// public const int GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6; +// public const int GL_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x8805; +// public const int GL_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x8806; +// public const int GL_PROGRAM_TEX_INDIRECTIONS_ARB = 0x8807; +// public const int GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x8808; +// public const int GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x8809; +// public const int GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x880A; +// public const int GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x880B; +// public const int GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x880C; +// public const int GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 0x880D; +// public const int GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x880E; +// public const int GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F; +// public const int GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x8810; +// public const int GL_PROGRAM_STRING_ARB = 0x8628; +// public const int GL_PROGRAM_ERROR_POSITION_ARB = 0x864B; +// public const int GL_CURRENT_MATRIX_ARB = 0x8641; +// public const int GL_TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7; +// public const int GL_CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640; +// public const int GL_MAX_PROGRAM_MATRICES_ARB = 0x862F; +// public const int GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E; +// public const int GL_MAX_TEXTURE_COORDS_ARB = 0x8871; +// public const int GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872; +// public const int GL_PROGRAM_ERROR_STRING_ARB = 0x8874; +// public const int GL_MATRIX0_ARB = 0x88C0; +// public const int GL_MATRIX1_ARB = 0x88C1; +// public const int GL_MATRIX2_ARB = 0x88C2; +// public const int GL_MATRIX3_ARB = 0x88C3; +// public const int GL_MATRIX4_ARB = 0x88C4; +// public const int GL_MATRIX5_ARB = 0x88C5; +// public const int GL_MATRIX6_ARB = 0x88C6; +// public const int GL_MATRIX7_ARB = 0x88C7; +// public const int GL_MATRIX8_ARB = 0x88C8; +// public const int GL_MATRIX9_ARB = 0x88C9; +// public const int GL_MATRIX10_ARB = 0x88CA; +// public const int GL_MATRIX11_ARB = 0x88CB; +// public const int GL_MATRIX12_ARB = 0x88CC; +// public const int GL_MATRIX13_ARB = 0x88CD; +// public const int GL_MATRIX14_ARB = 0x88CE; +// public const int GL_MATRIX15_ARB = 0x88CF; +// public const int GL_MATRIX16_ARB = 0x88D0; +// public const int GL_MATRIX17_ARB = 0x88D1; +// public const int GL_MATRIX18_ARB = 0x88D2; +// public const int GL_MATRIX19_ARB = 0x88D3; +// public const int GL_MATRIX20_ARB = 0x88D4; +// public const int GL_MATRIX21_ARB = 0x88D5; +// public const int GL_MATRIX22_ARB = 0x88D6; +// public const int GL_MATRIX23_ARB = 0x88D7; +// public const int GL_MATRIX24_ARB = 0x88D8; +// public const int GL_MATRIX25_ARB = 0x88D9; +// public const int GL_MATRIX26_ARB = 0x88DA; +// public const int GL_MATRIX27_ARB = 0x88DB; +// public const int GL_MATRIX28_ARB = 0x88DC; +// public const int GL_MATRIX29_ARB = 0x88DD; +// public const int GL_MATRIX30_ARB = 0x88DE; +// public const int GL_MATRIX31_ARB = 0x88DF; +// public const int GL_ARB_fragment_program_shadow = 1; +// public const int GL_ARB_fragment_shader = 1; +// public const int GL_FRAGMENT_SHADER_ARB = 0x8B30; +// public const int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB = 0x8B49; +// public const int GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB = 0x8B8B; +// public const int GL_ARB_fragment_shader_interlock = 1; +// public const int GL_ARB_framebuffer_no_attachments = 1; +// public const int GL_ARB_framebuffer_object = 1; +// public const int GL_ARB_framebuffer_sRGB = 1; +// public const int GL_ARB_geometry_shader4 = 1; +// public const int GL_LINES_ADJACENCY_ARB = 0x000A; +// public const int GL_LINE_STRIP_ADJACENCY_ARB = 0x000B; +// public const int GL_TRIANGLES_ADJACENCY_ARB = 0x000C; +// public const int GL_TRIANGLE_STRIP_ADJACENCY_ARB = 0x000D; +// public const int GL_PROGRAM_POINT_SIZE_ARB = 0x8642; +// public const int GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB = 0x8C29; +// public const int GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB = 0x8DA7; +// public const int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB = 0x8DA8; +// public const int GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB = 0x8DA9; +// public const int GL_GEOMETRY_SHADER_ARB = 0x8DD9; +// public const int GL_GEOMETRY_VERTICES_OUT_ARB = 0x8DDA; +// public const int GL_GEOMETRY_INPUT_TYPE_ARB = 0x8DDB; +// public const int GL_GEOMETRY_OUTPUT_TYPE_ARB = 0x8DDC; +// public const int GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB = 0x8DDD; +// public const int GL_MAX_VERTEX_VARYING_COMPONENTS_ARB = 0x8DDE; +// public const int GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB = 0x8DDF; +// public const int GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB = 0x8DE0; +// public const int GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB = 0x8DE1; +// public const int GL_ARB_get_program_binary = 1; +// public const int GL_ARB_get_texture_sub_image = 1; +// public const int GL_ARB_gl_spirv = 1; +// public const int GL_SHADER_BINARY_FORMAT_SPIR_V_ARB = 0x9551; +// public const int GL_SPIR_V_BINARY_ARB = 0x9552; +// public const int GL_ARB_gpu_shader5 = 1; +// public const int GL_ARB_gpu_shader_fp64 = 1; +// public const int GL_ARB_gpu_shader_int64 = 1; +// public const int GL_INT64_ARB = 0x140E; +// public const int GL_INT64_VEC2_ARB = 0x8FE9; +// public const int GL_INT64_VEC3_ARB = 0x8FEA; +// public const int GL_INT64_VEC4_ARB = 0x8FEB; +// public const int GL_UNSIGNED_INT64_VEC2_ARB = 0x8FF5; +// public const int GL_UNSIGNED_INT64_VEC3_ARB = 0x8FF6; +// public const int GL_UNSIGNED_INT64_VEC4_ARB = 0x8FF7; +// public const int GL_ARB_half_float_pixel = 1; +// public const int GL_HALF_FLOAT_ARB = 0x140B; +// public const int GL_ARB_half_float_vertex = 1; +// public const int GL_ARB_imaging = 1; +// public const int GL_ARB_indirect_parameters = 1; +// public const int GL_PARAMETER_BUFFER_ARB = 0x80EE; +// public const int GL_PARAMETER_BUFFER_BINDING_ARB = 0x80EF; +// public const int GL_ARB_instanced_arrays = 1; +// public const int GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB = 0x88FE; +// public const int GL_ARB_internalformat_query = 1; +// public const int GL_ARB_internalformat_query2 = 1; +// public const int GL_SRGB_DECODE_ARB = 0x8299; +// public const int GL_ARB_invalidate_subdata = 1; +// public const int GL_ARB_map_buffer_alignment = 1; +// public const int GL_ARB_map_buffer_range = 1; +// public const int GL_ARB_matrix_palette = 1; +// public const int GL_MATRIX_PALETTE_ARB = 0x8840; +// public const int GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = 0x8841; +// public const int GL_MAX_PALETTE_MATRICES_ARB = 0x8842; +// public const int GL_CURRENT_PALETTE_MATRIX_ARB = 0x8843; +// public const int GL_MATRIX_INDEX_ARRAY_ARB = 0x8844; +// public const int GL_CURRENT_MATRIX_INDEX_ARB = 0x8845; +// public const int GL_MATRIX_INDEX_ARRAY_SIZE_ARB = 0x8846; +// public const int GL_MATRIX_INDEX_ARRAY_TYPE_ARB = 0x8847; +// public const int GL_MATRIX_INDEX_ARRAY_STRIDE_ARB = 0x8848; +// public const int GL_MATRIX_INDEX_ARRAY_POINTER_ARB = 0x8849; +// public const int GL_ARB_multi_bind = 1; +// public const int GL_ARB_multi_draw_indirect = 1; +// public const int GL_ARB_multisample = 1; +// public const int GL_MULTISAMPLE_ARB = 0x809D; +// public const int GL_SAMPLE_ALPHA_TO_COVERAGE_ARB = 0x809E; +// public const int GL_SAMPLE_ALPHA_TO_ONE_ARB = 0x809F; +// public const int GL_SAMPLE_COVERAGE_ARB = 0x80A0; +// public const int GL_SAMPLE_BUFFERS_ARB = 0x80A8; +// public const int GL_SAMPLES_ARB = 0x80A9; +// public const int GL_SAMPLE_COVERAGE_VALUE_ARB = 0x80AA; +// public const int GL_SAMPLE_COVERAGE_INVERT_ARB = 0x80AB; +// public const int GL_MULTISAMPLE_BIT_ARB = 0x20000000; +// public const int GL_ARB_occlusion_query = 1; +// public const int GL_QUERY_COUNTER_BITS_ARB = 0x8864; +// public const int GL_CURRENT_QUERY_ARB = 0x8865; +// public const int GL_QUERY_RESULT_ARB = 0x8866; +// public const int GL_QUERY_RESULT_AVAILABLE_ARB = 0x8867; +// public const int GL_SAMPLES_PASSED_ARB = 0x8914; +// public const int GL_ARB_occlusion_query2 = 1; +// public const int GL_ARB_parallel_shader_compile = 1; +// public const int GL_MAX_SHADER_COMPILER_THREADS_ARB = 0x91B0; +// public const int GL_COMPLETION_STATUS_ARB = 0x91B1; +// public const int GL_ARB_pipeline_statistics_query = 1; +// public const int GL_VERTICES_SUBMITTED_ARB = 0x82EE; +// public const int GL_PRIMITIVES_SUBMITTED_ARB = 0x82EF; +// public const int GL_VERTEX_SHADER_INVOCATIONS_ARB = 0x82F0; +// public const int GL_TESS_CONTROL_SHADER_PATCHES_ARB = 0x82F1; +// public const int GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB = 0x82F2; +// public const int GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB = 0x82F3; +// public const int GL_FRAGMENT_SHADER_INVOCATIONS_ARB = 0x82F4; +// public const int GL_COMPUTE_SHADER_INVOCATIONS_ARB = 0x82F5; +// public const int GL_CLIPPING_INPUT_PRIMITIVES_ARB = 0x82F6; +// public const int GL_CLIPPING_OUTPUT_PRIMITIVES_ARB = 0x82F7; +// public const int GL_ARB_pixel_buffer_object = 1; +// public const int GL_PIXEL_PACK_BUFFER_ARB = 0x88EB; +// public const int GL_PIXEL_UNPACK_BUFFER_ARB = 0x88EC; +// public const int GL_PIXEL_PACK_BUFFER_BINDING_ARB = 0x88ED; +// public const int GL_PIXEL_UNPACK_BUFFER_BINDING_ARB = 0x88EF; +// public const int GL_ARB_point_parameters = 1; +// public const int GL_POINT_SIZE_MIN_ARB = 0x8126; +// public const int GL_POINT_SIZE_MAX_ARB = 0x8127; +// public const int GL_POINT_FADE_THRESHOLD_SIZE_ARB = 0x8128; +// public const int GL_POINT_DISTANCE_ATTENUATION_ARB = 0x8129; +// public const int GL_ARB_point_sprite = 1; +// public const int GL_POINT_SPRITE_ARB = 0x8861; +// public const int GL_COORD_REPLACE_ARB = 0x8862; +// public const int GL_ARB_polygon_offset_clamp = 1; +// public const int GL_ARB_post_depth_coverage = 1; +// public const int GL_ARB_program_interface_query = 1; +// public const int GL_ARB_provoking_vertex = 1; +// public const int GL_ARB_query_buffer_object = 1; +// public const int GL_ARB_robust_buffer_access_behavior = 1; +// public const int GL_ARB_robustness = 1; +// public const int GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB = 0x00000004; +// public const int GL_LOSE_CONTEXT_ON_RESET_ARB = 0x8252; +// public const int GL_GUILTY_CONTEXT_RESET_ARB = 0x8253; +// public const int GL_INNOCENT_CONTEXT_RESET_ARB = 0x8254; +// public const int GL_UNKNOWN_CONTEXT_RESET_ARB = 0x8255; +// public const int GL_RESET_NOTIFICATION_STRATEGY_ARB = 0x8256; +// public const int GL_NO_RESET_NOTIFICATION_ARB = 0x8261; +// public const int GL_ARB_robustness_isolation = 1; +// public const int GL_ARB_sample_locations = 1; +// public const int GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB = 0x933D; +// public const int GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB = 0x933E; +// public const int GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB = 0x933F; +// public const int GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB = 0x9340; +// public const int GL_SAMPLE_LOCATION_ARB = 0x8E50; +// public const int GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB = 0x9341; +// public const int GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB = 0x9342; +// public const int GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB = 0x9343; +// public const int GL_ARB_sample_shading = 1; +// public const int GL_SAMPLE_SHADING_ARB = 0x8C36; +// public const int GL_MIN_SAMPLE_SHADING_VALUE_ARB = 0x8C37; +// public const int GL_ARB_sampler_objects = 1; +// public const int GL_ARB_seamless_cube_map = 1; +// public const int GL_ARB_seamless_cubemap_per_texture = 1; +// public const int GL_ARB_separate_shader_objects = 1; +// public const int GL_ARB_shader_atomic_counter_ops = 1; +// public const int GL_ARB_shader_atomic_counters = 1; +// public const int GL_ARB_shader_ballot = 1; +// public const int GL_ARB_shader_bit_encoding = 1; +// public const int GL_ARB_shader_clock = 1; +// public const int GL_ARB_shader_draw_parameters = 1; +// public const int GL_ARB_shader_group_vote = 1; +// public const int GL_ARB_shader_image_load_store = 1; +// public const int GL_ARB_shader_image_size = 1; +// public const int GL_ARB_shader_objects = 1; +// public const int GL_PROGRAM_OBJECT_ARB = 0x8B40; +// public const int GL_SHADER_OBJECT_ARB = 0x8B48; +// public const int GL_OBJECT_TYPE_ARB = 0x8B4E; +// public const int GL_OBJECT_SUBTYPE_ARB = 0x8B4F; +// public const int GL_FLOAT_VEC2_ARB = 0x8B50; +// public const int GL_FLOAT_VEC3_ARB = 0x8B51; +// public const int GL_FLOAT_VEC4_ARB = 0x8B52; +// public const int GL_INT_VEC2_ARB = 0x8B53; +// public const int GL_INT_VEC3_ARB = 0x8B54; +// public const int GL_INT_VEC4_ARB = 0x8B55; +// public const int GL_BOOL_ARB = 0x8B56; +// public const int GL_BOOL_VEC2_ARB = 0x8B57; +// public const int GL_BOOL_VEC3_ARB = 0x8B58; +// public const int GL_BOOL_VEC4_ARB = 0x8B59; +// public const int GL_FLOAT_MAT2_ARB = 0x8B5A; +// public const int GL_FLOAT_MAT3_ARB = 0x8B5B; +// public const int GL_FLOAT_MAT4_ARB = 0x8B5C; +// public const int GL_SAMPLER_1D_ARB = 0x8B5D; +// public const int GL_SAMPLER_2D_ARB = 0x8B5E; +// public const int GL_SAMPLER_3D_ARB = 0x8B5F; +// public const int GL_SAMPLER_CUBE_ARB = 0x8B60; +// public const int GL_SAMPLER_1D_SHADOW_ARB = 0x8B61; +// public const int GL_SAMPLER_2D_SHADOW_ARB = 0x8B62; +// public const int GL_SAMPLER_2D_RECT_ARB = 0x8B63; +// public const int GL_SAMPLER_2D_RECT_SHADOW_ARB = 0x8B64; +// public const int GL_OBJECT_DELETE_STATUS_ARB = 0x8B80; +// public const int GL_OBJECT_COMPILE_STATUS_ARB = 0x8B81; +// public const int GL_OBJECT_LINK_STATUS_ARB = 0x8B82; +// public const int GL_OBJECT_VALIDATE_STATUS_ARB = 0x8B83; +// public const int GL_OBJECT_INFO_LOG_LENGTH_ARB = 0x8B84; +// public const int GL_OBJECT_ATTACHED_OBJECTS_ARB = 0x8B85; +// public const int GL_OBJECT_ACTIVE_UNIFORMS_ARB = 0x8B86; +// public const int GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB = 0x8B87; +// public const int GL_OBJECT_SHADER_SOURCE_LENGTH_ARB = 0x8B88; +// public const int GL_ARB_shader_precision = 1; +// public const int GL_ARB_shader_stencil_export = 1; +// public const int GL_ARB_shader_storage_buffer_object = 1; +// public const int GL_ARB_shader_subroutine = 1; +// public const int GL_ARB_shader_texture_image_samples = 1; +// public const int GL_ARB_shader_texture_lod = 1; +// public const int GL_ARB_shader_viewport_layer_array = 1; +// public const int GL_ARB_shading_language_100 = 1; +// public const int GL_SHADING_LANGUAGE_VERSION_ARB = 0x8B8C; +// public const int GL_ARB_shading_language_420pack = 1; +// public const int GL_ARB_shading_language_include = 1; +// public const int GL_SHADER_INCLUDE_ARB = 0x8DAE; +// public const int GL_NAMED_STRING_LENGTH_ARB = 0x8DE9; +// public const int GL_NAMED_STRING_TYPE_ARB = 0x8DEA; +// public const int GL_ARB_shading_language_packing = 1; +// public const int GL_ARB_shadow = 1; +// public const int GL_TEXTURE_COMPARE_MODE_ARB = 0x884C; +// public const int GL_TEXTURE_COMPARE_FUNC_ARB = 0x884D; +// public const int GL_COMPARE_R_TO_TEXTURE_ARB = 0x884E; +// public const int GL_ARB_shadow_ambient = 1; +// public const int GL_TEXTURE_COMPARE_FAIL_VALUE_ARB = 0x80BF; +// public const int GL_ARB_sparse_buffer = 1; +// public const int GL_SPARSE_STORAGE_BIT_ARB = 0x0400; +// public const int GL_SPARSE_BUFFER_PAGE_SIZE_ARB = 0x82F8; +// public const int GL_ARB_sparse_texture = 1; +// public const int GL_TEXTURE_SPARSE_ARB = 0x91A6; +// public const int GL_VIRTUAL_PAGE_SIZE_INDEX_ARB = 0x91A7; +// public const int GL_NUM_SPARSE_LEVELS_ARB = 0x91AA; +// public const int GL_NUM_VIRTUAL_PAGE_SIZES_ARB = 0x91A8; +// public const int GL_VIRTUAL_PAGE_SIZE_X_ARB = 0x9195; +// public const int GL_VIRTUAL_PAGE_SIZE_Y_ARB = 0x9196; +// public const int GL_VIRTUAL_PAGE_SIZE_Z_ARB = 0x9197; +// public const int GL_MAX_SPARSE_TEXTURE_SIZE_ARB = 0x9198; +// public const int GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB = 0x9199; +// public const int GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB = 0x919A; +// public const int GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB = 0x91A9; +// public const int GL_ARB_sparse_texture2 = 1; +// public const int GL_ARB_sparse_texture_clamp = 1; +// public const int GL_ARB_spirv_extensions = 1; +// public const int GL_ARB_stencil_texturing = 1; +// public const int GL_ARB_sync = 1; +// public const int GL_ARB_tessellation_shader = 1; +// public const int GL_ARB_texture_barrier = 1; +// public const int GL_ARB_texture_border_clamp = 1; +// public const int GL_CLAMP_TO_BORDER_ARB = 0x812D; +// public const int GL_ARB_texture_buffer_object = 1; +// public const int GL_TEXTURE_BUFFER_ARB = 0x8C2A; +// public const int GL_MAX_TEXTURE_BUFFER_SIZE_ARB = 0x8C2B; +// public const int GL_TEXTURE_BINDING_BUFFER_ARB = 0x8C2C; +// public const int GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB = 0x8C2D; +// public const int GL_TEXTURE_BUFFER_FORMAT_ARB = 0x8C2E; +// public const int GL_ARB_texture_buffer_object_rgb32 = 1; +// public const int GL_ARB_texture_buffer_range = 1; +// public const int GL_ARB_texture_compression = 1; +// public const int GL_COMPRESSED_ALPHA_ARB = 0x84E9; +// public const int GL_COMPRESSED_LUMINANCE_ARB = 0x84EA; +// public const int GL_COMPRESSED_LUMINANCE_ALPHA_ARB = 0x84EB; +// public const int GL_COMPRESSED_INTENSITY_ARB = 0x84EC; +// public const int GL_COMPRESSED_RGB_ARB = 0x84ED; +// public const int GL_COMPRESSED_RGBA_ARB = 0x84EE; +// public const int GL_TEXTURE_COMPRESSION_HINT_ARB = 0x84EF; +// public const int GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB = 0x86A0; +// public const int GL_TEXTURE_COMPRESSED_ARB = 0x86A1; +// public const int GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A2; +// public const int GL_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3; +// public const int GL_ARB_texture_compression_bptc = 1; +// public const int GL_COMPRESSED_RGBA_BPTC_UNORM_ARB = 0x8E8C; +// public const int GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB = 0x8E8D; +// public const int GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB = 0x8E8E; +// public const int GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB = 0x8E8F; +// public const int GL_ARB_texture_compression_rgtc = 1; +// public const int GL_ARB_texture_cube_map = 1; +// public const int GL_NORMAL_MAP_ARB = 0x8511; +// public const int GL_REFLECTION_MAP_ARB = 0x8512; +// public const int GL_TEXTURE_CUBE_MAP_ARB = 0x8513; +// public const int GL_TEXTURE_BINDING_CUBE_MAP_ARB = 0x8514; +// public const int GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x8515; +// public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x8516; +// public const int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x8517; +// public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x8518; +// public const int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x8519; +// public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x851A; +// public const int GL_PROXY_TEXTURE_CUBE_MAP_ARB = 0x851B; +// public const int GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 0x851C; +// public const int GL_ARB_texture_cube_map_array = 1; +// public const int GL_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x9009; +// public const int GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB = 0x900A; +// public const int GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x900B; +// public const int GL_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900C; +// public const int GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB = 0x900D; +// public const int GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900E; +// public const int GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900F; +// public const int GL_ARB_texture_env_add = 1; +// public const int GL_ARB_texture_env_combine = 1; +// public const int GL_COMBINE_ARB = 0x8570; +// public const int GL_COMBINE_RGB_ARB = 0x8571; +// public const int GL_COMBINE_ALPHA_ARB = 0x8572; +// public const int GL_SOURCE0_RGB_ARB = 0x8580; +// public const int GL_SOURCE1_RGB_ARB = 0x8581; +// public const int GL_SOURCE2_RGB_ARB = 0x8582; +// public const int GL_SOURCE0_ALPHA_ARB = 0x8588; +// public const int GL_SOURCE1_ALPHA_ARB = 0x8589; +// public const int GL_SOURCE2_ALPHA_ARB = 0x858A; +// public const int GL_OPERAND0_RGB_ARB = 0x8590; +// public const int GL_OPERAND1_RGB_ARB = 0x8591; +// public const int GL_OPERAND2_RGB_ARB = 0x8592; +// public const int GL_OPERAND0_ALPHA_ARB = 0x8598; +// public const int GL_OPERAND1_ALPHA_ARB = 0x8599; +// public const int GL_OPERAND2_ALPHA_ARB = 0x859A; +// public const int GL_RGB_SCALE_ARB = 0x8573; +// public const int GL_ADD_SIGNED_ARB = 0x8574; +// public const int GL_INTERPOLATE_ARB = 0x8575; +// public const int GL_SUBTRACT_ARB = 0x84E7; +// public const int GL_CONSTANT_ARB = 0x8576; +// public const int GL_PRIMARY_COLOR_ARB = 0x8577; +// public const int GL_PREVIOUS_ARB = 0x8578; +// public const int GL_ARB_texture_env_crossbar = 1; +// public const int GL_ARB_texture_env_dot3 = 1; +// public const int GL_DOT3_RGB_ARB = 0x86AE; +// public const int GL_DOT3_RGBA_ARB = 0x86AF; +// public const int GL_ARB_texture_filter_anisotropic = 1; +// public const int GL_ARB_texture_filter_minmax = 1; +// public const int GL_TEXTURE_REDUCTION_MODE_ARB = 0x9366; +// public const int GL_WEIGHTED_AVERAGE_ARB = 0x9367; +// public const int GL_ARB_texture_float = 1; +// public const int GL_TEXTURE_RED_TYPE_ARB = 0x8C10; +// public const int GL_TEXTURE_GREEN_TYPE_ARB = 0x8C11; +// public const int GL_TEXTURE_BLUE_TYPE_ARB = 0x8C12; +// public const int GL_TEXTURE_ALPHA_TYPE_ARB = 0x8C13; +// public const int GL_TEXTURE_LUMINANCE_TYPE_ARB = 0x8C14; +// public const int GL_TEXTURE_INTENSITY_TYPE_ARB = 0x8C15; +// public const int GL_TEXTURE_DEPTH_TYPE_ARB = 0x8C16; +// public const int GL_UNSIGNED_NORMALIZED_ARB = 0x8C17; +// public const int GL_RGBA32F_ARB = 0x8814; +// public const int GL_RGB32F_ARB = 0x8815; +// public const int GL_ALPHA32F_ARB = 0x8816; +// public const int GL_INTENSITY32F_ARB = 0x8817; +// public const int GL_LUMINANCE32F_ARB = 0x8818; +// public const int GL_LUMINANCE_ALPHA32F_ARB = 0x8819; +// public const int GL_RGBA16F_ARB = 0x881A; +// public const int GL_RGB16F_ARB = 0x881B; +// public const int GL_ALPHA16F_ARB = 0x881C; +// public const int GL_INTENSITY16F_ARB = 0x881D; +// public const int GL_LUMINANCE16F_ARB = 0x881E; +// public const int GL_LUMINANCE_ALPHA16F_ARB = 0x881F; +// public const int GL_ARB_texture_gather = 1; +// public const int GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5E; +// public const int GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5F; +// public const int GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB = 0x8F9F; +// public const int GL_ARB_texture_mirror_clamp_to_edge = 1; +// public const int GL_ARB_texture_mirrored_repeat = 1; +// public const int GL_MIRRORED_REPEAT_ARB = 0x8370; +// public const int GL_ARB_texture_multisample = 1; +// public const int GL_ARB_texture_non_power_of_two = 1; +// public const int GL_ARB_texture_query_levels = 1; +// public const int GL_ARB_texture_query_lod = 1; +// public const int GL_ARB_texture_rectangle = 1; +// public const int GL_TEXTURE_RECTANGLE_ARB = 0x84F5; +// public const int GL_TEXTURE_BINDING_RECTANGLE_ARB = 0x84F6; +// public const int GL_PROXY_TEXTURE_RECTANGLE_ARB = 0x84F7; +// public const int GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB = 0x84F8; +// public const int GL_ARB_texture_rg = 1; +// public const int GL_ARB_texture_rgb10_a2ui = 1; +// public const int GL_ARB_texture_stencil8 = 1; +// public const int GL_ARB_texture_storage = 1; +// public const int GL_ARB_texture_storage_multisample = 1; +// public const int GL_ARB_texture_swizzle = 1; +// public const int GL_ARB_texture_view = 1; +// public const int GL_ARB_timer_query = 1; +// public const int GL_ARB_transform_feedback2 = 1; +// public const int GL_ARB_transform_feedback3 = 1; +// public const int GL_ARB_transform_feedback_instanced = 1; +// public const int GL_ARB_transform_feedback_overflow_query = 1; +// public const int GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB = 0x82EC; +// public const int GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB = 0x82ED; +// public const int GL_ARB_transpose_matrix = 1; +// public const int GL_TRANSPOSE_MODELVIEW_MATRIX_ARB = 0x84E3; +// public const int GL_TRANSPOSE_PROJECTION_MATRIX_ARB = 0x84E4; +// public const int GL_TRANSPOSE_TEXTURE_MATRIX_ARB = 0x84E5; +// public const int GL_TRANSPOSE_COLOR_MATRIX_ARB = 0x84E6; +// public const int GL_ARB_uniform_buffer_object = 1; +// public const int GL_ARB_vertex_array_bgra = 1; +// public const int GL_ARB_vertex_array_object = 1; +// public const int GL_ARB_vertex_attrib_64bit = 1; +// public const int GL_ARB_vertex_attrib_binding = 1; +// public const int GL_ARB_vertex_blend = 1; +// public const int GL_MAX_VERTEX_UNITS_ARB = 0x86A4; +// public const int GL_ACTIVE_VERTEX_UNITS_ARB = 0x86A5; +// public const int GL_WEIGHT_SUM_UNITY_ARB = 0x86A6; +// public const int GL_VERTEX_BLEND_ARB = 0x86A7; +// public const int GL_CURRENT_WEIGHT_ARB = 0x86A8; +// public const int GL_WEIGHT_ARRAY_TYPE_ARB = 0x86A9; +// public const int GL_WEIGHT_ARRAY_STRIDE_ARB = 0x86AA; +// public const int GL_WEIGHT_ARRAY_SIZE_ARB = 0x86AB; +// public const int GL_WEIGHT_ARRAY_POINTER_ARB = 0x86AC; +// public const int GL_WEIGHT_ARRAY_ARB = 0x86AD; +// public const int GL_MODELVIEW0_ARB = 0x1700; +// public const int GL_MODELVIEW1_ARB = 0x850A; +// public const int GL_MODELVIEW2_ARB = 0x8722; +// public const int GL_MODELVIEW3_ARB = 0x8723; +// public const int GL_MODELVIEW4_ARB = 0x8724; +// public const int GL_MODELVIEW5_ARB = 0x8725; +// public const int GL_MODELVIEW6_ARB = 0x8726; +// public const int GL_MODELVIEW7_ARB = 0x8727; +// public const int GL_MODELVIEW8_ARB = 0x8728; +// public const int GL_MODELVIEW9_ARB = 0x8729; +// public const int GL_MODELVIEW10_ARB = 0x872A; +// public const int GL_MODELVIEW11_ARB = 0x872B; +// public const int GL_MODELVIEW12_ARB = 0x872C; +// public const int GL_MODELVIEW13_ARB = 0x872D; +// public const int GL_MODELVIEW14_ARB = 0x872E; +// public const int GL_MODELVIEW15_ARB = 0x872F; +// public const int GL_MODELVIEW16_ARB = 0x8730; +// public const int GL_MODELVIEW17_ARB = 0x8731; +// public const int GL_MODELVIEW18_ARB = 0x8732; +// public const int GL_MODELVIEW19_ARB = 0x8733; +// public const int GL_MODELVIEW20_ARB = 0x8734; +// public const int GL_MODELVIEW21_ARB = 0x8735; +// public const int GL_MODELVIEW22_ARB = 0x8736; +// public const int GL_MODELVIEW23_ARB = 0x8737; +// public const int GL_MODELVIEW24_ARB = 0x8738; +// public const int GL_MODELVIEW25_ARB = 0x8739; +// public const int GL_MODELVIEW26_ARB = 0x873A; +// public const int GL_MODELVIEW27_ARB = 0x873B; +// public const int GL_MODELVIEW28_ARB = 0x873C; +// public const int GL_MODELVIEW29_ARB = 0x873D; +// public const int GL_MODELVIEW30_ARB = 0x873E; +// public const int GL_MODELVIEW31_ARB = 0x873F; +// public const int GL_ARB_vertex_buffer_object = 1; +// public const int GL_BUFFER_SIZE_ARB = 0x8764; +// public const int GL_BUFFER_USAGE_ARB = 0x8765; +// public const int GL_ARRAY_BUFFER_ARB = 0x8892; +// public const int GL_ELEMENT_ARRAY_BUFFER_ARB = 0x8893; +// public const int GL_ARRAY_BUFFER_BINDING_ARB = 0x8894; +// public const int GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB = 0x8895; +// public const int GL_VERTEX_ARRAY_BUFFER_BINDING_ARB = 0x8896; +// public const int GL_NORMAL_ARRAY_BUFFER_BINDING_ARB = 0x8897; +// public const int GL_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x8898; +// public const int GL_INDEX_ARRAY_BUFFER_BINDING_ARB = 0x8899; +// public const int GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB = 0x889A; +// public const int GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB = 0x889B; +// public const int GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x889C; +// public const int GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB = 0x889D; +// public const int GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB = 0x889E; +// public const int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB = 0x889F; +// public const int GL_READ_ONLY_ARB = 0x88B8; +// public const int GL_WRITE_ONLY_ARB = 0x88B9; +// public const int GL_READ_WRITE_ARB = 0x88BA; +// public const int GL_BUFFER_ACCESS_ARB = 0x88BB; +// public const int GL_BUFFER_MAPPED_ARB = 0x88BC; +// public const int GL_BUFFER_MAP_POINTER_ARB = 0x88BD; +// public const int GL_STREAM_DRAW_ARB = 0x88E0; +// public const int GL_STREAM_READ_ARB = 0x88E1; +// public const int GL_STREAM_COPY_ARB = 0x88E2; +// public const int GL_STATIC_DRAW_ARB = 0x88E4; +// public const int GL_STATIC_READ_ARB = 0x88E5; +// public const int GL_STATIC_COPY_ARB = 0x88E6; +// public const int GL_DYNAMIC_DRAW_ARB = 0x88E8; +// public const int GL_DYNAMIC_READ_ARB = 0x88E9; +// public const int GL_DYNAMIC_COPY_ARB = 0x88EA; +// public const int GL_ARB_vertex_program = 1; +// public const int GL_COLOR_SUM_ARB = 0x8458; +// public const int GL_VERTEX_PROGRAM_ARB = 0x8620; +// public const int GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622; +// public const int GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623; +// public const int GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624; +// public const int GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625; +// public const int GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626; +// public const int GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642; +// public const int GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643; +// public const int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645; +// public const int GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869; +// public const int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A; +// public const int GL_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B0; +// public const int GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B1; +// public const int GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B2; +// public const int GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B3; +// public const int GL_ARB_vertex_shader = 1; +// public const int GL_VERTEX_SHADER_ARB = 0x8B31; +// public const int GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB = 0x8B4A; +// public const int GL_MAX_VARYING_FLOATS_ARB = 0x8B4B; +// public const int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = 0x8B4C; +// public const int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB = 0x8B4D; +// public const int GL_OBJECT_ACTIVE_ATTRIBUTES_ARB = 0x8B89; +// public const int GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB = 0x8B8A; +// public const int GL_ARB_vertex_type_10f_11f_11f_rev = 1; +// public const int GL_ARB_vertex_type_2_10_10_10_rev = 1; +// public const int GL_ARB_viewport_array = 1; +// public const int GL_ARB_window_pos = 1; +// public const int GL_KHR_blend_equation_advanced = 1; +// public const int GL_MULTIPLY_KHR = 0x9294; +// public const int GL_SCREEN_KHR = 0x9295; +// public const int GL_OVERLAY_KHR = 0x9296; +// public const int GL_DARKEN_KHR = 0x9297; +// public const int GL_LIGHTEN_KHR = 0x9298; +// public const int GL_COLORDODGE_KHR = 0x9299; +// public const int GL_COLORBURN_KHR = 0x929A; +// public const int GL_HARDLIGHT_KHR = 0x929B; +// public const int GL_SOFTLIGHT_KHR = 0x929C; +// public const int GL_DIFFERENCE_KHR = 0x929E; +// public const int GL_EXCLUSION_KHR = 0x92A0; +// public const int GL_HSL_HUE_KHR = 0x92AD; +// public const int GL_HSL_SATURATION_KHR = 0x92AE; +// public const int GL_HSL_COLOR_KHR = 0x92AF; +// public const int GL_HSL_LUMINOSITY_KHR = 0x92B0; +// public const int GL_KHR_blend_equation_advanced_coherent = 1; +// public const int GL_BLEND_ADVANCED_COHERENT_KHR = 0x9285; +// public const int GL_KHR_context_flush_control = 1; +// public const int GL_KHR_debug = 1; +// public const int GL_KHR_no_error = 1; +// public const int GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR = 0x00000008; +// public const int GL_KHR_parallel_shader_compile = 1; +// public const int GL_MAX_SHADER_COMPILER_THREADS_KHR = 0x91B0; +// public const int GL_COMPLETION_STATUS_KHR = 0x91B1; +// public const int GL_KHR_robust_buffer_access_behavior = 1; +// public const int GL_KHR_robustness = 1; +// public const int GL_CONTEXT_ROBUST_ACCESS = 0x90F3; +// public const int GL_KHR_texture_compression_astc_hdr = 1; +// public const int GL_COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0; +// public const int GL_COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1; +// public const int GL_COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2; +// public const int GL_COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3; +// public const int GL_COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4; +// public const int GL_COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5; +// public const int GL_COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6; +// public const int GL_COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7; +// public const int GL_COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8; +// public const int GL_COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9; +// public const int GL_COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA; +// public const int GL_COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB; +// public const int GL_COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC; +// public const int GL_COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD; +// public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0; +// public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1; +// public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2; +// public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3; +// public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4; +// public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5; +// public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6; +// public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7; +// public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8; +// public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9; +// public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA; +// public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB; +// public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC; +// public const int GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD; +// public const int GL_KHR_texture_compression_astc_ldr = 1; +// public const int GL_KHR_texture_compression_astc_sliced_3d = 1; +// public const int GL_OES_byte_coordinates = 1; +// public const int GL_OES_compressed_paletted_texture = 1; +// public const int GL_PALETTE4_RGB8_OES = 0x8B90; +// public const int GL_PALETTE4_RGBA8_OES = 0x8B91; +// public const int GL_PALETTE4_R5_G6_B5_OES = 0x8B92; +// public const int GL_PALETTE4_RGBA4_OES = 0x8B93; +// public const int GL_PALETTE4_RGB5_A1_OES = 0x8B94; +// public const int GL_PALETTE8_RGB8_OES = 0x8B95; +// public const int GL_PALETTE8_RGBA8_OES = 0x8B96; +// public const int GL_PALETTE8_R5_G6_B5_OES = 0x8B97; +// public const int GL_PALETTE8_RGBA4_OES = 0x8B98; +// public const int GL_PALETTE8_RGB5_A1_OES = 0x8B99; +// public const int GL_OES_fixed_point = 1; +// public const int GL_FIXED_OES = 0x140C; +// public const int GL_OES_query_matrix = 1; +// public const int GL_OES_read_format = 1; +// public const int GL_IMPLEMENTATION_COLOR_READ_TYPE_OES = 0x8B9A; +// public const int GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES = 0x8B9B; +// public const int GL_OES_single_precision = 1; +// public const int GL_3DFX_multisample = 1; +// public const int GL_MULTISAMPLE_3DFX = 0x86B2; +// public const int GL_SAMPLE_BUFFERS_3DFX = 0x86B3; +// public const int GL_SAMPLES_3DFX = 0x86B4; +// public const int GL_MULTISAMPLE_BIT_3DFX = 0x20000000; +// public const int GL_3DFX_tbuffer = 1; +// public const int GL_3DFX_texture_compression_FXT1 = 1; +// public const int GL_COMPRESSED_RGB_FXT1_3DFX = 0x86B0; +// public const int GL_COMPRESSED_RGBA_FXT1_3DFX = 0x86B1; +// public const int GL_AMD_blend_minmax_factor = 1; +// public const int GL_FACTOR_MIN_AMD = 0x901C; +// public const int GL_FACTOR_MAX_AMD = 0x901D; +// public const int GL_AMD_conservative_depth = 1; +// public const int GL_AMD_debug_output = 1; +// public const int GL_MAX_DEBUG_MESSAGE_LENGTH_AMD = 0x9143; +// public const int GL_MAX_DEBUG_LOGGED_MESSAGES_AMD = 0x9144; +// public const int GL_DEBUG_LOGGED_MESSAGES_AMD = 0x9145; +// public const int GL_DEBUG_SEVERITY_HIGH_AMD = 0x9146; +// public const int GL_DEBUG_SEVERITY_MEDIUM_AMD = 0x9147; +// public const int GL_DEBUG_SEVERITY_LOW_AMD = 0x9148; +// public const int GL_DEBUG_CATEGORY_API_ERROR_AMD = 0x9149; +// public const int GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD = 0x914A; +// public const int GL_DEBUG_CATEGORY_DEPRECATION_AMD = 0x914B; +// public const int GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD = 0x914C; +// public const int GL_DEBUG_CATEGORY_PERFORMANCE_AMD = 0x914D; +// public const int GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD = 0x914E; +// public const int GL_DEBUG_CATEGORY_APPLICATION_AMD = 0x914F; +// public const int GL_DEBUG_CATEGORY_OTHER_AMD = 0x9150; +// public const int GL_AMD_depth_clamp_separate = 1; +// public const int GL_DEPTH_CLAMP_NEAR_AMD = 0x901E; +// public const int GL_DEPTH_CLAMP_FAR_AMD = 0x901F; +// public const int GL_AMD_draw_buffers_blend = 1; +// public const int GL_AMD_framebuffer_multisample_advanced = 1; +// public const int GL_RENDERBUFFER_STORAGE_SAMPLES_AMD = 0x91B2; +// public const int GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD = 0x91B3; +// public const int GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD = 0x91B4; +// public const int GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD = 0x91B5; +// public const int GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B6; +// public const int GL_SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B7; +// public const int GL_AMD_framebuffer_sample_positions = 1; +// public const int GL_SUBSAMPLE_DISTANCE_AMD = 0x883F; +// public const int GL_PIXELS_PER_SAMPLE_PATTERN_X_AMD = 0x91AE; +// public const int GL_PIXELS_PER_SAMPLE_PATTERN_Y_AMD = 0x91AF; +// public const int GL_ALL_PIXELS_AMD = -1; +// public const int GL_AMD_gcn_shader = 1; +// public const int GL_AMD_gpu_shader_half_float = 1; +// public const int GL_FLOAT16_NV = 0x8FF8; +// public const int GL_FLOAT16_VEC2_NV = 0x8FF9; +// public const int GL_FLOAT16_VEC3_NV = 0x8FFA; +// public const int GL_FLOAT16_VEC4_NV = 0x8FFB; +// public const int GL_FLOAT16_MAT2_AMD = 0x91C5; +// public const int GL_FLOAT16_MAT3_AMD = 0x91C6; +// public const int GL_FLOAT16_MAT4_AMD = 0x91C7; +// public const int GL_FLOAT16_MAT2x3_AMD = 0x91C8; +// public const int GL_FLOAT16_MAT2x4_AMD = 0x91C9; +// public const int GL_FLOAT16_MAT3x2_AMD = 0x91CA; +// public const int GL_FLOAT16_MAT3x4_AMD = 0x91CB; +// public const int GL_FLOAT16_MAT4x2_AMD = 0x91CC; +// public const int GL_FLOAT16_MAT4x3_AMD = 0x91CD; +// public const int GL_AMD_gpu_shader_int16 = 1; +// public const int GL_AMD_gpu_shader_int64 = 1; +// public const int GL_INT64_NV = 0x140E; +// public const int GL_UNSIGNED_INT64_NV = 0x140F; +// public const int GL_INT8_NV = 0x8FE0; +// public const int GL_INT8_VEC2_NV = 0x8FE1; +// public const int GL_INT8_VEC3_NV = 0x8FE2; +// public const int GL_INT8_VEC4_NV = 0x8FE3; +// public const int GL_INT16_NV = 0x8FE4; +// public const int GL_INT16_VEC2_NV = 0x8FE5; +// public const int GL_INT16_VEC3_NV = 0x8FE6; +// public const int GL_INT16_VEC4_NV = 0x8FE7; +// public const int GL_INT64_VEC2_NV = 0x8FE9; +// public const int GL_INT64_VEC3_NV = 0x8FEA; +// public const int GL_INT64_VEC4_NV = 0x8FEB; +// public const int GL_UNSIGNED_INT8_NV = 0x8FEC; +// public const int GL_UNSIGNED_INT8_VEC2_NV = 0x8FED; +// public const int GL_UNSIGNED_INT8_VEC3_NV = 0x8FEE; +// public const int GL_UNSIGNED_INT8_VEC4_NV = 0x8FEF; +// public const int GL_UNSIGNED_INT16_NV = 0x8FF0; +// public const int GL_UNSIGNED_INT16_VEC2_NV = 0x8FF1; +// public const int GL_UNSIGNED_INT16_VEC3_NV = 0x8FF2; +// public const int GL_UNSIGNED_INT16_VEC4_NV = 0x8FF3; +// public const int GL_UNSIGNED_INT64_VEC2_NV = 0x8FF5; +// public const int GL_UNSIGNED_INT64_VEC3_NV = 0x8FF6; +// public const int GL_UNSIGNED_INT64_VEC4_NV = 0x8FF7; +// public const int GL_AMD_interleaved_elements = 1; +// public const int GL_VERTEX_ELEMENT_SWIZZLE_AMD = 0x91A4; +// public const int GL_VERTEX_ID_SWIZZLE_AMD = 0x91A5; +// public const int GL_AMD_multi_draw_indirect = 1; +// public const int GL_AMD_name_gen_delete = 1; +// public const int GL_DATA_BUFFER_AMD = 0x9151; +// public const int GL_PERFORMANCE_MONITOR_AMD = 0x9152; +// public const int GL_QUERY_OBJECT_AMD = 0x9153; +// public const int GL_VERTEX_ARRAY_OBJECT_AMD = 0x9154; +// public const int GL_SAMPLER_OBJECT_AMD = 0x9155; +// public const int GL_AMD_occlusion_query_event = 1; +// public const int GL_OCCLUSION_QUERY_EVENT_MASK_AMD = 0x874F; +// public const int GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD = 0x00000001; +// public const int GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD = 0x00000002; +// public const int GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD = 0x00000004; +// public const int GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD = 0x00000008; +// public const int GL_QUERY_ALL_EVENT_BITS_AMD = -1; +// public const int GL_AMD_performance_monitor = 1; +// public const int GL_COUNTER_TYPE_AMD = 0x8BC0; +// public const int GL_COUNTER_RANGE_AMD = 0x8BC1; +// public const int GL_UNSIGNED_INT64_AMD = 0x8BC2; +// public const int GL_PERCENTAGE_AMD = 0x8BC3; +// public const int GL_PERFMON_RESULT_AVAILABLE_AMD = 0x8BC4; +// public const int GL_PERFMON_RESULT_SIZE_AMD = 0x8BC5; +// public const int GL_PERFMON_RESULT_AMD = 0x8BC6; +// public const int GL_AMD_pinned_memory = 1; +// public const int GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD = 0x9160; +// public const int GL_AMD_query_buffer_object = 1; +// public const int GL_QUERY_BUFFER_AMD = 0x9192; +// public const int GL_QUERY_BUFFER_BINDING_AMD = 0x9193; +// public const int GL_QUERY_RESULT_NO_WAIT_AMD = 0x9194; +// public const int GL_AMD_sample_positions = 1; +// public const int GL_AMD_seamless_cubemap_per_texture = 1; +// public const int GL_AMD_shader_atomic_counter_ops = 1; +// public const int GL_AMD_shader_ballot = 1; +// public const int GL_AMD_shader_explicit_vertex_parameter = 1; +// public const int GL_AMD_shader_gpu_shader_half_float_fetch = 1; +// public const int GL_AMD_shader_image_load_store_lod = 1; +// public const int GL_AMD_shader_stencil_export = 1; +// public const int GL_AMD_shader_trinary_minmax = 1; +// public const int GL_AMD_sparse_texture = 1; +// public const int GL_VIRTUAL_PAGE_SIZE_X_AMD = 0x9195; +// public const int GL_VIRTUAL_PAGE_SIZE_Y_AMD = 0x9196; +// public const int GL_VIRTUAL_PAGE_SIZE_Z_AMD = 0x9197; +// public const int GL_MAX_SPARSE_TEXTURE_SIZE_AMD = 0x9198; +// public const int GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD = 0x9199; +// public const int GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS = 0x919A; +// public const int GL_MIN_SPARSE_LEVEL_AMD = 0x919B; +// public const int GL_MIN_LOD_WARNING_AMD = 0x919C; +// public const int GL_TEXTURE_STORAGE_SPARSE_BIT_AMD = 0x00000001; +// public const int GL_AMD_stencil_operation_extended = 1; +// public const int GL_SET_AMD = 0x874A; +// public const int GL_REPLACE_VALUE_AMD = 0x874B; +// public const int GL_STENCIL_OP_VALUE_AMD = 0x874C; +// public const int GL_STENCIL_BACK_OP_VALUE_AMD = 0x874D; +// public const int GL_AMD_texture_gather_bias_lod = 1; +// public const int GL_AMD_texture_texture4 = 1; +// public const int GL_AMD_transform_feedback3_lines_triangles = 1; +// public const int GL_AMD_transform_feedback4 = 1; +// public const int GL_STREAM_RASTERIZATION_AMD = 0x91A0; +// public const int GL_AMD_vertex_shader_layer = 1; +// public const int GL_AMD_vertex_shader_tessellator = 1; +// public const int GL_SAMPLER_BUFFER_AMD = 0x9001; +// public const int GL_INT_SAMPLER_BUFFER_AMD = 0x9002; +// public const int GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD = 0x9003; +// public const int GL_TESSELLATION_MODE_AMD = 0x9004; +// public const int GL_TESSELLATION_FACTOR_AMD = 0x9005; +// public const int GL_DISCRETE_AMD = 0x9006; +// public const int GL_CONTINUOUS_AMD = 0x9007; +// public const int GL_AMD_vertex_shader_viewport_index = 1; +// public const int GL_APPLE_aux_depth_stencil = 1; +// public const int GL_AUX_DEPTH_STENCIL_APPLE = 0x8A14; +// public const int GL_APPLE_client_storage = 1; +// public const int GL_UNPACK_CLIENT_STORAGE_APPLE = 0x85B2; +// public const int GL_APPLE_element_array = 1; +// public const int GL_ELEMENT_ARRAY_APPLE = 0x8A0C; +// public const int GL_ELEMENT_ARRAY_TYPE_APPLE = 0x8A0D; +// public const int GL_ELEMENT_ARRAY_POINTER_APPLE = 0x8A0E; +// public const int GL_APPLE_fence = 1; +// public const int GL_DRAW_PIXELS_APPLE = 0x8A0A; +// public const int GL_FENCE_APPLE = 0x8A0B; +// public const int GL_APPLE_float_pixels = 1; +// public const int GL_HALF_APPLE = 0x140B; +// public const int GL_RGBA_FLOAT32_APPLE = 0x8814; +// public const int GL_RGB_FLOAT32_APPLE = 0x8815; +// public const int GL_ALPHA_FLOAT32_APPLE = 0x8816; +// public const int GL_INTENSITY_FLOAT32_APPLE = 0x8817; +// public const int GL_LUMINANCE_FLOAT32_APPLE = 0x8818; +// public const int GL_LUMINANCE_ALPHA_FLOAT32_APPLE = 0x8819; +// public const int GL_RGBA_FLOAT16_APPLE = 0x881A; +// public const int GL_RGB_FLOAT16_APPLE = 0x881B; +// public const int GL_ALPHA_FLOAT16_APPLE = 0x881C; +// public const int GL_INTENSITY_FLOAT16_APPLE = 0x881D; +// public const int GL_LUMINANCE_FLOAT16_APPLE = 0x881E; +// public const int GL_LUMINANCE_ALPHA_FLOAT16_APPLE = 0x881F; +// public const int GL_COLOR_FLOAT_APPLE = 0x8A0F; +// public const int GL_APPLE_flush_buffer_range = 1; +// public const int GL_BUFFER_SERIALIZED_MODIFY_APPLE = 0x8A12; +// public const int GL_BUFFER_FLUSHING_UNMAP_APPLE = 0x8A13; +// public const int GL_APPLE_object_purgeable = 1; +// public const int GL_BUFFER_OBJECT_APPLE = 0x85B3; +// public const int GL_RELEASED_APPLE = 0x8A19; +// public const int GL_VOLATILE_APPLE = 0x8A1A; +// public const int GL_RETAINED_APPLE = 0x8A1B; +// public const int GL_UNDEFINED_APPLE = 0x8A1C; +// public const int GL_PURGEABLE_APPLE = 0x8A1D; +// public const int GL_APPLE_rgb_422 = 1; +// public const int GL_RGB_422_APPLE = 0x8A1F; +// public const int GL_UNSIGNED_SHORT_8_8_APPLE = 0x85BA; +// public const int GL_UNSIGNED_SHORT_8_8_REV_APPLE = 0x85BB; +// public const int GL_RGB_RAW_422_APPLE = 0x8A51; +// public const int GL_APPLE_row_bytes = 1; +// public const int GL_PACK_ROW_BYTES_APPLE = 0x8A15; +// public const int GL_UNPACK_ROW_BYTES_APPLE = 0x8A16; +// public const int GL_APPLE_specular_vector = 1; +// public const int GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE = 0x85B0; +// public const int GL_APPLE_texture_range = 1; +// public const int GL_TEXTURE_RANGE_LENGTH_APPLE = 0x85B7; +// public const int GL_TEXTURE_RANGE_POINTER_APPLE = 0x85B8; +// public const int GL_TEXTURE_STORAGE_HINT_APPLE = 0x85BC; +// public const int GL_STORAGE_PRIVATE_APPLE = 0x85BD; +// public const int GL_STORAGE_CACHED_APPLE = 0x85BE; +// public const int GL_STORAGE_SHARED_APPLE = 0x85BF; +// public const int GL_APPLE_transform_hint = 1; +// public const int GL_TRANSFORM_HINT_APPLE = 0x85B1; +// public const int GL_APPLE_vertex_array_object = 1; +// public const int GL_VERTEX_ARRAY_BINDING_APPLE = 0x85B5; +// public const int GL_APPLE_vertex_array_range = 1; +// public const int GL_VERTEX_ARRAY_RANGE_APPLE = 0x851D; +// public const int GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE = 0x851E; +// public const int GL_VERTEX_ARRAY_STORAGE_HINT_APPLE = 0x851F; +// public const int GL_VERTEX_ARRAY_RANGE_POINTER_APPLE = 0x8521; +// public const int GL_STORAGE_CLIENT_APPLE = 0x85B4; +// public const int GL_APPLE_vertex_program_evaluators = 1; +// public const int GL_VERTEX_ATTRIB_MAP1_APPLE = 0x8A00; +// public const int GL_VERTEX_ATTRIB_MAP2_APPLE = 0x8A01; +// public const int GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE = 0x8A02; +// public const int GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE = 0x8A03; +// public const int GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE = 0x8A04; +// public const int GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE = 0x8A05; +// public const int GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE = 0x8A06; +// public const int GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE = 0x8A07; +// public const int GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE = 0x8A08; +// public const int GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE = 0x8A09; +// public const int GL_APPLE_ycbcr_422 = 1; +// public const int GL_YCBCR_422_APPLE = 0x85B9; +// public const int GL_ATI_draw_buffers = 1; +// public const int GL_MAX_DRAW_BUFFERS_ATI = 0x8824; +// public const int GL_DRAW_BUFFER0_ATI = 0x8825; +// public const int GL_DRAW_BUFFER1_ATI = 0x8826; +// public const int GL_DRAW_BUFFER2_ATI = 0x8827; +// public const int GL_DRAW_BUFFER3_ATI = 0x8828; +// public const int GL_DRAW_BUFFER4_ATI = 0x8829; +// public const int GL_DRAW_BUFFER5_ATI = 0x882A; +// public const int GL_DRAW_BUFFER6_ATI = 0x882B; +// public const int GL_DRAW_BUFFER7_ATI = 0x882C; +// public const int GL_DRAW_BUFFER8_ATI = 0x882D; +// public const int GL_DRAW_BUFFER9_ATI = 0x882E; +// public const int GL_DRAW_BUFFER10_ATI = 0x882F; +// public const int GL_DRAW_BUFFER11_ATI = 0x8830; +// public const int GL_DRAW_BUFFER12_ATI = 0x8831; +// public const int GL_DRAW_BUFFER13_ATI = 0x8832; +// public const int GL_DRAW_BUFFER14_ATI = 0x8833; +// public const int GL_DRAW_BUFFER15_ATI = 0x8834; +// public const int GL_ATI_element_array = 1; +// public const int GL_ELEMENT_ARRAY_ATI = 0x8768; +// public const int GL_ELEMENT_ARRAY_TYPE_ATI = 0x8769; +// public const int GL_ELEMENT_ARRAY_POINTER_ATI = 0x876A; +// public const int GL_ATI_envmap_bumpmap = 1; +// public const int GL_BUMP_ROT_MATRIX_ATI = 0x8775; +// public const int GL_BUMP_ROT_MATRIX_SIZE_ATI = 0x8776; +// public const int GL_BUMP_NUM_TEX_UNITS_ATI = 0x8777; +// public const int GL_BUMP_TEX_UNITS_ATI = 0x8778; +// public const int GL_DUDV_ATI = 0x8779; +// public const int GL_DU8DV8_ATI = 0x877A; +// public const int GL_BUMP_ENVMAP_ATI = 0x877B; +// public const int GL_BUMP_TARGET_ATI = 0x877C; +// public const int GL_ATI_fragment_shader = 1; +// public const int GL_FRAGMENT_SHADER_ATI = 0x8920; +// public const int GL_REG_0_ATI = 0x8921; +// public const int GL_REG_1_ATI = 0x8922; +// public const int GL_REG_2_ATI = 0x8923; +// public const int GL_REG_3_ATI = 0x8924; +// public const int GL_REG_4_ATI = 0x8925; +// public const int GL_REG_5_ATI = 0x8926; +// public const int GL_REG_6_ATI = 0x8927; +// public const int GL_REG_7_ATI = 0x8928; +// public const int GL_REG_8_ATI = 0x8929; +// public const int GL_REG_9_ATI = 0x892A; +// public const int GL_REG_10_ATI = 0x892B; +// public const int GL_REG_11_ATI = 0x892C; +// public const int GL_REG_12_ATI = 0x892D; +// public const int GL_REG_13_ATI = 0x892E; +// public const int GL_REG_14_ATI = 0x892F; +// public const int GL_REG_15_ATI = 0x8930; +// public const int GL_REG_16_ATI = 0x8931; +// public const int GL_REG_17_ATI = 0x8932; +// public const int GL_REG_18_ATI = 0x8933; +// public const int GL_REG_19_ATI = 0x8934; +// public const int GL_REG_20_ATI = 0x8935; +// public const int GL_REG_21_ATI = 0x8936; +// public const int GL_REG_22_ATI = 0x8937; +// public const int GL_REG_23_ATI = 0x8938; +// public const int GL_REG_24_ATI = 0x8939; +// public const int GL_REG_25_ATI = 0x893A; +// public const int GL_REG_26_ATI = 0x893B; +// public const int GL_REG_27_ATI = 0x893C; +// public const int GL_REG_28_ATI = 0x893D; +// public const int GL_REG_29_ATI = 0x893E; +// public const int GL_REG_30_ATI = 0x893F; +// public const int GL_REG_31_ATI = 0x8940; +// public const int GL_CON_0_ATI = 0x8941; +// public const int GL_CON_1_ATI = 0x8942; +// public const int GL_CON_2_ATI = 0x8943; +// public const int GL_CON_3_ATI = 0x8944; +// public const int GL_CON_4_ATI = 0x8945; +// public const int GL_CON_5_ATI = 0x8946; +// public const int GL_CON_6_ATI = 0x8947; +// public const int GL_CON_7_ATI = 0x8948; +// public const int GL_CON_8_ATI = 0x8949; +// public const int GL_CON_9_ATI = 0x894A; +// public const int GL_CON_10_ATI = 0x894B; +// public const int GL_CON_11_ATI = 0x894C; +// public const int GL_CON_12_ATI = 0x894D; +// public const int GL_CON_13_ATI = 0x894E; +// public const int GL_CON_14_ATI = 0x894F; +// public const int GL_CON_15_ATI = 0x8950; +// public const int GL_CON_16_ATI = 0x8951; +// public const int GL_CON_17_ATI = 0x8952; +// public const int GL_CON_18_ATI = 0x8953; +// public const int GL_CON_19_ATI = 0x8954; +// public const int GL_CON_20_ATI = 0x8955; +// public const int GL_CON_21_ATI = 0x8956; +// public const int GL_CON_22_ATI = 0x8957; +// public const int GL_CON_23_ATI = 0x8958; +// public const int GL_CON_24_ATI = 0x8959; +// public const int GL_CON_25_ATI = 0x895A; +// public const int GL_CON_26_ATI = 0x895B; +// public const int GL_CON_27_ATI = 0x895C; +// public const int GL_CON_28_ATI = 0x895D; +// public const int GL_CON_29_ATI = 0x895E; +// public const int GL_CON_30_ATI = 0x895F; +// public const int GL_CON_31_ATI = 0x8960; +// public const int GL_MOV_ATI = 0x8961; +// public const int GL_ADD_ATI = 0x8963; +// public const int GL_MUL_ATI = 0x8964; +// public const int GL_SUB_ATI = 0x8965; +// public const int GL_DOT3_ATI = 0x8966; +// public const int GL_DOT4_ATI = 0x8967; +// public const int GL_MAD_ATI = 0x8968; +// public const int GL_LERP_ATI = 0x8969; +// public const int GL_CND_ATI = 0x896A; +// public const int GL_CND0_ATI = 0x896B; +// public const int GL_DOT2_ADD_ATI = 0x896C; +// public const int GL_SECONDARY_INTERPOLATOR_ATI = 0x896D; +// public const int GL_NUM_FRAGMENT_REGISTERS_ATI = 0x896E; +// public const int GL_NUM_FRAGMENT_CONSTANTS_ATI = 0x896F; +// public const int GL_NUM_PASSES_ATI = 0x8970; +// public const int GL_NUM_INSTRUCTIONS_PER_PASS_ATI = 0x8971; +// public const int GL_NUM_INSTRUCTIONS_TOTAL_ATI = 0x8972; +// public const int GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI = 0x8973; +// public const int GL_NUM_LOOPBACK_COMPONENTS_ATI = 0x8974; +// public const int GL_COLOR_ALPHA_PAIRING_ATI = 0x8975; +// public const int GL_SWIZZLE_STR_ATI = 0x8976; +// public const int GL_SWIZZLE_STQ_ATI = 0x8977; +// public const int GL_SWIZZLE_STR_DR_ATI = 0x8978; +// public const int GL_SWIZZLE_STQ_DQ_ATI = 0x8979; +// public const int GL_SWIZZLE_STRQ_ATI = 0x897A; +// public const int GL_SWIZZLE_STRQ_DQ_ATI = 0x897B; +// public const int GL_RED_BIT_ATI = 0x00000001; +// public const int GL_GREEN_BIT_ATI = 0x00000002; +// public const int GL_BLUE_BIT_ATI = 0x00000004; +// public const int GL_2X_BIT_ATI = 0x00000001; +// public const int GL_4X_BIT_ATI = 0x00000002; +// public const int GL_8X_BIT_ATI = 0x00000004; +// public const int GL_HALF_BIT_ATI = 0x00000008; +// public const int GL_QUARTER_BIT_ATI = 0x00000010; +// public const int GL_EIGHTH_BIT_ATI = 0x00000020; +// public const int GL_SATURATE_BIT_ATI = 0x00000040; +// public const int GL_COMP_BIT_ATI = 0x00000002; +// public const int GL_NEGATE_BIT_ATI = 0x00000004; +// public const int GL_BIAS_BIT_ATI = 0x00000008; +// public const int GL_ATI_map_object_buffer = 1; +// public const int GL_ATI_meminfo = 1; +// public const int GL_VBO_FREE_MEMORY_ATI = 0x87FB; +// public const int GL_TEXTURE_FREE_MEMORY_ATI = 0x87FC; +// public const int GL_RENDERBUFFER_FREE_MEMORY_ATI = 0x87FD; +// public const int GL_ATI_pixel_format_float = 1; +// public const int GL_RGBA_FLOAT_MODE_ATI = 0x8820; +// public const int GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI = 0x8835; +// public const int GL_ATI_pn_triangles = 1; +// public const int GL_PN_TRIANGLES_ATI = 0x87F0; +// public const int GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F1; +// public const int GL_PN_TRIANGLES_POINT_MODE_ATI = 0x87F2; +// public const int GL_PN_TRIANGLES_NORMAL_MODE_ATI = 0x87F3; +// public const int GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI = 0x87F4; +// public const int GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI = 0x87F5; +// public const int GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI = 0x87F6; +// public const int GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI = 0x87F7; +// public const int GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI = 0x87F8; +// public const int GL_ATI_separate_stencil = 1; +// public const int GL_STENCIL_BACK_FUNC_ATI = 0x8800; +// public const int GL_STENCIL_BACK_FAIL_ATI = 0x8801; +// public const int GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI = 0x8802; +// public const int GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI = 0x8803; +// public const int GL_ATI_text_fragment_shader = 1; +// public const int GL_TEXT_FRAGMENT_SHADER_ATI = 0x8200; +// public const int GL_ATI_texture_env_combine3 = 1; +// public const int GL_MODULATE_ADD_ATI = 0x8744; +// public const int GL_MODULATE_SIGNED_ADD_ATI = 0x8745; +// public const int GL_MODULATE_SUBTRACT_ATI = 0x8746; +// public const int GL_ATI_texture_float = 1; +// public const int GL_RGBA_FLOAT32_ATI = 0x8814; +// public const int GL_RGB_FLOAT32_ATI = 0x8815; +// public const int GL_ALPHA_FLOAT32_ATI = 0x8816; +// public const int GL_INTENSITY_FLOAT32_ATI = 0x8817; +// public const int GL_LUMINANCE_FLOAT32_ATI = 0x8818; +// public const int GL_LUMINANCE_ALPHA_FLOAT32_ATI = 0x8819; +// public const int GL_RGBA_FLOAT16_ATI = 0x881A; +// public const int GL_RGB_FLOAT16_ATI = 0x881B; +// public const int GL_ALPHA_FLOAT16_ATI = 0x881C; +// public const int GL_INTENSITY_FLOAT16_ATI = 0x881D; +// public const int GL_LUMINANCE_FLOAT16_ATI = 0x881E; +// public const int GL_LUMINANCE_ALPHA_FLOAT16_ATI = 0x881F; +// public const int GL_ATI_texture_mirror_once = 1; +// public const int GL_MIRROR_CLAMP_ATI = 0x8742; +// public const int GL_MIRROR_CLAMP_TO_EDGE_ATI = 0x8743; +// public const int GL_ATI_vertex_array_object = 1; +// public const int GL_STATIC_ATI = 0x8760; +// public const int GL_DYNAMIC_ATI = 0x8761; +// public const int GL_PRESERVE_ATI = 0x8762; +// public const int GL_DISCARD_ATI = 0x8763; +// public const int GL_OBJECT_BUFFER_SIZE_ATI = 0x8764; +// public const int GL_OBJECT_BUFFER_USAGE_ATI = 0x8765; +// public const int GL_ARRAY_OBJECT_BUFFER_ATI = 0x8766; +// public const int GL_ARRAY_OBJECT_OFFSET_ATI = 0x8767; +// public const int GL_ATI_vertex_attrib_array_object = 1; +// public const int GL_ATI_vertex_streams = 1; +// public const int GL_MAX_VERTEX_STREAMS_ATI = 0x876B; +// public const int GL_VERTEX_STREAM0_ATI = 0x876C; +// public const int GL_VERTEX_STREAM1_ATI = 0x876D; +// public const int GL_VERTEX_STREAM2_ATI = 0x876E; +// public const int GL_VERTEX_STREAM3_ATI = 0x876F; +// public const int GL_VERTEX_STREAM4_ATI = 0x8770; +// public const int GL_VERTEX_STREAM5_ATI = 0x8771; +// public const int GL_VERTEX_STREAM6_ATI = 0x8772; +// public const int GL_VERTEX_STREAM7_ATI = 0x8773; +// public const int GL_VERTEX_SOURCE_ATI = 0x8774; +// public const int GL_EXT_422_pixels = 1; +// public const int GL_422_EXT = 0x80CC; +// public const int GL_422_REV_EXT = 0x80CD; +// public const int GL_422_AVERAGE_EXT = 0x80CE; +// public const int GL_422_REV_AVERAGE_EXT = 0x80CF; +// public const int GL_EXT_EGL_image_storage = 1; +// public const int GL_EXT_abgr = 1; +// public const int GL_ABGR_EXT = 0x8000; +// public const int GL_EXT_bgra = 1; +// public const int GL_BGR_EXT = 0x80E0; +// public const int GL_BGRA_EXT = 0x80E1; +// public const int GL_EXT_bindable_uniform = 1; +// public const int GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT = 0x8DE2; +// public const int GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT = 0x8DE3; +// public const int GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT = 0x8DE4; +// public const int GL_MAX_BINDABLE_UNIFORM_SIZE_EXT = 0x8DED; +// public const int GL_UNIFORM_BUFFER_EXT = 0x8DEE; +// public const int GL_UNIFORM_BUFFER_BINDING_EXT = 0x8DEF; +// public const int GL_EXT_blend_color = 1; +// public const int GL_CONSTANT_COLOR_EXT = 0x8001; +// public const int GL_ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002; +// public const int GL_CONSTANT_ALPHA_EXT = 0x8003; +// public const int GL_ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004; +// public const int GL_BLEND_COLOR_EXT = 0x8005; +// public const int GL_EXT_blend_equation_separate = 1; +// public const int GL_BLEND_EQUATION_RGB_EXT = 0x8009; +// public const int GL_BLEND_EQUATION_ALPHA_EXT = 0x883D; +// public const int GL_EXT_blend_func_separate = 1; +// public const int GL_BLEND_DST_RGB_EXT = 0x80C8; +// public const int GL_BLEND_SRC_RGB_EXT = 0x80C9; +// public const int GL_BLEND_DST_ALPHA_EXT = 0x80CA; +// public const int GL_BLEND_SRC_ALPHA_EXT = 0x80CB; +// public const int GL_EXT_blend_logic_op = 1; +// public const int GL_EXT_blend_minmax = 1; +// public const int GL_MIN_EXT = 0x8007; +// public const int GL_MAX_EXT = 0x8008; +// public const int GL_FUNC_ADD_EXT = 0x8006; +// public const int GL_BLEND_EQUATION_EXT = 0x8009; +// public const int GL_EXT_blend_subtract = 1; +// public const int GL_FUNC_SUBTRACT_EXT = 0x800A; +// public const int GL_FUNC_REVERSE_SUBTRACT_EXT = 0x800B; +// public const int GL_EXT_clip_volume_hint = 1; +// public const int GL_CLIP_VOLUME_CLIPPING_HINT_EXT = 0x80F0; +// public const int GL_EXT_cmyka = 1; +// public const int GL_CMYK_EXT = 0x800C; +// public const int GL_CMYKA_EXT = 0x800D; +// public const int GL_PACK_CMYK_HINT_EXT = 0x800E; +// public const int GL_UNPACK_CMYK_HINT_EXT = 0x800F; +// public const int GL_EXT_color_subtable = 1; +// public const int GL_EXT_compiled_vertex_array = 1; +// public const int GL_ARRAY_ELEMENT_LOCK_FIRST_EXT = 0x81A8; +// public const int GL_ARRAY_ELEMENT_LOCK_COUNT_EXT = 0x81A9; +// public const int GL_EXT_convolution = 1; +// public const int GL_CONVOLUTION_1D_EXT = 0x8010; +// public const int GL_CONVOLUTION_2D_EXT = 0x8011; +// public const int GL_SEPARABLE_2D_EXT = 0x8012; +// public const int GL_CONVOLUTION_BORDER_MODE_EXT = 0x8013; +// public const int GL_CONVOLUTION_FILTER_SCALE_EXT = 0x8014; +// public const int GL_CONVOLUTION_FILTER_BIAS_EXT = 0x8015; +// public const int GL_REDUCE_EXT = 0x8016; +// public const int GL_CONVOLUTION_FORMAT_EXT = 0x8017; +// public const int GL_CONVOLUTION_WIDTH_EXT = 0x8018; +// public const int GL_CONVOLUTION_HEIGHT_EXT = 0x8019; +// public const int GL_MAX_CONVOLUTION_WIDTH_EXT = 0x801A; +// public const int GL_MAX_CONVOLUTION_HEIGHT_EXT = 0x801B; +// public const int GL_POST_CONVOLUTION_RED_SCALE_EXT = 0x801C; +// public const int GL_POST_CONVOLUTION_GREEN_SCALE_EXT = 0x801D; +// public const int GL_POST_CONVOLUTION_BLUE_SCALE_EXT = 0x801E; +// public const int GL_POST_CONVOLUTION_ALPHA_SCALE_EXT = 0x801F; +// public const int GL_POST_CONVOLUTION_RED_BIAS_EXT = 0x8020; +// public const int GL_POST_CONVOLUTION_GREEN_BIAS_EXT = 0x8021; +// public const int GL_POST_CONVOLUTION_BLUE_BIAS_EXT = 0x8022; +// public const int GL_POST_CONVOLUTION_ALPHA_BIAS_EXT = 0x8023; +// public const int GL_EXT_coordinate_frame = 1; +// public const int GL_TANGENT_ARRAY_EXT = 0x8439; +// public const int GL_BINORMAL_ARRAY_EXT = 0x843A; +// public const int GL_CURRENT_TANGENT_EXT = 0x843B; +// public const int GL_CURRENT_BINORMAL_EXT = 0x843C; +// public const int GL_TANGENT_ARRAY_TYPE_EXT = 0x843E; +// public const int GL_TANGENT_ARRAY_STRIDE_EXT = 0x843F; +// public const int GL_BINORMAL_ARRAY_TYPE_EXT = 0x8440; +// public const int GL_BINORMAL_ARRAY_STRIDE_EXT = 0x8441; +// public const int GL_TANGENT_ARRAY_POINTER_EXT = 0x8442; +// public const int GL_BINORMAL_ARRAY_POINTER_EXT = 0x8443; +// public const int GL_MAP1_TANGENT_EXT = 0x8444; +// public const int GL_MAP2_TANGENT_EXT = 0x8445; +// public const int GL_MAP1_BINORMAL_EXT = 0x8446; +// public const int GL_MAP2_BINORMAL_EXT = 0x8447; +// public const int GL_EXT_copy_texture = 1; +// public const int GL_EXT_cull_vertex = 1; +// public const int GL_CULL_VERTEX_EXT = 0x81AA; +// public const int GL_CULL_VERTEX_EYE_POSITION_EXT = 0x81AB; +// public const int GL_CULL_VERTEX_OBJECT_POSITION_EXT = 0x81AC; +// public const int GL_EXT_debug_label = 1; +// public const int GL_PROGRAM_PIPELINE_OBJECT_EXT = 0x8A4F; +// public const int GL_PROGRAM_OBJECT_EXT = 0x8B40; +// public const int GL_SHADER_OBJECT_EXT = 0x8B48; +// public const int GL_BUFFER_OBJECT_EXT = 0x9151; +// public const int GL_QUERY_OBJECT_EXT = 0x9153; +// public const int GL_VERTEX_ARRAY_OBJECT_EXT = 0x9154; +// public const int GL_EXT_debug_marker = 1; +// public const int GL_EXT_depth_bounds_test = 1; +// public const int GL_DEPTH_BOUNDS_TEST_EXT = 0x8890; +// public const int GL_DEPTH_BOUNDS_EXT = 0x8891; +// public const int GL_EXT_direct_state_access = 1; +// public const int GL_PROGRAM_MATRIX_EXT = 0x8E2D; +// public const int GL_TRANSPOSE_PROGRAM_MATRIX_EXT = 0x8E2E; +// public const int GL_PROGRAM_MATRIX_STACK_DEPTH_EXT = 0x8E2F; +// public const int GL_EXT_draw_buffers2 = 1; +// public const int GL_EXT_draw_instanced = 1; +// public const int GL_EXT_draw_range_elements = 1; +// public const int GL_MAX_ELEMENTS_VERTICES_EXT = 0x80E8; +// public const int GL_MAX_ELEMENTS_INDICES_EXT = 0x80E9; +// public const int GL_EXT_external_buffer = 1; +// public const int GL_EXT_fog_coord = 1; +// public const int GL_FOG_COORDINATE_SOURCE_EXT = 0x8450; +// public const int GL_FOG_COORDINATE_EXT = 0x8451; +// public const int GL_FRAGMENT_DEPTH_EXT = 0x8452; +// public const int GL_CURRENT_FOG_COORDINATE_EXT = 0x8453; +// public const int GL_FOG_COORDINATE_ARRAY_TYPE_EXT = 0x8454; +// public const int GL_FOG_COORDINATE_ARRAY_STRIDE_EXT = 0x8455; +// public const int GL_FOG_COORDINATE_ARRAY_POINTER_EXT = 0x8456; +// public const int GL_FOG_COORDINATE_ARRAY_EXT = 0x8457; +// public const int GL_EXT_framebuffer_blit = 1; +// public const int GL_READ_FRAMEBUFFER_EXT = 0x8CA8; +// public const int GL_DRAW_FRAMEBUFFER_EXT = 0x8CA9; +// public const int GL_DRAW_FRAMEBUFFER_BINDING_EXT = 0x8CA6; +// public const int GL_READ_FRAMEBUFFER_BINDING_EXT = 0x8CAA; +// public const int GL_EXT_framebuffer_multisample = 1; +// public const int GL_RENDERBUFFER_SAMPLES_EXT = 0x8CAB; +// public const int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT = 0x8D56; +// public const int GL_MAX_SAMPLES_EXT = 0x8D57; +// public const int GL_EXT_framebuffer_multisample_blit_scaled = 1; +// public const int GL_SCALED_RESOLVE_FASTEST_EXT = 0x90BA; +// public const int GL_SCALED_RESOLVE_NICEST_EXT = 0x90BB; +// public const int GL_EXT_framebuffer_object = 1; +// public const int GL_INVALID_FRAMEBUFFER_OPERATION_EXT = 0x0506; +// public const int GL_MAX_RENDERBUFFER_SIZE_EXT = 0x84E8; +// public const int GL_FRAMEBUFFER_BINDING_EXT = 0x8CA6; +// public const int GL_RENDERBUFFER_BINDING_EXT = 0x8CA7; +// public const int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT = 0x8CD0; +// public const int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT = 0x8CD1; +// public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT = 0x8CD2; +// public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT = 0x8CD3; +// public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT = 0x8CD4; +// public const int GL_FRAMEBUFFER_COMPLETE_EXT = 0x8CD5; +// public const int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT = 0x8CD6; +// public const int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT = 0x8CD7; +// public const int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT = 0x8CD9; +// public const int GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT = 0x8CDA; +// public const int GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT = 0x8CDB; +// public const int GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT = 0x8CDC; +// public const int GL_FRAMEBUFFER_UNSUPPORTED_EXT = 0x8CDD; +// public const int GL_MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF; +// public const int GL_COLOR_ATTACHMENT0_EXT = 0x8CE0; +// public const int GL_COLOR_ATTACHMENT1_EXT = 0x8CE1; +// public const int GL_COLOR_ATTACHMENT2_EXT = 0x8CE2; +// public const int GL_COLOR_ATTACHMENT3_EXT = 0x8CE3; +// public const int GL_COLOR_ATTACHMENT4_EXT = 0x8CE4; +// public const int GL_COLOR_ATTACHMENT5_EXT = 0x8CE5; +// public const int GL_COLOR_ATTACHMENT6_EXT = 0x8CE6; +// public const int GL_COLOR_ATTACHMENT7_EXT = 0x8CE7; +// public const int GL_COLOR_ATTACHMENT8_EXT = 0x8CE8; +// public const int GL_COLOR_ATTACHMENT9_EXT = 0x8CE9; +// public const int GL_COLOR_ATTACHMENT10_EXT = 0x8CEA; +// public const int GL_COLOR_ATTACHMENT11_EXT = 0x8CEB; +// public const int GL_COLOR_ATTACHMENT12_EXT = 0x8CEC; +// public const int GL_COLOR_ATTACHMENT13_EXT = 0x8CED; +// public const int GL_COLOR_ATTACHMENT14_EXT = 0x8CEE; +// public const int GL_COLOR_ATTACHMENT15_EXT = 0x8CEF; +// public const int GL_DEPTH_ATTACHMENT_EXT = 0x8D00; +// public const int GL_STENCIL_ATTACHMENT_EXT = 0x8D20; +// public const int GL_FRAMEBUFFER_EXT = 0x8D40; +// public const int GL_RENDERBUFFER_EXT = 0x8D41; +// public const int GL_RENDERBUFFER_WIDTH_EXT = 0x8D42; +// public const int GL_RENDERBUFFER_HEIGHT_EXT = 0x8D43; +// public const int GL_RENDERBUFFER_INTERNAL_FORMAT_EXT = 0x8D44; +// public const int GL_STENCIL_INDEX1_EXT = 0x8D46; +// public const int GL_STENCIL_INDEX4_EXT = 0x8D47; +// public const int GL_STENCIL_INDEX8_EXT = 0x8D48; +// public const int GL_STENCIL_INDEX16_EXT = 0x8D49; +// public const int GL_RENDERBUFFER_RED_SIZE_EXT = 0x8D50; +// public const int GL_RENDERBUFFER_GREEN_SIZE_EXT = 0x8D51; +// public const int GL_RENDERBUFFER_BLUE_SIZE_EXT = 0x8D52; +// public const int GL_RENDERBUFFER_ALPHA_SIZE_EXT = 0x8D53; +// public const int GL_RENDERBUFFER_DEPTH_SIZE_EXT = 0x8D54; +// public const int GL_RENDERBUFFER_STENCIL_SIZE_EXT = 0x8D55; +// public const int GL_EXT_framebuffer_sRGB = 1; +// public const int GL_FRAMEBUFFER_SRGB_EXT = 0x8DB9; +// public const int GL_FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x8DBA; +// public const int GL_EXT_geometry_shader4 = 1; +// public const int GL_GEOMETRY_SHADER_EXT = 0x8DD9; +// public const int GL_GEOMETRY_VERTICES_OUT_EXT = 0x8DDA; +// public const int GL_GEOMETRY_INPUT_TYPE_EXT = 0x8DDB; +// public const int GL_GEOMETRY_OUTPUT_TYPE_EXT = 0x8DDC; +// public const int GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT = 0x8C29; +// public const int GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT = 0x8DDD; +// public const int GL_MAX_VERTEX_VARYING_COMPONENTS_EXT = 0x8DDE; +// public const int GL_MAX_VARYING_COMPONENTS_EXT = 0x8B4B; +// public const int GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT = 0x8DDF; +// public const int GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT = 0x8DE0; +// public const int GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT = 0x8DE1; +// public const int GL_LINES_ADJACENCY_EXT = 0x000A; +// public const int GL_LINE_STRIP_ADJACENCY_EXT = 0x000B; +// public const int GL_TRIANGLES_ADJACENCY_EXT = 0x000C; +// public const int GL_TRIANGLE_STRIP_ADJACENCY_EXT = 0x000D; +// public const int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT = 0x8DA8; +// public const int GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT = 0x8DA9; +// public const int GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT = 0x8DA7; +// public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT = 0x8CD4; +// public const int GL_PROGRAM_POINT_SIZE_EXT = 0x8642; +// public const int GL_EXT_gpu_program_parameters = 1; +// public const int GL_EXT_gpu_shader4 = 1; +// public const int GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT = 0x88FD; +// public const int GL_SAMPLER_1D_ARRAY_EXT = 0x8DC0; +// public const int GL_SAMPLER_2D_ARRAY_EXT = 0x8DC1; +// public const int GL_SAMPLER_BUFFER_EXT = 0x8DC2; +// public const int GL_SAMPLER_1D_ARRAY_SHADOW_EXT = 0x8DC3; +// public const int GL_SAMPLER_2D_ARRAY_SHADOW_EXT = 0x8DC4; +// public const int GL_SAMPLER_CUBE_SHADOW_EXT = 0x8DC5; +// public const int GL_UNSIGNED_INT_VEC2_EXT = 0x8DC6; +// public const int GL_UNSIGNED_INT_VEC3_EXT = 0x8DC7; +// public const int GL_UNSIGNED_INT_VEC4_EXT = 0x8DC8; +// public const int GL_INT_SAMPLER_1D_EXT = 0x8DC9; +// public const int GL_INT_SAMPLER_2D_EXT = 0x8DCA; +// public const int GL_INT_SAMPLER_3D_EXT = 0x8DCB; +// public const int GL_INT_SAMPLER_CUBE_EXT = 0x8DCC; +// public const int GL_INT_SAMPLER_2D_RECT_EXT = 0x8DCD; +// public const int GL_INT_SAMPLER_1D_ARRAY_EXT = 0x8DCE; +// public const int GL_INT_SAMPLER_2D_ARRAY_EXT = 0x8DCF; +// public const int GL_INT_SAMPLER_BUFFER_EXT = 0x8DD0; +// public const int GL_UNSIGNED_INT_SAMPLER_1D_EXT = 0x8DD1; +// public const int GL_UNSIGNED_INT_SAMPLER_2D_EXT = 0x8DD2; +// public const int GL_UNSIGNED_INT_SAMPLER_3D_EXT = 0x8DD3; +// public const int GL_UNSIGNED_INT_SAMPLER_CUBE_EXT = 0x8DD4; +// public const int GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT = 0x8DD5; +// public const int GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT = 0x8DD6; +// public const int GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT = 0x8DD7; +// public const int GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT = 0x8DD8; +// public const int GL_MIN_PROGRAM_TEXEL_OFFSET_EXT = 0x8904; +// public const int GL_MAX_PROGRAM_TEXEL_OFFSET_EXT = 0x8905; +// public const int GL_EXT_histogram = 1; +// public const int GL_HISTOGRAM_EXT = 0x8024; +// public const int GL_PROXY_HISTOGRAM_EXT = 0x8025; +// public const int GL_HISTOGRAM_WIDTH_EXT = 0x8026; +// public const int GL_HISTOGRAM_FORMAT_EXT = 0x8027; +// public const int GL_HISTOGRAM_RED_SIZE_EXT = 0x8028; +// public const int GL_HISTOGRAM_GREEN_SIZE_EXT = 0x8029; +// public const int GL_HISTOGRAM_BLUE_SIZE_EXT = 0x802A; +// public const int GL_HISTOGRAM_ALPHA_SIZE_EXT = 0x802B; +// public const int GL_HISTOGRAM_LUMINANCE_SIZE_EXT = 0x802C; +// public const int GL_HISTOGRAM_SINK_EXT = 0x802D; +// public const int GL_MINMAX_EXT = 0x802E; +// public const int GL_MINMAX_FORMAT_EXT = 0x802F; +// public const int GL_MINMAX_SINK_EXT = 0x8030; +// public const int GL_TABLE_TOO_LARGE_EXT = 0x8031; +// public const int GL_EXT_index_array_formats = 1; +// public const int GL_IUI_V2F_EXT = 0x81AD; +// public const int GL_IUI_V3F_EXT = 0x81AE; +// public const int GL_IUI_N3F_V2F_EXT = 0x81AF; +// public const int GL_IUI_N3F_V3F_EXT = 0x81B0; +// public const int GL_T2F_IUI_V2F_EXT = 0x81B1; +// public const int GL_T2F_IUI_V3F_EXT = 0x81B2; +// public const int GL_T2F_IUI_N3F_V2F_EXT = 0x81B3; +// public const int GL_T2F_IUI_N3F_V3F_EXT = 0x81B4; +// public const int GL_EXT_index_func = 1; +// public const int GL_INDEX_TEST_EXT = 0x81B5; +// public const int GL_INDEX_TEST_FUNC_EXT = 0x81B6; +// public const int GL_INDEX_TEST_REF_EXT = 0x81B7; +// public const int GL_EXT_index_material = 1; +// public const int GL_INDEX_MATERIAL_EXT = 0x81B8; +// public const int GL_INDEX_MATERIAL_PARAMETER_EXT = 0x81B9; +// public const int GL_INDEX_MATERIAL_FACE_EXT = 0x81BA; +// public const int GL_EXT_index_texture = 1; +// public const int GL_EXT_light_texture = 1; +// public const int GL_FRAGMENT_MATERIAL_EXT = 0x8349; +// public const int GL_FRAGMENT_NORMAL_EXT = 0x834A; +// public const int GL_FRAGMENT_COLOR_EXT = 0x834C; +// public const int GL_ATTENUATION_EXT = 0x834D; +// public const int GL_SHADOW_ATTENUATION_EXT = 0x834E; +// public const int GL_TEXTURE_APPLICATION_MODE_EXT = 0x834F; +// public const int GL_TEXTURE_LIGHT_EXT = 0x8350; +// public const int GL_TEXTURE_MATERIAL_FACE_EXT = 0x8351; +// public const int GL_TEXTURE_MATERIAL_PARAMETER_EXT = 0x8352; +// public const int GL_EXT_memory_object = 1; +// public const int GL_TEXTURE_TILING_EXT = 0x9580; +// public const int GL_DEDICATED_MEMORY_OBJECT_EXT = 0x9581; +// public const int GL_PROTECTED_MEMORY_OBJECT_EXT = 0x959B; +// public const int GL_NUM_TILING_TYPES_EXT = 0x9582; +// public const int GL_TILING_TYPES_EXT = 0x9583; +// public const int GL_OPTIMAL_TILING_EXT = 0x9584; +// public const int GL_LINEAR_TILING_EXT = 0x9585; +// public const int GL_NUM_DEVICE_UUIDS_EXT = 0x9596; +// public const int GL_DEVICE_UUID_EXT = 0x9597; +// public const int GL_DRIVER_UUID_EXT = 0x9598; +// public const int GL_UUID_SIZE_EXT = 16; +// public const int GL_EXT_memory_object_fd = 1; +// public const int GL_HANDLE_TYPE_OPAQUE_FD_EXT = 0x9586; +// public const int GL_EXT_memory_object_win32 = 1; +// public const int GL_HANDLE_TYPE_OPAQUE_WIN32_EXT = 0x9587; +// public const int GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT = 0x9588; +// public const int GL_DEVICE_LUID_EXT = 0x9599; +// public const int GL_DEVICE_NODE_MASK_EXT = 0x959A; +// public const int GL_LUID_SIZE_EXT = 8; +// public const int GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT = 0x9589; +// public const int GL_HANDLE_TYPE_D3D12_RESOURCE_EXT = 0x958A; +// public const int GL_HANDLE_TYPE_D3D11_IMAGE_EXT = 0x958B; +// public const int GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT = 0x958C; +// public const int GL_EXT_misc_attribute = 1; +// public const int GL_EXT_multi_draw_arrays = 1; +// public const int GL_EXT_multisample = 1; +// public const int GL_MULTISAMPLE_EXT = 0x809D; +// public const int GL_SAMPLE_ALPHA_TO_MASK_EXT = 0x809E; +// public const int GL_SAMPLE_ALPHA_TO_ONE_EXT = 0x809F; +// public const int GL_SAMPLE_MASK_EXT = 0x80A0; +// public const int GL_1PASS_EXT = 0x80A1; +// public const int GL_2PASS_0_EXT = 0x80A2; +// public const int GL_2PASS_1_EXT = 0x80A3; +// public const int GL_4PASS_0_EXT = 0x80A4; +// public const int GL_4PASS_1_EXT = 0x80A5; +// public const int GL_4PASS_2_EXT = 0x80A6; +// public const int GL_4PASS_3_EXT = 0x80A7; +// public const int GL_SAMPLE_BUFFERS_EXT = 0x80A8; +// public const int GL_SAMPLES_EXT = 0x80A9; +// public const int GL_SAMPLE_MASK_VALUE_EXT = 0x80AA; +// public const int GL_SAMPLE_MASK_INVERT_EXT = 0x80AB; +// public const int GL_SAMPLE_PATTERN_EXT = 0x80AC; +// public const int GL_MULTISAMPLE_BIT_EXT = 0x20000000; +// public const int GL_EXT_packed_depth_stencil = 1; +// public const int GL_DEPTH_STENCIL_EXT = 0x84F9; +// public const int GL_UNSIGNED_INT_24_8_EXT = 0x84FA; +// public const int GL_DEPTH24_STENCIL8_EXT = 0x88F0; +// public const int GL_TEXTURE_STENCIL_SIZE_EXT = 0x88F1; +// public const int GL_EXT_packed_float = 1; +// public const int GL_R11F_G11F_B10F_EXT = 0x8C3A; +// public const int GL_UNSIGNED_INT_10F_11F_11F_REV_EXT = 0x8C3B; +// public const int GL_RGBA_SIGNED_COMPONENTS_EXT = 0x8C3C; +// public const int GL_EXT_packed_pixels = 1; +// public const int GL_UNSIGNED_BYTE_3_3_2_EXT = 0x8032; +// public const int GL_UNSIGNED_SHORT_4_4_4_4_EXT = 0x8033; +// public const int GL_UNSIGNED_SHORT_5_5_5_1_EXT = 0x8034; +// public const int GL_UNSIGNED_INT_8_8_8_8_EXT = 0x8035; +// public const int GL_UNSIGNED_INT_10_10_10_2_EXT = 0x8036; +// public const int GL_EXT_paletted_texture = 1; +// public const int GL_COLOR_INDEX1_EXT = 0x80E2; +// public const int GL_COLOR_INDEX2_EXT = 0x80E3; +// public const int GL_COLOR_INDEX4_EXT = 0x80E4; +// public const int GL_COLOR_INDEX8_EXT = 0x80E5; +// public const int GL_COLOR_INDEX12_EXT = 0x80E6; +// public const int GL_COLOR_INDEX16_EXT = 0x80E7; +// public const int GL_TEXTURE_INDEX_SIZE_EXT = 0x80ED; +// public const int GL_EXT_pixel_buffer_object = 1; +// public const int GL_PIXEL_PACK_BUFFER_EXT = 0x88EB; +// public const int GL_PIXEL_UNPACK_BUFFER_EXT = 0x88EC; +// public const int GL_PIXEL_PACK_BUFFER_BINDING_EXT = 0x88ED; +// public const int GL_PIXEL_UNPACK_BUFFER_BINDING_EXT = 0x88EF; +// public const int GL_EXT_pixel_transform = 1; +// public const int GL_PIXEL_TRANSFORM_2D_EXT = 0x8330; +// public const int GL_PIXEL_MAG_FILTER_EXT = 0x8331; +// public const int GL_PIXEL_MIN_FILTER_EXT = 0x8332; +// public const int GL_PIXEL_CUBIC_WEIGHT_EXT = 0x8333; +// public const int GL_CUBIC_EXT = 0x8334; +// public const int GL_AVERAGE_EXT = 0x8335; +// public const int GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8336; +// public const int GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT = 0x8337; +// public const int GL_PIXEL_TRANSFORM_2D_MATRIX_EXT = 0x8338; +// public const int GL_EXT_pixel_transform_color_table = 1; +// public const int GL_EXT_point_parameters = 1; +// public const int GL_POINT_SIZE_MIN_EXT = 0x8126; +// public const int GL_POINT_SIZE_MAX_EXT = 0x8127; +// public const int GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128; +// public const int GL_DISTANCE_ATTENUATION_EXT = 0x8129; +// public const int GL_EXT_polygon_offset = 1; +// public const int GL_POLYGON_OFFSET_EXT = 0x8037; +// public const int GL_POLYGON_OFFSET_FACTOR_EXT = 0x8038; +// public const int GL_POLYGON_OFFSET_BIAS_EXT = 0x8039; +// public const int GL_EXT_polygon_offset_clamp = 1; +// public const int GL_POLYGON_OFFSET_CLAMP_EXT = 0x8E1B; +// public const int GL_EXT_post_depth_coverage = 1; +// public const int GL_EXT_provoking_vertex = 1; +// public const int GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT = 0x8E4C; +// public const int GL_FIRST_VERTEX_CONVENTION_EXT = 0x8E4D; +// public const int GL_LAST_VERTEX_CONVENTION_EXT = 0x8E4E; +// public const int GL_PROVOKING_VERTEX_EXT = 0x8E4F; +// public const int GL_EXT_raster_multisample = 1; +// public const int GL_RASTER_MULTISAMPLE_EXT = 0x9327; +// public const int GL_RASTER_SAMPLES_EXT = 0x9328; +// public const int GL_MAX_RASTER_SAMPLES_EXT = 0x9329; +// public const int GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT = 0x932A; +// public const int GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT = 0x932B; +// public const int GL_EFFECTIVE_RASTER_SAMPLES_EXT = 0x932C; +// public const int GL_EXT_rescale_normal = 1; +// public const int GL_RESCALE_NORMAL_EXT = 0x803A; +// public const int GL_EXT_secondary_color = 1; +// public const int GL_COLOR_SUM_EXT = 0x8458; +// public const int GL_CURRENT_SECONDARY_COLOR_EXT = 0x8459; +// public const int GL_SECONDARY_COLOR_ARRAY_SIZE_EXT = 0x845A; +// public const int GL_SECONDARY_COLOR_ARRAY_TYPE_EXT = 0x845B; +// public const int GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT = 0x845C; +// public const int GL_SECONDARY_COLOR_ARRAY_POINTER_EXT = 0x845D; +// public const int GL_SECONDARY_COLOR_ARRAY_EXT = 0x845E; +// public const int GL_EXT_semaphore = 1; +// public const int GL_LAYOUT_GENERAL_EXT = 0x958D; +// public const int GL_LAYOUT_COLOR_ATTACHMENT_EXT = 0x958E; +// public const int GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT = 0x958F; +// public const int GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT = 0x9590; +// public const int GL_LAYOUT_SHADER_READ_ONLY_EXT = 0x9591; +// public const int GL_LAYOUT_TRANSFER_SRC_EXT = 0x9592; +// public const int GL_LAYOUT_TRANSFER_DST_EXT = 0x9593; +// public const int GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT = 0x9530; +// public const int GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT = 0x9531; +// public const int GL_EXT_semaphore_fd = 1; +// public const int GL_EXT_semaphore_win32 = 1; +// public const int GL_HANDLE_TYPE_D3D12_FENCE_EXT = 0x9594; +// public const int GL_D3D12_FENCE_VALUE_EXT = 0x9595; +// public const int GL_EXT_separate_shader_objects = 1; +// public const int GL_ACTIVE_PROGRAM_EXT = 0x8B8D; +// public const int GL_EXT_separate_specular_color = 1; +// public const int GL_LIGHT_MODEL_COLOR_CONTROL_EXT = 0x81F8; +// public const int GL_SINGLE_COLOR_EXT = 0x81F9; +// public const int GL_SEPARATE_SPECULAR_COLOR_EXT = 0x81FA; +// public const int GL_EXT_shader_framebuffer_fetch = 1; +// public const int GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT = 0x8A52; +// public const int GL_EXT_shader_framebuffer_fetch_non_coherent = 1; +// public const int GL_EXT_shader_image_load_formatted = 1; +// public const int GL_EXT_shader_image_load_store = 1; +// public const int GL_MAX_IMAGE_UNITS_EXT = 0x8F38; +// public const int GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT = 0x8F39; +// public const int GL_IMAGE_BINDING_NAME_EXT = 0x8F3A; +// public const int GL_IMAGE_BINDING_LEVEL_EXT = 0x8F3B; +// public const int GL_IMAGE_BINDING_LAYERED_EXT = 0x8F3C; +// public const int GL_IMAGE_BINDING_LAYER_EXT = 0x8F3D; +// public const int GL_IMAGE_BINDING_ACCESS_EXT = 0x8F3E; +// public const int GL_IMAGE_1D_EXT = 0x904C; +// public const int GL_IMAGE_2D_EXT = 0x904D; +// public const int GL_IMAGE_3D_EXT = 0x904E; +// public const int GL_IMAGE_2D_RECT_EXT = 0x904F; +// public const int GL_IMAGE_CUBE_EXT = 0x9050; +// public const int GL_IMAGE_BUFFER_EXT = 0x9051; +// public const int GL_IMAGE_1D_ARRAY_EXT = 0x9052; +// public const int GL_IMAGE_2D_ARRAY_EXT = 0x9053; +// public const int GL_IMAGE_CUBE_MAP_ARRAY_EXT = 0x9054; +// public const int GL_IMAGE_2D_MULTISAMPLE_EXT = 0x9055; +// public const int GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9056; +// public const int GL_INT_IMAGE_1D_EXT = 0x9057; +// public const int GL_INT_IMAGE_2D_EXT = 0x9058; +// public const int GL_INT_IMAGE_3D_EXT = 0x9059; +// public const int GL_INT_IMAGE_2D_RECT_EXT = 0x905A; +// public const int GL_INT_IMAGE_CUBE_EXT = 0x905B; +// public const int GL_INT_IMAGE_BUFFER_EXT = 0x905C; +// public const int GL_INT_IMAGE_1D_ARRAY_EXT = 0x905D; +// public const int GL_INT_IMAGE_2D_ARRAY_EXT = 0x905E; +// public const int GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x905F; +// public const int GL_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x9060; +// public const int GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9061; +// public const int GL_UNSIGNED_INT_IMAGE_1D_EXT = 0x9062; +// public const int GL_UNSIGNED_INT_IMAGE_2D_EXT = 0x9063; +// public const int GL_UNSIGNED_INT_IMAGE_3D_EXT = 0x9064; +// public const int GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT = 0x9065; +// public const int GL_UNSIGNED_INT_IMAGE_CUBE_EXT = 0x9066; +// public const int GL_UNSIGNED_INT_IMAGE_BUFFER_EXT = 0x9067; +// public const int GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT = 0x9068; +// public const int GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT = 0x9069; +// public const int GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x906A; +// public const int GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x906B; +// public const int GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x906C; +// public const int GL_MAX_IMAGE_SAMPLES_EXT = 0x906D; +// public const int GL_IMAGE_BINDING_FORMAT_EXT = 0x906E; +// public const int GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT = 0x00000001; +// public const int GL_ELEMENT_ARRAY_BARRIER_BIT_EXT = 0x00000002; +// public const int GL_UNIFORM_BARRIER_BIT_EXT = 0x00000004; +// public const int GL_TEXTURE_FETCH_BARRIER_BIT_EXT = 0x00000008; +// public const int GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT = 0x00000020; +// public const int GL_COMMAND_BARRIER_BIT_EXT = 0x00000040; +// public const int GL_PIXEL_BUFFER_BARRIER_BIT_EXT = 0x00000080; +// public const int GL_TEXTURE_UPDATE_BARRIER_BIT_EXT = 0x00000100; +// public const int GL_BUFFER_UPDATE_BARRIER_BIT_EXT = 0x00000200; +// public const int GL_FRAMEBUFFER_BARRIER_BIT_EXT = 0x00000400; +// public const int GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT = 0x00000800; +// public const int GL_ATOMIC_COUNTER_BARRIER_BIT_EXT = 0x00001000; +// public const int GL_ALL_BARRIER_BITS_EXT = -1; +// public const int GL_EXT_shader_integer_mix = 1; +// public const int GL_EXT_shadow_funcs = 1; +// public const int GL_EXT_shared_texture_palette = 1; +// public const int GL_SHARED_TEXTURE_PALETTE_EXT = 0x81FB; +// public const int GL_EXT_sparse_texture2 = 1; +// public const int GL_EXT_stencil_clear_tag = 1; +// public const int GL_STENCIL_TAG_BITS_EXT = 0x88F2; +// public const int GL_STENCIL_CLEAR_TAG_VALUE_EXT = 0x88F3; +// public const int GL_EXT_stencil_two_side = 1; +// public const int GL_STENCIL_TEST_TWO_SIDE_EXT = 0x8910; +// public const int GL_ACTIVE_STENCIL_FACE_EXT = 0x8911; +// public const int GL_EXT_stencil_wrap = 1; +// public const int GL_INCR_WRAP_EXT = 0x8507; +// public const int GL_DECR_WRAP_EXT = 0x8508; +// public const int GL_EXT_subtexture = 1; +// public const int GL_EXT_texture = 1; +// public const int GL_ALPHA4_EXT = 0x803B; +// public const int GL_ALPHA8_EXT = 0x803C; +// public const int GL_ALPHA12_EXT = 0x803D; +// public const int GL_ALPHA16_EXT = 0x803E; +// public const int GL_LUMINANCE4_EXT = 0x803F; +// public const int GL_LUMINANCE8_EXT = 0x8040; +// public const int GL_LUMINANCE12_EXT = 0x8041; +// public const int GL_LUMINANCE16_EXT = 0x8042; +// public const int GL_LUMINANCE4_ALPHA4_EXT = 0x8043; +// public const int GL_LUMINANCE6_ALPHA2_EXT = 0x8044; +// public const int GL_LUMINANCE8_ALPHA8_EXT = 0x8045; +// public const int GL_LUMINANCE12_ALPHA4_EXT = 0x8046; +// public const int GL_LUMINANCE12_ALPHA12_EXT = 0x8047; +// public const int GL_LUMINANCE16_ALPHA16_EXT = 0x8048; +// public const int GL_INTENSITY_EXT = 0x8049; +// public const int GL_INTENSITY4_EXT = 0x804A; +// public const int GL_INTENSITY8_EXT = 0x804B; +// public const int GL_INTENSITY12_EXT = 0x804C; +// public const int GL_INTENSITY16_EXT = 0x804D; +// public const int GL_RGB2_EXT = 0x804E; +// public const int GL_RGB4_EXT = 0x804F; +// public const int GL_RGB5_EXT = 0x8050; +// public const int GL_RGB8_EXT = 0x8051; +// public const int GL_RGB10_EXT = 0x8052; +// public const int GL_RGB12_EXT = 0x8053; +// public const int GL_RGB16_EXT = 0x8054; +// public const int GL_RGBA2_EXT = 0x8055; +// public const int GL_RGBA4_EXT = 0x8056; +// public const int GL_RGB5_A1_EXT = 0x8057; +// public const int GL_RGBA8_EXT = 0x8058; +// public const int GL_RGB10_A2_EXT = 0x8059; +// public const int GL_RGBA12_EXT = 0x805A; +// public const int GL_RGBA16_EXT = 0x805B; +// public const int GL_TEXTURE_RED_SIZE_EXT = 0x805C; +// public const int GL_TEXTURE_GREEN_SIZE_EXT = 0x805D; +// public const int GL_TEXTURE_BLUE_SIZE_EXT = 0x805E; +// public const int GL_TEXTURE_ALPHA_SIZE_EXT = 0x805F; +// public const int GL_TEXTURE_LUMINANCE_SIZE_EXT = 0x8060; +// public const int GL_TEXTURE_INTENSITY_SIZE_EXT = 0x8061; +// public const int GL_REPLACE_EXT = 0x8062; +// public const int GL_PROXY_TEXTURE_1D_EXT = 0x8063; +// public const int GL_PROXY_TEXTURE_2D_EXT = 0x8064; +// public const int GL_TEXTURE_TOO_LARGE_EXT = 0x8065; +// public const int GL_EXT_texture3D = 1; +// public const int GL_PACK_SKIP_IMAGES_EXT = 0x806B; +// public const int GL_PACK_IMAGE_HEIGHT_EXT = 0x806C; +// public const int GL_UNPACK_SKIP_IMAGES_EXT = 0x806D; +// public const int GL_UNPACK_IMAGE_HEIGHT_EXT = 0x806E; +// public const int GL_TEXTURE_3D_EXT = 0x806F; +// public const int GL_PROXY_TEXTURE_3D_EXT = 0x8070; +// public const int GL_TEXTURE_DEPTH_EXT = 0x8071; +// public const int GL_TEXTURE_WRAP_R_EXT = 0x8072; +// public const int GL_MAX_3D_TEXTURE_SIZE_EXT = 0x8073; +// public const int GL_EXT_texture_array = 1; +// public const int GL_TEXTURE_1D_ARRAY_EXT = 0x8C18; +// public const int GL_PROXY_TEXTURE_1D_ARRAY_EXT = 0x8C19; +// public const int GL_TEXTURE_2D_ARRAY_EXT = 0x8C1A; +// public const int GL_PROXY_TEXTURE_2D_ARRAY_EXT = 0x8C1B; +// public const int GL_TEXTURE_BINDING_1D_ARRAY_EXT = 0x8C1C; +// public const int GL_TEXTURE_BINDING_2D_ARRAY_EXT = 0x8C1D; +// public const int GL_MAX_ARRAY_TEXTURE_LAYERS_EXT = 0x88FF; +// public const int GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT = 0x884E; +// public const int GL_EXT_texture_buffer_object = 1; +// public const int GL_TEXTURE_BUFFER_EXT = 0x8C2A; +// public const int GL_MAX_TEXTURE_BUFFER_SIZE_EXT = 0x8C2B; +// public const int GL_TEXTURE_BINDING_BUFFER_EXT = 0x8C2C; +// public const int GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT = 0x8C2D; +// public const int GL_TEXTURE_BUFFER_FORMAT_EXT = 0x8C2E; +// public const int GL_EXT_texture_compression_latc = 1; +// public const int GL_COMPRESSED_LUMINANCE_LATC1_EXT = 0x8C70; +// public const int GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT = 0x8C71; +// public const int GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C72; +// public const int GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C73; +// public const int GL_EXT_texture_compression_rgtc = 1; +// public const int GL_COMPRESSED_RED_RGTC1_EXT = 0x8DBB; +// public const int GL_COMPRESSED_SIGNED_RED_RGTC1_EXT = 0x8DBC; +// public const int GL_COMPRESSED_RED_GREEN_RGTC2_EXT = 0x8DBD; +// public const int GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 0x8DBE; +// public const int GL_EXT_texture_compression_s3tc = 1; +// public const int GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0; +// public const int GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1; +// public const int GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2; +// public const int GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3; +// public const int GL_EXT_texture_cube_map = 1; +// public const int GL_NORMAL_MAP_EXT = 0x8511; +// public const int GL_REFLECTION_MAP_EXT = 0x8512; +// public const int GL_TEXTURE_CUBE_MAP_EXT = 0x8513; +// public const int GL_TEXTURE_BINDING_CUBE_MAP_EXT = 0x8514; +// public const int GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT = 0x8515; +// public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT = 0x8516; +// public const int GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT = 0x8517; +// public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT = 0x8518; +// public const int GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT = 0x8519; +// public const int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT = 0x851A; +// public const int GL_PROXY_TEXTURE_CUBE_MAP_EXT = 0x851B; +// public const int GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT = 0x851C; +// public const int GL_EXT_texture_env_add = 1; +// public const int GL_EXT_texture_env_combine = 1; +// public const int GL_COMBINE_EXT = 0x8570; +// public const int GL_COMBINE_RGB_EXT = 0x8571; +// public const int GL_COMBINE_ALPHA_EXT = 0x8572; +// public const int GL_RGB_SCALE_EXT = 0x8573; +// public const int GL_ADD_SIGNED_EXT = 0x8574; +// public const int GL_INTERPOLATE_EXT = 0x8575; +// public const int GL_CONSTANT_EXT = 0x8576; +// public const int GL_PRIMARY_COLOR_EXT = 0x8577; +// public const int GL_PREVIOUS_EXT = 0x8578; +// public const int GL_SOURCE0_RGB_EXT = 0x8580; +// public const int GL_SOURCE1_RGB_EXT = 0x8581; +// public const int GL_SOURCE2_RGB_EXT = 0x8582; +// public const int GL_SOURCE0_ALPHA_EXT = 0x8588; +// public const int GL_SOURCE1_ALPHA_EXT = 0x8589; +// public const int GL_SOURCE2_ALPHA_EXT = 0x858A; +// public const int GL_OPERAND0_RGB_EXT = 0x8590; +// public const int GL_OPERAND1_RGB_EXT = 0x8591; +// public const int GL_OPERAND2_RGB_EXT = 0x8592; +// public const int GL_OPERAND0_ALPHA_EXT = 0x8598; +// public const int GL_OPERAND1_ALPHA_EXT = 0x8599; +// public const int GL_OPERAND2_ALPHA_EXT = 0x859A; +// public const int GL_EXT_texture_env_dot3 = 1; +// public const int GL_DOT3_RGB_EXT = 0x8740; +// public const int GL_DOT3_RGBA_EXT = 0x8741; +// public const int GL_EXT_texture_filter_anisotropic = 1; +// public const int GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE; +// public const int GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF; +// public const int GL_EXT_texture_filter_minmax = 1; +// public const int GL_TEXTURE_REDUCTION_MODE_EXT = 0x9366; +// public const int GL_WEIGHTED_AVERAGE_EXT = 0x9367; +// public const int GL_EXT_texture_integer = 1; +// public const int GL_RGBA32UI_EXT = 0x8D70; +// public const int GL_RGB32UI_EXT = 0x8D71; +// public const int GL_ALPHA32UI_EXT = 0x8D72; +// public const int GL_INTENSITY32UI_EXT = 0x8D73; +// public const int GL_LUMINANCE32UI_EXT = 0x8D74; +// public const int GL_LUMINANCE_ALPHA32UI_EXT = 0x8D75; +// public const int GL_RGBA16UI_EXT = 0x8D76; +// public const int GL_RGB16UI_EXT = 0x8D77; +// public const int GL_ALPHA16UI_EXT = 0x8D78; +// public const int GL_INTENSITY16UI_EXT = 0x8D79; +// public const int GL_LUMINANCE16UI_EXT = 0x8D7A; +// public const int GL_LUMINANCE_ALPHA16UI_EXT = 0x8D7B; +// public const int GL_RGBA8UI_EXT = 0x8D7C; +// public const int GL_RGB8UI_EXT = 0x8D7D; +// public const int GL_ALPHA8UI_EXT = 0x8D7E; +// public const int GL_INTENSITY8UI_EXT = 0x8D7F; +// public const int GL_LUMINANCE8UI_EXT = 0x8D80; +// public const int GL_LUMINANCE_ALPHA8UI_EXT = 0x8D81; +// public const int GL_RGBA32I_EXT = 0x8D82; +// public const int GL_RGB32I_EXT = 0x8D83; +// public const int GL_ALPHA32I_EXT = 0x8D84; +// public const int GL_INTENSITY32I_EXT = 0x8D85; +// public const int GL_LUMINANCE32I_EXT = 0x8D86; +// public const int GL_LUMINANCE_ALPHA32I_EXT = 0x8D87; +// public const int GL_RGBA16I_EXT = 0x8D88; +// public const int GL_RGB16I_EXT = 0x8D89; +// public const int GL_ALPHA16I_EXT = 0x8D8A; +// public const int GL_INTENSITY16I_EXT = 0x8D8B; +// public const int GL_LUMINANCE16I_EXT = 0x8D8C; +// public const int GL_LUMINANCE_ALPHA16I_EXT = 0x8D8D; +// public const int GL_RGBA8I_EXT = 0x8D8E; +// public const int GL_RGB8I_EXT = 0x8D8F; +// public const int GL_ALPHA8I_EXT = 0x8D90; +// public const int GL_INTENSITY8I_EXT = 0x8D91; +// public const int GL_LUMINANCE8I_EXT = 0x8D92; +// public const int GL_LUMINANCE_ALPHA8I_EXT = 0x8D93; +// public const int GL_RED_INTEGER_EXT = 0x8D94; +// public const int GL_GREEN_INTEGER_EXT = 0x8D95; +// public const int GL_BLUE_INTEGER_EXT = 0x8D96; +// public const int GL_ALPHA_INTEGER_EXT = 0x8D97; +// public const int GL_RGB_INTEGER_EXT = 0x8D98; +// public const int GL_RGBA_INTEGER_EXT = 0x8D99; +// public const int GL_BGR_INTEGER_EXT = 0x8D9A; +// public const int GL_BGRA_INTEGER_EXT = 0x8D9B; +// public const int GL_LUMINANCE_INTEGER_EXT = 0x8D9C; +// public const int GL_LUMINANCE_ALPHA_INTEGER_EXT = 0x8D9D; +// public const int GL_RGBA_INTEGER_MODE_EXT = 0x8D9E; +// public const int GL_EXT_texture_lod_bias = 1; +// public const int GL_MAX_TEXTURE_LOD_BIAS_EXT = 0x84FD; +// public const int GL_TEXTURE_FILTER_CONTROL_EXT = 0x8500; +// public const int GL_TEXTURE_LOD_BIAS_EXT = 0x8501; +// public const int GL_EXT_texture_mirror_clamp = 1; +// public const int GL_MIRROR_CLAMP_EXT = 0x8742; +// public const int GL_MIRROR_CLAMP_TO_EDGE_EXT = 0x8743; +// public const int GL_MIRROR_CLAMP_TO_BORDER_EXT = 0x8912; +// public const int GL_EXT_texture_object = 1; +// public const int GL_TEXTURE_PRIORITY_EXT = 0x8066; +// public const int GL_TEXTURE_RESIDENT_EXT = 0x8067; +// public const int GL_TEXTURE_1D_BINDING_EXT = 0x8068; +// public const int GL_TEXTURE_2D_BINDING_EXT = 0x8069; +// public const int GL_TEXTURE_3D_BINDING_EXT = 0x806A; +// public const int GL_EXT_texture_perturb_normal = 1; +// public const int GL_PERTURB_EXT = 0x85AE; +// public const int GL_TEXTURE_NORMAL_EXT = 0x85AF; +// public const int GL_EXT_texture_sRGB = 1; +// public const int GL_SRGB_EXT = 0x8C40; +// public const int GL_SRGB8_EXT = 0x8C41; +// public const int GL_SRGB_ALPHA_EXT = 0x8C42; +// public const int GL_SRGB8_ALPHA8_EXT = 0x8C43; +// public const int GL_SLUMINANCE_ALPHA_EXT = 0x8C44; +// public const int GL_SLUMINANCE8_ALPHA8_EXT = 0x8C45; +// public const int GL_SLUMINANCE_EXT = 0x8C46; +// public const int GL_SLUMINANCE8_EXT = 0x8C47; +// public const int GL_COMPRESSED_SRGB_EXT = 0x8C48; +// public const int GL_COMPRESSED_SRGB_ALPHA_EXT = 0x8C49; +// public const int GL_COMPRESSED_SLUMINANCE_EXT = 0x8C4A; +// public const int GL_COMPRESSED_SLUMINANCE_ALPHA_EXT = 0x8C4B; +// public const int GL_COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C; +// public const int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D; +// public const int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E; +// public const int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F; +// public const int GL_EXT_texture_sRGB_decode = 1; +// public const int GL_TEXTURE_SRGB_DECODE_EXT = 0x8A48; +// public const int GL_DECODE_EXT = 0x8A49; +// public const int GL_SKIP_DECODE_EXT = 0x8A4A; +// public const int GL_EXT_texture_shared_exponent = 1; +// public const int GL_RGB9_E5_EXT = 0x8C3D; +// public const int GL_UNSIGNED_INT_5_9_9_9_REV_EXT = 0x8C3E; +// public const int GL_TEXTURE_SHARED_SIZE_EXT = 0x8C3F; +// public const int GL_EXT_texture_snorm = 1; +// public const int GL_ALPHA_SNORM = 0x9010; +// public const int GL_LUMINANCE_SNORM = 0x9011; +// public const int GL_LUMINANCE_ALPHA_SNORM = 0x9012; +// public const int GL_INTENSITY_SNORM = 0x9013; +// public const int GL_ALPHA8_SNORM = 0x9014; +// public const int GL_LUMINANCE8_SNORM = 0x9015; +// public const int GL_LUMINANCE8_ALPHA8_SNORM = 0x9016; +// public const int GL_INTENSITY8_SNORM = 0x9017; +// public const int GL_ALPHA16_SNORM = 0x9018; +// public const int GL_LUMINANCE16_SNORM = 0x9019; +// public const int GL_LUMINANCE16_ALPHA16_SNORM = 0x901A; +// public const int GL_INTENSITY16_SNORM = 0x901B; +// public const int GL_RED_SNORM = 0x8F90; +// public const int GL_RG_SNORM = 0x8F91; +// public const int GL_RGB_SNORM = 0x8F92; +// public const int GL_RGBA_SNORM = 0x8F93; +// public const int GL_EXT_texture_swizzle = 1; +// public const int GL_TEXTURE_SWIZZLE_R_EXT = 0x8E42; +// public const int GL_TEXTURE_SWIZZLE_G_EXT = 0x8E43; +// public const int GL_TEXTURE_SWIZZLE_B_EXT = 0x8E44; +// public const int GL_TEXTURE_SWIZZLE_A_EXT = 0x8E45; +// public const int GL_TEXTURE_SWIZZLE_RGBA_EXT = 0x8E46; +// public const int GL_EXT_timer_query = 1; +// public const int GL_TIME_ELAPSED_EXT = 0x88BF; +// public const int GL_EXT_transform_feedback = 1; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_EXT = 0x8C8E; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT = 0x8C84; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT = 0x8C85; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT = 0x8C8F; +// public const int GL_INTERLEAVED_ATTRIBS_EXT = 0x8C8C; +// public const int GL_SEPARATE_ATTRIBS_EXT = 0x8C8D; +// public const int GL_PRIMITIVES_GENERATED_EXT = 0x8C87; +// public const int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT = 0x8C88; +// public const int GL_RASTERIZER_DISCARD_EXT = 0x8C89; +// public const int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT = 0x8C8A; +// public const int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT = 0x8C8B; +// public const int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT = 0x8C80; +// public const int GL_TRANSFORM_FEEDBACK_VARYINGS_EXT = 0x8C83; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT = 0x8C7F; +// public const int GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT = 0x8C76; +// public const int GL_EXT_vertex_array = 1; +// public const int GL_VERTEX_ARRAY_EXT = 0x8074; +// public const int GL_NORMAL_ARRAY_EXT = 0x8075; +// public const int GL_COLOR_ARRAY_EXT = 0x8076; +// public const int GL_INDEX_ARRAY_EXT = 0x8077; +// public const int GL_TEXTURE_COORD_ARRAY_EXT = 0x8078; +// public const int GL_EDGE_FLAG_ARRAY_EXT = 0x8079; +// public const int GL_VERTEX_ARRAY_SIZE_EXT = 0x807A; +// public const int GL_VERTEX_ARRAY_TYPE_EXT = 0x807B; +// public const int GL_VERTEX_ARRAY_STRIDE_EXT = 0x807C; +// public const int GL_VERTEX_ARRAY_COUNT_EXT = 0x807D; +// public const int GL_NORMAL_ARRAY_TYPE_EXT = 0x807E; +// public const int GL_NORMAL_ARRAY_STRIDE_EXT = 0x807F; +// public const int GL_NORMAL_ARRAY_COUNT_EXT = 0x8080; +// public const int GL_COLOR_ARRAY_SIZE_EXT = 0x8081; +// public const int GL_COLOR_ARRAY_TYPE_EXT = 0x8082; +// public const int GL_COLOR_ARRAY_STRIDE_EXT = 0x8083; +// public const int GL_COLOR_ARRAY_COUNT_EXT = 0x8084; +// public const int GL_INDEX_ARRAY_TYPE_EXT = 0x8085; +// public const int GL_INDEX_ARRAY_STRIDE_EXT = 0x8086; +// public const int GL_INDEX_ARRAY_COUNT_EXT = 0x8087; +// public const int GL_TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088; +// public const int GL_TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089; +// public const int GL_TEXTURE_COORD_ARRAY_STRIDE_EXT = 0x808A; +// public const int GL_TEXTURE_COORD_ARRAY_COUNT_EXT = 0x808B; +// public const int GL_EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C; +// public const int GL_EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D; +// public const int GL_VERTEX_ARRAY_POINTER_EXT = 0x808E; +// public const int GL_NORMAL_ARRAY_POINTER_EXT = 0x808F; +// public const int GL_COLOR_ARRAY_POINTER_EXT = 0x8090; +// public const int GL_INDEX_ARRAY_POINTER_EXT = 0x8091; +// public const int GL_TEXTURE_COORD_ARRAY_POINTER_EXT = 0x8092; +// public const int GL_EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093; +// public const int GL_EXT_vertex_array_bgra = 1; +// public const int GL_EXT_vertex_attrib_64bit = 1; +// public const int GL_DOUBLE_VEC2_EXT = 0x8FFC; +// public const int GL_DOUBLE_VEC3_EXT = 0x8FFD; +// public const int GL_DOUBLE_VEC4_EXT = 0x8FFE; +// public const int GL_DOUBLE_MAT2_EXT = 0x8F46; +// public const int GL_DOUBLE_MAT3_EXT = 0x8F47; +// public const int GL_DOUBLE_MAT4_EXT = 0x8F48; +// public const int GL_DOUBLE_MAT2x3_EXT = 0x8F49; +// public const int GL_DOUBLE_MAT2x4_EXT = 0x8F4A; +// public const int GL_DOUBLE_MAT3x2_EXT = 0x8F4B; +// public const int GL_DOUBLE_MAT3x4_EXT = 0x8F4C; +// public const int GL_DOUBLE_MAT4x2_EXT = 0x8F4D; +// public const int GL_DOUBLE_MAT4x3_EXT = 0x8F4E; +// public const int GL_EXT_vertex_shader = 1; +// public const int GL_VERTEX_SHADER_EXT = 0x8780; +// public const int GL_VERTEX_SHADER_BINDING_EXT = 0x8781; +// public const int GL_OP_INDEX_EXT = 0x8782; +// public const int GL_OP_NEGATE_EXT = 0x8783; +// public const int GL_OP_DOT3_EXT = 0x8784; +// public const int GL_OP_DOT4_EXT = 0x8785; +// public const int GL_OP_MUL_EXT = 0x8786; +// public const int GL_OP_ADD_EXT = 0x8787; +// public const int GL_OP_MADD_EXT = 0x8788; +// public const int GL_OP_FRAC_EXT = 0x8789; +// public const int GL_OP_MAX_EXT = 0x878A; +// public const int GL_OP_MIN_EXT = 0x878B; +// public const int GL_OP_SET_GE_EXT = 0x878C; +// public const int GL_OP_SET_LT_EXT = 0x878D; +// public const int GL_OP_CLAMP_EXT = 0x878E; +// public const int GL_OP_FLOOR_EXT = 0x878F; +// public const int GL_OP_ROUND_EXT = 0x8790; +// public const int GL_OP_EXP_BASE_2_EXT = 0x8791; +// public const int GL_OP_LOG_BASE_2_EXT = 0x8792; +// public const int GL_OP_POWER_EXT = 0x8793; +// public const int GL_OP_RECIP_EXT = 0x8794; +// public const int GL_OP_RECIP_SQRT_EXT = 0x8795; +// public const int GL_OP_SUB_EXT = 0x8796; +// public const int GL_OP_CROSS_PRODUCT_EXT = 0x8797; +// public const int GL_OP_MULTIPLY_MATRIX_EXT = 0x8798; +// public const int GL_OP_MOV_EXT = 0x8799; +// public const int GL_OUTPUT_VERTEX_EXT = 0x879A; +// public const int GL_OUTPUT_COLOR0_EXT = 0x879B; +// public const int GL_OUTPUT_COLOR1_EXT = 0x879C; +// public const int GL_OUTPUT_TEXTURE_COORD0_EXT = 0x879D; +// public const int GL_OUTPUT_TEXTURE_COORD1_EXT = 0x879E; +// public const int GL_OUTPUT_TEXTURE_COORD2_EXT = 0x879F; +// public const int GL_OUTPUT_TEXTURE_COORD3_EXT = 0x87A0; +// public const int GL_OUTPUT_TEXTURE_COORD4_EXT = 0x87A1; +// public const int GL_OUTPUT_TEXTURE_COORD5_EXT = 0x87A2; +// public const int GL_OUTPUT_TEXTURE_COORD6_EXT = 0x87A3; +// public const int GL_OUTPUT_TEXTURE_COORD7_EXT = 0x87A4; +// public const int GL_OUTPUT_TEXTURE_COORD8_EXT = 0x87A5; +// public const int GL_OUTPUT_TEXTURE_COORD9_EXT = 0x87A6; +// public const int GL_OUTPUT_TEXTURE_COORD10_EXT = 0x87A7; +// public const int GL_OUTPUT_TEXTURE_COORD11_EXT = 0x87A8; +// public const int GL_OUTPUT_TEXTURE_COORD12_EXT = 0x87A9; +// public const int GL_OUTPUT_TEXTURE_COORD13_EXT = 0x87AA; +// public const int GL_OUTPUT_TEXTURE_COORD14_EXT = 0x87AB; +// public const int GL_OUTPUT_TEXTURE_COORD15_EXT = 0x87AC; +// public const int GL_OUTPUT_TEXTURE_COORD16_EXT = 0x87AD; +// public const int GL_OUTPUT_TEXTURE_COORD17_EXT = 0x87AE; +// public const int GL_OUTPUT_TEXTURE_COORD18_EXT = 0x87AF; +// public const int GL_OUTPUT_TEXTURE_COORD19_EXT = 0x87B0; +// public const int GL_OUTPUT_TEXTURE_COORD20_EXT = 0x87B1; +// public const int GL_OUTPUT_TEXTURE_COORD21_EXT = 0x87B2; +// public const int GL_OUTPUT_TEXTURE_COORD22_EXT = 0x87B3; +// public const int GL_OUTPUT_TEXTURE_COORD23_EXT = 0x87B4; +// public const int GL_OUTPUT_TEXTURE_COORD24_EXT = 0x87B5; +// public const int GL_OUTPUT_TEXTURE_COORD25_EXT = 0x87B6; +// public const int GL_OUTPUT_TEXTURE_COORD26_EXT = 0x87B7; +// public const int GL_OUTPUT_TEXTURE_COORD27_EXT = 0x87B8; +// public const int GL_OUTPUT_TEXTURE_COORD28_EXT = 0x87B9; +// public const int GL_OUTPUT_TEXTURE_COORD29_EXT = 0x87BA; +// public const int GL_OUTPUT_TEXTURE_COORD30_EXT = 0x87BB; +// public const int GL_OUTPUT_TEXTURE_COORD31_EXT = 0x87BC; +// public const int GL_OUTPUT_FOG_EXT = 0x87BD; +// public const int GL_SCALAR_EXT = 0x87BE; +// public const int GL_VECTOR_EXT = 0x87BF; +// public const int GL_MATRIX_EXT = 0x87C0; +// public const int GL_VARIANT_EXT = 0x87C1; +// public const int GL_INVARIANT_EXT = 0x87C2; +// public const int GL_LOCAL_CONSTANT_EXT = 0x87C3; +// public const int GL_LOCAL_EXT = 0x87C4; +// public const int GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87C5; +// public const int GL_MAX_VERTEX_SHADER_VARIANTS_EXT = 0x87C6; +// public const int GL_MAX_VERTEX_SHADER_INVARIANTS_EXT = 0x87C7; +// public const int GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87C8; +// public const int GL_MAX_VERTEX_SHADER_LOCALS_EXT = 0x87C9; +// public const int GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CA; +// public const int GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT = 0x87CB; +// public const int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87CC; +// public const int GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT = 0x87CD; +// public const int GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT = 0x87CE; +// public const int GL_VERTEX_SHADER_INSTRUCTIONS_EXT = 0x87CF; +// public const int GL_VERTEX_SHADER_VARIANTS_EXT = 0x87D0; +// public const int GL_VERTEX_SHADER_INVARIANTS_EXT = 0x87D1; +// public const int GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT = 0x87D2; +// public const int GL_VERTEX_SHADER_LOCALS_EXT = 0x87D3; +// public const int GL_VERTEX_SHADER_OPTIMIZED_EXT = 0x87D4; +// public const int GL_X_EXT = 0x87D5; +// public const int GL_Y_EXT = 0x87D6; +// public const int GL_Z_EXT = 0x87D7; +// public const int GL_W_EXT = 0x87D8; +// public const int GL_NEGATIVE_X_EXT = 0x87D9; +// public const int GL_NEGATIVE_Y_EXT = 0x87DA; +// public const int GL_NEGATIVE_Z_EXT = 0x87DB; +// public const int GL_NEGATIVE_W_EXT = 0x87DC; +// public const int GL_ZERO_EXT = 0x87DD; +// public const int GL_ONE_EXT = 0x87DE; +// public const int GL_NEGATIVE_ONE_EXT = 0x87DF; +// public const int GL_NORMALIZED_RANGE_EXT = 0x87E0; +// public const int GL_FULL_RANGE_EXT = 0x87E1; +// public const int GL_CURRENT_VERTEX_EXT = 0x87E2; +// public const int GL_MVP_MATRIX_EXT = 0x87E3; +// public const int GL_VARIANT_VALUE_EXT = 0x87E4; +// public const int GL_VARIANT_DATATYPE_EXT = 0x87E5; +// public const int GL_VARIANT_ARRAY_STRIDE_EXT = 0x87E6; +// public const int GL_VARIANT_ARRAY_TYPE_EXT = 0x87E7; +// public const int GL_VARIANT_ARRAY_EXT = 0x87E8; +// public const int GL_VARIANT_ARRAY_POINTER_EXT = 0x87E9; +// public const int GL_INVARIANT_VALUE_EXT = 0x87EA; +// public const int GL_INVARIANT_DATATYPE_EXT = 0x87EB; +// public const int GL_LOCAL_CONSTANT_VALUE_EXT = 0x87EC; +// public const int GL_LOCAL_CONSTANT_DATATYPE_EXT = 0x87ED; +// public const int GL_EXT_vertex_weighting = 1; +// public const int GL_MODELVIEW0_STACK_DEPTH_EXT = 0x0BA3; +// public const int GL_MODELVIEW1_STACK_DEPTH_EXT = 0x8502; +// public const int GL_MODELVIEW0_MATRIX_EXT = 0x0BA6; +// public const int GL_MODELVIEW1_MATRIX_EXT = 0x8506; +// public const int GL_VERTEX_WEIGHTING_EXT = 0x8509; +// public const int GL_MODELVIEW0_EXT = 0x1700; +// public const int GL_MODELVIEW1_EXT = 0x850A; +// public const int GL_CURRENT_VERTEX_WEIGHT_EXT = 0x850B; +// public const int GL_VERTEX_WEIGHT_ARRAY_EXT = 0x850C; +// public const int GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT = 0x850D; +// public const int GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT = 0x850E; +// public const int GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT = 0x850F; +// public const int GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT = 0x8510; +// public const int GL_EXT_win32_keyed_mutex = 1; +// public const int GL_EXT_window_rectangles = 1; +// public const int GL_INCLUSIVE_EXT = 0x8F10; +// public const int GL_EXCLUSIVE_EXT = 0x8F11; +// public const int GL_WINDOW_RECTANGLE_EXT = 0x8F12; +// public const int GL_WINDOW_RECTANGLE_MODE_EXT = 0x8F13; +// public const int GL_MAX_WINDOW_RECTANGLES_EXT = 0x8F14; +// public const int GL_NUM_WINDOW_RECTANGLES_EXT = 0x8F15; +// public const int GL_EXT_x11_sync_object = 1; +// public const int GL_SYNC_X11_FENCE_EXT = 0x90E1; +// public const int GL_GREMEDY_frame_terminator = 1; +// public const int GL_GREMEDY_string_marker = 1; +// public const int GL_HP_convolution_border_modes = 1; +// public const int GL_IGNORE_BORDER_HP = 0x8150; +// public const int GL_CONSTANT_BORDER_HP = 0x8151; +// public const int GL_REPLICATE_BORDER_HP = 0x8153; +// public const int GL_CONVOLUTION_BORDER_COLOR_HP = 0x8154; +// public const int GL_HP_image_transform = 1; +// public const int GL_IMAGE_SCALE_X_HP = 0x8155; +// public const int GL_IMAGE_SCALE_Y_HP = 0x8156; +// public const int GL_IMAGE_TRANSLATE_X_HP = 0x8157; +// public const int GL_IMAGE_TRANSLATE_Y_HP = 0x8158; +// public const int GL_IMAGE_ROTATE_ANGLE_HP = 0x8159; +// public const int GL_IMAGE_ROTATE_ORIGIN_X_HP = 0x815A; +// public const int GL_IMAGE_ROTATE_ORIGIN_Y_HP = 0x815B; +// public const int GL_IMAGE_MAG_FILTER_HP = 0x815C; +// public const int GL_IMAGE_MIN_FILTER_HP = 0x815D; +// public const int GL_IMAGE_CUBIC_WEIGHT_HP = 0x815E; +// public const int GL_CUBIC_HP = 0x815F; +// public const int GL_AVERAGE_HP = 0x8160; +// public const int GL_IMAGE_TRANSFORM_2D_HP = 0x8161; +// public const int GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8162; +// public const int GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP = 0x8163; +// public const int GL_HP_occlusion_test = 1; +// public const int GL_OCCLUSION_TEST_HP = 0x8165; +// public const int GL_OCCLUSION_TEST_RESULT_HP = 0x8166; +// public const int GL_HP_texture_lighting = 1; +// public const int GL_TEXTURE_LIGHTING_MODE_HP = 0x8167; +// public const int GL_TEXTURE_POST_SPECULAR_HP = 0x8168; +// public const int GL_TEXTURE_PRE_SPECULAR_HP = 0x8169; +// public const int GL_IBM_cull_vertex = 1; +// public const int GL_CULL_VERTEX_IBM = 103050; +// public const int GL_IBM_multimode_draw_arrays = 1; +// public const int GL_IBM_rasterpos_clip = 1; +// public const int GL_RASTER_POSITION_UNCLIPPED_IBM = 0x19262; +// public const int GL_IBM_static_data = 1; +// public const int GL_ALL_STATIC_DATA_IBM = 103060; +// public const int GL_STATIC_VERTEX_ARRAY_IBM = 103061; +// public const int GL_IBM_texture_mirrored_repeat = 1; +// public const int GL_MIRRORED_REPEAT_IBM = 0x8370; +// public const int GL_IBM_vertex_array_lists = 1; +// public const int GL_VERTEX_ARRAY_LIST_IBM = 103070; +// public const int GL_NORMAL_ARRAY_LIST_IBM = 103071; +// public const int GL_COLOR_ARRAY_LIST_IBM = 103072; +// public const int GL_INDEX_ARRAY_LIST_IBM = 103073; +// public const int GL_TEXTURE_COORD_ARRAY_LIST_IBM = 103074; +// public const int GL_EDGE_FLAG_ARRAY_LIST_IBM = 103075; +// public const int GL_FOG_COORDINATE_ARRAY_LIST_IBM = 103076; +// public const int GL_SECONDARY_COLOR_ARRAY_LIST_IBM = 103077; +// public const int GL_VERTEX_ARRAY_LIST_STRIDE_IBM = 103080; +// public const int GL_NORMAL_ARRAY_LIST_STRIDE_IBM = 103081; +// public const int GL_COLOR_ARRAY_LIST_STRIDE_IBM = 103082; +// public const int GL_INDEX_ARRAY_LIST_STRIDE_IBM = 103083; +// public const int GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM = 103084; +// public const int GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM = 103085; +// public const int GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM = 103086; +// public const int GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM = 103087; +// public const int GL_INGR_blend_func_separate = 1; +// public const int GL_INGR_color_clamp = 1; +// public const int GL_RED_MIN_CLAMP_INGR = 0x8560; +// public const int GL_GREEN_MIN_CLAMP_INGR = 0x8561; +// public const int GL_BLUE_MIN_CLAMP_INGR = 0x8562; +// public const int GL_ALPHA_MIN_CLAMP_INGR = 0x8563; +// public const int GL_RED_MAX_CLAMP_INGR = 0x8564; +// public const int GL_GREEN_MAX_CLAMP_INGR = 0x8565; +// public const int GL_BLUE_MAX_CLAMP_INGR = 0x8566; +// public const int GL_ALPHA_MAX_CLAMP_INGR = 0x8567; +// public const int GL_INGR_interlace_read = 1; +// public const int GL_INTERLACE_READ_INGR = 0x8568; +// public const int GL_INTEL_blackhole_render = 1; +// public const int GL_BLACKHOLE_RENDER_INTEL = 0x83FC; +// public const int GL_INTEL_conservative_rasterization = 1; +// public const int GL_CONSERVATIVE_RASTERIZATION_INTEL = 0x83FE; +// public const int GL_INTEL_fragment_shader_ordering = 1; +// public const int GL_INTEL_framebuffer_CMAA = 1; +// public const int GL_INTEL_map_texture = 1; +// public const int GL_TEXTURE_MEMORY_LAYOUT_INTEL = 0x83FF; +// public const int GL_LAYOUT_DEFAULT_INTEL = 0; +// public const int GL_LAYOUT_LINEAR_INTEL = 1; +// public const int GL_LAYOUT_LINEAR_CPU_CACHED_INTEL = 2; +// public const int GL_INTEL_parallel_arrays = 1; +// public const int GL_PARALLEL_ARRAYS_INTEL = 0x83F4; +// public const int GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F5; +// public const int GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F6; +// public const int GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F7; +// public const int GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL = 0x83F8; +// public const int GL_INTEL_performance_query = 1; +// public const int GL_PERFQUERY_SINGLE_CONTEXT_INTEL = 0x00000000; +// public const int GL_PERFQUERY_GLOBAL_CONTEXT_INTEL = 0x00000001; +// public const int GL_PERFQUERY_WAIT_INTEL = 0x83FB; +// public const int GL_PERFQUERY_FLUSH_INTEL = 0x83FA; +// public const int GL_PERFQUERY_DONOT_FLUSH_INTEL = 0x83F9; +// public const int GL_PERFQUERY_COUNTER_EVENT_INTEL = 0x94F0; +// public const int GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL = 0x94F1; +// public const int GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL = 0x94F2; +// public const int GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL = 0x94F3; +// public const int GL_PERFQUERY_COUNTER_RAW_INTEL = 0x94F4; +// public const int GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL = 0x94F5; +// public const int GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL = 0x94F8; +// public const int GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL = 0x94F9; +// public const int GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL = 0x94FA; +// public const int GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL = 0x94FB; +// public const int GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL = 0x94FC; +// public const int GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL = 0x94FD; +// public const int GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL = 0x94FE; +// public const int GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL = 0x94FF; +// public const int GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL = 0x9500; +// public const int GL_MESAX_texture_stack = 1; +// public const int GL_TEXTURE_1D_STACK_MESAX = 0x8759; +// public const int GL_TEXTURE_2D_STACK_MESAX = 0x875A; +// public const int GL_PROXY_TEXTURE_1D_STACK_MESAX = 0x875B; +// public const int GL_PROXY_TEXTURE_2D_STACK_MESAX = 0x875C; +// public const int GL_TEXTURE_1D_STACK_BINDING_MESAX = 0x875D; +// public const int GL_TEXTURE_2D_STACK_BINDING_MESAX = 0x875E; +// public const int GL_MESA_pack_invert = 1; +// public const int GL_PACK_INVERT_MESA = 0x8758; +// public const int GL_MESA_program_binary_formats = 1; +// public const int GL_PROGRAM_BINARY_FORMAT_MESA = 0x875F; +// public const int GL_MESA_resize_buffers = 1; +// public const int GL_MESA_shader_integer_functions = 1; +// public const int GL_MESA_tile_raster_order = 1; +// public const int GL_TILE_RASTER_ORDER_FIXED_MESA = 0x8BB8; +// public const int GL_TILE_RASTER_ORDER_INCREASING_X_MESA = 0x8BB9; +// public const int GL_TILE_RASTER_ORDER_INCREASING_Y_MESA = 0x8BBA; +// public const int GL_MESA_window_pos = 1; +// public const int GL_MESA_ycbcr_texture = 1; +// public const int GL_UNSIGNED_SHORT_8_8_MESA = 0x85BA; +// public const int GL_UNSIGNED_SHORT_8_8_REV_MESA = 0x85BB; +// public const int GL_YCBCR_MESA = 0x8757; +// public const int GL_NVX_blend_equation_advanced_multi_draw_buffers = 1; +// public const int GL_NVX_conditional_render = 1; +// public const int GL_NVX_gpu_memory_info = 1; +// public const int GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = 0x9047; +// public const int GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = 0x9048; +// public const int GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = 0x9049; +// public const int GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX = 0x904A; +// public const int GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX = 0x904B; +// public const int GL_NVX_linked_gpu_multicast = 1; +// public const int GL_LGPU_SEPARATE_STORAGE_BIT_NVX = 0x0800; +// public const int GL_MAX_LGPU_GPUS_NVX = 0x92BA; +// public const int GL_NV_alpha_to_coverage_dither_control = 1; +// public const int GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV = 0x934D; +// public const int GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV = 0x934E; +// public const int GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV = 0x934F; +// public const int GL_ALPHA_TO_COVERAGE_DITHER_MODE_NV = 0x92BF; +// public const int GL_NV_bindless_multi_draw_indirect = 1; +// public const int GL_NV_bindless_multi_draw_indirect_count = 1; +// public const int GL_NV_bindless_texture = 1; +// public const int GL_NV_blend_equation_advanced = 1; +// public const int GL_BLEND_OVERLAP_NV = 0x9281; +// public const int GL_BLEND_PREMULTIPLIED_SRC_NV = 0x9280; +// public const int GL_BLUE_NV = 0x1905; +// public const int GL_COLORBURN_NV = 0x929A; +// public const int GL_COLORDODGE_NV = 0x9299; +// public const int GL_CONJOINT_NV = 0x9284; +// public const int GL_CONTRAST_NV = 0x92A1; +// public const int GL_DARKEN_NV = 0x9297; +// public const int GL_DIFFERENCE_NV = 0x929E; +// public const int GL_DISJOINT_NV = 0x9283; +// public const int GL_DST_ATOP_NV = 0x928F; +// public const int GL_DST_IN_NV = 0x928B; +// public const int GL_DST_NV = 0x9287; +// public const int GL_DST_OUT_NV = 0x928D; +// public const int GL_DST_OVER_NV = 0x9289; +// public const int GL_EXCLUSION_NV = 0x92A0; +// public const int GL_GREEN_NV = 0x1904; +// public const int GL_HARDLIGHT_NV = 0x929B; +// public const int GL_HARDMIX_NV = 0x92A9; +// public const int GL_HSL_COLOR_NV = 0x92AF; +// public const int GL_HSL_HUE_NV = 0x92AD; +// public const int GL_HSL_LUMINOSITY_NV = 0x92B0; +// public const int GL_HSL_SATURATION_NV = 0x92AE; +// public const int GL_INVERT_OVG_NV = 0x92B4; +// public const int GL_INVERT_RGB_NV = 0x92A3; +// public const int GL_LIGHTEN_NV = 0x9298; +// public const int GL_LINEARBURN_NV = 0x92A5; +// public const int GL_LINEARDODGE_NV = 0x92A4; +// public const int GL_LINEARLIGHT_NV = 0x92A7; +// public const int GL_MINUS_CLAMPED_NV = 0x92B3; +// public const int GL_MINUS_NV = 0x929F; +// public const int GL_MULTIPLY_NV = 0x9294; +// public const int GL_OVERLAY_NV = 0x9296; +// public const int GL_PINLIGHT_NV = 0x92A8; +// public const int GL_PLUS_CLAMPED_ALPHA_NV = 0x92B2; +// public const int GL_PLUS_CLAMPED_NV = 0x92B1; +// public const int GL_PLUS_DARKER_NV = 0x9292; +// public const int GL_PLUS_NV = 0x9291; +// public const int GL_RED_NV = 0x1903; +// public const int GL_SCREEN_NV = 0x9295; +// public const int GL_SOFTLIGHT_NV = 0x929C; +// public const int GL_SRC_ATOP_NV = 0x928E; +// public const int GL_SRC_IN_NV = 0x928A; +// public const int GL_SRC_NV = 0x9286; +// public const int GL_SRC_OUT_NV = 0x928C; +// public const int GL_SRC_OVER_NV = 0x9288; +// public const int GL_UNCORRELATED_NV = 0x9282; +// public const int GL_VIVIDLIGHT_NV = 0x92A6; +// public const int GL_XOR_NV = 0x1506; +// public const int GL_NV_blend_equation_advanced_coherent = 1; +// public const int GL_BLEND_ADVANCED_COHERENT_NV = 0x9285; +// public const int GL_NV_blend_minmax_factor = 1; +// public const int GL_NV_blend_square = 1; +// public const int GL_NV_clip_space_w_scaling = 1; +// public const int GL_VIEWPORT_POSITION_W_SCALE_NV = 0x937C; +// public const int GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV = 0x937D; +// public const int GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV = 0x937E; +// public const int GL_NV_command_list = 1; +// public const int GL_TERMINATE_SEQUENCE_COMMAND_NV = 0x0000; +// public const int GL_NOP_COMMAND_NV = 0x0001; +// public const int GL_DRAW_ELEMENTS_COMMAND_NV = 0x0002; +// public const int GL_DRAW_ARRAYS_COMMAND_NV = 0x0003; +// public const int GL_DRAW_ELEMENTS_STRIP_COMMAND_NV = 0x0004; +// public const int GL_DRAW_ARRAYS_STRIP_COMMAND_NV = 0x0005; +// public const int GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV = 0x0006; +// public const int GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV = 0x0007; +// public const int GL_ELEMENT_ADDRESS_COMMAND_NV = 0x0008; +// public const int GL_ATTRIBUTE_ADDRESS_COMMAND_NV = 0x0009; +// public const int GL_UNIFORM_ADDRESS_COMMAND_NV = 0x000A; +// public const int GL_BLEND_COLOR_COMMAND_NV = 0x000B; +// public const int GL_STENCIL_REF_COMMAND_NV = 0x000C; +// public const int GL_LINE_WIDTH_COMMAND_NV = 0x000D; +// public const int GL_POLYGON_OFFSET_COMMAND_NV = 0x000E; +// public const int GL_ALPHA_REF_COMMAND_NV = 0x000F; +// public const int GL_VIEWPORT_COMMAND_NV = 0x0010; +// public const int GL_SCISSOR_COMMAND_NV = 0x0011; +// public const int GL_FRONT_FACE_COMMAND_NV = 0x0012; +// public const int GL_NV_compute_program5 = 1; +// public const int GL_COMPUTE_PROGRAM_NV = 0x90FB; +// public const int GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV = 0x90FC; +// public const int GL_NV_conditional_render = 1; +// public const int GL_QUERY_WAIT_NV = 0x8E13; +// public const int GL_QUERY_NO_WAIT_NV = 0x8E14; +// public const int GL_QUERY_BY_REGION_WAIT_NV = 0x8E15; +// public const int GL_QUERY_BY_REGION_NO_WAIT_NV = 0x8E16; +// public const int GL_NV_conservative_raster = 1; +// public const int GL_CONSERVATIVE_RASTERIZATION_NV = 0x9346; +// public const int GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV = 0x9347; +// public const int GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV = 0x9348; +// public const int GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV = 0x9349; +// public const int GL_NV_conservative_raster_dilate = 1; +// public const int GL_CONSERVATIVE_RASTER_DILATE_NV = 0x9379; +// public const int GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV = 0x937A; +// public const int GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV = 0x937B; +// public const int GL_NV_conservative_raster_pre_snap = 1; +// public const int GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV = 0x9550; +// public const int GL_NV_conservative_raster_pre_snap_triangles = 1; +// public const int GL_CONSERVATIVE_RASTER_MODE_NV = 0x954D; +// public const int GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV = 0x954E; +// public const int GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV = 0x954F; +// public const int GL_NV_conservative_raster_underestimation = 1; +// public const int GL_NV_copy_depth_to_color = 1; +// public const int GL_DEPTH_STENCIL_TO_RGBA_NV = 0x886E; +// public const int GL_DEPTH_STENCIL_TO_BGRA_NV = 0x886F; +// public const int GL_NV_copy_image = 1; +// public const int GL_NV_deep_texture3D = 1; +// public const int GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV = 0x90D0; +// public const int GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV = 0x90D1; +// public const int GL_NV_depth_buffer_float = 1; +// public const int GL_DEPTH_COMPONENT32F_NV = 0x8DAB; +// public const int GL_DEPTH32F_STENCIL8_NV = 0x8DAC; +// public const int GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV = 0x8DAD; +// public const int GL_DEPTH_BUFFER_FLOAT_MODE_NV = 0x8DAF; +// public const int GL_NV_depth_clamp = 1; +// public const int GL_DEPTH_CLAMP_NV = 0x864F; +// public const int GL_NV_draw_texture = 1; +// public const int GL_NV_draw_vulkan_image = 1; +// public const int GL_NV_evaluators = 1; +// public const int GL_EVAL_2D_NV = 0x86C0; +// public const int GL_EVAL_TRIANGULAR_2D_NV = 0x86C1; +// public const int GL_MAP_TESSELLATION_NV = 0x86C2; +// public const int GL_MAP_ATTRIB_U_ORDER_NV = 0x86C3; +// public const int GL_MAP_ATTRIB_V_ORDER_NV = 0x86C4; +// public const int GL_EVAL_FRACTIONAL_TESSELLATION_NV = 0x86C5; +// public const int GL_EVAL_VERTEX_ATTRIB0_NV = 0x86C6; +// public const int GL_EVAL_VERTEX_ATTRIB1_NV = 0x86C7; +// public const int GL_EVAL_VERTEX_ATTRIB2_NV = 0x86C8; +// public const int GL_EVAL_VERTEX_ATTRIB3_NV = 0x86C9; +// public const int GL_EVAL_VERTEX_ATTRIB4_NV = 0x86CA; +// public const int GL_EVAL_VERTEX_ATTRIB5_NV = 0x86CB; +// public const int GL_EVAL_VERTEX_ATTRIB6_NV = 0x86CC; +// public const int GL_EVAL_VERTEX_ATTRIB7_NV = 0x86CD; +// public const int GL_EVAL_VERTEX_ATTRIB8_NV = 0x86CE; +// public const int GL_EVAL_VERTEX_ATTRIB9_NV = 0x86CF; +// public const int GL_EVAL_VERTEX_ATTRIB10_NV = 0x86D0; +// public const int GL_EVAL_VERTEX_ATTRIB11_NV = 0x86D1; +// public const int GL_EVAL_VERTEX_ATTRIB12_NV = 0x86D2; +// public const int GL_EVAL_VERTEX_ATTRIB13_NV = 0x86D3; +// public const int GL_EVAL_VERTEX_ATTRIB14_NV = 0x86D4; +// public const int GL_EVAL_VERTEX_ATTRIB15_NV = 0x86D5; +// public const int GL_MAX_MAP_TESSELLATION_NV = 0x86D6; +// public const int GL_MAX_RATIONAL_EVAL_ORDER_NV = 0x86D7; +// public const int GL_NV_explicit_multisample = 1; +// public const int GL_SAMPLE_POSITION_NV = 0x8E50; +// public const int GL_SAMPLE_MASK_NV = 0x8E51; +// public const int GL_SAMPLE_MASK_VALUE_NV = 0x8E52; +// public const int GL_TEXTURE_BINDING_RENDERBUFFER_NV = 0x8E53; +// public const int GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV = 0x8E54; +// public const int GL_TEXTURE_RENDERBUFFER_NV = 0x8E55; +// public const int GL_SAMPLER_RENDERBUFFER_NV = 0x8E56; +// public const int GL_INT_SAMPLER_RENDERBUFFER_NV = 0x8E57; +// public const int GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV = 0x8E58; +// public const int GL_MAX_SAMPLE_MASK_WORDS_NV = 0x8E59; +// public const int GL_NV_fence = 1; +// public const int GL_ALL_COMPLETED_NV = 0x84F2; +// public const int GL_FENCE_STATUS_NV = 0x84F3; +// public const int GL_FENCE_CONDITION_NV = 0x84F4; +// public const int GL_NV_fill_rectangle = 1; +// public const int GL_FILL_RECTANGLE_NV = 0x933C; +// public const int GL_NV_float_buffer = 1; +// public const int GL_FLOAT_R_NV = 0x8880; +// public const int GL_FLOAT_RG_NV = 0x8881; +// public const int GL_FLOAT_RGB_NV = 0x8882; +// public const int GL_FLOAT_RGBA_NV = 0x8883; +// public const int GL_FLOAT_R16_NV = 0x8884; +// public const int GL_FLOAT_R32_NV = 0x8885; +// public const int GL_FLOAT_RG16_NV = 0x8886; +// public const int GL_FLOAT_RG32_NV = 0x8887; +// public const int GL_FLOAT_RGB16_NV = 0x8888; +// public const int GL_FLOAT_RGB32_NV = 0x8889; +// public const int GL_FLOAT_RGBA16_NV = 0x888A; +// public const int GL_FLOAT_RGBA32_NV = 0x888B; +// public const int GL_TEXTURE_FLOAT_COMPONENTS_NV = 0x888C; +// public const int GL_FLOAT_CLEAR_COLOR_VALUE_NV = 0x888D; +// public const int GL_FLOAT_RGBA_MODE_NV = 0x888E; +// public const int GL_NV_fog_distance = 1; +// public const int GL_FOG_DISTANCE_MODE_NV = 0x855A; +// public const int GL_EYE_RADIAL_NV = 0x855B; +// public const int GL_EYE_PLANE_ABSOLUTE_NV = 0x855C; +// public const int GL_NV_fragment_coverage_to_color = 1; +// public const int GL_FRAGMENT_COVERAGE_TO_COLOR_NV = 0x92DD; +// public const int GL_FRAGMENT_COVERAGE_COLOR_NV = 0x92DE; +// public const int GL_NV_fragment_program = 1; +// public const int GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV = 0x8868; +// public const int GL_FRAGMENT_PROGRAM_NV = 0x8870; +// public const int GL_MAX_TEXTURE_COORDS_NV = 0x8871; +// public const int GL_MAX_TEXTURE_IMAGE_UNITS_NV = 0x8872; +// public const int GL_FRAGMENT_PROGRAM_BINDING_NV = 0x8873; +// public const int GL_PROGRAM_ERROR_STRING_NV = 0x8874; +// public const int GL_NV_fragment_program2 = 1; +// public const int GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV = 0x88F4; +// public const int GL_MAX_PROGRAM_CALL_DEPTH_NV = 0x88F5; +// public const int GL_MAX_PROGRAM_IF_DEPTH_NV = 0x88F6; +// public const int GL_MAX_PROGRAM_LOOP_DEPTH_NV = 0x88F7; +// public const int GL_MAX_PROGRAM_LOOP_COUNT_NV = 0x88F8; +// public const int GL_NV_fragment_program4 = 1; +// public const int GL_NV_fragment_program_option = 1; +// public const int GL_NV_fragment_shader_interlock = 1; +// public const int GL_NV_framebuffer_mixed_samples = 1; +// public const int GL_COVERAGE_MODULATION_TABLE_NV = 0x9331; +// public const int GL_COLOR_SAMPLES_NV = 0x8E20; +// public const int GL_DEPTH_SAMPLES_NV = 0x932D; +// public const int GL_STENCIL_SAMPLES_NV = 0x932E; +// public const int GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV = 0x932F; +// public const int GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV = 0x9330; +// public const int GL_COVERAGE_MODULATION_NV = 0x9332; +// public const int GL_COVERAGE_MODULATION_TABLE_SIZE_NV = 0x9333; +// public const int GL_NV_framebuffer_multisample_coverage = 1; +// public const int GL_RENDERBUFFER_COVERAGE_SAMPLES_NV = 0x8CAB; +// public const int GL_RENDERBUFFER_COLOR_SAMPLES_NV = 0x8E10; +// public const int GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV = 0x8E11; +// public const int GL_MULTISAMPLE_COVERAGE_MODES_NV = 0x8E12; +// public const int GL_NV_geometry_program4 = 1; +// public const int GL_GEOMETRY_PROGRAM_NV = 0x8C26; +// public const int GL_MAX_PROGRAM_OUTPUT_VERTICES_NV = 0x8C27; +// public const int GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV = 0x8C28; +// public const int GL_NV_geometry_shader4 = 1; +// public const int GL_NV_geometry_shader_passthrough = 1; +// public const int GL_NV_gpu_multicast = 1; +// public const int GL_PER_GPU_STORAGE_BIT_NV = 0x0800; +// public const int GL_MULTICAST_GPUS_NV = 0x92BA; +// public const int GL_RENDER_GPU_MASK_NV = 0x9558; +// public const int GL_PER_GPU_STORAGE_NV = 0x9548; +// public const int GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9549; +// public const int GL_NV_gpu_program4 = 1; +// public const int GL_MIN_PROGRAM_TEXEL_OFFSET_NV = 0x8904; +// public const int GL_MAX_PROGRAM_TEXEL_OFFSET_NV = 0x8905; +// public const int GL_PROGRAM_ATTRIB_COMPONENTS_NV = 0x8906; +// public const int GL_PROGRAM_RESULT_COMPONENTS_NV = 0x8907; +// public const int GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV = 0x8908; +// public const int GL_MAX_PROGRAM_RESULT_COMPONENTS_NV = 0x8909; +// public const int GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV = 0x8DA5; +// public const int GL_MAX_PROGRAM_GENERIC_RESULTS_NV = 0x8DA6; +// public const int GL_NV_gpu_program5 = 1; +// public const int GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV = 0x8E5A; +// public const int GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5B; +// public const int GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV = 0x8E5C; +// public const int GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV = 0x8E5D; +// public const int GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV = 0x8E5E; +// public const int GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV = 0x8E5F; +// public const int GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV = 0x8F44; +// public const int GL_MAX_PROGRAM_SUBROUTINE_NUM_NV = 0x8F45; +// public const int GL_NV_gpu_program5_mem_extended = 1; +// public const int GL_NV_gpu_shader5 = 1; +// public const int GL_NV_half_float = 1; +// public const int GL_HALF_FLOAT_NV = 0x140B; +// public const int GL_NV_internalformat_sample_query = 1; +// public const int GL_MULTISAMPLES_NV = 0x9371; +// public const int GL_SUPERSAMPLE_SCALE_X_NV = 0x9372; +// public const int GL_SUPERSAMPLE_SCALE_Y_NV = 0x9373; +// public const int GL_CONFORMANT_NV = 0x9374; +// public const int GL_NV_light_max_exponent = 1; +// public const int GL_MAX_SHININESS_NV = 0x8504; +// public const int GL_MAX_SPOT_EXPONENT_NV = 0x8505; +// public const int GL_NV_multisample_coverage = 1; +// public const int GL_NV_multisample_filter_hint = 1; +// public const int GL_MULTISAMPLE_FILTER_HINT_NV = 0x8534; +// public const int GL_NV_occlusion_query = 1; +// public const int GL_PIXEL_COUNTER_BITS_NV = 0x8864; +// public const int GL_CURRENT_OCCLUSION_QUERY_ID_NV = 0x8865; +// public const int GL_PIXEL_COUNT_NV = 0x8866; +// public const int GL_PIXEL_COUNT_AVAILABLE_NV = 0x8867; +// public const int GL_NV_packed_depth_stencil = 1; +// public const int GL_DEPTH_STENCIL_NV = 0x84F9; +// public const int GL_UNSIGNED_INT_24_8_NV = 0x84FA; +// public const int GL_NV_parameter_buffer_object = 1; +// public const int GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV = 0x8DA0; +// public const int GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV = 0x8DA1; +// public const int GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA2; +// public const int GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA3; +// public const int GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV = 0x8DA4; +// public const int GL_NV_parameter_buffer_object2 = 1; +// public const int GL_NV_path_rendering = 1; +// public const int GL_PATH_FORMAT_SVG_NV = 0x9070; +// public const int GL_PATH_FORMAT_PS_NV = 0x9071; +// public const int GL_STANDARD_FONT_NAME_NV = 0x9072; +// public const int GL_SYSTEM_FONT_NAME_NV = 0x9073; +// public const int GL_FILE_NAME_NV = 0x9074; +// public const int GL_PATH_STROKE_WIDTH_NV = 0x9075; +// public const int GL_PATH_END_CAPS_NV = 0x9076; +// public const int GL_PATH_INITIAL_END_CAP_NV = 0x9077; +// public const int GL_PATH_TERMINAL_END_CAP_NV = 0x9078; +// public const int GL_PATH_JOIN_STYLE_NV = 0x9079; +// public const int GL_PATH_MITER_LIMIT_NV = 0x907A; +// public const int GL_PATH_DASH_CAPS_NV = 0x907B; +// public const int GL_PATH_INITIAL_DASH_CAP_NV = 0x907C; +// public const int GL_PATH_TERMINAL_DASH_CAP_NV = 0x907D; +// public const int GL_PATH_DASH_OFFSET_NV = 0x907E; +// public const int GL_PATH_CLIENT_LENGTH_NV = 0x907F; +// public const int GL_PATH_FILL_MODE_NV = 0x9080; +// public const int GL_PATH_FILL_MASK_NV = 0x9081; +// public const int GL_PATH_FILL_COVER_MODE_NV = 0x9082; +// public const int GL_PATH_STROKE_COVER_MODE_NV = 0x9083; +// public const int GL_PATH_STROKE_MASK_NV = 0x9084; +// public const int GL_COUNT_UP_NV = 0x9088; +// public const int GL_COUNT_DOWN_NV = 0x9089; +// public const int GL_PATH_OBJECT_BOUNDING_BOX_NV = 0x908A; +// public const int GL_CONVEX_HULL_NV = 0x908B; +// public const int GL_BOUNDING_BOX_NV = 0x908D; +// public const int GL_TRANSLATE_X_NV = 0x908E; +// public const int GL_TRANSLATE_Y_NV = 0x908F; +// public const int GL_TRANSLATE_2D_NV = 0x9090; +// public const int GL_TRANSLATE_3D_NV = 0x9091; +// public const int GL_AFFINE_2D_NV = 0x9092; +// public const int GL_AFFINE_3D_NV = 0x9094; +// public const int GL_TRANSPOSE_AFFINE_2D_NV = 0x9096; +// public const int GL_TRANSPOSE_AFFINE_3D_NV = 0x9098; +// public const int GL_UTF8_NV = 0x909A; +// public const int GL_UTF16_NV = 0x909B; +// public const int GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV = 0x909C; +// public const int GL_PATH_COMMAND_COUNT_NV = 0x909D; +// public const int GL_PATH_COORD_COUNT_NV = 0x909E; +// public const int GL_PATH_DASH_ARRAY_COUNT_NV = 0x909F; +// public const int GL_PATH_COMPUTED_LENGTH_NV = 0x90A0; +// public const int GL_PATH_FILL_BOUNDING_BOX_NV = 0x90A1; +// public const int GL_PATH_STROKE_BOUNDING_BOX_NV = 0x90A2; +// public const int GL_SQUARE_NV = 0x90A3; +// public const int GL_ROUND_NV = 0x90A4; +// public const int GL_TRIANGULAR_NV = 0x90A5; +// public const int GL_BEVEL_NV = 0x90A6; +// public const int GL_MITER_REVERT_NV = 0x90A7; +// public const int GL_MITER_TRUNCATE_NV = 0x90A8; +// public const int GL_SKIP_MISSING_GLYPH_NV = 0x90A9; +// public const int GL_USE_MISSING_GLYPH_NV = 0x90AA; +// public const int GL_PATH_ERROR_POSITION_NV = 0x90AB; +// public const int GL_ACCUM_ADJACENT_PAIRS_NV = 0x90AD; +// public const int GL_ADJACENT_PAIRS_NV = 0x90AE; +// public const int GL_FIRST_TO_REST_NV = 0x90AF; +// public const int GL_PATH_GEN_MODE_NV = 0x90B0; +// public const int GL_PATH_GEN_COEFF_NV = 0x90B1; +// public const int GL_PATH_GEN_COMPONENTS_NV = 0x90B3; +// public const int GL_PATH_STENCIL_FUNC_NV = 0x90B7; +// public const int GL_PATH_STENCIL_REF_NV = 0x90B8; +// public const int GL_PATH_STENCIL_VALUE_MASK_NV = 0x90B9; +// public const int GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV = 0x90BD; +// public const int GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV = 0x90BE; +// public const int GL_PATH_COVER_DEPTH_FUNC_NV = 0x90BF; +// public const int GL_PATH_DASH_OFFSET_RESET_NV = 0x90B4; +// public const int GL_MOVE_TO_RESETS_NV = 0x90B5; +// public const int GL_MOVE_TO_CONTINUES_NV = 0x90B6; +// public const int GL_CLOSE_PATH_NV = 0x00; +// public const int GL_MOVE_TO_NV = 0x02; +// public const int GL_RELATIVE_MOVE_TO_NV = 0x03; +// public const int GL_LINE_TO_NV = 0x04; +// public const int GL_RELATIVE_LINE_TO_NV = 0x05; +// public const int GL_HORIZONTAL_LINE_TO_NV = 0x06; +// public const int GL_RELATIVE_HORIZONTAL_LINE_TO_NV = 0x07; +// public const int GL_VERTICAL_LINE_TO_NV = 0x08; +// public const int GL_RELATIVE_VERTICAL_LINE_TO_NV = 0x09; +// public const int GL_QUADRATIC_CURVE_TO_NV = 0x0A; +// public const int GL_RELATIVE_QUADRATIC_CURVE_TO_NV = 0x0B; +// public const int GL_CUBIC_CURVE_TO_NV = 0x0C; +// public const int GL_RELATIVE_CUBIC_CURVE_TO_NV = 0x0D; +// public const int GL_SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0E; +// public const int GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV = 0x0F; +// public const int GL_SMOOTH_CUBIC_CURVE_TO_NV = 0x10; +// public const int GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV = 0x11; +// public const int GL_SMALL_CCW_ARC_TO_NV = 0x12; +// public const int GL_RELATIVE_SMALL_CCW_ARC_TO_NV = 0x13; +// public const int GL_SMALL_CW_ARC_TO_NV = 0x14; +// public const int GL_RELATIVE_SMALL_CW_ARC_TO_NV = 0x15; +// public const int GL_LARGE_CCW_ARC_TO_NV = 0x16; +// public const int GL_RELATIVE_LARGE_CCW_ARC_TO_NV = 0x17; +// public const int GL_LARGE_CW_ARC_TO_NV = 0x18; +// public const int GL_RELATIVE_LARGE_CW_ARC_TO_NV = 0x19; +// public const int GL_RESTART_PATH_NV = 0xF0; +// public const int GL_DUP_FIRST_CUBIC_CURVE_TO_NV = 0xF2; +// public const int GL_DUP_LAST_CUBIC_CURVE_TO_NV = 0xF4; +// public const int GL_RECT_NV = 0xF6; +// public const int GL_CIRCULAR_CCW_ARC_TO_NV = 0xF8; +// public const int GL_CIRCULAR_CW_ARC_TO_NV = 0xFA; +// public const int GL_CIRCULAR_TANGENT_ARC_TO_NV = 0xFC; +// public const int GL_ARC_TO_NV = 0xFE; +// public const int GL_RELATIVE_ARC_TO_NV = 0xFF; +// public const int GL_BOLD_BIT_NV = 0x01; +// public const int GL_ITALIC_BIT_NV = 0x02; +// public const int GL_GLYPH_WIDTH_BIT_NV = 0x01; +// public const int GL_GLYPH_HEIGHT_BIT_NV = 0x02; +// public const int GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV = 0x04; +// public const int GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV = 0x08; +// public const int GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV = 0x10; +// public const int GL_GLYPH_VERTICAL_BEARING_X_BIT_NV = 0x20; +// public const int GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV = 0x40; +// public const int GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV = 0x80; +// public const int GL_GLYPH_HAS_KERNING_BIT_NV = 0x100; +// public const int GL_FONT_X_MIN_BOUNDS_BIT_NV = 0x00010000; +// public const int GL_FONT_Y_MIN_BOUNDS_BIT_NV = 0x00020000; +// public const int GL_FONT_X_MAX_BOUNDS_BIT_NV = 0x00040000; +// public const int GL_FONT_Y_MAX_BOUNDS_BIT_NV = 0x00080000; +// public const int GL_FONT_UNITS_PER_EM_BIT_NV = 0x00100000; +// public const int GL_FONT_ASCENDER_BIT_NV = 0x00200000; +// public const int GL_FONT_DESCENDER_BIT_NV = 0x00400000; +// public const int GL_FONT_HEIGHT_BIT_NV = 0x00800000; +// public const int GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV = 0x01000000; +// public const int GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV = 0x02000000; +// public const int GL_FONT_UNDERLINE_POSITION_BIT_NV = 0x04000000; +// public const int GL_FONT_UNDERLINE_THICKNESS_BIT_NV = 0x08000000; +// public const int GL_FONT_HAS_KERNING_BIT_NV = 0x10000000; +// public const int GL_ROUNDED_RECT_NV = 0xE8; +// public const int GL_RELATIVE_ROUNDED_RECT_NV = 0xE9; +// public const int GL_ROUNDED_RECT2_NV = 0xEA; +// public const int GL_RELATIVE_ROUNDED_RECT2_NV = 0xEB; +// public const int GL_ROUNDED_RECT4_NV = 0xEC; +// public const int GL_RELATIVE_ROUNDED_RECT4_NV = 0xED; +// public const int GL_ROUNDED_RECT8_NV = 0xEE; +// public const int GL_RELATIVE_ROUNDED_RECT8_NV = 0xEF; +// public const int GL_RELATIVE_RECT_NV = 0xF7; +// public const int GL_FONT_GLYPHS_AVAILABLE_NV = 0x9368; +// public const int GL_FONT_TARGET_UNAVAILABLE_NV = 0x9369; +// public const int GL_FONT_UNAVAILABLE_NV = 0x936A; +// public const int GL_FONT_UNINTELLIGIBLE_NV = 0x936B; +// public const int GL_CONIC_CURVE_TO_NV = 0x1A; +// public const int GL_RELATIVE_CONIC_CURVE_TO_NV = 0x1B; +// public const int GL_FONT_NUM_GLYPH_INDICES_BIT_NV = 0x20000000; +// public const int GL_STANDARD_FONT_FORMAT_NV = 0x936C; +// public const int GL_2_BYTES_NV = 0x1407; +// public const int GL_3_BYTES_NV = 0x1408; +// public const int GL_4_BYTES_NV = 0x1409; +// public const int GL_EYE_LINEAR_NV = 0x2400; +// public const int GL_OBJECT_LINEAR_NV = 0x2401; +// public const int GL_CONSTANT_NV = 0x8576; +// public const int GL_PATH_FOG_GEN_MODE_NV = 0x90AC; +// public const int GL_PRIMARY_COLOR_NV = 0x852C; +// public const int GL_SECONDARY_COLOR_NV = 0x852D; +// public const int GL_PATH_GEN_COLOR_FORMAT_NV = 0x90B2; +// public const int GL_PATH_PROJECTION_NV = 0x1701; +// public const int GL_PATH_MODELVIEW_NV = 0x1700; +// public const int GL_PATH_MODELVIEW_STACK_DEPTH_NV = 0x0BA3; +// public const int GL_PATH_MODELVIEW_MATRIX_NV = 0x0BA6; +// public const int GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV = 0x0D36; +// public const int GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV = 0x84E3; +// public const int GL_PATH_PROJECTION_STACK_DEPTH_NV = 0x0BA4; +// public const int GL_PATH_PROJECTION_MATRIX_NV = 0x0BA7; +// public const int GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV = 0x0D38; +// public const int GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV = 0x84E4; +// public const int GL_FRAGMENT_INPUT_NV = 0x936D; +// public const int GL_NV_path_rendering_shared_edge = 1; +// public const int GL_SHARED_EDGE_NV = 0xC0; +// public const int GL_NV_pixel_data_range = 1; +// public const int GL_WRITE_PIXEL_DATA_RANGE_NV = 0x8878; +// public const int GL_READ_PIXEL_DATA_RANGE_NV = 0x8879; +// public const int GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV = 0x887A; +// public const int GL_READ_PIXEL_DATA_RANGE_LENGTH_NV = 0x887B; +// public const int GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV = 0x887C; +// public const int GL_READ_PIXEL_DATA_RANGE_POINTER_NV = 0x887D; +// public const int GL_NV_point_sprite = 1; +// public const int GL_POINT_SPRITE_NV = 0x8861; +// public const int GL_COORD_REPLACE_NV = 0x8862; +// public const int GL_POINT_SPRITE_R_MODE_NV = 0x8863; +// public const int GL_NV_present_video = 1; +// public const int GL_FRAME_NV = 0x8E26; +// public const int GL_FIELDS_NV = 0x8E27; +// public const int GL_CURRENT_TIME_NV = 0x8E28; +// public const int GL_NUM_FILL_STREAMS_NV = 0x8E29; +// public const int GL_PRESENT_TIME_NV = 0x8E2A; +// public const int GL_PRESENT_DURATION_NV = 0x8E2B; +// public const int GL_NV_primitive_restart = 1; +// public const int GL_PRIMITIVE_RESTART_NV = 0x8558; +// public const int GL_PRIMITIVE_RESTART_INDEX_NV = 0x8559; +// public const int GL_NV_query_resource = 1; +// public const int GL_QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV = 0x9540; +// public const int GL_QUERY_RESOURCE_MEMTYPE_VIDMEM_NV = 0x9542; +// public const int GL_QUERY_RESOURCE_SYS_RESERVED_NV = 0x9544; +// public const int GL_QUERY_RESOURCE_TEXTURE_NV = 0x9545; +// public const int GL_QUERY_RESOURCE_RENDERBUFFER_NV = 0x9546; +// public const int GL_QUERY_RESOURCE_BUFFEROBJECT_NV = 0x9547; +// public const int GL_NV_query_resource_tag = 1; +// public const int GL_NV_register_combiners = 1; +// public const int GL_REGISTER_COMBINERS_NV = 0x8522; +// public const int GL_VARIABLE_A_NV = 0x8523; +// public const int GL_VARIABLE_B_NV = 0x8524; +// public const int GL_VARIABLE_C_NV = 0x8525; +// public const int GL_VARIABLE_D_NV = 0x8526; +// public const int GL_VARIABLE_E_NV = 0x8527; +// public const int GL_VARIABLE_F_NV = 0x8528; +// public const int GL_VARIABLE_G_NV = 0x8529; +// public const int GL_CONSTANT_COLOR0_NV = 0x852A; +// public const int GL_CONSTANT_COLOR1_NV = 0x852B; +// public const int GL_SPARE0_NV = 0x852E; +// public const int GL_SPARE1_NV = 0x852F; +// public const int GL_DISCARD_NV = 0x8530; +// public const int GL_E_TIMES_F_NV = 0x8531; +// public const int GL_SPARE0_PLUS_SECONDARY_COLOR_NV = 0x8532; +// public const int GL_UNSIGNED_IDENTITY_NV = 0x8536; +// public const int GL_UNSIGNED_INVERT_NV = 0x8537; +// public const int GL_EXPAND_NORMAL_NV = 0x8538; +// public const int GL_EXPAND_NEGATE_NV = 0x8539; +// public const int GL_HALF_BIAS_NORMAL_NV = 0x853A; +// public const int GL_HALF_BIAS_NEGATE_NV = 0x853B; +// public const int GL_SIGNED_IDENTITY_NV = 0x853C; +// public const int GL_SIGNED_NEGATE_NV = 0x853D; +// public const int GL_SCALE_BY_TWO_NV = 0x853E; +// public const int GL_SCALE_BY_FOUR_NV = 0x853F; +// public const int GL_SCALE_BY_ONE_HALF_NV = 0x8540; +// public const int GL_BIAS_BY_NEGATIVE_ONE_HALF_NV = 0x8541; +// public const int GL_COMBINER_INPUT_NV = 0x8542; +// public const int GL_COMBINER_MAPPING_NV = 0x8543; +// public const int GL_COMBINER_COMPONENT_USAGE_NV = 0x8544; +// public const int GL_COMBINER_AB_DOT_PRODUCT_NV = 0x8545; +// public const int GL_COMBINER_CD_DOT_PRODUCT_NV = 0x8546; +// public const int GL_COMBINER_MUX_SUM_NV = 0x8547; +// public const int GL_COMBINER_SCALE_NV = 0x8548; +// public const int GL_COMBINER_BIAS_NV = 0x8549; +// public const int GL_COMBINER_AB_OUTPUT_NV = 0x854A; +// public const int GL_COMBINER_CD_OUTPUT_NV = 0x854B; +// public const int GL_COMBINER_SUM_OUTPUT_NV = 0x854C; +// public const int GL_MAX_GENERAL_COMBINERS_NV = 0x854D; +// public const int GL_NUM_GENERAL_COMBINERS_NV = 0x854E; +// public const int GL_COLOR_SUM_CLAMP_NV = 0x854F; +// public const int GL_COMBINER0_NV = 0x8550; +// public const int GL_COMBINER1_NV = 0x8551; +// public const int GL_COMBINER2_NV = 0x8552; +// public const int GL_COMBINER3_NV = 0x8553; +// public const int GL_COMBINER4_NV = 0x8554; +// public const int GL_COMBINER5_NV = 0x8555; +// public const int GL_COMBINER6_NV = 0x8556; +// public const int GL_COMBINER7_NV = 0x8557; +// public const int GL_NV_register_combiners2 = 1; +// public const int GL_PER_STAGE_CONSTANTS_NV = 0x8535; +// public const int GL_NV_robustness_video_memory_purge = 1; +// public const int GL_PURGED_CONTEXT_RESET_NV = 0x92BB; +// public const int GL_NV_sample_locations = 1; +// public const int GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV = 0x933D; +// public const int GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV = 0x933E; +// public const int GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV = 0x933F; +// public const int GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV = 0x9340; +// public const int GL_SAMPLE_LOCATION_NV = 0x8E50; +// public const int GL_PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9341; +// public const int GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV = 0x9342; +// public const int GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV = 0x9343; +// public const int GL_NV_sample_mask_override_coverage = 1; +// public const int GL_NV_shader_atomic_counters = 1; +// public const int GL_NV_shader_atomic_float = 1; +// public const int GL_NV_shader_atomic_float64 = 1; +// public const int GL_NV_shader_atomic_fp16_vector = 1; +// public const int GL_NV_shader_atomic_int64 = 1; +// public const int GL_NV_shader_buffer_load = 1; +// public const int GL_BUFFER_GPU_ADDRESS_NV = 0x8F1D; +// public const int GL_GPU_ADDRESS_NV = 0x8F34; +// public const int GL_MAX_SHADER_BUFFER_ADDRESS_NV = 0x8F35; +// public const int GL_NV_shader_buffer_store = 1; +// public const int GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV = 0x00000010; +// public const int GL_NV_shader_storage_buffer_object = 1; +// public const int GL_NV_shader_thread_group = 1; +// public const int GL_WARP_SIZE_NV = 0x9339; +// public const int GL_WARPS_PER_SM_NV = 0x933A; +// public const int GL_SM_COUNT_NV = 0x933B; +// public const int GL_NV_shader_thread_shuffle = 1; +// public const int GL_NV_stereo_view_rendering = 1; +// public const int GL_NV_tessellation_program5 = 1; +// public const int GL_MAX_PROGRAM_PATCH_ATTRIBS_NV = 0x86D8; +// public const int GL_TESS_CONTROL_PROGRAM_NV = 0x891E; +// public const int GL_TESS_EVALUATION_PROGRAM_NV = 0x891F; +// public const int GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV = 0x8C74; +// public const int GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV = 0x8C75; +// public const int GL_NV_texgen_emboss = 1; +// public const int GL_EMBOSS_LIGHT_NV = 0x855D; +// public const int GL_EMBOSS_CONSTANT_NV = 0x855E; +// public const int GL_EMBOSS_MAP_NV = 0x855F; +// public const int GL_NV_texgen_reflection = 1; +// public const int GL_NORMAL_MAP_NV = 0x8511; +// public const int GL_REFLECTION_MAP_NV = 0x8512; +// public const int GL_NV_texture_barrier = 1; +// public const int GL_NV_texture_compression_vtc = 1; +// public const int GL_NV_texture_env_combine4 = 1; +// public const int GL_COMBINE4_NV = 0x8503; +// public const int GL_SOURCE3_RGB_NV = 0x8583; +// public const int GL_SOURCE3_ALPHA_NV = 0x858B; +// public const int GL_OPERAND3_RGB_NV = 0x8593; +// public const int GL_OPERAND3_ALPHA_NV = 0x859B; +// public const int GL_NV_texture_expand_normal = 1; +// public const int GL_TEXTURE_UNSIGNED_REMAP_MODE_NV = 0x888F; +// public const int GL_NV_texture_multisample = 1; +// public const int GL_TEXTURE_COVERAGE_SAMPLES_NV = 0x9045; +// public const int GL_TEXTURE_COLOR_SAMPLES_NV = 0x9046; +// public const int GL_NV_texture_rectangle = 1; +// public const int GL_TEXTURE_RECTANGLE_NV = 0x84F5; +// public const int GL_TEXTURE_BINDING_RECTANGLE_NV = 0x84F6; +// public const int GL_PROXY_TEXTURE_RECTANGLE_NV = 0x84F7; +// public const int GL_MAX_RECTANGLE_TEXTURE_SIZE_NV = 0x84F8; +// public const int GL_NV_texture_rectangle_compressed = 1; +// public const int GL_NV_texture_shader = 1; +// public const int GL_OFFSET_TEXTURE_RECTANGLE_NV = 0x864C; +// public const int GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV = 0x864D; +// public const int GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV = 0x864E; +// public const int GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV = 0x86D9; +// public const int GL_UNSIGNED_INT_S8_S8_8_8_NV = 0x86DA; +// public const int GL_UNSIGNED_INT_8_8_S8_S8_REV_NV = 0x86DB; +// public const int GL_DSDT_MAG_INTENSITY_NV = 0x86DC; +// public const int GL_SHADER_CONSISTENT_NV = 0x86DD; +// public const int GL_TEXTURE_SHADER_NV = 0x86DE; +// public const int GL_SHADER_OPERATION_NV = 0x86DF; +// public const int GL_CULL_MODES_NV = 0x86E0; +// public const int GL_OFFSET_TEXTURE_MATRIX_NV = 0x86E1; +// public const int GL_OFFSET_TEXTURE_SCALE_NV = 0x86E2; +// public const int GL_OFFSET_TEXTURE_BIAS_NV = 0x86E3; +// public const int GL_OFFSET_TEXTURE_2D_MATRIX_NV = 0x86E1; +// public const int GL_OFFSET_TEXTURE_2D_SCALE_NV = 0x86E2; +// public const int GL_OFFSET_TEXTURE_2D_BIAS_NV = 0x86E3; +// public const int GL_PREVIOUS_TEXTURE_INPUT_NV = 0x86E4; +// public const int GL_CONST_EYE_NV = 0x86E5; +// public const int GL_PASS_THROUGH_NV = 0x86E6; +// public const int GL_CULL_FRAGMENT_NV = 0x86E7; +// public const int GL_OFFSET_TEXTURE_2D_NV = 0x86E8; +// public const int GL_DEPENDENT_AR_TEXTURE_2D_NV = 0x86E9; +// public const int GL_DEPENDENT_GB_TEXTURE_2D_NV = 0x86EA; +// public const int GL_DOT_PRODUCT_NV = 0x86EC; +// public const int GL_DOT_PRODUCT_DEPTH_REPLACE_NV = 0x86ED; +// public const int GL_DOT_PRODUCT_TEXTURE_2D_NV = 0x86EE; +// public const int GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV = 0x86F0; +// public const int GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV = 0x86F1; +// public const int GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV = 0x86F2; +// public const int GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV = 0x86F3; +// public const int GL_HILO_NV = 0x86F4; +// public const int GL_DSDT_NV = 0x86F5; +// public const int GL_DSDT_MAG_NV = 0x86F6; +// public const int GL_DSDT_MAG_VIB_NV = 0x86F7; +// public const int GL_HILO16_NV = 0x86F8; +// public const int GL_SIGNED_HILO_NV = 0x86F9; +// public const int GL_SIGNED_HILO16_NV = 0x86FA; +// public const int GL_SIGNED_RGBA_NV = 0x86FB; +// public const int GL_SIGNED_RGBA8_NV = 0x86FC; +// public const int GL_SIGNED_RGB_NV = 0x86FE; +// public const int GL_SIGNED_RGB8_NV = 0x86FF; +// public const int GL_SIGNED_LUMINANCE_NV = 0x8701; +// public const int GL_SIGNED_LUMINANCE8_NV = 0x8702; +// public const int GL_SIGNED_LUMINANCE_ALPHA_NV = 0x8703; +// public const int GL_SIGNED_LUMINANCE8_ALPHA8_NV = 0x8704; +// public const int GL_SIGNED_ALPHA_NV = 0x8705; +// public const int GL_SIGNED_ALPHA8_NV = 0x8706; +// public const int GL_SIGNED_INTENSITY_NV = 0x8707; +// public const int GL_SIGNED_INTENSITY8_NV = 0x8708; +// public const int GL_DSDT8_NV = 0x8709; +// public const int GL_DSDT8_MAG8_NV = 0x870A; +// public const int GL_DSDT8_MAG8_INTENSITY8_NV = 0x870B; +// public const int GL_SIGNED_RGB_UNSIGNED_ALPHA_NV = 0x870C; +// public const int GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV = 0x870D; +// public const int GL_HI_SCALE_NV = 0x870E; +// public const int GL_LO_SCALE_NV = 0x870F; +// public const int GL_DS_SCALE_NV = 0x8710; +// public const int GL_DT_SCALE_NV = 0x8711; +// public const int GL_MAGNITUDE_SCALE_NV = 0x8712; +// public const int GL_VIBRANCE_SCALE_NV = 0x8713; +// public const int GL_HI_BIAS_NV = 0x8714; +// public const int GL_LO_BIAS_NV = 0x8715; +// public const int GL_DS_BIAS_NV = 0x8716; +// public const int GL_DT_BIAS_NV = 0x8717; +// public const int GL_MAGNITUDE_BIAS_NV = 0x8718; +// public const int GL_VIBRANCE_BIAS_NV = 0x8719; +// public const int GL_TEXTURE_BORDER_VALUES_NV = 0x871A; +// public const int GL_TEXTURE_HI_SIZE_NV = 0x871B; +// public const int GL_TEXTURE_LO_SIZE_NV = 0x871C; +// public const int GL_TEXTURE_DS_SIZE_NV = 0x871D; +// public const int GL_TEXTURE_DT_SIZE_NV = 0x871E; +// public const int GL_TEXTURE_MAG_SIZE_NV = 0x871F; +// public const int GL_NV_texture_shader2 = 1; +// public const int GL_DOT_PRODUCT_TEXTURE_3D_NV = 0x86EF; +// public const int GL_NV_texture_shader3 = 1; +// public const int GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV = 0x8850; +// public const int GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV = 0x8851; +// public const int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8852; +// public const int GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV = 0x8853; +// public const int GL_OFFSET_HILO_TEXTURE_2D_NV = 0x8854; +// public const int GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV = 0x8855; +// public const int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV = 0x8856; +// public const int GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV = 0x8857; +// public const int GL_DEPENDENT_HILO_TEXTURE_2D_NV = 0x8858; +// public const int GL_DEPENDENT_RGB_TEXTURE_3D_NV = 0x8859; +// public const int GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV = 0x885A; +// public const int GL_DOT_PRODUCT_PASS_THROUGH_NV = 0x885B; +// public const int GL_DOT_PRODUCT_TEXTURE_1D_NV = 0x885C; +// public const int GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV = 0x885D; +// public const int GL_HILO8_NV = 0x885E; +// public const int GL_SIGNED_HILO8_NV = 0x885F; +// public const int GL_FORCE_BLUE_TO_ONE_NV = 0x8860; +// public const int GL_NV_transform_feedback = 1; +// public const int GL_BACK_PRIMARY_COLOR_NV = 0x8C77; +// public const int GL_BACK_SECONDARY_COLOR_NV = 0x8C78; +// public const int GL_TEXTURE_COORD_NV = 0x8C79; +// public const int GL_CLIP_DISTANCE_NV = 0x8C7A; +// public const int GL_VERTEX_ID_NV = 0x8C7B; +// public const int GL_PRIMITIVE_ID_NV = 0x8C7C; +// public const int GL_GENERIC_ATTRIB_NV = 0x8C7D; +// public const int GL_TRANSFORM_FEEDBACK_ATTRIBS_NV = 0x8C7E; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV = 0x8C7F; +// public const int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV = 0x8C80; +// public const int GL_ACTIVE_VARYINGS_NV = 0x8C81; +// public const int GL_ACTIVE_VARYING_MAX_LENGTH_NV = 0x8C82; +// public const int GL_TRANSFORM_FEEDBACK_VARYINGS_NV = 0x8C83; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_START_NV = 0x8C84; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV = 0x8C85; +// public const int GL_TRANSFORM_FEEDBACK_RECORD_NV = 0x8C86; +// public const int GL_PRIMITIVES_GENERATED_NV = 0x8C87; +// public const int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV = 0x8C88; +// public const int GL_RASTERIZER_DISCARD_NV = 0x8C89; +// public const int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV = 0x8C8A; +// public const int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = 0x8C8B; +// public const int GL_INTERLEAVED_ATTRIBS_NV = 0x8C8C; +// public const int GL_SEPARATE_ATTRIBS_NV = 0x8C8D; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_NV = 0x8C8E; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV = 0x8C8F; +// public const int GL_LAYER_NV = 0x8DAA; +// public const int GL_NEXT_BUFFER_NV = -2; +// public const int GL_SKIP_COMPONENTS4_NV = -3; +// public const int GL_SKIP_COMPONENTS3_NV = -4; +// public const int GL_SKIP_COMPONENTS2_NV = -5; +// public const int GL_SKIP_COMPONENTS1_NV = -6; +// public const int GL_NV_transform_feedback2 = 1; +// public const int GL_TRANSFORM_FEEDBACK_NV = 0x8E22; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV = 0x8E23; +// public const int GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV = 0x8E24; +// public const int GL_TRANSFORM_FEEDBACK_BINDING_NV = 0x8E25; +// public const int GL_NV_uniform_buffer_unified_memory = 1; +// public const int GL_UNIFORM_BUFFER_UNIFIED_NV = 0x936E; +// public const int GL_UNIFORM_BUFFER_ADDRESS_NV = 0x936F; +// public const int GL_UNIFORM_BUFFER_LENGTH_NV = 0x9370; +// public const int GL_NV_vdpau_interop = 1; +// public const int GL_SURFACE_STATE_NV = 0x86EB; +// public const int GL_SURFACE_REGISTERED_NV = 0x86FD; +// public const int GL_SURFACE_MAPPED_NV = 0x8700; +// public const int GL_WRITE_DISCARD_NV = 0x88BE; +// public const int GL_NV_vertex_array_range = 1; +// public const int GL_VERTEX_ARRAY_RANGE_NV = 0x851D; +// public const int GL_VERTEX_ARRAY_RANGE_LENGTH_NV = 0x851E; +// public const int GL_VERTEX_ARRAY_RANGE_VALID_NV = 0x851F; +// public const int GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV = 0x8520; +// public const int GL_VERTEX_ARRAY_RANGE_POINTER_NV = 0x8521; +// public const int GL_NV_vertex_array_range2 = 1; +// public const int GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV = 0x8533; +// public const int GL_NV_vertex_attrib_integer_64bit = 1; +// public const int GL_NV_vertex_buffer_unified_memory = 1; +// public const int GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV = 0x8F1E; +// public const int GL_ELEMENT_ARRAY_UNIFIED_NV = 0x8F1F; +// public const int GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV = 0x8F20; +// public const int GL_VERTEX_ARRAY_ADDRESS_NV = 0x8F21; +// public const int GL_NORMAL_ARRAY_ADDRESS_NV = 0x8F22; +// public const int GL_COLOR_ARRAY_ADDRESS_NV = 0x8F23; +// public const int GL_INDEX_ARRAY_ADDRESS_NV = 0x8F24; +// public const int GL_TEXTURE_COORD_ARRAY_ADDRESS_NV = 0x8F25; +// public const int GL_EDGE_FLAG_ARRAY_ADDRESS_NV = 0x8F26; +// public const int GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV = 0x8F27; +// public const int GL_FOG_COORD_ARRAY_ADDRESS_NV = 0x8F28; +// public const int GL_ELEMENT_ARRAY_ADDRESS_NV = 0x8F29; +// public const int GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV = 0x8F2A; +// public const int GL_VERTEX_ARRAY_LENGTH_NV = 0x8F2B; +// public const int GL_NORMAL_ARRAY_LENGTH_NV = 0x8F2C; +// public const int GL_COLOR_ARRAY_LENGTH_NV = 0x8F2D; +// public const int GL_INDEX_ARRAY_LENGTH_NV = 0x8F2E; +// public const int GL_TEXTURE_COORD_ARRAY_LENGTH_NV = 0x8F2F; +// public const int GL_EDGE_FLAG_ARRAY_LENGTH_NV = 0x8F30; +// public const int GL_SECONDARY_COLOR_ARRAY_LENGTH_NV = 0x8F31; +// public const int GL_FOG_COORD_ARRAY_LENGTH_NV = 0x8F32; +// public const int GL_ELEMENT_ARRAY_LENGTH_NV = 0x8F33; +// public const int GL_DRAW_INDIRECT_UNIFIED_NV = 0x8F40; +// public const int GL_DRAW_INDIRECT_ADDRESS_NV = 0x8F41; +// public const int GL_DRAW_INDIRECT_LENGTH_NV = 0x8F42; +// public const int GL_NV_vertex_program = 1; +// public const int GL_VERTEX_PROGRAM_NV = 0x8620; +// public const int GL_VERTEX_STATE_PROGRAM_NV = 0x8621; +// public const int GL_ATTRIB_ARRAY_SIZE_NV = 0x8623; +// public const int GL_ATTRIB_ARRAY_STRIDE_NV = 0x8624; +// public const int GL_ATTRIB_ARRAY_TYPE_NV = 0x8625; +// public const int GL_CURRENT_ATTRIB_NV = 0x8626; +// public const int GL_PROGRAM_LENGTH_NV = 0x8627; +// public const int GL_PROGRAM_STRING_NV = 0x8628; +// public const int GL_MODELVIEW_PROJECTION_NV = 0x8629; +// public const int GL_IDENTITY_NV = 0x862A; +// public const int GL_INVERSE_NV = 0x862B; +// public const int GL_TRANSPOSE_NV = 0x862C; +// public const int GL_INVERSE_TRANSPOSE_NV = 0x862D; +// public const int GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV = 0x862E; +// public const int GL_MAX_TRACK_MATRICES_NV = 0x862F; +// public const int GL_MATRIX0_NV = 0x8630; +// public const int GL_MATRIX1_NV = 0x8631; +// public const int GL_MATRIX2_NV = 0x8632; +// public const int GL_MATRIX3_NV = 0x8633; +// public const int GL_MATRIX4_NV = 0x8634; +// public const int GL_MATRIX5_NV = 0x8635; +// public const int GL_MATRIX6_NV = 0x8636; +// public const int GL_MATRIX7_NV = 0x8637; +// public const int GL_CURRENT_MATRIX_STACK_DEPTH_NV = 0x8640; +// public const int GL_CURRENT_MATRIX_NV = 0x8641; +// public const int GL_VERTEX_PROGRAM_POINT_SIZE_NV = 0x8642; +// public const int GL_VERTEX_PROGRAM_TWO_SIDE_NV = 0x8643; +// public const int GL_PROGRAM_PARAMETER_NV = 0x8644; +// public const int GL_ATTRIB_ARRAY_POINTER_NV = 0x8645; +// public const int GL_PROGRAM_TARGET_NV = 0x8646; +// public const int GL_PROGRAM_RESIDENT_NV = 0x8647; +// public const int GL_TRACK_MATRIX_NV = 0x8648; +// public const int GL_TRACK_MATRIX_TRANSFORM_NV = 0x8649; +// public const int GL_VERTEX_PROGRAM_BINDING_NV = 0x864A; +// public const int GL_PROGRAM_ERROR_POSITION_NV = 0x864B; +// public const int GL_VERTEX_ATTRIB_ARRAY0_NV = 0x8650; +// public const int GL_VERTEX_ATTRIB_ARRAY1_NV = 0x8651; +// public const int GL_VERTEX_ATTRIB_ARRAY2_NV = 0x8652; +// public const int GL_VERTEX_ATTRIB_ARRAY3_NV = 0x8653; +// public const int GL_VERTEX_ATTRIB_ARRAY4_NV = 0x8654; +// public const int GL_VERTEX_ATTRIB_ARRAY5_NV = 0x8655; +// public const int GL_VERTEX_ATTRIB_ARRAY6_NV = 0x8656; +// public const int GL_VERTEX_ATTRIB_ARRAY7_NV = 0x8657; +// public const int GL_VERTEX_ATTRIB_ARRAY8_NV = 0x8658; +// public const int GL_VERTEX_ATTRIB_ARRAY9_NV = 0x8659; +// public const int GL_VERTEX_ATTRIB_ARRAY10_NV = 0x865A; +// public const int GL_VERTEX_ATTRIB_ARRAY11_NV = 0x865B; +// public const int GL_VERTEX_ATTRIB_ARRAY12_NV = 0x865C; +// public const int GL_VERTEX_ATTRIB_ARRAY13_NV = 0x865D; +// public const int GL_VERTEX_ATTRIB_ARRAY14_NV = 0x865E; +// public const int GL_VERTEX_ATTRIB_ARRAY15_NV = 0x865F; +// public const int GL_MAP1_VERTEX_ATTRIB0_4_NV = 0x8660; +// public const int GL_MAP1_VERTEX_ATTRIB1_4_NV = 0x8661; +// public const int GL_MAP1_VERTEX_ATTRIB2_4_NV = 0x8662; +// public const int GL_MAP1_VERTEX_ATTRIB3_4_NV = 0x8663; +// public const int GL_MAP1_VERTEX_ATTRIB4_4_NV = 0x8664; +// public const int GL_MAP1_VERTEX_ATTRIB5_4_NV = 0x8665; +// public const int GL_MAP1_VERTEX_ATTRIB6_4_NV = 0x8666; +// public const int GL_MAP1_VERTEX_ATTRIB7_4_NV = 0x8667; +// public const int GL_MAP1_VERTEX_ATTRIB8_4_NV = 0x8668; +// public const int GL_MAP1_VERTEX_ATTRIB9_4_NV = 0x8669; +// public const int GL_MAP1_VERTEX_ATTRIB10_4_NV = 0x866A; +// public const int GL_MAP1_VERTEX_ATTRIB11_4_NV = 0x866B; +// public const int GL_MAP1_VERTEX_ATTRIB12_4_NV = 0x866C; +// public const int GL_MAP1_VERTEX_ATTRIB13_4_NV = 0x866D; +// public const int GL_MAP1_VERTEX_ATTRIB14_4_NV = 0x866E; +// public const int GL_MAP1_VERTEX_ATTRIB15_4_NV = 0x866F; +// public const int GL_MAP2_VERTEX_ATTRIB0_4_NV = 0x8670; +// public const int GL_MAP2_VERTEX_ATTRIB1_4_NV = 0x8671; +// public const int GL_MAP2_VERTEX_ATTRIB2_4_NV = 0x8672; +// public const int GL_MAP2_VERTEX_ATTRIB3_4_NV = 0x8673; +// public const int GL_MAP2_VERTEX_ATTRIB4_4_NV = 0x8674; +// public const int GL_MAP2_VERTEX_ATTRIB5_4_NV = 0x8675; +// public const int GL_MAP2_VERTEX_ATTRIB6_4_NV = 0x8676; +// public const int GL_MAP2_VERTEX_ATTRIB7_4_NV = 0x8677; +// public const int GL_MAP2_VERTEX_ATTRIB8_4_NV = 0x8678; +// public const int GL_MAP2_VERTEX_ATTRIB9_4_NV = 0x8679; +// public const int GL_MAP2_VERTEX_ATTRIB10_4_NV = 0x867A; +// public const int GL_MAP2_VERTEX_ATTRIB11_4_NV = 0x867B; +// public const int GL_MAP2_VERTEX_ATTRIB12_4_NV = 0x867C; +// public const int GL_MAP2_VERTEX_ATTRIB13_4_NV = 0x867D; +// public const int GL_MAP2_VERTEX_ATTRIB14_4_NV = 0x867E; +// public const int GL_MAP2_VERTEX_ATTRIB15_4_NV = 0x867F; +// public const int GL_NV_vertex_program1_1 = 1; +// public const int GL_NV_vertex_program2 = 1; +// public const int GL_NV_vertex_program2_option = 1; +// public const int GL_NV_vertex_program3 = 1; +// public const int GL_NV_vertex_program4 = 1; +// public const int GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV = 0x88FD; +// public const int GL_NV_video_capture = 1; +// public const int GL_VIDEO_BUFFER_NV = 0x9020; +// public const int GL_VIDEO_BUFFER_BINDING_NV = 0x9021; +// public const int GL_FIELD_UPPER_NV = 0x9022; +// public const int GL_FIELD_LOWER_NV = 0x9023; +// public const int GL_NUM_VIDEO_CAPTURE_STREAMS_NV = 0x9024; +// public const int GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV = 0x9025; +// public const int GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV = 0x9026; +// public const int GL_LAST_VIDEO_CAPTURE_STATUS_NV = 0x9027; +// public const int GL_VIDEO_BUFFER_PITCH_NV = 0x9028; +// public const int GL_VIDEO_COLOR_CONVERSION_MATRIX_NV = 0x9029; +// public const int GL_VIDEO_COLOR_CONVERSION_MAX_NV = 0x902A; +// public const int GL_VIDEO_COLOR_CONVERSION_MIN_NV = 0x902B; +// public const int GL_VIDEO_COLOR_CONVERSION_OFFSET_NV = 0x902C; +// public const int GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV = 0x902D; +// public const int GL_PARTIAL_SUCCESS_NV = 0x902E; +// public const int GL_SUCCESS_NV = 0x902F; +// public const int GL_FAILURE_NV = 0x9030; +// public const int GL_YCBYCR8_422_NV = 0x9031; +// public const int GL_YCBAYCR8A_4224_NV = 0x9032; +// public const int GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV = 0x9033; +// public const int GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV = 0x9034; +// public const int GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV = 0x9035; +// public const int GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV = 0x9036; +// public const int GL_Z4Y12Z4CB12Z4CR12_444_NV = 0x9037; +// public const int GL_VIDEO_CAPTURE_FRAME_WIDTH_NV = 0x9038; +// public const int GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV = 0x9039; +// public const int GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV = 0x903A; +// public const int GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV = 0x903B; +// public const int GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV = 0x903C; +// public const int GL_NV_viewport_array2 = 1; +// public const int GL_NV_viewport_swizzle = 1; +// public const int GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV = 0x9350; +// public const int GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV = 0x9351; +// public const int GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV = 0x9352; +// public const int GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV = 0x9353; +// public const int GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV = 0x9354; +// public const int GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV = 0x9355; +// public const int GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV = 0x9356; +// public const int GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV = 0x9357; +// public const int GL_VIEWPORT_SWIZZLE_X_NV = 0x9358; +// public const int GL_VIEWPORT_SWIZZLE_Y_NV = 0x9359; +// public const int GL_VIEWPORT_SWIZZLE_Z_NV = 0x935A; +// public const int GL_VIEWPORT_SWIZZLE_W_NV = 0x935B; +// public const int GL_OML_interlace = 1; +// public const int GL_INTERLACE_OML = 0x8980; +// public const int GL_INTERLACE_READ_OML = 0x8981; +// public const int GL_OML_resample = 1; +// public const int GL_PACK_RESAMPLE_OML = 0x8984; +// public const int GL_UNPACK_RESAMPLE_OML = 0x8985; +// public const int GL_RESAMPLE_REPLICATE_OML = 0x8986; +// public const int GL_RESAMPLE_ZERO_FILL_OML = 0x8987; +// public const int GL_RESAMPLE_AVERAGE_OML = 0x8988; +// public const int GL_RESAMPLE_DECIMATE_OML = 0x8989; +// public const int GL_OML_subsample = 1; +// public const int GL_FORMAT_SUBSAMPLE_24_24_OML = 0x8982; +// public const int GL_FORMAT_SUBSAMPLE_244_244_OML = 0x8983; +// public const int GL_OVR_multiview = 1; +// public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR = 0x9630; +// public const int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR = 0x9632; +// public const int GL_MAX_VIEWS_OVR = 0x9631; +// public const int GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR = 0x9633; +// public const int GL_OVR_multiview2 = 1; +// public const int GL_PGI_misc_hints = 1; +// public const int GL_PREFER_DOUBLEBUFFER_HINT_PGI = 0x1A1F8; +// public const int GL_CONSERVE_MEMORY_HINT_PGI = 0x1A1FD; +// public const int GL_RECLAIM_MEMORY_HINT_PGI = 0x1A1FE; +// public const int GL_NATIVE_GRAPHICS_HANDLE_PGI = 0x1A202; +// public const int GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI = 0x1A203; +// public const int GL_NATIVE_GRAPHICS_END_HINT_PGI = 0x1A204; +// public const int GL_ALWAYS_FAST_HINT_PGI = 0x1A20C; +// public const int GL_ALWAYS_SOFT_HINT_PGI = 0x1A20D; +// public const int GL_ALLOW_DRAW_OBJ_HINT_PGI = 0x1A20E; +// public const int GL_ALLOW_DRAW_WIN_HINT_PGI = 0x1A20F; +// public const int GL_ALLOW_DRAW_FRG_HINT_PGI = 0x1A210; +// public const int GL_ALLOW_DRAW_MEM_HINT_PGI = 0x1A211; +// public const int GL_STRICT_DEPTHFUNC_HINT_PGI = 0x1A216; +// public const int GL_STRICT_LIGHTING_HINT_PGI = 0x1A217; +// public const int GL_STRICT_SCISSOR_HINT_PGI = 0x1A218; +// public const int GL_FULL_STIPPLE_HINT_PGI = 0x1A219; +// public const int GL_CLIP_NEAR_HINT_PGI = 0x1A220; +// public const int GL_CLIP_FAR_HINT_PGI = 0x1A221; +// public const int GL_WIDE_LINE_HINT_PGI = 0x1A222; +// public const int GL_BACK_NORMALS_HINT_PGI = 0x1A223; +// public const int GL_PGI_vertex_hints = 1; +// public const int GL_VERTEX_DATA_HINT_PGI = 0x1A22A; +// public const int GL_VERTEX_CONSISTENT_HINT_PGI = 0x1A22B; +// public const int GL_MATERIAL_SIDE_HINT_PGI = 0x1A22C; +// public const int GL_MAX_VERTEX_HINT_PGI = 0x1A22D; +// public const int GL_COLOR3_BIT_PGI = 0x00010000; +// public const int GL_COLOR4_BIT_PGI = 0x00020000; +// public const int GL_EDGEFLAG_BIT_PGI = 0x00040000; +// public const int GL_INDEX_BIT_PGI = 0x00080000; +// public const int GL_MAT_AMBIENT_BIT_PGI = 0x00100000; +// public const int GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI = 0x00200000; +// public const int GL_MAT_DIFFUSE_BIT_PGI = 0x00400000; +// public const int GL_MAT_EMISSION_BIT_PGI = 0x00800000; +// public const int GL_MAT_COLOR_INDEXES_BIT_PGI = 0x01000000; +// public const int GL_MAT_SHININESS_BIT_PGI = 0x02000000; +// public const int GL_MAT_SPECULAR_BIT_PGI = 0x04000000; +// public const int GL_NORMAL_BIT_PGI = 0x08000000; +// public const int GL_TEXCOORD1_BIT_PGI = 0x10000000; +// public const int GL_TEXCOORD2_BIT_PGI = 0x20000000; +// public const int GL_TEXCOORD3_BIT_PGI = 0x40000000; +// public const int GL_TEXCOORD4_BIT_PGI = unchecked((int)0x80000000); +// public const int GL_VERTEX23_BIT_PGI = 0x00000004; +// public const int GL_VERTEX4_BIT_PGI = 0x00000008; +// public const int GL_REND_screen_coordinates = 1; +// public const int GL_SCREEN_COORDINATES_REND = 0x8490; +// public const int GL_INVERTED_SCREEN_W_REND = 0x8491; +// public const int GL_S3_s3tc = 1; +// public const int GL_RGB_S3TC = 0x83A0; +// public const int GL_RGB4_S3TC = 0x83A1; +// public const int GL_RGBA_S3TC = 0x83A2; +// public const int GL_RGBA4_S3TC = 0x83A3; +// public const int GL_RGBA_DXT5_S3TC = 0x83A4; +// public const int GL_RGBA4_DXT5_S3TC = 0x83A5; +// public const int GL_SGIS_detail_texture = 1; +// public const int GL_DETAIL_TEXTURE_2D_SGIS = 0x8095; +// public const int GL_DETAIL_TEXTURE_2D_BINDING_SGIS = 0x8096; +// public const int GL_LINEAR_DETAIL_SGIS = 0x8097; +// public const int GL_LINEAR_DETAIL_ALPHA_SGIS = 0x8098; +// public const int GL_LINEAR_DETAIL_COLOR_SGIS = 0x8099; +// public const int GL_DETAIL_TEXTURE_LEVEL_SGIS = 0x809A; +// public const int GL_DETAIL_TEXTURE_MODE_SGIS = 0x809B; +// public const int GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS = 0x809C; +// public const int GL_SGIS_fog_function = 1; +// public const int GL_FOG_FUNC_SGIS = 0x812A; +// public const int GL_FOG_FUNC_POINTS_SGIS = 0x812B; +// public const int GL_MAX_FOG_FUNC_POINTS_SGIS = 0x812C; +// public const int GL_SGIS_generate_mipmap = 1; +// public const int GL_GENERATE_MIPMAP_SGIS = 0x8191; +// public const int GL_GENERATE_MIPMAP_HINT_SGIS = 0x8192; +// public const int GL_SGIS_multisample = 1; +// public const int GL_MULTISAMPLE_SGIS = 0x809D; +// public const int GL_SAMPLE_ALPHA_TO_MASK_SGIS = 0x809E; +// public const int GL_SAMPLE_ALPHA_TO_ONE_SGIS = 0x809F; +// public const int GL_SAMPLE_MASK_SGIS = 0x80A0; +// public const int GL_1PASS_SGIS = 0x80A1; +// public const int GL_2PASS_0_SGIS = 0x80A2; +// public const int GL_2PASS_1_SGIS = 0x80A3; +// public const int GL_4PASS_0_SGIS = 0x80A4; +// public const int GL_4PASS_1_SGIS = 0x80A5; +// public const int GL_4PASS_2_SGIS = 0x80A6; +// public const int GL_4PASS_3_SGIS = 0x80A7; +// public const int GL_SAMPLE_BUFFERS_SGIS = 0x80A8; +// public const int GL_SAMPLES_SGIS = 0x80A9; +// public const int GL_SAMPLE_MASK_VALUE_SGIS = 0x80AA; +// public const int GL_SAMPLE_MASK_INVERT_SGIS = 0x80AB; +// public const int GL_SAMPLE_PATTERN_SGIS = 0x80AC; +// public const int GL_SGIS_pixel_texture = 1; +// public const int GL_PIXEL_TEXTURE_SGIS = 0x8353; +// public const int GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS = 0x8354; +// public const int GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS = 0x8355; +// public const int GL_PIXEL_GROUP_COLOR_SGIS = 0x8356; +// public const int GL_SGIS_point_line_texgen = 1; +// public const int GL_EYE_DISTANCE_TO_POINT_SGIS = 0x81F0; +// public const int GL_OBJECT_DISTANCE_TO_POINT_SGIS = 0x81F1; +// public const int GL_EYE_DISTANCE_TO_LINE_SGIS = 0x81F2; +// public const int GL_OBJECT_DISTANCE_TO_LINE_SGIS = 0x81F3; +// public const int GL_EYE_POINT_SGIS = 0x81F4; +// public const int GL_OBJECT_POINT_SGIS = 0x81F5; +// public const int GL_EYE_LINE_SGIS = 0x81F6; +// public const int GL_OBJECT_LINE_SGIS = 0x81F7; +// public const int GL_SGIS_point_parameters = 1; +// public const int GL_POINT_SIZE_MIN_SGIS = 0x8126; +// public const int GL_POINT_SIZE_MAX_SGIS = 0x8127; +// public const int GL_POINT_FADE_THRESHOLD_SIZE_SGIS = 0x8128; +// public const int GL_DISTANCE_ATTENUATION_SGIS = 0x8129; +// public const int GL_SGIS_sharpen_texture = 1; +// public const int GL_LINEAR_SHARPEN_SGIS = 0x80AD; +// public const int GL_LINEAR_SHARPEN_ALPHA_SGIS = 0x80AE; +// public const int GL_LINEAR_SHARPEN_COLOR_SGIS = 0x80AF; +// public const int GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS = 0x80B0; +// public const int GL_SGIS_texture4D = 1; +// public const int GL_PACK_SKIP_VOLUMES_SGIS = 0x8130; +// public const int GL_PACK_IMAGE_DEPTH_SGIS = 0x8131; +// public const int GL_UNPACK_SKIP_VOLUMES_SGIS = 0x8132; +// public const int GL_UNPACK_IMAGE_DEPTH_SGIS = 0x8133; +// public const int GL_TEXTURE_4D_SGIS = 0x8134; +// public const int GL_PROXY_TEXTURE_4D_SGIS = 0x8135; +// public const int GL_TEXTURE_4DSIZE_SGIS = 0x8136; +// public const int GL_TEXTURE_WRAP_Q_SGIS = 0x8137; +// public const int GL_MAX_4D_TEXTURE_SIZE_SGIS = 0x8138; +// public const int GL_TEXTURE_4D_BINDING_SGIS = 0x814F; +// public const int GL_SGIS_texture_border_clamp = 1; +// public const int GL_CLAMP_TO_BORDER_SGIS = 0x812D; +// public const int GL_SGIS_texture_color_mask = 1; +// public const int GL_TEXTURE_COLOR_WRITEMASK_SGIS = 0x81EF; +// public const int GL_SGIS_texture_edge_clamp = 1; +// public const int GL_CLAMP_TO_EDGE_SGIS = 0x812F; +// public const int GL_SGIS_texture_filter4 = 1; +// public const int GL_FILTER4_SGIS = 0x8146; +// public const int GL_TEXTURE_FILTER4_SIZE_SGIS = 0x8147; +// public const int GL_SGIS_texture_lod = 1; +// public const int GL_TEXTURE_MIN_LOD_SGIS = 0x813A; +// public const int GL_TEXTURE_MAX_LOD_SGIS = 0x813B; +// public const int GL_TEXTURE_BASE_LEVEL_SGIS = 0x813C; +// public const int GL_TEXTURE_MAX_LEVEL_SGIS = 0x813D; +// public const int GL_SGIS_texture_select = 1; +// public const int GL_DUAL_ALPHA4_SGIS = 0x8110; +// public const int GL_DUAL_ALPHA8_SGIS = 0x8111; +// public const int GL_DUAL_ALPHA12_SGIS = 0x8112; +// public const int GL_DUAL_ALPHA16_SGIS = 0x8113; +// public const int GL_DUAL_LUMINANCE4_SGIS = 0x8114; +// public const int GL_DUAL_LUMINANCE8_SGIS = 0x8115; +// public const int GL_DUAL_LUMINANCE12_SGIS = 0x8116; +// public const int GL_DUAL_LUMINANCE16_SGIS = 0x8117; +// public const int GL_DUAL_INTENSITY4_SGIS = 0x8118; +// public const int GL_DUAL_INTENSITY8_SGIS = 0x8119; +// public const int GL_DUAL_INTENSITY12_SGIS = 0x811A; +// public const int GL_DUAL_INTENSITY16_SGIS = 0x811B; +// public const int GL_DUAL_LUMINANCE_ALPHA4_SGIS = 0x811C; +// public const int GL_DUAL_LUMINANCE_ALPHA8_SGIS = 0x811D; +// public const int GL_QUAD_ALPHA4_SGIS = 0x811E; +// public const int GL_QUAD_ALPHA8_SGIS = 0x811F; +// public const int GL_QUAD_LUMINANCE4_SGIS = 0x8120; +// public const int GL_QUAD_LUMINANCE8_SGIS = 0x8121; +// public const int GL_QUAD_INTENSITY4_SGIS = 0x8122; +// public const int GL_QUAD_INTENSITY8_SGIS = 0x8123; +// public const int GL_DUAL_TEXTURE_SELECT_SGIS = 0x8124; +// public const int GL_QUAD_TEXTURE_SELECT_SGIS = 0x8125; +// public const int GL_SGIX_async = 1; +// public const int GL_ASYNC_MARKER_SGIX = 0x8329; +// public const int GL_SGIX_async_histogram = 1; +// public const int GL_ASYNC_HISTOGRAM_SGIX = 0x832C; +// public const int GL_MAX_ASYNC_HISTOGRAM_SGIX = 0x832D; +// public const int GL_SGIX_async_pixel = 1; +// public const int GL_ASYNC_TEX_IMAGE_SGIX = 0x835C; +// public const int GL_ASYNC_DRAW_PIXELS_SGIX = 0x835D; +// public const int GL_ASYNC_READ_PIXELS_SGIX = 0x835E; +// public const int GL_MAX_ASYNC_TEX_IMAGE_SGIX = 0x835F; +// public const int GL_MAX_ASYNC_DRAW_PIXELS_SGIX = 0x8360; +// public const int GL_MAX_ASYNC_READ_PIXELS_SGIX = 0x8361; +// public const int GL_SGIX_blend_alpha_minmax = 1; +// public const int GL_ALPHA_MIN_SGIX = 0x8320; +// public const int GL_ALPHA_MAX_SGIX = 0x8321; +// public const int GL_SGIX_calligraphic_fragment = 1; +// public const int GL_CALLIGRAPHIC_FRAGMENT_SGIX = 0x8183; +// public const int GL_SGIX_clipmap = 1; +// public const int GL_LINEAR_CLIPMAP_LINEAR_SGIX = 0x8170; +// public const int GL_TEXTURE_CLIPMAP_CENTER_SGIX = 0x8171; +// public const int GL_TEXTURE_CLIPMAP_FRAME_SGIX = 0x8172; +// public const int GL_TEXTURE_CLIPMAP_OFFSET_SGIX = 0x8173; +// public const int GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX = 0x8174; +// public const int GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX = 0x8175; +// public const int GL_TEXTURE_CLIPMAP_DEPTH_SGIX = 0x8176; +// public const int GL_MAX_CLIPMAP_DEPTH_SGIX = 0x8177; +// public const int GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX = 0x8178; +// public const int GL_NEAREST_CLIPMAP_NEAREST_SGIX = 0x844D; +// public const int GL_NEAREST_CLIPMAP_LINEAR_SGIX = 0x844E; +// public const int GL_LINEAR_CLIPMAP_NEAREST_SGIX = 0x844F; +// public const int GL_SGIX_convolution_accuracy = 1; +// public const int GL_CONVOLUTION_HINT_SGIX = 0x8316; +// public const int GL_SGIX_depth_pass_instrument = 1; +// public const int GL_SGIX_depth_texture = 1; +// public const int GL_DEPTH_COMPONENT16_SGIX = 0x81A5; +// public const int GL_DEPTH_COMPONENT24_SGIX = 0x81A6; +// public const int GL_DEPTH_COMPONENT32_SGIX = 0x81A7; +// public const int GL_SGIX_flush_raster = 1; +// public const int GL_SGIX_fog_offset = 1; +// public const int GL_FOG_OFFSET_SGIX = 0x8198; +// public const int GL_FOG_OFFSET_VALUE_SGIX = 0x8199; +// public const int GL_SGIX_fragment_lighting = 1; +// public const int GL_FRAGMENT_LIGHTING_SGIX = 0x8400; +// public const int GL_FRAGMENT_COLOR_MATERIAL_SGIX = 0x8401; +// public const int GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX = 0x8402; +// public const int GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX = 0x8403; +// public const int GL_MAX_FRAGMENT_LIGHTS_SGIX = 0x8404; +// public const int GL_MAX_ACTIVE_LIGHTS_SGIX = 0x8405; +// public const int GL_CURRENT_RASTER_NORMAL_SGIX = 0x8406; +// public const int GL_LIGHT_ENV_MODE_SGIX = 0x8407; +// public const int GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX = 0x8408; +// public const int GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX = 0x8409; +// public const int GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX = 0x840A; +// public const int GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX = 0x840B; +// public const int GL_FRAGMENT_LIGHT0_SGIX = 0x840C; +// public const int GL_FRAGMENT_LIGHT1_SGIX = 0x840D; +// public const int GL_FRAGMENT_LIGHT2_SGIX = 0x840E; +// public const int GL_FRAGMENT_LIGHT3_SGIX = 0x840F; +// public const int GL_FRAGMENT_LIGHT4_SGIX = 0x8410; +// public const int GL_FRAGMENT_LIGHT5_SGIX = 0x8411; +// public const int GL_FRAGMENT_LIGHT6_SGIX = 0x8412; +// public const int GL_FRAGMENT_LIGHT7_SGIX = 0x8413; +// public const int GL_SGIX_framezoom = 1; +// public const int GL_FRAMEZOOM_SGIX = 0x818B; +// public const int GL_FRAMEZOOM_FACTOR_SGIX = 0x818C; +// public const int GL_MAX_FRAMEZOOM_FACTOR_SGIX = 0x818D; +// public const int GL_SGIX_igloo_interface = 1; +// public const int GL_SGIX_instruments = 1; +// public const int GL_INSTRUMENT_BUFFER_POINTER_SGIX = 0x8180; +// public const int GL_INSTRUMENT_MEASUREMENTS_SGIX = 0x8181; +// public const int GL_SGIX_interlace = 1; +// public const int GL_INTERLACE_SGIX = 0x8094; +// public const int GL_SGIX_ir_instrument1 = 1; +// public const int GL_IR_INSTRUMENT1_SGIX = 0x817F; +// public const int GL_SGIX_list_priority = 1; +// public const int GL_LIST_PRIORITY_SGIX = 0x8182; +// public const int GL_SGIX_pixel_texture = 1; +// public const int GL_PIXEL_TEX_GEN_SGIX = 0x8139; +// public const int GL_PIXEL_TEX_GEN_MODE_SGIX = 0x832B; +// public const int GL_SGIX_pixel_tiles = 1; +// public const int GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX = 0x813E; +// public const int GL_PIXEL_TILE_CACHE_INCREMENT_SGIX = 0x813F; +// public const int GL_PIXEL_TILE_WIDTH_SGIX = 0x8140; +// public const int GL_PIXEL_TILE_HEIGHT_SGIX = 0x8141; +// public const int GL_PIXEL_TILE_GRID_WIDTH_SGIX = 0x8142; +// public const int GL_PIXEL_TILE_GRID_HEIGHT_SGIX = 0x8143; +// public const int GL_PIXEL_TILE_GRID_DEPTH_SGIX = 0x8144; +// public const int GL_PIXEL_TILE_CACHE_SIZE_SGIX = 0x8145; +// public const int GL_SGIX_polynomial_ffd = 1; +// public const int GL_TEXTURE_DEFORMATION_BIT_SGIX = 0x00000001; +// public const int GL_GEOMETRY_DEFORMATION_BIT_SGIX = 0x00000002; +// public const int GL_GEOMETRY_DEFORMATION_SGIX = 0x8194; +// public const int GL_TEXTURE_DEFORMATION_SGIX = 0x8195; +// public const int GL_DEFORMATIONS_MASK_SGIX = 0x8196; +// public const int GL_MAX_DEFORMATION_ORDER_SGIX = 0x8197; +// public const int GL_SGIX_reference_plane = 1; +// public const int GL_REFERENCE_PLANE_SGIX = 0x817D; +// public const int GL_REFERENCE_PLANE_EQUATION_SGIX = 0x817E; +// public const int GL_SGIX_resample = 1; +// public const int GL_PACK_RESAMPLE_SGIX = 0x842E; +// public const int GL_UNPACK_RESAMPLE_SGIX = 0x842F; +// public const int GL_RESAMPLE_REPLICATE_SGIX = 0x8433; +// public const int GL_RESAMPLE_ZERO_FILL_SGIX = 0x8434; +// public const int GL_RESAMPLE_DECIMATE_SGIX = 0x8430; +// public const int GL_SGIX_scalebias_hint = 1; +// public const int GL_SCALEBIAS_HINT_SGIX = 0x8322; +// public const int GL_SGIX_shadow = 1; +// public const int GL_TEXTURE_COMPARE_SGIX = 0x819A; +// public const int GL_TEXTURE_COMPARE_OPERATOR_SGIX = 0x819B; +// public const int GL_TEXTURE_LEQUAL_R_SGIX = 0x819C; +// public const int GL_TEXTURE_GEQUAL_R_SGIX = 0x819D; +// public const int GL_SGIX_shadow_ambient = 1; +// public const int GL_SHADOW_AMBIENT_SGIX = 0x80BF; +// public const int GL_SGIX_sprite = 1; +// public const int GL_SPRITE_SGIX = 0x8148; +// public const int GL_SPRITE_MODE_SGIX = 0x8149; +// public const int GL_SPRITE_AXIS_SGIX = 0x814A; +// public const int GL_SPRITE_TRANSLATION_SGIX = 0x814B; +// public const int GL_SPRITE_AXIAL_SGIX = 0x814C; +// public const int GL_SPRITE_OBJECT_ALIGNED_SGIX = 0x814D; +// public const int GL_SPRITE_EYE_ALIGNED_SGIX = 0x814E; +// public const int GL_SGIX_subsample = 1; +// public const int GL_PACK_SUBSAMPLE_RATE_SGIX = 0x85A0; +// public const int GL_UNPACK_SUBSAMPLE_RATE_SGIX = 0x85A1; +// public const int GL_PIXEL_SUBSAMPLE_4444_SGIX = 0x85A2; +// public const int GL_PIXEL_SUBSAMPLE_2424_SGIX = 0x85A3; +// public const int GL_PIXEL_SUBSAMPLE_4242_SGIX = 0x85A4; +// public const int GL_SGIX_tag_sample_buffer = 1; +// public const int GL_SGIX_texture_add_env = 1; +// public const int GL_TEXTURE_ENV_BIAS_SGIX = 0x80BE; +// public const int GL_SGIX_texture_coordinate_clamp = 1; +// public const int GL_TEXTURE_MAX_CLAMP_S_SGIX = 0x8369; +// public const int GL_TEXTURE_MAX_CLAMP_T_SGIX = 0x836A; +// public const int GL_TEXTURE_MAX_CLAMP_R_SGIX = 0x836B; +// public const int GL_SGIX_texture_lod_bias = 1; +// public const int GL_TEXTURE_LOD_BIAS_S_SGIX = 0x818E; +// public const int GL_TEXTURE_LOD_BIAS_T_SGIX = 0x818F; +// public const int GL_TEXTURE_LOD_BIAS_R_SGIX = 0x8190; +// public const int GL_SGIX_texture_multi_buffer = 1; +// public const int GL_TEXTURE_MULTI_BUFFER_HINT_SGIX = 0x812E; +// public const int GL_SGIX_texture_scale_bias = 1; +// public const int GL_POST_TEXTURE_FILTER_BIAS_SGIX = 0x8179; +// public const int GL_POST_TEXTURE_FILTER_SCALE_SGIX = 0x817A; +// public const int GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX = 0x817B; +// public const int GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX = 0x817C; +// public const int GL_SGIX_vertex_preclip = 1; +// public const int GL_VERTEX_PRECLIP_SGIX = 0x83EE; +// public const int GL_VERTEX_PRECLIP_HINT_SGIX = 0x83EF; +// public const int GL_SGIX_ycrcb = 1; +// public const int GL_YCRCB_422_SGIX = 0x81BB; +// public const int GL_YCRCB_444_SGIX = 0x81BC; +// public const int GL_SGIX_ycrcb_subsample = 1; +// public const int GL_SGIX_ycrcba = 1; +// public const int GL_YCRCB_SGIX = 0x8318; +// public const int GL_YCRCBA_SGIX = 0x8319; +// public const int GL_SGI_color_matrix = 1; +// public const int GL_COLOR_MATRIX_SGI = 0x80B1; +// public const int GL_COLOR_MATRIX_STACK_DEPTH_SGI = 0x80B2; +// public const int GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI = 0x80B3; +// public const int GL_POST_COLOR_MATRIX_RED_SCALE_SGI = 0x80B4; +// public const int GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI = 0x80B5; +// public const int GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI = 0x80B6; +// public const int GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI = 0x80B7; +// public const int GL_POST_COLOR_MATRIX_RED_BIAS_SGI = 0x80B8; +// public const int GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI = 0x80B9; +// public const int GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI = 0x80BA; +// public const int GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI = 0x80BB; +// public const int GL_SGI_color_table = 1; +// public const int GL_COLOR_TABLE_SGI = 0x80D0; +// public const int GL_POST_CONVOLUTION_COLOR_TABLE_SGI = 0x80D1; +// public const int GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI = 0x80D2; +// public const int GL_PROXY_COLOR_TABLE_SGI = 0x80D3; +// public const int GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI = 0x80D4; +// public const int GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI = 0x80D5; +// public const int GL_COLOR_TABLE_SCALE_SGI = 0x80D6; +// public const int GL_COLOR_TABLE_BIAS_SGI = 0x80D7; +// public const int GL_COLOR_TABLE_FORMAT_SGI = 0x80D8; +// public const int GL_COLOR_TABLE_WIDTH_SGI = 0x80D9; +// public const int GL_COLOR_TABLE_RED_SIZE_SGI = 0x80DA; +// public const int GL_COLOR_TABLE_GREEN_SIZE_SGI = 0x80DB; +// public const int GL_COLOR_TABLE_BLUE_SIZE_SGI = 0x80DC; +// public const int GL_COLOR_TABLE_ALPHA_SIZE_SGI = 0x80DD; +// public const int GL_COLOR_TABLE_LUMINANCE_SIZE_SGI = 0x80DE; +// public const int GL_COLOR_TABLE_INTENSITY_SIZE_SGI = 0x80DF; +// public const int GL_SGI_texture_color_table = 1; +// public const int GL_TEXTURE_COLOR_TABLE_SGI = 0x80BC; +// public const int GL_PROXY_TEXTURE_COLOR_TABLE_SGI = 0x80BD; +// public const int GL_SUNX_constant_data = 1; +// public const int GL_UNPACK_CONSTANT_DATA_SUNX = 0x81D5; +// public const int GL_TEXTURE_CONSTANT_DATA_SUNX = 0x81D6; +// public const int GL_SUN_convolution_border_modes = 1; +// public const int GL_WRAP_BORDER_SUN = 0x81D4; +// public const int GL_SUN_global_alpha = 1; +// public const int GL_GLOBAL_ALPHA_SUN = 0x81D9; +// public const int GL_GLOBAL_ALPHA_FACTOR_SUN = 0x81DA; +// public const int GL_SUN_mesh_array = 1; +// public const int GL_QUAD_MESH_SUN = 0x8614; +// public const int GL_TRIANGLE_MESH_SUN = 0x8615; +// public const int GL_SUN_slice_accum = 1; +// public const int GL_SLICE_ACCUM_SUN = 0x85CC; +// public const int GL_SUN_triangle_list = 1; +// public const int GL_RESTART_SUN = 0x0001; +// public const int GL_REPLACE_MIDDLE_SUN = 0x0002; +// public const int GL_REPLACE_OLDEST_SUN = 0x0003; +// public const int GL_TRIANGLE_LIST_SUN = 0x81D7; +// public const int GL_REPLACEMENT_CODE_SUN = 0x81D8; +// public const int GL_REPLACEMENT_CODE_ARRAY_SUN = 0x85C0; +// public const int GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN = 0x85C1; +// public const int GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN = 0x85C2; +// public const int GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN = 0x85C3; +// public const int GL_R1UI_V3F_SUN = 0x85C4; +// public const int GL_R1UI_C4UB_V3F_SUN = 0x85C5; +// public const int GL_R1UI_C3F_V3F_SUN = 0x85C6; +// public const int GL_R1UI_N3F_V3F_SUN = 0x85C7; +// public const int GL_R1UI_C4F_N3F_V3F_SUN = 0x85C8; +// public const int GL_R1UI_T2F_V3F_SUN = 0x85C9; +// public const int GL_R1UI_T2F_N3F_V3F_SUN = 0x85CA; +// public const int GL_R1UI_T2F_C4F_N3F_V3F_SUN = 0x85CB; +// public const int GL_SUN_vertex = 1; +// public const int GL_WIN_phong_shading = 1; +// public const int GL_PHONG_WIN = 0x80EA; +// public const int GL_PHONG_HINT_WIN = 0x80EB; +// public const int GL_WIN_specular_fog = 1; +// public const int GL_FOG_SPECULAR_TEXTURE_WIN = 0x80EC; } } diff --git a/src/Avalonia.OpenGL/IGlContext.cs b/src/Avalonia.OpenGL/IGlContext.cs index 50868db873..a52a6535da 100644 --- a/src/Avalonia.OpenGL/IGlContext.cs +++ b/src/Avalonia.OpenGL/IGlContext.cs @@ -1,8 +1,9 @@ using System; +using Avalonia.Platform; namespace Avalonia.OpenGL { - public interface IGlContext : IDisposable + public interface IGlContext : IPlatformGpuContext { GlVersion Version { get; } GlInterface GlInterface { get; } diff --git a/src/Avalonia.OpenGL/IPlatformOpenGlInterface.cs b/src/Avalonia.OpenGL/IPlatformOpenGlInterface.cs index 5ee5df1e85..4ff7997b03 100644 --- a/src/Avalonia.OpenGL/IPlatformOpenGlInterface.cs +++ b/src/Avalonia.OpenGL/IPlatformOpenGlInterface.cs @@ -1,8 +1,10 @@ +using Avalonia.Platform; + namespace Avalonia.OpenGL { - public interface IPlatformOpenGlInterface + public interface IPlatformOpenGlInterface : IPlatformGpu { - IGlContext PrimaryContext { get; } + new IGlContext PrimaryContext { get; } IGlContext CreateSharedContext(); bool CanShareContexts { get; } bool CanCreateContexts { get; } diff --git a/src/Avalonia.Themes.Default/Controls/NativeMenuBar.xaml b/src/Avalonia.Themes.Default/Controls/NativeMenuBar.xaml index 81bd8f39c5..3b0019eea1 100644 --- a/src/Avalonia.Themes.Default/Controls/NativeMenuBar.xaml +++ b/src/Avalonia.Themes.Default/Controls/NativeMenuBar.xaml @@ -14,6 +14,7 @@ + +"; + + var contentControl = AvaloniaRuntimeXamlLoader.Parse(xaml); + contentControl.Measure(new Size(10, 10)); + + var result = contentControl.GetTemplateChildren().OfType().First(); + Assert.Equal("Hello", result.Content); + } + } + + [Fact] + public void ResolvesElementNameInTemplate() + { + using (UnitTestApplication.Start(TestServices.StyledWindow)) + { + var xaml = @" + + + + +"; + + var contentControl = AvaloniaRuntimeXamlLoader.Parse(xaml); + contentControl.Measure(new Size(10, 10)); + + var result = contentControl.GetTemplateChildren().OfType().First(); + + Assert.Equal("Hello", result.Content); + } + } + [Fact] public void Binds_To_Source() { @@ -1145,6 +1289,28 @@ namespace Avalonia.Markup.Xaml.UnitTests.MarkupExtensions Assert.Equal("bar-" + typeof(TestDataContext).FullName, textBlock.Text); } } + + [Fact] + public void SupportCastToTypeInExpressionWithProperty_ExplicitPropertyCast() + { + using (UnitTestApplication.Start(TestServices.StyledWindow)) + { + var xaml = @" + + +"; + var window = (Window)AvaloniaRuntimeXamlLoader.Load(xaml); + var contentControl = window.GetControl("contentControl"); + + var dataContext = new TestDataContext(); + + window.DataContext = dataContext; + + Assert.Equal(((IHasExplicitProperty)dataContext).ExplicitProperty, contentControl.Content); + } + } [Fact] public void Binds_To_Self_Without_DataType() @@ -1366,6 +1532,43 @@ namespace Avalonia.Markup.Xaml.UnitTests.MarkupExtensions } } + [Fact] + public void ResolvesDataTypeForAssignBinding() + { + using (UnitTestApplication.Start(TestServices.StyledWindow)) + { + var xaml = @" +"; + var control = (AssignBindingControl)AvaloniaRuntimeXamlLoader.Load(xaml); + var compiledPath = ((CompiledBindingExtension)control.X).Path; + + var node = Assert.IsType(Assert.Single(compiledPath.Elements)); + Assert.Equal(typeof(string), node.Property.PropertyType); + } + } + + [Fact] + public void ResolvesDataTypeForAssignBinding_FromBindingProperty() + { + using (UnitTestApplication.Start(TestServices.StyledWindow)) + { + var xaml = @" +"; + var control = (AssignBindingControl)AvaloniaRuntimeXamlLoader.Load(xaml); + var compiledPath = ((CompiledBindingExtension)control.X).Path; + + var node = Assert.IsType(Assert.Single(compiledPath.Elements)); + Assert.Equal(typeof(string), node.Property.PropertyType); + } + } + void Throws(string type, Action cb) { try @@ -1410,6 +1613,11 @@ namespace Avalonia.Markup.Xaml.UnitTests.MarkupExtensions public interface IHasPropertyDerived : IHasProperty { } + public interface IHasExplicitProperty + { + string ExplicitProperty { get; } + } + public class AppendConverter : IValueConverter { public static IValueConverter Instance { get; } = new AppendConverter(); @@ -1429,7 +1637,7 @@ namespace Avalonia.Markup.Xaml.UnitTests.MarkupExtensions public class TestDataContextBaseClass {} - public class TestDataContext : TestDataContextBaseClass, IHasPropertyDerived + public class TestDataContext : TestDataContextBaseClass, IHasPropertyDerived, IHasExplicitProperty { public string StringProperty { get; set; } @@ -1449,6 +1657,10 @@ namespace Avalonia.Markup.Xaml.UnitTests.MarkupExtensions public INonIntegerIndexerDerived NonIntegerIndexerInterfaceProperty => NonIntegerIndexerProperty; + string IHasExplicitProperty.ExplicitProperty => "Hello"; + + public string ExplicitProperty => "Bye"; + public class NonIntegerIndexer : NotifyingBase, INonIntegerIndexerDerived { private readonly Dictionary _storage = new Dictionary(); @@ -1534,4 +1746,9 @@ namespace Avalonia.Markup.Xaml.UnitTests.MarkupExtensions } public class CustomDataTemplateInherit : CustomDataTemplate { } + + public class AssignBindingControl : Control + { + [AssignBinding] public IBinding X { get; set; } + } } diff --git a/tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs b/tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs index 3831c9cfac..0bb6c01041 100644 --- a/tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs +++ b/tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs @@ -17,6 +17,7 @@ using System.Linq; using System.Xml; using Xunit; using Avalonia.Controls.Documents; +using Avalonia.Metadata; namespace Avalonia.Markup.Xaml.UnitTests.Xaml { @@ -947,7 +948,7 @@ namespace Avalonia.Markup.Xaml.UnitTests.Xaml } } - public class ObjectWithAddChildOfT : IAddChild + public class ObjectWithAddChildOfT : IAddChild, IAddChild { public string Text { get; set; } diff --git a/tests/Avalonia.RenderTests/ManualRenderTimer.cs b/tests/Avalonia.RenderTests/ManualRenderTimer.cs new file mode 100644 index 0000000000..0dc994aaa5 --- /dev/null +++ b/tests/Avalonia.RenderTests/ManualRenderTimer.cs @@ -0,0 +1,19 @@ +using Avalonia.Rendering; +using System.Threading.Tasks; +using System; + + +#if AVALONIA_SKIA +namespace Avalonia.Skia.RenderTests +#else +namespace Avalonia.Direct2D1.RenderTests +#endif +{ + public class ManualRenderTimer : IRenderTimer + { + public event Action Tick; + public bool RunsInBackground => false; + public void TriggerTick() => Tick?.Invoke(TimeSpan.Zero); + public Task TriggerBackgroundTick() => Task.Run(TriggerTick); + } +} \ No newline at end of file diff --git a/tests/Avalonia.RenderTests/TestBase.cs b/tests/Avalonia.RenderTests/TestBase.cs index 39250f2aa7..4d6b313ffc 100644 --- a/tests/Avalonia.RenderTests/TestBase.cs +++ b/tests/Avalonia.RenderTests/TestBase.cs @@ -8,8 +8,13 @@ using Xunit; using Avalonia.Platform; using System.Threading.Tasks; using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; +using System.Reactive.Disposables; using System.Threading; using Avalonia.Media; +using Avalonia.Rendering.Composition; using Avalonia.Threading; using SixLabors.ImageSharp.PixelFormats; using Image = SixLabors.ImageSharp.Image; @@ -38,7 +43,7 @@ namespace Avalonia.Direct2D1.RenderTests new TestThreadingInterface(); private static readonly IAssetLoader assetLoader = new AssetLoader(); - + static TestBase() { #if AVALONIA_SKIA @@ -84,6 +89,7 @@ namespace Avalonia.Direct2D1.RenderTests var immediatePath = Path.Combine(OutputPath, testName + ".immediate.out.png"); var deferredPath = Path.Combine(OutputPath, testName + ".deferred.out.png"); + var compositedPath = Path.Combine(OutputPath, testName + ".composited.out.png"); var factory = AvaloniaLocator.Current.GetService(); var pixelSize = new PixelSize((int)target.Width, (int)target.Height); var size = new Size(target.Width, target.Height); @@ -96,7 +102,8 @@ namespace Avalonia.Direct2D1.RenderTests bitmap.Render(target); bitmap.Save(immediatePath); } - + + using (var rtb = factory.CreateRenderTargetBitmap(pixelSize, dpiVector)) using (var renderer = new DeferredRenderer(target, rtb)) { @@ -107,9 +114,30 @@ namespace Avalonia.Direct2D1.RenderTests // Do the deferred render on a background thread to expose any threading errors in // the deferred rendering path. await Task.Run((Action)renderer.UnitTestRender); + threadingInterface.MainThread = Thread.CurrentThread; rtb.Save(deferredPath); } + + var timer = new ManualRenderTimer(); + + var compositor = new Compositor(new RenderLoop(timer, Dispatcher.UIThread), null); + using (var rtb = factory.CreateRenderTargetBitmap(pixelSize, dpiVector)) + { + var root = new TestRenderRoot(dpiVector.X / 96, rtb); + using (var renderer = new CompositingRenderer(root, compositor) { RenderOnlyOnRenderThread = false}) + { + root.Initialize(renderer, target); + renderer.Start(); + Dispatcher.UIThread.RunJobs(); + timer.TriggerTick(); + } + + // Free pools + for (var c = 0; c < 11; c++) + TestThreadingInterface.RunTimers(); + rtb.Save(compositedPath); + } } protected void CompareImages([CallerMemberName] string testName = "") @@ -117,13 +145,16 @@ namespace Avalonia.Direct2D1.RenderTests var expectedPath = Path.Combine(OutputPath, testName + ".expected.png"); var immediatePath = Path.Combine(OutputPath, testName + ".immediate.out.png"); var deferredPath = Path.Combine(OutputPath, testName + ".deferred.out.png"); + var compositedPath = Path.Combine(OutputPath, testName + ".composited.out.png"); using (var expected = Image.Load(expectedPath)) using (var immediate = Image.Load(immediatePath)) using (var deferred = Image.Load(deferredPath)) + using (var composited = Image.Load(compositedPath)) { var immediateError = CompareImages(immediate, expected); var deferredError = CompareImages(deferred, expected); + var compositedError = CompareImages(composited, expected); if (immediateError > 0.022) { @@ -134,6 +165,11 @@ namespace Avalonia.Direct2D1.RenderTests { Assert.True(false, deferredPath + ": Error = " + deferredError); } + + if (compositedError > 0.022) + { + Assert.True(false, compositedPath + ": Error = " + compositedError); + } } } @@ -233,9 +269,25 @@ namespace Avalonia.Direct2D1.RenderTests // No-op } + private static List s_timers = new(); + + public static void RunTimers() + { + lock (s_timers) + { + foreach(var t in s_timers.ToList()) + t.Invoke(); + } + } + public IDisposable StartTimer(DispatcherPriority priority, TimeSpan interval, Action tick) { - throw new NotImplementedException(); + var act = () => tick(); + lock (s_timers) s_timers.Add(act); + return Disposable.Create(() => + { + lock (s_timers) s_timers.Remove(act); + }); } } } diff --git a/tests/Avalonia.RenderTests/TestRenderRoot.cs b/tests/Avalonia.RenderTests/TestRenderRoot.cs new file mode 100644 index 0000000000..8f2b324d9c --- /dev/null +++ b/tests/Avalonia.RenderTests/TestRenderRoot.cs @@ -0,0 +1,48 @@ +using Avalonia.Rendering; +using System.Threading.Tasks; +using System; +using Avalonia.Controls; +using Avalonia.Platform; + + +#if AVALONIA_SKIA +namespace Avalonia.Skia.RenderTests +#else +namespace Avalonia.Direct2D1.RenderTests +#endif +{ + public class TestRenderRoot : Decorator, IRenderRoot + { + private readonly IRenderTarget _renderTarget; + public Size ClientSize { get; private set; } + public IRenderer Renderer { get; private set; } + public double RenderScaling { get; } + + public TestRenderRoot(double scaling, IRenderTarget renderTarget) + { + _renderTarget = renderTarget; + RenderScaling = scaling; + } + + public void Initialize(IRenderer renderer, Control child) + { + Renderer = renderer; + Child = child; + Width = child.Width; + Height = child.Height; + ClientSize = new Size(Width, Height); + Measure(ClientSize); + Arrange(new Rect(ClientSize)); + } + + public IRenderTarget CreateRenderTarget() => _renderTarget; + + public void Invalidate(Rect rect) + { + } + + public Point PointToClient(PixelPoint point) => point.ToPoint(RenderScaling); + + public PixelPoint PointToScreen(Point point) => PixelPoint.FromPoint(point, RenderScaling); + } +} \ No newline at end of file diff --git a/tests/Avalonia.UnitTests/MockPlatformRenderInterface.cs b/tests/Avalonia.UnitTests/MockPlatformRenderInterface.cs index bf4ac9c1f6..f6a127b573 100644 --- a/tests/Avalonia.UnitTests/MockPlatformRenderInterface.cs +++ b/tests/Avalonia.UnitTests/MockPlatformRenderInterface.cs @@ -4,6 +4,7 @@ using System.IO; using Avalonia.Media; using Avalonia.Platform; using Avalonia.Media.Imaging; +using Avalonia.Rendering; using Moq; namespace Avalonia.UnitTests @@ -25,9 +26,33 @@ namespace Avalonia.UnitTests return Mock.Of(x => x.Bounds == rect); } + class MockRenderTarget : IRenderTarget + { + public void Dispose() + { + + } + + public IDrawingContextImpl CreateDrawingContext(IVisualBrushRenderer visualBrushRenderer) + { + var m = new Mock(); + m.Setup(c => c.CreateLayer(It.IsAny())) + .Returns(() => + { + var r = new Mock(); + r.Setup(r => r.CreateDrawingContext(It.IsAny())) + .Returns(CreateDrawingContext(null)); + return r.Object; + } + ); + return m.Object; + + } + } + public IRenderTarget CreateRenderTarget(IEnumerable surfaces) { - return Mock.Of(); + return new MockRenderTarget(); } public IRenderTargetBitmapImpl CreateRenderTargetBitmap(PixelSize size, Vector dpi) diff --git a/tests/Avalonia.UnitTests/MockWindowingPlatform.cs b/tests/Avalonia.UnitTests/MockWindowingPlatform.cs index 461e0f4392..e30f0fa5f3 100644 --- a/tests/Avalonia.UnitTests/MockWindowingPlatform.cs +++ b/tests/Avalonia.UnitTests/MockWindowingPlatform.cs @@ -21,11 +21,11 @@ namespace Avalonia.UnitTests _popupImpl = popupImpl; } - public static Mock CreateWindowMock() + public static Mock CreateWindowMock(double initialWidth = 800, double initialHeight = 600) { var windowImpl = new Mock(); var position = new PixelPoint(); - var clientSize = new Size(800, 600); + var clientSize = new Size(initialWidth, initialHeight); windowImpl.SetupAllProperties(); windowImpl.Setup(x => x.ClientSize).Returns(() => clientSize); @@ -34,7 +34,6 @@ namespace Avalonia.UnitTests windowImpl.Setup(x => x.RenderScaling).Returns(1); windowImpl.Setup(x => x.Screen).Returns(CreateScreenMock().Object); windowImpl.Setup(x => x.Position).Returns(() => position); - SetupToplevel(windowImpl); windowImpl.Setup(x => x.CreatePopup()).Returns(() => { @@ -55,12 +54,18 @@ namespace Avalonia.UnitTests windowImpl.Setup(x => x.Resize(It.IsAny(), It.IsAny())) .Callback((x, y) => { - clientSize = x.Constrain(s_screenSize); - windowImpl.Object.Resized?.Invoke(clientSize, y); + var constrainedSize = x.Constrain(s_screenSize); + + if (constrainedSize != clientSize) + { + clientSize = constrainedSize; + windowImpl.Object.Resized?.Invoke(clientSize, y); + } }); windowImpl.Setup(x => x.Show(true, It.IsAny())).Callback(() => { + windowImpl.Object.Resized?.Invoke(windowImpl.Object.ClientSize, PlatformResizeReason.Unspecified); windowImpl.Object.Activated?.Invoke(); }); @@ -94,8 +99,6 @@ namespace Avalonia.UnitTests { popupImpl.Object.Closed?.Invoke(); }); - - SetupToplevel(popupImpl); return popupImpl; } @@ -138,10 +141,5 @@ namespace Avalonia.UnitTests { return null; } - - private static void SetupToplevel(Mock mock) where T : class, ITopLevelImpl - { - mock.SetupGet(x => x.MouseDevice).Returns(new MouseDevice()); - } } } diff --git a/tests/Avalonia.UnitTests/TestRoot.cs b/tests/Avalonia.UnitTests/TestRoot.cs index 41e29a85c4..138958512f 100644 --- a/tests/Avalonia.UnitTests/TestRoot.cs +++ b/tests/Avalonia.UnitTests/TestRoot.cs @@ -58,9 +58,7 @@ namespace Avalonia.UnitTests public IKeyboardNavigationHandler KeyboardNavigationHandler => null; public IInputElement PointerOverElement { get; set; } - - public IMouseDevice MouseDevice { get; set; } - + public bool ShowAccessKeys { get; set; } public IStyleHost StylingParent { get; set; }