Merge pull request #529 from sanbox-irl/feature-gate-tables-api

decided to feature gate the tables API
This commit is contained in:
Jonathan Spira 2021-09-17 12:37:25 -04:00 committed by GitHub
commit 5f441b7b1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

View File

@ -13,6 +13,6 @@ publish = false
clipboard = "0.5"
glium = { version = "0.30", default-features = true }
image = "0.23"
imgui = { path = "../imgui" }
imgui = { path = "../imgui", features = ["tables-api"] }
imgui-glium-renderer = { path = "../imgui-glium-renderer" }
imgui-winit-support = { path = "../imgui-winit-support" }

View File

@ -23,6 +23,9 @@ default = ["min-const-generics"]
wasm = ["imgui-sys/wasm"]
freetype = ["imgui-sys/freetype"]
min-const-generics = []
# this api is in beta in the upstream imgui crate. See issue #524 for more info.
# it should be stable and fine to use though.
tables-api = []
[dev-dependencies]
memoffset = "0.6"

View File

@ -34,6 +34,8 @@ pub use self::render::renderer::*;
pub use self::stacks::*;
pub use self::string::*;
pub use self::style::*;
#[cfg(feature = "tables-api")]
pub use self::tables::*;
pub use self::utils::*;
pub use self::widget::color_editors::*;
@ -77,6 +79,7 @@ mod popups;
mod render;
mod stacks;
mod style;
#[cfg(feature = "tables-api")]
mod tables;
#[cfg(test)]
mod test;
@ -289,6 +292,9 @@ impl<T> From<*mut T> for Id<'static> {
}
impl<'a> Id<'a> {
// this is used in the tables-api and possibly elsewhere,
// but not with just default features...
#[allow(dead_code)]
fn as_imgui_id(&self) -> sys::ImGuiID {
unsafe {
match self {