Commit graph

9 commits

Author SHA1 Message Date
Simon Hausmann
0b6beb081b Minor fixup to the C++ rendering notifier API
Add the graphics state enum to the callback, too. When we add support for different backends,
it would be nice if it didn't require an API change.

 It's duplicated from Rust
because it doesn't provide values. The WebLG one doesn't make sense for C++ and
the proc address closure isn't ffi safe.

(It could be manually bridged thought)
2022-02-07 08:50:09 +01:00
Simon Hausmann
18bba6ede4 Add sixtyfps::Window::request_redraw()
This allows scheduling a redraw of a Window explicitly. Unfortunately it
comes with a winit caveat :(
2022-02-04 15:41:53 +01:00
Simon Hausmann
8959eac3d0 Add rendering callbacks to sixtyfps::Window
This API allows specifying a callback that will be invoked when setting
up graphics (great for compiling shaders), before rendering a frame (but
after the clearning of the surface background), after rendering a frame
(before swapbuffers) and when releasing graphics resources.
2022-02-04 15:41:53 +01:00
Simon Hausmann
559f108b37
Fix include statement in mini-tutorial 2022-02-02 13:06:48 +01:00
Simon Hausmann
98ffd629cf Exclude private C++ API from the reference documentation
The path to the API meant to be excluded needs to be adjusted after the folder renaming.
2022-02-02 09:20:56 +01:00
Olivier Goffart
1f4c625fac
Mention the change of SOURCE_SUBDIR in the C++ migration docs
cc #910
2022-02-01 22:12:48 +01:00
Olivier Goffart
ff3ef50896
Make sure the README of cpp still contains a branch and tag that match
The folder was renamed in master, but not in the release tag

Fixes #910 

Will edit the checklist so we remember to put that back for the release
2022-02-01 22:03:15 +01:00
Olivier Goffart
f9c3e7a8de C++ interpreter: first crash when invoking native callback
This was a regression following the move to the edition 2021.
The CallbackUserData was not capture in the lamda, its member were moved.
So the destructor was called right after it was set.
We must make sure we capture the whole CallbackUserData, so put the callback
inside of it. This also reduce a bit of code duplication at the same time.

Test the callback invokation with statefull lambda
2022-01-31 22:25:24 +01:00
Tobias Hunger
842f75e653 [reorg]: Move api/sixtyfps-rs/sixtyfps-* into api/rs 2022-01-31 18:24:33 +01:00