+ 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
[ImGui] Add helper functions for keyboard keys
User still needs to use get_key_index to get the value of user_key_index for each key, similar to what is done in the original imgui.
This is not very convenient but it allows to be back-end independent.
Fix#105
Add deprecation warning for each renamed variant.
However, it will just fail to compile if the deprecated variant is used
inside a match statement. It is not possible to make aliases of variants
in Rust.
Since there are no mutable borrows in the WindowDrawList API, we can remove all
draw functions from ChannelsSplit and just use the same `draw_list' all
the time, as shown in the `WindowDrawList::channels_split` example.
This approach makes the `DrawAPI` trait pointless so it can be removed, and
ChannelsSplit is reduced to a type with just one function:
`set_current`.
At run time, the environment checks that at most one instance of
WindowDrawList exists using a static boolean: WINDOW_DRAW_LIST_LOADED.
If two WindowDrawList could exist at the same time, there would be
several instances of the same `*mut ImDrawList`, which could lead
to unfathomable bad things.
When a WindowDrawList is created, WINDOW_DRAW_LIST_LOADED is set to
true. And when it is dropped, WINDOW_DRAW_LIST_LOADED is set to false.
Creating a new WindowDrawList while WINDOW_DRAW_LIST_LOADED is true
causes a panic.
AtomicBool could have been used instead of a bool for
WINDOW_DRAW_LIST_LOADED. Though it allows to avoid the use of `unsafe { }`,
the construct we are doing is already inherently unsafe.
WindowDrawList and Ui are !Send and !Sync, so they cannot anyway be shared
among threads.
So we'd better be explicit and use an unsafe block with a normal bool.
The test was failing because no `main` function was defined, as explained
in the rustdoc documentation [1].
Add the "no_run" flag. This way, there is no attempt to run the test
code. Only compile checks are done. Thus defining a `main` function is
unnecessary.
Moreover "export crate imgui" is implicit, so removed.
[1] https://doc.rust-lang.org/stable/rustdoc/documentation-tests.html#pre-processing-examples.