mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Inverse missing_docs
logic (#11676)
# Objective Currently the `missing_docs` lint is allowed-by-default and enabled at crate level when their documentations is complete (see #3492). This PR proposes to inverse this logic by making `missing_docs` warn-by-default and mark crates with imcomplete docs allowed. ## Solution Makes `missing_docs` warn at workspace level and allowed at crate level when the docs is imcomplete.
This commit is contained in:
parent
55493a823e
commit
694c06f3d0
85 changed files with 149 additions and 123 deletions
|
@ -42,6 +42,7 @@ map_flatten = "warn"
|
||||||
|
|
||||||
[workspace.lints.rust]
|
[workspace.lints.rust]
|
||||||
unsafe_op_in_unsafe_fn = "warn"
|
unsafe_op_in_unsafe_fn = "warn"
|
||||||
|
missing_docs = "warn"
|
||||||
|
|
||||||
[lints]
|
[lints]
|
||||||
workspace = true
|
workspace = true
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
//! Accessibility for Bevy
|
//! Accessibility for Bevy
|
||||||
|
|
||||||
#![warn(missing_docs)]
|
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
|
|
||||||
use std::sync::{
|
use std::sync::{
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
//! Animation for the game engine Bevy
|
//! Animation for the game engine Bevy
|
||||||
|
|
||||||
#![warn(missing_docs)]
|
|
||||||
|
|
||||||
mod animatable;
|
mod animatable;
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
//! This crate is about everything concerning the highest-level, application layer of a Bevy app.
|
//! This crate is about everything concerning the highest-level, application layer of a Bevy app.
|
||||||
|
|
||||||
#![warn(missing_docs)]
|
|
||||||
|
|
||||||
mod app;
|
mod app;
|
||||||
mod main_schedule;
|
mod main_schedule;
|
||||||
mod plugin;
|
mod plugin;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
use bevy_macro_utils::BevyManifest;
|
use bevy_macro_utils::BevyManifest;
|
||||||
use proc_macro::{Span, TokenStream};
|
use proc_macro::{Span, TokenStream};
|
||||||
use quote::{format_ident, quote};
|
use quote::{format_ident, quote};
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
pub mod io;
|
pub mod io;
|
||||||
pub mod meta;
|
pub mod meta;
|
||||||
pub mod processor;
|
pub mod processor;
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
#![warn(missing_docs)]
|
|
||||||
|
|
||||||
mod audio;
|
mod audio;
|
||||||
mod audio_output;
|
mod audio_output;
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![warn(missing_docs)]
|
|
||||||
|
|
||||||
//! This crate provides core functionality for Bevy Engine.
|
//! This crate provides core functionality for Bevy Engine.
|
||||||
|
|
||||||
mod name;
|
mod name;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
pub mod blit;
|
pub mod blit;
|
||||||
pub mod bloom;
|
pub mod bloom;
|
||||||
pub mod contrast_adaptive_sharpening;
|
pub mod contrast_adaptive_sharpening;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
extern crate proc_macro;
|
extern crate proc_macro;
|
||||||
|
|
||||||
mod app_plugin;
|
mod app_plugin;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
//! This crate provides a straightforward solution for integrating diagnostics in the [Bevy game engine](https://bevyengine.org/).
|
//! This crate provides a straightforward solution for integrating diagnostics in the [Bevy game engine](https://bevyengine.org/).
|
||||||
//! It allows users to easily add diagnostic functionality to their Bevy applications, enhancing
|
//! It allows users to easily add diagnostic functionality to their Bevy applications, enhancing
|
||||||
//! their ability to monitor and optimize their game's.
|
//! their ability to monitor and optimize their game's.
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#![warn(missing_docs)]
|
|
||||||
#![allow(clippy::single_component_path_imports)]
|
#![allow(clippy::single_component_path_imports)]
|
||||||
|
|
||||||
//! Forces dynamic linking of Bevy.
|
//! Forces dynamic linking of Bevy.
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
// FIXME(11590): remove this once the lint is fixed
|
// FIXME(11590): remove this once the lint is fixed
|
||||||
#![allow(unsafe_op_in_unsafe_fn)]
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
mod loader;
|
mod loader;
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
|
//! In this example we will simulate a population of entities. In every tick we will:
|
||||||
|
//! 1. spawn a new entity with a certain possibility
|
||||||
|
//! 2. age all entities
|
||||||
|
//! 3. despawn entities with age > 2
|
||||||
|
//!
|
||||||
|
//! To demonstrate change detection, there are some console outputs based on changes in
|
||||||
|
//! the `EntityCounter` resource and updated Age components
|
||||||
|
|
||||||
use bevy_ecs::prelude::*;
|
use bevy_ecs::prelude::*;
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
// In this example we will simulate a population of entities. In every tick we will:
|
|
||||||
// 1. spawn a new entity with a certain possibility
|
|
||||||
// 2. age all entities
|
|
||||||
// 3. despawn entities with age > 2
|
|
||||||
//
|
|
||||||
// To demonstrate change detection, there are some console outputs based on changes in
|
|
||||||
// the EntityCounter resource and updated Age components
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Create a new empty World to hold our Entities, Components and Resources
|
// Create a new empty World to hold our Entities, Components and Resources
|
||||||
let mut world = World::new();
|
let mut world = World::new();
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
|
//! In this example a system sends a custom event with a 50/50 chance during any frame.
|
||||||
|
//! If an event was send, it will be printed by the console in a receiving system.
|
||||||
|
|
||||||
use bevy_ecs::prelude::*;
|
use bevy_ecs::prelude::*;
|
||||||
|
|
||||||
// In this example a system sends a custom event with a 50/50 chance during any frame.
|
|
||||||
// If an event was send, it will be printed by the console in a receiving system.
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Create a new empty world and add the event as a resource
|
// Create a new empty world and add the event as a resource
|
||||||
let mut world = World::new();
|
let mut world = World::new();
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
|
//! In this example we add a counter resource and increase it's value in one system,
|
||||||
|
//! while a different system prints the current count to the console.
|
||||||
|
|
||||||
use bevy_ecs::prelude::*;
|
use bevy_ecs::prelude::*;
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
|
||||||
// In this example we add a counter resource and increase it's value in one system,
|
|
||||||
// while a different system prints the current count to the console.
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Create a world
|
// Create a world
|
||||||
let mut world = World::new();
|
let mut world = World::new();
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
extern crate proc_macro;
|
extern crate proc_macro;
|
||||||
|
|
||||||
mod component;
|
mod component;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// FIXME(11590): remove this once the lint is fixed
|
// FIXME(11590): remove this once the lint is fixed
|
||||||
#![allow(unsafe_op_in_unsafe_fn)]
|
#![allow(unsafe_op_in_unsafe_fn)]
|
||||||
#![warn(missing_docs)]
|
|
||||||
#![doc = include_str!("../README.md")]
|
#![doc = include_str!("../README.md")]
|
||||||
|
|
||||||
#[cfg(target_pointer_width = "16")]
|
#[cfg(target_pointer_width = "16")]
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
use bevy_macro_utils::BevyManifest;
|
use bevy_macro_utils::BevyManifest;
|
||||||
use encase_derive_impl::{implement, syn};
|
use encase_derive_impl::{implement, syn};
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
//! This crate is built on top of [GilRs](gilrs), a library
|
//! This crate is built on top of [GilRs](gilrs), a library
|
||||||
//! that handles abstracting over platform-specific gamepad APIs.
|
//! that handles abstracting over platform-specific gamepad APIs.
|
||||||
|
|
||||||
#![warn(missing_docs)]
|
|
||||||
|
|
||||||
mod converter;
|
mod converter;
|
||||||
mod gilrs_system;
|
mod gilrs_system;
|
||||||
mod rumble;
|
mod rumble;
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![warn(missing_docs)]
|
|
||||||
|
|
||||||
//! This crate adds an immediate mode drawing api to Bevy for visual debugging.
|
//! This crate adds an immediate mode drawing api to Bevy for visual debugging.
|
||||||
//!
|
//!
|
||||||
//! # Example
|
//! # Example
|
||||||
|
@ -79,7 +77,7 @@ use bevy_render::{
|
||||||
renderer::RenderDevice,
|
renderer::RenderDevice,
|
||||||
Extract, ExtractSchedule, Render, RenderApp, RenderSet,
|
Extract, ExtractSchedule, Render, RenderApp, RenderSet,
|
||||||
};
|
};
|
||||||
use bevy_utils::{tracing::warn, HashMap};
|
use bevy_utils::HashMap;
|
||||||
use config::{
|
use config::{
|
||||||
DefaultGizmoConfigGroup, GizmoConfig, GizmoConfigGroup, GizmoConfigStore, GizmoMeshConfig,
|
DefaultGizmoConfigGroup, GizmoConfig, GizmoConfigGroup, GizmoConfigStore, GizmoMeshConfig,
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
//!
|
//!
|
||||||
//! The [glTF 2.0 specification](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html) defines the format of the glTF files.
|
//! The [glTF 2.0 specification](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html) defines the format of the glTF files.
|
||||||
|
|
||||||
#![warn(missing_docs)]
|
|
||||||
|
|
||||||
#[cfg(feature = "bevy_animation")]
|
#[cfg(feature = "bevy_animation")]
|
||||||
use bevy_animation::AnimationClip;
|
use bevy_animation::AnimationClip;
|
||||||
use bevy_utils::HashMap;
|
use bevy_utils::HashMap;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#![warn(missing_docs)]
|
|
||||||
//! Parent-child relationships for Bevy entities.
|
//! Parent-child relationships for Bevy entities.
|
||||||
//!
|
//!
|
||||||
//! You should use the tools in this crate
|
//! You should use the tools in this crate
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![warn(missing_docs)]
|
|
||||||
|
|
||||||
//! Input functionality for the [Bevy game engine](https://bevyengine.org/).
|
//! Input functionality for the [Bevy game engine](https://bevyengine.org/).
|
||||||
//!
|
//!
|
||||||
//! # Supported input devices
|
//! # Supported input devices
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#![warn(missing_docs)]
|
|
||||||
//! This module is separated into its own crate to enable simple dynamic linking for Bevy, and should not be used directly
|
//! This module is separated into its own crate to enable simple dynamic linking for Bevy, and should not be used directly
|
||||||
|
|
||||||
/// `use bevy::prelude::*;` to import common components, bundles, and plugins.
|
/// `use bevy::prelude::*;` to import common components, bundles, and plugins.
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#![warn(missing_docs)]
|
|
||||||
//! This crate provides logging functions and configuration for [Bevy](https://bevyengine.org)
|
//! This crate provides logging functions and configuration for [Bevy](https://bevyengine.org)
|
||||||
//! apps, and automatically configures platform specific log handlers (i.e. WASM or Android).
|
//! apps, and automatically configures platform specific log handlers (i.e. WASM or Android).
|
||||||
//!
|
//!
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#![warn(missing_docs)]
|
|
||||||
#![deny(unsafe_code)]
|
#![deny(unsafe_code)]
|
||||||
//! A collection of helper types and functions for working on macros within the Bevy ecosystem.
|
//! A collection of helper types and functions for working on macros within the Bevy ecosystem.
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
//! matrices like [`Mat2`], [`Mat3`] and [`Mat4`] and orientation representations
|
//! matrices like [`Mat2`], [`Mat3`] and [`Mat4`] and orientation representations
|
||||||
//! like [`Quat`].
|
//! like [`Quat`].
|
||||||
|
|
||||||
#![warn(missing_docs)]
|
|
||||||
|
|
||||||
mod affine3;
|
mod affine3;
|
||||||
mod aspect_ratio;
|
mod aspect_ratio;
|
||||||
pub mod bounding;
|
pub mod bounding;
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
|
//! This example demonstrates how to generate a mesh.
|
||||||
|
|
||||||
#![allow(clippy::bool_assert_comparison, clippy::useless_conversion)]
|
#![allow(clippy::bool_assert_comparison, clippy::useless_conversion)]
|
||||||
|
|
||||||
use glam::{Vec2, Vec3};
|
use glam::{Vec2, Vec3};
|
||||||
|
|
||||||
pub type Face = [u32; 3];
|
type Face = [u32; 3];
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Vertex {
|
struct Vertex {
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
clippy::all,
|
clippy::all,
|
||||||
clippy::undocumented_unsafe_blocks
|
clippy::undocumented_unsafe_blocks
|
||||||
)]
|
)]
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
use glam::{Vec2, Vec3};
|
use glam::{Vec2, Vec3};
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
pub mod wireframe;
|
pub mod wireframe;
|
||||||
|
|
||||||
mod alpha;
|
mod alpha;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#![doc = include_str!("../README.md")]
|
#![doc = include_str!("../README.md")]
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![warn(missing_docs)]
|
|
||||||
|
|
||||||
use core::fmt::{self, Formatter, Pointer};
|
use core::fmt::{self, Formatter, Pointer};
|
||||||
use core::{
|
use core::{
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
//! Reflection in Rust.
|
//! Reflection in Rust.
|
||||||
//!
|
//!
|
||||||
//! [Reflection] is a powerful tool provided within many programming languages
|
//! [Reflection] is a powerful tool provided within many programming languages
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![warn(missing_docs)]
|
|
||||||
|
|
||||||
pub mod access;
|
pub mod access;
|
||||||
pub use access::*;
|
pub use access::*;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
mod as_bind_group;
|
mod as_bind_group;
|
||||||
mod extract_component;
|
mod extract_component;
|
||||||
mod extract_resource;
|
mod extract_resource;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
#[cfg(target_pointer_width = "16")]
|
#[cfg(target_pointer_width = "16")]
|
||||||
compile_error!("bevy_render cannot compile for a 16-bit platform.");
|
compile_error!("bevy_render cannot compile for a 16-bit platform.");
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
//! # }
|
//! # }
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
#![warn(missing_docs)]
|
|
||||||
|
|
||||||
mod dim2;
|
mod dim2;
|
||||||
pub use dim2::{CircleMeshBuilder, EllipseMeshBuilder};
|
pub use dim2::{CircleMeshBuilder, EllipseMeshBuilder};
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
//! instantiated or removed from a world to allow composition. Scenes can be serialized/deserialized,
|
//! instantiated or removed from a world to allow composition. Scenes can be serialized/deserialized,
|
||||||
//! for example to save part of the world state to a file.
|
//! for example to save part of the world state to a file.
|
||||||
|
|
||||||
#![warn(missing_docs)]
|
|
||||||
|
|
||||||
mod bundle;
|
mod bundle;
|
||||||
mod dynamic_scene;
|
mod dynamic_scene;
|
||||||
mod dynamic_scene_builder;
|
mod dynamic_scene_builder;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
//! Provides 2D sprite rendering functionality.
|
//! Provides 2D sprite rendering functionality.
|
||||||
mod bundle;
|
mod bundle;
|
||||||
mod dynamic_texture_atlas_builder;
|
mod dynamic_texture_atlas_builder;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
|
//! This sample demonstrates creating a thread pool with 4 tasks and spawning 40 tasks that spin
|
||||||
|
//! for 100ms. It's expected to take about a second to run (assuming the machine has >= 4 logical
|
||||||
|
//! cores)
|
||||||
|
|
||||||
use bevy_tasks::TaskPoolBuilder;
|
use bevy_tasks::TaskPoolBuilder;
|
||||||
use web_time::{Duration, Instant};
|
use web_time::{Duration, Instant};
|
||||||
|
|
||||||
// This sample demonstrates creating a thread pool with 4 tasks and spawning 40 tasks that spin
|
|
||||||
// for 100ms. It's expected to take about a second to run (assuming the machine has >= 4 logical
|
|
||||||
// cores)
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let pool = TaskPoolBuilder::new()
|
let pool = TaskPoolBuilder::new()
|
||||||
.thread_name("Busy Behavior ThreadPool".to_string())
|
.thread_name("Busy Behavior ThreadPool".to_string())
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
|
//! This sample demonstrates a thread pool with one thread per logical core and only one task
|
||||||
|
//! spinning. Other than the one thread, the system should remain idle, demonstrating good behavior
|
||||||
|
//! for small workloads.
|
||||||
|
|
||||||
use bevy_tasks::TaskPoolBuilder;
|
use bevy_tasks::TaskPoolBuilder;
|
||||||
use web_time::{Duration, Instant};
|
use web_time::{Duration, Instant};
|
||||||
|
|
||||||
// This sample demonstrates a thread pool with one thread per logical core and only one task
|
|
||||||
// spinning. Other than the one thread, the system should remain idle, demonstrating good behavior
|
|
||||||
// for small workloads.
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let pool = TaskPoolBuilder::new()
|
let pool = TaskPoolBuilder::new()
|
||||||
.thread_name("Idle Behavior ThreadPool".to_string())
|
.thread_name("Idle Behavior ThreadPool".to_string())
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#![warn(missing_docs)]
|
|
||||||
#![doc = include_str!("../README.md")]
|
#![doc = include_str!("../README.md")]
|
||||||
|
|
||||||
mod slice;
|
mod slice;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
mod error;
|
mod error;
|
||||||
mod font;
|
mod font;
|
||||||
mod font_atlas;
|
mod font_atlas;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#![warn(missing_docs)]
|
|
||||||
#![doc = include_str!("../README.md")]
|
#![doc = include_str!("../README.md")]
|
||||||
|
|
||||||
/// Common run conditions
|
/// Common run conditions
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#![warn(missing_docs)]
|
|
||||||
#![doc = include_str!("../README.md")]
|
#![doc = include_str!("../README.md")]
|
||||||
|
|
||||||
pub mod commands;
|
pub mod commands;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
//! This crate contains Bevy's UI system, which can be used to create UI for both 2D and 3D games
|
//! This crate contains Bevy's UI system, which can be used to create UI for both 2D and 3D games
|
||||||
//! # Basic usage
|
//! # Basic usage
|
||||||
//! Spawn UI elements with [`node_bundles::ButtonBundle`], [`node_bundles::ImageBundle`], [`node_bundles::TextBundle`] and [`node_bundles::NodeBundle`]
|
//! Spawn UI elements with [`node_bundles::ButtonBundle`], [`node_bundles::ImageBundle`], [`node_bundles::TextBundle`] and [`node_bundles::NodeBundle`]
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// FIXME(3492): remove once docs are ready
|
||||||
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
use proc_macro::TokenStream;
|
use proc_macro::TokenStream;
|
||||||
use quote::{format_ident, quote};
|
use quote::{format_ident, quote};
|
||||||
use syn::{
|
use syn::{
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
//! [Bevy]: https://bevyengine.org/
|
//! [Bevy]: https://bevyengine.org/
|
||||||
//!
|
//!
|
||||||
|
|
||||||
#![warn(missing_docs)]
|
|
||||||
|
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
pub mod prelude {
|
pub mod prelude {
|
||||||
pub use crate::default;
|
pub use crate::default;
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#![warn(missing_docs)]
|
|
||||||
//! `bevy_window` provides a platform-agnostic interface for windowing in Bevy.
|
//! `bevy_window` provides a platform-agnostic interface for windowing in Bevy.
|
||||||
//!
|
//!
|
||||||
//! This crate contains types for window management and events,
|
//! This crate contains types for window management and events,
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#![warn(missing_docs)]
|
|
||||||
//! `bevy_winit` provides utilities to handle window creation and the eventloop through [`winit`]
|
//! `bevy_winit` provides utilities to handle window creation and the eventloop through [`winit`]
|
||||||
//!
|
//!
|
||||||
//! Most commonly, the [`WinitPlugin`] is used as part of
|
//! Most commonly, the [`WinitPlugin`] is used as part of
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![warn(missing_docs)]
|
|
||||||
|
|
||||||
use accesskit_winit::Adapter;
|
use accesskit_winit::Adapter;
|
||||||
use bevy_a11y::{
|
use bevy_a11y::{
|
||||||
accesskit::{NodeBuilder, NodeClassSet, NodeId, Role, Tree, TreeUpdate},
|
accesskit::{NodeBuilder, NodeClassSet, NodeId, Role, Tree, TreeUpdate},
|
||||||
|
|
|
@ -25,7 +25,7 @@ fn main() {
|
||||||
struct MyRoundGizmos {}
|
struct MyRoundGizmos {}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Resource)]
|
#[derive(Debug, Clone, Resource)]
|
||||||
pub struct PrimitiveSegments(usize);
|
struct PrimitiveSegments(usize);
|
||||||
impl Default for PrimitiveSegments {
|
impl Default for PrimitiveSegments {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self(10)
|
Self(10)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// ! This example demonstrates how to create a custom mesh,
|
//! This example demonstrates how to create a custom mesh,
|
||||||
// ! assign a custom UV mapping for a custom texture,
|
//! assign a custom UV mapping for a custom texture,
|
||||||
// ! and how to change the UV mapping at run-time.
|
//! and how to change the UV mapping at run-time.
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy::render::{
|
use bevy::render::{
|
||||||
mesh::{Indices, VertexAttributeValues},
|
mesh::{Indices, VertexAttributeValues},
|
||||||
|
|
|
@ -87,8 +87,8 @@ impl Material for LineMaterial {
|
||||||
|
|
||||||
/// A list of lines with a start and end position
|
/// A list of lines with a start and end position
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct LineList {
|
struct LineList {
|
||||||
pub lines: Vec<(Vec3, Vec3)>,
|
lines: Vec<(Vec3, Vec3)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<LineList> for Mesh {
|
impl From<LineList> for Mesh {
|
||||||
|
@ -108,8 +108,8 @@ impl From<LineList> for Mesh {
|
||||||
|
|
||||||
/// A list of points that will have a line drawn between each consecutive points
|
/// A list of points that will have a line drawn between each consecutive points
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct LineStrip {
|
struct LineStrip {
|
||||||
pub points: Vec<Vec3>,
|
points: Vec<Vec3>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<LineStrip> for Mesh {
|
impl From<LineStrip> for Mesh {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! Illustrates spot lights.
|
||||||
|
|
||||||
use std::f32::consts::*;
|
use std::f32::consts::*;
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
|
|
|
@ -704,7 +704,7 @@ impl Material for ColorGradientMaterial {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
||||||
pub struct ColorGradientMaterial {}
|
struct ColorGradientMaterial {}
|
||||||
|
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
struct CameraTransform(Transform);
|
struct CameraTransform(Transform);
|
||||||
|
|
|
@ -6,7 +6,7 @@ use bevy::{
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub struct Curve(CubicCurve<Vec3>);
|
struct Curve(CubicCurve<Vec3>);
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
App::new()
|
App::new()
|
||||||
|
@ -72,11 +72,7 @@ fn setup(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn animate_cube(
|
fn animate_cube(time: Res<Time>, mut query: Query<(&mut Transform, &Curve)>, mut gizmos: Gizmos) {
|
||||||
time: Res<Time>,
|
|
||||||
mut query: Query<(&mut Transform, &Curve)>,
|
|
||||||
mut gizmos: Gizmos,
|
|
||||||
) {
|
|
||||||
let t = (time.elapsed_seconds().sin() + 1.) / 2.;
|
let t = (time.elapsed_seconds().sin() + 1.) / 2.;
|
||||||
|
|
||||||
for (mut transform, cubic_curve) in &mut query {
|
for (mut transform, cubic_curve) in &mut query {
|
||||||
|
|
|
@ -20,7 +20,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// This "print message plugin" prints a `message` every `wait_duration`
|
// This "print message plugin" prints a `message` every `wait_duration`
|
||||||
pub struct PrintMessagePlugin {
|
struct PrintMessagePlugin {
|
||||||
// Put your plugin configuration here
|
// Put your plugin configuration here
|
||||||
wait_duration: Duration,
|
wait_duration: Duration,
|
||||||
message: String,
|
message: String,
|
||||||
|
|
|
@ -34,7 +34,7 @@ impl PluginGroup for HelloWorldPlugins {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct PrintHelloPlugin;
|
struct PrintHelloPlugin;
|
||||||
|
|
||||||
impl Plugin for PrintHelloPlugin {
|
impl Plugin for PrintHelloPlugin {
|
||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
|
@ -46,7 +46,7 @@ fn print_hello_system() {
|
||||||
info!("hello");
|
info!("hello");
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct PrintWorldPlugin;
|
struct PrintWorldPlugin;
|
||||||
|
|
||||||
impl Plugin for PrintWorldPlugin {
|
impl Plugin for PrintWorldPlugin {
|
||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
|
|
|
@ -16,12 +16,12 @@ use std::marker::PhantomData;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
#[derive(Asset, TypePath)]
|
#[derive(Asset, TypePath)]
|
||||||
pub struct GzAsset {
|
struct GzAsset {
|
||||||
pub uncompressed: ErasedLoadedAsset,
|
uncompressed: ErasedLoadedAsset,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct GzAssetLoader;
|
struct GzAssetLoader;
|
||||||
|
|
||||||
/// Possible errors that can be produced by [`GzAssetLoader`]
|
/// Possible errors that can be produced by [`GzAssetLoader`]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
|
|
|
@ -11,12 +11,13 @@ use serde::Deserialize;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
#[derive(Asset, TypePath, Debug, Deserialize)]
|
#[derive(Asset, TypePath, Debug, Deserialize)]
|
||||||
pub struct CustomAsset {
|
struct CustomAsset {
|
||||||
pub value: i32,
|
#[allow(dead_code)]
|
||||||
|
value: i32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct CustomAssetLoader;
|
struct CustomAssetLoader;
|
||||||
|
|
||||||
/// Possible errors that can be produced by [`CustomAssetLoader`]
|
/// Possible errors that can be produced by [`CustomAssetLoader`]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
|
@ -54,12 +55,12 @@ impl AssetLoader for CustomAssetLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Asset, TypePath, Debug)]
|
#[derive(Asset, TypePath, Debug)]
|
||||||
pub struct Blob {
|
struct Blob {
|
||||||
pub bytes: Vec<u8>,
|
bytes: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct BlobAssetLoader;
|
struct BlobAssetLoader;
|
||||||
|
|
||||||
/// Possible errors that can be produced by [`CustomAssetLoader`]
|
/// Possible errors that can be produced by [`CustomAssetLoader`]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
|
|
|
@ -107,14 +107,14 @@ impl AssetLoader for TextLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
pub struct CoolTextRon {
|
struct CoolTextRon {
|
||||||
text: String,
|
text: String,
|
||||||
dependencies: Vec<String>,
|
dependencies: Vec<String>,
|
||||||
embedded_dependencies: Vec<String>,
|
embedded_dependencies: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Asset, TypePath, Debug)]
|
#[derive(Asset, TypePath, Debug)]
|
||||||
pub struct CoolText {
|
struct CoolText {
|
||||||
text: String,
|
text: String,
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
dependencies: Vec<Handle<Text>>,
|
dependencies: Vec<Handle<Text>>,
|
||||||
|
@ -174,7 +174,7 @@ impl AssetLoader for CoolTextLoader {
|
||||||
struct CoolTextTransformer;
|
struct CoolTextTransformer;
|
||||||
|
|
||||||
#[derive(Default, Serialize, Deserialize)]
|
#[derive(Default, Serialize, Deserialize)]
|
||||||
pub struct CoolTextTransformerSettings {
|
struct CoolTextTransformerSettings {
|
||||||
appended: String,
|
appended: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// All diagnostics should have a unique DiagnosticPath.
|
// All diagnostics should have a unique DiagnosticPath.
|
||||||
pub const SYSTEM_ITERATION_COUNT: DiagnosticPath =
|
const SYSTEM_ITERATION_COUNT: DiagnosticPath = DiagnosticPath::const_new("system_iteration_count");
|
||||||
DiagnosticPath::const_new("system_iteration_count");
|
|
||||||
|
|
||||||
fn my_system(mut diagnostics: Diagnostics) {
|
fn my_system(mut diagnostics: Diagnostics) {
|
||||||
// Add a measurement of 10.0 for our diagnostic each time this system runs.
|
// Add a measurement of 10.0 for our diagnostic each time this system runs.
|
||||||
|
|
|
@ -11,10 +11,10 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub struct Player;
|
struct Player;
|
||||||
|
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
pub struct PlayerCount(usize);
|
struct PlayerCount(usize);
|
||||||
|
|
||||||
/// The [`SystemParam`] struct can contain any types that can also be included in a
|
/// The [`SystemParam`] struct can contain any types that can also be included in a
|
||||||
/// system function signature.
|
/// system function signature.
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! Demonstrate stepping through systems in order of execution.
|
||||||
|
|
||||||
use bevy::{ecs::schedule::Stepping, log::LogPlugin, prelude::*};
|
use bevy::{ecs::schedule::Stepping, log::LogPlugin, prelude::*};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! A minimal example that outputs "hello world"
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! A 3d Scene with a button and playing sound.
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
input::touch::TouchPhase,
|
input::touch::TouchPhase,
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
|
|
@ -49,7 +49,7 @@ pub struct Bar {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct NonReflectedValue {
|
struct NonReflectedValue {
|
||||||
_a: usize,
|
_a: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ pub struct C(usize);
|
||||||
|
|
||||||
/// Deriving reflect on an enum will implement the `Reflect` and `Enum` traits
|
/// Deriving reflect on an enum will implement the `Reflect` and `Enum` traits
|
||||||
#[derive(Reflect)]
|
#[derive(Reflect)]
|
||||||
pub enum D {
|
enum D {
|
||||||
A,
|
A,
|
||||||
B(usize),
|
B(usize),
|
||||||
C { value: f32 },
|
C { value: f32 },
|
||||||
|
@ -57,7 +57,7 @@ pub struct E {
|
||||||
/// that these values behave as expected when nested underneath Reflect-ed structs.
|
/// that these values behave as expected when nested underneath Reflect-ed structs.
|
||||||
#[derive(Reflect, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Reflect, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[reflect_value(PartialEq, Serialize, Deserialize)]
|
#[reflect_value(PartialEq, Serialize, Deserialize)]
|
||||||
pub enum F {
|
enum F {
|
||||||
X,
|
X,
|
||||||
Y,
|
Y,
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ impl DoThing for MyType {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[reflect_trait]
|
#[reflect_trait]
|
||||||
pub trait DoThing {
|
trait DoThing {
|
||||||
fn do_thing(&self) -> String;
|
fn do_thing(&self) -> String;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
//! This example illustrates how to create a texture for use with a `texture_2d_array<f32>` shader
|
||||||
|
//! uniform variable.
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
asset::LoadState,
|
asset::LoadState,
|
||||||
prelude::*,
|
prelude::*,
|
||||||
|
@ -5,8 +8,6 @@ use bevy::{
|
||||||
render::render_resource::{AsBindGroup, ShaderRef},
|
render::render_resource::{AsBindGroup, ShaderRef},
|
||||||
};
|
};
|
||||||
|
|
||||||
/// This example illustrates how to create a texture for use with a `texture_2d_array<f32>` shader
|
|
||||||
/// uniform variable.
|
|
||||||
fn main() {
|
fn main() {
|
||||||
App::new()
|
App::new()
|
||||||
.add_plugins((
|
.add_plugins((
|
||||||
|
|
|
@ -68,10 +68,10 @@ fn setup(mut commands: Commands, mut images: ResMut<Assets<Image>>) {
|
||||||
commands.insert_resource(GameOfLifeImage { texture: image });
|
commands.insert_resource(GameOfLifeImage { texture: image });
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct GameOfLifeComputePlugin;
|
struct GameOfLifeComputePlugin;
|
||||||
|
|
||||||
#[derive(Debug, Hash, PartialEq, Eq, Clone, RenderLabel)]
|
#[derive(Debug, Hash, PartialEq, Eq, Clone, RenderLabel)]
|
||||||
pub struct GameOfLifeLabel;
|
struct GameOfLifeLabel;
|
||||||
|
|
||||||
impl Plugin for GameOfLifeComputePlugin {
|
impl Plugin for GameOfLifeComputePlugin {
|
||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
|
@ -121,7 +121,7 @@ fn prepare_bind_group(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
pub struct GameOfLifePipeline {
|
struct GameOfLifePipeline {
|
||||||
texture_bind_group_layout: BindGroupLayout,
|
texture_bind_group_layout: BindGroupLayout,
|
||||||
init_pipeline: CachedComputePipelineId,
|
init_pipeline: CachedComputePipelineId,
|
||||||
update_pipeline: CachedComputePipelineId,
|
update_pipeline: CachedComputePipelineId,
|
||||||
|
|
|
@ -58,7 +58,7 @@ fn setup(
|
||||||
|
|
||||||
// This is the struct that will be passed to your shader
|
// This is the struct that will be passed to your shader
|
||||||
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
||||||
pub struct CustomMaterial {
|
struct CustomMaterial {
|
||||||
#[uniform(0)]
|
#[uniform(0)]
|
||||||
color: Color,
|
color: Color,
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,7 @@ impl Plugin for PostProcessPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Hash, PartialEq, Eq, Clone, RenderLabel)]
|
#[derive(Debug, Hash, PartialEq, Eq, Clone, RenderLabel)]
|
||||||
pub struct PostProcessLabel;
|
struct PostProcessLabel;
|
||||||
|
|
||||||
// The post process node used for the render graph
|
// The post process node used for the render graph
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
|
|
@ -76,7 +76,7 @@ impl Material for CustomMaterial {
|
||||||
// This is the struct that will be passed to your shader
|
// This is the struct that will be passed to your shader
|
||||||
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
||||||
#[bind_group_data(CustomMaterialKey)]
|
#[bind_group_data(CustomMaterialKey)]
|
||||||
pub struct CustomMaterial {
|
struct CustomMaterial {
|
||||||
#[uniform(0)]
|
#[uniform(0)]
|
||||||
color: Color,
|
color: Color,
|
||||||
is_red: bool,
|
is_red: bool,
|
||||||
|
@ -87,7 +87,7 @@ pub struct CustomMaterial {
|
||||||
// Specialization keys should be kept as small / cheap to hash as possible,
|
// Specialization keys should be kept as small / cheap to hash as possible,
|
||||||
// as they will be used to look up the pipeline for each drawn entity with this material type.
|
// as they will be used to look up the pipeline for each drawn entity with this material type.
|
||||||
#[derive(Eq, PartialEq, Hash, Clone)]
|
#[derive(Eq, PartialEq, Hash, Clone)]
|
||||||
pub struct CustomMaterialKey {
|
struct CustomMaterialKey {
|
||||||
is_red: bool,
|
is_red: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ impl ExtractComponent for InstanceMaterialData {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct CustomMaterialPlugin;
|
struct CustomMaterialPlugin;
|
||||||
|
|
||||||
impl Plugin for CustomMaterialPlugin {
|
impl Plugin for CustomMaterialPlugin {
|
||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
|
@ -151,7 +151,7 @@ fn queue_custom(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
pub struct InstanceBuffer {
|
struct InstanceBuffer {
|
||||||
buffer: Buffer,
|
buffer: Buffer,
|
||||||
length: usize,
|
length: usize,
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,7 @@ fn prepare_instance_buffers(
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
pub struct CustomPipeline {
|
struct CustomPipeline {
|
||||||
shader: Handle<Shader>,
|
shader: Handle<Shader>,
|
||||||
mesh_pipeline: MeshPipeline,
|
mesh_pipeline: MeshPipeline,
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ type DrawCustom = (
|
||||||
DrawMeshInstanced,
|
DrawMeshInstanced,
|
||||||
);
|
);
|
||||||
|
|
||||||
pub struct DrawMeshInstanced;
|
struct DrawMeshInstanced;
|
||||||
|
|
||||||
impl<P: PhaseItem> RenderCommand<P> for DrawMeshInstanced {
|
impl<P: PhaseItem> RenderCommand<P> for DrawMeshInstanced {
|
||||||
type Param = (SRes<RenderAssets<Mesh>>, SRes<RenderMeshInstances>);
|
type Param = (SRes<RenderAssets<Mesh>>, SRes<RenderMeshInstances>);
|
||||||
|
|
|
@ -41,7 +41,7 @@ fn setup(
|
||||||
|
|
||||||
// This struct defines the data that will be passed to your shader
|
// This struct defines the data that will be passed to your shader
|
||||||
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
||||||
pub struct CustomMaterial {
|
struct CustomMaterial {
|
||||||
#[uniform(0)]
|
#[uniform(0)]
|
||||||
color: Color,
|
color: Color,
|
||||||
#[texture(1)]
|
#[texture(1)]
|
||||||
|
|
|
@ -41,7 +41,7 @@ fn setup(
|
||||||
|
|
||||||
// This is the struct that will be passed to your shader
|
// This is the struct that will be passed to your shader
|
||||||
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
||||||
pub struct CustomMaterial {
|
struct CustomMaterial {
|
||||||
#[uniform(0)]
|
#[uniform(0)]
|
||||||
color: Color,
|
color: Color,
|
||||||
#[texture(1)]
|
#[texture(1)]
|
||||||
|
|
|
@ -47,7 +47,7 @@ fn setup(
|
||||||
|
|
||||||
// This is the struct that will be passed to your shader
|
// This is the struct that will be passed to your shader
|
||||||
#[derive(Asset, TypePath, AsBindGroup, Clone)]
|
#[derive(Asset, TypePath, AsBindGroup, Clone)]
|
||||||
pub struct CustomMaterial {
|
struct CustomMaterial {
|
||||||
#[uniform(0)]
|
#[uniform(0)]
|
||||||
color: Color,
|
color: Color,
|
||||||
#[texture(1)]
|
#[texture(1)]
|
||||||
|
|
|
@ -70,7 +70,7 @@ fn rotate_camera(mut camera: Query<&mut Transform, With<MainCamera>>, time: Res<
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
||||||
pub struct CustomMaterial {
|
struct CustomMaterial {
|
||||||
#[texture(0)]
|
#[texture(0)]
|
||||||
#[sampler(1)]
|
#[sampler(1)]
|
||||||
texture: Handle<Image>,
|
texture: Handle<Image>,
|
||||||
|
|
|
@ -157,7 +157,7 @@ fn setup(
|
||||||
|
|
||||||
// This is the struct that will be passed to your shader
|
// This is the struct that will be passed to your shader
|
||||||
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
||||||
pub struct CustomMaterial {
|
struct CustomMaterial {
|
||||||
#[uniform(0)]
|
#[uniform(0)]
|
||||||
color: Color,
|
color: Color,
|
||||||
#[texture(1)]
|
#[texture(1)]
|
||||||
|
@ -205,7 +205,7 @@ struct ShowPrepassSettings {
|
||||||
|
|
||||||
// This shader simply loads the prepass texture and outputs it directly
|
// This shader simply loads the prepass texture and outputs it directly
|
||||||
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
#[derive(Asset, TypePath, AsBindGroup, Debug, Clone)]
|
||||||
pub struct PrepassOutputMaterial {
|
struct PrepassOutputMaterial {
|
||||||
#[uniform(0)]
|
#[uniform(0)]
|
||||||
settings: ShowPrepassSettings,
|
settings: ShowPrepassSettings,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/// General UI benchmark that stress tests layouting, text, interaction and rendering
|
//! General UI benchmark that stress tests layouting, text, interaction and rendering
|
||||||
|
|
||||||
use argh::FromArgs;
|
use argh::FromArgs;
|
||||||
use bevy::{
|
use bevy::{
|
||||||
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
|
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! Test rendering of many gizmos.
|
||||||
|
|
||||||
use std::f32::consts::TAU;
|
use std::f32::consts::TAU;
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! An example that illustrates how Time is handled in ECS.
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
|
||||||
use std::io::{self, BufRead};
|
use std::io::{self, BufRead};
|
||||||
|
|
|
@ -12,12 +12,12 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Component, Deref, DerefMut)]
|
#[derive(Component, Deref, DerefMut)]
|
||||||
pub struct PrintOnCompletionTimer(Timer);
|
struct PrintOnCompletionTimer(Timer);
|
||||||
|
|
||||||
#[derive(Resource)]
|
#[derive(Resource)]
|
||||||
pub struct Countdown {
|
struct Countdown {
|
||||||
pub percent_trigger: Timer,
|
percent_trigger: Timer,
|
||||||
pub main_timer: Timer,
|
main_timer: Timer,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Countdown {
|
impl Countdown {
|
||||||
|
|
Loading…
Reference in a new issue