8 releases
0.2.6 | Aug 19, 2024 |
---|---|
0.2.5 | Jul 7, 2024 |
0.2.3 | Jun 27, 2024 |
0.2.2 | Mar 4, 2024 |
0.1.0 | Dec 9, 2023 |
#158 in Graphics APIs
512 downloads per month
580KB
2.5K
SLoC
pnte
2D Graphics library for Windows in Rust
pnte is a Direct2D and DreictWrite wrapper.
Requirement
To use this library, CoInitializeEx
must be called for each thread.
How to use simply
- Create a
pnte::Context
.
let ctx = pnte::Context::new(pnte::Direct2D::new()?)?;
- Create a render target.
let render_target = ctx.create_render_target(&window, (size.width, size.height))?;
- Draw.
ctx.draw(&render_target, |cmd| {
let white = pnte::SolidColorBrush::new(&ctx, (1.0, 1.0, 1.0, 1.0))?;
cmd.clear((0.0, 0.0, 0.0, 0.0));
cmd.draw_text("pnte", (10.0, 10.0), &white)?;
})?;
License
This library is licensed under the MIT license.
Dependencies
~127MB
~2M SLoC