DEV Community

Корчеватель
Корчеватель

Posted on

Subgrid devlog.2

Setting up the library

Before I started this devlog, I have already spent few years learning Rust and writing various libraries. Usually as a learning tool I prefer to write the stuff by myself initially, this is how I have got a async executor library, the half baked win32 reactor and the the couple of logging libraries. The approach is very questionable, it always concerns me if I am wasting a ton of my time here. Besides of the learning explanation I have got for myself I also feel uncomfortable how the other libraries manage dependencies and making theirs performance choices. For example, once I though I need something in futures crate so I have added this a dependency to some demo app. When I have built the project with only futures dependency I have got this:

Building the futures crate

This was not totally that I expected thinkin about futures as a kind of utility code. Now for one small feature I have like 20 crates in dependencies and 45 sec of debug build.

Anyway when I proceed to subgrid I have started with some well known crates as dependencies for subgrid library and its demo app:

  • ab_glyph - rendering font glyphs. making own ttf parsing and rendering is too much even for me. The author seems to care about his dependencies as well.
  • winit implement as win32 application that opens a simple GUI window
  • softbuffer - helper library for winit to render a Vec<u32> as RGBA bitmap

So now I have an app that opens window and can render glyphs into the bitmap and then to a screen.

Top comments (0)