Skip to content

Commit d9e4319

Browse files
committed
update
1 parent 52a9adc commit d9e4319

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed

Cargo.lock

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ serde = "1.0"
1212
serde_derive = "1.0"
1313
serde_json = "1.0"
1414
libc = "0.2.9"
15+
imgui-sys = "0.0.21"
1516

1617
[target.wasm32-unknown-unknown.dependencies]
1718
stdweb = { version = "0.4.10", optional = true }

src/imgui_stdweb.rs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11

22

3+
#[derive(Debug, Clone)]
4+
pub struct ImguiIO{
5+
}
6+
7+
#[derive(Debug, Clone)]
8+
pub struct ImDrawList{
9+
draw_list:stdweb::Value
10+
}
11+
12+
impl ImDrawList{
13+
pub fn vtx_buffer(&self) -> &stdweb::Value{
14+
self.draw_list.VtxBuffer
15+
}
16+
17+
pub fn idx_buffer(&self) -> &stdweb::Value{
18+
self.draw_list.IdxBuffer
19+
}
20+
21+
pub fn flags(&self) -> &stdweb::Value{
22+
self.draw_list.Flags
23+
}
24+
25+
pub fn iterate_draw_lists(&self){
26+
27+
}
28+
}
329

430
#[derive(Debug, Clone)]
531
pub struct Imgui{
@@ -36,4 +62,19 @@ impl Imgui{
3662
};
3763
ret
3864
}
65+
66+
pub fn style_colors_dark(&self){
67+
let module = &self.module;
68+
js! {
69+
return @{module}.StyleColorsDark();
70+
};
71+
}
72+
73+
#[allow(non_snake_case)]
74+
pub fn IM_ASSERT(&self, cond:bool){
75+
let module = &self.module;
76+
js! {
77+
@{module}.IM_ASSERT(@{cond});
78+
};
79+
}
3980
}

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#[cfg(all(target_arch = "wasm32"))]
33
extern crate stdweb;
44

5+
#[cfg(not(target_arch = "wasm32"))]
6+
extern crate imgui_sys;
57

68
#[cfg(all(target_arch = "wasm32"))]
79
pub mod imgui_stdweb;

0 commit comments

Comments
 (0)