| 1762 | } |
| 1763 | |
| 1764 | fn pollster_block_on<F: std::future::Future>(future: F) -> F::Output { |
| 1765 | use std::task::{Context, Poll, Wake, Waker}; |
| 1766 | use std::pin::Pin; |
| 1767 | use std::sync::Arc; |
| 1768 | struct NoopWaker; |
| 1769 | impl Wake for NoopWaker { fn wake(self: Arc<Self>) {} } |
| 1770 | let waker = Waker::from(Arc::new(NoopWaker)); |
| 1771 | let mut cx = Context::from_waker(&waker); |
| 1772 | let mut future = unsafe { Pin::new_unchecked(Box::new(future)) }; |
| 1773 | loop { |
| 1774 | match future.as_mut().poll(&mut cx) { |
| 1775 | Poll::Ready(result) => return result, |
| 1776 | Poll::Pending => std::thread::yield_now(), |
| 1777 | } |
| 1778 | } |
| 1779 | } |
| 1780 | |
| 1781 | // 3D engine stubs — not yet implemented on Windows |
| 1782 | #[no_mangle] pub extern "C" fn bloom_register_frame_callback(_priority: f64, _callback: extern "C" fn(f64)) -> f64 { 0.0 } |