examples/Qt/ISFEditor/ISFEditor_app/Spout/SpoutSDK.cpp
// ------------------------------------------
//	Update a sender
//	Used when a sender's texture changes size
//  The DirectX texture or memory map has to be re-created and the sender info updated
// ------------------------------------------

Update a sender
Used when a sender's texture changes size
The DirectX texture or memory map has to be re-created and the sender info updated
Update a sender Used when a sender ' s texture changes size The DirectX texture or memory map has to be re - created and the sender info updated
bool Spout::UpdateSender(const char *sendername, unsigned int width, unsigned int height)
{
	HANDLE hSharehandle = NULL;
	DWORD dwFormat = 0;
	unsigned int w, h;
	if(!bInitialized) return false;
	if(strcmp(g_SharedMemoryName, sendername) != 0)
		return false;
	if(interop.senders.GetSenderInfo(sendername, w, h, hSharehandle, dwFormat)) {
		if(bDxInitOK) {
			interop.CreateInterop(g_hWnd, sendername, width, height, dwFormat, false); 
		}
		else {
			interop.senders.UpdateSender(sendername, width, height, NULL, 0);
			interop.memoryshare.UpdateSenderMemorySize (sendername, width, height);
		}
		interop.senders.GetSenderInfo(g_SharedMemoryName, g_Width, g_Height, g_ShareHandle, g_Format);
		return true;
	}
	return false;
}
bool Spout :: UpdateSender ( const char * sendername , unsigned int width , unsigned int height ) { HANDLE hSharehandle = NULL ; DWORD dwFormat = 0 ; unsigned int w , h ; if ( ! bInitialized ) return false ; if ( strcmp ( g_SharedMemoryName , sendername ) != 0 ) return false ; if ( interop . senders . GetSenderInfo ( sendername , w , h , hSharehandle , dwFormat ) ) { if ( bDxInitOK ) { interop . CreateInterop ( g_hWnd , sendername , width , height , dwFormat , false ) ; } else { interop . senders . UpdateSender ( sendername , width , height , NULL , 0 ) ; interop . memoryshare . UpdateSenderMemorySize ( sendername , width , height ) ; } interop . senders . GetSenderInfo ( g_SharedMemoryName , g_Width , g_Height , g_ShareHandle , g_Format ) ; return true ; } return false ; }
Update a sender
Used when a sender's texture changes size
The DirectX texture or memory map has to be re-created and the sender info updated
Update a sender Used when a sender ' s texture changes size The DirectX texture or memory map has to be re - created and the sender info updated
// Make sure it has initialized
 // If it is not the same sendername, quit
 // printf("Spout::UpdateSender [%s] %dx%d\n", sendername, width, height);
 // Is the sender still there? - use local vars
 // For texture and CPU modes, re-create the sender directX shared texture
 // with the new dimensions and update the sender info
 // No need to re-initialize DirectX, only the GLDX interop
 // which is re-registered for the new texture
 // false means a sender
 // Memoryshare has to update the sender information as well as the memory map size
 // Only the sender can update the memory map (see SpoutMemoryShare.cpp).
 //
 // Get the new sender width, height and share handle into local globals
 //
