Hello,
I have been working on something that would provide similar possibilities as Syphon on OSX on Windows.
Inspired by /dx9ex and Sharedtexture, I started working on a dll that should allow software developers to easily share the necessary data about a shared texture with other applications. I called it Wyphon, and ideally it becomes good enough for other application vendors to add to their software too.
For this I wanted to create a very simple API, so it will hopefully not only stay a vvvv feature. I created a c++ dll, and on top of that I also implemented a WyphonDotNet dll in c# for managed applications. The current source-code can be found here: https://github.com/mrft/Wyphon
I didn’t use the concept of clients and servers like Syphon, but I assumed that there would/should be a high level of trust between the applications that share texture (and in the future maybe other) data, so I used the concept of ‘Partners’, where every WyphonPartner can share textures and can get notified of textures shared by other parties (by subscribing to an event in .net or by registering a callback function in c++).
I also started creating some simple nodes (under Network/Wyphon) that use these dll’s to use in vvvv. The current source-code can be found in my Wyphon branch on github at https://github.com/mrft/vvvv-sdk/tree/Wyphon
But now it is time for some feedback and help from other people.
- Currently in the vvvv nodes I am sending te Enum2Ord values for format and usage, but I should use the values defined in the D3D constants (see http://msdn.microsoft.com/en-us/library/windows/desktop/bb172558(v=vs.85).aspx and http://msdn.microsoft.com/en-us/library/windows/desktop/bb172625(v=vs.85).aspx). So who can help me add enum inputs to my nodes (like the sharedtexture nodes use), and help me translate these to the real D3D values, so that my vvvv nodes behave like they should?
- Did I forget things in the Wyphon.dll? (for example, I think I should provide a lock for each texture to all wyphon-partners, so applications can synchronize their access to the texture)
To give you an idea of what I am talking about, in c# it should be no more than:
using Wyphon;
WyphonPartner wyphonPartner = new WyphonPartner( "<My application name>" );
//if you want to get notified of other joining or leaving partners
wyphonPartner.WyphonPartnerJoinedEvent += WyphonPartnerJoined;
wyphonPartner.WyphonPartnerLeftEvent += WyphonPartnerLeft;
//if you want to get notified when another partner starts or stops sharing a texture
wyphonPartner.WyphonPartnerD3DTextureSharedEvent += WyphonD3DTextureShared;
wyphonPartner.WyphonPartnerD3DTextureUnsharedEvent += WyphonD3DTextureUnshared;
//Start sharing one of your own textures
bool success = wyphonPartner.ShareD3DTexture(handle, width, height, format, usage, "my texture");
//Stop sharing one of your own texture
wyphonPartner.UnshareD3DTexture(handle);