Skip to content
プロジェクト

TakWolf/tge has 34 GitHub stars and 1 forks. Star changes are not measured yet. Last checked 2026-11-14 17:20 UTC. Last push 2026-09-20.

この数値の測り方

できること

  • 2D only and use pixel unit.
  • Hardware-accelerated rendering base on OpenGL.
  • Automatically process rendering batch.
  • Dynamic font rendering with text layout.

計測したスター増加

24時間
履歴を収集中
7日間
履歴を収集中
15日間
履歴を収集中
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

概要

A lightweight cross-platform 2D game framework written in pure Rust and based on OpenGL 3.3+

制作・メディア

TakWolf's Game Engine (tge)

crates.io

A lightweight cross-platform 2D game framework written in pure Rust and based on OpenGL 3.3+.

Features

  • 2D only and use pixel unit.
  • Hardware-accelerated rendering base on OpenGL.
  • Automatically process rendering batch.
  • Dynamic font rendering with text layout.
  • Support high-DPI.
  • Keyboard, mouse, touch, touchpad and gamepad input handling.
  • Audio play. (TODO)

Non goals

  • 3D.
  • Visual editor.

The following does not contain, but can easily work with other crates:

  • Entity Component System (ECS).
  • Physics engines and collision detection.
  • Network.

Usage

Add the dependency line to your Cargo.toml file:

[dependencies]
tge = "0.0.4"

To release performance, also add the following configs:

[profile.dev]
opt-level = 3

Then create a basic template. Here is the minimal example that will create a window:

use tge::prelude::*;

struct App {}

impl App {
    fn new(_: &mut Engine) -> GameResult<Self> {
        // load assets
        Ok(Self {})
    }
}

impl Game for App {
    fn update(&mut self, _: &mut Engine) -> GameResult {
        // handle logic
        Ok(())
    }

    fn render(&mut self, engine: &mut Engine) -> GameResult {
        engine.graphics().clear(Color::BLUE);
        // draw sprites
        Ok(())
    }
}

fn main() -> GameResult {
    let mut engine = EngineBuilder::new()
        .window_config(WindowConfig::new()
            .title("My Game")
            .inner_size((1024.0, 600.0)))
        .build()?;
    let mut app = App::new(&mut engine)?;
    engine.run(&mut app)
}

That is!

You can also see the examples/ directory to learn other examples.

Examples

camera

Camera

cannon

Cannon

clock

Clock

bunny_mark

Bunny Mark

hare_mark

Hare Mark

frame_animation

Frame Animation

parallax_forest

Parallax Forest

parallax_mountain

Parallax Mountain

dvd

DVD

text_layout

Text Layout

stroke_text

Stroke Text

License

MIT License OR Apache License 2.0