Exemplo n.º 1
0
void TutorialApp::draw()
{	
	gl::clear( Color( 0, 0, 0 ), true );
	gl::enableDepthRead();
	gl::enableDepthWrite();
	
	// DRAW PARTICLES
	mParticleController.draw();
	
	// DRAW ZONE DIAGRAM
	gl::disableDepthRead();
	gl::disableDepthWrite();
	gl::setMatricesWindow( getWindowSize() );
	gl::pushModelView();
        gl::translate( Vec3f( 117.0f, getWindowHeight() - 117.0f, 0.0f ) );
        
        gl::color( ColorA( 1.0f, 0.25f, 0.25f, 1.0f ) );
        gl::drawSolidCircle( Vec2f::zero(), mZoneRadius );
    
        gl::color( ColorA( 0.25f, 0.25f, 1.0f, 1.0f ) );
        gl::drawSolidCircle( Vec2f::zero(), mThresh * mZoneRadius );    
        
        gl::color( ColorA( 1.0f, 1.0f, 1.0f, 0.25f ) );
        gl::drawStrokedCircle( Vec2f::zero(), 100.0f );
	gl::popModelView();
	
	// DRAW PARAMS WINDOW
	params::InterfaceGl::draw();
}
Exemplo n.º 2
0
void Box2DTestApp::draw()
{
	gl::clear( Color( 0, 0, 0 ) );
	gl::enableAlphaBlending();

	particleController.draw();
}
Exemplo n.º 3
0
void TutorialApp::draw()
{
    if(isFirst) {
        gl::clear( Color( 0, 0, 0 ), true );
        isFirst = false;
    }

    gl::enableAlphaBlending();
	
	if( mDrawImage ){
		mTexture.enableAndBind();
		gl::draw( mTexture, getWindowBounds() );
	}
    
//	if( mDrawParticles ){
		glDisable( GL_TEXTURE_2D );
		mParticleController.draw();
//	}
    
    if( mDrawImage ){
        mOverlay.enableAndBind();
        gl::draw( mOverlay, getWindowBounds() );
    }

//	if( mSaveFrames ){
//		writeImage( getHomeDirectory() / ( "image_" + toString( getElapsedFrames() ) + ".png" ), copyWindowSurface() );
//	}
}
Exemplo n.º 4
0
void JtChapterOneApp::draw()
{
    //float gray = sin( getElapsedSeconds() ) * 0.5f + 0.5f;
    //gl::clear( Color( gray, gray, gray ), true);

    myPController.draw();
}
void HellCinderApp::draw()
{
    
    gl::clear( Color( 0, 0, 0 ), true );
	
	glDisable( GL_TEXTURE_2D );
	//gl::draw( texture, getWindowBounds() );

	particleController.draw();
}
Exemplo n.º 6
0
void Day57App::draw()
{
    gl::clear(Color(0, 0, 0), true);
    gl::enableDepthRead();
    gl::enableDepthWrite();
    
    gl::color(ColorA(1.0f, 1.0f, 1.0f, 1.0f));
    mParticleController.draw();
    //	mParticleController.drawConnections();
}
Exemplo n.º 7
0
void TutorialApp::draw()
{	
	gl::clear( Color( 0, 0, 0 ), true );
	
	mImage.enableAndBind();
	gl::draw( mImage, getWindowBounds() );
	
	glDisable( GL_TEXTURE_2D );
	glColor3f( 1, 1, 1 );
	mParticleController.draw();
}
Exemplo n.º 8
0
void VideoPanApp::draw()
{
	// clear out the window with black
	
	gl::clear( Color( 0, 0, 0 ) ); 
	
	gl::setMatricesWindow(getWindowSize(), true);

	gl::rotate(90);
	mParticleController.draw();
	params::InterfaceGl::draw();
}
Exemplo n.º 9
0
void FlockingApp::draw()
{	
	gl::clear( Color( 0, 0, 0.01f ), true );
	gl::enableDepthRead();
	gl::enableDepthWrite();
	
	// DRAW PARTICLES
	glColor4f( ColorA( 1.0f, 1.0f, 1.0f, 1.0f ) );
	mParticleController.draw();
	
	// DRAW PARAMS WINDOW
	mParams->draw();
}
Exemplo n.º 10
0
void TutorialApp::draw()
{	
	gl::clear( Color( 0, 0, 0 ), true );
	
	if( mDrawImage ){
		mTexture.enableAndBind();
		gl::draw( mTexture, getWindowBounds() );
	}
	
	if( mDrawParticles ){
		glDisable( GL_TEXTURE_2D );
		mParticleController.draw();
	}
}
Exemplo n.º 11
0
void FlockingApp::draw()
{	
	gl::clear( Color( 0, 0, 0 ), true );
	gl::enableDepthRead();
	gl::enableDepthWrite();

	gl::color( ColorA( 1.0f, 1.0f, 1.0f, 1.0f ) );
	mParticleController.draw();
	
	if( mSaveFrames ){
		writeImage( getHomeDirectory() / "flocking" / ("image_" + toString( getElapsedFrames() ) + ".png"), copyWindowSurface() );
	}
	
	// DRAW PARAMS WINDOW
	params::InterfaceGl::draw();
}
Exemplo n.º 12
0
void chapter3App::draw()
{
	// clear out the window with black
	gl::clear( Color( 0, 0, 0 ) ); 
        
    if(mDrawImage)
    {
        mColorTexture.enableAndBind();
        gl::draw( mColorTexture, getWindowBounds());
    }
    
    if ( mDrawParticles )
    {
        glDisable(GL_TEXTURE_2D);
        mParticleController.draw();
    }
}
Exemplo n.º 13
0
void syphonImpApp::renderSceneToFbo()
{
	// this will restore the old framebuffer binding when we leave this function
	// on non-OpenGL ES platforms, you can just call mFbo.unbindFramebuffer() at the end of the function
	// but this will restore the "screen" FBO on OpenGL ES, and does the right thing on both platforms
	gl::SaveFramebufferBinding bindingSaver;
	
	// bind the framebuffer - now everything we draw will go there
	myFbo.bindFramebuffer();
    gl::setViewport(myFbo.getBounds() );
    gl::setMatricesWindow( myFbo.getSize(), false );
	
	// clear out the FBO with blue
	gl::clear();
   mParticleController.update();
    mParticleController.draw();
    
}
Exemplo n.º 14
0
void TutorialApp::draw()
{	
	gl::clear( Color( 0, 0, 0 ), true );
	
	if( mDrawImage ){
		mTexture.enableAndBind();
		gl::draw( mTexture, getWindowBounds() );
	}
	
	if( mDrawParticles ){
		glDisable( GL_TEXTURE_2D );
		mParticleController.draw();
	}
	
	if( mSaveFrames ){
		writeImage( getHomeDirectory() + "image_" + toString( getElapsedFrames() ) + ".png", copyWindowSurface() );
	}
}
Exemplo n.º 15
0
void matrixP::draw() {
	gl::clear();
	if(mRenderParticles) mParticleController.draw();
}
Exemplo n.º 16
0
// Draw
void PixarDemo2012::draw()
{

    gl::clear( ColorA(0.0f,0.0f,0.0f,1.0f) );

    //render Gradient FBO
    if(!drawMindField && !drawCloth)
    {
        renderGradientFBO();
    }

    gl::setViewport( getWindowBounds() );
    gl::setMatricesWindow( getWindowSize(), true );

    gl::clear( ColorA(0.0f,0.0f,0.0f,1.0f) );

    // draw FBO bg
    gl::color(1.0f,1.0f,1.0f);
    gl::draw( mGradientFBO.getTexture(0), Rectf( 0, 0, getWindowWidth(), getWindowHeight()) );

    if ( drawTitle ) {
        if ( mTime > 10.0f ) drawTitle = false;
        theTitle.Render();
    }


    // FFT stuff
    generateWaveforms();

    if ( drawMindField ) {
        theMindField.Render();
        drawFader();
        return;
    }
    if ( drawCubes ) {
        gl::popMatrices();
        gl::setMatrices( theCubes.cubesCamera );
        theCubes.Render();
    }
    if ( drawCloth ) {

        theCloth.Render();
        drawFader();
        return;
    }


    // Balls
    if ( !drawCubes ) {
        gl::setMatricesWindow( getWindowSize(), true );
        if (makeBall > 0.075f) mParticleController.addParticles(1,makeBall*100.0f,mTime);
        mParticleController.draw();
    }
    if ( drawFPS ) {
        string mString;
        mString = str(boost::format("FRAMERATE: %f") % getAverageFps() );
        gl::drawString( mString, Vec2f( 10.0f, 10.0f ), Color::white(), mFont );
    }

    drawFader();

}
Exemplo n.º 17
0
//------------------------------------------------------------
//--
//------------------------------------------------------------
void cdr_Snow::draw()
{
    // clear out the window with black
    gl::clear( Color( 0, 0, 0.2f ) );
    myParticles.draw();
}