From 4c38a6550fc0c3c1b3d6c2e32cca384bd3fd8ec3 Mon Sep 17 00:00:00 2001 From: Jean-Loup Beaussart Date: Fri, 1 Nov 2024 23:52:42 +0100 Subject: [PATCH] Initial code to test macroquad --- .gitattributes | 3 +++ Cargo.toml | 7 +++++++ examples/ferris.png | 3 +++ src/main.rs | 12 ++++++++++++ 4 files changed, 25 insertions(+) create mode 100644 .gitattributes create mode 100644 Cargo.toml create mode 100755 examples/ferris.png create mode 100644 src/main.rs diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c139e44 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +*.png filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text +*.jpeg filter=lfs diff=lfs merge=lfs -text diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..83b4660 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "photo-frame" +version = "0.1.0" +edition = "2021" + +[dependencies] +macroquad = "0.4.13" diff --git a/examples/ferris.png b/examples/ferris.png new file mode 100755 index 0000000..88e9d52 --- /dev/null +++ b/examples/ferris.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bede91fb9164a251e4ecfba29935e954e102f88a156a98f6aa8640b536bfe035 +size 33061 diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e1a8292 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,12 @@ +use macroquad::prelude::*; + +#[macroquad::main("Texture")] +async fn main() { + let texture: Texture2D = load_texture("examples/ferris.png").await.unwrap(); + + loop { + clear_background(LIGHTGRAY); + draw_texture(&texture, 0., 0., WHITE); + next_frame().await + } +}