This PR adds code to render a basic gray background to the opened window in the `open_window` example.
This also helps making the example a bit more useful, since most users will want to render to their window.
And also it looks nicer. 🙂
This is done using the `softbuffer` crate, in the same manner of the `open_parented` introduced in #172.
This PR adds a simple example that allows to test and showcase the `Window::open_parented` method.
That example first creates a parent window using `Window::open_blocking`, and then creates a smaller child window using `Window::open_parented`.
Both window's handlers log all of their events to the console, in a similar fashion to the `open_window` example.
Both windows actually do rendering (unlike the `open_window` example for now): the parent fills its window with a grey backround, and the child fills its window with a red background.
This example also uses the `softbuffer` crate to perform the rendering, which allows testing it in a more portable manner and in the simplest use case possible, without having to involve OpenGL or any 3D rendering pipeline at all.
* add ability to close window from user code, add HostWindowHandle
* fix manual close method for Mac, rename HostWindowHandle to ChildWindowHandle
* fix rustfmt.toml and run cargo format
* fix merge conflict mistake
* fix more merge conflict mistakes
* implement requested changes (with a non-broken commit this time)
* implement requested changes
* slight reordering of impls
* Add mutable event status argument to WindowHandler::on_event
* macOS: simplify method declaration for simple mouse event handlers
* macOS: add macro for adding simple keyboard class methods
* macOS: reorder code in mouse_moved
* Take EventStatus as return value in WindowHandler::on_event
* Add doc comments for EventStatus
* Improve EventStatus documentation
* x11: ignore return value of on_event for now
* EventStatus: improve docs
* Improve EventsStatus docs
* Improve EventStatus docs further
* macOS: ignore EventStatus::Ignored for mouse events
* macOS: minor formatting improvement
* improve EventStatus docs again
also remove the `Window` ref argument because `on_frame()` shouldn't be
doing any window system ops (this is my opinion and i am happy to
backpedal if it turns out to be wrong).