Set target version and add an example program
This commit is contained in:
parent
825c69d40c
commit
69bcff7fa6
13
Cargo.toml
13
Cargo.toml
@ -1,21 +1,16 @@
|
||||
[package]
|
||||
name = "raylib-ffi"
|
||||
version = "0.1.0"
|
||||
version = "4.2.0"
|
||||
authors = ["Evan Pratten <ewpratten@gmail.com>"]
|
||||
edition = "2021"
|
||||
description = "<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"
|
||||
|
47
examples/basic.rs
Normal file
47
examples/basic.rs
Normal file
@ -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();
|
||||
}
|
||||
}
|
2
third_party/raylib
vendored
2
third_party/raylib
vendored
@ -1 +1 @@
|
||||
Subproject commit 2c9d116a5ce835328dc3267313f1b34b2e7ad8c9
|
||||
Subproject commit bf2ad9df5fdcaa385b2a7f66fd85632eeebbadaa
|
Loading…
x
Reference in New Issue
Block a user