diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 948c1c0..074e9c1 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -2,19 +2,16 @@ ## Project Overview -Rust workspace with turtle graphics implementations. **Primary focus: `turtle-lib-macroquad`** - lightweight library using Macroquad + Lyon for GPU-accelerated rendering. +Rust workspace with turtle graphics implementations. **Primary focus: `turtle-lib`** - lightweight library using Macroquad + Lyon for GPU-accelerated rendering. ### Workspace Structure ``` -turtle/ -├── turtle-lib-macroquad/ # MAIN LIBRARY - Macroquad + Lyon (focus here) -├── turtle-lib-macroquad-macros/ # Proc macro for turtle_main -├── turtle-lib/ # Legacy Bevy 0.17.1 implementation (maintenance only) -├── turtle-example/ # Legacy examples -└── turtle-ui/ # UI components +turtlers/ +├── turtle-lib/ # MAIN LIBRARY - Macroquad + Lyon (focus here) +└── turtle-lib-macros/ # Proc macro for turtle_main ``` -## Architecture (`turtle-lib-macroquad`) +## Architecture (`turtle-lib`) ### Core Design Pattern: Command Queue + Tweening - **Builder API** (`TurtlePlan`) accumulates commands @@ -64,20 +61,20 @@ All drawing → Lyon → GPU mesh → Macroquad rendering ### Building & Testing ```bash # Main library -cargo build --package turtle-lib-macroquad -cargo test --package turtle-lib-macroquad -cargo clippy --package turtle-lib-macroquad -- -Wclippy::pedantic \ +cargo build --package turtle-lib +cargo test --package turtle-lib +cargo clippy --package turtle-lib -- -Wclippy::pedantic \ -Aclippy::cast_precision_loss -Aclippy::cast_sign_loss -Aclippy::cast_possible_truncation # Run examples (15+ examples available) -cargo run --package turtle-lib-macroquad --example hello_turtle -cargo run --package turtle-lib-macroquad --example yinyang -cargo run --package turtle-lib-macroquad --example cheese_macro +cargo run --package turtle-lib --example hello_turtle +cargo run --package turtle-lib --example yinyang +cargo run --package turtle-lib --example cheese_macro ``` ### Macro Crate ```bash -cargo build --package turtle-lib-macroquad-macros +cargo build --package turtle-lib-macros ``` ### Code Quality Standards @@ -91,7 +88,7 @@ cargo build --package turtle-lib-macroquad-macros ### 1. The `turtle_main` Macro (PREFERRED for examples) Simplest way to create turtle programs: ```rust -use turtle_lib_macroquad::*; +use turtle_lib::*; #[turtle_main("Window Title")] fn draw(turtle: &mut TurtlePlan) { @@ -102,7 +99,7 @@ fn draw(turtle: &mut TurtlePlan) { Generates: window setup + render loop + quit handling (ESC/Q) ### 2. Import Convention -Only need: `use turtle_lib_macroquad::*;` +Only need: `use turtle_lib::*;` - Re-exports: `vec2`, `RED/BLUE/GREEN/etc`, all turtle types - No `use macroquad::prelude::*` needed (causes unused warnings) @@ -155,12 +152,12 @@ async fn main() { ### Adding Example - Prefer `turtle_main` macro for simplicity -- Use only `use turtle_lib_macroquad::*;` +- Use only `use turtle_lib::*;` - Keep examples focused (one concept each) - See `examples/hello_turtle.rs` for minimal template ### Debugging Lyon Issues -- Enable tracing: `RUST_LOG=turtle_lib_macroquad=debug cargo run` +- Enable tracing: `RUST_LOG=turtle_lib=debug cargo run` - Check `tessellation.rs` for Lyon API usage - EvenOdd fill rule: holes must have opposite winding @@ -182,14 +179,13 @@ async fn main() { - Don't add `use macroquad::prelude::*` in examples when not required - Don't manually triangulate - use Lyon functions - Don't add commands for Forward/Backward separately (use Move) -- Don't modify `turtle-lib` (Bevy) unless specifically needed - Don't create summary/comparison docs unless requested ## Key Documentation Files - `README.md` - Main API docs -- `turtle-lib-macroquad/README.md` - Library-specific docs -- `turtle-lib-macroquad-macros/README.md` - Macro docs +- `turtle-lib/README.md` - Library-specific docs +- `turtle-lib-macros/README.md` - Macro docs ## Response Style diff --git a/Cargo.toml b/Cargo.toml index acb2c14..d9be37b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,7 @@ [workspace] resolver = "2" -members = [ - "turtle-lib", - "turtle-example", - "turtle-lib-macroquad", - "turtle-lib-macroquad-macros", -] +members = ["turtle-lib", "turtle-lib-macros"] [workspace.dependencies] diff --git a/README.md b/README.md index 31b910a..8375ee0 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ A modern turtle graphics library for Rust built on [Macroquad](https://macroquad ```rust use macroquad::prelude::*; -use turtle_lib_macroquad::*; +use turtle_lib::*; #[macroquad::main("Turtle")] async fn main() { @@ -169,19 +169,18 @@ Control verbosity with the `RUST_LOG` environment variable: ```bash # Show debug output -RUST_LOG=turtle_lib_macroquad=debug cargo run +RUST_LOG=turtle_lib=debug cargo run # Very verbose trace output -RUST_LOG=turtle_lib_macroquad=trace cargo run +RUST_LOG=turtle_lib=trace cargo run ``` -**See the complete example**: [`examples/logging_example.rs`](turtle-lib-macroquad/examples/logging_example.rs) demonstrates initialization, log levels, filtering, and example output. +**See the complete example**: [`examples/logging_example.rs`](turtle-lib/examples/logging_example.rs) demonstrates initialization, log levels, filtering, and example output. ## Examples Run examples with: ```bash -# From turtle-lib-macroquad directory cargo run --example square cargo run --example koch cargo run --example shapes @@ -191,12 +190,7 @@ cargo run --example nikolaus # Logging example - shows how to enable debug output cargo run --example logging_example -RUST_LOG=turtle_lib_macroquad=debug cargo run --example logging_example - -# Lyon proof-of-concept examples -cargo run --package turtle-lyon-poc --example yinyang --release -cargo run --package turtle-lyon-poc --example basic_shapes --release -cargo run --package turtle-lyon-poc --example fill_comparison --release +RUST_LOG=turtle_lib=debug cargo run --example logging_example ``` ### Available Examples @@ -275,7 +269,7 @@ plan.end_fill(); // Auto-detects holes and fills correctly ### Module Structure ``` -turtle-lib-macroquad/src/ +turtle-lib/src/ ├── lib.rs - Public API and TurtleApp ├── state.rs - TurtleState and TurtleWorld ├── commands.rs - TurtleCommand enum (consolidated commands) @@ -314,14 +308,11 @@ This design eliminates ~250 lines of duplicate code while maintaining the same u ## Workspace Structure ``` -turtle/ -├── turtle-lib-macroquad/ - Main library (Macroquad + Lyon) -├── turtle-lib/ - Legacy Bevy-based implementation -└── turtle-example/ - Legacy examples +turtlers/ +├── turtle-lib/ - Main library (Macroquad + Lyon) +└── turtle-lib-macros/ - Procedural macros (turtle_main) ``` -The `turtle-lib-macroquad` package is the current and future focus of development. - ## Building and Running ```bash @@ -329,13 +320,10 @@ The `turtle-lib-macroquad` package is the current and future focus of developmen cargo check # Run specific example -cargo run --package turtle-lib-macroquad --example yinyang +cargo run --example yinyang # Build release version cargo build --release - -# Run Lyon POC examples to see future rendering -cargo run --package turtle-lyon-poc --example yinyang --release ``` ## Development Status diff --git a/turtle-example/Cargo.toml b/turtle-example/Cargo.toml deleted file mode 100644 index 6ff0e34..0000000 --- a/turtle-example/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "turtle-example" -version = "0.1.0" -edition = "2021" -license = "MIT OR Apache-2.0" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -bevy = { workspace = true, features = ["wayland"] } -bevy_prototype_lyon = { workspace = true } -num-traits = { workspace = true } -rand = { workspace = true } -turtle-lib = { path = "../turtle-lib" } diff --git a/turtle-example/LICENSE b/turtle-example/LICENSE deleted file mode 100644 index 2071b23..0000000 --- a/turtle-example/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/turtle-example/README.md b/turtle-example/README.md deleted file mode 100644 index 9071500..0000000 --- a/turtle-example/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# turtle-example - -**⚠️ LEGACY PACKAGE - Bevy-based implementation** - -This package contains the original Bevy-based turtle implementation. - -**For current development, see [turtle-lib-macroquad](../turtle-lib-macroquad/).** -**See the [main README](../README.md) for the active project.** - -## Status - -This package is no longer actively developed. The project has moved to a Macroquad + Lyon architecture for: -- Faster compilation times -- Simpler codebase -- Better rendering quality - -Examples here are kept for reference only. - diff --git a/turtle-example/examples/interrupted_lines.rs b/turtle-example/examples/interrupted_lines.rs deleted file mode 100644 index a482720..0000000 --- a/turtle-example/examples/interrupted_lines.rs +++ /dev/null @@ -1,29 +0,0 @@ -use bevy::prelude::*; -use turtle_lib::builders::{DirectionalMovement, StopLine, Turnable}; -use turtle_lib::{get_a_turtle, TurtlePlugin}; - -use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}; - -#[derive(Component, Reflect)] -struct Egon {} - -fn main() { - App::new() - .add_plugins(TurtlePlugin) - .add_systems(Startup, setup) - //.add_systems(Update, plan) - .add_plugins(LogDiagnosticsPlugin::default()) - .add_plugins(FrameTimeDiagnosticsPlugin::default()) - .run(); -} - -fn setup(mut commands: Commands) { - let mut turtle = get_a_turtle(); - turtle.set_speed(1); - - // NOTE: pen_up() consumes self, which is why this example is incomplete - // TODO: Fix the builder API to work with the deref pattern - // let mt = turtle.pen_up(); - - commands.spawn((turtle, Egon {})); -} diff --git a/turtle-example/examples/koch.rs b/turtle-example/examples/koch.rs deleted file mode 100644 index 0f42a18..0000000 --- a/turtle-example/examples/koch.rs +++ /dev/null @@ -1,43 +0,0 @@ -use bevy::prelude::*; -use turtle_lib::builders::{DirectionalMovement, Turnable}; -use turtle_lib::turtle_bundle::AnimatedTurtle; -use turtle_lib::{get_a_turtle, TurtlePlugin}; - -use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}; - -#[derive(Component, Reflect)] -struct Egon {} - -fn main() { - App::new() - .add_plugins(TurtlePlugin) - .add_systems(Startup, setup) - //.add_systems(Update, plan) - .add_plugins(LogDiagnosticsPlugin::default()) - .add_plugins(FrameTimeDiagnosticsPlugin::default()) - .run(); -} - -fn setup(mut commands: Commands) { - let mut turtle = get_a_turtle(); - turtle.set_speed(1); - for _x in 0..3 { - koch(4, &mut turtle); - turtle.right(120); - } - commands.spawn((turtle, Egon {})); -} - -fn koch(depth: u32, turtle: &mut AnimatedTurtle) { - if depth == 0 { - turtle.forward(10); - } else { - koch(depth - 1, turtle); - turtle.left(60); - koch(depth - 1, turtle); - turtle.right(120); - koch(depth - 1, turtle); - turtle.left(60); - koch(depth - 1, turtle); - } -} diff --git a/turtle-example/examples/nikolaus.rs b/turtle-example/examples/nikolaus.rs deleted file mode 100644 index 564f9a1..0000000 --- a/turtle-example/examples/nikolaus.rs +++ /dev/null @@ -1,73 +0,0 @@ -use bevy::prelude::*; -use turtle_lib::builders::{DirectionalMovement, Turnable}; -use turtle_lib::turtle_bundle::AnimatedTurtle; -use turtle_lib::{get_a_turtle, TurtlePlugin}; - -use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}; - -#[derive(Component, Reflect)] -struct Egon {} - -fn main() { - App::new() - .add_plugins(TurtlePlugin) - .add_systems(Startup, setup) - //.add_systems(Update, plan) - .add_plugins(LogDiagnosticsPlugin::default()) - .add_plugins(FrameTimeDiagnosticsPlugin::default()) - .run(); -} - -fn setup(mut commands: Commands) { - let mut turtle = get_a_turtle(); - turtle.set_speed(500); - stern(&mut turtle); - commands.spawn((turtle, Egon {})); -} - -fn stern(turtle: &mut AnimatedTurtle) { - // Draw the roof of the house - turtle.left(45); - turtle.forward(70); - turtle.right(90); - turtle.forward(70); - turtle.left(45); - - // Draw the sides of the house - turtle.left(90); - turtle.forward(100); - turtle.left(90); - turtle.forward(50); - turtle.left(90); - turtle.forward(100); - turtle.left(90); - turtle.forward(50); - - // Draw the door of the house - turtle.left(90); - turtle.forward(25); - turtle.right(90); - turtle.forward(20); - turtle.right(90); - turtle.forward(25); - turtle.left(90); - turtle.forward(50); - - // Draw the chimney of the house - turtle.left(90); - turtle.forward(25); - turtle.right(90); - turtle.forward(10); - turtle.right(90); - turtle.forward(25); - turtle.left(90); - turtle.forward(10); - turtle.left(90); - turtle.forward(10); - turtle.right(90); - turtle.forward(25); - turtle.left(90); - turtle.forward(10); - turtle.left(90); - turtle.forward(10); -} diff --git a/turtle-example/examples/stern.rs b/turtle-example/examples/stern.rs deleted file mode 100644 index 9c7b0ca..0000000 --- a/turtle-example/examples/stern.rs +++ /dev/null @@ -1,36 +0,0 @@ -use bevy::prelude::*; -use turtle_lib::builders::{CurvedMovement, DirectionalMovement}; -use turtle_lib::turtle_bundle::AnimatedTurtle; -use turtle_lib::{get_a_turtle, TurtlePlugin}; - -use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}; - -#[derive(Component, Reflect)] -struct Egon {} - -fn main() { - App::new() - .add_plugins(TurtlePlugin) - .add_systems(Startup, setup) - //.add_systems(Update, plan) - .add_plugins(LogDiagnosticsPlugin::default()) - .add_plugins(FrameTimeDiagnosticsPlugin::default()) - .run(); -} - -fn setup(mut commands: Commands) { - let mut turtle = get_a_turtle(); - turtle.set_speed(1000); - stern(&mut turtle); - - commands.spawn((turtle, Egon {})); -} - -fn stern(turtle: &mut AnimatedTurtle) { - for _ in 0..5 { - turtle.forward(200); - turtle.circle(10, 72); - turtle.circle_right(5, 360); - turtle.circle(10, 72); - } -} diff --git a/turtle-example/examples/tweening_test.rs b/turtle-example/examples/tweening_test.rs deleted file mode 100644 index 114db69..0000000 --- a/turtle-example/examples/tweening_test.rs +++ /dev/null @@ -1,130 +0,0 @@ -use bevy::prelude::*; - -// Note: bevy_inspector_egui and bevy_tweening are not yet fully compatible with Bevy 0.17 -// This example is disabled until they are updated -// use bevy_inspector_egui::prelude::*; -// use bevy_tweening::{lens::*, *}; - -fn main() { - App::default() - .add_plugins(DefaultPlugins.set(WindowPlugin { - primary_window: Some(Window { - title: "TransformPositionLens".to_string(), - resolution: (1400, 600).into(), - present_mode: bevy::window::PresentMode::Fifo, // vsync - ..default() - }), - ..default() - })) - // .add_systems(Update, bevy::window::close_on_esc) - // .add_plugins(TweeningPlugin) - .add_systems(Startup, setup) - // .add_systems(Update, update_animation_speed) - .register_type::() - .run(); -} - -#[derive(Copy, Clone, PartialEq, Reflect, Resource)] -struct Options { - speed: f32, -} - -impl Default for Options { - fn default() -> Self { - Self { speed: 1. } - } -} - -fn setup(mut commands: Commands) { - commands.spawn(Camera2d); - - // NOTE: This example is disabled because bevy_tweening is not yet compatible with Bevy 0.17 - // Once bevy_tweening is updated, uncomment the code below - - /* - let size = 25.; - - let spacing = 1.5; - let screen_x = 570.; - let screen_y = 150.; - let mut x = -screen_x; - - for ease_function in &[ - EaseFunction::QuadraticIn, - EaseFunction::QuadraticOut, - EaseFunction::QuadraticInOut, - EaseFunction::CubicIn, - EaseFunction::CubicOut, - EaseFunction::CubicInOut, - EaseFunction::QuarticIn, - EaseFunction::QuarticOut, - EaseFunction::QuarticInOut, - EaseFunction::QuinticIn, - EaseFunction::QuinticOut, - EaseFunction::QuinticInOut, - EaseFunction::SineIn, - EaseFunction::SineOut, - EaseFunction::SineInOut, - EaseFunction::CircularIn, - EaseFunction::CircularOut, - EaseFunction::CircularInOut, - EaseFunction::ExponentialIn, - EaseFunction::ExponentialOut, - EaseFunction::ExponentialInOut, - EaseFunction::ElasticIn, - EaseFunction::ElasticOut, - EaseFunction::ElasticInOut, - EaseFunction::BackIn, - EaseFunction::BackOut, - EaseFunction::BackInOut, - EaseFunction::BounceIn, - EaseFunction::BounceOut, - EaseFunction::BounceInOut, - ] { - let tween = Tween::new( - *ease_function, - std::time::Duration::from_secs(1), - TransformPositionLens { - start: Vec3::new(x, screen_y, 0.), - end: Vec3::new(x, -screen_y, 0.), - }, - ) - .then( - Tween::new( - EaseFunction::QuadraticInOut, - std::time::Duration::from_millis(200), - TransformRotateZLens { - start: 0.05, - end: -0.05, - }, - ) - .with_repeat_strategy(bevy_tweening::RepeatStrategy::MirroredRepeat) - .with_repeat_count(RepeatCount::Infinite), - ); - - commands.spawn(( - Sprite { - color: Color::srgb(1.0, 0.0, 0.0), - custom_size: Some(Vec2::new(size, size)), - ..default() - }, - Animator::new(tween), - )); - - x += size * spacing; - } - */ -} - -fn update_animation_speed(_options: Res /*, mut animators: Query<&mut Animator>*/) { - // NOTE: This function is disabled because bevy_tweening is not yet compatible with Bevy 0.17 - /* - if !options.is_changed() { - return; - } - - for mut animator in animators.iter_mut() { - animator.set_speed(options.speed); - } - */ -} diff --git a/turtle-example/src/main.rs b/turtle-example/src/main.rs deleted file mode 100644 index 2feb013..0000000 --- a/turtle-example/src/main.rs +++ /dev/null @@ -1,37 +0,0 @@ -use bevy::prelude::*; -use turtle_lib::builders::{CurvedMovement, DirectionalMovement, Turnable}; -use turtle_lib::{get_a_turtle, TurtlePlugin}; - -use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}; - -#[derive(Component, Reflect)] -struct Egon {} - -fn main() { - App::new() - .add_plugins(TurtlePlugin) - .add_systems(Startup, setup) - //.add_system(plan) - .add_plugins(LogDiagnosticsPlugin::default()) - .add_plugins(FrameTimeDiagnosticsPlugin::default()) - .run(); -} - -fn setup(mut commands: Commands) { - let mut turtle = get_a_turtle(); - turtle.set_speed(0); - turtle.circle(50, 90); - turtle.circle_right(50, 180); - turtle.circle(50, 90); - for x in 0..1999 { - turtle.forward(x); - turtle.right(45); - turtle.forward(30); - turtle.left(90 + x); - turtle.forward(30); - turtle.right(45); - turtle.forward(x); - turtle.left(91); - } - commands.spawn((turtle, Egon {})); -} diff --git a/turtle-lib-macroquad-macros/Cargo.toml b/turtle-lib-macros/Cargo.toml similarity index 84% rename from turtle-lib-macroquad-macros/Cargo.toml rename to turtle-lib-macros/Cargo.toml index 0bbd536..fe9f050 100644 --- a/turtle-lib-macroquad-macros/Cargo.toml +++ b/turtle-lib-macros/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "turtle-lib-macroquad-macros" +name = "turtle-lib-macros" version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" diff --git a/turtle-lib-macroquad-macros/README.md b/turtle-lib-macros/README.md similarity index 92% rename from turtle-lib-macroquad-macros/README.md rename to turtle-lib-macros/README.md index 1ccceb2..770a5fc 100644 --- a/turtle-lib-macroquad-macros/README.md +++ b/turtle-lib-macros/README.md @@ -1,6 +1,6 @@ -# turtle-lib-macroquad-macros +# turtle-lib-macros -Procedural macros for `turtle-lib-macroquad`. +Procedural macros for `turtle-lib`. ## `turtle_main` Macro @@ -16,7 +16,7 @@ The `turtle_main` macro simplifies creating turtle graphics programs by automati ```rust use macroquad::prelude::*; -use turtle_lib_macroquad::*; +use turtle_lib::*; #[turtle_main("My Drawing")] fn my_drawing(turtle: &mut TurtlePlan) { @@ -31,7 +31,7 @@ fn my_drawing(turtle: &mut TurtlePlan) { ```rust use macroquad::prelude::*; -use turtle_lib_macroquad::*; +use turtle_lib::*; #[turtle_main("My Drawing")] fn my_drawing() { diff --git a/turtle-lib-macroquad-macros/src/lib.rs b/turtle-lib-macros/src/lib.rs similarity index 88% rename from turtle-lib-macroquad-macros/src/lib.rs rename to turtle-lib-macros/src/lib.rs index 8753b67..0aaf05f 100644 --- a/turtle-lib-macroquad-macros/src/lib.rs +++ b/turtle-lib-macros/src/lib.rs @@ -1,4 +1,4 @@ -//! Procedural macros for turtle-lib-macroquad +//! Procedural macros for turtle-lib //! //! This crate provides the `turtle_main` procedural macro that simplifies //! creating turtle graphics programs by automatically setting up the @@ -20,11 +20,11 @@ use syn::{parse_macro_input, ItemFn}; /// # Example /// /// ```no_run -/// use turtle_lib_macroquad::*; +/// use turtle_lib::*; /// /// #[turtle_main("My Turtle Drawing")] /// fn my_drawing(turtle: &mut TurtlePlan) { -/// // Use colors from turtle_lib_macroquad (re-exported from macroquad) +/// // Use colors from turtle_lib (re-exported from macroquad) /// turtle.set_pen_color(RED); /// turtle.forward(100.0); /// turtle.right(90.0); @@ -32,11 +32,11 @@ use syn::{parse_macro_input, ItemFn}; /// } /// ``` /// -/// If you need macroquad types not re-exported by turtle_lib_macroquad: +/// If you need macroquad types not re-exported by turtle_lib: /// /// ```no_run /// use macroquad::prelude::SKYBLUE; // Import specific items -/// use turtle_lib_macroquad::*; +/// use turtle_lib::*; /// /// #[turtle_main("My Drawing")] /// fn my_drawing(turtle: &mut TurtlePlan) { @@ -49,7 +49,7 @@ use syn::{parse_macro_input, ItemFn}; /// /// ```no_run /// use macroquad::prelude::*; -/// use turtle_lib_macroquad::*; +/// use turtle_lib::*; /// /// #[macroquad::main("My Turtle Drawing")] /// async fn main() { @@ -102,12 +102,12 @@ pub fn turtle_main(args: TokenStream, input: TokenStream) -> TokenStream { quote! { #[macroquad::main(#window_title)] async fn main() { - let mut turtle = turtle_lib_macroquad::create_turtle(); + let mut turtle = turtle_lib::create_turtle(); // Call the user's function with the turtle #fn_name(&mut turtle); - let mut app = turtle_lib_macroquad::TurtleApp::new() + let mut app = turtle_lib::TurtleApp::new() .with_commands(turtle.build()); loop { @@ -132,19 +132,19 @@ pub fn turtle_main(args: TokenStream, input: TokenStream) -> TokenStream { } } - fn #fn_name(turtle: &mut turtle_lib_macroquad::TurtlePlan) #fn_block + fn #fn_name(turtle: &mut turtle_lib::TurtlePlan) #fn_block } } else { // Function takes no parameters - inline the code quote! { #[macroquad::main(#window_title)] async fn main() { - let mut turtle = turtle_lib_macroquad::create_turtle(); + let mut turtle = turtle_lib::create_turtle(); // Inline the user's code #fn_block - let mut app = turtle_lib_macroquad::TurtleApp::new() + let mut app = turtle_lib::TurtleApp::new() .with_commands(turtle.build()); loop { diff --git a/turtle-lib-macroquad/Cargo.toml b/turtle-lib/Cargo.toml similarity index 76% rename from turtle-lib-macroquad/Cargo.toml rename to turtle-lib/Cargo.toml index 695024b..74974f1 100644 --- a/turtle-lib-macroquad/Cargo.toml +++ b/turtle-lib/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "turtle-lib-macroquad" +name = "turtle-lib" version = "0.2.0" edition = "2021" license = "MIT OR Apache-2.0" @@ -9,7 +9,7 @@ macroquad = "0.4" tween = "2.1.0" lyon = "1.0" tracing = { version = "0.1", features = ["log"], default-features = false } -turtle-lib-macroquad-macros = { path = "../turtle-lib-macroquad-macros" } +turtle-lib-macros = { path = "../turtle-lib-macros" } [dev-dependencies] # For examples and testing diff --git a/turtle-lib-macroquad/README.md b/turtle-lib/README.md similarity index 97% rename from turtle-lib-macroquad/README.md rename to turtle-lib/README.md index 298959f..fb5715b 100644 --- a/turtle-lib-macroquad/README.md +++ b/turtle-lib/README.md @@ -1,4 +1,4 @@ -# turtle-lib-macroquad +# turtle-lib The main turtle graphics library built on Macroquad with Lyon tessellation. @@ -30,7 +30,7 @@ The easiest way to create turtle programs is with the `turtle_main` macro: ```rust use macroquad::prelude::*; -use turtle_lib_macroquad::*; +use turtle_lib::*; #[turtle_main("My First Drawing")] fn my_drawing(turtle: &mut TurtlePlan) { @@ -53,7 +53,7 @@ For more control over the application loop: ```rust use macroquad::prelude::*; -use turtle_lib_macroquad::*; +use turtle_lib::*; #[macroquad::main("Turtle")] async fn main() { diff --git a/turtle-lib-macroquad/examples/cheese.rs b/turtle-lib/examples/cheese.rs similarity index 99% rename from turtle-lib-macroquad/examples/cheese.rs rename to turtle-lib/examples/cheese.rs index 25a1649..8fba80b 100644 --- a/turtle-lib-macroquad/examples/cheese.rs +++ b/turtle-lib/examples/cheese.rs @@ -8,7 +8,7 @@ //! Lyon's EvenOdd fill rule automatically creates holes where contours overlap! use macroquad::prelude::*; -use turtle_lib_macroquad::*; +use turtle_lib::*; #[macroquad::main("Cheese with Holes")] async fn main() { diff --git a/turtle-lib-macroquad/examples/cheese_macro.rs b/turtle-lib/examples/cheese_macro.rs similarity index 98% rename from turtle-lib-macroquad/examples/cheese_macro.rs rename to turtle-lib/examples/cheese_macro.rs index d82a617..2bc8246 100644 --- a/turtle-lib-macroquad/examples/cheese_macro.rs +++ b/turtle-lib/examples/cheese_macro.rs @@ -3,7 +3,7 @@ //! This is a simplified version of cheese.rs that demonstrates how the //! turtle_main macro reduces boilerplate code. -use turtle_lib_macroquad::*; +use turtle_lib::*; #[turtle_main("Cheese with Holes - Using Macro")] fn draw_cheese(turtle: &mut TurtlePlan) { diff --git a/turtle-lib-macroquad/examples/circle_test.rs b/turtle-lib/examples/circle_test.rs similarity index 96% rename from turtle-lib-macroquad/examples/circle_test.rs rename to turtle-lib/examples/circle_test.rs index cf82de5..fd9038e 100644 --- a/turtle-lib-macroquad/examples/circle_test.rs +++ b/turtle-lib/examples/circle_test.rs @@ -1,6 +1,6 @@ //! Test circle_left and circle_right commands -use turtle_lib_macroquad::*; +use turtle_lib::*; #[turtle_main("Circle Test")] fn draw(turtle: &mut TurtlePlan) { diff --git a/turtle-lib-macroquad/examples/dragon.rs b/turtle-lib/examples/dragon.rs similarity index 98% rename from turtle-lib-macroquad/examples/dragon.rs rename to turtle-lib/examples/dragon.rs index 47633f4..31d47cf 100644 --- a/turtle-lib-macroquad/examples/dragon.rs +++ b/turtle-lib/examples/dragon.rs @@ -35,7 +35,7 @@ //! function, passing the direction of the turn for this fold as an angle //! (+90 for a right turn, -90 for a left turn). -use turtle_lib_macroquad::*; +use turtle_lib::*; #[turtle_main("Dragon Curve")] fn draw_dragon(turtle: &mut TurtlePlan) { diff --git a/turtle-lib-macroquad/examples/fill_advanced.rs b/turtle-lib/examples/fill_advanced.rs similarity index 99% rename from turtle-lib-macroquad/examples/fill_advanced.rs rename to turtle-lib/examples/fill_advanced.rs index f5f656e..3efef97 100644 --- a/turtle-lib-macroquad/examples/fill_advanced.rs +++ b/turtle-lib/examples/fill_advanced.rs @@ -3,7 +3,7 @@ //! This example uses manual setup to demonstrate custom window size and UI elements. use macroquad::{miniquad::window::set_window_size, prelude::*}; -use turtle_lib_macroquad::*; +use turtle_lib::*; #[macroquad::main("Advanced Fill Demo")] async fn main() { diff --git a/turtle-lib-macroquad/examples/hello_turtle.rs b/turtle-lib/examples/hello_turtle.rs similarity index 90% rename from turtle-lib-macroquad/examples/hello_turtle.rs rename to turtle-lib/examples/hello_turtle.rs index e429b3a..a40e738 100644 --- a/turtle-lib-macroquad/examples/hello_turtle.rs +++ b/turtle-lib/examples/hello_turtle.rs @@ -2,7 +2,7 @@ //! //! This is the simplest possible turtle program using the macro. -use turtle_lib_macroquad::*; +use turtle_lib::*; #[turtle_main("Hello Turtle")] fn hello() { diff --git a/turtle-lib-macroquad/examples/koch.rs b/turtle-lib/examples/koch.rs similarity index 96% rename from turtle-lib-macroquad/examples/koch.rs rename to turtle-lib/examples/koch.rs index 894c1ef..2c3da9a 100644 --- a/turtle-lib-macroquad/examples/koch.rs +++ b/turtle-lib/examples/koch.rs @@ -1,6 +1,6 @@ //! Koch snowflake fractal example -use turtle_lib_macroquad::*; +use turtle_lib::*; fn koch(depth: u32, turtle: &mut TurtlePlan, distance: f32) { if depth == 0 { diff --git a/turtle-lib-macroquad/examples/logging_example.rs b/turtle-lib/examples/logging_example.rs similarity index 80% rename from turtle-lib-macroquad/examples/logging_example.rs rename to turtle-lib/examples/logging_example.rs index fa03847..ca754d2 100644 --- a/turtle-lib-macroquad/examples/logging_example.rs +++ b/turtle-lib/examples/logging_example.rs @@ -4,24 +4,24 @@ //! You can control the log level using the `RUST_LOG` environment variable: //! //! ```bash -//! # Show all debug output from turtle-lib-macroquad -//! RUST_LOG=turtle_lib_macroquad=debug cargo run --example logging_example +//! # Show all debug output from turtle-lib +//! RUST_LOG=turtle_lib=debug cargo run --example logging_example //! //! # Show only warnings and errors -//! RUST_LOG=turtle_lib_macroquad=warn cargo run --example logging_example +//! RUST_LOG=turtle_lib=warn cargo run --example logging_example //! //! # Show trace-level output (very verbose, includes all vertices) -//! RUST_LOG=turtle_lib_macroquad=trace cargo run --example logging_example +//! RUST_LOG=turtle_lib=trace cargo run --example logging_example //! //! # Show debug output from specific modules -//! RUST_LOG=turtle_lib_macroquad::tessellation=debug cargo run --example logging_example -//! RUST_LOG=turtle_lib_macroquad::execution=debug cargo run --example logging_example +//! RUST_LOG=turtle_lib::tessellation=debug cargo run --example logging_example +//! RUST_LOG=turtle_lib::execution=debug cargo run --example logging_example //! ``` //! //! Note: This example uses manual setup to demonstrate custom initialization logic. use macroquad::prelude::*; -use turtle_lib_macroquad::*; +use turtle_lib::*; #[macroquad::main("Turtle Logging Example")] async fn main() { @@ -31,7 +31,7 @@ async fn main() { .with_env_filter( tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or_else(|_| { // Default to showing info-level logs if RUST_LOG is not set - tracing_subscriber::EnvFilter::new("turtle_lib_macroquad=info") + tracing_subscriber::EnvFilter::new("turtle_lib=info") }), ) .with_target(true) // Show which module the log came from @@ -42,7 +42,7 @@ async fn main() { tracing::info!("Starting turtle graphics example with logging enabled"); tracing::info!( - "Try running with: RUST_LOG=turtle_lib_macroquad=debug cargo run --example logging_example" + "Try running with: RUST_LOG=turtle_lib=debug cargo run --example logging_example" ); // Create a turtle plan with fill operations to see detailed logging diff --git a/turtle-lib-macroquad/examples/macro_demo.rs b/turtle-lib/examples/macro_demo.rs similarity index 93% rename from turtle-lib-macroquad/examples/macro_demo.rs rename to turtle-lib/examples/macro_demo.rs index 988a9e2..9d202b2 100644 --- a/turtle-lib-macroquad/examples/macro_demo.rs +++ b/turtle-lib/examples/macro_demo.rs @@ -3,7 +3,7 @@ //! This example shows how the turtle_main macro simplifies turtle programs //! by automatically handling window setup, turtle creation, and the render loop. -use turtle_lib_macroquad::*; +use turtle_lib::*; #[turtle_main("Macro Demo - Simple Square")] fn draw_square(turtle: &mut TurtlePlan) { diff --git a/turtle-lib-macroquad/examples/macro_demo_inline.rs b/turtle-lib/examples/macro_demo_inline.rs similarity index 93% rename from turtle-lib-macroquad/examples/macro_demo_inline.rs rename to turtle-lib/examples/macro_demo_inline.rs index c16c113..f63035d 100644 --- a/turtle-lib-macroquad/examples/macro_demo_inline.rs +++ b/turtle-lib/examples/macro_demo_inline.rs @@ -3,7 +3,7 @@ //! This example shows that you can write your turtle code directly //! in the function body without taking a turtle parameter. -use turtle_lib_macroquad::*; +use turtle_lib::*; #[turtle_main("Macro Demo - Inline Spiral")] fn draw_spiral() { diff --git a/turtle-lib-macroquad/examples/nikolaus.rs b/turtle-lib/examples/nikolaus.rs similarity index 97% rename from turtle-lib-macroquad/examples/nikolaus.rs rename to turtle-lib/examples/nikolaus.rs index a15cc28..198ced6 100644 --- a/turtle-lib-macroquad/examples/nikolaus.rs +++ b/turtle-lib/examples/nikolaus.rs @@ -1,6 +1,6 @@ //! Nikolaus example - draws a house-like figure -use turtle_lib_macroquad::*; +use turtle_lib::*; fn nikolausquadrat(turtle: &mut TurtlePlan, groesse: f32) { turtle.forward(groesse); diff --git a/turtle-lib-macroquad/examples/shapes.rs b/turtle-lib/examples/shapes.rs similarity index 95% rename from turtle-lib-macroquad/examples/shapes.rs rename to turtle-lib/examples/shapes.rs index 830ab2e..889bb3d 100644 --- a/turtle-lib-macroquad/examples/shapes.rs +++ b/turtle-lib/examples/shapes.rs @@ -1,6 +1,6 @@ //! Example demonstrating different turtle shapes -use turtle_lib_macroquad::*; +use turtle_lib::*; #[turtle_main("Turtle Shapes")] fn draw(turtle: &mut TurtlePlan) { diff --git a/turtle-lib-macroquad/examples/sierpinski_triangle.rs b/turtle-lib/examples/sierpinski_triangle.rs similarity index 99% rename from turtle-lib-macroquad/examples/sierpinski_triangle.rs rename to turtle-lib/examples/sierpinski_triangle.rs index 2922a5b..2d8bf44 100644 --- a/turtle-lib-macroquad/examples/sierpinski_triangle.rs +++ b/turtle-lib/examples/sierpinski_triangle.rs @@ -19,7 +19,7 @@ //! size: the triangle will stay correctly sized and positioned automatically. use macroquad::window::{screen_height, screen_width}; -use turtle_lib_macroquad::*; +use turtle_lib::*; /// The number of levels to draw following the recursive procedure. const LEVELS: u8 = 9; diff --git a/turtle-lib-macroquad/examples/stern.rs b/turtle-lib/examples/stern.rs similarity index 94% rename from turtle-lib-macroquad/examples/stern.rs rename to turtle-lib/examples/stern.rs index 4d9f6f8..7c98d1b 100644 --- a/turtle-lib-macroquad/examples/stern.rs +++ b/turtle-lib/examples/stern.rs @@ -1,6 +1,6 @@ //! Star pattern example demonstrating complex turtle patterns -use turtle_lib_macroquad::*; +use turtle_lib::*; #[turtle_main("Star Pattern")] fn draw(turtle: &mut TurtlePlan) { diff --git a/turtle-lib-macroquad/examples/v1_0_0.rs b/turtle-lib/examples/v1_0_0.rs similarity index 98% rename from turtle-lib-macroquad/examples/v1_0_0.rs rename to turtle-lib/examples/v1_0_0.rs index 34cba6c..1c78b2f 100644 --- a/turtle-lib-macroquad/examples/v1_0_0.rs +++ b/turtle-lib/examples/v1_0_0.rs @@ -3,7 +3,7 @@ //! This example draws "1.0.0" with decorative background lines and filled shapes. //! Ported from the original sunjay/turtle example. -use turtle_lib_macroquad::*; +use turtle_lib::*; #[turtle_main("Version 1.0.0")] fn draw_version(turtle: &mut TurtlePlan) { diff --git a/turtle-lib-macroquad/examples/yinyang.rs b/turtle-lib/examples/yinyang.rs similarity index 96% rename from turtle-lib-macroquad/examples/yinyang.rs rename to turtle-lib/examples/yinyang.rs index a8a8f91..56192fa 100644 --- a/turtle-lib-macroquad/examples/yinyang.rs +++ b/turtle-lib/examples/yinyang.rs @@ -1,6 +1,6 @@ //! Yin-Yang symbol example demonstrating multi-contour fills -use turtle_lib_macroquad::*; +use turtle_lib::*; #[turtle_main("Yin-Yang")] fn draw(turtle: &mut TurtlePlan) { diff --git a/turtle-lib-macroquad/src/builders.rs b/turtle-lib/src/builders.rs similarity index 95% rename from turtle-lib-macroquad/src/builders.rs rename to turtle-lib/src/builders.rs index b5c8039..a07e5df 100644 --- a/turtle-lib-macroquad/src/builders.rs +++ b/turtle-lib/src/builders.rs @@ -20,7 +20,7 @@ pub trait DirectionalMovement: WithCommands { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Forward Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -48,7 +48,7 @@ pub trait DirectionalMovement: WithCommands { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Backward Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -79,7 +79,7 @@ pub trait Turnable: WithCommands { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Left Turn Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -106,7 +106,7 @@ pub trait Turnable: WithCommands { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Right Turn Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -142,7 +142,7 @@ pub trait CurvedMovement: WithCommands { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Circle Left Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -187,7 +187,7 @@ pub trait CurvedMovement: WithCommands { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Circle Right Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -235,7 +235,7 @@ impl TurtlePlan { /// # Examples /// /// ```no_run - /// use turtle_lib_macroquad::*; + /// use turtle_lib::*; /// use macroquad::prelude::*; /// /// #[macroquad::main("Manual Setup")] @@ -276,7 +276,7 @@ impl TurtlePlan { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Speed Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -302,7 +302,7 @@ impl TurtlePlan { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Pen Color Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -326,7 +326,7 @@ impl TurtlePlan { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Pen Width Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -354,7 +354,7 @@ impl TurtlePlan { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Heading Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -380,7 +380,7 @@ impl TurtlePlan { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Pen Up/Down Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -414,7 +414,7 @@ impl TurtlePlan { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Pen Down Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -437,7 +437,7 @@ impl TurtlePlan { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Hide Turtle Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -460,7 +460,7 @@ impl TurtlePlan { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Show Turtle Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -482,7 +482,7 @@ impl TurtlePlan { /// # Examples /// /// ``` - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Shape Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -502,7 +502,7 @@ impl TurtlePlan { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Shape Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -529,7 +529,7 @@ impl TurtlePlan { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Fill Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -562,7 +562,7 @@ impl TurtlePlan { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("End Fill Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -588,7 +588,7 @@ impl TurtlePlan { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Fill Color Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -619,7 +619,7 @@ impl TurtlePlan { /// # Examples /// /// ```no_run - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// #[turtle_main("Goto Example")] /// fn draw(turtle: &mut TurtlePlan) { @@ -643,7 +643,7 @@ impl TurtlePlan { /// # Examples /// /// ``` - /// # use turtle_lib_macroquad::*; + /// # use turtle_lib::*; /// # /// let mut turtle = TurtlePlan::new(); /// turtle.forward(100.0).right(90.0).forward(100.0); diff --git a/turtle-lib-macroquad/src/circle_geometry.rs b/turtle-lib/src/circle_geometry.rs similarity index 100% rename from turtle-lib-macroquad/src/circle_geometry.rs rename to turtle-lib/src/circle_geometry.rs diff --git a/turtle-lib-macroquad/src/commands.rs b/turtle-lib/src/commands.rs similarity index 100% rename from turtle-lib-macroquad/src/commands.rs rename to turtle-lib/src/commands.rs diff --git a/turtle-lib-macroquad/src/drawing.rs b/turtle-lib/src/drawing.rs similarity index 100% rename from turtle-lib-macroquad/src/drawing.rs rename to turtle-lib/src/drawing.rs diff --git a/turtle-lib-macroquad/src/execution.rs b/turtle-lib/src/execution.rs similarity index 100% rename from turtle-lib-macroquad/src/execution.rs rename to turtle-lib/src/execution.rs diff --git a/turtle-lib-macroquad/src/general.rs b/turtle-lib/src/general.rs similarity index 100% rename from turtle-lib-macroquad/src/general.rs rename to turtle-lib/src/general.rs diff --git a/turtle-lib-macroquad/src/general/angle.rs b/turtle-lib/src/general/angle.rs similarity index 100% rename from turtle-lib-macroquad/src/general/angle.rs rename to turtle-lib/src/general/angle.rs diff --git a/turtle-lib-macroquad/src/general/length.rs b/turtle-lib/src/general/length.rs similarity index 100% rename from turtle-lib-macroquad/src/general/length.rs rename to turtle-lib/src/general/length.rs diff --git a/turtle-lib-macroquad/src/lib.rs b/turtle-lib/src/lib.rs similarity index 97% rename from turtle-lib-macroquad/src/lib.rs rename to turtle-lib/src/lib.rs index 093e1aa..b12c359 100644 --- a/turtle-lib-macroquad/src/lib.rs +++ b/turtle-lib/src/lib.rs @@ -9,7 +9,7 @@ //! //! ```no_run //! use macroquad::prelude::*; -//! use turtle_lib_macroquad::*; +//! use turtle_lib::*; //! //! #[turtle_main("My Drawing")] //! fn draw(turtle: &mut TurtlePlan) { @@ -28,7 +28,7 @@ //! //! ```no_run //! use macroquad::prelude::*; -//! use turtle_lib_macroquad::*; +//! use turtle_lib::*; //! //! #[macroquad::main("Turtle")] //! async fn main() { @@ -66,7 +66,7 @@ pub use state::{DrawCommand, TurtleState, TurtleWorld}; pub use tweening::TweenController; // Re-export the turtle_main macro -pub use turtle_lib_macroquad_macros::turtle_main; +pub use turtle_lib_macros::turtle_main; // Re-export common macroquad types and colors for convenience pub use macroquad::prelude::{ @@ -225,7 +225,7 @@ impl Default for TurtleApp { /// /// # Example /// ``` -/// use turtle_lib_macroquad::*; +/// use turtle_lib::*; /// /// let mut turtle = create_turtle(); /// turtle.forward(100.0).right(90.0).forward(50.0); diff --git a/turtle-lib-macroquad/src/shapes.rs b/turtle-lib/src/shapes.rs similarity index 100% rename from turtle-lib-macroquad/src/shapes.rs rename to turtle-lib/src/shapes.rs diff --git a/turtle-lib-macroquad/src/state.rs b/turtle-lib/src/state.rs similarity index 100% rename from turtle-lib-macroquad/src/state.rs rename to turtle-lib/src/state.rs diff --git a/turtle-lib-macroquad/src/tessellation.rs b/turtle-lib/src/tessellation.rs similarity index 100% rename from turtle-lib-macroquad/src/tessellation.rs rename to turtle-lib/src/tessellation.rs diff --git a/turtle-lib-macroquad/src/tweening.rs b/turtle-lib/src/tweening.rs similarity index 100% rename from turtle-lib-macroquad/src/tweening.rs rename to turtle-lib/src/tweening.rs