script/dom/webgl/extensions/ext/
oeselementindexuint.rs1use canvas_traits::webgl::WebGLVersion;
6use dom_struct::dom_struct;
7
8use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions};
9use crate::dom::bindings::reflector::{DomGlobal, Reflector, reflect_dom_object};
10use crate::dom::bindings::root::DomRoot;
11use crate::dom::webgl::webglrenderingcontext::WebGLRenderingContext;
12use crate::script_runtime::CanGc;
13
14#[dom_struct]
15pub(crate) struct OESElementIndexUint {
16 reflector_: Reflector,
17}
18
19impl OESElementIndexUint {
20 fn new_inherited() -> Self {
21 Self {
22 reflector_: Reflector::new(),
23 }
24 }
25}
26
27impl WebGLExtension for OESElementIndexUint {
28 type Extension = Self;
29
30 fn new(ctx: &WebGLRenderingContext, can_gc: CanGc) -> DomRoot<Self> {
31 reflect_dom_object(
32 Box::new(OESElementIndexUint::new_inherited()),
33 &*ctx.global(),
34 can_gc,
35 )
36 }
37
38 fn spec() -> WebGLExtensionSpec {
39 WebGLExtensionSpec::Specific(WebGLVersion::WebGL1)
40 }
41
42 fn is_supported(ext: &WebGLExtensions) -> bool {
43 !ext.is_gles() || ext.supports_gl_extension("GL_OES_element_index_uint")
45 }
46
47 fn enable(ext: &WebGLExtensions) {
48 ext.enable_element_index_uint();
49 }
50
51 fn name() -> &'static str {
52 "OES_element_index_uint"
53 }
54}