spout-rs 0.1.2

Rust bindings for Spout2 — GPU texture sharing on Windows
docs.rs failed to build spout-rs-0.1.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: spout-rs-0.1.3

spout-rs

crates.io docs.rs

Rust bindings for Spout2 — GPU texture sharing on Windows via DirectX 11 and OpenGL.

Requirements

  • Windows only (Spout2 is a Windows-exclusive library)
  • A compiled Spout.lib import library — set SPOUT2_LIB_DIR to its containing directory
  • Spout.dll on PATH at runtime (found in cmake-build/bin/Release after building)

Building

After cloning, run the bootstrap task to install git hooks, initialise submodules, and compile Spout2:

mise run bootstrap

Then set SPOUT2_LIB_DIR before building or running tests:

$env:SPOUT2_LIB_DIR = "vendor\Spout2\cmake-build\lib\Release"   # PowerShell
$env:PATH += ";vendor\Spout2\cmake-build\bin\Release"
cargo build

Usage

Sender

use spout_rs::SpoutSender;

let mut sender = SpoutSender::new("my-sender");
// Each frame, after rendering to a texture:
sender.send_texture(tex_id, gl::TEXTURE_2D, 1920, 1080, false);
sender.hold_fps(60);

Receiver

use spout_rs::SpoutReceiver;

let mut receiver = SpoutReceiver::new(Some("my-sender"));
// Each frame:
if receiver.is_connected() {
    let info = receiver.sender_info(); // name, width, height, fps
    receiver.receive_texture(tex_id, gl::TEXTURE_2D, false);
}

Vendored Libraries