1[package]
2name = "softbuffer"
3version = "0.4.6"
4edition = "2021"
5license = "MIT OR Apache-2.0"
6description = "Cross-platform software buffer"
7documentation = "https://docs.rs/softbuffer"
8readme = "README.md"
9repository = "https://github.com/rust-windowing/softbuffer"
10keywords = ["framebuffer", "windowing"]
11categories = ["game-development", "graphics", "gui", "multimedia", "rendering"]
12exclude = ["examples"]
13rust-version = "1.70.0"
14
15[[bench]]
16name = "buffer_mut"
17harness = false
18
19[features]
20default = ["kms", "x11", "x11-dlopen", "wayland", "wayland-dlopen"]
21kms = ["bytemuck", "drm", "rustix"]
22wayland = ["wayland-backend", "wayland-client", "wayland-sys", "memmap2", "rustix", "fastrand"]
23wayland-dlopen = ["wayland-sys/dlopen"]
24x11 = ["as-raw-xcb-connection", "bytemuck", "fastrand", "rustix", "tiny-xlib", "x11rb"]
25x11-dlopen = ["tiny-xlib/dlopen", "x11rb/dl-libxcb"]
26
27[dependencies]
28log = "0.4.17"
29raw_window_handle = { package = "raw-window-handle", version = "0.6", features = ["std"] }
30
31[target.'cfg(all(unix, not(any(target_vendor = "apple", target_os = "android", target_os = "redox"))))'.dependencies]
32as-raw-xcb-connection = { version = "1.0.0", optional = true }
33bytemuck = { version = "1.12.3", optional = true }
34drm = { version = "0.12.0", default-features = false, optional = true }
35fastrand = { version = "2.0.0", optional = true }
36memmap2 = { version = "0.9.0", optional = true }
37rustix = { version = "0.38.19", features = ["fs", "mm", "shm", "std"], default-features = false, optional = true }
38tiny-xlib = { version = "0.2.1", optional = true }
39wayland-backend = { version = "0.3.0", features = ["client_system"], optional = true }
40wayland-client = { version = "0.31.0", optional = true }
41wayland-sys = { version = "0.31.0", optional = true }
42x11rb = { version = "0.13.0", features = ["allow-unsafe-code", "shm"], optional = true }
43
44[target.'cfg(target_os = "windows")'.dependencies.windows-sys]
45version = "0.59.0"
46features = ["Win32_Graphics_Gdi", "Win32_UI_Shell", "Win32_UI_WindowsAndMessaging", "Win32_Foundation"]
47
48[target.'cfg(target_vendor = "apple")'.dependencies]
49bytemuck = { version = "1.12.3", features = ["extern_crate_alloc"] }
50core-graphics = "0.24.0"
51foreign-types = "0.5.0"
52objc2 = "0.5.2"
53objc2-foundation = { version = "0.2.2", features = [
54 "NSDictionary",
55 "NSGeometry",
56 "NSKeyValueObserving",
57 "NSString",
58 "NSThread",
59 "NSValue",
60] }
61objc2-quartz-core = { version = "0.2.2", features = ["CALayer", "CATransaction"] }
62
63[target.'cfg(target_arch = "wasm32")'.dependencies]
64js-sys = "0.3.63"
65wasm-bindgen = "0.2.86"
66
67[target.'cfg(target_arch = "wasm32")'.dependencies.web-sys]
68version = "0.3.55"
69features = [
70 "CanvasRenderingContext2d",
71 "Document",
72 "Element",
73 "HtmlCanvasElement",
74 "ImageData",
75 "OffscreenCanvas",
76 "OffscreenCanvasRenderingContext2d",
77 "Window",
78]
79
80[target.'cfg(target_os = "redox")'.dependencies]
81redox_syscall = "0.5"
82
83[build-dependencies]
84cfg_aliases = "0.2.0"
85
86[dev-dependencies]
87colorous = "1.0.12"
88criterion = { version = "0.4.0", default-features = false, features = ["cargo_bench_support"] }
89web-time = "1.0.0"
90winit = "0.30.0"
91
92[dev-dependencies.image]
93version = "0.25.0"
94# Disable rayon on web
95default-features = false
96features = ["jpeg"]
97
98[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
99# Turn rayon back on everywhere else; creating the separate entry resets the features to default.
100rayon = "1.5.1"
101
102[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
103wasm-bindgen-test = "0.3"
104
105[target.'cfg(all(unix, not(any(target_vendor = "apple", target_os = "android", target_os = "redox"))))'.dev-dependencies]
106rustix = { version = "0.38.8", features = ["event"] }
107
108[workspace]
109members = [
110 "run-wasm",
111]
112
113[package.metadata.docs.rs]
114all-features = true
115rustdoc-args = ["--cfg", "docsrs"]
116default-target = "x86_64-unknown-linux-gnu"
117targets = [
118 "x86_64-pc-windows-msvc",
119 "x86_64-apple-darwin",
120 "x86_64-unknown-linux-gnu",
121 "wasm32-unknown-unknown",
122]
123