void AwesomeSilkApp::draw()
{
	gl::clear();
    
	if( mWebTexture )
	{
		gl::color( Color::white() );
		gl::draw( mWebTexture );
        if (useSyphon){
            mTextureSyphon.publishTexture(&mWebTexture); //publish our texture
        }
	}
    
	// show spinner while loading
	if( mLoadingTexture && mWebViewPtr && mWebViewPtr->IsLoading() )
	{
		gl::pushModelView();
        
		gl::translate( 0.5f * Vec2f( getWindowSize() ) );
		gl::scale( 0.5f, 0.5f );
		gl::rotate( 180.0f * float( getElapsedSeconds() ) );
		gl::translate( -0.5f * Vec2f( mLoadingTexture.getSize() ) );
		
		gl::color( Color::white() );
		gl::enableAlphaBlending();
		gl::draw( mLoadingTexture );
		gl::disableAlphaBlending();
        
		gl::popModelView();
	}
}
Пример #2
0
void MilluminApp::draw()
{    
	gl::enableAlphaBlending();
	gl::clear( Color( 0.1f, 0.1f, 0.1f ) );

	//draw our spiral
	gl::pushModelView();
	gl::translate(Vec2f(getWindowWidth()/2, getWindowHeight()/2));
	gl::rotate(mRot);
	gl::scale(Vec3f(4.f, 4.f, 1.f));
	gl::color(ColorA(1.f, 0.f, 0.f, 1.f));
	archimedes.draw();
	gl::popModelView();
	
	//draw our publishable texture
	if(mTex){
		gl::color(ColorA(1.f, 1.f, 1.f, 1.f));
		gl::draw(mTex);
	}
	
	mScreenSyphon.publishScreen(); //publish the screen
	mTextureSyphon.publishTexture(&mTex); //publish our texture
	
	//anything that we draw after here will not be published
	
	mClientSyphon.draw(Vec2f(300.0f, 0.0f)); //draw our client image
}
Пример #3
0
void syphonImpApp::draw()
{
	gl::enableAlphaBlending();
	gl::clear( Color( 0.1f, 0.1f, 0.1f ) );

    renderSceneToFbo();
    mTextureSyphon.publishTexture(&myFbo.getTexture()); //publish our texture

    Vec2f upperLeftCorner = Vec2f( 0, WIDTH );
    Vec2f lowerRightCorner = Vec2f(WIDTH,WIDTH-(WIDTH/1.33) );
    Rectf rect = Rectf( upperLeftCorner, lowerRightCorner );
    gl::draw( myFbo.getTexture(0),rect);


	

}
Пример #4
0
void ardroneApp::draw()
{
    renderFbo.bindFramebuffer();

	gl::clear( Color( 0, 0, 0 ) );
    gl::color( Color::white() );
	if ( mFrameTexture ) {
		Rectf centeredRect = Rectf( mFrameTexture.getBounds() ).getCenteredFit( getWindowBounds(), true );
		gl::draw( mFrameTexture, centeredRect  );
	}
    
    renderFbo.blitToScreen(renderFbo.getBounds(), getWindowBounds());
    mSyphonServer.publishTexture(renderFbo.getTexture(), false);

    renderFbo.unbindFramebuffer(); // return rendering to the window's own frame buffer

	if( mInfoTexture ) {
		glDisable( GL_TEXTURE_RECTANGLE_ARB );
		gl::draw( mInfoTexture, Vec2f( 5, getWindowHeight() - 5 - mInfoTexture.getHeight() ) );
	}
}
Пример #5
0
void SyphonBasicApp::draw()
{
	gl::enableAlphaBlending();
	gl::clear(Color::white());
    gl::color(ColorA(1.f, 1.f, 1.f, 1.f));
	
    mShader->bind();
    mShader->uniform( "tex0", 0 );
    mShader->uniform( "sampleOffset", Vec2f( cos( mAngle ), sin( mAngle ) ) * ( 3.0f / getWindowWidth() ) );
    gl::draw(mLogo, Vec2f::zero());
    mShader->unbind();
    
    mClientSyphon.draw(Vec2f(16.f, 64.f)); //draw our client image
    
	mScreenSyphon.publishScreen(); //publish the screen's output
	mTextureSyphon.publishTexture(mLogo); //publish our texture without shader
	
	//anything that we draw after here will not be published
    gl::drawStringCentered("This text will not be published to Syphon.", Vec2f(getWindowCenter().x, 20.f), ColorA::black());
	
}