File tree Expand file tree Collapse file tree 3 files changed +67
-37
lines changed Expand file tree Collapse file tree 3 files changed +67
-37
lines changed Original file line number Diff line number Diff line change
1
+
2
+ #[ derive( Debug , Clone ) ]
3
+ pub struct Imgui {
4
+ }
5
+
6
+ impl Imgui {
7
+ pub fn new ( ) -> Imgui {
8
+ Imgui {
9
+ }
10
+ }
11
+
12
+ #[ allow( non_snake_case) ]
13
+ pub fn IMGUI_CHECKVERSION ( & self ) {
14
+ }
15
+
16
+ pub fn create_context ( & self ) {
17
+ }
18
+
19
+ pub fn get_io ( & self ) {
20
+ }
21
+ }
Original file line number Diff line number Diff line change
1
+
2
+
3
+
4
+ #[ derive( Debug , Clone ) ]
5
+ pub struct Imgui {
6
+ module : stdweb:: Value
7
+ }
8
+
9
+
10
+ impl Imgui {
11
+ pub fn new ( ) -> Imgui {
12
+ Imgui {
13
+ module : js ! { return window. Imgui ; }
14
+ }
15
+ }
16
+
17
+ #[ allow( non_snake_case) ]
18
+ pub fn IMGUI_CHECKVERSION ( & self ) {
19
+ let module = & self . module ;
20
+ js ! {
21
+ @{ module} . IMGUI_CHECKVERSION ( ) ;
22
+ } ;
23
+ }
24
+
25
+ pub fn create_context ( & self ) {
26
+ let module = & self . module ;
27
+ js ! {
28
+ return @{ module} . create_context( ) ;
29
+ } ;
30
+ }
31
+
32
+ pub fn get_io ( & self ) -> stdweb:: Value {
33
+ let module = & self . module ;
34
+ let ret = js ! {
35
+ return @{ module} . get_io( ) ;
36
+ } ;
37
+ ret
38
+ }
39
+ }
Original file line number Diff line number Diff line change 1
- #[ cfg( not( target_arch = "wasm32" ) ) ]
2
- extern crate libc;
3
-
4
1
#[ macro_use]
5
2
#[ cfg( all( target_arch = "wasm32" ) ) ]
6
3
extern crate stdweb;
7
4
8
- #[ cfg( not( target_arch = "wasm32" ) ) ]
9
- #[ derive( Debug , Clone ) ]
10
- pub struct Imgui {
11
- }
12
-
13
- #[ cfg( not( target_arch = "wasm32" ) ) ]
14
- impl Imgui {
15
- pub fn new ( ) -> Imgui {
16
- Imgui {
17
- }
18
- }
19
-
20
- #[ allow( non_snake_case) ]
21
- pub fn IMGUI_CHECKVERSION ( & self ) {
22
- }
23
- }
24
5
25
6
#[ cfg( all( target_arch = "wasm32" ) ) ]
26
- #[ derive( Debug , Clone ) ]
27
- pub struct Imgui {
28
- module : stdweb:: Value
29
- }
7
+ pub mod imgui_stdweb;
30
8
31
9
#[ cfg( all( target_arch = "wasm32" ) ) ]
32
- impl Imgui {
33
- pub fn new ( ) -> Imgui {
34
- Imgui {
35
- module : js ! { return window. Imgui ; }
36
- }
37
- }
10
+ pub use self :: imgui_stdweb:: * ;
38
11
39
- #[ allow( non_snake_case) ]
40
- pub fn IMGUI_CHECKVERSION ( & self ) {
41
- let module = & self . module ;
42
- js ! {
43
- @{ module} . IMGUI_CHECKVERSION ( ) ;
44
- } ;
45
- }
46
- }
12
+ #[ cfg( not( target_arch = "wasm32" ) ) ]
13
+ pub mod imgui_c;
14
+
15
+ #[ cfg( not( target_arch = "wasm32" ) ) ]
16
+ pub use self :: imgui_c:: * ;
47
17
48
18
49
19
#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments