├── .github ├── FUNDING.yml └── workflows │ └── ci.yml ├── .gitignore ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── LICENSE-ZLIB ├── README.md ├── bors.toml ├── clippy.toml ├── examples ├── hello │ ├── Cargo.toml │ ├── README.md │ ├── index.html │ └── src │ │ └── main.rs └── howto │ ├── Cargo.toml │ ├── README.md │ └── src │ └── main.rs ├── generate-native.sh ├── rustfmt.toml └── src ├── gl46.rs ├── lib.rs ├── native.rs ├── version.rs └── web_sys.rs /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [grovesNL] 2 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches-ignore: [staging.tmp] 6 | pull_request: 7 | branches-ignore: [staging.tmp] 8 | 9 | jobs: 10 | build: 11 | runs-on: ${{ matrix.os }} 12 | strategy: 13 | matrix: 14 | build: [pinned, stable, beta, nightly, macos, windows] 15 | include: 16 | - build: pinned 17 | os: ubuntu-latest 18 | rust: 1.73.0 19 | sdl: true 20 | - build: stable 21 | os: ubuntu-latest 22 | rust: stable 23 | sdl: true 24 | - build: beta 25 | os: ubuntu-latest 26 | rust: beta 27 | sdl: true 28 | - build: nightly 29 | os: ubuntu-latest 30 | rust: nightly 31 | sdl: true 32 | - build: macos 33 | os: macos-latest 34 | rust: stable 35 | sdl: false 36 | - build: windows 37 | os: windows-latest 38 | rust: stable 39 | sdl: false 40 | steps: 41 | - name: Checkout 42 | uses: actions/checkout@v2 43 | - name: Install toolchain 44 | uses: actions-rs/toolchain@v1 45 | with: 46 | toolchain: ${{ matrix.rust }} 47 | override: true 48 | profile: minimal 49 | target: wasm32-unknown-unknown 50 | - run: cargo build --verbose 51 | - run: cargo build --verbose --target wasm32-unknown-unknown 52 | env: 53 | RUSTFLAGS: --cfg=web_sys_unstable_apis 54 | - run: cargo test --verbose 55 | - run: (cd examples/hello && cargo build --features glutin_winit) 56 | - run: (cd examples/hello && cargo build --target wasm32-unknown-unknown) 57 | - name: sdl 58 | if: ${{ matrix.sdl == true }} 59 | run: | 60 | sudo apt-get -qq update 61 | sudo apt-get -qq install libsdl2-dev 62 | cargo build --verbose 63 | (cd examples/hello && cargo build --features sdl2) 64 | - name: android 65 | if: matrix.build == 'stable' 66 | run: | 67 | rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android 68 | cargo build --verbose --target aarch64-linux-android 69 | cargo build --verbose --target armv7-linux-androideabi 70 | cargo build --verbose --target x86_64-linux-android 71 | lint: 72 | runs-on: ubuntu-latest 73 | steps: 74 | - name: Checkout 75 | uses: actions/checkout@v2 76 | - name: Check fmt 77 | run: cargo fmt --check 78 | - name: Install phosphorus from crates.io 79 | uses: baptiste0928/cargo-install@v3 80 | with: 81 | crate: phosphorus 82 | version: '0.0.22' 83 | - name: Test reproducability of gl46.rs 84 | run: bash generate-native.sh 85 | - uses: infotroph/tree-is-clean@v1 86 | with: 87 | check_untracked: true 88 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | /target 3 | **/*.rs.bk 4 | Cargo.lock 5 | generated 6 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "glow" 3 | version = "0.16.0" 4 | description = "GL on Whatever: a set of bindings to run GL (Open GL, OpenGL ES, and WebGL) anywhere, and avoid target-specific code." 5 | authors = [ 6 | "Joshua Groves ", 7 | "Dzmitry Malyshau ", 8 | ] 9 | homepage = "https://github.com/grovesNL/glow.git" 10 | repository = "https://github.com/grovesNL/glow" 11 | license = "MIT OR Apache-2.0 OR Zlib" 12 | edition = "2021" 13 | 14 | [package.metadata.docs.rs] 15 | default-target = "x86_64-unknown-linux-gnu" 16 | targets = [ 17 | "x86_64-unknown-linux-gnu", 18 | "x86_64-apple-darwin", 19 | "x86_64-pc-windows-msvc", 20 | "i686-unknown-linux-gnu", 21 | "i686-pc-windows-msvc", 22 | "wasm32-unknown-unknown" 23 | ] 24 | 25 | [lib] 26 | name = "glow" 27 | path = "src/lib.rs" 28 | 29 | [dependencies] 30 | log = { version = "0.4.16", optional = true } 31 | 32 | [features] 33 | debug_trace_calls = [] 34 | debug_automatic_glGetError = [] 35 | 36 | [target.'cfg(target_arch = "wasm32")'.dependencies] 37 | js-sys = "~0.3" 38 | wasm-bindgen = "~0.2" 39 | slotmap = "1" 40 | 41 | [target.'cfg(target_arch = "wasm32")'.dependencies.web_sys] 42 | version = "~0.3.60" 43 | package = "web-sys" 44 | features = [ 45 | "Document", 46 | "Element", 47 | "HtmlCanvasElement", 48 | "HtmlImageElement", 49 | "HtmlVideoElement", 50 | "ImageBitmap", 51 | "ImageData", 52 | "VideoFrame", 53 | "WebGlActiveInfo", 54 | "WebGlBuffer", 55 | "WebGlFramebuffer", 56 | "WebGlProgram", 57 | "WebGlQuery", 58 | "WebGlRenderbuffer", 59 | "WebGlRenderingContext", 60 | "WebGl2RenderingContext", 61 | "WebGlSampler", 62 | "WebGlShader", 63 | "WebGlShaderPrecisionFormat", 64 | "WebGlSync", 65 | "WebGlTexture", 66 | "WebGlTransformFeedback", 67 | "WebGlUniformLocation", 68 | "WebGlVertexArrayObject", 69 | "Window", 70 | 71 | "AngleInstancedArrays", 72 | "ExtBlendMinmax", 73 | "ExtColorBufferFloat", 74 | "ExtColorBufferHalfFloat", 75 | "ExtDisjointTimerQuery", 76 | "ExtFragDepth", 77 | "ExtShaderTextureLod", 78 | "ExtSRgb", 79 | "ExtTextureFilterAnisotropic", 80 | "OesElementIndexUint", 81 | "OesStandardDerivatives", 82 | "OesTextureFloat", 83 | "OesTextureFloatLinear", 84 | "OesTextureHalfFloat", 85 | "OesTextureHalfFloatLinear", 86 | "OesVertexArrayObject", 87 | "WebglColorBufferFloat", 88 | "WebglCompressedTextureAstc", 89 | "WebglCompressedTextureEtc", 90 | "WebglCompressedTextureEtc1", 91 | "WebglCompressedTexturePvrtc", 92 | "WebglCompressedTextureS3tc", 93 | "WebglCompressedTextureS3tcSrgb", 94 | "WebglDebugRendererInfo", 95 | "WebglDebugShaders", 96 | "WebglDepthTexture", 97 | "WebglDrawBuffers", 98 | "WebglLoseContext", 99 | "OvrMultiview2", 100 | ] 101 | 102 | [workspace] 103 | members = [ 104 | "examples/hello", 105 | "examples/howto", 106 | ] 107 | -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any 2 | person obtaining a copy of this software and associated 3 | documentation files (the "Software"), to deal in the 4 | Software without restriction, including without 5 | limitation the rights to use, copy, modify, merge, 6 | publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software 8 | is furnished to do so, subject to the following 9 | conditions: 10 | 11 | The above copyright notice and this permission notice 12 | shall be included in all copies or substantial portions 13 | of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 16 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 17 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 18 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 19 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 22 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /LICENSE-ZLIB: -------------------------------------------------------------------------------- 1 | This software is provided 'as-is', without any express or implied 2 | warranty. In no event will the authors be held liable for any damages 3 | arising from the use of this software. 4 | 5 | Permission is granted to anyone to use this software for any purpose, 6 | including commercial applications, and to alter it and redistribute it 7 | freely, subject to the following restrictions: 8 | 9 | 1. The origin of this software must not be misrepresented; you must not 10 | claim that you wrote the original software. If you use this software 11 | in a product, an acknowledgment in the product documentation would be 12 | appreciated but is not required. 13 | 2. Altered source versions must be plainly marked as such, and must not be 14 | misrepresented as being the original software. 15 | 3. This notice may not be removed or altered from any source distribution. 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | glow 3 |

4 |
5 | GL on Whatever: a set of bindings to run GL anywhere (Open GL, OpenGL ES, and WebGL) and avoid target-specific code. 6 |
7 |
8 |
9 | crates.io 10 | docs.rs 11 | Build Status 12 | Minimum Rust Version 13 |
14 | 15 | ## Build commands 16 | 17 | ```sh 18 | # native 19 | cargo build 20 | 21 | # web-sys 22 | cargo build --target wasm32-unknown-unknown 23 | ``` 24 | 25 | ## License 26 | 27 | This project is licensed under any one of [Apache License, Version 28 | 2.0](LICENSE-APACHE), [zlib License](LICENSE-ZLIB), or [MIT 29 | license](LICENSE-MIT), at your option. 30 | 31 | ## Contribution 32 | 33 | Unless you explicitly state otherwise, any contribution intentionally submitted 34 | for inclusion in this project by you, as defined in the Apache 2.0 license, 35 | shall be dual licensed as above, without any additional terms or conditions. 36 | -------------------------------------------------------------------------------- /bors.toml: -------------------------------------------------------------------------------- 1 | status = [ 2 | "build (pinned)", 3 | "build (stable)", 4 | "build (beta)", 5 | "build (nightly)", 6 | "build (macos)", 7 | "build (windows)" 8 | ] 9 | -------------------------------------------------------------------------------- /clippy.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grovesNL/glow/aa4238a60d17076b917eaa1ec662e5080df42b0a/clippy.toml -------------------------------------------------------------------------------- /examples/hello/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "hello" 3 | version = "0.1.0" 4 | edition = "2018" 5 | 6 | [dependencies] 7 | glow = { path = "../../" } 8 | 9 | [target.'cfg(not(any(target_arch = "wasm32")))'.dependencies] 10 | glutin = { version = "0.31.2", optional = true } 11 | glutin-winit = { version = "0.4.2", optional = true} 12 | winit = { version = "0.29.10", features = ["rwh_05"], optional = true } 13 | raw-window-handle = { version = "0.5", optional = true } 14 | sdl2 = { version = "0.35", optional = true } 15 | 16 | [target.'cfg(target_arch = "wasm32")'.dependencies] 17 | web-sys = { version = "0.3", features=["HtmlCanvasElement", "WebGl2RenderingContext", "Window"] } 18 | wasm-bindgen = { version = "0.2" } 19 | 20 | [features] 21 | glutin_winit = ["glutin", "glutin-winit", "winit", "raw-window-handle"] 22 | -------------------------------------------------------------------------------- /examples/hello/README.md: -------------------------------------------------------------------------------- 1 | # How to Build 2 | 3 | ## Native 4 | 5 | To run with glutin and winit: 6 | 7 | ```shell 8 | cargo run --features=glutin_winit 9 | ``` 10 | 11 | To run with sdl2: 12 | 13 | ```shell 14 | cargo run --features=sdl2 15 | ``` 16 | 17 | ## Web 18 | 19 | `cd` to `examples/hello` directory 20 | 21 | To run with web-sys: 22 | 23 | ```shell 24 | cargo build --target wasm32-unknown-unknown 25 | mkdir -p generated 26 | wasm-bindgen ../../target/wasm32-unknown-unknown/debug/hello.wasm --out-dir generated --target web 27 | cp index.html generated 28 | ``` 29 | -------------------------------------------------------------------------------- /examples/hello/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/hello/src/main.rs: -------------------------------------------------------------------------------- 1 | use glow::*; 2 | 3 | fn main() { 4 | unsafe { 5 | // Create a context from a WebGL2 context on wasm32 targets 6 | #[cfg(target_arch = "wasm32")] 7 | let (gl, shader_version) = { 8 | use wasm_bindgen::JsCast; 9 | let canvas = web_sys::window() 10 | .unwrap() 11 | .document() 12 | .unwrap() 13 | .get_element_by_id("canvas") 14 | .unwrap() 15 | .dyn_into::() 16 | .unwrap(); 17 | let webgl2_context = canvas 18 | .get_context("webgl2") 19 | .unwrap() 20 | .unwrap() 21 | .dyn_into::() 22 | .unwrap(); 23 | let gl = glow::Context::from_webgl2_context(webgl2_context); 24 | (gl, "#version 300 es") 25 | }; 26 | 27 | // Create a context from a glutin window on non-wasm32 targets 28 | #[cfg(feature = "glutin_winit")] 29 | let (gl, gl_surface, gl_context, shader_version, _window, event_loop) = { 30 | use glutin::{ 31 | config::{ConfigTemplateBuilder, GlConfig}, 32 | context::{ContextApi, ContextAttributesBuilder, NotCurrentGlContext}, 33 | display::{GetGlDisplay, GlDisplay}, 34 | surface::{GlSurface, SwapInterval}, 35 | }; 36 | use glutin_winit::{DisplayBuilder, GlWindow}; 37 | use raw_window_handle::HasRawWindowHandle; 38 | use std::num::NonZeroU32; 39 | 40 | let event_loop = winit::event_loop::EventLoopBuilder::new().build().unwrap(); 41 | let window_builder = winit::window::WindowBuilder::new() 42 | .with_title("Hello triangle!") 43 | .with_inner_size(winit::dpi::LogicalSize::new(1024.0, 768.0)); 44 | 45 | let template = ConfigTemplateBuilder::new(); 46 | 47 | let display_builder = DisplayBuilder::new().with_window_builder(Some(window_builder)); 48 | 49 | let (window, gl_config) = display_builder 50 | .build(&event_loop, template, |configs| { 51 | configs 52 | .reduce(|accum, config| { 53 | if config.num_samples() > accum.num_samples() { 54 | config 55 | } else { 56 | accum 57 | } 58 | }) 59 | .unwrap() 60 | }) 61 | .unwrap(); 62 | 63 | let raw_window_handle = window.as_ref().map(|window| window.raw_window_handle()); 64 | 65 | let gl_display = gl_config.display(); 66 | let context_attributes = ContextAttributesBuilder::new() 67 | .with_context_api(ContextApi::OpenGl(Some(glutin::context::Version { 68 | major: 4, 69 | minor: 1, 70 | }))) 71 | .build(raw_window_handle); 72 | 73 | let not_current_gl_context = gl_display 74 | .create_context(&gl_config, &context_attributes) 75 | .unwrap(); 76 | 77 | let window = window.unwrap(); 78 | 79 | let attrs = window.build_surface_attributes(Default::default()); 80 | let gl_surface = gl_display 81 | .create_window_surface(&gl_config, &attrs) 82 | .unwrap(); 83 | 84 | let gl_context = not_current_gl_context.make_current(&gl_surface).unwrap(); 85 | 86 | let gl = glow::Context::from_loader_function_cstr(|s| gl_display.get_proc_address(s)); 87 | 88 | gl_surface 89 | .set_swap_interval(&gl_context, SwapInterval::Wait(NonZeroU32::new(1).unwrap())) 90 | .unwrap(); 91 | 92 | ( 93 | gl, 94 | gl_surface, 95 | gl_context, 96 | "#version 410", 97 | window, 98 | event_loop, 99 | ) 100 | }; 101 | 102 | // Create a context from a sdl2 window 103 | #[cfg(feature = "sdl2")] 104 | let (gl, shader_version, window, mut events_loop, _context) = { 105 | let sdl = sdl2::init().unwrap(); 106 | let video = sdl.video().unwrap(); 107 | let gl_attr = video.gl_attr(); 108 | gl_attr.set_context_profile(sdl2::video::GLProfile::Core); 109 | gl_attr.set_context_version(3, 0); 110 | let window = video 111 | .window("Hello triangle!", 1024, 769) 112 | .opengl() 113 | .resizable() 114 | .build() 115 | .unwrap(); 116 | let gl_context = window.gl_create_context().unwrap(); 117 | let gl = 118 | glow::Context::from_loader_function(|s| video.gl_get_proc_address(s) as *const _); 119 | let event_loop = sdl.event_pump().unwrap(); 120 | (gl, "#version 130", window, event_loop, gl_context) 121 | }; 122 | 123 | let vertex_array = gl 124 | .create_vertex_array() 125 | .expect("Cannot create vertex array"); 126 | gl.bind_vertex_array(Some(vertex_array)); 127 | 128 | let program = gl.create_program().expect("Cannot create program"); 129 | 130 | let (vertex_shader_source, fragment_shader_source) = ( 131 | r#"const vec2 verts[3] = vec2[3]( 132 | vec2(0.5f, 1.0f), 133 | vec2(0.0f, 0.0f), 134 | vec2(1.0f, 0.0f) 135 | ); 136 | out vec2 vert; 137 | void main() { 138 | vert = verts[gl_VertexID]; 139 | gl_Position = vec4(vert - 0.5, 0.0, 1.0); 140 | }"#, 141 | r#"precision mediump float; 142 | in vec2 vert; 143 | out vec4 color; 144 | void main() { 145 | color = vec4(vert, 0.5, 1.0); 146 | }"#, 147 | ); 148 | 149 | let shader_sources = [ 150 | (glow::VERTEX_SHADER, vertex_shader_source), 151 | (glow::FRAGMENT_SHADER, fragment_shader_source), 152 | ]; 153 | 154 | let mut shaders = Vec::with_capacity(shader_sources.len()); 155 | 156 | for (shader_type, shader_source) in shader_sources.iter() { 157 | let shader = gl 158 | .create_shader(*shader_type) 159 | .expect("Cannot create shader"); 160 | gl.shader_source(shader, &format!("{}\n{}", shader_version, shader_source)); 161 | gl.compile_shader(shader); 162 | if !gl.get_shader_compile_status(shader) { 163 | panic!("{}", gl.get_shader_info_log(shader)); 164 | } 165 | gl.attach_shader(program, shader); 166 | shaders.push(shader); 167 | } 168 | 169 | gl.link_program(program); 170 | if !gl.get_program_link_status(program) { 171 | panic!("{}", gl.get_program_info_log(program)); 172 | } 173 | 174 | for shader in shaders { 175 | gl.detach_shader(program, shader); 176 | gl.delete_shader(shader); 177 | } 178 | 179 | gl.use_program(Some(program)); 180 | gl.clear_color(0.1, 0.2, 0.3, 1.0); 181 | 182 | // We handle events differently between targets 183 | 184 | #[cfg(feature = "glutin_winit")] 185 | { 186 | use glutin::prelude::GlSurface; 187 | use winit::event::{Event, WindowEvent}; 188 | let _ = event_loop.run(move |event, elwt| { 189 | if let Event::WindowEvent { event, .. } = event { 190 | match event { 191 | WindowEvent::CloseRequested => { 192 | elwt.exit(); 193 | } 194 | WindowEvent::RedrawRequested => { 195 | gl.clear(glow::COLOR_BUFFER_BIT); 196 | gl.draw_arrays(glow::TRIANGLES, 0, 3); 197 | gl_surface.swap_buffers(&gl_context).unwrap(); 198 | } 199 | _ => (), 200 | } 201 | } 202 | }); 203 | } 204 | 205 | #[cfg(feature = "sdl2")] 206 | { 207 | let mut running = true; 208 | while running { 209 | { 210 | for event in events_loop.poll_iter() { 211 | match event { 212 | sdl2::event::Event::Quit { .. } => running = false, 213 | _ => {} 214 | } 215 | } 216 | } 217 | 218 | gl.clear(glow::COLOR_BUFFER_BIT); 219 | gl.draw_arrays(glow::TRIANGLES, 0, 3); 220 | window.gl_swap_window(); 221 | 222 | if !running { 223 | gl.delete_program(program); 224 | gl.delete_vertex_array(vertex_array); 225 | } 226 | } 227 | } 228 | 229 | #[cfg(target_arch = "wasm32")] 230 | { 231 | // This could be called from `requestAnimationFrame`, a winit event 232 | // loop, etc. 233 | gl.clear(glow::COLOR_BUFFER_BIT); 234 | gl.draw_arrays(glow::TRIANGLES, 0, 3); 235 | gl.delete_program(program); 236 | gl.delete_vertex_array(vertex_array); 237 | } 238 | } 239 | } 240 | -------------------------------------------------------------------------------- /examples/howto/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "howto" 3 | version = "0.1.0" 4 | edition = "2018" 5 | 6 | [dependencies] 7 | glow = { path = "../../" } 8 | sdl2 = { version = "0.35" } 9 | -------------------------------------------------------------------------------- /examples/howto/README.md: -------------------------------------------------------------------------------- 1 | # `howto` example 2 | 3 | This example is meant to showcase common actions within `glow`. 4 | 5 | # How to Build 6 | 7 | ```shell 8 | cargo run 9 | ``` 10 | -------------------------------------------------------------------------------- /examples/howto/src/main.rs: -------------------------------------------------------------------------------- 1 | use glow::*; 2 | 3 | fn main() { 4 | unsafe { 5 | // Create a context from a sdl2 window 6 | let (gl, window, mut events_loop, _context) = create_sdl2_context(); 7 | 8 | // Create a shader program from source 9 | let program = create_program(&gl, VERTEX_SHADER_SOURCE, FRAGMENT_SHADER_SOURCE); 10 | gl.use_program(Some(program)); 11 | 12 | // Create a vertex buffer and vertex array object 13 | let (vbo, vao) = create_vertex_buffer(&gl); 14 | 15 | // Upload some uniforms 16 | set_uniform(&gl, program, "blue", 0.8); 17 | 18 | gl.clear_color(0.1, 0.2, 0.3, 1.0); 19 | 20 | 'render: loop { 21 | { 22 | for event in events_loop.poll_iter() { 23 | if let sdl2::event::Event::Quit { .. } = event { 24 | break 'render; 25 | } 26 | } 27 | } 28 | 29 | gl.clear(glow::COLOR_BUFFER_BIT); 30 | gl.draw_arrays(glow::TRIANGLES, 0, 3); 31 | window.gl_swap_window(); 32 | } 33 | 34 | // Clean up 35 | gl.delete_program(program); 36 | gl.delete_vertex_array(vao); 37 | gl.delete_buffer(vbo) 38 | } 39 | } 40 | 41 | unsafe fn create_sdl2_context() -> ( 42 | glow::Context, 43 | sdl2::video::Window, 44 | sdl2::EventPump, 45 | sdl2::video::GLContext, 46 | ) { 47 | let sdl = sdl2::init().unwrap(); 48 | let video = sdl.video().unwrap(); 49 | let gl_attr = video.gl_attr(); 50 | gl_attr.set_context_profile(sdl2::video::GLProfile::Core); 51 | gl_attr.set_context_version(3, 3); 52 | gl_attr.set_context_flags().forward_compatible().set(); 53 | let window = video 54 | .window("Hello triangle!", 1024, 769) 55 | .opengl() 56 | .resizable() 57 | .build() 58 | .unwrap(); 59 | let gl_context = window.gl_create_context().unwrap(); 60 | let gl = glow::Context::from_loader_function(|s| video.gl_get_proc_address(s) as *const _); 61 | let event_loop = sdl.event_pump().unwrap(); 62 | 63 | (gl, window, event_loop, gl_context) 64 | } 65 | 66 | unsafe fn create_program( 67 | gl: &glow::Context, 68 | vertex_shader_source: &str, 69 | fragment_shader_source: &str, 70 | ) -> NativeProgram { 71 | let program = gl.create_program().expect("Cannot create program"); 72 | 73 | let shader_sources = [ 74 | (glow::VERTEX_SHADER, vertex_shader_source), 75 | (glow::FRAGMENT_SHADER, fragment_shader_source), 76 | ]; 77 | 78 | let mut shaders = Vec::with_capacity(shader_sources.len()); 79 | 80 | for (shader_type, shader_source) in shader_sources.iter() { 81 | let shader = gl 82 | .create_shader(*shader_type) 83 | .expect("Cannot create shader"); 84 | gl.shader_source(shader, shader_source); 85 | gl.compile_shader(shader); 86 | if !gl.get_shader_compile_status(shader) { 87 | panic!("{}", gl.get_shader_info_log(shader)); 88 | } 89 | gl.attach_shader(program, shader); 90 | shaders.push(shader); 91 | } 92 | 93 | gl.link_program(program); 94 | if !gl.get_program_link_status(program) { 95 | panic!("{}", gl.get_program_info_log(program)); 96 | } 97 | 98 | for shader in shaders { 99 | gl.detach_shader(program, shader); 100 | gl.delete_shader(shader); 101 | } 102 | 103 | program 104 | } 105 | 106 | unsafe fn create_vertex_buffer(gl: &glow::Context) -> (NativeBuffer, NativeVertexArray) { 107 | // This is a flat array of f32s that are to be interpreted as vec2s. 108 | let triangle_vertices = [0.5f32, 1.0f32, 0.0f32, 0.0f32, 1.0f32, 0.0f32]; 109 | let triangle_vertices_u8: &[u8] = core::slice::from_raw_parts( 110 | triangle_vertices.as_ptr() as *const u8, 111 | triangle_vertices.len() * core::mem::size_of::(), 112 | ); 113 | 114 | // We construct a buffer and upload the data 115 | let vbo = gl.create_buffer().unwrap(); 116 | gl.bind_buffer(glow::ARRAY_BUFFER, Some(vbo)); 117 | gl.buffer_data_u8_slice(glow::ARRAY_BUFFER, triangle_vertices_u8, glow::STATIC_DRAW); 118 | 119 | // We now construct a vertex array to describe the format of the input buffer 120 | let vao = gl.create_vertex_array().unwrap(); 121 | gl.bind_vertex_array(Some(vao)); 122 | gl.enable_vertex_attrib_array(0); 123 | gl.vertex_attrib_pointer_f32(0, 2, glow::FLOAT, false, 8, 0); 124 | 125 | (vbo, vao) 126 | } 127 | 128 | unsafe fn set_uniform(gl: &glow::Context, program: NativeProgram, name: &str, value: f32) { 129 | let uniform_location = gl.get_uniform_location(program, name); 130 | // See also `uniform_n_i32`, `uniform_n_u32`, `uniform_matrix_4_f32_slice` etc. 131 | gl.uniform_1_f32(uniform_location.as_ref(), value) 132 | } 133 | 134 | const VERTEX_SHADER_SOURCE: &str = r#"#version 330 135 | in vec2 in_position; 136 | out vec2 position; 137 | void main() { 138 | position = in_position; 139 | gl_Position = vec4(in_position - 0.5, 0.0, 1.0); 140 | }"#; 141 | const FRAGMENT_SHADER_SOURCE: &str = r#"#version 330 142 | precision mediump float; 143 | in vec2 position; 144 | out vec4 color; 145 | uniform float blue; 146 | void main() { 147 | color = vec4(position, blue, 1.0); 148 | }"#; 149 | -------------------------------------------------------------------------------- /generate-native.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | mkdir -p generated 3 | curl https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/01ac568838ce3a93385d885362e3ddc7bca54b08/xml/gl.xml > generated/gl.xml 4 | 5 | # phosphorus expects one API, but we're trying to generate bindings for multiple at once. 6 | # We'll work around it for now by renaming GL ES 3.2 to match GL 4.6. 7 | replacements='' 8 | replacements+='s/api="gles2"/api="gl"/g;' 9 | replacements+='s/name="GL_ES_VERSION_3_2"/name="GL_VERSION_4_6"/g;' 10 | replacements+='s/number="3.2"/number="4.6"/g;' 11 | sed --in-place $replacements generated/gl.xml 12 | 13 | gl_extensions=( 14 | GL_ARB_debug_output 15 | GL_KHR_debug 16 | GL_ARB_texture_filter_anisotropic 17 | GL_EXT_texture_filter_anisotropic 18 | GL_ARB_tessellation_shader 19 | GL_ARB_compute_shader 20 | GL_ARB_instanced_arrays 21 | GL_EXT_draw_buffers2 22 | GL_ARB_draw_instanced 23 | GL_ARB_base_instance 24 | GL_ARB_draw_elements_base_vertex 25 | GL_ARB_framebuffer_sRGB 26 | GL_ARB_uniform_buffer_object 27 | GL_ARB_copy_buffer 28 | GL_NV_copy_buffer 29 | GL_ARB_sampler_objects 30 | GL_ARB_buffer_storage 31 | GL_EXT_buffer_storage 32 | GL_ARB_vertex_array_object 33 | GL_ARB_framebuffer_object 34 | GL_ARB_texture_storage 35 | GL_ARB_program_interface_query 36 | GL_ARB_sync 37 | GL_KHR_parallel_shader_compile 38 | GL_ARB_parallel_shader_compile 39 | GL_OES_vertex_array_object 40 | GL_APPLE_vertex_array_object 41 | GL_EXT_disjoint_timer_query 42 | ) 43 | printf -v gl_extensions_comma_joined '%s,' "${gl_extensions[@]}" 44 | 45 | phosphorus \ 46 | ./generated/gl.xml \ 47 | gl \ 48 | 4 6 \ 49 | core \ 50 | "${gl_extensions_comma_joined%,}" \ 51 | > generated/gl46.rs 52 | 53 | cp generated/gl46.rs src/gl46.rs 54 | cargo fmt 55 | # add allow(unused) 56 | sed -i '1 i\#!\[allow(unused)]' src/gl46.rs 57 | # remove features for extentions 58 | for gl_extension in "${gl_extensions[@]}"; do 59 | sed -i '/#\[cfg(any(feature = "'"$gl_extension"'"))]/d' src/gl46.rs 60 | sed -i '/#\[cfg_attr(docs_rs, doc(cfg(any(feature = "'"$gl_extension"'"))))]/d' src/gl46.rs 61 | done 62 | function remove_between() { 63 | start_line=$(grep -wn "$1" src/gl46.rs | cut -d: -f1 | head -n 1) 64 | end_line=$(grep -wn "$2" src/gl46.rs | cut -d: -f1 | head -n 1) 65 | sed -i "${start_line},${end_line}d" src/gl46.rs 66 | } 67 | # remove unused import 68 | remove_between '#\[cfg(feature = "chlorine")]' '#\[cfg(not(feature = "chlorine"))]' 69 | # remove first ocurance of #[cfg(feature = "global_loader")] 70 | remove_between '#\[cfg(feature = "global_loader")]' '#\[cfg(feature = "global_loader")]' 71 | # remove global loader 72 | remove_between '#\[cfg(feature = "global_loader")]' '#\[cfg(feature = "struct_loader")]' 73 | # remove all occurances of #[cfg(feature = "struct_loader")] 74 | sed -i '/#\[cfg(feature = "struct_loader")]/d' src/gl46.rs 75 | cargo fmt -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/grovesNL/glow/aa4238a60d17076b917eaa1ec662e5080df42b0a/rustfmt.toml -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(non_upper_case_globals)] 2 | #![allow(clippy::too_many_arguments)] 3 | #![allow(clippy::trivially_copy_pass_by_ref)] 4 | #![allow(clippy::unreadable_literal)] 5 | #![allow(clippy::missing_safety_doc)] 6 | #![allow(clippy::pedantic)] // For anyone using pedantic and a source dep, this is needed 7 | 8 | use core::fmt::Debug; 9 | use core::hash::Hash; 10 | use std::collections::HashSet; 11 | 12 | mod version; 13 | pub use version::Version; 14 | 15 | #[cfg(any(not(target_arch = "wasm32"), target_os = "emscripten"))] 16 | mod native; 17 | #[cfg(any(not(target_arch = "wasm32"), target_os = "emscripten"))] 18 | pub use native::*; 19 | #[cfg(any(not(target_arch = "wasm32"), target_os = "emscripten"))] 20 | mod gl46; 21 | 22 | #[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))] 23 | #[path = "web_sys.rs"] 24 | mod web; 25 | #[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))] 26 | pub use web::*; 27 | 28 | pub type Shader = ::Shader; 29 | pub type Program = ::Program; 30 | pub type Buffer = ::Buffer; 31 | pub type VertexArray = ::VertexArray; 32 | pub type Texture = ::Texture; 33 | pub type Sampler = ::Sampler; 34 | pub type Fence = ::Fence; 35 | pub type Framebuffer = ::Framebuffer; 36 | pub type Renderbuffer = ::Renderbuffer; 37 | pub type Query = ::Query; 38 | pub type UniformLocation = ::UniformLocation; 39 | pub type TransformFeedback = ::TransformFeedback; 40 | pub type DebugCallback = Box; 41 | 42 | pub struct ActiveUniform { 43 | pub size: i32, 44 | pub utype: u32, 45 | pub name: String, 46 | } 47 | 48 | pub struct ActiveAttribute { 49 | pub size: i32, 50 | pub atype: u32, 51 | pub name: String, 52 | } 53 | 54 | pub struct ActiveTransformFeedback { 55 | pub size: i32, 56 | pub tftype: u32, 57 | pub name: String, 58 | } 59 | 60 | #[derive(Debug)] 61 | pub struct ShaderPrecisionFormat { 62 | /// The base 2 log of the absolute value of the minimum value that can be represented 63 | pub range_min: i32, 64 | /// The base 2 log of the absolute value of the maximum value that can be represented. 65 | pub range_max: i32, 66 | /// The number of bits of precision that can be represented. 67 | /// For integer formats this value is always 0. 68 | pub precision: i32, 69 | } 70 | 71 | impl ShaderPrecisionFormat { 72 | /// Returns OpenGL standard precision that most desktop hardware support 73 | pub fn common_desktop_hardware(precision_type: u32, is_embedded: bool) -> Self { 74 | let (range_min, range_max, precision) = match precision_type { 75 | LOW_INT | MEDIUM_INT | HIGH_INT => { 76 | // Precision: For integer formats this value is always 0 77 | if is_embedded { 78 | // These values are for a 32-bit twos-complement integer format. 79 | (31, 30, 0) 80 | } else { 81 | // Range: from -2^24 to 2^24 82 | (24, 24, 0) 83 | } 84 | } 85 | // IEEE 754 single-precision floating-point 86 | // Range: from -2^127 to 2^127 87 | // Significand precision: 23 bits 88 | LOW_FLOAT | MEDIUM_FLOAT | HIGH_FLOAT => (127, 127, 23), 89 | _ => unreachable!("invalid precision"), 90 | }; 91 | Self { 92 | range_min, 93 | range_max, 94 | precision, 95 | } 96 | } 97 | } 98 | 99 | #[allow(dead_code)] 100 | #[derive(Debug)] 101 | pub struct DebugMessageLogEntry { 102 | source: u32, 103 | msg_type: u32, 104 | id: u32, 105 | severity: u32, 106 | message: String, 107 | } 108 | 109 | pub enum PixelPackData<'a> { 110 | BufferOffset(u32), 111 | Slice(Option<&'a mut [u8]>), 112 | } 113 | 114 | pub enum PixelUnpackData<'a> { 115 | BufferOffset(u32), 116 | Slice(Option<&'a [u8]>), 117 | } 118 | 119 | pub enum CompressedPixelUnpackData<'a> { 120 | BufferRange(core::ops::Range), 121 | Slice(&'a [u8]), 122 | } 123 | 124 | pub struct ProgramBinary { 125 | pub buffer: Vec, 126 | pub format: u32, 127 | } 128 | 129 | /// A trait for types that can be used as a context for OpenGL, OpenGL ES, and WebGL functions. 130 | /// 131 | /// This trait is sealed and cannot be implemented outside of this crate. 132 | /// 133 | /// # Safety 134 | /// 135 | /// All GL API usage must be valid. For example, each function call should follow the rules in the 136 | /// relevant GL specification for the type of context being used. This crate doesn't enforce these 137 | /// rules, so it is up to the caller to ensure they're followed. 138 | /// 139 | /// The context implementing this trait must be current when it is dropped. This is necessary to 140 | /// ensure that certain context state can be deleted on the correct thread. Usually this is only 141 | /// a concern for desktop GL contexts that are shared between threads. 142 | pub trait HasContext: __private::Sealed { 143 | type Shader: Copy + Clone + Debug + Eq + Hash + Ord + PartialEq + PartialOrd; 144 | type Program: Copy + Clone + Debug + Eq + Hash + Ord + PartialEq + PartialOrd; 145 | type Buffer: Copy + Clone + Debug + Eq + Hash + Ord + PartialEq + PartialOrd; 146 | type VertexArray: Copy + Clone + Debug + Eq + Hash + Ord + PartialEq + PartialOrd; 147 | type Texture: Copy + Clone + Debug + Eq + Hash + Ord + PartialEq + PartialOrd; 148 | type Sampler: Copy + Clone + Debug + Eq + Hash + Ord + PartialEq + PartialOrd; 149 | type Fence: Copy + Clone + Debug + Eq + Hash + Ord + PartialEq + PartialOrd; 150 | type Framebuffer: Copy + Clone + Debug + Eq + Hash + Ord + PartialEq + PartialOrd; 151 | type Renderbuffer: Copy + Clone + Debug + Eq + Hash + Ord + PartialEq + PartialOrd; 152 | type Query: Copy + Clone + Debug + Eq + Hash + Ord + PartialEq + PartialOrd; 153 | type TransformFeedback: Copy + Clone + Debug + Eq + Hash + Ord + PartialEq + PartialOrd; 154 | type UniformLocation: Clone + Debug; 155 | 156 | fn supported_extensions(&self) -> &HashSet; 157 | 158 | fn supports_debug(&self) -> bool; 159 | 160 | fn version(&self) -> &Version; 161 | 162 | unsafe fn create_framebuffer(&self) -> Result; 163 | 164 | unsafe fn create_named_framebuffer(&self) -> Result; 165 | 166 | unsafe fn is_framebuffer(&self, framebuffer: Self::Framebuffer) -> bool; 167 | 168 | unsafe fn create_query(&self) -> Result; 169 | 170 | unsafe fn create_renderbuffer(&self) -> Result; 171 | 172 | unsafe fn is_renderbuffer(&self, renderbuffer: Self::Renderbuffer) -> bool; 173 | 174 | unsafe fn create_sampler(&self) -> Result; 175 | 176 | unsafe fn create_shader(&self, shader_type: u32) -> Result; 177 | 178 | unsafe fn is_shader(&self, shader: Self::Shader) -> bool; 179 | 180 | unsafe fn create_texture(&self) -> Result; 181 | 182 | unsafe fn create_named_texture(&self, target: u32) -> Result; 183 | 184 | unsafe fn is_texture(&self, texture: Self::Texture) -> bool; 185 | 186 | unsafe fn delete_shader(&self, shader: Self::Shader); 187 | 188 | unsafe fn shader_source(&self, shader: Self::Shader, source: &str); 189 | 190 | unsafe fn compile_shader(&self, shader: Self::Shader); 191 | 192 | unsafe fn get_shader_completion_status(&self, shader: Self::Shader) -> bool; 193 | 194 | unsafe fn get_shader_compile_status(&self, shader: Self::Shader) -> bool; 195 | 196 | unsafe fn get_shader_info_log(&self, shader: Self::Shader) -> String; 197 | 198 | unsafe fn get_shader_precision_format( 199 | &self, 200 | shader_type: u32, 201 | precision_mode: u32, 202 | ) -> Option; 203 | 204 | unsafe fn get_tex_image( 205 | &self, 206 | target: u32, 207 | level: i32, 208 | format: u32, 209 | ty: u32, 210 | pixels: PixelPackData, 211 | ); 212 | 213 | unsafe fn create_program(&self) -> Result; 214 | 215 | unsafe fn is_program(&self, program: Self::Program) -> bool; 216 | 217 | unsafe fn delete_program(&self, program: Self::Program); 218 | 219 | unsafe fn attach_shader(&self, program: Self::Program, shader: Self::Shader); 220 | 221 | unsafe fn detach_shader(&self, program: Self::Program, shader: Self::Shader); 222 | 223 | unsafe fn link_program(&self, program: Self::Program); 224 | 225 | unsafe fn validate_program(&self, program: Self::Program); 226 | 227 | unsafe fn get_program_completion_status(&self, program: Self::Program) -> bool; 228 | 229 | unsafe fn get_program_validate_status(&self, program: Self::Program) -> bool; 230 | 231 | unsafe fn get_program_link_status(&self, program: Self::Program) -> bool; 232 | 233 | unsafe fn get_program_parameter_i32(&self, program: Self::Program, parameter: u32) -> i32; 234 | 235 | unsafe fn get_program_info_log(&self, program: Self::Program) -> String; 236 | 237 | unsafe fn get_program_resource_i32( 238 | &self, 239 | program: Self::Program, 240 | interface: u32, 241 | index: u32, 242 | properties: &[u32], 243 | ) -> Vec; 244 | 245 | unsafe fn program_uniform_1_i32( 246 | &self, 247 | program: Self::Program, 248 | location: Option<&Self::UniformLocation>, 249 | x: i32, 250 | ); 251 | 252 | unsafe fn program_uniform_2_i32( 253 | &self, 254 | program: Self::Program, 255 | location: Option<&Self::UniformLocation>, 256 | x: i32, 257 | y: i32, 258 | ); 259 | 260 | unsafe fn program_uniform_3_i32( 261 | &self, 262 | program: Self::Program, 263 | location: Option<&Self::UniformLocation>, 264 | x: i32, 265 | y: i32, 266 | z: i32, 267 | ); 268 | 269 | unsafe fn program_uniform_4_i32( 270 | &self, 271 | program: Self::Program, 272 | location: Option<&Self::UniformLocation>, 273 | x: i32, 274 | y: i32, 275 | z: i32, 276 | w: i32, 277 | ); 278 | 279 | unsafe fn program_uniform_1_i32_slice( 280 | &self, 281 | program: Self::Program, 282 | location: Option<&Self::UniformLocation>, 283 | v: &[i32], 284 | ); 285 | 286 | unsafe fn program_uniform_2_i32_slice( 287 | &self, 288 | program: Self::Program, 289 | location: Option<&Self::UniformLocation>, 290 | v: &[i32], 291 | ); 292 | 293 | unsafe fn program_uniform_3_i32_slice( 294 | &self, 295 | program: Self::Program, 296 | location: Option<&Self::UniformLocation>, 297 | v: &[i32], 298 | ); 299 | 300 | unsafe fn program_uniform_4_i32_slice( 301 | &self, 302 | program: Self::Program, 303 | location: Option<&Self::UniformLocation>, 304 | v: &[i32], 305 | ); 306 | 307 | unsafe fn program_uniform_1_u32( 308 | &self, 309 | program: Self::Program, 310 | location: Option<&Self::UniformLocation>, 311 | x: u32, 312 | ); 313 | 314 | unsafe fn program_uniform_2_u32( 315 | &self, 316 | program: Self::Program, 317 | location: Option<&Self::UniformLocation>, 318 | x: u32, 319 | y: u32, 320 | ); 321 | 322 | unsafe fn program_uniform_3_u32( 323 | &self, 324 | program: Self::Program, 325 | location: Option<&Self::UniformLocation>, 326 | x: u32, 327 | y: u32, 328 | z: u32, 329 | ); 330 | 331 | unsafe fn program_uniform_4_u32( 332 | &self, 333 | program: Self::Program, 334 | location: Option<&Self::UniformLocation>, 335 | x: u32, 336 | y: u32, 337 | z: u32, 338 | w: u32, 339 | ); 340 | 341 | unsafe fn program_uniform_1_u32_slice( 342 | &self, 343 | program: Self::Program, 344 | location: Option<&Self::UniformLocation>, 345 | v: &[u32], 346 | ); 347 | 348 | unsafe fn program_uniform_2_u32_slice( 349 | &self, 350 | program: Self::Program, 351 | location: Option<&Self::UniformLocation>, 352 | v: &[u32], 353 | ); 354 | 355 | unsafe fn program_uniform_3_u32_slice( 356 | &self, 357 | program: Self::Program, 358 | location: Option<&Self::UniformLocation>, 359 | v: &[u32], 360 | ); 361 | 362 | unsafe fn program_uniform_4_u32_slice( 363 | &self, 364 | program: Self::Program, 365 | location: Option<&Self::UniformLocation>, 366 | v: &[u32], 367 | ); 368 | 369 | unsafe fn program_uniform_1_f32( 370 | &self, 371 | program: Self::Program, 372 | location: Option<&Self::UniformLocation>, 373 | x: f32, 374 | ); 375 | 376 | unsafe fn program_uniform_2_f32( 377 | &self, 378 | program: Self::Program, 379 | location: Option<&Self::UniformLocation>, 380 | x: f32, 381 | y: f32, 382 | ); 383 | 384 | unsafe fn program_uniform_3_f32( 385 | &self, 386 | program: Self::Program, 387 | location: Option<&Self::UniformLocation>, 388 | x: f32, 389 | y: f32, 390 | z: f32, 391 | ); 392 | 393 | unsafe fn program_uniform_4_f32( 394 | &self, 395 | program: Self::Program, 396 | location: Option<&Self::UniformLocation>, 397 | x: f32, 398 | y: f32, 399 | z: f32, 400 | w: f32, 401 | ); 402 | 403 | unsafe fn program_uniform_1_f32_slice( 404 | &self, 405 | program: Self::Program, 406 | location: Option<&Self::UniformLocation>, 407 | v: &[f32], 408 | ); 409 | 410 | unsafe fn program_uniform_2_f32_slice( 411 | &self, 412 | program: Self::Program, 413 | location: Option<&Self::UniformLocation>, 414 | v: &[f32], 415 | ); 416 | 417 | unsafe fn program_uniform_3_f32_slice( 418 | &self, 419 | program: Self::Program, 420 | location: Option<&Self::UniformLocation>, 421 | v: &[f32], 422 | ); 423 | 424 | unsafe fn program_uniform_4_f32_slice( 425 | &self, 426 | program: Self::Program, 427 | location: Option<&Self::UniformLocation>, 428 | v: &[f32], 429 | ); 430 | 431 | unsafe fn program_uniform_matrix_2_f32_slice( 432 | &self, 433 | program: Self::Program, 434 | location: Option<&Self::UniformLocation>, 435 | transpose: bool, 436 | v: &[f32], 437 | ); 438 | 439 | unsafe fn program_uniform_matrix_2x3_f32_slice( 440 | &self, 441 | program: Self::Program, 442 | location: Option<&Self::UniformLocation>, 443 | transpose: bool, 444 | v: &[f32], 445 | ); 446 | 447 | unsafe fn program_uniform_matrix_2x4_f32_slice( 448 | &self, 449 | program: Self::Program, 450 | location: Option<&Self::UniformLocation>, 451 | transpose: bool, 452 | v: &[f32], 453 | ); 454 | 455 | unsafe fn program_uniform_matrix_3x2_f32_slice( 456 | &self, 457 | program: Self::Program, 458 | location: Option<&Self::UniformLocation>, 459 | transpose: bool, 460 | v: &[f32], 461 | ); 462 | 463 | unsafe fn program_uniform_matrix_3_f32_slice( 464 | &self, 465 | program: Self::Program, 466 | location: Option<&Self::UniformLocation>, 467 | transpose: bool, 468 | v: &[f32], 469 | ); 470 | 471 | unsafe fn program_uniform_matrix_3x4_f32_slice( 472 | &self, 473 | program: Self::Program, 474 | location: Option<&Self::UniformLocation>, 475 | transpose: bool, 476 | v: &[f32], 477 | ); 478 | 479 | unsafe fn program_uniform_matrix_4x2_f32_slice( 480 | &self, 481 | program: Self::Program, 482 | location: Option<&Self::UniformLocation>, 483 | transpose: bool, 484 | v: &[f32], 485 | ); 486 | 487 | unsafe fn program_uniform_matrix_4x3_f32_slice( 488 | &self, 489 | program: Self::Program, 490 | location: Option<&Self::UniformLocation>, 491 | transpose: bool, 492 | v: &[f32], 493 | ); 494 | 495 | unsafe fn program_uniform_matrix_4_f32_slice( 496 | &self, 497 | program: Self::Program, 498 | location: Option<&Self::UniformLocation>, 499 | transpose: bool, 500 | v: &[f32], 501 | ); 502 | 503 | unsafe fn program_binary_retrievable_hint(&self, program: Self::Program, value: bool); 504 | 505 | unsafe fn get_program_binary(&self, program: Self::Program) -> Option; 506 | 507 | unsafe fn program_binary(&self, program: Self::Program, binary: &ProgramBinary); 508 | 509 | unsafe fn get_active_uniforms(&self, program: Self::Program) -> u32; 510 | 511 | #[doc(alias = "GetActiveUniformsiv")] 512 | unsafe fn get_active_uniforms_parameter( 513 | &self, 514 | program: Self::Program, 515 | uniforms: &[u32], 516 | pname: u32, 517 | ) -> Vec; 518 | 519 | unsafe fn get_active_uniform( 520 | &self, 521 | program: Self::Program, 522 | index: u32, 523 | ) -> Option; 524 | 525 | unsafe fn use_program(&self, program: Option); 526 | 527 | unsafe fn create_buffer(&self) -> Result; 528 | 529 | unsafe fn create_named_buffer(&self) -> Result; 530 | 531 | unsafe fn is_buffer(&self, buffer: Self::Buffer) -> bool; 532 | 533 | unsafe fn bind_buffer(&self, target: u32, buffer: Option); 534 | 535 | unsafe fn bind_buffer_base(&self, target: u32, index: u32, buffer: Option); 536 | 537 | unsafe fn bind_buffer_range( 538 | &self, 539 | target: u32, 540 | index: u32, 541 | buffer: Option, 542 | offset: i32, 543 | size: i32, 544 | ); 545 | 546 | unsafe fn bind_vertex_buffer( 547 | &self, 548 | binding_index: u32, 549 | buffer: Option, 550 | offset: i32, 551 | stride: i32, 552 | ); 553 | 554 | unsafe fn bind_framebuffer(&self, target: u32, framebuffer: Option); 555 | 556 | unsafe fn bind_renderbuffer(&self, target: u32, renderbuffer: Option); 557 | 558 | unsafe fn blit_framebuffer( 559 | &self, 560 | src_x0: i32, 561 | src_y0: i32, 562 | src_x1: i32, 563 | src_y1: i32, 564 | dst_x0: i32, 565 | dst_y0: i32, 566 | dst_x1: i32, 567 | dst_y1: i32, 568 | mask: u32, 569 | filter: u32, 570 | ); 571 | 572 | unsafe fn blit_named_framebuffer( 573 | &self, 574 | read_buffer: Option, 575 | draw_buffer: Option, 576 | src_x0: i32, 577 | src_y0: i32, 578 | src_x1: i32, 579 | src_y1: i32, 580 | dst_x0: i32, 581 | dst_y0: i32, 582 | dst_x1: i32, 583 | dst_y1: i32, 584 | mask: u32, 585 | filter: u32, 586 | ); 587 | 588 | unsafe fn create_vertex_array(&self) -> Result; 589 | 590 | unsafe fn create_named_vertex_array(&self) -> Result; 591 | 592 | unsafe fn delete_vertex_array(&self, vertex_array: Self::VertexArray); 593 | 594 | unsafe fn bind_vertex_array(&self, vertex_array: Option); 595 | 596 | unsafe fn clear_color(&self, red: f32, green: f32, blue: f32, alpha: f32); 597 | 598 | unsafe fn supports_f64_precision(&self) -> bool; 599 | 600 | unsafe fn clear_depth_f64(&self, depth: f64); 601 | 602 | unsafe fn clear_depth_f32(&self, depth: f32); 603 | 604 | unsafe fn clear_depth(&self, depth: f64); 605 | 606 | unsafe fn clear_stencil(&self, stencil: i32); 607 | 608 | unsafe fn clear(&self, mask: u32); 609 | 610 | unsafe fn patch_parameter_i32(&self, parameter: u32, value: i32); 611 | 612 | unsafe fn pixel_store_i32(&self, parameter: u32, value: i32); 613 | 614 | unsafe fn pixel_store_bool(&self, parameter: u32, value: bool); 615 | 616 | unsafe fn get_frag_data_location(&self, program: Self::Program, name: &str) -> i32; 617 | 618 | unsafe fn bind_frag_data_location(&self, program: Self::Program, color_number: u32, name: &str); 619 | 620 | unsafe fn buffer_data_size(&self, target: u32, size: i32, usage: u32); 621 | 622 | unsafe fn named_buffer_data_size(&self, buffer: Self::Buffer, size: i32, usage: u32); 623 | 624 | unsafe fn buffer_data_u8_slice(&self, target: u32, data: &[u8], usage: u32); 625 | 626 | unsafe fn named_buffer_data_u8_slice(&self, buffer: Self::Buffer, data: &[u8], usage: u32); 627 | 628 | unsafe fn buffer_sub_data_u8_slice(&self, target: u32, offset: i32, src_data: &[u8]); 629 | 630 | unsafe fn named_buffer_sub_data_u8_slice( 631 | &self, 632 | buffer: Self::Buffer, 633 | offset: i32, 634 | src_data: &[u8], 635 | ); 636 | 637 | unsafe fn get_buffer_sub_data(&self, target: u32, offset: i32, dst_data: &mut [u8]); 638 | 639 | unsafe fn buffer_storage(&self, target: u32, size: i32, data: Option<&[u8]>, flags: u32); 640 | 641 | unsafe fn named_buffer_storage( 642 | &self, 643 | target: Self::Buffer, 644 | size: i32, 645 | data: Option<&[u8]>, 646 | flags: u32, 647 | ); 648 | 649 | unsafe fn check_framebuffer_status(&self, target: u32) -> u32; 650 | 651 | unsafe fn check_named_framebuffer_status( 652 | &self, 653 | framebuffer: Option, 654 | target: u32, 655 | ) -> u32; 656 | 657 | unsafe fn clear_buffer_i32_slice(&self, target: u32, draw_buffer: u32, values: &[i32]); 658 | 659 | unsafe fn clear_buffer_u32_slice(&self, target: u32, draw_buffer: u32, values: &[u32]); 660 | 661 | unsafe fn clear_buffer_f32_slice(&self, target: u32, draw_buffer: u32, values: &[f32]); 662 | 663 | unsafe fn clear_buffer_depth_stencil( 664 | &self, 665 | target: u32, 666 | draw_buffer: u32, 667 | depth: f32, 668 | stencil: i32, 669 | ); 670 | 671 | unsafe fn clear_named_framebuffer_i32_slice( 672 | &self, 673 | framebuffer: Option, 674 | target: u32, 675 | draw_buffer: u32, 676 | values: &[i32], 677 | ); 678 | 679 | unsafe fn clear_named_framebuffer_u32_slice( 680 | &self, 681 | framebuffer: Option, 682 | target: u32, 683 | draw_buffer: u32, 684 | values: &[u32], 685 | ); 686 | 687 | unsafe fn clear_named_framebuffer_f32_slice( 688 | &self, 689 | framebuffer: Option, 690 | target: u32, 691 | draw_buffer: u32, 692 | values: &[f32], 693 | ); 694 | 695 | unsafe fn clear_named_framebuffer_depth_stencil( 696 | &self, 697 | framebuffer: Option, 698 | target: u32, 699 | draw_buffer: u32, 700 | depth: f32, 701 | stencil: i32, 702 | ); 703 | 704 | unsafe fn client_wait_sync(&self, fence: Self::Fence, flags: u32, timeout: i32) -> u32; 705 | 706 | unsafe fn get_sync_parameter_i32(&self, fence: Self::Fence, parameter: u32) -> i32; 707 | 708 | unsafe fn wait_sync(&self, fence: Self::Fence, flags: u32, timeout: u64); 709 | 710 | unsafe fn copy_buffer_sub_data( 711 | &self, 712 | src_target: u32, 713 | dst_target: u32, 714 | src_offset: i32, 715 | dst_offset: i32, 716 | size: i32, 717 | ); 718 | 719 | unsafe fn copy_image_sub_data( 720 | &self, 721 | src_name: Self::Texture, 722 | src_target: u32, 723 | src_level: i32, 724 | src_x: i32, 725 | src_y: i32, 726 | src_z: i32, 727 | dst_name: Self::Texture, 728 | dst_target: u32, 729 | dst_level: i32, 730 | dst_x: i32, 731 | dst_y: i32, 732 | dst_z: i32, 733 | src_width: i32, 734 | src_height: i32, 735 | src_depth: i32, 736 | ); 737 | 738 | unsafe fn copy_tex_image_2d( 739 | &self, 740 | target: u32, 741 | level: i32, 742 | internal_format: u32, 743 | x: i32, 744 | y: i32, 745 | width: i32, 746 | height: i32, 747 | border: i32, 748 | ); 749 | 750 | unsafe fn copy_tex_sub_image_2d( 751 | &self, 752 | target: u32, 753 | level: i32, 754 | x_offset: i32, 755 | y_offset: i32, 756 | x: i32, 757 | y: i32, 758 | width: i32, 759 | height: i32, 760 | ); 761 | 762 | unsafe fn copy_tex_sub_image_3d( 763 | &self, 764 | target: u32, 765 | level: i32, 766 | x_offset: i32, 767 | y_offset: i32, 768 | z_offset: i32, 769 | x: i32, 770 | y: i32, 771 | width: i32, 772 | height: i32, 773 | ); 774 | 775 | unsafe fn delete_buffer(&self, buffer: Self::Buffer); 776 | 777 | unsafe fn delete_framebuffer(&self, framebuffer: Self::Framebuffer); 778 | 779 | unsafe fn delete_query(&self, query: Self::Query); 780 | 781 | unsafe fn delete_renderbuffer(&self, renderbuffer: Self::Renderbuffer); 782 | 783 | unsafe fn delete_sampler(&self, texture: Self::Sampler); 784 | 785 | unsafe fn delete_sync(&self, fence: Self::Fence); 786 | 787 | unsafe fn delete_texture(&self, texture: Self::Texture); 788 | 789 | unsafe fn disable(&self, parameter: u32); 790 | 791 | unsafe fn disable_draw_buffer(&self, parameter: u32, draw_buffer: u32); 792 | 793 | unsafe fn disable_vertex_attrib_array(&self, index: u32); 794 | 795 | unsafe fn dispatch_compute(&self, groups_x: u32, groups_y: u32, groups_z: u32); 796 | 797 | unsafe fn dispatch_compute_indirect(&self, offset: i32); 798 | 799 | unsafe fn draw_arrays(&self, mode: u32, first: i32, count: i32); 800 | 801 | unsafe fn draw_arrays_instanced(&self, mode: u32, first: i32, count: i32, instance_count: i32); 802 | 803 | unsafe fn draw_arrays_instanced_base_instance( 804 | &self, 805 | mode: u32, 806 | first: i32, 807 | count: i32, 808 | instance_count: i32, 809 | base_instance: u32, 810 | ); 811 | 812 | unsafe fn draw_arrays_indirect_offset(&self, mode: u32, offset: i32); 813 | 814 | unsafe fn draw_buffer(&self, buffer: u32); 815 | 816 | unsafe fn named_framebuffer_draw_buffer( 817 | &self, 818 | framebuffer: Option, 819 | draw_buffer: u32, 820 | ); 821 | 822 | unsafe fn named_framebuffer_draw_buffers( 823 | &self, 824 | framebuffer: Option, 825 | buffers: &[u32], 826 | ); 827 | 828 | unsafe fn draw_buffers(&self, buffers: &[u32]); 829 | 830 | unsafe fn draw_elements(&self, mode: u32, count: i32, element_type: u32, offset: i32); 831 | 832 | unsafe fn draw_elements_base_vertex( 833 | &self, 834 | mode: u32, 835 | count: i32, 836 | element_type: u32, 837 | offset: i32, 838 | base_vertex: i32, 839 | ); 840 | 841 | unsafe fn draw_elements_instanced( 842 | &self, 843 | mode: u32, 844 | count: i32, 845 | element_type: u32, 846 | offset: i32, 847 | instance_count: i32, 848 | ); 849 | 850 | unsafe fn draw_elements_instanced_base_vertex( 851 | &self, 852 | mode: u32, 853 | count: i32, 854 | element_type: u32, 855 | offset: i32, 856 | instance_count: i32, 857 | base_vertex: i32, 858 | ); 859 | 860 | unsafe fn draw_elements_instanced_base_vertex_base_instance( 861 | &self, 862 | mode: u32, 863 | count: i32, 864 | element_type: u32, 865 | offset: i32, 866 | instance_count: i32, 867 | base_vertex: i32, 868 | base_instance: u32, 869 | ); 870 | 871 | unsafe fn draw_elements_indirect_offset(&self, mode: u32, element_type: u32, offset: i32); 872 | 873 | unsafe fn enable(&self, parameter: u32); 874 | 875 | unsafe fn is_enabled(&self, parameter: u32) -> bool; 876 | 877 | unsafe fn enable_draw_buffer(&self, parameter: u32, draw_buffer: u32); 878 | 879 | unsafe fn enable_vertex_array_attrib(&self, vao: Self::VertexArray, index: u32); 880 | 881 | unsafe fn enable_vertex_attrib_array(&self, index: u32); 882 | 883 | unsafe fn flush(&self); 884 | 885 | unsafe fn framebuffer_renderbuffer( 886 | &self, 887 | target: u32, 888 | attachment: u32, 889 | renderbuffer_target: u32, 890 | renderbuffer: Option, 891 | ); 892 | 893 | unsafe fn framebuffer_texture( 894 | &self, 895 | target: u32, 896 | attachment: u32, 897 | texture: Option, 898 | level: i32, 899 | ); 900 | 901 | unsafe fn framebuffer_texture_2d( 902 | &self, 903 | target: u32, 904 | attachment: u32, 905 | texture_target: u32, 906 | texture: Option, 907 | level: i32, 908 | ); 909 | 910 | unsafe fn framebuffer_texture_3d( 911 | &self, 912 | target: u32, 913 | attachment: u32, 914 | texture_target: u32, 915 | texture: Option, 916 | level: i32, 917 | layer: i32, 918 | ); 919 | 920 | unsafe fn framebuffer_texture_layer( 921 | &self, 922 | target: u32, 923 | attachment: u32, 924 | texture: Option, 925 | level: i32, 926 | layer: i32, 927 | ); 928 | 929 | unsafe fn named_framebuffer_renderbuffer( 930 | &self, 931 | framebuffer: Option, 932 | attachment: u32, 933 | renderbuffer_target: u32, 934 | renderbuffer: Option, 935 | ); 936 | 937 | unsafe fn named_framebuffer_texture( 938 | &self, 939 | framebuffer: Option, 940 | attachment: u32, 941 | texture: Option, 942 | level: i32, 943 | ); 944 | 945 | unsafe fn named_framebuffer_texture_layer( 946 | &self, 947 | framebuffer: Option, 948 | attachment: u32, 949 | texture: Option, 950 | level: i32, 951 | layer: i32, 952 | ); 953 | 954 | unsafe fn front_face(&self, value: u32); 955 | 956 | unsafe fn get_error(&self) -> u32; 957 | 958 | unsafe fn get_tex_parameter_i32(&self, target: u32, parameter: u32) -> i32; 959 | 960 | unsafe fn get_tex_parameter_f32(&self, target: u32, parameter: u32) -> f32; 961 | 962 | unsafe fn get_buffer_parameter_i32(&self, target: u32, parameter: u32) -> i32; 963 | 964 | #[doc(alias = "glGetBooleanv")] 965 | unsafe fn get_parameter_bool(&self, parameter: u32) -> bool; 966 | 967 | #[doc(alias = "glGetBooleanv")] 968 | unsafe fn get_parameter_bool_array(&self, parameter: u32) -> [bool; N]; 969 | 970 | #[doc(alias = "glGetIntegerv")] 971 | unsafe fn get_parameter_i32(&self, parameter: u32) -> i32; 972 | 973 | #[doc(alias = "glGetIntegerv")] 974 | unsafe fn get_parameter_i32_slice(&self, parameter: u32, out: &mut [i32]); 975 | 976 | #[doc(alias = "glGetInteger64v")] 977 | unsafe fn get_parameter_i64(&self, parameter: u32) -> i64; 978 | 979 | #[doc(alias = "glGetInteger64v")] 980 | unsafe fn get_parameter_i64_slice(&self, parameter: u32, out: &mut [i64]); 981 | 982 | #[doc(alias = "glGetInteger64i_v")] 983 | unsafe fn get_parameter_indexed_i64(&self, parameter: u32, index: u32) -> i64; 984 | 985 | #[doc(alias = "glGetFloatv")] 986 | unsafe fn get_parameter_f32(&self, parameter: u32) -> f32; 987 | 988 | #[doc(alias = "glGetFloatv")] 989 | unsafe fn get_parameter_f32_slice(&self, parameter: u32, out: &mut [f32]); 990 | 991 | #[doc(alias = "glGetIntegeri_v")] 992 | unsafe fn get_parameter_indexed_i32(&self, parameter: u32, index: u32) -> i32; 993 | 994 | #[doc(alias = "glGetStringi")] 995 | unsafe fn get_parameter_indexed_string(&self, parameter: u32, index: u32) -> String; 996 | 997 | #[doc(alias = "glGetString")] 998 | unsafe fn get_parameter_string(&self, parameter: u32) -> String; 999 | 1000 | unsafe fn get_parameter_buffer(&self, parameter: u32) -> Option; 1001 | 1002 | unsafe fn get_parameter_framebuffer(&self, parameter: u32) -> Option; 1003 | 1004 | unsafe fn get_parameter_program(&self, parameter: u32) -> Option; 1005 | 1006 | unsafe fn get_parameter_renderbuffer(&self, parameter: u32) -> Option; 1007 | 1008 | unsafe fn get_parameter_sampler(&self, parameter: u32) -> Option; 1009 | 1010 | unsafe fn get_parameter_texture(&self, parameter: u32) -> Option; 1011 | 1012 | unsafe fn get_parameter_transform_feedback( 1013 | &self, 1014 | parameter: u32, 1015 | ) -> Option; 1016 | 1017 | unsafe fn get_parameter_vertex_array(&self, parameter: u32) -> Option; 1018 | 1019 | unsafe fn get_renderbuffer_parameter_i32(&self, target: u32, parameter: u32) -> i32; 1020 | 1021 | unsafe fn get_framebuffer_parameter_i32(&self, target: u32, parameter: u32) -> i32; 1022 | 1023 | unsafe fn get_named_framebuffer_parameter_i32( 1024 | &self, 1025 | framebuffer: Option, 1026 | parameter: u32, 1027 | ) -> i32; 1028 | 1029 | unsafe fn get_framebuffer_attachment_parameter_i32( 1030 | &self, 1031 | target: u32, 1032 | attachment: u32, 1033 | parameter: u32, 1034 | ) -> i32; 1035 | 1036 | unsafe fn get_named_framebuffer_attachment_parameter_i32( 1037 | &self, 1038 | framebuffer: Option, 1039 | attachment: u32, 1040 | parameter: u32, 1041 | ) -> i32; 1042 | 1043 | unsafe fn get_active_uniform_block_parameter_i32( 1044 | &self, 1045 | program: Self::Program, 1046 | uniform_block_index: u32, 1047 | parameter: u32, 1048 | ) -> i32; 1049 | 1050 | unsafe fn get_active_uniform_block_parameter_i32_slice( 1051 | &self, 1052 | program: Self::Program, 1053 | uniform_block_index: u32, 1054 | parameter: u32, 1055 | out: &mut [i32], 1056 | ); 1057 | 1058 | unsafe fn get_active_uniform_block_name( 1059 | &self, 1060 | program: Self::Program, 1061 | uniform_block_index: u32, 1062 | ) -> String; 1063 | 1064 | unsafe fn get_uniform_location( 1065 | &self, 1066 | program: Self::Program, 1067 | name: &str, 1068 | ) -> Option; 1069 | 1070 | unsafe fn get_attrib_location(&self, program: Self::Program, name: &str) -> Option; 1071 | 1072 | unsafe fn bind_attrib_location(&self, program: Self::Program, index: u32, name: &str); 1073 | 1074 | unsafe fn get_active_attributes(&self, program: Self::Program) -> u32; 1075 | 1076 | unsafe fn get_active_attribute( 1077 | &self, 1078 | program: Self::Program, 1079 | index: u32, 1080 | ) -> Option; 1081 | 1082 | unsafe fn get_sync_status(&self, fence: Self::Fence) -> u32; 1083 | 1084 | unsafe fn is_sync(&self, fence: Self::Fence) -> bool; 1085 | 1086 | unsafe fn renderbuffer_storage( 1087 | &self, 1088 | target: u32, 1089 | internal_format: u32, 1090 | width: i32, 1091 | height: i32, 1092 | ); 1093 | 1094 | unsafe fn renderbuffer_storage_multisample( 1095 | &self, 1096 | target: u32, 1097 | samples: i32, 1098 | internal_format: u32, 1099 | width: i32, 1100 | height: i32, 1101 | ); 1102 | 1103 | unsafe fn sampler_parameter_f32(&self, sampler: Self::Sampler, name: u32, value: f32); 1104 | 1105 | unsafe fn sampler_parameter_f32_slice(&self, sampler: Self::Sampler, name: u32, value: &[f32]); 1106 | 1107 | unsafe fn sampler_parameter_i32(&self, sampler: Self::Sampler, name: u32, value: i32); 1108 | 1109 | unsafe fn get_sampler_parameter_i32(&self, sampler: Self::Sampler, name: u32) -> i32; 1110 | 1111 | unsafe fn get_sampler_parameter_f32(&self, sampler: Self::Sampler, name: u32) -> f32; 1112 | 1113 | unsafe fn generate_mipmap(&self, target: u32); 1114 | 1115 | unsafe fn generate_texture_mipmap(&self, texture: Self::Texture); 1116 | 1117 | unsafe fn tex_image_1d( 1118 | &self, 1119 | target: u32, 1120 | level: i32, 1121 | internal_format: i32, 1122 | width: i32, 1123 | border: i32, 1124 | format: u32, 1125 | ty: u32, 1126 | pixels: PixelUnpackData, 1127 | ); 1128 | 1129 | unsafe fn compressed_tex_image_1d( 1130 | &self, 1131 | target: u32, 1132 | level: i32, 1133 | internal_format: i32, 1134 | width: i32, 1135 | border: i32, 1136 | image_size: i32, 1137 | pixels: &[u8], 1138 | ); 1139 | 1140 | unsafe fn tex_image_2d( 1141 | &self, 1142 | target: u32, 1143 | level: i32, 1144 | internal_format: i32, 1145 | width: i32, 1146 | height: i32, 1147 | border: i32, 1148 | format: u32, 1149 | ty: u32, 1150 | pixels: PixelUnpackData, 1151 | ); 1152 | 1153 | unsafe fn tex_image_2d_multisample( 1154 | &self, 1155 | target: u32, 1156 | samples: i32, 1157 | internal_format: i32, 1158 | width: i32, 1159 | height: i32, 1160 | fixed_sample_locations: bool, 1161 | ); 1162 | 1163 | unsafe fn compressed_tex_image_2d( 1164 | &self, 1165 | target: u32, 1166 | level: i32, 1167 | internal_format: i32, 1168 | width: i32, 1169 | height: i32, 1170 | border: i32, 1171 | image_size: i32, 1172 | pixels: &[u8], 1173 | ); 1174 | 1175 | unsafe fn tex_image_3d( 1176 | &self, 1177 | target: u32, 1178 | level: i32, 1179 | internal_format: i32, 1180 | width: i32, 1181 | height: i32, 1182 | depth: i32, 1183 | border: i32, 1184 | format: u32, 1185 | ty: u32, 1186 | pixels: PixelUnpackData, 1187 | ); 1188 | 1189 | unsafe fn compressed_tex_image_3d( 1190 | &self, 1191 | target: u32, 1192 | level: i32, 1193 | internal_format: i32, 1194 | width: i32, 1195 | height: i32, 1196 | depth: i32, 1197 | border: i32, 1198 | image_size: i32, 1199 | pixels: &[u8], 1200 | ); 1201 | 1202 | unsafe fn tex_storage_1d(&self, target: u32, levels: i32, internal_format: u32, width: i32); 1203 | 1204 | unsafe fn tex_storage_2d( 1205 | &self, 1206 | target: u32, 1207 | levels: i32, 1208 | internal_format: u32, 1209 | width: i32, 1210 | height: i32, 1211 | ); 1212 | 1213 | unsafe fn texture_storage_2d( 1214 | &self, 1215 | texture: Self::Texture, 1216 | levels: i32, 1217 | internal_format: u32, 1218 | width: i32, 1219 | height: i32, 1220 | ); 1221 | 1222 | unsafe fn tex_storage_2d_multisample( 1223 | &self, 1224 | target: u32, 1225 | samples: i32, 1226 | internal_format: u32, 1227 | width: i32, 1228 | height: i32, 1229 | fixed_sample_locations: bool, 1230 | ); 1231 | 1232 | unsafe fn tex_storage_3d( 1233 | &self, 1234 | target: u32, 1235 | levels: i32, 1236 | internal_format: u32, 1237 | width: i32, 1238 | height: i32, 1239 | depth: i32, 1240 | ); 1241 | 1242 | unsafe fn texture_storage_3d( 1243 | &self, 1244 | texture: Self::Texture, 1245 | levels: i32, 1246 | internal_format: u32, 1247 | width: i32, 1248 | height: i32, 1249 | depth: i32, 1250 | ); 1251 | 1252 | unsafe fn get_uniform_i32( 1253 | &self, 1254 | program: Self::Program, 1255 | location: &Self::UniformLocation, 1256 | v: &mut [i32], 1257 | ); 1258 | 1259 | unsafe fn get_uniform_u32( 1260 | &self, 1261 | program: Self::Program, 1262 | location: &Self::UniformLocation, 1263 | v: &mut [u32], 1264 | ); 1265 | 1266 | unsafe fn get_uniform_f32( 1267 | &self, 1268 | program: Self::Program, 1269 | location: &Self::UniformLocation, 1270 | v: &mut [f32], 1271 | ); 1272 | 1273 | unsafe fn uniform_1_i32(&self, location: Option<&Self::UniformLocation>, x: i32); 1274 | 1275 | unsafe fn uniform_2_i32(&self, location: Option<&Self::UniformLocation>, x: i32, y: i32); 1276 | 1277 | unsafe fn uniform_3_i32( 1278 | &self, 1279 | location: Option<&Self::UniformLocation>, 1280 | x: i32, 1281 | y: i32, 1282 | z: i32, 1283 | ); 1284 | 1285 | unsafe fn uniform_4_i32( 1286 | &self, 1287 | location: Option<&Self::UniformLocation>, 1288 | x: i32, 1289 | y: i32, 1290 | z: i32, 1291 | w: i32, 1292 | ); 1293 | 1294 | unsafe fn uniform_1_i32_slice(&self, location: Option<&Self::UniformLocation>, v: &[i32]); 1295 | 1296 | unsafe fn uniform_2_i32_slice(&self, location: Option<&Self::UniformLocation>, v: &[i32]); 1297 | 1298 | unsafe fn uniform_3_i32_slice(&self, location: Option<&Self::UniformLocation>, v: &[i32]); 1299 | 1300 | unsafe fn uniform_4_i32_slice(&self, location: Option<&Self::UniformLocation>, v: &[i32]); 1301 | 1302 | unsafe fn uniform_1_u32(&self, location: Option<&Self::UniformLocation>, x: u32); 1303 | 1304 | unsafe fn uniform_2_u32(&self, location: Option<&Self::UniformLocation>, x: u32, y: u32); 1305 | 1306 | unsafe fn uniform_3_u32( 1307 | &self, 1308 | location: Option<&Self::UniformLocation>, 1309 | x: u32, 1310 | y: u32, 1311 | z: u32, 1312 | ); 1313 | 1314 | unsafe fn uniform_4_u32( 1315 | &self, 1316 | location: Option<&Self::UniformLocation>, 1317 | x: u32, 1318 | y: u32, 1319 | z: u32, 1320 | w: u32, 1321 | ); 1322 | 1323 | unsafe fn uniform_1_u32_slice(&self, location: Option<&Self::UniformLocation>, v: &[u32]); 1324 | 1325 | unsafe fn uniform_2_u32_slice(&self, location: Option<&Self::UniformLocation>, v: &[u32]); 1326 | 1327 | unsafe fn uniform_3_u32_slice(&self, location: Option<&Self::UniformLocation>, v: &[u32]); 1328 | 1329 | unsafe fn uniform_4_u32_slice(&self, location: Option<&Self::UniformLocation>, v: &[u32]); 1330 | 1331 | unsafe fn uniform_1_f32(&self, location: Option<&Self::UniformLocation>, x: f32); 1332 | 1333 | unsafe fn uniform_2_f32(&self, location: Option<&Self::UniformLocation>, x: f32, y: f32); 1334 | 1335 | unsafe fn uniform_3_f32( 1336 | &self, 1337 | location: Option<&Self::UniformLocation>, 1338 | x: f32, 1339 | y: f32, 1340 | z: f32, 1341 | ); 1342 | 1343 | unsafe fn uniform_4_f32( 1344 | &self, 1345 | location: Option<&Self::UniformLocation>, 1346 | x: f32, 1347 | y: f32, 1348 | z: f32, 1349 | w: f32, 1350 | ); 1351 | 1352 | unsafe fn uniform_1_f32_slice(&self, location: Option<&Self::UniformLocation>, v: &[f32]); 1353 | 1354 | unsafe fn uniform_2_f32_slice(&self, location: Option<&Self::UniformLocation>, v: &[f32]); 1355 | 1356 | unsafe fn uniform_3_f32_slice(&self, location: Option<&Self::UniformLocation>, v: &[f32]); 1357 | 1358 | unsafe fn uniform_4_f32_slice(&self, location: Option<&Self::UniformLocation>, v: &[f32]); 1359 | 1360 | unsafe fn uniform_matrix_2_f32_slice( 1361 | &self, 1362 | location: Option<&Self::UniformLocation>, 1363 | transpose: bool, 1364 | v: &[f32], 1365 | ); 1366 | 1367 | unsafe fn uniform_matrix_2x3_f32_slice( 1368 | &self, 1369 | location: Option<&Self::UniformLocation>, 1370 | transpose: bool, 1371 | v: &[f32], 1372 | ); 1373 | 1374 | unsafe fn uniform_matrix_2x4_f32_slice( 1375 | &self, 1376 | location: Option<&Self::UniformLocation>, 1377 | transpose: bool, 1378 | v: &[f32], 1379 | ); 1380 | 1381 | unsafe fn uniform_matrix_3x2_f32_slice( 1382 | &self, 1383 | location: Option<&Self::UniformLocation>, 1384 | transpose: bool, 1385 | v: &[f32], 1386 | ); 1387 | 1388 | unsafe fn uniform_matrix_3_f32_slice( 1389 | &self, 1390 | location: Option<&Self::UniformLocation>, 1391 | transpose: bool, 1392 | v: &[f32], 1393 | ); 1394 | 1395 | unsafe fn uniform_matrix_3x4_f32_slice( 1396 | &self, 1397 | location: Option<&Self::UniformLocation>, 1398 | transpose: bool, 1399 | v: &[f32], 1400 | ); 1401 | 1402 | unsafe fn uniform_matrix_4x2_f32_slice( 1403 | &self, 1404 | location: Option<&Self::UniformLocation>, 1405 | transpose: bool, 1406 | v: &[f32], 1407 | ); 1408 | 1409 | unsafe fn uniform_matrix_4x3_f32_slice( 1410 | &self, 1411 | location: Option<&Self::UniformLocation>, 1412 | transpose: bool, 1413 | v: &[f32], 1414 | ); 1415 | 1416 | unsafe fn uniform_matrix_4_f32_slice( 1417 | &self, 1418 | location: Option<&Self::UniformLocation>, 1419 | transpose: bool, 1420 | v: &[f32], 1421 | ); 1422 | 1423 | unsafe fn unmap_buffer(&self, target: u32); 1424 | 1425 | unsafe fn cull_face(&self, value: u32); 1426 | 1427 | unsafe fn color_mask(&self, red: bool, green: bool, blue: bool, alpha: bool); 1428 | 1429 | unsafe fn color_mask_draw_buffer( 1430 | &self, 1431 | buffer: u32, 1432 | red: bool, 1433 | green: bool, 1434 | blue: bool, 1435 | alpha: bool, 1436 | ); 1437 | 1438 | unsafe fn depth_mask(&self, value: bool); 1439 | 1440 | unsafe fn blend_color(&self, red: f32, green: f32, blue: f32, alpha: f32); 1441 | 1442 | unsafe fn line_width(&self, width: f32); 1443 | 1444 | unsafe fn map_buffer_range( 1445 | &self, 1446 | target: u32, 1447 | offset: i32, 1448 | length: i32, 1449 | access: u32, 1450 | ) -> *mut u8; 1451 | 1452 | unsafe fn flush_mapped_buffer_range(&self, target: u32, offset: i32, length: i32); 1453 | 1454 | unsafe fn invalidate_buffer_sub_data(&self, target: u32, offset: i32, length: i32); 1455 | 1456 | unsafe fn invalidate_framebuffer(&self, target: u32, attachments: &[u32]); 1457 | 1458 | unsafe fn invalidate_sub_framebuffer( 1459 | &self, 1460 | target: u32, 1461 | attachments: &[u32], 1462 | x: i32, 1463 | y: i32, 1464 | width: i32, 1465 | height: i32, 1466 | ); 1467 | 1468 | unsafe fn polygon_offset(&self, factor: f32, units: f32); 1469 | 1470 | unsafe fn polygon_mode(&self, face: u32, mode: u32); 1471 | 1472 | unsafe fn finish(&self); 1473 | 1474 | unsafe fn bind_texture(&self, target: u32, texture: Option); 1475 | 1476 | unsafe fn bind_texture_unit(&self, unit: u32, texture: Option); 1477 | 1478 | unsafe fn bind_sampler(&self, unit: u32, sampler: Option); 1479 | 1480 | unsafe fn active_texture(&self, unit: u32); 1481 | 1482 | unsafe fn fence_sync(&self, condition: u32, flags: u32) -> Result; 1483 | 1484 | unsafe fn tex_parameter_f32(&self, target: u32, parameter: u32, value: f32); 1485 | 1486 | unsafe fn tex_parameter_i32(&self, target: u32, parameter: u32, value: i32); 1487 | 1488 | unsafe fn texture_parameter_i32(&self, texture: Self::Texture, parameter: u32, value: i32); 1489 | 1490 | unsafe fn tex_parameter_f32_slice(&self, target: u32, parameter: u32, values: &[f32]); 1491 | 1492 | unsafe fn tex_parameter_i32_slice(&self, target: u32, parameter: u32, values: &[i32]); 1493 | 1494 | unsafe fn tex_sub_image_2d( 1495 | &self, 1496 | target: u32, 1497 | level: i32, 1498 | x_offset: i32, 1499 | y_offset: i32, 1500 | width: i32, 1501 | height: i32, 1502 | format: u32, 1503 | ty: u32, 1504 | pixels: PixelUnpackData, 1505 | ); 1506 | 1507 | unsafe fn texture_sub_image_2d( 1508 | &self, 1509 | texture: Self::Texture, 1510 | level: i32, 1511 | x_offset: i32, 1512 | y_offset: i32, 1513 | width: i32, 1514 | height: i32, 1515 | format: u32, 1516 | ty: u32, 1517 | pixels: PixelUnpackData, 1518 | ); 1519 | 1520 | unsafe fn compressed_tex_sub_image_2d( 1521 | &self, 1522 | target: u32, 1523 | level: i32, 1524 | x_offset: i32, 1525 | y_offset: i32, 1526 | width: i32, 1527 | height: i32, 1528 | format: u32, 1529 | pixels: CompressedPixelUnpackData, 1530 | ); 1531 | 1532 | unsafe fn tex_sub_image_3d( 1533 | &self, 1534 | target: u32, 1535 | level: i32, 1536 | x_offset: i32, 1537 | y_offset: i32, 1538 | z_offset: i32, 1539 | width: i32, 1540 | height: i32, 1541 | depth: i32, 1542 | format: u32, 1543 | ty: u32, 1544 | pixels: PixelUnpackData, 1545 | ); 1546 | 1547 | unsafe fn texture_sub_image_3d( 1548 | &self, 1549 | texture: Self::Texture, 1550 | level: i32, 1551 | x_offset: i32, 1552 | y_offset: i32, 1553 | z_offset: i32, 1554 | width: i32, 1555 | height: i32, 1556 | depth: i32, 1557 | format: u32, 1558 | ty: u32, 1559 | pixels: PixelUnpackData, 1560 | ); 1561 | 1562 | unsafe fn compressed_tex_sub_image_3d( 1563 | &self, 1564 | target: u32, 1565 | level: i32, 1566 | x_offset: i32, 1567 | y_offset: i32, 1568 | z_offset: i32, 1569 | width: i32, 1570 | height: i32, 1571 | depth: i32, 1572 | format: u32, 1573 | pixels: CompressedPixelUnpackData, 1574 | ); 1575 | 1576 | unsafe fn depth_func(&self, func: u32); 1577 | 1578 | unsafe fn depth_range_f32(&self, near: f32, far: f32); 1579 | 1580 | unsafe fn depth_range_f64(&self, near: f64, far: f64); 1581 | 1582 | unsafe fn depth_range(&self, near: f64, far: f64); 1583 | 1584 | unsafe fn depth_range_f64_slice(&self, first: u32, count: i32, values: &[[f64; 2]]); 1585 | 1586 | unsafe fn scissor(&self, x: i32, y: i32, width: i32, height: i32); 1587 | 1588 | unsafe fn scissor_slice(&self, first: u32, count: i32, scissors: &[[i32; 4]]); 1589 | 1590 | unsafe fn vertex_array_attrib_binding_f32( 1591 | &self, 1592 | vao: Self::VertexArray, 1593 | index: u32, 1594 | binding_index: u32, 1595 | ); 1596 | 1597 | unsafe fn vertex_array_attrib_format_f32( 1598 | &self, 1599 | vao: Self::VertexArray, 1600 | index: u32, 1601 | size: i32, 1602 | data_type: u32, 1603 | normalized: bool, 1604 | relative_offset: u32, 1605 | ); 1606 | 1607 | unsafe fn vertex_array_attrib_format_i32( 1608 | &self, 1609 | vao: Self::VertexArray, 1610 | index: u32, 1611 | size: i32, 1612 | data_type: u32, 1613 | relative_offset: u32, 1614 | ); 1615 | 1616 | unsafe fn vertex_array_attrib_format_f64( 1617 | &self, 1618 | vao: Self::VertexArray, 1619 | index: u32, 1620 | size: i32, 1621 | data_type: u32, 1622 | relative_offset: u32, 1623 | ); 1624 | 1625 | unsafe fn vertex_array_element_buffer( 1626 | &self, 1627 | vao: Self::VertexArray, 1628 | buffer: Option, 1629 | ); 1630 | 1631 | unsafe fn vertex_array_vertex_buffer( 1632 | &self, 1633 | vao: Self::VertexArray, 1634 | binding_index: u32, 1635 | buffer: Option, 1636 | offset: i32, 1637 | stride: i32, 1638 | ); 1639 | 1640 | unsafe fn vertex_attrib_divisor(&self, index: u32, divisor: u32); 1641 | 1642 | unsafe fn get_vertex_attrib_parameter_f32_slice( 1643 | &self, 1644 | index: u32, 1645 | pname: u32, 1646 | result: &mut [f32], 1647 | ); 1648 | 1649 | unsafe fn vertex_attrib_pointer_f32( 1650 | &self, 1651 | index: u32, 1652 | size: i32, 1653 | data_type: u32, 1654 | normalized: bool, 1655 | stride: i32, 1656 | offset: i32, 1657 | ); 1658 | 1659 | unsafe fn vertex_attrib_pointer_i32( 1660 | &self, 1661 | index: u32, 1662 | size: i32, 1663 | data_type: u32, 1664 | stride: i32, 1665 | offset: i32, 1666 | ); 1667 | 1668 | unsafe fn vertex_attrib_pointer_f64( 1669 | &self, 1670 | index: u32, 1671 | size: i32, 1672 | data_type: u32, 1673 | stride: i32, 1674 | offset: i32, 1675 | ); 1676 | 1677 | unsafe fn vertex_attrib_format_f32( 1678 | &self, 1679 | index: u32, 1680 | size: i32, 1681 | data_type: u32, 1682 | normalized: bool, 1683 | relative_offset: u32, 1684 | ); 1685 | 1686 | unsafe fn vertex_attrib_format_i32( 1687 | &self, 1688 | index: u32, 1689 | size: i32, 1690 | data_type: u32, 1691 | relative_offset: u32, 1692 | ); 1693 | 1694 | unsafe fn vertex_attrib_format_f64( 1695 | &self, 1696 | index: u32, 1697 | size: i32, 1698 | data_type: u32, 1699 | relative_offset: u32, 1700 | ); 1701 | 1702 | unsafe fn vertex_attrib_1_f32(&self, index: u32, x: f32); 1703 | 1704 | unsafe fn vertex_attrib_2_f32(&self, index: u32, x: f32, y: f32); 1705 | 1706 | unsafe fn vertex_attrib_3_f32(&self, index: u32, x: f32, y: f32, z: f32); 1707 | 1708 | unsafe fn vertex_attrib_4_f32(&self, index: u32, x: f32, y: f32, z: f32, w: f32); 1709 | 1710 | unsafe fn vertex_attrib_4_i32(&self, index: u32, x: i32, y: i32, z: i32, w: i32); 1711 | 1712 | unsafe fn vertex_attrib_4_u32(&self, index: u32, x: u32, y: u32, z: u32, w: u32); 1713 | 1714 | unsafe fn vertex_attrib_1_f32_slice(&self, index: u32, v: &[f32]); 1715 | 1716 | unsafe fn vertex_attrib_2_f32_slice(&self, index: u32, v: &[f32]); 1717 | 1718 | unsafe fn vertex_attrib_3_f32_slice(&self, index: u32, v: &[f32]); 1719 | 1720 | unsafe fn vertex_attrib_4_f32_slice(&self, index: u32, v: &[f32]); 1721 | 1722 | unsafe fn vertex_attrib_binding(&self, attrib_index: u32, binding_index: u32); 1723 | 1724 | unsafe fn vertex_binding_divisor(&self, binding_index: u32, divisor: u32); 1725 | 1726 | unsafe fn viewport(&self, x: i32, y: i32, width: i32, height: i32); 1727 | 1728 | unsafe fn viewport_f32_slice(&self, first: u32, count: i32, values: &[[f32; 4]]); 1729 | 1730 | unsafe fn blend_equation(&self, mode: u32); 1731 | 1732 | unsafe fn blend_equation_draw_buffer(&self, draw_buffer: u32, mode: u32); 1733 | 1734 | unsafe fn blend_equation_separate(&self, mode_rgb: u32, mode_alpha: u32); 1735 | 1736 | unsafe fn blend_equation_separate_draw_buffer( 1737 | &self, 1738 | buffer: u32, 1739 | mode_rgb: u32, 1740 | mode_alpha: u32, 1741 | ); 1742 | 1743 | unsafe fn blend_func(&self, src: u32, dst: u32); 1744 | 1745 | unsafe fn blend_func_draw_buffer(&self, draw_buffer: u32, src: u32, dst: u32); 1746 | 1747 | unsafe fn blend_func_separate( 1748 | &self, 1749 | src_rgb: u32, 1750 | dst_rgb: u32, 1751 | src_alpha: u32, 1752 | dst_alpha: u32, 1753 | ); 1754 | 1755 | unsafe fn blend_func_separate_draw_buffer( 1756 | &self, 1757 | draw_buffer: u32, 1758 | src_rgb: u32, 1759 | dst_rgb: u32, 1760 | src_alpha: u32, 1761 | dst_alpha: u32, 1762 | ); 1763 | 1764 | unsafe fn stencil_func(&self, func: u32, reference: i32, mask: u32); 1765 | 1766 | unsafe fn stencil_func_separate(&self, face: u32, func: u32, reference: i32, mask: u32); 1767 | 1768 | unsafe fn stencil_mask(&self, mask: u32); 1769 | 1770 | unsafe fn stencil_mask_separate(&self, face: u32, mask: u32); 1771 | 1772 | unsafe fn stencil_op(&self, stencil_fail: u32, depth_fail: u32, pass: u32); 1773 | 1774 | unsafe fn stencil_op_separate(&self, face: u32, stencil_fail: u32, depth_fail: u32, pass: u32); 1775 | 1776 | unsafe fn debug_message_control( 1777 | &self, 1778 | source: u32, 1779 | msg_type: u32, 1780 | severity: u32, 1781 | ids: &[u32], 1782 | enabled: bool, 1783 | ); 1784 | 1785 | unsafe fn debug_message_insert( 1786 | &self, 1787 | source: u32, 1788 | msg_type: u32, 1789 | id: u32, 1790 | severity: u32, 1791 | msg: S, 1792 | ) where 1793 | S: AsRef; 1794 | 1795 | unsafe fn debug_message_callback(&mut self, callback: F) 1796 | where 1797 | F: Fn(u32, u32, u32, u32, &str) + Send + Sync + 'static; 1798 | 1799 | unsafe fn get_debug_message_log(&self, count: u32) -> Vec; 1800 | 1801 | unsafe fn push_debug_group(&self, source: u32, id: u32, message: S) 1802 | where 1803 | S: AsRef; 1804 | 1805 | unsafe fn pop_debug_group(&self); 1806 | 1807 | unsafe fn object_label(&self, identifier: u32, name: u32, label: Option) 1808 | where 1809 | S: AsRef; 1810 | 1811 | unsafe fn get_object_label(&self, identifier: u32, name: u32) -> String; 1812 | 1813 | unsafe fn object_ptr_label(&self, sync: Self::Fence, label: Option) 1814 | where 1815 | S: AsRef; 1816 | 1817 | unsafe fn get_object_ptr_label(&self, sync: Self::Fence) -> String; 1818 | 1819 | unsafe fn get_uniform_block_index(&self, program: Self::Program, name: &str) -> Option; 1820 | 1821 | unsafe fn get_uniform_indices( 1822 | &self, 1823 | program: Self::Program, 1824 | names: &[&str], 1825 | ) -> Vec>; 1826 | 1827 | unsafe fn uniform_block_binding(&self, program: Self::Program, index: u32, binding: u32); 1828 | 1829 | unsafe fn get_shader_storage_block_index( 1830 | &self, 1831 | program: Self::Program, 1832 | name: &str, 1833 | ) -> Option; 1834 | 1835 | unsafe fn shader_storage_block_binding(&self, program: Self::Program, index: u32, binding: u32); 1836 | 1837 | unsafe fn read_buffer(&self, src: u32); 1838 | 1839 | unsafe fn named_framebuffer_read_buffer( 1840 | &self, 1841 | framebuffer: Option, 1842 | src: u32, 1843 | ); 1844 | 1845 | unsafe fn read_pixels( 1846 | &self, 1847 | x: i32, 1848 | y: i32, 1849 | width: i32, 1850 | height: i32, 1851 | format: u32, 1852 | gltype: u32, 1853 | pixels: PixelPackData, 1854 | ); 1855 | 1856 | unsafe fn begin_query(&self, target: u32, query: Self::Query); 1857 | 1858 | unsafe fn end_query(&self, target: u32); 1859 | 1860 | unsafe fn query_counter(&self, query: Self::Query, target: u32); 1861 | 1862 | unsafe fn get_query_parameter_u32(&self, query: Self::Query, parameter: u32) -> u32; 1863 | 1864 | unsafe fn get_query_parameter_u64(&self, query: Self::Query, parameter: u32) -> u64; 1865 | 1866 | unsafe fn get_query_parameter_u64_with_offset( 1867 | &self, 1868 | query: Self::Query, 1869 | parameter: u32, 1870 | offset: usize, 1871 | ); 1872 | 1873 | unsafe fn delete_transform_feedback(&self, transform_feedback: Self::TransformFeedback); 1874 | 1875 | unsafe fn is_transform_feedback(&self, transform_feedback: Self::TransformFeedback) -> bool; 1876 | 1877 | unsafe fn create_transform_feedback(&self) -> Result; 1878 | 1879 | unsafe fn bind_transform_feedback( 1880 | &self, 1881 | target: u32, 1882 | transform_feedback: Option, 1883 | ); 1884 | 1885 | unsafe fn begin_transform_feedback(&self, primitive_mode: u32); 1886 | 1887 | unsafe fn end_transform_feedback(&self); 1888 | 1889 | unsafe fn pause_transform_feedback(&self); 1890 | 1891 | unsafe fn resume_transform_feedback(&self); 1892 | 1893 | unsafe fn transform_feedback_varyings( 1894 | &self, 1895 | program: Self::Program, 1896 | varyings: &[&str], 1897 | buffer_mode: u32, 1898 | ); 1899 | 1900 | unsafe fn get_transform_feedback_varying( 1901 | &self, 1902 | program: Self::Program, 1903 | index: u32, 1904 | ) -> Option; 1905 | 1906 | unsafe fn memory_barrier(&self, barriers: u32); 1907 | 1908 | unsafe fn memory_barrier_by_region(&self, barriers: u32); 1909 | 1910 | unsafe fn bind_image_texture( 1911 | &self, 1912 | unit: u32, 1913 | texture: Option, 1914 | level: i32, 1915 | layered: bool, 1916 | layer: i32, 1917 | access: u32, 1918 | format: u32, 1919 | ); 1920 | 1921 | unsafe fn max_shader_compiler_threads(&self, count: u32); 1922 | 1923 | unsafe fn hint(&self, target: u32, mode: u32); 1924 | 1925 | unsafe fn sample_coverage(&self, value: f32, invert: bool); 1926 | 1927 | unsafe fn get_internal_format_i32_slice( 1928 | &self, 1929 | target: u32, 1930 | internal_format: u32, 1931 | pname: u32, 1932 | result: &mut [i32], 1933 | ); 1934 | } 1935 | 1936 | /// Returns number of components used by format 1937 | pub fn components_per_format(format: u32) -> usize { 1938 | match format { 1939 | RED | GREEN | BLUE => 1, 1940 | RED_INTEGER | GREEN_INTEGER | BLUE_INTEGER => 1, 1941 | ALPHA | LUMINANCE | DEPTH_COMPONENT => 1, 1942 | RG | LUMINANCE_ALPHA => 2, 1943 | RGB | BGR => 3, 1944 | RGBA | BGRA => 4, 1945 | _ => panic!("unsupported format: {:?}", format), 1946 | } 1947 | } 1948 | 1949 | /// Returns number of bytes used by pixel type (in one component) 1950 | pub fn bytes_per_type(pixel_type: u32) -> usize { 1951 | // per https://www.khronos.org/opengl/wiki/Pixel_Transfer#Pixel_type 1952 | match pixel_type { 1953 | BYTE | UNSIGNED_BYTE => 1, 1954 | SHORT | UNSIGNED_SHORT => 2, 1955 | INT | UNSIGNED_INT => 4, 1956 | HALF_FLOAT | HALF_FLOAT_OES => 2, 1957 | FLOAT => 4, 1958 | _ => panic!("unsupported pixel type: {:?}", pixel_type), 1959 | } 1960 | } 1961 | 1962 | pub fn compute_size(width: i32, height: i32, format: u32, pixel_type: u32) -> usize { 1963 | width as usize * height as usize * components_per_format(format) * bytes_per_type(pixel_type) 1964 | } 1965 | 1966 | pub const ACTIVE_ATOMIC_COUNTER_BUFFERS: u32 = 0x92D9; 1967 | 1968 | pub const ACTIVE_ATTRIBUTES: u32 = 0x8B89; 1969 | 1970 | pub const ACTIVE_ATTRIBUTE_MAX_LENGTH: u32 = 0x8B8A; 1971 | 1972 | pub const ACTIVE_PROGRAM: u32 = 0x8259; 1973 | 1974 | pub const ACTIVE_RESOURCES: u32 = 0x92F5; 1975 | 1976 | pub const ACTIVE_SUBROUTINES: u32 = 0x8DE5; 1977 | 1978 | pub const ACTIVE_SUBROUTINE_MAX_LENGTH: u32 = 0x8E48; 1979 | 1980 | pub const ACTIVE_SUBROUTINE_UNIFORMS: u32 = 0x8DE6; 1981 | 1982 | pub const ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS: u32 = 0x8E47; 1983 | 1984 | pub const ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH: u32 = 0x8E49; 1985 | 1986 | pub const ACTIVE_TEXTURE: u32 = 0x84E0; 1987 | 1988 | pub const ACTIVE_UNIFORMS: u32 = 0x8B86; 1989 | 1990 | pub const ACTIVE_UNIFORM_BLOCKS: u32 = 0x8A36; 1991 | 1992 | pub const ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH: u32 = 0x8A35; 1993 | 1994 | pub const ACTIVE_UNIFORM_MAX_LENGTH: u32 = 0x8B87; 1995 | 1996 | pub const ACTIVE_VARIABLES: u32 = 0x9305; 1997 | 1998 | pub const ALIASED_LINE_WIDTH_RANGE: u32 = 0x846E; 1999 | 2000 | pub const ALIASED_POINT_SIZE_RANGE: u32 = 0x846D; 2001 | 2002 | pub const ALL_BARRIER_BITS: u32 = 0xFFFFFFFF; 2003 | 2004 | pub const ALL_SHADER_BITS: u32 = 0xFFFFFFFF; 2005 | 2006 | pub const ALPHA: u32 = 0x1906; 2007 | 2008 | pub const ALPHA_BITS: u32 = 0x0D55; 2009 | 2010 | pub const ALREADY_SIGNALED: u32 = 0x911A; 2011 | 2012 | pub const ALWAYS: u32 = 0x0207; 2013 | 2014 | pub const AND: u32 = 0x1501; 2015 | 2016 | pub const AND_INVERTED: u32 = 0x1504; 2017 | 2018 | pub const AND_REVERSE: u32 = 0x1502; 2019 | 2020 | pub const ANY_SAMPLES_PASSED: u32 = 0x8C2F; 2021 | 2022 | pub const ANY_SAMPLES_PASSED_CONSERVATIVE: u32 = 0x8D6A; 2023 | 2024 | pub const ARRAY_BUFFER: u32 = 0x8892; 2025 | 2026 | pub const ARRAY_BUFFER_BINDING: u32 = 0x8894; 2027 | 2028 | pub const ARRAY_SIZE: u32 = 0x92FB; 2029 | 2030 | pub const ARRAY_STRIDE: u32 = 0x92FE; 2031 | 2032 | pub const ATOMIC_COUNTER_BARRIER_BIT: u32 = 0x00001000; 2033 | 2034 | pub const ATOMIC_COUNTER_BUFFER: u32 = 0x92C0; 2035 | 2036 | pub const ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS: u32 = 0x92C5; 2037 | 2038 | pub const ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES: u32 = 0x92C6; 2039 | 2040 | pub const ATOMIC_COUNTER_BUFFER_BINDING: u32 = 0x92C1; 2041 | 2042 | pub const ATOMIC_COUNTER_BUFFER_DATA_SIZE: u32 = 0x92C4; 2043 | 2044 | pub const ATOMIC_COUNTER_BUFFER_INDEX: u32 = 0x9301; 2045 | 2046 | pub const ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER: u32 = 0x90ED; 2047 | 2048 | pub const ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER: u32 = 0x92CB; 2049 | 2050 | pub const ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER: u32 = 0x92CA; 2051 | 2052 | pub const ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER: u32 = 0x92C8; 2053 | 2054 | pub const ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER: u32 = 0x92C9; 2055 | 2056 | pub const ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER: u32 = 0x92C7; 2057 | 2058 | pub const ATOMIC_COUNTER_BUFFER_SIZE: u32 = 0x92C3; 2059 | 2060 | pub const ATOMIC_COUNTER_BUFFER_START: u32 = 0x92C2; 2061 | 2062 | pub const ATTACHED_SHADERS: u32 = 0x8B85; 2063 | 2064 | pub const AUTO_GENERATE_MIPMAP: u32 = 0x8295; 2065 | 2066 | pub const BACK: u32 = 0x0405; 2067 | 2068 | pub const BACK_LEFT: u32 = 0x0402; 2069 | 2070 | pub const BACK_RIGHT: u32 = 0x0403; 2071 | 2072 | pub const BGR: u32 = 0x80E0; 2073 | 2074 | pub const BGRA: u32 = 0x80E1; 2075 | 2076 | pub const BGRA_INTEGER: u32 = 0x8D9B; 2077 | 2078 | pub const BGR_INTEGER: u32 = 0x8D9A; 2079 | 2080 | pub const BLEND: u32 = 0x0BE2; 2081 | 2082 | pub const BLEND_COLOR: u32 = 0x8005; 2083 | 2084 | pub const BLEND_DST: u32 = 0x0BE0; 2085 | 2086 | pub const BLEND_DST_ALPHA: u32 = 0x80CA; 2087 | 2088 | pub const BLEND_DST_RGB: u32 = 0x80C8; 2089 | 2090 | pub const BLEND_EQUATION: u32 = 0x8009; 2091 | 2092 | pub const BLEND_EQUATION_ALPHA: u32 = 0x883D; 2093 | 2094 | pub const BLEND_EQUATION_RGB: u32 = 0x8009; 2095 | 2096 | pub const BLEND_SRC: u32 = 0x0BE1; 2097 | 2098 | pub const BLEND_SRC_ALPHA: u32 = 0x80CB; 2099 | 2100 | pub const BLEND_SRC_RGB: u32 = 0x80C9; 2101 | 2102 | pub const BLOCK_INDEX: u32 = 0x92FD; 2103 | 2104 | pub const BLUE: u32 = 0x1905; 2105 | 2106 | pub const BLUE_BITS: u32 = 0x0D54; 2107 | 2108 | pub const BLUE_INTEGER: u32 = 0x8D96; 2109 | 2110 | pub const BOOL: u32 = 0x8B56; 2111 | 2112 | pub const BOOL_VEC2: u32 = 0x8B57; 2113 | 2114 | pub const BOOL_VEC3: u32 = 0x8B58; 2115 | 2116 | pub const BOOL_VEC4: u32 = 0x8B59; 2117 | 2118 | pub const BUFFER: u32 = 0x82E0; 2119 | 2120 | pub const BUFFER_ACCESS: u32 = 0x88BB; 2121 | 2122 | pub const BUFFER_ACCESS_FLAGS: u32 = 0x911F; 2123 | 2124 | pub const BUFFER_BINDING: u32 = 0x9302; 2125 | 2126 | pub const BUFFER_DATA_SIZE: u32 = 0x9303; 2127 | 2128 | pub const BUFFER_IMMUTABLE_STORAGE: u32 = 0x821F; 2129 | 2130 | pub const BUFFER_MAPPED: u32 = 0x88BC; 2131 | 2132 | pub const BUFFER_MAP_LENGTH: u32 = 0x9120; 2133 | 2134 | pub const BUFFER_MAP_OFFSET: u32 = 0x9121; 2135 | 2136 | pub const BUFFER_MAP_POINTER: u32 = 0x88BD; 2137 | 2138 | pub const BUFFER_SIZE: u32 = 0x8764; 2139 | 2140 | pub const BUFFER_STORAGE_FLAGS: u32 = 0x8220; 2141 | 2142 | pub const BUFFER_UPDATE_BARRIER_BIT: u32 = 0x00000200; 2143 | 2144 | pub const BUFFER_USAGE: u32 = 0x8765; 2145 | 2146 | pub const BUFFER_VARIABLE: u32 = 0x92E5; 2147 | 2148 | pub const BYTE: u32 = 0x1400; 2149 | 2150 | pub const CAVEAT_SUPPORT: u32 = 0x82B8; 2151 | 2152 | pub const CCW: u32 = 0x0901; 2153 | 2154 | pub const CLAMP_READ_COLOR: u32 = 0x891C; 2155 | 2156 | pub const CLAMP_TO_BORDER: u32 = 0x812D; 2157 | 2158 | pub const CLAMP_TO_EDGE: u32 = 0x812F; 2159 | 2160 | pub const CLEAR: u32 = 0x1500; 2161 | 2162 | pub const CLEAR_BUFFER: u32 = 0x82B4; 2163 | 2164 | pub const CLEAR_TEXTURE: u32 = 0x9365; 2165 | 2166 | pub const CLIENT_MAPPED_BUFFER_BARRIER_BIT: u32 = 0x00004000; 2167 | 2168 | pub const CLIENT_STORAGE_BIT: u32 = 0x0200; 2169 | 2170 | pub const CLIPPING_INPUT_PRIMITIVES: u32 = 0x82F6; 2171 | 2172 | pub const CLIPPING_OUTPUT_PRIMITIVES: u32 = 0x82F7; 2173 | 2174 | pub const CLIP_DEPTH_MODE: u32 = 0x935D; 2175 | 2176 | pub const CLIP_DISTANCE0: u32 = 0x3000; 2177 | 2178 | pub const CLIP_DISTANCE1: u32 = 0x3001; 2179 | 2180 | pub const CLIP_DISTANCE2: u32 = 0x3002; 2181 | 2182 | pub const CLIP_DISTANCE3: u32 = 0x3003; 2183 | 2184 | pub const CLIP_DISTANCE4: u32 = 0x3004; 2185 | 2186 | pub const CLIP_DISTANCE5: u32 = 0x3005; 2187 | 2188 | pub const CLIP_DISTANCE6: u32 = 0x3006; 2189 | 2190 | pub const CLIP_DISTANCE7: u32 = 0x3007; 2191 | 2192 | pub const CLIP_ORIGIN: u32 = 0x935C; 2193 | 2194 | pub const COLOR: u32 = 0x1800; 2195 | 2196 | pub const COLOR_ATTACHMENT0: u32 = 0x8CE0; 2197 | 2198 | pub const COLOR_ATTACHMENT1: u32 = 0x8CE1; 2199 | 2200 | pub const COLOR_ATTACHMENT10: u32 = 0x8CEA; 2201 | 2202 | pub const COLOR_ATTACHMENT11: u32 = 0x8CEB; 2203 | 2204 | pub const COLOR_ATTACHMENT12: u32 = 0x8CEC; 2205 | 2206 | pub const COLOR_ATTACHMENT13: u32 = 0x8CED; 2207 | 2208 | pub const COLOR_ATTACHMENT14: u32 = 0x8CEE; 2209 | 2210 | pub const COLOR_ATTACHMENT15: u32 = 0x8CEF; 2211 | 2212 | pub const COLOR_ATTACHMENT16: u32 = 0x8CF0; 2213 | 2214 | pub const COLOR_ATTACHMENT17: u32 = 0x8CF1; 2215 | 2216 | pub const COLOR_ATTACHMENT18: u32 = 0x8CF2; 2217 | 2218 | pub const COLOR_ATTACHMENT19: u32 = 0x8CF3; 2219 | 2220 | pub const COLOR_ATTACHMENT2: u32 = 0x8CE2; 2221 | 2222 | pub const COLOR_ATTACHMENT20: u32 = 0x8CF4; 2223 | 2224 | pub const COLOR_ATTACHMENT21: u32 = 0x8CF5; 2225 | 2226 | pub const COLOR_ATTACHMENT22: u32 = 0x8CF6; 2227 | 2228 | pub const COLOR_ATTACHMENT23: u32 = 0x8CF7; 2229 | 2230 | pub const COLOR_ATTACHMENT24: u32 = 0x8CF8; 2231 | 2232 | pub const COLOR_ATTACHMENT25: u32 = 0x8CF9; 2233 | 2234 | pub const COLOR_ATTACHMENT26: u32 = 0x8CFA; 2235 | 2236 | pub const COLOR_ATTACHMENT27: u32 = 0x8CFB; 2237 | 2238 | pub const COLOR_ATTACHMENT28: u32 = 0x8CFC; 2239 | 2240 | pub const COLOR_ATTACHMENT29: u32 = 0x8CFD; 2241 | 2242 | pub const COLOR_ATTACHMENT3: u32 = 0x8CE3; 2243 | 2244 | pub const COLOR_ATTACHMENT30: u32 = 0x8CFE; 2245 | 2246 | pub const COLOR_ATTACHMENT31: u32 = 0x8CFF; 2247 | 2248 | pub const COLOR_ATTACHMENT4: u32 = 0x8CE4; 2249 | 2250 | pub const COLOR_ATTACHMENT5: u32 = 0x8CE5; 2251 | 2252 | pub const COLOR_ATTACHMENT6: u32 = 0x8CE6; 2253 | 2254 | pub const COLOR_ATTACHMENT7: u32 = 0x8CE7; 2255 | 2256 | pub const COLOR_ATTACHMENT8: u32 = 0x8CE8; 2257 | 2258 | pub const COLOR_ATTACHMENT9: u32 = 0x8CE9; 2259 | 2260 | pub const COLOR_BUFFER_BIT: u32 = 0x00004000; 2261 | 2262 | pub const COLOR_CLEAR_VALUE: u32 = 0x0C22; 2263 | 2264 | pub const COLOR_COMPONENTS: u32 = 0x8283; 2265 | 2266 | pub const COLOR_ENCODING: u32 = 0x8296; 2267 | 2268 | pub const COLOR_LOGIC_OP: u32 = 0x0BF2; 2269 | 2270 | pub const COLOR_RENDERABLE: u32 = 0x8286; 2271 | 2272 | pub const COLOR_WRITEMASK: u32 = 0x0C23; 2273 | 2274 | pub const COMMAND_BARRIER_BIT: u32 = 0x00000040; 2275 | 2276 | pub const COMPARE_REF_TO_TEXTURE: u32 = 0x884E; 2277 | 2278 | pub const COMPATIBLE_SUBROUTINES: u32 = 0x8E4B; 2279 | 2280 | pub const COMPILE_STATUS: u32 = 0x8B81; 2281 | 2282 | pub const COMPLETION_STATUS: u32 = 0x91B1; 2283 | 2284 | pub const COMPRESSED_R11_EAC: u32 = 0x9270; 2285 | 2286 | pub const COMPRESSED_RED: u32 = 0x8225; 2287 | 2288 | pub const COMPRESSED_RED_RGTC1: u32 = 0x8DBB; 2289 | 2290 | pub const COMPRESSED_RG: u32 = 0x8226; 2291 | 2292 | pub const COMPRESSED_RG11_EAC: u32 = 0x9272; 2293 | 2294 | pub const COMPRESSED_RGB: u32 = 0x84ED; 2295 | 2296 | pub const COMPRESSED_RGB8_ETC2: u32 = 0x9274; 2297 | 2298 | pub const COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: u32 = 0x9276; 2299 | 2300 | pub const COMPRESSED_RGBA: u32 = 0x84EE; 2301 | 2302 | pub const COMPRESSED_RGBA8_ETC2_EAC: u32 = 0x9278; 2303 | 2304 | pub const COMPRESSED_RGBA_BPTC_UNORM: u32 = 0x8E8C; 2305 | 2306 | pub const COMPRESSED_RGB_BPTC_SIGNED_FLOAT: u32 = 0x8E8E; 2307 | 2308 | pub const COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT: u32 = 0x8E8F; 2309 | 2310 | pub const COMPRESSED_RG_RGTC2: u32 = 0x8DBD; 2311 | 2312 | pub const COMPRESSED_SIGNED_R11_EAC: u32 = 0x9271; 2313 | 2314 | pub const COMPRESSED_SIGNED_RED_RGTC1: u32 = 0x8DBC; 2315 | 2316 | pub const COMPRESSED_SIGNED_RG11_EAC: u32 = 0x9273; 2317 | 2318 | pub const COMPRESSED_SIGNED_RG_RGTC2: u32 = 0x8DBE; 2319 | 2320 | pub const COMPRESSED_SRGB: u32 = 0x8C48; 2321 | 2322 | pub const COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: u32 = 0x9279; 2323 | 2324 | pub const COMPRESSED_SRGB8_ETC2: u32 = 0x9275; 2325 | 2326 | pub const COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: u32 = 0x9277; 2327 | 2328 | pub const COMPRESSED_SRGB_ALPHA: u32 = 0x8C49; 2329 | 2330 | pub const COMPRESSED_SRGB_ALPHA_BPTC_UNORM: u32 = 0x8E8D; 2331 | 2332 | pub const COMPRESSED_RGB_S3TC_DXT1_EXT: u32 = 0x83F0; 2333 | 2334 | pub const COMPRESSED_RGBA_S3TC_DXT1_EXT: u32 = 0x83F1; 2335 | 2336 | pub const COMPRESSED_RGBA_S3TC_DXT3_EXT: u32 = 0x83F2; 2337 | 2338 | pub const COMPRESSED_RGBA_S3TC_DXT5_EXT: u32 = 0x83F3; 2339 | 2340 | pub const COMPRESSED_SRGB_S3TC_DXT1_EXT: u32 = 0x8C4C; 2341 | 2342 | pub const COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: u32 = 0x8C4D; 2343 | 2344 | pub const COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: u32 = 0x8C4E; 2345 | 2346 | pub const COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: u32 = 0x8C4F; 2347 | 2348 | pub const COMPRESSED_RGBA_ASTC_4x4_KHR: u32 = 0x93B0; 2349 | 2350 | pub const COMPRESSED_RGBA_ASTC_5x4_KHR: u32 = 0x93B1; 2351 | 2352 | pub const COMPRESSED_RGBA_ASTC_5x5_KHR: u32 = 0x93B2; 2353 | 2354 | pub const COMPRESSED_RGBA_ASTC_6x5_KHR: u32 = 0x93B3; 2355 | 2356 | pub const COMPRESSED_RGBA_ASTC_6x6_KHR: u32 = 0x93B4; 2357 | 2358 | pub const COMPRESSED_RGBA_ASTC_8x5_KHR: u32 = 0x93B5; 2359 | 2360 | pub const COMPRESSED_RGBA_ASTC_8x6_KHR: u32 = 0x93B6; 2361 | 2362 | pub const COMPRESSED_RGBA_ASTC_8x8_KHR: u32 = 0x93B7; 2363 | 2364 | pub const COMPRESSED_RGBA_ASTC_10x5_KHR: u32 = 0x93B8; 2365 | 2366 | pub const COMPRESSED_RGBA_ASTC_10x6_KHR: u32 = 0x93B9; 2367 | 2368 | pub const COMPRESSED_RGBA_ASTC_10x8_KHR: u32 = 0x93BA; 2369 | 2370 | pub const COMPRESSED_RGBA_ASTC_10x10_KHR: u32 = 0x93BB; 2371 | 2372 | pub const COMPRESSED_RGBA_ASTC_12x10_KHR: u32 = 0x93BC; 2373 | 2374 | pub const COMPRESSED_RGBA_ASTC_12x12_KHR: u32 = 0x93BD; 2375 | 2376 | pub const COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: u32 = 0x93D0; 2377 | 2378 | pub const COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: u32 = 0x93D1; 2379 | 2380 | pub const COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: u32 = 0x93D2; 2381 | 2382 | pub const COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: u32 = 0x93D3; 2383 | 2384 | pub const COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: u32 = 0x93D4; 2385 | 2386 | pub const COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: u32 = 0x93D5; 2387 | 2388 | pub const COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: u32 = 0x93D6; 2389 | 2390 | pub const COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: u32 = 0x93D7; 2391 | 2392 | pub const COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: u32 = 0x93D8; 2393 | 2394 | pub const COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: u32 = 0x93D9; 2395 | 2396 | pub const COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: u32 = 0x93DA; 2397 | 2398 | pub const COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: u32 = 0x93DB; 2399 | 2400 | pub const COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: u32 = 0x93DC; 2401 | 2402 | pub const COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: u32 = 0x93DD; 2403 | 2404 | pub const COMPRESSED_TEXTURE_FORMATS: u32 = 0x86A3; 2405 | 2406 | pub const COMPUTE_SHADER: u32 = 0x91B9; 2407 | 2408 | pub const COMPUTE_SHADER_BIT: u32 = 0x00000020; 2409 | 2410 | pub const COMPUTE_SHADER_INVOCATIONS: u32 = 0x82F5; 2411 | 2412 | pub const COMPUTE_SUBROUTINE: u32 = 0x92ED; 2413 | 2414 | pub const COMPUTE_SUBROUTINE_UNIFORM: u32 = 0x92F3; 2415 | 2416 | pub const COMPUTE_TEXTURE: u32 = 0x82A0; 2417 | 2418 | pub const COMPUTE_WORK_GROUP_SIZE: u32 = 0x8267; 2419 | 2420 | pub const CONDITION_SATISFIED: u32 = 0x911C; 2421 | 2422 | pub const CONSTANT_ALPHA: u32 = 0x8003; 2423 | 2424 | pub const CONSTANT_COLOR: u32 = 0x8001; 2425 | 2426 | pub const CONTEXT_COMPATIBILITY_PROFILE_BIT: u32 = 0x00000002; 2427 | 2428 | pub const CONTEXT_CORE_PROFILE_BIT: u32 = 0x00000001; 2429 | 2430 | pub const CONTEXT_FLAGS: u32 = 0x821E; 2431 | 2432 | pub const CONTEXT_FLAG_DEBUG_BIT: u32 = 0x00000002; 2433 | 2434 | pub const CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT: u32 = 0x00000001; 2435 | 2436 | pub const CONTEXT_FLAG_NO_ERROR_BIT: u32 = 0x00000008; 2437 | 2438 | pub const CONTEXT_FLAG_ROBUST_ACCESS_BIT: u32 = 0x00000004; 2439 | 2440 | pub const CONTEXT_LOST: u32 = 0x0507; 2441 | 2442 | pub const CONTEXT_PROFILE_MASK: u32 = 0x9126; 2443 | 2444 | pub const CONTEXT_RELEASE_BEHAVIOR: u32 = 0x82FB; 2445 | 2446 | pub const CONTEXT_RELEASE_BEHAVIOR_FLUSH: u32 = 0x82FC; 2447 | 2448 | pub const COPY: u32 = 0x1503; 2449 | 2450 | pub const COPY_INVERTED: u32 = 0x150C; 2451 | 2452 | pub const COPY_READ_BUFFER: u32 = 0x8F36; 2453 | 2454 | pub const COPY_READ_BUFFER_BINDING: u32 = 0x8F36; 2455 | 2456 | pub const COPY_WRITE_BUFFER: u32 = 0x8F37; 2457 | 2458 | pub const COPY_WRITE_BUFFER_BINDING: u32 = 0x8F37; 2459 | 2460 | pub const CULL_FACE: u32 = 0x0B44; 2461 | 2462 | pub const CULL_FACE_MODE: u32 = 0x0B45; 2463 | 2464 | pub const CURRENT_PROGRAM: u32 = 0x8B8D; 2465 | 2466 | pub const CURRENT_QUERY: u32 = 0x8865; 2467 | 2468 | pub const CURRENT_VERTEX_ATTRIB: u32 = 0x8626; 2469 | 2470 | pub const CW: u32 = 0x0900; 2471 | 2472 | pub const DEBUG_CALLBACK_FUNCTION: u32 = 0x8244; 2473 | 2474 | pub const DEBUG_CALLBACK_USER_PARAM: u32 = 0x8245; 2475 | 2476 | pub const DEBUG_GROUP_STACK_DEPTH: u32 = 0x826D; 2477 | 2478 | pub const DEBUG_LOGGED_MESSAGES: u32 = 0x9145; 2479 | 2480 | pub const DEBUG_NEXT_LOGGED_MESSAGE_LENGTH: u32 = 0x8243; 2481 | 2482 | pub const DEBUG_OUTPUT: u32 = 0x92E0; 2483 | 2484 | pub const DEBUG_OUTPUT_SYNCHRONOUS: u32 = 0x8242; 2485 | 2486 | pub const DEBUG_SEVERITY_HIGH: u32 = 0x9146; 2487 | 2488 | pub const DEBUG_SEVERITY_LOW: u32 = 0x9148; 2489 | 2490 | pub const DEBUG_SEVERITY_MEDIUM: u32 = 0x9147; 2491 | 2492 | pub const DEBUG_SEVERITY_NOTIFICATION: u32 = 0x826B; 2493 | 2494 | pub const DEBUG_SOURCE_API: u32 = 0x8246; 2495 | 2496 | pub const DEBUG_SOURCE_APPLICATION: u32 = 0x824A; 2497 | 2498 | pub const DEBUG_SOURCE_OTHER: u32 = 0x824B; 2499 | 2500 | pub const DEBUG_SOURCE_SHADER_COMPILER: u32 = 0x8248; 2501 | 2502 | pub const DEBUG_SOURCE_THIRD_PARTY: u32 = 0x8249; 2503 | 2504 | pub const DEBUG_SOURCE_WINDOW_SYSTEM: u32 = 0x8247; 2505 | 2506 | pub const DEBUG_TYPE_DEPRECATED_BEHAVIOR: u32 = 0x824D; 2507 | 2508 | pub const DEBUG_TYPE_ERROR: u32 = 0x824C; 2509 | 2510 | pub const DEBUG_TYPE_MARKER: u32 = 0x8268; 2511 | 2512 | pub const DEBUG_TYPE_OTHER: u32 = 0x8251; 2513 | 2514 | pub const DEBUG_TYPE_PERFORMANCE: u32 = 0x8250; 2515 | 2516 | pub const DEBUG_TYPE_POP_GROUP: u32 = 0x826A; 2517 | 2518 | pub const DEBUG_TYPE_PORTABILITY: u32 = 0x824F; 2519 | 2520 | pub const DEBUG_TYPE_PUSH_GROUP: u32 = 0x8269; 2521 | 2522 | pub const DEBUG_TYPE_UNDEFINED_BEHAVIOR: u32 = 0x824E; 2523 | 2524 | pub const DECR: u32 = 0x1E03; 2525 | 2526 | pub const DECR_WRAP: u32 = 0x8508; 2527 | 2528 | pub const DELETE_STATUS: u32 = 0x8B80; 2529 | 2530 | pub const DEPTH: u32 = 0x1801; 2531 | 2532 | pub const DEPTH24_STENCIL8: u32 = 0x88F0; 2533 | 2534 | pub const DEPTH32F_STENCIL8: u32 = 0x8CAD; 2535 | 2536 | pub const DEPTH_ATTACHMENT: u32 = 0x8D00; 2537 | 2538 | pub const DEPTH_BITS: u32 = 0x0D56; 2539 | 2540 | pub const DEPTH_BUFFER_BIT: u32 = 0x00000100; 2541 | 2542 | pub const DEPTH_CLAMP: u32 = 0x864F; 2543 | 2544 | pub const DEPTH_CLEAR_VALUE: u32 = 0x0B73; 2545 | 2546 | pub const DEPTH_COMPONENT: u32 = 0x1902; 2547 | 2548 | pub const DEPTH_COMPONENT16: u32 = 0x81A5; 2549 | 2550 | pub const DEPTH_COMPONENT24: u32 = 0x81A6; 2551 | 2552 | pub const DEPTH_COMPONENT32: u32 = 0x81A7; 2553 | 2554 | pub const DEPTH_COMPONENT32F: u32 = 0x8CAC; 2555 | 2556 | pub const DEPTH_COMPONENTS: u32 = 0x8284; 2557 | 2558 | pub const DEPTH_FUNC: u32 = 0x0B74; 2559 | 2560 | pub const DEPTH_RANGE: u32 = 0x0B70; 2561 | 2562 | pub const DEPTH_RENDERABLE: u32 = 0x8287; 2563 | 2564 | pub const DEPTH_STENCIL: u32 = 0x84F9; 2565 | 2566 | pub const DEPTH_STENCIL_ATTACHMENT: u32 = 0x821A; 2567 | 2568 | pub const DEPTH_STENCIL_TEXTURE_MODE: u32 = 0x90EA; 2569 | 2570 | pub const DEPTH_TEST: u32 = 0x0B71; 2571 | 2572 | pub const DEPTH_WRITEMASK: u32 = 0x0B72; 2573 | 2574 | pub const DISPATCH_INDIRECT_BUFFER: u32 = 0x90EE; 2575 | 2576 | pub const DISPATCH_INDIRECT_BUFFER_BINDING: u32 = 0x90EF; 2577 | 2578 | pub const DISPLAY_LIST: u32 = 0x82E7; 2579 | 2580 | pub const DITHER: u32 = 0x0BD0; 2581 | 2582 | pub const DONT_CARE: u32 = 0x1100; 2583 | 2584 | pub const DOUBLE: u32 = 0x140A; 2585 | 2586 | pub const DOUBLEBUFFER: u32 = 0x0C32; 2587 | 2588 | pub const DOUBLE_MAT2: u32 = 0x8F46; 2589 | 2590 | pub const DOUBLE_MAT2x3: u32 = 0x8F49; 2591 | 2592 | pub const DOUBLE_MAT2x4: u32 = 0x8F4A; 2593 | 2594 | pub const DOUBLE_MAT3: u32 = 0x8F47; 2595 | 2596 | pub const DOUBLE_MAT3x2: u32 = 0x8F4B; 2597 | 2598 | pub const DOUBLE_MAT3x4: u32 = 0x8F4C; 2599 | 2600 | pub const DOUBLE_MAT4: u32 = 0x8F48; 2601 | 2602 | pub const DOUBLE_MAT4x2: u32 = 0x8F4D; 2603 | 2604 | pub const DOUBLE_MAT4x3: u32 = 0x8F4E; 2605 | 2606 | pub const DOUBLE_VEC2: u32 = 0x8FFC; 2607 | 2608 | pub const DOUBLE_VEC3: u32 = 0x8FFD; 2609 | 2610 | pub const DOUBLE_VEC4: u32 = 0x8FFE; 2611 | 2612 | pub const DRAW_BUFFER: u32 = 0x0C01; 2613 | 2614 | pub const DRAW_BUFFER0: u32 = 0x8825; 2615 | 2616 | pub const DRAW_BUFFER1: u32 = 0x8826; 2617 | 2618 | pub const DRAW_BUFFER10: u32 = 0x882F; 2619 | 2620 | pub const DRAW_BUFFER11: u32 = 0x8830; 2621 | 2622 | pub const DRAW_BUFFER12: u32 = 0x8831; 2623 | 2624 | pub const DRAW_BUFFER13: u32 = 0x8832; 2625 | 2626 | pub const DRAW_BUFFER14: u32 = 0x8833; 2627 | 2628 | pub const DRAW_BUFFER15: u32 = 0x8834; 2629 | 2630 | pub const DRAW_BUFFER2: u32 = 0x8827; 2631 | 2632 | pub const DRAW_BUFFER3: u32 = 0x8828; 2633 | 2634 | pub const DRAW_BUFFER4: u32 = 0x8829; 2635 | 2636 | pub const DRAW_BUFFER5: u32 = 0x882A; 2637 | 2638 | pub const DRAW_BUFFER6: u32 = 0x882B; 2639 | 2640 | pub const DRAW_BUFFER7: u32 = 0x882C; 2641 | 2642 | pub const DRAW_BUFFER8: u32 = 0x882D; 2643 | 2644 | pub const DRAW_BUFFER9: u32 = 0x882E; 2645 | 2646 | pub const DRAW_FRAMEBUFFER: u32 = 0x8CA9; 2647 | 2648 | pub const DRAW_FRAMEBUFFER_BINDING: u32 = 0x8CA6; 2649 | 2650 | pub const DRAW_INDIRECT_BUFFER: u32 = 0x8F3F; 2651 | 2652 | pub const DRAW_INDIRECT_BUFFER_BINDING: u32 = 0x8F43; 2653 | 2654 | pub const DST_ALPHA: u32 = 0x0304; 2655 | 2656 | pub const DST_COLOR: u32 = 0x0306; 2657 | 2658 | pub const DYNAMIC_COPY: u32 = 0x88EA; 2659 | 2660 | pub const DYNAMIC_DRAW: u32 = 0x88E8; 2661 | 2662 | pub const DYNAMIC_READ: u32 = 0x88E9; 2663 | 2664 | pub const DYNAMIC_STORAGE_BIT: u32 = 0x0100; 2665 | 2666 | pub const ELEMENT_ARRAY_BARRIER_BIT: u32 = 0x00000002; 2667 | 2668 | pub const ELEMENT_ARRAY_BUFFER: u32 = 0x8893; 2669 | 2670 | pub const ELEMENT_ARRAY_BUFFER_BINDING: u32 = 0x8895; 2671 | 2672 | pub const EQUAL: u32 = 0x0202; 2673 | 2674 | pub const EQUIV: u32 = 0x1509; 2675 | 2676 | pub const EXTENSIONS: u32 = 0x1F03; 2677 | 2678 | pub const FALSE: u8 = 0; 2679 | 2680 | pub const FASTEST: u32 = 0x1101; 2681 | 2682 | pub const FILL: u32 = 0x1B02; 2683 | 2684 | pub const FILTER: u32 = 0x829A; 2685 | 2686 | pub const FIRST_VERTEX_CONVENTION: u32 = 0x8E4D; 2687 | 2688 | pub const FIXED: u32 = 0x140C; 2689 | 2690 | pub const FIXED_ONLY: u32 = 0x891D; 2691 | 2692 | pub const FLOAT: u32 = 0x1406; 2693 | 2694 | pub const FLOAT_32_UNSIGNED_INT_24_8_REV: u32 = 0x8DAD; 2695 | 2696 | pub const FLOAT_MAT2: u32 = 0x8B5A; 2697 | 2698 | pub const FLOAT_MAT2x3: u32 = 0x8B65; 2699 | 2700 | pub const FLOAT_MAT2x4: u32 = 0x8B66; 2701 | 2702 | pub const FLOAT_MAT3: u32 = 0x8B5B; 2703 | 2704 | pub const FLOAT_MAT3x2: u32 = 0x8B67; 2705 | 2706 | pub const FLOAT_MAT3x4: u32 = 0x8B68; 2707 | 2708 | pub const FLOAT_MAT4: u32 = 0x8B5C; 2709 | 2710 | pub const FLOAT_MAT4x2: u32 = 0x8B69; 2711 | 2712 | pub const FLOAT_MAT4x3: u32 = 0x8B6A; 2713 | 2714 | pub const FLOAT_VEC2: u32 = 0x8B50; 2715 | 2716 | pub const FLOAT_VEC3: u32 = 0x8B51; 2717 | 2718 | pub const FLOAT_VEC4: u32 = 0x8B52; 2719 | 2720 | pub const FRACTIONAL_EVEN: u32 = 0x8E7C; 2721 | 2722 | pub const FRACTIONAL_ODD: u32 = 0x8E7B; 2723 | 2724 | pub const FRAGMENT_INTERPOLATION_OFFSET_BITS: u32 = 0x8E5D; 2725 | 2726 | pub const FRAGMENT_SHADER: u32 = 0x8B30; 2727 | 2728 | pub const FRAGMENT_SHADER_BIT: u32 = 0x00000002; 2729 | 2730 | pub const FRAGMENT_SHADER_DERIVATIVE_HINT: u32 = 0x8B8B; 2731 | 2732 | pub const FRAGMENT_SHADER_INVOCATIONS: u32 = 0x82F4; 2733 | 2734 | pub const FRAGMENT_SUBROUTINE: u32 = 0x92EC; 2735 | 2736 | pub const FRAGMENT_SUBROUTINE_UNIFORM: u32 = 0x92F2; 2737 | 2738 | pub const FRAGMENT_TEXTURE: u32 = 0x829F; 2739 | 2740 | pub const FRAMEBUFFER: u32 = 0x8D40; 2741 | 2742 | pub const FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: u32 = 0x8215; 2743 | 2744 | pub const FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: u32 = 0x8214; 2745 | 2746 | pub const FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: u32 = 0x8210; 2747 | 2748 | pub const FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: u32 = 0x8211; 2749 | 2750 | pub const FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: u32 = 0x8216; 2751 | 2752 | pub const FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: u32 = 0x8213; 2753 | 2754 | pub const FRAMEBUFFER_ATTACHMENT_LAYERED: u32 = 0x8DA7; 2755 | 2756 | pub const FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: u32 = 0x8CD1; 2757 | 2758 | pub const FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: u32 = 0x8CD0; 2759 | 2760 | pub const FRAMEBUFFER_ATTACHMENT_RED_SIZE: u32 = 0x8212; 2761 | 2762 | pub const FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: u32 = 0x8217; 2763 | 2764 | pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: u32 = 0x8CD3; 2765 | 2766 | pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: u32 = 0x8CD4; 2767 | 2768 | pub const FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: u32 = 0x8CD2; 2769 | 2770 | pub const FRAMEBUFFER_BARRIER_BIT: u32 = 0x00000400; 2771 | 2772 | pub const FRAMEBUFFER_BINDING: u32 = 0x8CA6; 2773 | 2774 | pub const FRAMEBUFFER_BLEND: u32 = 0x828B; 2775 | 2776 | pub const FRAMEBUFFER_COMPLETE: u32 = 0x8CD5; 2777 | 2778 | pub const FRAMEBUFFER_DEFAULT: u32 = 0x8218; 2779 | 2780 | pub const FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS: u32 = 0x9314; 2781 | 2782 | pub const FRAMEBUFFER_DEFAULT_HEIGHT: u32 = 0x9311; 2783 | 2784 | pub const FRAMEBUFFER_DEFAULT_LAYERS: u32 = 0x9312; 2785 | 2786 | pub const FRAMEBUFFER_DEFAULT_SAMPLES: u32 = 0x9313; 2787 | 2788 | pub const FRAMEBUFFER_DEFAULT_WIDTH: u32 = 0x9310; 2789 | 2790 | pub const FRAMEBUFFER_INCOMPLETE_ATTACHMENT: u32 = 0x8CD6; 2791 | 2792 | pub const FRAMEBUFFER_INCOMPLETE_DIMENSIONS: u32 = 0x8CD9; 2793 | 2794 | pub const FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER: u32 = 0x8CDB; 2795 | 2796 | pub const FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS: u32 = 0x8DA8; 2797 | 2798 | pub const FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: u32 = 0x8CD7; 2799 | 2800 | pub const FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: u32 = 0x8D56; 2801 | 2802 | pub const FRAMEBUFFER_INCOMPLETE_READ_BUFFER: u32 = 0x8CDC; 2803 | 2804 | pub const FRAMEBUFFER_RENDERABLE: u32 = 0x8289; 2805 | 2806 | pub const FRAMEBUFFER_RENDERABLE_LAYERED: u32 = 0x828A; 2807 | 2808 | pub const FRAMEBUFFER_SRGB: u32 = 0x8DB9; 2809 | 2810 | pub const FRAMEBUFFER_UNDEFINED: u32 = 0x8219; 2811 | 2812 | pub const FRAMEBUFFER_UNSUPPORTED: u32 = 0x8CDD; 2813 | 2814 | pub const FRONT: u32 = 0x0404; 2815 | 2816 | pub const FRONT_AND_BACK: u32 = 0x0408; 2817 | 2818 | pub const FRONT_FACE: u32 = 0x0B46; 2819 | 2820 | pub const FRONT_LEFT: u32 = 0x0400; 2821 | 2822 | pub const FRONT_RIGHT: u32 = 0x0401; 2823 | 2824 | pub const FULL_SUPPORT: u32 = 0x82B7; 2825 | 2826 | pub const FUNC_ADD: u32 = 0x8006; 2827 | 2828 | pub const FUNC_REVERSE_SUBTRACT: u32 = 0x800B; 2829 | 2830 | pub const FUNC_SUBTRACT: u32 = 0x800A; 2831 | 2832 | pub const GENERATE_MIPMAP_HINT: u32 = 0x8192; 2833 | 2834 | pub const GEOMETRY_INPUT_TYPE: u32 = 0x8917; 2835 | 2836 | pub const GEOMETRY_OUTPUT_TYPE: u32 = 0x8918; 2837 | 2838 | pub const GEOMETRY_SHADER: u32 = 0x8DD9; 2839 | 2840 | pub const GEOMETRY_SHADER_BIT: u32 = 0x00000004; 2841 | 2842 | pub const GEOMETRY_SHADER_INVOCATIONS: u32 = 0x887F; 2843 | 2844 | pub const GEOMETRY_SHADER_PRIMITIVES_EMITTED: u32 = 0x82F3; 2845 | 2846 | pub const GEOMETRY_SUBROUTINE: u32 = 0x92EB; 2847 | 2848 | pub const GEOMETRY_SUBROUTINE_UNIFORM: u32 = 0x92F1; 2849 | 2850 | pub const GEOMETRY_TEXTURE: u32 = 0x829E; 2851 | 2852 | pub const GEOMETRY_VERTICES_OUT: u32 = 0x8916; 2853 | 2854 | pub const GEQUAL: u32 = 0x0206; 2855 | 2856 | pub const GET_TEXTURE_IMAGE_FORMAT: u32 = 0x8291; 2857 | 2858 | pub const GET_TEXTURE_IMAGE_TYPE: u32 = 0x8292; 2859 | 2860 | pub const GREATER: u32 = 0x0204; 2861 | 2862 | pub const GREEN: u32 = 0x1904; 2863 | 2864 | pub const GREEN_BITS: u32 = 0x0D53; 2865 | 2866 | pub const GREEN_INTEGER: u32 = 0x8D95; 2867 | 2868 | pub const GUILTY_CONTEXT_RESET: u32 = 0x8253; 2869 | 2870 | pub const HALF_FLOAT_OES: u32 = 0x8D61; 2871 | 2872 | pub const HALF_FLOAT: u32 = 0x140B; 2873 | 2874 | pub const HIGH_FLOAT: u32 = 0x8DF2; 2875 | 2876 | pub const HIGH_INT: u32 = 0x8DF5; 2877 | 2878 | pub const IMAGE_1D: u32 = 0x904C; 2879 | 2880 | pub const IMAGE_1D_ARRAY: u32 = 0x9052; 2881 | 2882 | pub const IMAGE_2D: u32 = 0x904D; 2883 | 2884 | pub const IMAGE_2D_ARRAY: u32 = 0x9053; 2885 | 2886 | pub const IMAGE_2D_MULTISAMPLE: u32 = 0x9055; 2887 | 2888 | pub const IMAGE_2D_MULTISAMPLE_ARRAY: u32 = 0x9056; 2889 | 2890 | pub const IMAGE_2D_RECT: u32 = 0x904F; 2891 | 2892 | pub const IMAGE_3D: u32 = 0x904E; 2893 | 2894 | pub const IMAGE_BINDING_ACCESS: u32 = 0x8F3E; 2895 | 2896 | pub const IMAGE_BINDING_FORMAT: u32 = 0x906E; 2897 | 2898 | pub const IMAGE_BINDING_LAYER: u32 = 0x8F3D; 2899 | 2900 | pub const IMAGE_BINDING_LAYERED: u32 = 0x8F3C; 2901 | 2902 | pub const IMAGE_BINDING_LEVEL: u32 = 0x8F3B; 2903 | 2904 | pub const IMAGE_BINDING_NAME: u32 = 0x8F3A; 2905 | 2906 | pub const IMAGE_BUFFER: u32 = 0x9051; 2907 | 2908 | pub const IMAGE_CLASS_10_10_10_2: u32 = 0x82C3; 2909 | 2910 | pub const IMAGE_CLASS_11_11_10: u32 = 0x82C2; 2911 | 2912 | pub const IMAGE_CLASS_1_X_16: u32 = 0x82BE; 2913 | 2914 | pub const IMAGE_CLASS_1_X_32: u32 = 0x82BB; 2915 | 2916 | pub const IMAGE_CLASS_1_X_8: u32 = 0x82C1; 2917 | 2918 | pub const IMAGE_CLASS_2_X_16: u32 = 0x82BD; 2919 | 2920 | pub const IMAGE_CLASS_2_X_32: u32 = 0x82BA; 2921 | 2922 | pub const IMAGE_CLASS_2_X_8: u32 = 0x82C0; 2923 | 2924 | pub const IMAGE_CLASS_4_X_16: u32 = 0x82BC; 2925 | 2926 | pub const IMAGE_CLASS_4_X_32: u32 = 0x82B9; 2927 | 2928 | pub const IMAGE_CLASS_4_X_8: u32 = 0x82BF; 2929 | 2930 | pub const IMAGE_COMPATIBILITY_CLASS: u32 = 0x82A8; 2931 | 2932 | pub const IMAGE_CUBE: u32 = 0x9050; 2933 | 2934 | pub const IMAGE_CUBE_MAP_ARRAY: u32 = 0x9054; 2935 | 2936 | pub const IMAGE_FORMAT_COMPATIBILITY_BY_CLASS: u32 = 0x90C9; 2937 | 2938 | pub const IMAGE_FORMAT_COMPATIBILITY_BY_SIZE: u32 = 0x90C8; 2939 | 2940 | pub const IMAGE_FORMAT_COMPATIBILITY_TYPE: u32 = 0x90C7; 2941 | 2942 | pub const IMAGE_PIXEL_FORMAT: u32 = 0x82A9; 2943 | 2944 | pub const IMAGE_PIXEL_TYPE: u32 = 0x82AA; 2945 | 2946 | pub const IMAGE_TEXEL_SIZE: u32 = 0x82A7; 2947 | 2948 | pub const IMPLEMENTATION_COLOR_READ_FORMAT: u32 = 0x8B9B; 2949 | 2950 | pub const IMPLEMENTATION_COLOR_READ_TYPE: u32 = 0x8B9A; 2951 | 2952 | pub const INCR: u32 = 0x1E02; 2953 | 2954 | pub const INCR_WRAP: u32 = 0x8507; 2955 | 2956 | pub const INDEX: u32 = 0x8222; 2957 | 2958 | pub const INFO_LOG_LENGTH: u32 = 0x8B84; 2959 | 2960 | pub const INNOCENT_CONTEXT_RESET: u32 = 0x8254; 2961 | 2962 | pub const INT: u32 = 0x1404; 2963 | 2964 | pub const INTERLEAVED_ATTRIBS: u32 = 0x8C8C; 2965 | 2966 | pub const INTERNALFORMAT_ALPHA_SIZE: u32 = 0x8274; 2967 | 2968 | pub const INTERNALFORMAT_ALPHA_TYPE: u32 = 0x827B; 2969 | 2970 | pub const INTERNALFORMAT_BLUE_SIZE: u32 = 0x8273; 2971 | 2972 | pub const INTERNALFORMAT_BLUE_TYPE: u32 = 0x827A; 2973 | 2974 | pub const INTERNALFORMAT_DEPTH_SIZE: u32 = 0x8275; 2975 | 2976 | pub const INTERNALFORMAT_DEPTH_TYPE: u32 = 0x827C; 2977 | 2978 | pub const INTERNALFORMAT_GREEN_SIZE: u32 = 0x8272; 2979 | 2980 | pub const INTERNALFORMAT_GREEN_TYPE: u32 = 0x8279; 2981 | 2982 | pub const INTERNALFORMAT_PREFERRED: u32 = 0x8270; 2983 | 2984 | pub const INTERNALFORMAT_RED_SIZE: u32 = 0x8271; 2985 | 2986 | pub const INTERNALFORMAT_RED_TYPE: u32 = 0x8278; 2987 | 2988 | pub const INTERNALFORMAT_SHARED_SIZE: u32 = 0x8277; 2989 | 2990 | pub const INTERNALFORMAT_STENCIL_SIZE: u32 = 0x8276; 2991 | 2992 | pub const INTERNALFORMAT_STENCIL_TYPE: u32 = 0x827D; 2993 | 2994 | pub const INTERNALFORMAT_SUPPORTED: u32 = 0x826F; 2995 | 2996 | pub const INT_2_10_10_10_REV: u32 = 0x8D9F; 2997 | 2998 | pub const INT_IMAGE_1D: u32 = 0x9057; 2999 | 3000 | pub const INT_IMAGE_1D_ARRAY: u32 = 0x905D; 3001 | 3002 | pub const INT_IMAGE_2D: u32 = 0x9058; 3003 | 3004 | pub const INT_IMAGE_2D_ARRAY: u32 = 0x905E; 3005 | 3006 | pub const INT_IMAGE_2D_MULTISAMPLE: u32 = 0x9060; 3007 | 3008 | pub const INT_IMAGE_2D_MULTISAMPLE_ARRAY: u32 = 0x9061; 3009 | 3010 | pub const INT_IMAGE_2D_RECT: u32 = 0x905A; 3011 | 3012 | pub const INT_IMAGE_3D: u32 = 0x9059; 3013 | 3014 | pub const INT_IMAGE_BUFFER: u32 = 0x905C; 3015 | 3016 | pub const INT_IMAGE_CUBE: u32 = 0x905B; 3017 | 3018 | pub const INT_IMAGE_CUBE_MAP_ARRAY: u32 = 0x905F; 3019 | 3020 | pub const INT_SAMPLER_1D: u32 = 0x8DC9; 3021 | 3022 | pub const INT_SAMPLER_1D_ARRAY: u32 = 0x8DCE; 3023 | 3024 | pub const INT_SAMPLER_2D: u32 = 0x8DCA; 3025 | 3026 | pub const INT_SAMPLER_2D_ARRAY: u32 = 0x8DCF; 3027 | 3028 | pub const INT_SAMPLER_2D_MULTISAMPLE: u32 = 0x9109; 3029 | 3030 | pub const INT_SAMPLER_2D_MULTISAMPLE_ARRAY: u32 = 0x910C; 3031 | 3032 | pub const INT_SAMPLER_2D_RECT: u32 = 0x8DCD; 3033 | 3034 | pub const INT_SAMPLER_3D: u32 = 0x8DCB; 3035 | 3036 | pub const INT_SAMPLER_BUFFER: u32 = 0x8DD0; 3037 | 3038 | pub const INT_SAMPLER_CUBE: u32 = 0x8DCC; 3039 | 3040 | pub const INT_SAMPLER_CUBE_MAP_ARRAY: u32 = 0x900E; 3041 | 3042 | pub const INT_VEC2: u32 = 0x8B53; 3043 | 3044 | pub const INT_VEC3: u32 = 0x8B54; 3045 | 3046 | pub const INT_VEC4: u32 = 0x8B55; 3047 | 3048 | pub const INVALID_ENUM: u32 = 0x0500; 3049 | 3050 | pub const INVALID_FRAMEBUFFER_OPERATION: u32 = 0x0506; 3051 | 3052 | pub const INVALID_INDEX: u32 = 0xFFFFFFFF; 3053 | 3054 | pub const INVALID_OPERATION: u32 = 0x0502; 3055 | 3056 | pub const INVALID_VALUE: u32 = 0x0501; 3057 | 3058 | pub const INVERT: u32 = 0x150A; 3059 | 3060 | pub const ISOLINES: u32 = 0x8E7A; 3061 | 3062 | pub const IS_PER_PATCH: u32 = 0x92E7; 3063 | 3064 | pub const IS_ROW_MAJOR: u32 = 0x9300; 3065 | 3066 | pub const KEEP: u32 = 0x1E00; 3067 | 3068 | pub const LAST_VERTEX_CONVENTION: u32 = 0x8E4E; 3069 | 3070 | pub const LAYER_PROVOKING_VERTEX: u32 = 0x825E; 3071 | 3072 | pub const LEFT: u32 = 0x0406; 3073 | 3074 | pub const LEQUAL: u32 = 0x0203; 3075 | 3076 | pub const LESS: u32 = 0x0201; 3077 | 3078 | pub const LINE: u32 = 0x1B01; 3079 | 3080 | pub const LINEAR: u32 = 0x2601; 3081 | 3082 | pub const LINEAR_MIPMAP_LINEAR: u32 = 0x2703; 3083 | 3084 | pub const LINEAR_MIPMAP_NEAREST: u32 = 0x2701; 3085 | 3086 | pub const LINES: u32 = 0x0001; 3087 | 3088 | pub const LINES_ADJACENCY: u32 = 0x000A; 3089 | 3090 | pub const LINE_LOOP: u32 = 0x0002; 3091 | 3092 | pub const LINE_SMOOTH: u32 = 0x0B20; 3093 | 3094 | pub const LINE_SMOOTH_HINT: u32 = 0x0C52; 3095 | 3096 | pub const LINE_STRIP: u32 = 0x0003; 3097 | 3098 | pub const LINE_STRIP_ADJACENCY: u32 = 0x000B; 3099 | 3100 | pub const LINE_WIDTH: u32 = 0x0B21; 3101 | 3102 | pub const LINE_WIDTH_GRANULARITY: u32 = 0x0B23; 3103 | 3104 | pub const LINE_WIDTH_RANGE: u32 = 0x0B22; 3105 | 3106 | pub const LINK_STATUS: u32 = 0x8B82; 3107 | 3108 | pub const LOCATION: u32 = 0x930E; 3109 | 3110 | pub const LOCATION_COMPONENT: u32 = 0x934A; 3111 | 3112 | pub const LOCATION_INDEX: u32 = 0x930F; 3113 | 3114 | pub const LOGIC_OP_MODE: u32 = 0x0BF0; 3115 | 3116 | pub const LOSE_CONTEXT_ON_RESET: u32 = 0x8252; 3117 | 3118 | pub const LOWER_LEFT: u32 = 0x8CA1; 3119 | 3120 | pub const LOW_FLOAT: u32 = 0x8DF0; 3121 | 3122 | pub const LOW_INT: u32 = 0x8DF3; 3123 | 3124 | pub const LUMINANCE: u32 = 0x1909; 3125 | 3126 | pub const LUMINANCE_ALPHA: u32 = 0x190A; 3127 | 3128 | pub const MAJOR_VERSION: u32 = 0x821B; 3129 | 3130 | pub const MANUAL_GENERATE_MIPMAP: u32 = 0x8294; 3131 | 3132 | pub const MAP_COHERENT_BIT: u32 = 0x0080; 3133 | 3134 | pub const MAP_FLUSH_EXPLICIT_BIT: u32 = 0x0010; 3135 | 3136 | pub const MAP_INVALIDATE_BUFFER_BIT: u32 = 0x0008; 3137 | 3138 | pub const MAP_INVALIDATE_RANGE_BIT: u32 = 0x0004; 3139 | 3140 | pub const MAP_PERSISTENT_BIT: u32 = 0x0040; 3141 | 3142 | pub const MAP_READ_BIT: u32 = 0x0001; 3143 | 3144 | pub const MAP_UNSYNCHRONIZED_BIT: u32 = 0x0020; 3145 | 3146 | pub const MAP_WRITE_BIT: u32 = 0x0002; 3147 | 3148 | pub const MATRIX_STRIDE: u32 = 0x92FF; 3149 | 3150 | pub const MAX: u32 = 0x8008; 3151 | 3152 | pub const MAX_3D_TEXTURE_SIZE: u32 = 0x8073; 3153 | 3154 | pub const MAX_ARRAY_TEXTURE_LAYERS: u32 = 0x88FF; 3155 | 3156 | pub const MAX_ATOMIC_COUNTER_BUFFER_BINDINGS: u32 = 0x92DC; 3157 | 3158 | pub const MAX_ATOMIC_COUNTER_BUFFER_SIZE: u32 = 0x92D8; 3159 | 3160 | pub const MAX_CLIP_DISTANCES: u32 = 0x0D32; 3161 | 3162 | pub const MAX_COLOR_ATTACHMENTS: u32 = 0x8CDF; 3163 | 3164 | pub const MAX_COLOR_TEXTURE_SAMPLES: u32 = 0x910E; 3165 | 3166 | pub const MAX_COMBINED_ATOMIC_COUNTERS: u32 = 0x92D7; 3167 | 3168 | pub const MAX_COMBINED_ATOMIC_COUNTER_BUFFERS: u32 = 0x92D1; 3169 | 3170 | pub const MAX_COMBINED_CLIP_AND_CULL_DISTANCES: u32 = 0x82FA; 3171 | 3172 | pub const MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS: u32 = 0x8266; 3173 | 3174 | pub const MAX_COMBINED_DIMENSIONS: u32 = 0x8282; 3175 | 3176 | pub const MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: u32 = 0x8A33; 3177 | 3178 | pub const MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS: u32 = 0x8A32; 3179 | 3180 | pub const MAX_COMBINED_IMAGE_UNIFORMS: u32 = 0x90CF; 3181 | 3182 | pub const MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS: u32 = 0x8F39; 3183 | 3184 | pub const MAX_COMBINED_SHADER_OUTPUT_RESOURCES: u32 = 0x8F39; 3185 | 3186 | pub const MAX_COMBINED_SHADER_STORAGE_BLOCKS: u32 = 0x90DC; 3187 | 3188 | pub const MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS: u32 = 0x8E1E; 3189 | 3190 | pub const MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS: u32 = 0x8E1F; 3191 | 3192 | pub const MAX_COMBINED_TEXTURE_IMAGE_UNITS: u32 = 0x8B4D; 3193 | 3194 | pub const MAX_COMBINED_UNIFORM_BLOCKS: u32 = 0x8A2E; 3195 | 3196 | pub const MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: u32 = 0x8A31; 3197 | 3198 | pub const MAX_COMPUTE_ATOMIC_COUNTERS: u32 = 0x8265; 3199 | 3200 | pub const MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS: u32 = 0x8264; 3201 | 3202 | pub const MAX_COMPUTE_IMAGE_UNIFORMS: u32 = 0x91BD; 3203 | 3204 | pub const MAX_COMPUTE_SHADER_STORAGE_BLOCKS: u32 = 0x90DB; 3205 | 3206 | pub const MAX_COMPUTE_SHARED_MEMORY_SIZE: u32 = 0x8262; 3207 | 3208 | pub const MAX_COMPUTE_TEXTURE_IMAGE_UNITS: u32 = 0x91BC; 3209 | 3210 | pub const MAX_COMPUTE_UNIFORM_BLOCKS: u32 = 0x91BB; 3211 | 3212 | pub const MAX_COMPUTE_UNIFORM_COMPONENTS: u32 = 0x8263; 3213 | 3214 | pub const MAX_COMPUTE_WORK_GROUP_COUNT: u32 = 0x91BE; 3215 | 3216 | pub const MAX_COMPUTE_WORK_GROUP_INVOCATIONS: u32 = 0x90EB; 3217 | 3218 | pub const MAX_COMPUTE_WORK_GROUP_SIZE: u32 = 0x91BF; 3219 | 3220 | pub const MAX_CUBE_MAP_TEXTURE_SIZE: u32 = 0x851C; 3221 | 3222 | pub const MAX_CULL_DISTANCES: u32 = 0x82F9; 3223 | 3224 | pub const MAX_DEBUG_GROUP_STACK_DEPTH: u32 = 0x826C; 3225 | 3226 | pub const MAX_DEBUG_LOGGED_MESSAGES: u32 = 0x9144; 3227 | 3228 | pub const MAX_DEBUG_MESSAGE_LENGTH: u32 = 0x9143; 3229 | 3230 | pub const MAX_DEPTH: u32 = 0x8280; 3231 | 3232 | pub const MAX_DEPTH_TEXTURE_SAMPLES: u32 = 0x910F; 3233 | 3234 | pub const MAX_DRAW_BUFFERS: u32 = 0x8824; 3235 | 3236 | pub const MAX_DUAL_SOURCE_DRAW_BUFFERS: u32 = 0x88FC; 3237 | 3238 | pub const MAX_ELEMENTS_INDICES: u32 = 0x80E9; 3239 | 3240 | pub const MAX_ELEMENTS_VERTICES: u32 = 0x80E8; 3241 | 3242 | pub const MAX_ELEMENT_INDEX: u32 = 0x8D6B; 3243 | 3244 | pub const MAX_FRAGMENT_ATOMIC_COUNTERS: u32 = 0x92D6; 3245 | 3246 | pub const MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS: u32 = 0x92D0; 3247 | 3248 | pub const MAX_FRAGMENT_IMAGE_UNIFORMS: u32 = 0x90CE; 3249 | 3250 | pub const MAX_FRAGMENT_INPUT_COMPONENTS: u32 = 0x9125; 3251 | 3252 | pub const MAX_FRAGMENT_INTERPOLATION_OFFSET: u32 = 0x8E5C; 3253 | 3254 | pub const MAX_FRAGMENT_SHADER_STORAGE_BLOCKS: u32 = 0x90DA; 3255 | 3256 | pub const MAX_FRAGMENT_UNIFORM_BLOCKS: u32 = 0x8A2D; 3257 | 3258 | pub const MAX_FRAGMENT_UNIFORM_COMPONENTS: u32 = 0x8B49; 3259 | 3260 | pub const MAX_FRAGMENT_UNIFORM_VECTORS: u32 = 0x8DFD; 3261 | 3262 | pub const MAX_FRAMEBUFFER_HEIGHT: u32 = 0x9316; 3263 | 3264 | pub const MAX_FRAMEBUFFER_LAYERS: u32 = 0x9317; 3265 | 3266 | pub const MAX_FRAMEBUFFER_SAMPLES: u32 = 0x9318; 3267 | 3268 | pub const MAX_FRAMEBUFFER_WIDTH: u32 = 0x9315; 3269 | 3270 | pub const MAX_GEOMETRY_ATOMIC_COUNTERS: u32 = 0x92D5; 3271 | 3272 | pub const MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS: u32 = 0x92CF; 3273 | 3274 | pub const MAX_GEOMETRY_IMAGE_UNIFORMS: u32 = 0x90CD; 3275 | 3276 | pub const MAX_GEOMETRY_INPUT_COMPONENTS: u32 = 0x9123; 3277 | 3278 | pub const MAX_GEOMETRY_OUTPUT_COMPONENTS: u32 = 0x9124; 3279 | 3280 | pub const MAX_GEOMETRY_OUTPUT_VERTICES: u32 = 0x8DE0; 3281 | 3282 | pub const MAX_GEOMETRY_SHADER_INVOCATIONS: u32 = 0x8E5A; 3283 | 3284 | pub const MAX_GEOMETRY_SHADER_STORAGE_BLOCKS: u32 = 0x90D7; 3285 | 3286 | pub const MAX_GEOMETRY_TEXTURE_IMAGE_UNITS: u32 = 0x8C29; 3287 | 3288 | pub const MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS: u32 = 0x8DE1; 3289 | 3290 | pub const MAX_GEOMETRY_UNIFORM_BLOCKS: u32 = 0x8A2C; 3291 | 3292 | pub const MAX_GEOMETRY_UNIFORM_COMPONENTS: u32 = 0x8DDF; 3293 | 3294 | pub const MAX_HEIGHT: u32 = 0x827F; 3295 | 3296 | pub const MAX_IMAGE_SAMPLES: u32 = 0x906D; 3297 | 3298 | pub const MAX_IMAGE_UNITS: u32 = 0x8F38; 3299 | 3300 | pub const MAX_INTEGER_SAMPLES: u32 = 0x9110; 3301 | 3302 | pub const MAX_LABEL_LENGTH: u32 = 0x82E8; 3303 | 3304 | pub const MAX_LAYERS: u32 = 0x8281; 3305 | 3306 | pub const MAX_NAME_LENGTH: u32 = 0x92F6; 3307 | 3308 | pub const MAX_NUM_ACTIVE_VARIABLES: u32 = 0x92F7; 3309 | 3310 | pub const MAX_NUM_COMPATIBLE_SUBROUTINES: u32 = 0x92F8; 3311 | 3312 | pub const MAX_PATCH_VERTICES: u32 = 0x8E7D; 3313 | 3314 | pub const MAX_PROGRAM_TEXEL_OFFSET: u32 = 0x8905; 3315 | 3316 | pub const MAX_PROGRAM_TEXTURE_GATHER_OFFSET: u32 = 0x8E5F; 3317 | 3318 | pub const MAX_RECTANGLE_TEXTURE_SIZE: u32 = 0x84F8; 3319 | 3320 | pub const MAX_RENDERBUFFER_SIZE: u32 = 0x84E8; 3321 | 3322 | pub const MAX_SAMPLES: u32 = 0x8D57; 3323 | 3324 | pub const MAX_SAMPLE_MASK_WORDS: u32 = 0x8E59; 3325 | 3326 | pub const MAX_SERVER_WAIT_TIMEOUT: u32 = 0x9111; 3327 | 3328 | pub const MAX_SHADER_COMPILER_THREADS: u32 = 0x91B0; 3329 | 3330 | pub const MAX_SHADER_STORAGE_BLOCK_SIZE: u32 = 0x90DE; 3331 | 3332 | pub const MAX_SHADER_STORAGE_BUFFER_BINDINGS: u32 = 0x90DD; 3333 | 3334 | pub const MAX_SUBROUTINES: u32 = 0x8DE7; 3335 | 3336 | pub const MAX_SUBROUTINE_UNIFORM_LOCATIONS: u32 = 0x8DE8; 3337 | 3338 | pub const MAX_TESS_CONTROL_ATOMIC_COUNTERS: u32 = 0x92D3; 3339 | 3340 | pub const MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS: u32 = 0x92CD; 3341 | 3342 | pub const MAX_TESS_CONTROL_IMAGE_UNIFORMS: u32 = 0x90CB; 3343 | 3344 | pub const MAX_TESS_CONTROL_INPUT_COMPONENTS: u32 = 0x886C; 3345 | 3346 | pub const MAX_TESS_CONTROL_OUTPUT_COMPONENTS: u32 = 0x8E83; 3347 | 3348 | pub const MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS: u32 = 0x90D8; 3349 | 3350 | pub const MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS: u32 = 0x8E81; 3351 | 3352 | pub const MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS: u32 = 0x8E85; 3353 | 3354 | pub const MAX_TESS_CONTROL_UNIFORM_BLOCKS: u32 = 0x8E89; 3355 | 3356 | pub const MAX_TESS_CONTROL_UNIFORM_COMPONENTS: u32 = 0x8E7F; 3357 | 3358 | pub const MAX_TESS_EVALUATION_ATOMIC_COUNTERS: u32 = 0x92D4; 3359 | 3360 | pub const MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS: u32 = 0x92CE; 3361 | 3362 | pub const MAX_TESS_EVALUATION_IMAGE_UNIFORMS: u32 = 0x90CC; 3363 | 3364 | pub const MAX_TESS_EVALUATION_INPUT_COMPONENTS: u32 = 0x886D; 3365 | 3366 | pub const MAX_TESS_EVALUATION_OUTPUT_COMPONENTS: u32 = 0x8E86; 3367 | 3368 | pub const MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS: u32 = 0x90D9; 3369 | 3370 | pub const MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS: u32 = 0x8E82; 3371 | 3372 | pub const MAX_TESS_EVALUATION_UNIFORM_BLOCKS: u32 = 0x8E8A; 3373 | 3374 | pub const MAX_TESS_EVALUATION_UNIFORM_COMPONENTS: u32 = 0x8E80; 3375 | 3376 | pub const MAX_TESS_GEN_LEVEL: u32 = 0x8E7E; 3377 | 3378 | pub const MAX_TESS_PATCH_COMPONENTS: u32 = 0x8E84; 3379 | 3380 | pub const MAX_TEXTURE_BUFFER_SIZE: u32 = 0x8C2B; 3381 | 3382 | pub const MAX_TEXTURE_IMAGE_UNITS: u32 = 0x8872; 3383 | 3384 | pub const MAX_TEXTURE_LOD_BIAS: u32 = 0x84FD; 3385 | 3386 | pub const MAX_TEXTURE_MAX_ANISOTROPY: u32 = 0x84FF; 3387 | 3388 | pub const MAX_TEXTURE_MAX_ANISOTROPY_EXT: u32 = 0x84FF; 3389 | 3390 | pub const MAX_TEXTURE_SIZE: u32 = 0x0D33; 3391 | 3392 | pub const MAX_TRANSFORM_FEEDBACK_BUFFERS: u32 = 0x8E70; 3393 | 3394 | pub const MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: u32 = 0x8C8A; 3395 | 3396 | pub const MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: u32 = 0x8C8B; 3397 | 3398 | pub const MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: u32 = 0x8C80; 3399 | 3400 | pub const MAX_UNIFORM_BLOCK_SIZE: u32 = 0x8A30; 3401 | 3402 | pub const MAX_UNIFORM_BUFFER_BINDINGS: u32 = 0x8A2F; 3403 | 3404 | pub const MAX_UNIFORM_LOCATIONS: u32 = 0x826E; 3405 | 3406 | pub const MAX_VARYING_COMPONENTS: u32 = 0x8B4B; 3407 | 3408 | pub const MAX_VARYING_FLOATS: u32 = 0x8B4B; 3409 | 3410 | pub const MAX_VARYING_VECTORS: u32 = 0x8DFC; 3411 | 3412 | pub const MAX_VERTEX_ATOMIC_COUNTERS: u32 = 0x92D2; 3413 | 3414 | pub const MAX_VERTEX_ATOMIC_COUNTER_BUFFERS: u32 = 0x92CC; 3415 | 3416 | pub const MAX_VERTEX_ATTRIBS: u32 = 0x8869; 3417 | 3418 | pub const MAX_VERTEX_ATTRIB_BINDINGS: u32 = 0x82DA; 3419 | 3420 | pub const MAX_VERTEX_ATTRIB_RELATIVE_OFFSET: u32 = 0x82D9; 3421 | 3422 | pub const MAX_VERTEX_ATTRIB_STRIDE: u32 = 0x82E5; 3423 | 3424 | pub const MAX_VERTEX_IMAGE_UNIFORMS: u32 = 0x90CA; 3425 | 3426 | pub const MAX_VERTEX_OUTPUT_COMPONENTS: u32 = 0x9122; 3427 | 3428 | pub const MAX_VERTEX_SHADER_STORAGE_BLOCKS: u32 = 0x90D6; 3429 | 3430 | pub const MAX_VERTEX_STREAMS: u32 = 0x8E71; 3431 | 3432 | pub const MAX_VERTEX_TEXTURE_IMAGE_UNITS: u32 = 0x8B4C; 3433 | 3434 | pub const MAX_VERTEX_UNIFORM_BLOCKS: u32 = 0x8A2B; 3435 | 3436 | pub const MAX_VERTEX_UNIFORM_COMPONENTS: u32 = 0x8B4A; 3437 | 3438 | pub const MAX_VERTEX_UNIFORM_VECTORS: u32 = 0x8DFB; 3439 | 3440 | pub const MAX_VIEWPORTS: u32 = 0x825B; 3441 | 3442 | pub const MAX_VIEWPORT_DIMS: u32 = 0x0D3A; 3443 | 3444 | pub const MAX_WIDTH: u32 = 0x827E; 3445 | 3446 | pub const MEDIUM_FLOAT: u32 = 0x8DF1; 3447 | 3448 | pub const MEDIUM_INT: u32 = 0x8DF4; 3449 | 3450 | pub const MIN: u32 = 0x8007; 3451 | 3452 | pub const MINOR_VERSION: u32 = 0x821C; 3453 | 3454 | pub const MIN_FRAGMENT_INTERPOLATION_OFFSET: u32 = 0x8E5B; 3455 | 3456 | pub const MIN_MAP_BUFFER_ALIGNMENT: u32 = 0x90BC; 3457 | 3458 | pub const MIN_PROGRAM_TEXEL_OFFSET: u32 = 0x8904; 3459 | 3460 | pub const MIN_PROGRAM_TEXTURE_GATHER_OFFSET: u32 = 0x8E5E; 3461 | 3462 | pub const MIN_SAMPLE_SHADING_VALUE: u32 = 0x8C37; 3463 | 3464 | pub const MIPMAP: u32 = 0x8293; 3465 | 3466 | pub const MIRRORED_REPEAT: u32 = 0x8370; 3467 | 3468 | pub const MIRROR_CLAMP_TO_EDGE: u32 = 0x8743; 3469 | 3470 | pub const MULTISAMPLE: u32 = 0x809D; 3471 | 3472 | pub const NAME_LENGTH: u32 = 0x92F9; 3473 | 3474 | pub const NAND: u32 = 0x150E; 3475 | 3476 | pub const NEAREST: u32 = 0x2600; 3477 | 3478 | pub const NEAREST_MIPMAP_LINEAR: u32 = 0x2702; 3479 | 3480 | pub const NEAREST_MIPMAP_NEAREST: u32 = 0x2700; 3481 | 3482 | pub const NEGATIVE_ONE_TO_ONE: u32 = 0x935E; 3483 | 3484 | pub const NEVER: u32 = 0x0200; 3485 | 3486 | pub const NICEST: u32 = 0x1102; 3487 | 3488 | pub const NONE: u32 = 0; 3489 | 3490 | pub const NOOP: u32 = 0x1505; 3491 | 3492 | pub const NOR: u32 = 0x1508; 3493 | 3494 | pub const NOTEQUAL: u32 = 0x0205; 3495 | 3496 | pub const NO_ERROR: u32 = 0; 3497 | 3498 | pub const NO_RESET_NOTIFICATION: u32 = 0x8261; 3499 | 3500 | pub const NUM_ACTIVE_VARIABLES: u32 = 0x9304; 3501 | 3502 | pub const NUM_COMPATIBLE_SUBROUTINES: u32 = 0x8E4A; 3503 | 3504 | pub const NUM_COMPRESSED_TEXTURE_FORMATS: u32 = 0x86A2; 3505 | 3506 | pub const NUM_EXTENSIONS: u32 = 0x821D; 3507 | 3508 | pub const NUM_PROGRAM_BINARY_FORMATS: u32 = 0x87FE; 3509 | 3510 | pub const NUM_SAMPLE_COUNTS: u32 = 0x9380; 3511 | 3512 | pub const NUM_SHADER_BINARY_FORMATS: u32 = 0x8DF9; 3513 | 3514 | pub const NUM_SHADING_LANGUAGE_VERSIONS: u32 = 0x82E9; 3515 | 3516 | pub const NUM_SPIR_V_EXTENSIONS: u32 = 0x9554; 3517 | 3518 | pub const OBJECT_TYPE: u32 = 0x9112; 3519 | 3520 | pub const OFFSET: u32 = 0x92FC; 3521 | 3522 | pub const ONE: u32 = 1; 3523 | 3524 | pub const ONE_MINUS_CONSTANT_ALPHA: u32 = 0x8004; 3525 | 3526 | pub const ONE_MINUS_CONSTANT_COLOR: u32 = 0x8002; 3527 | 3528 | pub const ONE_MINUS_DST_ALPHA: u32 = 0x0305; 3529 | 3530 | pub const ONE_MINUS_DST_COLOR: u32 = 0x0307; 3531 | 3532 | pub const ONE_MINUS_SRC1_ALPHA: u32 = 0x88FB; 3533 | 3534 | pub const ONE_MINUS_SRC1_COLOR: u32 = 0x88FA; 3535 | 3536 | pub const ONE_MINUS_SRC_ALPHA: u32 = 0x0303; 3537 | 3538 | pub const ONE_MINUS_SRC_COLOR: u32 = 0x0301; 3539 | 3540 | pub const OR: u32 = 0x1507; 3541 | 3542 | pub const OR_INVERTED: u32 = 0x150D; 3543 | 3544 | pub const OR_REVERSE: u32 = 0x150B; 3545 | 3546 | pub const OUT_OF_MEMORY: u32 = 0x0505; 3547 | 3548 | pub const PACK_ALIGNMENT: u32 = 0x0D05; 3549 | 3550 | pub const PACK_COMPRESSED_BLOCK_DEPTH: u32 = 0x912D; 3551 | 3552 | pub const PACK_COMPRESSED_BLOCK_HEIGHT: u32 = 0x912C; 3553 | 3554 | pub const PACK_COMPRESSED_BLOCK_SIZE: u32 = 0x912E; 3555 | 3556 | pub const PACK_COMPRESSED_BLOCK_WIDTH: u32 = 0x912B; 3557 | 3558 | pub const PACK_IMAGE_HEIGHT: u32 = 0x806C; 3559 | 3560 | pub const PACK_LSB_FIRST: u32 = 0x0D01; 3561 | 3562 | pub const PACK_ROW_LENGTH: u32 = 0x0D02; 3563 | 3564 | pub const PACK_SKIP_IMAGES: u32 = 0x806B; 3565 | 3566 | pub const PACK_SKIP_PIXELS: u32 = 0x0D04; 3567 | 3568 | pub const PACK_SKIP_ROWS: u32 = 0x0D03; 3569 | 3570 | pub const PACK_SWAP_BYTES: u32 = 0x0D00; 3571 | 3572 | pub const PARAMETER_BUFFER: u32 = 0x80EE; 3573 | 3574 | pub const PARAMETER_BUFFER_BINDING: u32 = 0x80EF; 3575 | 3576 | pub const PATCHES: u32 = 0x000E; 3577 | 3578 | pub const PATCH_DEFAULT_INNER_LEVEL: u32 = 0x8E73; 3579 | 3580 | pub const PATCH_DEFAULT_OUTER_LEVEL: u32 = 0x8E74; 3581 | 3582 | pub const PATCH_VERTICES: u32 = 0x8E72; 3583 | 3584 | pub const PIXEL_BUFFER_BARRIER_BIT: u32 = 0x00000080; 3585 | 3586 | pub const PIXEL_PACK_BUFFER: u32 = 0x88EB; 3587 | 3588 | pub const PIXEL_PACK_BUFFER_BINDING: u32 = 0x88ED; 3589 | 3590 | pub const PIXEL_UNPACK_BUFFER: u32 = 0x88EC; 3591 | 3592 | pub const PIXEL_UNPACK_BUFFER_BINDING: u32 = 0x88EF; 3593 | 3594 | pub const POINT: u32 = 0x1B00; 3595 | 3596 | pub const POINTS: u32 = 0x0000; 3597 | 3598 | pub const POINT_FADE_THRESHOLD_SIZE: u32 = 0x8128; 3599 | 3600 | pub const POINT_SIZE: u32 = 0x0B11; 3601 | 3602 | pub const POINT_SIZE_GRANULARITY: u32 = 0x0B13; 3603 | 3604 | pub const POINT_SIZE_RANGE: u32 = 0x0B12; 3605 | 3606 | pub const POINT_SPRITE_COORD_ORIGIN: u32 = 0x8CA0; 3607 | 3608 | pub const POLYGON_MODE: u32 = 0x0B40; 3609 | 3610 | pub const POLYGON_OFFSET_CLAMP: u32 = 0x8E1B; 3611 | 3612 | pub const POLYGON_OFFSET_FACTOR: u32 = 0x8038; 3613 | 3614 | pub const POLYGON_OFFSET_FILL: u32 = 0x8037; 3615 | 3616 | pub const POLYGON_OFFSET_LINE: u32 = 0x2A02; 3617 | 3618 | pub const POLYGON_OFFSET_POINT: u32 = 0x2A01; 3619 | 3620 | pub const POLYGON_OFFSET_UNITS: u32 = 0x2A00; 3621 | 3622 | pub const POLYGON_SMOOTH: u32 = 0x0B41; 3623 | 3624 | pub const POLYGON_SMOOTH_HINT: u32 = 0x0C53; 3625 | 3626 | pub const PRIMITIVES_GENERATED: u32 = 0x8C87; 3627 | 3628 | pub const PRIMITIVES_SUBMITTED: u32 = 0x82EF; 3629 | 3630 | pub const PRIMITIVE_RESTART: u32 = 0x8F9D; 3631 | 3632 | pub const PRIMITIVE_RESTART_FIXED_INDEX: u32 = 0x8D69; 3633 | 3634 | pub const PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED: u32 = 0x8221; 3635 | 3636 | pub const PRIMITIVE_RESTART_INDEX: u32 = 0x8F9E; 3637 | 3638 | pub const PROGRAM: u32 = 0x82E2; 3639 | 3640 | pub const PROGRAM_BINARY_FORMATS: u32 = 0x87FF; 3641 | 3642 | pub const PROGRAM_BINARY_LENGTH: u32 = 0x8741; 3643 | 3644 | pub const PROGRAM_BINARY_RETRIEVABLE_HINT: u32 = 0x8257; 3645 | 3646 | pub const PROGRAM_INPUT: u32 = 0x92E3; 3647 | 3648 | pub const PROGRAM_OUTPUT: u32 = 0x92E4; 3649 | 3650 | pub const PROGRAM_PIPELINE: u32 = 0x82E4; 3651 | 3652 | pub const PROGRAM_PIPELINE_BINDING: u32 = 0x825A; 3653 | 3654 | pub const PROGRAM_POINT_SIZE: u32 = 0x8642; 3655 | 3656 | pub const PROGRAM_SEPARABLE: u32 = 0x8258; 3657 | 3658 | pub const PROVOKING_VERTEX: u32 = 0x8E4F; 3659 | 3660 | pub const PROXY_TEXTURE_1D: u32 = 0x8063; 3661 | 3662 | pub const PROXY_TEXTURE_1D_ARRAY: u32 = 0x8C19; 3663 | 3664 | pub const PROXY_TEXTURE_2D: u32 = 0x8064; 3665 | 3666 | pub const PROXY_TEXTURE_2D_ARRAY: u32 = 0x8C1B; 3667 | 3668 | pub const PROXY_TEXTURE_2D_MULTISAMPLE: u32 = 0x9101; 3669 | 3670 | pub const PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY: u32 = 0x9103; 3671 | 3672 | pub const PROXY_TEXTURE_3D: u32 = 0x8070; 3673 | 3674 | pub const PROXY_TEXTURE_CUBE_MAP: u32 = 0x851B; 3675 | 3676 | pub const PROXY_TEXTURE_CUBE_MAP_ARRAY: u32 = 0x900B; 3677 | 3678 | pub const PROXY_TEXTURE_RECTANGLE: u32 = 0x84F7; 3679 | 3680 | pub const QUADS: u32 = 0x0007; 3681 | 3682 | pub const QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION: u32 = 0x8E4C; 3683 | 3684 | pub const QUERY: u32 = 0x82E3; 3685 | 3686 | pub const QUERY_BUFFER: u32 = 0x9192; 3687 | 3688 | pub const QUERY_BUFFER_BARRIER_BIT: u32 = 0x00008000; 3689 | 3690 | pub const QUERY_BUFFER_BINDING: u32 = 0x9193; 3691 | 3692 | pub const QUERY_BY_REGION_NO_WAIT: u32 = 0x8E16; 3693 | 3694 | pub const QUERY_BY_REGION_NO_WAIT_INVERTED: u32 = 0x8E1A; 3695 | 3696 | pub const QUERY_BY_REGION_WAIT: u32 = 0x8E15; 3697 | 3698 | pub const QUERY_BY_REGION_WAIT_INVERTED: u32 = 0x8E19; 3699 | 3700 | pub const QUERY_COUNTER_BITS: u32 = 0x8864; 3701 | 3702 | pub const QUERY_NO_WAIT: u32 = 0x8E14; 3703 | 3704 | pub const QUERY_NO_WAIT_INVERTED: u32 = 0x8E18; 3705 | 3706 | pub const QUERY_RESULT: u32 = 0x8866; 3707 | 3708 | pub const QUERY_RESULT_AVAILABLE: u32 = 0x8867; 3709 | 3710 | pub const QUERY_RESULT_NO_WAIT: u32 = 0x9194; 3711 | 3712 | pub const QUERY_TARGET: u32 = 0x82EA; 3713 | 3714 | pub const QUERY_WAIT: u32 = 0x8E13; 3715 | 3716 | pub const QUERY_WAIT_INVERTED: u32 = 0x8E17; 3717 | 3718 | pub const R11F_G11F_B10F: u32 = 0x8C3A; 3719 | 3720 | pub const R16: u32 = 0x822A; 3721 | 3722 | pub const R16F: u32 = 0x822D; 3723 | 3724 | pub const R16I: u32 = 0x8233; 3725 | 3726 | pub const R16UI: u32 = 0x8234; 3727 | 3728 | pub const R16_SNORM: u32 = 0x8F98; 3729 | 3730 | pub const R32F: u32 = 0x822E; 3731 | 3732 | pub const R32I: u32 = 0x8235; 3733 | 3734 | pub const R32UI: u32 = 0x8236; 3735 | 3736 | pub const R3_G3_B2: u32 = 0x2A10; 3737 | 3738 | pub const R8: u32 = 0x8229; 3739 | 3740 | pub const R8I: u32 = 0x8231; 3741 | 3742 | pub const R8UI: u32 = 0x8232; 3743 | 3744 | pub const R8_SNORM: u32 = 0x8F94; 3745 | 3746 | pub const RASTERIZER_DISCARD: u32 = 0x8C89; 3747 | 3748 | pub const READ_BUFFER: u32 = 0x0C02; 3749 | 3750 | pub const READ_FRAMEBUFFER: u32 = 0x8CA8; 3751 | 3752 | pub const READ_FRAMEBUFFER_BINDING: u32 = 0x8CAA; 3753 | 3754 | pub const READ_ONLY: u32 = 0x88B8; 3755 | 3756 | pub const READ_PIXELS: u32 = 0x828C; 3757 | 3758 | pub const READ_PIXELS_FORMAT: u32 = 0x828D; 3759 | 3760 | pub const READ_PIXELS_TYPE: u32 = 0x828E; 3761 | 3762 | pub const READ_WRITE: u32 = 0x88BA; 3763 | 3764 | pub const RED: u32 = 0x1903; 3765 | 3766 | pub const RED_BITS: u32 = 0x0D52; 3767 | 3768 | pub const RED_INTEGER: u32 = 0x8D94; 3769 | 3770 | pub const REFERENCED_BY_COMPUTE_SHADER: u32 = 0x930B; 3771 | 3772 | pub const REFERENCED_BY_FRAGMENT_SHADER: u32 = 0x930A; 3773 | 3774 | pub const REFERENCED_BY_GEOMETRY_SHADER: u32 = 0x9309; 3775 | 3776 | pub const REFERENCED_BY_TESS_CONTROL_SHADER: u32 = 0x9307; 3777 | 3778 | pub const REFERENCED_BY_TESS_EVALUATION_SHADER: u32 = 0x9308; 3779 | 3780 | pub const REFERENCED_BY_VERTEX_SHADER: u32 = 0x9306; 3781 | 3782 | pub const RENDERBUFFER: u32 = 0x8D41; 3783 | 3784 | pub const RENDERBUFFER_ALPHA_SIZE: u32 = 0x8D53; 3785 | 3786 | pub const RENDERBUFFER_BINDING: u32 = 0x8CA7; 3787 | 3788 | pub const RENDERBUFFER_BLUE_SIZE: u32 = 0x8D52; 3789 | 3790 | pub const RENDERBUFFER_DEPTH_SIZE: u32 = 0x8D54; 3791 | 3792 | pub const RENDERBUFFER_GREEN_SIZE: u32 = 0x8D51; 3793 | 3794 | pub const RENDERBUFFER_HEIGHT: u32 = 0x8D43; 3795 | 3796 | pub const RENDERBUFFER_INTERNAL_FORMAT: u32 = 0x8D44; 3797 | 3798 | pub const RENDERBUFFER_RED_SIZE: u32 = 0x8D50; 3799 | 3800 | pub const RENDERBUFFER_SAMPLES: u32 = 0x8CAB; 3801 | 3802 | pub const RENDERBUFFER_STENCIL_SIZE: u32 = 0x8D55; 3803 | 3804 | pub const RENDERBUFFER_WIDTH: u32 = 0x8D42; 3805 | 3806 | pub const RENDERER: u32 = 0x1F01; 3807 | 3808 | pub const REPEAT: u32 = 0x2901; 3809 | 3810 | pub const REPLACE: u32 = 0x1E01; 3811 | 3812 | pub const RESET_NOTIFICATION_STRATEGY: u32 = 0x8256; 3813 | 3814 | pub const RG: u32 = 0x8227; 3815 | 3816 | pub const RG16: u32 = 0x822C; 3817 | 3818 | pub const RG16F: u32 = 0x822F; 3819 | 3820 | pub const RG16I: u32 = 0x8239; 3821 | 3822 | pub const RG16UI: u32 = 0x823A; 3823 | 3824 | pub const RG16_SNORM: u32 = 0x8F99; 3825 | 3826 | pub const RG32F: u32 = 0x8230; 3827 | 3828 | pub const RG32I: u32 = 0x823B; 3829 | 3830 | pub const RG32UI: u32 = 0x823C; 3831 | 3832 | pub const RG8: u32 = 0x822B; 3833 | 3834 | pub const RG8I: u32 = 0x8237; 3835 | 3836 | pub const RG8UI: u32 = 0x8238; 3837 | 3838 | pub const RG8_SNORM: u32 = 0x8F95; 3839 | 3840 | pub const RGB: u32 = 0x1907; 3841 | 3842 | pub const RGB10: u32 = 0x8052; 3843 | 3844 | pub const RGB10_A2: u32 = 0x8059; 3845 | 3846 | pub const RGB10_A2UI: u32 = 0x906F; 3847 | 3848 | pub const RGB12: u32 = 0x8053; 3849 | 3850 | pub const RGB16: u32 = 0x8054; 3851 | 3852 | pub const RGB16F: u32 = 0x881B; 3853 | 3854 | pub const RGB16I: u32 = 0x8D89; 3855 | 3856 | pub const RGB16UI: u32 = 0x8D77; 3857 | 3858 | pub const RGB16_SNORM: u32 = 0x8F9A; 3859 | 3860 | pub const RGB32F: u32 = 0x8815; 3861 | 3862 | pub const RGB32I: u32 = 0x8D83; 3863 | 3864 | pub const RGB32UI: u32 = 0x8D71; 3865 | 3866 | pub const RGB4: u32 = 0x804F; 3867 | 3868 | pub const RGB5: u32 = 0x8050; 3869 | 3870 | pub const RGB565: u32 = 0x8D62; 3871 | 3872 | pub const RGB5_A1: u32 = 0x8057; 3873 | 3874 | pub const RGB8: u32 = 0x8051; 3875 | 3876 | pub const RGB8I: u32 = 0x8D8F; 3877 | 3878 | pub const RGB8UI: u32 = 0x8D7D; 3879 | 3880 | pub const RGB8_SNORM: u32 = 0x8F96; 3881 | 3882 | pub const RGB9_E5: u32 = 0x8C3D; 3883 | 3884 | pub const RGBA: u32 = 0x1908; 3885 | 3886 | pub const RGBA12: u32 = 0x805A; 3887 | 3888 | pub const RGBA16: u32 = 0x805B; 3889 | 3890 | pub const RGBA16F: u32 = 0x881A; 3891 | 3892 | pub const RGBA16I: u32 = 0x8D88; 3893 | 3894 | pub const RGBA16UI: u32 = 0x8D76; 3895 | 3896 | pub const RGBA16_SNORM: u32 = 0x8F9B; 3897 | 3898 | pub const RGBA2: u32 = 0x8055; 3899 | 3900 | pub const RGBA32F: u32 = 0x8814; 3901 | 3902 | pub const RGBA32I: u32 = 0x8D82; 3903 | 3904 | pub const RGBA32UI: u32 = 0x8D70; 3905 | 3906 | pub const RGBA4: u32 = 0x8056; 3907 | 3908 | pub const RGBA8: u32 = 0x8058; 3909 | 3910 | pub const RGBA8I: u32 = 0x8D8E; 3911 | 3912 | pub const RGBA8UI: u32 = 0x8D7C; 3913 | 3914 | pub const RGBA8_SNORM: u32 = 0x8F97; 3915 | 3916 | pub const RGBA_INTEGER: u32 = 0x8D99; 3917 | 3918 | pub const RGB_INTEGER: u32 = 0x8D98; 3919 | 3920 | pub const RG_INTEGER: u32 = 0x8228; 3921 | 3922 | pub const RIGHT: u32 = 0x0407; 3923 | 3924 | pub const SAMPLER: u32 = 0x82E6; 3925 | 3926 | pub const SAMPLER_1D: u32 = 0x8B5D; 3927 | 3928 | pub const SAMPLER_1D_ARRAY: u32 = 0x8DC0; 3929 | 3930 | pub const SAMPLER_1D_ARRAY_SHADOW: u32 = 0x8DC3; 3931 | 3932 | pub const SAMPLER_1D_SHADOW: u32 = 0x8B61; 3933 | 3934 | pub const SAMPLER_2D: u32 = 0x8B5E; 3935 | 3936 | pub const SAMPLER_2D_ARRAY: u32 = 0x8DC1; 3937 | 3938 | pub const SAMPLER_2D_ARRAY_SHADOW: u32 = 0x8DC4; 3939 | 3940 | pub const SAMPLER_2D_MULTISAMPLE: u32 = 0x9108; 3941 | 3942 | pub const SAMPLER_2D_MULTISAMPLE_ARRAY: u32 = 0x910B; 3943 | 3944 | pub const SAMPLER_2D_RECT: u32 = 0x8B63; 3945 | 3946 | pub const SAMPLER_2D_RECT_SHADOW: u32 = 0x8B64; 3947 | 3948 | pub const SAMPLER_2D_SHADOW: u32 = 0x8B62; 3949 | 3950 | pub const SAMPLER_3D: u32 = 0x8B5F; 3951 | 3952 | pub const SAMPLER_BINDING: u32 = 0x8919; 3953 | 3954 | pub const SAMPLER_BUFFER: u32 = 0x8DC2; 3955 | 3956 | pub const SAMPLER_CUBE: u32 = 0x8B60; 3957 | 3958 | pub const SAMPLER_CUBE_MAP_ARRAY: u32 = 0x900C; 3959 | 3960 | pub const SAMPLER_CUBE_MAP_ARRAY_SHADOW: u32 = 0x900D; 3961 | 3962 | pub const SAMPLER_CUBE_SHADOW: u32 = 0x8DC5; 3963 | 3964 | pub const SAMPLES: u32 = 0x80A9; 3965 | 3966 | pub const SAMPLES_PASSED: u32 = 0x8914; 3967 | 3968 | pub const SAMPLE_ALPHA_TO_COVERAGE: u32 = 0x809E; 3969 | 3970 | pub const SAMPLE_ALPHA_TO_ONE: u32 = 0x809F; 3971 | 3972 | pub const SAMPLE_BUFFERS: u32 = 0x80A8; 3973 | 3974 | pub const SAMPLE_COVERAGE: u32 = 0x80A0; 3975 | 3976 | pub const SAMPLE_COVERAGE_INVERT: u32 = 0x80AB; 3977 | 3978 | pub const SAMPLE_COVERAGE_VALUE: u32 = 0x80AA; 3979 | 3980 | pub const SAMPLE_MASK: u32 = 0x8E51; 3981 | 3982 | pub const SAMPLE_MASK_VALUE: u32 = 0x8E52; 3983 | 3984 | pub const SAMPLE_POSITION: u32 = 0x8E50; 3985 | 3986 | pub const SAMPLE_SHADING: u32 = 0x8C36; 3987 | 3988 | pub const SCISSOR_BOX: u32 = 0x0C10; 3989 | 3990 | pub const SCISSOR_TEST: u32 = 0x0C11; 3991 | 3992 | pub const SEPARATE_ATTRIBS: u32 = 0x8C8D; 3993 | 3994 | pub const SET: u32 = 0x150F; 3995 | 3996 | pub const SHADER: u32 = 0x82E1; 3997 | 3998 | pub const SHADER_BINARY_FORMATS: u32 = 0x8DF8; 3999 | 4000 | pub const SHADER_BINARY_FORMAT_SPIR_V: u32 = 0x9551; 4001 | 4002 | pub const SHADER_COMPILER: u32 = 0x8DFA; 4003 | 4004 | pub const SHADER_IMAGE_ACCESS_BARRIER_BIT: u32 = 0x00000020; 4005 | 4006 | pub const SHADER_IMAGE_ATOMIC: u32 = 0x82A6; 4007 | 4008 | pub const SHADER_IMAGE_LOAD: u32 = 0x82A4; 4009 | 4010 | pub const SHADER_IMAGE_STORE: u32 = 0x82A5; 4011 | 4012 | pub const SHADER_SOURCE_LENGTH: u32 = 0x8B88; 4013 | 4014 | pub const SHADER_STORAGE_BARRIER_BIT: u32 = 0x00002000; 4015 | 4016 | pub const SHADER_STORAGE_BLOCK: u32 = 0x92E6; 4017 | 4018 | pub const SHADER_STORAGE_BUFFER: u32 = 0x90D2; 4019 | 4020 | pub const SHADER_STORAGE_BUFFER_BINDING: u32 = 0x90D3; 4021 | 4022 | pub const SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT: u32 = 0x90DF; 4023 | 4024 | pub const SHADER_STORAGE_BUFFER_SIZE: u32 = 0x90D5; 4025 | 4026 | pub const SHADER_STORAGE_BUFFER_START: u32 = 0x90D4; 4027 | 4028 | pub const SHADER_TYPE: u32 = 0x8B4F; 4029 | 4030 | pub const SHADING_LANGUAGE_VERSION: u32 = 0x8B8C; 4031 | 4032 | pub const SHORT: u32 = 0x1402; 4033 | 4034 | pub const SIGNALED: u32 = 0x9119; 4035 | 4036 | pub const SIGNED_NORMALIZED: u32 = 0x8F9C; 4037 | 4038 | pub const SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST: u32 = 0x82AC; 4039 | 4040 | pub const SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE: u32 = 0x82AE; 4041 | 4042 | pub const SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST: u32 = 0x82AD; 4043 | 4044 | pub const SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE: u32 = 0x82AF; 4045 | 4046 | pub const SMOOTH_LINE_WIDTH_GRANULARITY: u32 = 0x0B23; 4047 | 4048 | pub const SMOOTH_LINE_WIDTH_RANGE: u32 = 0x0B22; 4049 | 4050 | pub const SMOOTH_POINT_SIZE_GRANULARITY: u32 = 0x0B13; 4051 | 4052 | pub const SMOOTH_POINT_SIZE_RANGE: u32 = 0x0B12; 4053 | 4054 | pub const SPIR_V_BINARY: u32 = 0x9552; 4055 | 4056 | pub const SPIR_V_EXTENSIONS: u32 = 0x9553; 4057 | 4058 | pub const SRC1_ALPHA: u32 = 0x8589; 4059 | 4060 | pub const SRC1_COLOR: u32 = 0x88F9; 4061 | 4062 | pub const SRC_ALPHA: u32 = 0x0302; 4063 | 4064 | pub const SRC_ALPHA_SATURATE: u32 = 0x0308; 4065 | 4066 | pub const SRC_COLOR: u32 = 0x0300; 4067 | 4068 | pub const SRGB: u32 = 0x8C40; 4069 | 4070 | pub const SRGB8: u32 = 0x8C41; 4071 | 4072 | pub const SRGB8_ALPHA8: u32 = 0x8C43; 4073 | 4074 | pub const SRGB_ALPHA: u32 = 0x8C42; 4075 | 4076 | pub const SRGB_READ: u32 = 0x8297; 4077 | 4078 | pub const SRGB_WRITE: u32 = 0x8298; 4079 | 4080 | pub const STACK_OVERFLOW: u32 = 0x0503; 4081 | 4082 | pub const STACK_UNDERFLOW: u32 = 0x0504; 4083 | 4084 | pub const STATIC_COPY: u32 = 0x88E6; 4085 | 4086 | pub const STATIC_DRAW: u32 = 0x88E4; 4087 | 4088 | pub const STATIC_READ: u32 = 0x88E5; 4089 | 4090 | pub const STENCIL: u32 = 0x1802; 4091 | 4092 | pub const STENCIL_ATTACHMENT: u32 = 0x8D20; 4093 | 4094 | pub const STENCIL_BACK_FAIL: u32 = 0x8801; 4095 | 4096 | pub const STENCIL_BACK_FUNC: u32 = 0x8800; 4097 | 4098 | pub const STENCIL_BACK_PASS_DEPTH_FAIL: u32 = 0x8802; 4099 | 4100 | pub const STENCIL_BACK_PASS_DEPTH_PASS: u32 = 0x8803; 4101 | 4102 | pub const STENCIL_BACK_REF: u32 = 0x8CA3; 4103 | 4104 | pub const STENCIL_BACK_VALUE_MASK: u32 = 0x8CA4; 4105 | 4106 | pub const STENCIL_BACK_WRITEMASK: u32 = 0x8CA5; 4107 | 4108 | pub const STENCIL_BITS: u32 = 0x0D57; 4109 | 4110 | pub const STENCIL_BUFFER_BIT: u32 = 0x00000400; 4111 | 4112 | pub const STENCIL_CLEAR_VALUE: u32 = 0x0B91; 4113 | 4114 | pub const STENCIL_COMPONENTS: u32 = 0x8285; 4115 | 4116 | pub const STENCIL_FAIL: u32 = 0x0B94; 4117 | 4118 | pub const STENCIL_FUNC: u32 = 0x0B92; 4119 | 4120 | pub const STENCIL_INDEX: u32 = 0x1901; 4121 | 4122 | pub const STENCIL_INDEX1: u32 = 0x8D46; 4123 | 4124 | pub const STENCIL_INDEX16: u32 = 0x8D49; 4125 | 4126 | pub const STENCIL_INDEX4: u32 = 0x8D47; 4127 | 4128 | pub const STENCIL_INDEX8: u32 = 0x8D48; 4129 | 4130 | pub const STENCIL_PASS_DEPTH_FAIL: u32 = 0x0B95; 4131 | 4132 | pub const STENCIL_PASS_DEPTH_PASS: u32 = 0x0B96; 4133 | 4134 | pub const STENCIL_REF: u32 = 0x0B97; 4135 | 4136 | pub const STENCIL_RENDERABLE: u32 = 0x8288; 4137 | 4138 | pub const STENCIL_TEST: u32 = 0x0B90; 4139 | 4140 | pub const STENCIL_VALUE_MASK: u32 = 0x0B93; 4141 | 4142 | pub const STENCIL_WRITEMASK: u32 = 0x0B98; 4143 | 4144 | pub const STEREO: u32 = 0x0C33; 4145 | 4146 | pub const STREAM_COPY: u32 = 0x88E2; 4147 | 4148 | pub const STREAM_DRAW: u32 = 0x88E0; 4149 | 4150 | pub const STREAM_READ: u32 = 0x88E1; 4151 | 4152 | pub const SUBPIXEL_BITS: u32 = 0x0D50; 4153 | 4154 | pub const SYNC_CONDITION: u32 = 0x9113; 4155 | 4156 | pub const SYNC_FENCE: u32 = 0x9116; 4157 | 4158 | pub const SYNC_FLAGS: u32 = 0x9115; 4159 | 4160 | pub const SYNC_FLUSH_COMMANDS_BIT: u32 = 0x00000001; 4161 | 4162 | pub const SYNC_GPU_COMMANDS_COMPLETE: u32 = 0x9117; 4163 | 4164 | pub const SYNC_STATUS: u32 = 0x9114; 4165 | 4166 | pub const TESS_CONTROL_OUTPUT_VERTICES: u32 = 0x8E75; 4167 | 4168 | pub const TESS_CONTROL_SHADER: u32 = 0x8E88; 4169 | 4170 | pub const TESS_CONTROL_SHADER_BIT: u32 = 0x00000008; 4171 | 4172 | pub const TESS_CONTROL_SHADER_PATCHES: u32 = 0x82F1; 4173 | 4174 | pub const TESS_CONTROL_SUBROUTINE: u32 = 0x92E9; 4175 | 4176 | pub const TESS_CONTROL_SUBROUTINE_UNIFORM: u32 = 0x92EF; 4177 | 4178 | pub const TESS_CONTROL_TEXTURE: u32 = 0x829C; 4179 | 4180 | pub const TESS_EVALUATION_SHADER: u32 = 0x8E87; 4181 | 4182 | pub const TESS_EVALUATION_SHADER_BIT: u32 = 0x00000010; 4183 | 4184 | pub const TESS_EVALUATION_SHADER_INVOCATIONS: u32 = 0x82F2; 4185 | 4186 | pub const TESS_EVALUATION_SUBROUTINE: u32 = 0x92EA; 4187 | 4188 | pub const TESS_EVALUATION_SUBROUTINE_UNIFORM: u32 = 0x92F0; 4189 | 4190 | pub const TESS_EVALUATION_TEXTURE: u32 = 0x829D; 4191 | 4192 | pub const TESS_GEN_MODE: u32 = 0x8E76; 4193 | 4194 | pub const TESS_GEN_POINT_MODE: u32 = 0x8E79; 4195 | 4196 | pub const TESS_GEN_SPACING: u32 = 0x8E77; 4197 | 4198 | pub const TESS_GEN_VERTEX_ORDER: u32 = 0x8E78; 4199 | 4200 | pub const TEXTURE: u32 = 0x1702; 4201 | 4202 | pub const TEXTURE0: u32 = 0x84C0; 4203 | 4204 | pub const TEXTURE1: u32 = 0x84C1; 4205 | 4206 | pub const TEXTURE10: u32 = 0x84CA; 4207 | 4208 | pub const TEXTURE11: u32 = 0x84CB; 4209 | 4210 | pub const TEXTURE12: u32 = 0x84CC; 4211 | 4212 | pub const TEXTURE13: u32 = 0x84CD; 4213 | 4214 | pub const TEXTURE14: u32 = 0x84CE; 4215 | 4216 | pub const TEXTURE15: u32 = 0x84CF; 4217 | 4218 | pub const TEXTURE16: u32 = 0x84D0; 4219 | 4220 | pub const TEXTURE17: u32 = 0x84D1; 4221 | 4222 | pub const TEXTURE18: u32 = 0x84D2; 4223 | 4224 | pub const TEXTURE19: u32 = 0x84D3; 4225 | 4226 | pub const TEXTURE2: u32 = 0x84C2; 4227 | 4228 | pub const TEXTURE20: u32 = 0x84D4; 4229 | 4230 | pub const TEXTURE21: u32 = 0x84D5; 4231 | 4232 | pub const TEXTURE22: u32 = 0x84D6; 4233 | 4234 | pub const TEXTURE23: u32 = 0x84D7; 4235 | 4236 | pub const TEXTURE24: u32 = 0x84D8; 4237 | 4238 | pub const TEXTURE25: u32 = 0x84D9; 4239 | 4240 | pub const TEXTURE26: u32 = 0x84DA; 4241 | 4242 | pub const TEXTURE27: u32 = 0x84DB; 4243 | 4244 | pub const TEXTURE28: u32 = 0x84DC; 4245 | 4246 | pub const TEXTURE29: u32 = 0x84DD; 4247 | 4248 | pub const TEXTURE3: u32 = 0x84C3; 4249 | 4250 | pub const TEXTURE30: u32 = 0x84DE; 4251 | 4252 | pub const TEXTURE31: u32 = 0x84DF; 4253 | 4254 | pub const TEXTURE4: u32 = 0x84C4; 4255 | 4256 | pub const TEXTURE5: u32 = 0x84C5; 4257 | 4258 | pub const TEXTURE6: u32 = 0x84C6; 4259 | 4260 | pub const TEXTURE7: u32 = 0x84C7; 4261 | 4262 | pub const TEXTURE8: u32 = 0x84C8; 4263 | 4264 | pub const TEXTURE9: u32 = 0x84C9; 4265 | 4266 | pub const TEXTURE_1D: u32 = 0x0DE0; 4267 | 4268 | pub const TEXTURE_1D_ARRAY: u32 = 0x8C18; 4269 | 4270 | pub const TEXTURE_2D: u32 = 0x0DE1; 4271 | 4272 | pub const TEXTURE_2D_ARRAY: u32 = 0x8C1A; 4273 | 4274 | pub const TEXTURE_2D_MULTISAMPLE: u32 = 0x9100; 4275 | 4276 | pub const TEXTURE_2D_MULTISAMPLE_ARRAY: u32 = 0x9102; 4277 | 4278 | pub const TEXTURE_3D: u32 = 0x806F; 4279 | 4280 | pub const TEXTURE_ALPHA_SIZE: u32 = 0x805F; 4281 | 4282 | pub const TEXTURE_ALPHA_TYPE: u32 = 0x8C13; 4283 | 4284 | pub const TEXTURE_BASE_LEVEL: u32 = 0x813C; 4285 | 4286 | pub const TEXTURE_BINDING_1D: u32 = 0x8068; 4287 | 4288 | pub const TEXTURE_BINDING_1D_ARRAY: u32 = 0x8C1C; 4289 | 4290 | pub const TEXTURE_BINDING_2D: u32 = 0x8069; 4291 | 4292 | pub const TEXTURE_BINDING_2D_ARRAY: u32 = 0x8C1D; 4293 | 4294 | pub const TEXTURE_BINDING_2D_MULTISAMPLE: u32 = 0x9104; 4295 | 4296 | pub const TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY: u32 = 0x9105; 4297 | 4298 | pub const TEXTURE_BINDING_3D: u32 = 0x806A; 4299 | 4300 | pub const TEXTURE_BINDING_BUFFER: u32 = 0x8C2C; 4301 | 4302 | pub const TEXTURE_BINDING_CUBE_MAP: u32 = 0x8514; 4303 | 4304 | pub const TEXTURE_BINDING_CUBE_MAP_ARRAY: u32 = 0x900A; 4305 | 4306 | pub const TEXTURE_BINDING_RECTANGLE: u32 = 0x84F6; 4307 | 4308 | pub const TEXTURE_BLUE_SIZE: u32 = 0x805E; 4309 | 4310 | pub const TEXTURE_BLUE_TYPE: u32 = 0x8C12; 4311 | 4312 | pub const TEXTURE_BORDER_COLOR: u32 = 0x1004; 4313 | 4314 | pub const TEXTURE_BUFFER: u32 = 0x8C2A; 4315 | 4316 | pub const TEXTURE_BUFFER_BINDING: u32 = 0x8C2A; 4317 | 4318 | pub const TEXTURE_BUFFER_DATA_STORE_BINDING: u32 = 0x8C2D; 4319 | 4320 | pub const TEXTURE_BUFFER_OFFSET: u32 = 0x919D; 4321 | 4322 | pub const TEXTURE_BUFFER_OFFSET_ALIGNMENT: u32 = 0x919F; 4323 | 4324 | pub const TEXTURE_BUFFER_SIZE: u32 = 0x919E; 4325 | 4326 | pub const TEXTURE_COMPARE_FUNC: u32 = 0x884D; 4327 | 4328 | pub const TEXTURE_COMPARE_MODE: u32 = 0x884C; 4329 | 4330 | pub const TEXTURE_COMPRESSED: u32 = 0x86A1; 4331 | 4332 | pub const TEXTURE_COMPRESSED_BLOCK_HEIGHT: u32 = 0x82B2; 4333 | 4334 | pub const TEXTURE_COMPRESSED_BLOCK_SIZE: u32 = 0x82B3; 4335 | 4336 | pub const TEXTURE_COMPRESSED_BLOCK_WIDTH: u32 = 0x82B1; 4337 | 4338 | pub const TEXTURE_COMPRESSED_IMAGE_SIZE: u32 = 0x86A0; 4339 | 4340 | pub const TEXTURE_COMPRESSION_HINT: u32 = 0x84EF; 4341 | 4342 | pub const TEXTURE_CUBE_MAP: u32 = 0x8513; 4343 | 4344 | pub const TEXTURE_CUBE_MAP_ARRAY: u32 = 0x9009; 4345 | 4346 | pub const TEXTURE_CUBE_MAP_NEGATIVE_X: u32 = 0x8516; 4347 | 4348 | pub const TEXTURE_CUBE_MAP_NEGATIVE_Y: u32 = 0x8518; 4349 | 4350 | pub const TEXTURE_CUBE_MAP_NEGATIVE_Z: u32 = 0x851A; 4351 | 4352 | pub const TEXTURE_CUBE_MAP_POSITIVE_X: u32 = 0x8515; 4353 | 4354 | pub const TEXTURE_CUBE_MAP_POSITIVE_Y: u32 = 0x8517; 4355 | 4356 | pub const TEXTURE_CUBE_MAP_POSITIVE_Z: u32 = 0x8519; 4357 | 4358 | pub const TEXTURE_CUBE_MAP_SEAMLESS: u32 = 0x884F; 4359 | 4360 | pub const TEXTURE_DEPTH: u32 = 0x8071; 4361 | 4362 | pub const TEXTURE_DEPTH_SIZE: u32 = 0x884A; 4363 | 4364 | pub const TEXTURE_DEPTH_TYPE: u32 = 0x8C16; 4365 | 4366 | pub const TEXTURE_FETCH_BARRIER_BIT: u32 = 0x00000008; 4367 | 4368 | pub const TEXTURE_FIXED_SAMPLE_LOCATIONS: u32 = 0x9107; 4369 | 4370 | pub const TEXTURE_GATHER: u32 = 0x82A2; 4371 | 4372 | pub const TEXTURE_GATHER_SHADOW: u32 = 0x82A3; 4373 | 4374 | pub const TEXTURE_GREEN_SIZE: u32 = 0x805D; 4375 | 4376 | pub const TEXTURE_GREEN_TYPE: u32 = 0x8C11; 4377 | 4378 | pub const TEXTURE_HEIGHT: u32 = 0x1001; 4379 | 4380 | pub const TEXTURE_IMAGE_FORMAT: u32 = 0x828F; 4381 | 4382 | pub const TEXTURE_IMAGE_TYPE: u32 = 0x8290; 4383 | 4384 | pub const TEXTURE_IMMUTABLE_FORMAT: u32 = 0x912F; 4385 | 4386 | pub const TEXTURE_IMMUTABLE_LEVELS: u32 = 0x82DF; 4387 | 4388 | pub const TEXTURE_INTERNAL_FORMAT: u32 = 0x1003; 4389 | 4390 | pub const TEXTURE_LOD_BIAS: u32 = 0x8501; 4391 | 4392 | pub const TEXTURE_MAG_FILTER: u32 = 0x2800; 4393 | 4394 | pub const TEXTURE_MAX_ANISOTROPY: u32 = 0x84FE; 4395 | 4396 | pub const TEXTURE_MAX_ANISOTROPY_EXT: u32 = 0x84FE; 4397 | 4398 | pub const TEXTURE_MAX_LEVEL: u32 = 0x813D; 4399 | 4400 | pub const TEXTURE_MAX_LOD: u32 = 0x813B; 4401 | 4402 | pub const TEXTURE_MIN_FILTER: u32 = 0x2801; 4403 | 4404 | pub const TEXTURE_MIN_LOD: u32 = 0x813A; 4405 | 4406 | pub const TEXTURE_RECTANGLE: u32 = 0x84F5; 4407 | 4408 | pub const TEXTURE_RED_SIZE: u32 = 0x805C; 4409 | 4410 | pub const TEXTURE_RED_TYPE: u32 = 0x8C10; 4411 | 4412 | pub const TEXTURE_SAMPLES: u32 = 0x9106; 4413 | 4414 | pub const TEXTURE_SHADOW: u32 = 0x82A1; 4415 | 4416 | pub const TEXTURE_SHARED_SIZE: u32 = 0x8C3F; 4417 | 4418 | pub const TEXTURE_STENCIL_SIZE: u32 = 0x88F1; 4419 | 4420 | pub const TEXTURE_SWIZZLE_A: u32 = 0x8E45; 4421 | 4422 | pub const TEXTURE_SWIZZLE_B: u32 = 0x8E44; 4423 | 4424 | pub const TEXTURE_SWIZZLE_G: u32 = 0x8E43; 4425 | 4426 | pub const TEXTURE_SWIZZLE_R: u32 = 0x8E42; 4427 | 4428 | pub const TEXTURE_SWIZZLE_RGBA: u32 = 0x8E46; 4429 | 4430 | pub const TEXTURE_TARGET: u32 = 0x1006; 4431 | 4432 | pub const TEXTURE_UPDATE_BARRIER_BIT: u32 = 0x00000100; 4433 | 4434 | pub const TEXTURE_VIEW: u32 = 0x82B5; 4435 | 4436 | pub const TEXTURE_VIEW_MIN_LAYER: u32 = 0x82DD; 4437 | 4438 | pub const TEXTURE_VIEW_MIN_LEVEL: u32 = 0x82DB; 4439 | 4440 | pub const TEXTURE_VIEW_NUM_LAYERS: u32 = 0x82DE; 4441 | 4442 | pub const TEXTURE_VIEW_NUM_LEVELS: u32 = 0x82DC; 4443 | 4444 | pub const TEXTURE_WIDTH: u32 = 0x1000; 4445 | 4446 | pub const TEXTURE_WRAP_R: u32 = 0x8072; 4447 | 4448 | pub const TEXTURE_WRAP_S: u32 = 0x2802; 4449 | 4450 | pub const TEXTURE_WRAP_T: u32 = 0x2803; 4451 | 4452 | pub const TIMEOUT_EXPIRED: u32 = 0x911B; 4453 | 4454 | pub const TIMEOUT_IGNORED: u64 = 0xFFFFFFFFFFFFFFFF; 4455 | 4456 | pub const TIMESTAMP: u32 = 0x8E28; 4457 | 4458 | pub const TIME_ELAPSED: u32 = 0x88BF; 4459 | 4460 | pub const TOP_LEVEL_ARRAY_SIZE: u32 = 0x930C; 4461 | 4462 | pub const TOP_LEVEL_ARRAY_STRIDE: u32 = 0x930D; 4463 | 4464 | pub const TRANSFORM_FEEDBACK: u32 = 0x8E22; 4465 | 4466 | pub const TRANSFORM_FEEDBACK_ACTIVE: u32 = 0x8E24; 4467 | 4468 | pub const TRANSFORM_FEEDBACK_BARRIER_BIT: u32 = 0x00000800; 4469 | 4470 | pub const TRANSFORM_FEEDBACK_BINDING: u32 = 0x8E25; 4471 | 4472 | pub const TRANSFORM_FEEDBACK_BUFFER: u32 = 0x8C8E; 4473 | 4474 | pub const TRANSFORM_FEEDBACK_BUFFER_ACTIVE: u32 = 0x8E24; 4475 | 4476 | pub const TRANSFORM_FEEDBACK_BUFFER_BINDING: u32 = 0x8C8F; 4477 | 4478 | pub const TRANSFORM_FEEDBACK_BUFFER_INDEX: u32 = 0x934B; 4479 | 4480 | pub const TRANSFORM_FEEDBACK_BUFFER_MODE: u32 = 0x8C7F; 4481 | 4482 | pub const TRANSFORM_FEEDBACK_BUFFER_PAUSED: u32 = 0x8E23; 4483 | 4484 | pub const TRANSFORM_FEEDBACK_BUFFER_SIZE: u32 = 0x8C85; 4485 | 4486 | pub const TRANSFORM_FEEDBACK_BUFFER_START: u32 = 0x8C84; 4487 | 4488 | pub const TRANSFORM_FEEDBACK_BUFFER_STRIDE: u32 = 0x934C; 4489 | 4490 | pub const TRANSFORM_FEEDBACK_OVERFLOW: u32 = 0x82EC; 4491 | 4492 | pub const TRANSFORM_FEEDBACK_PAUSED: u32 = 0x8E23; 4493 | 4494 | pub const TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: u32 = 0x8C88; 4495 | 4496 | pub const TRANSFORM_FEEDBACK_STREAM_OVERFLOW: u32 = 0x82ED; 4497 | 4498 | pub const TRANSFORM_FEEDBACK_VARYING: u32 = 0x92F4; 4499 | 4500 | pub const TRANSFORM_FEEDBACK_VARYINGS: u32 = 0x8C83; 4501 | 4502 | pub const TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH: u32 = 0x8C76; 4503 | 4504 | pub const TRIANGLES: u32 = 0x0004; 4505 | 4506 | pub const TRIANGLES_ADJACENCY: u32 = 0x000C; 4507 | 4508 | pub const TRIANGLE_FAN: u32 = 0x0006; 4509 | 4510 | pub const TRIANGLE_STRIP: u32 = 0x0005; 4511 | 4512 | pub const TRIANGLE_STRIP_ADJACENCY: u32 = 0x000D; 4513 | 4514 | pub const TRUE: u8 = 1; 4515 | 4516 | pub const TYPE: u32 = 0x92FA; 4517 | 4518 | pub const UNDEFINED_VERTEX: u32 = 0x8260; 4519 | 4520 | pub const UNIFORM: u32 = 0x92E1; 4521 | 4522 | pub const UNIFORM_ARRAY_STRIDE: u32 = 0x8A3C; 4523 | 4524 | pub const UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX: u32 = 0x92DA; 4525 | 4526 | pub const UNIFORM_BARRIER_BIT: u32 = 0x00000004; 4527 | 4528 | pub const UNIFORM_BLOCK: u32 = 0x92E2; 4529 | 4530 | pub const UNIFORM_BLOCK_ACTIVE_UNIFORMS: u32 = 0x8A42; 4531 | 4532 | pub const UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: u32 = 0x8A43; 4533 | 4534 | pub const UNIFORM_BLOCK_BINDING: u32 = 0x8A3F; 4535 | 4536 | pub const UNIFORM_BLOCK_DATA_SIZE: u32 = 0x8A40; 4537 | 4538 | pub const UNIFORM_BLOCK_INDEX: u32 = 0x8A3A; 4539 | 4540 | pub const UNIFORM_BLOCK_NAME_LENGTH: u32 = 0x8A41; 4541 | 4542 | pub const UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER: u32 = 0x90EC; 4543 | 4544 | pub const UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: u32 = 0x8A46; 4545 | 4546 | pub const UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER: u32 = 0x8A45; 4547 | 4548 | pub const UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER: u32 = 0x84F0; 4549 | 4550 | pub const UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER: u32 = 0x84F1; 4551 | 4552 | pub const UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: u32 = 0x8A44; 4553 | 4554 | pub const UNIFORM_BUFFER: u32 = 0x8A11; 4555 | 4556 | pub const UNIFORM_BUFFER_BINDING: u32 = 0x8A28; 4557 | 4558 | pub const UNIFORM_BUFFER_OFFSET_ALIGNMENT: u32 = 0x8A34; 4559 | 4560 | pub const UNIFORM_BUFFER_SIZE: u32 = 0x8A2A; 4561 | 4562 | pub const UNIFORM_BUFFER_START: u32 = 0x8A29; 4563 | 4564 | pub const UNIFORM_IS_ROW_MAJOR: u32 = 0x8A3E; 4565 | 4566 | pub const UNIFORM_MATRIX_STRIDE: u32 = 0x8A3D; 4567 | 4568 | pub const UNIFORM_NAME_LENGTH: u32 = 0x8A39; 4569 | 4570 | pub const UNIFORM_OFFSET: u32 = 0x8A3B; 4571 | 4572 | pub const UNIFORM_SIZE: u32 = 0x8A38; 4573 | 4574 | pub const UNIFORM_TYPE: u32 = 0x8A37; 4575 | 4576 | pub const UNKNOWN_CONTEXT_RESET: u32 = 0x8255; 4577 | 4578 | pub const UNPACK_ALIGNMENT: u32 = 0x0CF5; 4579 | 4580 | pub const UNPACK_COMPRESSED_BLOCK_DEPTH: u32 = 0x9129; 4581 | 4582 | pub const UNPACK_COMPRESSED_BLOCK_HEIGHT: u32 = 0x9128; 4583 | 4584 | pub const UNPACK_COMPRESSED_BLOCK_SIZE: u32 = 0x912A; 4585 | 4586 | pub const UNPACK_COMPRESSED_BLOCK_WIDTH: u32 = 0x9127; 4587 | 4588 | pub const UNPACK_IMAGE_HEIGHT: u32 = 0x806E; 4589 | 4590 | pub const UNPACK_LSB_FIRST: u32 = 0x0CF1; 4591 | 4592 | pub const UNPACK_ROW_LENGTH: u32 = 0x0CF2; 4593 | 4594 | pub const UNPACK_SKIP_IMAGES: u32 = 0x806D; 4595 | 4596 | pub const UNPACK_SKIP_PIXELS: u32 = 0x0CF4; 4597 | 4598 | pub const UNPACK_SKIP_ROWS: u32 = 0x0CF3; 4599 | 4600 | pub const UNPACK_SWAP_BYTES: u32 = 0x0CF0; 4601 | 4602 | pub const UNSIGNALED: u32 = 0x9118; 4603 | 4604 | pub const UNSIGNED_BYTE: u32 = 0x1401; 4605 | 4606 | pub const UNSIGNED_BYTE_2_3_3_REV: u32 = 0x8362; 4607 | 4608 | pub const UNSIGNED_BYTE_3_3_2: u32 = 0x8032; 4609 | 4610 | pub const UNSIGNED_INT: u32 = 0x1405; 4611 | 4612 | pub const UNSIGNED_INT_10F_11F_11F_REV: u32 = 0x8C3B; 4613 | 4614 | pub const UNSIGNED_INT_10_10_10_2: u32 = 0x8036; 4615 | 4616 | pub const UNSIGNED_INT_24_8: u32 = 0x84FA; 4617 | 4618 | pub const UNSIGNED_INT_2_10_10_10_REV: u32 = 0x8368; 4619 | 4620 | pub const UNSIGNED_INT_5_9_9_9_REV: u32 = 0x8C3E; 4621 | 4622 | pub const UNSIGNED_INT_8_8_8_8: u32 = 0x8035; 4623 | 4624 | pub const UNSIGNED_INT_8_8_8_8_REV: u32 = 0x8367; 4625 | 4626 | pub const UNSIGNED_INT_ATOMIC_COUNTER: u32 = 0x92DB; 4627 | 4628 | pub const UNSIGNED_INT_IMAGE_1D: u32 = 0x9062; 4629 | 4630 | pub const UNSIGNED_INT_IMAGE_1D_ARRAY: u32 = 0x9068; 4631 | 4632 | pub const UNSIGNED_INT_IMAGE_2D: u32 = 0x9063; 4633 | 4634 | pub const UNSIGNED_INT_IMAGE_2D_ARRAY: u32 = 0x9069; 4635 | 4636 | pub const UNSIGNED_INT_IMAGE_2D_MULTISAMPLE: u32 = 0x906B; 4637 | 4638 | pub const UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY: u32 = 0x906C; 4639 | 4640 | pub const UNSIGNED_INT_IMAGE_2D_RECT: u32 = 0x9065; 4641 | 4642 | pub const UNSIGNED_INT_IMAGE_3D: u32 = 0x9064; 4643 | 4644 | pub const UNSIGNED_INT_IMAGE_BUFFER: u32 = 0x9067; 4645 | 4646 | pub const UNSIGNED_INT_IMAGE_CUBE: u32 = 0x9066; 4647 | 4648 | pub const UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY: u32 = 0x906A; 4649 | 4650 | pub const UNSIGNED_INT_SAMPLER_1D: u32 = 0x8DD1; 4651 | 4652 | pub const UNSIGNED_INT_SAMPLER_1D_ARRAY: u32 = 0x8DD6; 4653 | 4654 | pub const UNSIGNED_INT_SAMPLER_2D: u32 = 0x8DD2; 4655 | 4656 | pub const UNSIGNED_INT_SAMPLER_2D_ARRAY: u32 = 0x8DD7; 4657 | 4658 | pub const UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE: u32 = 0x910A; 4659 | 4660 | pub const UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY: u32 = 0x910D; 4661 | 4662 | pub const UNSIGNED_INT_SAMPLER_2D_RECT: u32 = 0x8DD5; 4663 | 4664 | pub const UNSIGNED_INT_SAMPLER_3D: u32 = 0x8DD3; 4665 | 4666 | pub const UNSIGNED_INT_SAMPLER_BUFFER: u32 = 0x8DD8; 4667 | 4668 | pub const UNSIGNED_INT_SAMPLER_CUBE: u32 = 0x8DD4; 4669 | 4670 | pub const UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY: u32 = 0x900F; 4671 | 4672 | pub const UNSIGNED_INT_VEC2: u32 = 0x8DC6; 4673 | 4674 | pub const UNSIGNED_INT_VEC3: u32 = 0x8DC7; 4675 | 4676 | pub const UNSIGNED_INT_VEC4: u32 = 0x8DC8; 4677 | 4678 | pub const UNSIGNED_NORMALIZED: u32 = 0x8C17; 4679 | 4680 | pub const UNSIGNED_SHORT: u32 = 0x1403; 4681 | 4682 | pub const UNSIGNED_SHORT_1_5_5_5_REV: u32 = 0x8366; 4683 | 4684 | pub const UNSIGNED_SHORT_4_4_4_4: u32 = 0x8033; 4685 | 4686 | pub const UNSIGNED_SHORT_4_4_4_4_REV: u32 = 0x8365; 4687 | 4688 | pub const UNSIGNED_SHORT_5_5_5_1: u32 = 0x8034; 4689 | 4690 | pub const UNSIGNED_SHORT_5_6_5: u32 = 0x8363; 4691 | 4692 | pub const UNSIGNED_SHORT_5_6_5_REV: u32 = 0x8364; 4693 | 4694 | pub const UPPER_LEFT: u32 = 0x8CA2; 4695 | 4696 | pub const VALIDATE_STATUS: u32 = 0x8B83; 4697 | 4698 | pub const VENDOR: u32 = 0x1F00; 4699 | 4700 | pub const VERSION: u32 = 0x1F02; 4701 | 4702 | pub const VERTEX_ARRAY: u32 = 0x8074; 4703 | 4704 | pub const VERTEX_ARRAY_BINDING: u32 = 0x85B5; 4705 | 4706 | pub const VERTEX_ATTRIB_ARRAY_BARRIER_BIT: u32 = 0x00000001; 4707 | 4708 | pub const VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: u32 = 0x889F; 4709 | 4710 | pub const VERTEX_ATTRIB_ARRAY_DIVISOR: u32 = 0x88FE; 4711 | 4712 | pub const VERTEX_ATTRIB_ARRAY_ENABLED: u32 = 0x8622; 4713 | 4714 | pub const VERTEX_ATTRIB_ARRAY_INTEGER: u32 = 0x88FD; 4715 | 4716 | pub const VERTEX_ATTRIB_ARRAY_LONG: u32 = 0x874E; 4717 | 4718 | pub const VERTEX_ATTRIB_ARRAY_NORMALIZED: u32 = 0x886A; 4719 | 4720 | pub const VERTEX_ATTRIB_ARRAY_POINTER: u32 = 0x8645; 4721 | 4722 | pub const VERTEX_ATTRIB_ARRAY_SIZE: u32 = 0x8623; 4723 | 4724 | pub const VERTEX_ATTRIB_ARRAY_STRIDE: u32 = 0x8624; 4725 | 4726 | pub const VERTEX_ATTRIB_ARRAY_TYPE: u32 = 0x8625; 4727 | 4728 | pub const VERTEX_ATTRIB_BINDING: u32 = 0x82D4; 4729 | 4730 | pub const VERTEX_ATTRIB_RELATIVE_OFFSET: u32 = 0x82D5; 4731 | 4732 | pub const VERTEX_BINDING_BUFFER: u32 = 0x8F4F; 4733 | 4734 | pub const VERTEX_BINDING_DIVISOR: u32 = 0x82D6; 4735 | 4736 | pub const VERTEX_BINDING_OFFSET: u32 = 0x82D7; 4737 | 4738 | pub const VERTEX_BINDING_STRIDE: u32 = 0x82D8; 4739 | 4740 | pub const VERTEX_PROGRAM_POINT_SIZE: u32 = 0x8642; 4741 | 4742 | pub const VERTEX_SHADER: u32 = 0x8B31; 4743 | 4744 | pub const VERTEX_SHADER_BIT: u32 = 0x00000001; 4745 | 4746 | pub const VERTEX_SHADER_INVOCATIONS: u32 = 0x82F0; 4747 | 4748 | pub const VERTEX_SUBROUTINE: u32 = 0x92E8; 4749 | 4750 | pub const VERTEX_SUBROUTINE_UNIFORM: u32 = 0x92EE; 4751 | 4752 | pub const VERTEX_TEXTURE: u32 = 0x829B; 4753 | 4754 | pub const VERTICES_SUBMITTED: u32 = 0x82EE; 4755 | 4756 | pub const VIEWPORT: u32 = 0x0BA2; 4757 | 4758 | pub const VIEWPORT_BOUNDS_RANGE: u32 = 0x825D; 4759 | 4760 | pub const VIEWPORT_INDEX_PROVOKING_VERTEX: u32 = 0x825F; 4761 | 4762 | pub const VIEWPORT_SUBPIXEL_BITS: u32 = 0x825C; 4763 | 4764 | pub const VIEW_CLASS_128_BITS: u32 = 0x82C4; 4765 | 4766 | pub const VIEW_CLASS_16_BITS: u32 = 0x82CA; 4767 | 4768 | pub const VIEW_CLASS_24_BITS: u32 = 0x82C9; 4769 | 4770 | pub const VIEW_CLASS_32_BITS: u32 = 0x82C8; 4771 | 4772 | pub const VIEW_CLASS_48_BITS: u32 = 0x82C7; 4773 | 4774 | pub const VIEW_CLASS_64_BITS: u32 = 0x82C6; 4775 | 4776 | pub const VIEW_CLASS_8_BITS: u32 = 0x82CB; 4777 | 4778 | pub const VIEW_CLASS_96_BITS: u32 = 0x82C5; 4779 | 4780 | pub const VIEW_CLASS_BPTC_FLOAT: u32 = 0x82D3; 4781 | 4782 | pub const VIEW_CLASS_BPTC_UNORM: u32 = 0x82D2; 4783 | 4784 | pub const VIEW_CLASS_RGTC1_RED: u32 = 0x82D0; 4785 | 4786 | pub const VIEW_CLASS_RGTC2_RG: u32 = 0x82D1; 4787 | 4788 | pub const VIEW_CLASS_S3TC_DXT1_RGB: u32 = 0x82CC; 4789 | 4790 | pub const VIEW_CLASS_S3TC_DXT1_RGBA: u32 = 0x82CD; 4791 | 4792 | pub const VIEW_CLASS_S3TC_DXT3_RGBA: u32 = 0x82CE; 4793 | 4794 | pub const VIEW_CLASS_S3TC_DXT5_RGBA: u32 = 0x82CF; 4795 | 4796 | pub const VIEW_COMPATIBILITY_CLASS: u32 = 0x82B6; 4797 | 4798 | pub const WAIT_FAILED: u32 = 0x911D; 4799 | 4800 | pub const WRITE_ONLY: u32 = 0x88B9; 4801 | 4802 | pub const XOR: u32 = 0x1506; 4803 | 4804 | pub const ZERO: u32 = 0; 4805 | 4806 | pub const ZERO_TO_ONE: u32 = 0x935F; 4807 | 4808 | mod __private { 4809 | /// Prevents [`HasContext`] from being implemented outside of this crate. 4810 | #[doc(hidden)] 4811 | pub trait Sealed {} 4812 | } 4813 | -------------------------------------------------------------------------------- /src/version.rs: -------------------------------------------------------------------------------- 1 | /// A version number for a specific component of an OpenGL implementation 2 | #[derive(Clone, Eq, Ord, PartialEq, PartialOrd)] 3 | pub struct Version { 4 | pub major: u32, 5 | pub minor: u32, 6 | pub is_embedded: bool, 7 | pub revision: Option, 8 | pub vendor_info: String, 9 | } 10 | 11 | impl Version { 12 | /// Create a new OpenGL version number 13 | #[allow(dead_code)] 14 | pub(crate) fn new(major: u32, minor: u32, revision: Option, vendor_info: String) -> Self { 15 | Version { 16 | major: major, 17 | minor: minor, 18 | is_embedded: false, 19 | revision: revision, 20 | vendor_info, 21 | } 22 | } 23 | 24 | /// Create a new OpenGL ES version number 25 | #[allow(dead_code)] 26 | pub(crate) fn new_embedded(major: u32, minor: u32, vendor_info: String) -> Self { 27 | Version { 28 | major, 29 | minor, 30 | is_embedded: true, 31 | revision: None, 32 | vendor_info, 33 | } 34 | } 35 | 36 | /// According to the OpenGL specification, the version information is 37 | /// expected to follow the following syntax: 38 | /// 39 | /// ~~~bnf 40 | /// ::= 41 | /// ::= 42 | /// ::= 43 | /// ::= 44 | /// ::= "." ["." ] 45 | /// ::= [" " ] 46 | /// ~~~ 47 | /// 48 | /// Note that this function is intentionally lenient in regards to parsing, 49 | /// and will try to recover at least the first two version numbers without 50 | /// resulting in an `Err`. 51 | /// # Notes 52 | /// `WebGL 2` version returned as `OpenGL ES 3.0` 53 | pub(crate) fn parse(mut src: &str) -> Result { 54 | let webgl_sig = "WebGL "; 55 | // According to the WebGL specification 56 | // VERSION WebGL1.0 57 | // SHADING_LANGUAGE_VERSION WebGLGLSLES1.0 58 | let is_webgl = src.starts_with(webgl_sig); 59 | let is_es = if is_webgl { 60 | let pos = src.rfind(webgl_sig).unwrap_or(0); 61 | src = &src[pos + webgl_sig.len()..]; 62 | true 63 | } else { 64 | let es_sig = " ES "; 65 | match src.rfind(es_sig) { 66 | Some(pos) => { 67 | src = &src[pos + es_sig.len()..]; 68 | true 69 | } 70 | None => false, 71 | } 72 | }; 73 | 74 | let glsl_es_sig = "GLSL ES "; 75 | let is_glsl = match src.find(glsl_es_sig) { 76 | Some(pos) => { 77 | src = &src[pos + glsl_es_sig.len()..]; 78 | true 79 | } 80 | None => false, 81 | }; 82 | 83 | let (version, vendor_info) = match src.find(' ') { 84 | Some(i) => (&src[..i], src[i + 1..].to_string()), 85 | None => (src, String::new()), 86 | }; 87 | 88 | // TODO: make this even more lenient so that we can also accept 89 | // ` "." []` 90 | let mut it = version.split('.'); 91 | let major = it.next().and_then(|s| s.parse().ok()); 92 | let minor = it.next().and_then(|s| { 93 | let trimmed = if s.starts_with('0') { 94 | "0" 95 | } else { 96 | s.trim_end_matches('0') 97 | }; 98 | trimmed.parse().ok() 99 | }); 100 | let revision = if is_webgl { 101 | None 102 | } else { 103 | it.next().and_then(|s| s.parse().ok()) 104 | }; 105 | 106 | match (major, minor, revision) { 107 | (Some(major), Some(minor), revision) => Ok(Version { 108 | // Return WebGL 2.0 version as OpenGL ES 3.0 109 | major: if is_webgl && !is_glsl { 110 | major + 1 111 | } else { 112 | major 113 | }, 114 | minor, 115 | is_embedded: is_es, 116 | revision, 117 | vendor_info, 118 | }), 119 | (_, _, _) => Err(src), 120 | } 121 | } 122 | } 123 | 124 | impl std::fmt::Debug for Version { 125 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 126 | match ( 127 | self.major, 128 | self.minor, 129 | self.revision, 130 | self.vendor_info.as_str(), 131 | ) { 132 | (major, minor, Some(revision), "") => write!(f, "{}.{}.{}", major, minor, revision), 133 | (major, minor, None, "") => write!(f, "{}.{}", major, minor), 134 | (major, minor, Some(revision), vendor_info) => { 135 | write!(f, "{}.{}.{}, {}", major, minor, revision, vendor_info) 136 | } 137 | (major, minor, None, vendor_info) => write!(f, "{}.{}, {}", major, minor, vendor_info), 138 | } 139 | } 140 | } 141 | 142 | #[cfg(test)] 143 | mod tests { 144 | use super::Version; 145 | 146 | #[test] 147 | fn test_version_parse() { 148 | assert_eq!(Version::parse("1"), Err("1")); 149 | assert_eq!(Version::parse("1."), Err("1.")); 150 | assert_eq!(Version::parse("1 h3l1o. W0rld"), Err("1 h3l1o. W0rld")); 151 | assert_eq!(Version::parse("1. h3l1o. W0rld"), Err("1. h3l1o. W0rld")); 152 | assert_eq!( 153 | Version::parse("1.2.3"), 154 | Ok(Version::new(1, 2, Some(3), String::new())) 155 | ); 156 | assert_eq!( 157 | Version::parse("1.2"), 158 | Ok(Version::new(1, 2, None, String::new())) 159 | ); 160 | assert_eq!( 161 | Version::parse("1.2 h3l1o. W0rld"), 162 | Ok(Version::new(1, 2, None, "h3l1o. W0rld".to_string())) 163 | ); 164 | assert_eq!( 165 | Version::parse("1.2.h3l1o. W0rld"), 166 | Ok(Version::new(1, 2, None, "W0rld".to_string())) 167 | ); 168 | assert_eq!( 169 | Version::parse("1.2. h3l1o. W0rld"), 170 | Ok(Version::new(1, 2, None, "h3l1o. W0rld".to_string())) 171 | ); 172 | assert_eq!( 173 | Version::parse("1.2.3.h3l1o. W0rld"), 174 | Ok(Version::new(1, 2, Some(3), "W0rld".to_string())) 175 | ); 176 | assert_eq!( 177 | Version::parse("1.2.3 h3l1o. W0rld"), 178 | Ok(Version::new(1, 2, Some(3), "h3l1o. W0rld".to_string())) 179 | ); 180 | assert_eq!( 181 | Version::parse("OpenGL ES 3.1"), 182 | Ok(Version::new_embedded(3, 1, String::new())) 183 | ); 184 | assert_eq!( 185 | Version::parse("OpenGL ES 2.0 Google Nexus"), 186 | Ok(Version::new_embedded(2, 0, "Google Nexus".to_string())) 187 | ); 188 | assert_eq!( 189 | Version::parse("GLSL ES 1.1"), 190 | Ok(Version::new_embedded(1, 1, String::new())) 191 | ); 192 | assert_eq!( 193 | Version::parse("OpenGL ES GLSL ES 3.20"), 194 | Ok(Version::new_embedded(3, 2, String::new())) 195 | ); 196 | assert_eq!( 197 | // WebGL 2.0 should parse as OpenGL ES 3.0 198 | Version::parse("WebGL 2.0 (OpenGL ES 3.0 Chromium)"), 199 | Ok(Version::new_embedded( 200 | 3, 201 | 0, 202 | "(OpenGL ES 3.0 Chromium)".to_string() 203 | )) 204 | ); 205 | assert_eq!( 206 | Version::parse("WebGL GLSL ES 3.00 (OpenGL ES GLSL ES 3.0 Chromium)"), 207 | Ok(Version::new_embedded( 208 | 3, 209 | 0, 210 | "(OpenGL ES GLSL ES 3.0 Chromium)".to_string() 211 | )) 212 | ); 213 | } 214 | } 215 | --------------------------------------------------------------------------------