[package]
name = "dear-imgui-sdl3"
version = "0.12.0"
edition.workspace = true
description = "SDL3 platform backend with optional OpenGL3 renderer for dear-imgui-rs"
license.workspace = true
repository.workspace = true
homepage.workspace = true
documentation = "https://docs.rs/dear-imgui-sdl3"
categories.workspace = true
keywords.workspace = true
build = "build.rs"
links = "dear-imgui-sdl3-backend"

[dependencies]
dear-imgui-rs = { path = "../../dear-imgui", version = "0.12" }
dear-imgui-sys = { path = "../../dear-imgui-sys", version = "0.12" }
sdl3-sys = "0.6"
thiserror.workspace = true

[target.'cfg(any(target_os = "linux", target_os = "windows"))'.dependencies]
# On Linux/Windows, prefer building SDL3 from source so CI and users don't need
# a pre-installed system SDL3. sdl3-sys will download and build SDL3 via CMake.
sdl3 = { version = "0.18", features = ["build-from-source"] }

[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
# On Apple targets, keep SDL3 acquisition owned by the consuming application.
# On macOS that usually means a Homebrew/system install. On iOS that usually
# means an app-provided SDL3.xcframework or an app-owned build-from-source
# setup via a direct `sdl3` dependency.
sdl3 = { version = "0.18" }

[target.'cfg(target_os = "android")'.dependencies]
# On Android, keep SDL3 acquisition owned by the consuming application.
# Apps may either provide SDL3 headers/libs themselves, or add their own direct
# `sdl3 = { features = ["build-from-source"] }` dependency and rely on Cargo
# feature unification to make sdl3-sys export headers via DEP_SDL3_OUT_DIR.
sdl3 = { version = "0.18" }

[build-dependencies]
cc.workspace = true
pkg-config.workspace = true

[features]
default = []
# Enable the official C++ OpenGL3 renderer backend (imgui_impl_opengl3).
# Off by default to keep SDL3 platform-only mode lightweight.
opengl3-renderer = ["dear-imgui-sys/backend-shim-opengl3"]
# Enable the official C++ SDLRenderer3 renderer backend (imgui_impl_sdlrenderer3).
sdlrenderer3-renderer = ["dear-imgui-sys/backend-shim-sdlrenderer3"]
# Enable multi-viewport helpers (requires multi-viewport support in dear-imgui-rs).
multi-viewport = ["dear-imgui-rs/multi-viewport"]
