CacheClientTextureValues() private method

private CacheClientTextureValues ( int textureId, int width, int height, IntPtr syphonClientTextureInstance ) : bool
textureId int
width int
height int
syphonClientTextureInstance IntPtr
return bool
コード例 #1
0
	public void Render(){
				
		if(attachedTexture.GetNativeTextureID() != cachedTexID){
			cachedTexID = attachedTexture.GetNativeTextureID();
			Syphon.CacheClientTextureValues(attachedTexture.GetNativeTextureID(), attachedTexture.width, attachedTexture.height, syphonClientPointer);
			initialized = true;
		}
		
		if(syphonClientPointer != IntPtr.Zero && initialized){	

			//you need to render once per frame for each texture.
			Syphon.SafeMaterial.SetPass(0);	
			RenderTexture.active = attachedTexture;
			GL.IssuePluginEvent((int)syphonClientPointer);
			RenderTexture.active = null;
		}
	}
コード例 #2
0
    public void Render()
    {
        if (attachedTexture.GetNativeTexturePtr() != cachedTexID)
        {
            cachedTexID = attachedTexture.GetNativeTexturePtr();
            Syphon.CacheClientTextureValues(attachedTexture.GetNativeTexturePtr(), attachedTexture.width, attachedTexture.height, syphonClientPointer);
            initialized = true;
        }

        if (syphonClientPointer != IntPtr.Zero && initialized)
        {
            //you need to render once per frame for each texture.
            Syphon.SafeMaterial.SetPass(0);
            RenderTexture.active = attachedTexture;
//			UnityEngine.Debug.Log ("ISSUING EVENT?" + (int)syphonClientPointer) ;
            GL.IssuePluginEvent(Syphon.SyphonGetRenderEventFunc(), (int)syphonClientPointer);
            RenderTexture.active = null;
        }
    }
コード例 #3
0
    public void InitSyphonClient()
    {
        //call Syphon initialize method here.
        //if we have a valid syphon server attached, and not initialized yet,
        if (Application.isPlaying && attachedServer.SyphonServerPointer != 0 && !initialized)
        {
            // Debug.Log("EXECUTING syphon client: " + boundAppName + " " + boundName);
            attachedTexture.Create();
            RenderTexture.active = attachedTexture;
            Graphics.Blit(Syphon.NullTexture, attachedTexture);
            RenderTexture.active = null;
            //RenderTexture.active = attachedTexture;
            syphonClientPointer = Syphon.CreateClientTexture(attachedServer.SyphonServerPointer);
            Syphon.CacheClientTextureValues(attachedTexture.GetNativeTextureID(), attachedTexture.width, attachedTexture.height, syphonClientPointer);
            initialized = true;

            if (AnnounceClient != null)
            {
                AnnounceClient(this);
            }
        }
    }