pub fn wait_until_ready(&self) -> usize {
        // check the target frame first
        {
            let frame = self.frames[self.index as usize].inner.lock();
            assert!(!frame.available);
            if frame.drawable.is_some() {
                return 0;
            }
        }
        // wait for new frames to come until we meet the chosen one
        let mut count = 1;
        loop {
            match self.surface.next_frame(&self.frames) {
                Ok((index, _)) if index == self.index as usize => {
                    debug!(
                        "Swapchain image {} is ready after {} frames",
                        self.index, count
                    );
                    break;
                }
                Ok(_) => {
                    count += 1;
                }
                Err(_e) => {
                    warn!(
                        "Swapchain drawables are changed, unable to wait for {}",
                        self.index
                    );
                    break;
                }
            }
        }
        count
    }
/// Waits until the specified swapchain index is available for rendering.
/// Returns the number of frames it had to wait.
Waits until the specified swapchain index is available for rendering.
Returns the number of frames it had to wait.
Waits until the specified swapchain index is available for rendering . Returns the number of frames it had to wait .
pub fn wait_until_ready(&self) -> usize {
        // check the target frame first
        {
            let frame = self.frames[self.index as usize].inner.lock();
            assert!(!frame.available);
            if frame.drawable.is_some() {
                return 0;
            }
        }
        // wait for new frames to come until we meet the chosen one
        let mut count = 1;
        loop {
            match self.surface.next_frame(&self.frames) {
                Ok((index, _)) if index == self.index as usize => {
                    debug!(
                        "Swapchain image {} is ready after {} frames",
                        self.index, count
                    );
                    break;
                }
                Ok(_) => {
                    count += 1;
                }
                Err(_e) => {
                    warn!(
                        "Swapchain drawables are changed, unable to wait for {}",
                        self.index
                    );
                    break;
                }
            }
        }
        count
    }
pub fn wait_until_ready ( & self ) -> usize { // check the target frame first { let frame = self . frames [ self . index as usize ] . inner . lock ( ) ; assert ! ( frame available ) ; if frame . drawable . is_some ( ) { return 0 ; } } // wait for new frames to come until we meet the chosen one let mut count = 1 ; loop { match self . surface . next_frame ( & self . frames ) { Ok ( ( index , _ ) ) if index == self . index as usize => { debug ! ( " " self index count ) ; break ; } Ok ( _ ) => { count += 1 ; } Err ( _e ) => { warn ! ( " " self index ) ; break ; } } } count }
Waits until the specified swapchain index is available for rendering.
Waits until the specified swapchain index is available for rendering .
&self
&self