bevy/crates/bevy_gizmos/src
BD103 b2d417b03d
Warn when bevy_sprite and bevy_pbr are not enabled with bevy_gizmos (#11296)
# Objective

- `bevy_gizmos` cannot work if both `bevy_sprite` and `bevy_pbr` are
disabled.
- It silently fails to render, making it difficult to debug.
- Fixes #10984

## Solution

- Log an error message when `GizmoPlugin` is registered.

## Alternatives

I chose to log an error message, since it seemed the least intrusive of
potential solutions. Some alternatives include:

- Choosing one dependency as the default, neglecting the other. (#11035)
- Raising a compile error when neither dependency is enabled. ([See my
original
comment](https://github.com/bevyengine/bevy/issues/10984#issuecomment-1873420426))
- Raising a compile warning using a macro hack. ([Pre-RFC - Add
compile_warning!
macro](https://internals.rust-lang.org/t/pre-rfc-add-compile-warning-macro/9370/7?u=bd103))
- Logging a warning instead of an error.
- _This might be the better option. Let me know if I should change it._

---

## Changelog

- `bevy_gizmos` will now log an error if neither `bevy_pbr` nor
`bevy_sprite` are enabled.
2024-01-14 13:51:14 +00:00
..
arcs.rs Remove unnecessary parens (#11075) 2023-12-24 17:43:01 +00:00
arrows.rs Move Circle Gizmos to Their Own File (#10631) 2023-11-20 09:47:50 +00:00
circles.rs Remove unnecessary parens (#11075) 2023-12-24 17:43:01 +00:00
gizmos.rs move gizmo arcs to their own file (#10660) 2023-11-22 14:58:34 +00:00
lib.rs Warn when bevy_sprite and bevy_pbr are not enabled with bevy_gizmos (#11296) 2024-01-14 13:51:14 +00:00
lines.wgsl Fix float precision issue in the gizmo shader (#10408) 2023-11-14 22:36:02 +00:00
pipeline_2d.rs resolve all internal ambiguities (#10411) 2024-01-09 19:08:15 +00:00
pipeline_3d.rs resolve all internal ambiguities (#10411) 2024-01-09 19:08:15 +00:00