Since we removed the direct2d renderer we no longer need to reference
the direct2d-zig repository. Instead we now directly reference the
zigwin32 repository. I've also updated that repository with a few fixes
and additions which allowed us to remove some code from flow.
Looks like I probably accidently removed the calls to BeginPaint and
EndPaint in WM_PAINT, which, would cause the OS to think that the
window contents are never validated and will continuously send us WM_PAINT
messages. I've added these back in and now flow is back to low CPU usage
especially when idle.
Adds a Fonts type the render interface. Here's an example of how
you could use this in `gui.zig`:
```zig
const fonts = render.Fonts.init();
defer fonts.deinit();
const count = fonts.count();
std.log.info("{} fonts", .{count});
for (0..count) |font_index| {
const name = fonts.getName(font_index);
std.log.info("font {} '{}'", .{ font_index, std.unicode.fmtUtf16Le(name.slice()) });
}
```
I tried adding Andrew's TrueType renderer as an option, however, I
realized it doesn't work with zig 0.13.0, so it'll have to wait.
Until then here's the changes needed to decouple the screen/text rendering
which would make it easier to add more text renderers and just cleans
things up a bit more in general.
Changes d3d11 to accept an array of cells to render that have already been
rendered to a texture and converted to texture coordinates. This minimizes
the time we have to map the shader cell buffer which blocks the GPU from
using it.
Now instead of snapping to a size after releasing the mouse from resizing
the window, the window will incrementally snap to a good size while the
window is being resized.
Removes the old slow Direct2D renderer which has become obselete with
the new Direct3D11 renderer. Note that Direct2D is built on top of
Direct3D so there's really no reason to keep it around.
I played around with the API a bit and I tried out the other approach
where instead of trying to implement our own keyboard translation, instead
I just clear the "control key" before calling ToUnicode. This fixes any
weird translation the OS was doing.
With this change, we no longer need to skip calling ToUnicode if the
control or alt keys are down, so keys will always work the same way whether
or not these modifiers are down.