spout-rs 0.1.3

Rust bindings for Spout2 — GPU texture sharing on Windows
Documentation
#[cfg(any(target_os = "windows", docsrs))]
#[cxx::bridge]
mod ffi {
    unsafe extern "C++" {
        include!("spout_bridge.h");

        #[cxx_name = "SpoutSenderBridge"]
        type SpoutSender;
        fn new_spout_sender() -> UniquePtr<SpoutSender>;
        fn set_sender_name(self: Pin<&mut SpoutSender>, name: &str);
        fn send_texture(
            self: Pin<&mut SpoutSender>,
            tex_id: u32,
            target: u32,
            width: u32,
            height: u32,
            invert: bool,
            host_fbo: u32,
        ) -> bool;
        fn send_image(
            self: Pin<&mut SpoutSender>,
            pixels: &[u8],
            width: u32,
            height: u32,
            gl_format: u32,
            invert: bool,
            host_fbo: u32,
        ) -> bool;
        fn release_sender(self: Pin<&mut SpoutSender>);
        fn is_initialized(self: Pin<&mut SpoutSender>) -> bool;
        fn get_name(self: Pin<&mut SpoutSender>) -> String;
        fn get_width(self: Pin<&mut SpoutSender>) -> u32;
        fn get_height(self: Pin<&mut SpoutSender>) -> u32;
        fn hold_fps(self: Pin<&mut SpoutSender>, fps: i32);

        #[cxx_name = "SpoutReceiverBridge"]
        type SpoutReceiver;
        fn new_spout_receiver() -> UniquePtr<SpoutReceiver>;
        fn set_receiver_name(self: Pin<&mut SpoutReceiver>, name: &str);
        fn receive_texture(
            self: Pin<&mut SpoutReceiver>,
            tex_id: u32,
            target: u32,
            invert: bool,
            host_fbo: u32,
        ) -> bool;
        fn receive_texture_connect(self: Pin<&mut SpoutReceiver>) -> bool;
        fn release_receiver(self: Pin<&mut SpoutReceiver>);
        fn is_updated(self: Pin<&mut SpoutReceiver>) -> bool;
        fn is_connected(self: Pin<&mut SpoutReceiver>) -> bool;
        fn is_frame_new(self: Pin<&mut SpoutReceiver>) -> bool;
        fn get_sender_name(self: Pin<&mut SpoutReceiver>) -> String;
        fn get_sender_width(self: Pin<&mut SpoutReceiver>) -> u32;
        fn get_sender_height(self: Pin<&mut SpoutReceiver>) -> u32;
        fn get_sender_fps(self: Pin<&mut SpoutReceiver>) -> f64;

        // Directory
        fn spout_sender_count() -> i32;
        fn spout_get_sender(index: i32) -> String;
    }
}

#[cfg(any(target_os = "windows", docsrs))]
pub mod directory;
#[cfg(any(target_os = "windows", docsrs))]
pub mod error;
#[cfg(any(target_os = "windows", docsrs))]
pub mod frame;
#[cfg(any(target_os = "windows", docsrs))]
pub mod receiver;
#[cfg(any(target_os = "windows", docsrs))]
pub mod sender;
#[cfg(any(target_os = "windows", docsrs))]
pub mod types;

#[cfg(any(target_os = "windows", docsrs))]
pub use directory::Directory;
#[cfg(any(target_os = "windows", docsrs))]
pub use error::SpoutError;
#[cfg(any(target_os = "windows", docsrs))]
pub use frame::Frame;
#[cfg(any(target_os = "windows", docsrs))]
pub use receiver::SpoutReceiver;
#[cfg(any(target_os = "windows", docsrs))]
pub use sender::SpoutSender;
#[cfg(any(target_os = "windows", docsrs))]
pub use types::SenderInfo;