1
1
use napi:: * ;
2
2
use napi_derive:: napi;
3
3
use std:: ffi:: { c_void, CString } ;
4
- #[ napi( js_name = "WebGLRenderingContext" ) ]
5
- pub struct JSWebGLRenderingContext {
4
+ #[ napi]
5
+ pub struct WebGLRenderingContext {
6
6
state : * mut canvas_c:: WebGLState ,
7
7
}
8
8
9
9
10
10
#[ napi]
11
- impl JSWebGLRenderingContext {
11
+ impl WebGLRenderingContext {
12
12
13
13
// #[napi]
14
14
// pub fn render(&self) {
@@ -40,7 +40,7 @@ impl JSWebGLRenderingContext {
40
40
stencil : bool ,
41
41
desynchronized : bool ,
42
42
xr_compatible : bool
43
- ) -> Result < JSWebGLRenderingContext > {
43
+ ) -> Result < WebGLRenderingContext > {
44
44
let ret = canvas_c:: canvas_native_webgl_create (
45
45
view as _ ,
46
46
version,
@@ -60,7 +60,7 @@ impl JSWebGLRenderingContext {
60
60
return Err ( napi:: Error :: from_reason ( "Invalid parameter" ) ) ;
61
61
}
62
62
63
- Ok ( JSWebGLRenderingContext {
63
+ Ok ( WebGLRenderingContext {
64
64
state : ret
65
65
} )
66
66
}
@@ -81,7 +81,7 @@ impl JSWebGLRenderingContext {
81
81
desynchronized : bool ,
82
82
xr_compatible : bool ,
83
83
is_canvas : bool ,
84
- ) -> Result < JSWebGLRenderingContext > {
84
+ ) -> Result < WebGLRenderingContext > {
85
85
let ret = canvas_c:: canvas_native_webgl_create_no_window (
86
86
width,
87
87
height,
@@ -103,7 +103,7 @@ impl JSWebGLRenderingContext {
103
103
return Err ( napi:: Error :: from_reason ( "Invalid parameter" ) ) ;
104
104
}
105
105
106
- Ok ( JSWebGLRenderingContext {
106
+ Ok ( WebGLRenderingContext {
107
107
state : ret
108
108
} )
109
109
}
0 commit comments