The texture structure goes back to the original sender shared memory devised by Elio Wahlen together with Frederik Tilkin with “Wyphon”. I kept it the same with Wyphon compatibility in mind. The definition is not in the documentation but you will find it in the Spout SDK file “SpoutSenderNames.h”.
struct SharedTextureInfo {
unsigned __int32 shareHandle;
unsigned __int32 width;
unsigned __int32 height;
DWORD format; // Texture pixel format
DWORD usage; // not used
wchar_t description{128}; // Wyhon compatible description (not used)
unsigned __int32 partnerId; // Wyphon id of partner that shared it with us (not used)
};
Usage, description and partnerId are not used but could be used for something else in the future. Format is the format of the shared DirectX texture and can be set to memory so that a receiver knows what it is receiving.
If it is defined, it should be whatever format the sender is using. The defaults are D3DFMT_A8R8G8B8 (21) for DirectX 9 and DXGI_FORMAT_B8G8R8A8_UNORM (87) for DirectX 11. Then the receiver can read and use this information. At at the moment there is nothing specific done other than display the format by SpoutPanel.exe when selecting a sender by a receiver, but it might be used in future for DirectX to DirectX texture processing, or for other DirectX applications which require the texture format.
There are a limited number of formats that can be used for sharing textures, particularly between DirectX 11 and DirectX 9. These include DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_SNORM and DXGI_FORMAT_R10G10B10A2_UNORM. There has been some interest in floating point textures, so this could become important when that is pursued further.
Meanwhile the format can be set to zero and it will still work OK, the receiver will then assume the default formats and it is not necessary for the receiver to know whether the source is DirectX 9 or DirectX 11. The only thing necessary is the handle (or pointer) to the texture and it will be shared OK for both DirectX 9 and DirectX 11 for the compatible formats.
For field widths, the description is 256 bytes and all others are 4 bytes - 256 + 24 = 280 bytes. The sender name defines the name of the memory map itself.
Let me know if that is not clear or if there is anything else you need to know.