Ejemplo n.º 1
0
void SyphonBasicApp::setup()
{
	try {
		mLogo = gl::Texture::create( loadImage( loadAsset("cinder_logo_alpha.png") ) );
	}
	catch( ... ) {
		std::cout << "unable to load the texture file!" << std::endl;
	}
	
	try {
		mShader = gl::GlslProg::create( loadAsset("passThru_vert.glsl"), loadAsset("gaussianBlur_frag.glsl") );
	}
	catch( gl::GlslProgCompileExc &exc ) {
		std::cout << "Shader compile error: " << std::endl;
		std::cout << exc.what();
	}
	catch( ... ) {
		std::cout << "Unable to load shader" << std::endl;
	}
	
	mAngle = 0.0f;
	
	mScreenSyphon.setName("Screen Output"); // set a name for each item to be published
	mTextureSyphon.setName("Texture Output");
	
	mClientSyphon.setup();
    
	// in order for this to work, you must run simple server which is a syphon test application
    // feel free to change the app and server name for your specific case
    mClientSyphon.set("", "Simple Server");
    
    mClientSyphon.bind();
}
void SyphonServerDirectoryApp::setClient(int _idx){
    if(dir.isValidIndex(_idx)){
        syphonServerDescription desc = dir.getDescription(_idx);
        client.set(desc);
        client.bind();
        serverName = desc.serverName;
        appName = desc.appName;
        
        if(serverName == ""){
            serverName = "null";
        }
        if(appName == ""){
            appName = "null";
        }
    }
}