11use napi:: * ;
22use napi_derive:: napi;
33use std:: ffi:: { c_void, CString } ;
4- #[ napi( js_name = "WebGLRenderingContext" ) ]
5- pub struct JSWebGLRenderingContext {
4+ #[ napi]
5+ pub struct WebGLRenderingContext {
66 state : * mut canvas_c:: WebGLState ,
77}
88
99
1010#[ napi]
11- impl JSWebGLRenderingContext {
11+ impl WebGLRenderingContext {
1212
1313 // #[napi]
1414 // pub fn render(&self) {
@@ -40,7 +40,7 @@ impl JSWebGLRenderingContext {
4040 stencil : bool ,
4141 desynchronized : bool ,
4242 xr_compatible : bool
43- ) -> Result < JSWebGLRenderingContext > {
43+ ) -> Result < WebGLRenderingContext > {
4444 let ret = canvas_c:: canvas_native_webgl_create (
4545 view as _ ,
4646 version,
@@ -60,7 +60,7 @@ impl JSWebGLRenderingContext {
6060 return Err ( napi:: Error :: from_reason ( "Invalid parameter" ) ) ;
6161 }
6262
63- Ok ( JSWebGLRenderingContext {
63+ Ok ( WebGLRenderingContext {
6464 state : ret
6565 } )
6666 }
@@ -81,7 +81,7 @@ impl JSWebGLRenderingContext {
8181 desynchronized : bool ,
8282 xr_compatible : bool ,
8383 is_canvas : bool ,
84- ) -> Result < JSWebGLRenderingContext > {
84+ ) -> Result < WebGLRenderingContext > {
8585 let ret = canvas_c:: canvas_native_webgl_create_no_window (
8686 width,
8787 height,
@@ -103,7 +103,7 @@ impl JSWebGLRenderingContext {
103103 return Err ( napi:: Error :: from_reason ( "Invalid parameter" ) ) ;
104104 }
105105
106- Ok ( JSWebGLRenderingContext {
106+ Ok ( WebGLRenderingContext {
107107 state : ret
108108 } )
109109 }
0 commit comments