프로젝트
소개
A lightweight cross-platform 2D game framework written in pure Rust and based on OpenGL 3.3+
게임 및 에뮬레이션What you can do
- 2D only and use pixel unit.
- Hardware-accelerated rendering base on OpenGL.
- Automatically process rendering batch.
- Dynamic font rendering with text layout.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalTakWolf's Game Engine (tge)
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

cannon

clock

bunny_mark

hare_mark

frame_animation

parallax_forest

parallax_mountain

dvd

text_layout

stroke_text

License
관련 프로젝트 살펴보기
불러오는 중…