Crates.io | kludgine-core |
lib.rs | kludgine-core |
version | 0.5.0 |
source | src |
created_at | 2021-08-22 19:55:04.696378 |
updated_at | 2023-04-28 16:25:04.468235 |
description | 2D rendering for Kludgine |
homepage | |
repository | https://github.com/khonsulabs/kludgine |
max_upload_size | |
id | 440825 |
size | 2,282,911 |
A 2d rendering engine for the Rust language.
Kludgine is named in a way to hopefully be ironic in nature, but it's being designed and written by a developer that is fairly new to modern graphics programming and rust. Thus, it is probably a kludge.
Kludgine is early in development and is subject to breaking API changes. That being said, the API has started to stabilize, and these are the primary benefits of Kludgine:
Kludgine is built upon easygpu, which
is based on wgpu. wgpu
is an experimental WebGPU
implementation, and it supports DirectX on Windows, Vulkan on Linux, Metal on
iOS/Mac OS, and is close to working within the web browser. Kludgine does not
yet currently work inside of the web browser, but we eventually will support it.
Apps and games written in Kludgine should have no problem running with reasonable performance on budget hardware, even without a discrete GPU.
While most games want a steady framerate, many developers may want to allow
their programs to not redraw constantly. Kludgine makes managing this easy with
the
RedrawStatus
type, allowing easy scheduling of future frame redraws or immediately requesting
a redraw.
If you do want a consistent redraw, implement
Window::target_fps
.
Kludgine has multi-window support. In general, most games don't need multiple windows, but general purpose applications do.
This is a bit nebulous but examples include:
let texture = Texture::load("kludgine/examples/assets/k.png")?;
let sprite = SpriteSource::entire_texture(texture);
sprite.render_at(
scene,
Rect::from(scene.size()).center(),
SpriteRotation::around_center(self.rotation_angle),
);
To see examples on how to use various features of Kludgine, see the kludgine/examples folder in the repository. If you are having issues, make sure you're looking at examples for the correct version of Kludgine. If you're using a released version, switch to viewing the repository at that version's tag.
To use Kludgine, add it to your Cargo.toml:
cargo add kludgine
This is being developed by and for Khonsu Labs for Cosmic Verge. I hope it will be useful to others as well.
This code is dual-licensed under the MIT License and Apache License 2.0. Fonts in this repository are not included by default, and are solely licensed under the Apache License 2.0.