To avoid conflicts in dependency version, this commit put examples using
different renderers in different crates.
Especially, glium and gfx do not necessarily depend on the same version
of glutin.
We have two examples:
- imgui-examples (main examples, use gfx renderer here)
- imgui-glium-examples (basic hello_glium example + maybe some texture stuff)
Once vulcano support lands, we may add: imgui-vulkano-examples.
This commit currently only moves files around. We plan to use gfx as a
"main2 renderer for now on as gfx is more actively maintained that
glium. Subsequent commits will migrate some glium examples to gfx.
The library still supports fractional DPI factors, but it seems like a
good idea to use integer factors in examples to avoid blurry fonts and
other issues which might give the wrong impression.
+ use linear filtering in both renderers. Nearest just won't work
anymore if we have a non-integer scaling factor (which winit can give
us on 1440p screens for example)
+ pass around FrameSize which has the necessary info with full f64
precision
+ extra care with conversions to/from f32 and u32 and rounding
The new version of glutin apparently changed the behaviour regarding
HDIPI.
Thanks to the patch submitted by semtexzv [1], this commit fixes the
issue.
[1] b6f5b27883
- gfx uses an sRGB framebuffer, which means it expects all vertex colors to be in linear space
- imgui provides vertex colors in sRGB space! This causes the appearance of washed out colors
- Fix the color space conflict by converting the imgui colors to linear space
Include drawing canvas example into show_example_app_custom_rendering.
The example contains now everything included in the original C++ example
provided with dear imgui.
show_example_app_custom_rendering is implemented exactly as it is in the
original Dear ImGui in C++. The result should be the same.
The only difference is that `DragFloat`, used to control the size of the
drawings, is not implement as of now.
This example demonstrates how the custom drawing API can be used.