1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use super::WebGLExtensions;
use crate::dom::bindings::reflector::DomObject;
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::trace::JSTraceable;
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
use canvas_traits::webgl::WebGLVersion;
pub trait WebGLExtension: Sized
where
Self::Extension: DomObject + JSTraceable,
{
type Extension;
fn new(ctx: &WebGLRenderingContext) -> DomRoot<Self::Extension>;
fn spec() -> WebGLExtensionSpec;
fn is_supported(ext: &WebGLExtensions) -> bool;
fn enable(ext: &WebGLExtensions);
fn name() -> &'static str;
}
pub enum WebGLExtensionSpec {
All,
Specific(WebGLVersion),
}