examples/Qt/ISFEditor/ISFEditor_app/Spout/SpoutGLDXinterop.cpp
//
// Read shared memory to texture pixel data
// rgba textures only
//

Read shared memory to texture pixel data
rgba textures only
Read shared memory to texture pixel data rgba textures only
bool spoutGLDXinterop::ReadMemory(GLuint TexID, 
								  GLuint TextureTarget,
								  unsigned int width,
								  unsigned int height,
								  bool bInvert,
								  GLuint HostFBO)
{
	unsigned char *pBuffer = memoryshare.LockSenderMemory();
	if(!pBuffer) return false;
	CheckOpenGLTexture(m_TexID, GL_RGBA, width, height, m_TexWidth, m_TexHeight);
	if(IsPBOavailable()) {
		LoadTexturePixels(m_TexID, GL_TEXTURE_2D, width, height, (const unsigned char *)pBuffer, GL_RGBA);
	}
	else {
		glBindTexture(GL_TEXTURE_2D, m_TexID);
		glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid *)pBuffer);
		glBindTexture(GL_TEXTURE_2D, 0);
	}
	CopyTexture(m_TexID, GL_TEXTURE_2D, TexID, TextureTarget, width, height, bInvert, HostFBO);
	memoryshare.UnlockSenderMemory();
	return true;
}
bool spoutGLDXinterop :: ReadMemory ( GLuint TexID , GLuint TextureTarget , unsigned int width , unsigned int height , bool bInvert , GLuint HostFBO ) { unsigned char * pBuffer = memoryshare . LockSenderMemory ( ) ; if ( ! pBuffer ) return false ; CheckOpenGLTexture ( m_TexID , GL_RGBA , width , height , m_TexWidth , m_TexHeight ) ; if ( IsPBOavailable ( ) ) { LoadTexturePixels ( m_TexID , GL_TEXTURE_2D , width , height , ( const unsigned char * ) pBuffer , GL_RGBA ) ; } else { glBindTexture ( GL_TEXTURE_2D , m_TexID ) ; glTexSubImage2D ( GL_TEXTURE_2D , 0 , 0 , 0 , width , height , GL_RGBA , GL_UNSIGNED_BYTE , ( GLvoid * ) pBuffer ) ; glBindTexture ( GL_TEXTURE_2D , 0 ) ; } CopyTexture ( m_TexID , GL_TEXTURE_2D , TexID , TextureTarget , width , height , bInvert , HostFBO ) ; memoryshare . UnlockSenderMemory ( ) ; return true ; }
Read shared memory to texture pixel data
rgba textures only
Read shared memory to texture pixel data rgba textures only
// Create or resize a local OpenGL texture
 // Copy the rgba memory map pixels to the local rgba opengl texture
 // Copy the local rgba texture to the user texture and invert as necessary
