All Projects → emoon → Rust_minifb

emoon / Rust_minifb

Licence: other
Cross platfrom window and framebuffer crate for Rust

Programming Languages

rust
11053 projects

Labels

Projects that are alternatives of or similar to Rust minifb

mcwm
mcwm window manager
Stars: ✭ 34 (-93.63%)
Mutual labels:  window
Tana
Bringing the Picture-in-Picture experience to the desktop.
Stars: ✭ 109 (-79.59%)
Mutual labels:  window
Libcopp
cross-platform coroutine library in c++
Stars: ✭ 398 (-25.47%)
Mutual labels:  window
window-manager
A javascript-only Window Manager
Stars: ✭ 54 (-89.89%)
Mutual labels:  window
FTerm.nvim
🔥 No-nonsense floating terminal plugin for neovim 🔥
Stars: ✭ 353 (-33.9%)
Mutual labels:  window
plain-overlay
The simple library for customizable overlay which covers a page, elements or iframe-windows.
Stars: ✭ 28 (-94.76%)
Mutual labels:  window
fullcontrols
Reworked version of the wpf controls, plus new controls and features.
Stars: ✭ 28 (-94.76%)
Mutual labels:  window
Berry
🍓 A healthy, byte-sized window manager
Stars: ✭ 496 (-7.12%)
Mutual labels:  window
dynamic-utils
Utility functions to perform dynamic operations on Android.
Stars: ✭ 86 (-83.9%)
Mutual labels:  window
Pixel
A hand-crafted 2D game library in Go
Stars: ✭ 3,756 (+603.37%)
Mutual labels:  window
incache
Powerful key/value in-memory storage or on disk to persist data
Stars: ✭ 16 (-97%)
Mutual labels:  window
window-scroll-position
React hook for Window scroll position
Stars: ✭ 81 (-84.83%)
Mutual labels:  window
jsPanel3
A jQuery Plugin to create highly configurable floating panels, modals, tooltips, hints/notifiers or contextmenus for use in a backend solution and other web applications.
Stars: ✭ 89 (-83.33%)
Mutual labels:  window
For 0416
당신의 컴퓨터에 노란리본을 달아드립니다. For_0416 & Remember 0416
Stars: ✭ 70 (-86.89%)
Mutual labels:  window
Qt Advanced Docking System
Advanced Docking System for Qt
Stars: ✭ 422 (-20.97%)
Mutual labels:  window
3d-core-raub
An extensible Node.js 3D core for desktop applications
Stars: ✭ 55 (-89.7%)
Mutual labels:  window
vue-pseudo-window
🖼 Declaratively interface window/document/body in your Vue template
Stars: ✭ 28 (-94.76%)
Mutual labels:  window
Penrose
A library for writing an X11 tiling window manager
Stars: ✭ 495 (-7.3%)
Mutual labels:  window
Konsole
Home of the simple console library consisting of ProgressBar, Window, Form, Draw & MockConsole (C# console progress bar with support for single or multithreaded progress updates) Window is a 100%-ish console compatible window, supporting all normal console writing to a windowed section of the screen, supporting scrolling and clipping of console output.
Stars: ✭ 467 (-12.55%)
Mutual labels:  window
autoops for win
Window自动化运维,模拟鼠标移动、单击、模拟输入等,可用来实现复杂GUI应用的操作
Stars: ✭ 36 (-93.26%)
Mutual labels:  window

Build Status Crates.io Documentation

minifb is a cross platform library written in Rust and that makes it easy to setup a window and to (optional) display a 32-bit pixel buffer. It also makes it easy to get input from keyboard and mouse. Notice that minifb is primary designed for prototyping and may not include all the features found in full window handling libraries. An example is the best way to show how it works:

Changelog

Usage

# Cargo.toml
[dependencies]
minifb = "0.19.2"

Example

extern crate minifb;

use minifb::{Key, Window, WindowOptions};

const WIDTH: usize = 640;
const HEIGHT: usize = 360;

fn main() {
    let mut buffer: Vec<u32> = vec![0; WIDTH * HEIGHT];

    let mut window = Window::new(
        "Test - ESC to exit",
        WIDTH,
        HEIGHT,
        WindowOptions::default(),
    )
    .unwrap_or_else(|e| {
        panic!("{}", e);
    });

    // Limit to max ~60 fps update rate
    window.limit_update_rate(Some(std::time::Duration::from_micros(16600)));

    while window.is_open() && !window.is_key_down(Key::Escape) {
        for i in buffer.iter_mut() {
            *i = 0; // write something more funny here!
        }

        // We unwrap here as we want this code to exit if it fails. Real applications may want to handle this in a different way
        window
            .update_with_buffer(&buffer, WIDTH, HEIGHT)
            .unwrap();
    }
}

Status

Currently macOS, Linux and Windows (64-bit and 32-bit) are the current supported platforms. X11 (Linux/FreeBSD/etc) support has been tested on Ubuntu (x64). Linux Wayland support is also available. Bug report(s) for other OSes/CPUs are welcome! Notice: That after 0.13 Redox hasn't been updated and some work is required to get that working again. PR are welcome.

Build instructions

On Linux you may need to install these dependencies first:

sudo apt install libxkbcommon-dev libwayland-cursor0 libwayland-dev
cargo build
cargo run --example noise

This will run the noise example

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].