examples/Qt/ISFEditor/ISFEditor_app/Spout/SpoutGLDXinterop.cpp
//
// BIND THE SHARED TEXTURE
//
// for use within an application - this locks the interop object and binds the shared texture
// Locks remain in place, so afterwards a call to UnbindSharedTexture MUST be called
//

BIND THE SHARED TEXTURE
for use within an application - this locks the interop object and binds the shared texture
Locks remain in place, so afterwards a call to UnbindSharedTexture MUST be called
BIND THE SHARED TEXTURE for use within an application - this locks the interop object and binds the shared texture Locks remain in place so afterwards a call to UnbindSharedTexture MUST be called
bool spoutGLDXinterop::BindSharedTexture()
{
	bool bRet = false;
	if(m_hInteropDevice == NULL || m_hInteropObject == NULL)
		return false;
	if(spoutdx.CheckAccess(m_hAccessMutex)) {
		if(LockInteropObject(m_hInteropDevice, &m_hInteropObject) == S_OK) {
			glBindTexture(GL_TEXTURE_2D, m_glTexture);
			bRet = true;
		}
		else {
			bRet = false;
		}
	}
	if(!bRet) {
		UnlockInteropObject(m_hInteropDevice, &m_hInteropObject);
		spoutdx.AllowAccess(m_hAccessMutex); 
	}
	return bRet;
}
bool spoutGLDXinterop :: BindSharedTexture ( ) { bool bRet = false ; if ( m_hInteropDevice == NULL || m_hInteropObject == NULL ) return false ; if ( spoutdx . CheckAccess ( m_hAccessMutex ) ) { if ( LockInteropObject ( m_hInteropDevice , & m_hInteropObject ) == S_OK ) { glBindTexture ( GL_TEXTURE_2D , m_glTexture ) ; bRet = true ; } else { bRet = false ; } } if ( ! bRet ) { UnlockInteropObject ( m_hInteropDevice , & m_hInteropObject ) ; spoutdx . AllowAccess ( m_hAccessMutex ) ; } return bRet ; }
BIND THE SHARED TEXTURE
for use within an application - this locks the interop object and binds the shared texture
Locks remain in place, so afterwards a call to UnbindSharedTexture MUST be called
BIND THE SHARED TEXTURE for use within an application - this locks the interop object and binds the shared texture Locks remain in place so afterwards a call to UnbindSharedTexture MUST be called
// Only for GL/DX interop mode
 // Wait for access to the texture
 // lock dx object
 // Bind our shared OpenGL texture
 // Leave locked for succcess, release interop lock and allow texture access for fail
 // Allow access to the texture
