nabijaczleweli / bearlibterminal.rs Goto Github PK
View Code? Open in Web Editor NEWBearLibTerminal FFI for Rust
License: MIT License
BearLibTerminal FFI for Rust
License: MIT License
Sorry, not sure how to do this. I've got the libBearLibTerminal.dylib
and put it in my src. not sure what to do with it from there... cargo run
says:
λ ~/sandbox/rust/bear/ master* cargo run
Compiling bear v0.1.0 (/Users/justgage/sandbox/rust/bear)
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-m64" "-L" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/justgage/sandbox/rust/bear/target/debug/deps/bear-f9575ad4cb149f8b.2gkhn179cjec6l3b.rcgu.o" "/Users/justgage/sandbox/rust/bear/target/debug/deps/bear-f9575ad4cb149f8b.2kyead65syd0h408.rcgu.o" "/Users/justgage/sandbox/rust/bear/target/debug/deps/bear-f9575ad4cb149f8b.4ihsln5i6kcoxe74.rcgu.o" "/Users/justgage/sandbox/rust/bear/target/debug/deps/bear-f9575ad4cb149f8b.4qp6saoq8ch4khbi.rcgu.o" "/Users/justgage/sandbox/rust/bear/target/debug/deps/bear-f9575ad4cb149f8b.4tb9vh2tlhjgmdsg.rcgu.o" "-o" "/Users/justgage/sandbox/rust/bear/target/debug/deps/bear-f9575ad4cb149f8b" "/Users/justgage/sandbox/rust/bear/target/debug/deps/bear-f9575ad4cb149f8b.7ldewih2fcza26m.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/justgage/sandbox/rust/bear/target/debug/deps" "-L" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/justgage/sandbox/rust/bear/target/debug/deps/libbear_lib_terminal-52c813dd64cd8b7e.rlib" "/Users/justgage/sandbox/rust/bear/target/debug/deps/libbear_lib_terminal_sys-2507a917265e469a.rlib" "/Users/justgage/sandbox/rust/bear/target/debug/deps/liblibc-83d68bd06eb59687.rlib" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-edeacefc1391b975.rlib" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-661c88e34f871df0.rlib" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-f7c06680fdd716f3.rlib" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-f2e753da53df829c.rlib" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-961b28aeeb5bc8e1.rlib" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-b6f6b59b6a29ec3a.rlib" "/Users/justgage/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-f31526d6d86acb04.rlib" "-lBearLibTerminal" "-lSystem" "-lresolv" "-lc" "-lm"
= note: ld: library not found for -lBearLibTerminal
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: aborting due to previous error
error: Could not compile `bear`.
To learn more, run the command again with --verbose.
My Cargo.toml file looks like:
[dependencies]
bear-lib-terminal = "2.0.0"
main.rs:
#[link(name = "libBearLibTerminal.dylib")]
use bear_lib_terminal::terminal;
pub fn main() {
terminal::open("Test", 80, 30);
terminal::print_xy(0, 0, "[color=red]asdf[bkcolor=blue]asdf");
terminal::refresh();
let _ = terminal::wait_event();
terminal::close();
}
BearLibTerminal.rs and BearLibTerminal-sys.rs do not handle BearLibTerminal's Alt key pressed event causing the EventIterator
to end when the Alt key is pressed.
BearLibTerminal.rs/src/terminal/mod.rs
Lines 439 to 444 in 4464bb5
TK_ALT
is defined as 0x72
at:
In linux, changing the X11 keyboard layout does not affect BearLibTerminal applications.
Whenever I run a release build of my game, a terminal window opens up. How do I deactivate it?
My platform is Windows.
Currently impossible, should support all of Event and state constants in a type-safe fashion,
Returns wait_event()
on next()
.
while let Some(event) = terminal::wait_event() {
// ...
}
Should be equivalent to
for event in terminal::events() {
// ...
}
Increasing readability.
The link to https://bitbucket.org/cfyzium/bearlibterminal is broken, it looks like the repository disappeared.
I don't know if there is an up-to-date repository by the original author. There's a still somewhat maintained version on github by another author though: https://github.com/tommyettinger/BearLibTerminal
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.