pnte

Crates.iopnte
lib.rspnte
version0.2.6
sourcesrc
created_at2023-12-09 02:40:55.847191
updated_at2024-08-19 01:42:16.28819
description2D Graphics library for Windows in Rust
homepage
repositoryhttps://github.com/btanno/pnte
max_upload_size
id1063231
size648,290
(btanno)

documentation

https://docs.rs/pnte

README

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

  1. Create a pnte::Context.
let ctx = pnte::Context::new(pnte::Direct2D::new()?)?;
  1. Create a render target.
let render_target = ctx.create_render_target(&window, (size.width, size.height))?;
  1. 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.

Commit count: 14

cargo fmt