rust_pixel 2.3.0

2d pixel-art game engine & rapid prototype tools support terminal, wgpu and web...
Documentation
[package]
name = "rust_pixel"
version = "2.3.0"
edition = "2021"
authors = ["zipxing@hotmail.com"]
repository = "https://github.com/zipxing/rust_pixel"
readme = "README.md"
license = "Apache-2.0"
description = "2d pixel-art game engine & rapid prototype tools support terminal, wgpu and web..."
categories = ["game-engines", "gui", "graphics"]
exclude = ["/screen-shot", "/doc", "/test", "/assets", "/web-template"]

# Define binaries that will be built for the project.
[[bin]]
name = "cargo-pixel"
path = "tools/cargo-pixel/src/main.rs"

[workspace.dependencies]
cfg_aliases = "0.2.1"

[build-dependencies]
cfg_aliases = { workspace = true }

[dependencies]
cfg_aliases = { workspace = true }
# Procedural macro dependencies
quote = "1.0"
syn = { version = "2.0", features = ["full"] }
proc-macro2 = "1.0"
paste = "1.0"

bincode = { version = "2.0.1", features = ["serde"] }
bitflags = { version = "2.11", features = ["serde"] }
crossterm = { version = "0.29", optional = true }
dirs-next = "2.0.0"
flate2 = "1.1.9"
itertools = "0.14.0"
lazy_static = "1.5.0"
log = "0.4.29"
log4rs = { version = "1.4.0", optional = true }
num-traits = "0.2"
num-derive = "0.4"
regex = "1.12.3"
rand = "0.9.2"
rand_xoshiro = "0.7.0"
keyframe = "=1.1.1"
keyframe_derive = "1.0.0"
serde = { version = "1.0.228", features = ["derive"] }
winit = { version = "0.30", optional = true }
glutin = { version = "0.32.3", optional = true }
glutin-winit = { version = "0.5", optional = true }
raw-window-handle = { version = "0.6", optional = true }
image = { version = "0.25.9", optional = true }
# glow removed - web mode now uses wgpu with webgl fallback
# wgpu dependencies for modern GPU rendering
# webgl feature enables automatic WebGL2 fallback when WebGPU is unavailable on browsers
wgpu = { version = "26.0", optional = true, features = ["webgl"] }
bytemuck = { version = "1.25", features = ["derive"], optional = true }
pollster = { version = "0.4", optional = true }
unicode-segmentation = "1.12"
unicode-width = "0.2"
clap = { version = "4.5", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9"
toml = "0.8"
lab = "0.11.0"
deltae = "0.3.2"

# wgpu dependencies removed

[target.'cfg(not(any(target_os = "android", target_os = "ios", target_arch = "wasm32")))'.dependencies]
rodio = { version = "0.21.1", optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = { version = "0.1.7", optional = true }
getrandom = { version = "0.3", features = ["wasm_js"] }
js-sys = "0.3.91"
wasm-bindgen = "0.2.114"
wasm-logger = "0.2.0"
wasm-bindgen-futures = "0.4"
# WGPU for web rendering (automatically enabled for wasm32)
wgpu = { version = "26.0", features = ["webgl"] }
bytemuck = { version = "1.25", features = ["derive"] }

[dependencies.web-sys]
version = "0.3.91"
features = [
  "CanvasRenderingContext2d",
  "CssStyleDeclaration",
  "Document",
  "DomRect",
  "Element",
  "EventTarget",
  "HtmlCanvasElement",
  "HtmlElement",
  "KeyboardEvent",
  "MouseEvent",
  "Node",
  "Window",
  "WebGlBuffer",
  "WebGl2RenderingContext",
  "WebGlProgram",
  "WebGlShader",
  "WebGlUniformLocation",
  "console",
  "Event",
  "MouseEventInit"
]

[features]
default = ["log4rs", "crossterm", "rodio", "image"]
# web feature - wgpu/bytemuck are automatically included for wasm32 target
web = ["image"]
term = ["log4rs", "crossterm", "rodio", "image"]
# Native wgpu mode with winit window management
wgpu = ["log4rs", "rodio", "dep:wgpu", "dep:bytemuck", "dep:pollster", "dep:winit", "dep:glutin", "dep:glutin-winit", "dep:raw-window-handle", "image"]
base = ["log4rs"]

[profile.release]
opt-level = 's'
codegen-units = 1
lto = true # FullLTO - the most aggressive LTO version
# debug = true # temporary: enable debug symbols for profiling

[workspace]
members = [
    "apps/*",
    "tools/*",
    "pixel_basic",
]

exclude = [
    "tools/cargo-pixel",
    "tools/symbols",
    "apps/poker/ffi",
    "apps/poker/wasm",
    "apps/template/ffi",
    "apps/template/wasm",
    "apps/palette/ffi",
    "apps/palette/wasm",
    "apps/petview/ffi",
    "apps/petview/wasm",
]

[workspace.package]
authors = ["zipxing@hotmail.com"]
description = "2d pixel art game engine support terminal, wgpu, and wasm..."