The Image's source property used to be a string. Now it is a Resource
enum, which can either be None or an absolute file path to the image on
disk. This also replaces the internal Image type.
The compiler internally resolves the img bang expression to a resource
reference, which shall remain just an absolute path. For now the target
generator passes that through, but in the future the target generator
may choose a target specific way of embedding the data and thus
generating a different Resource type in the final code (through
compile_expression in the cpp and rust generator).
The C++ binding is a bit messy as cbindgen doesn't really support
exporting enums that can be constructed on the C++ side. So instead we
use cbindgen to merely export the type internally and only use the tag
from it then. The public API is then a custom Resource type that is
meant to be binary compatible.
Use a full prefixed name (sixtyfps_rendering_backend_gl) to ensure that
the created static lib can be installed without file conflicts (libgl is
not a unique name).
This introduces a separate rendering preparation step in the main
window. As a consequence, the component becomes a parameter and the
graphicstest example can't use the main window anymore.
The decision whether a new low-level primitive needs to be created or
not is made by comparing the last RenderingPrimitive against the new
one.
On the upside, this means that property changes are now reflected in the
graphics.
Make our GL context not current when done with the initialization
and make it current for the duration fo primitive creation and frame
rendering.
Fixes#4
Replace winit re-exports from glutin with a direct winit dependency.
This is done to prepare for moving the code into the core library that may depend on winit but not glutin.
These are the basics. Still to do are fixing the alpha channel blending, the rect handling,
a texture type to avoid consuming the image over and over again. And more :-)
The idea is that they can be recursively rendered and propagate at least
the transform but also clip in the future.
One thing that's left is to split RenderNode into RenderNode and
RenderNodeMut, so that the rendering itself can be done on a non-mutable
tree reference.