leadedge / Spout2

A video frame sharing system for Microsoft Windows
BSD 2-Clause "Simplified" License
748 stars 137 forks source link

SpoutSender/Receiver sourcecode #74

Closed Firesampo closed 2 years ago

Firesampo commented 2 years ago

Hi,

Would it be possible to share the source code for the demo/SpoutReceiver and Sender?

I'd need to make a slight modification to the receiver so that I could spread the window over several displays (preferrably with command line arguments for the positions or so), and I can't get the windows dx version to display anything?

leadedge commented 2 years ago

The Spout demo programs are based on a very old tutorial by NEHE and the code has been extended over time, so it's not really suitable for sharing. For that reason I created an Openframeworks version :

https://github.com/leadedge/ofSpoutDemo

The full-screen function is exactly the same as in the Spout demo receiver code. It has been adapted for multiple monitors so if you want to change the output position, that's a place to look.

There is a tip by the Openframeworks developer Arturo here :

https://forum.openframeworks.cc/t/one-app-two-monitors-two-full-screen-windows/28458/8

I haven't tried it but it seems to be a possible solution.

I have recently added command line arguments to another openframeworks project and can help with that.

leadedge commented 2 years ago

Does this project allow you to make the modification you require? I think the key to it could be in the full-screen function. I can help further with command line arguments.

Firesampo commented 2 years ago

Hey,

I did manage to add the window size option to the dx version, but I can't get it to display anything on my laptop - it works fine on a desktop machine...

Could be related to the fact that the laptop has two cards, an Intel built-in one and NVidia RTX 2080. I think the demo sender / receiver defaults to opengl, that's why it works.

Is there a way to select which gfx card(s) Spout is using?

leadedge commented 2 years ago

Thanks for your reply.

There is an issue with Spout using OpenGL for Laptops with dual graphics. You need to select the high performance NVIDIA card by default for all programs by way of the NVIDIA control panel. SpoutSettings also has an "Optimus global processor" setting.

But DirectX programs don't use the OpenGL/DirectX interop for sharing textures and the example binaries should work straight way. You need all the files in the Examples folder.

Do WindowsSender and WindowsReceiver work together without your modification? WindowsReceiver should receive from any Spout sender. If not, we will need to explore further.

Yes it's possible to select the graphics card for Spout to use, although both sender and receiver have to be using the same adapter. Examples are Tutorial04 and Tutorial07.

leadedge commented 2 years ago

There have been a couple of reports on the Spout Discourse forum recently here and here of trouble with laptops using Intel UHD and GeForce RTX3060 graphics.

After quite some investigation, the key seems to be attaching a monitor to the NVIDIA output.

Unfortunately, the idea of selecting different graphics is only a solution for DirecX.