6 releases

Uses new Rust 2024

0.1.6 Aug 12, 2025
0.1.5 Aug 12, 2025

#444 in Graphics APIs

Download history 404/week @ 2025-08-09 55/week @ 2025-08-16 26/week @ 2025-08-23 29/week @ 2025-08-30 11/week @ 2025-09-06 6/week @ 2025-09-13 9/week @ 2025-09-20 11/week @ 2025-09-27 5/week @ 2025-10-04 6/week @ 2025-10-11 11/week @ 2025-10-18

266 downloads per month
Used in xege

MIT license

9MB
204K SLoC

Rust 159K SLoC // 0.0% comments C 32K SLoC // 0.2% comments C++ 12K SLoC // 0.3% comments

xege-ffi

This crate provides Rust FFI bindings for the C++ graphics library xege. It enables users to call xege's functionalities within Rust. xege is a beginner-oriented C++ graphics library offering features like graphics drawing, event handling, and other functionalities. It is a widely used third-party library for programming language and computer graphics learning.

Why EGE?

EGE (Easy Graphics Engine) is a simple graphics library for Windows. It is similar to BGI (graphics.h) and is designed for beginners in C/C++ programming (Now, it can also be used in Rust). Its goal is to serve as a replacement for the BGI library from Turbo C (TC).

Its usage is very close to graphics.h from TC. For beginners, it is simple, friendly, and easy to learn. It is free, open-source, and features an intuitive interface. Even those with no prior graphics programming experience can quickly master basic drawing.

Example

use std::io::stdin;

fn main() {
    unsafe {
        xege_ffi::ege_initgraph(640, 480, 0);
        stdin().lines().next().unwrap().unwrap();
        xege_ffi::ege_closegraph();
    }
}

License

This project is licensed under the MIT license.

No runtime deps