[reorg]: Move the rendering backends into internal

This commit is contained in:
Tobias Hunger 2022-01-31 12:37:57 +01:00 committed by Tobias Hunger
parent e6b24bceec
commit a3b86690ff
75 changed files with 77 additions and 74 deletions

View file

@ -246,7 +246,7 @@ pub use sixtyfps_corelib::timers::{Timer, TimerMode};
#[doc(hidden)]
#[cfg(feature = "std")]
pub fn register_font_from_memory(data: &'static [u8]) -> Result<(), Box<dyn std::error::Error>> {
sixtyfps_rendering_backend_default::backend().register_font_from_memory(data)
sixtyfps_rendering_backend_selector::backend().register_font_from_memory(data)
}
/// This function can be used to register a custom TrueType font with SixtyFPS,
@ -257,7 +257,7 @@ pub fn register_font_from_memory(data: &'static [u8]) -> Result<(), Box<dyn std:
pub fn register_font_from_path<P: AsRef<std::path::Path>>(
path: P,
) -> Result<(), Box<dyn std::error::Error>> {
sixtyfps_rendering_backend_default::backend().register_font_from_path(path.as_ref())
sixtyfps_rendering_backend_selector::backend().register_font_from_path(path.as_ref())
}
/// internal re_exports used by the macro generated
@ -299,7 +299,7 @@ pub mod re_exports {
pub use sixtyfps_corelib::ComponentVTable_static;
pub use sixtyfps_corelib::SharedString;
pub use sixtyfps_corelib::SharedVector;
pub use sixtyfps_rendering_backend_default::native_widgets::*;
pub use sixtyfps_rendering_backend_selector::native_widgets::*;
pub use vtable::{self, *};
}
@ -430,14 +430,14 @@ pub mod internal {
/// Creates a new window to render components in.
#[doc(hidden)]
pub fn create_window() -> re_exports::WindowRc {
sixtyfps_rendering_backend_default::backend().create_window()
sixtyfps_rendering_backend_selector::backend().create_window()
}
/// Enters the main event loop. This is necessary in order to receive
/// events from the windowing system in order to render to the screen
/// and react to user input.
pub fn run_event_loop() {
sixtyfps_rendering_backend_default::backend()
sixtyfps_rendering_backend_selector::backend()
.run_event_loop(sixtyfps_corelib::backend::EventLoopQuitBehavior::QuitOnLastWindowClosed);
}
@ -446,7 +446,7 @@ pub fn run_event_loop() {
/// it will return immediately and once control is passed back to the event loop,
/// the initial call to [`run_event_loop()`] will return.
pub fn quit_event_loop() {
sixtyfps_rendering_backend_default::backend().quit_event_loop();
sixtyfps_rendering_backend_selector::backend().quit_event_loop();
}
/// This module contains functions useful for unit tests