mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-26 12:59:00 +00:00
Add f32 constructors for ImVec2/ImVec4
This commit is contained in:
parent
8c3c485cd5
commit
d970e287d1
20
src/ffi.rs
20
src/ffi.rs
@ -211,6 +211,15 @@ pub struct ImVec2 {
|
|||||||
pub y: c_float
|
pub y: c_float
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ImVec2 {
|
||||||
|
pub fn new(x: f32, y: f32) -> ImVec2 {
|
||||||
|
ImVec2 {
|
||||||
|
x: x as c_float,
|
||||||
|
y: y as c_float
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Copy, Clone, Debug, Default)]
|
#[derive(Copy, Clone, Debug, Default)]
|
||||||
pub struct ImVec4 {
|
pub struct ImVec4 {
|
||||||
@ -220,6 +229,17 @@ pub struct ImVec4 {
|
|||||||
pub w: c_float
|
pub w: c_float
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ImVec4 {
|
||||||
|
pub fn new(x: f32, y: f32, z: f32, w: f32) -> ImVec4 {
|
||||||
|
ImVec4 {
|
||||||
|
x: x as c_float,
|
||||||
|
y: y as c_float,
|
||||||
|
z: z as c_float,
|
||||||
|
w: w as c_float
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct ImGuiStyle {
|
pub struct ImGuiStyle {
|
||||||
pub alpha: c_float,
|
pub alpha: c_float,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user