diff --git a/Cargo.toml b/Cargo.toml index 9be5bb8..6ad568a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,21 +1,16 @@ [package] name = "raylib-ffi" -version = "0.1.0" +version = "4.2.0" authors = ["Evan Pratten "] edition = "2021" -description = "" +description = "Automatic raw Rust bindings to raylib" documentation = "https://docs.rs/raylib-ffi" readme = "README.md" homepage = "https://github.com/ewpratten/raylib-ffi" repository = "https://github.com/ewpratten/raylib-ffi" license = "GPL-3.0" -keywords = [] -categories = [] - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] - +keywords = ["raylib", "graphics"] +categories = ["external-ffi-bindings", "graphics", "multimedia", "rendering"] [build-dependencies] bindgen = "^0.63.0" diff --git a/examples/basic.rs b/examples/basic.rs new file mode 100644 index 0000000..2aa5b9c --- /dev/null +++ b/examples/basic.rs @@ -0,0 +1,47 @@ +pub fn main() { + unsafe { + // Create a window + raylib_ffi::InitWindow( + 800, + 450, + "raylib-ffi example - basic window\0".as_ptr() as *const i8, + ); + + // Render the window + loop { + // Close the window if requested + if raylib_ffi::WindowShouldClose() { + break; + } + + // Begin a draw call + raylib_ffi::BeginDrawing(); + + // Render text and a background + raylib_ffi::ClearBackground(raylib_ffi::Color { + r: 255, + g: 255, + b: 255, + a: 255, + }); + raylib_ffi::DrawText( + "Congrats! You created your first window!\0".as_ptr() as *const i8, + 190, + 200, + 20, + raylib_ffi::Color { + r: 0, + g: 0, + b: 0, + a: 255, + }, + ); + + // End the draw call + raylib_ffi::EndDrawing(); + } + + // Clean up + raylib_ffi::CloseWindow(); + } +} diff --git a/third_party/raylib b/third_party/raylib index 2c9d116..bf2ad9d 160000 --- a/third_party/raylib +++ b/third_party/raylib @@ -1 +1 @@ -Subproject commit 2c9d116a5ce835328dc3267313f1b34b2e7ad8c9 +Subproject commit bf2ad9df5fdcaa385b2a7f66fd85632eeebbadaa