void TextTestApp::onPassiveSceneComplete( /* SceneBase* sceneInstance */) { int sceneId = currentScene->getId(); currentScene->getSignal()->disconnect_all_slots(); switch(sceneId){ case 1: currentScene = new PassiveScene2(); break; case 2: currentScene = new PassiveScene3(); break; case 3: currentScene = new PassiveScene4(); break; case 4: currentScene = new PassiveScene1(); break; case 101 : currentScene = new ActiveScene2(); break; case 102 : currentScene = new PassiveScene3(); break; } currentScene->getSignal()->connect( boost::bind(&TextTestApp::onPassiveSceneComplete, this )); currentScene->setup( myFont, iconFactory, fgParticles, mbackground.gridLayer1 ); }
void TextTestApp::beginActiveScene(){ currentScene->getSignal()->disconnect_all_slots(); //timeline().clear(); currentScene = new ActiveScene1(); currentScene->getSignal()->connect( boost::bind(&TextTestApp::onPassiveSceneComplete, this )); currentScene->setup( myFont, iconFactory, fgParticles, mbackground.gridLayer1 ); }
void TextTestApp::setup() { hideBackground = false; activeUserPresent = false; // SET UP BLUR STUFF // setup our scene Fbo mFboScene = gl::Fbo( getWindowWidth(), getWindowHeight() ); // setup our blur Fbo's, smaller ones will generate a bigger blur mFboBlur1 = gl::Fbo(getWindowWidth()/8, getWindowHeight()/8); mFboBlur2 = gl::Fbo(getWindowWidth()/8, getWindowHeight()/8); OutlineParams::getInstance()->init(); // load and compile the shaders try { mShaderBlur = gl::GlslProg( loadFile("../shaders/blur_vert.glsl"), loadFile("../shaders/blur_frag.glsl")); } catch(...) { console() << "Can't load/compile blur shader" << endl; quit(); } try { mShaderPhong = gl::GlslProg( loadFile("../shaders/phong_vert.glsl"), loadFile("../shaders/phong_frag.glsl")); } catch(...) { console() << "Can't load/compile phong shader" << endl; quit(); } mTransform.setToIdentity(); gestureTracker = GestureTracker::getInstance(); gl::Texture::Format format; format.enableMipmapping(true); mCamera.setEyePoint( Vec3f(2.5f, 5.0f, 5.0f) ); mCamera.setCenterOfInterestPoint( Vec3f(0.0f, 2.0f, 0.0f) ); mCamera.setPerspective( 60.0f, getWindowAspectRatio(), 1.0f, 1000.0f ); for (int i=0; i<40; i++) { CinderClip cinderClip = CinderClip(); cinderClip.x = -200; cinderClip.y = -200; repelClips.push_back(cinderClip); //// // TweenParticle userParticle = TweenParticle(cinderClip.x, cinderClip.y,10,true); //userParticles.push_back(userParticle); } mbackground.setup(); mbackground.setRepelClips( repelClips ); // I KNOW THEY ON SCREEN //load store config cinder::XmlTree configXml(ci::app::loadAsset( "shopconfig.xml" ) ); ShopConfig::getInstance()->parseConfig(configXml); ci::gl::Texture bubbleManWaveTexture = cinder::loadImage(ci::app::loadResource(BUBBLEMAN_WAVE)); mBubbleManWave = new SpriteSheet(); mBubbleManWave->init(bubbleManWaveTexture, "./spritesheetdata/bubbleman_wave.xml", SpriteSheet::FORMAT_TEXTUREPACKER_GENERIC_XML); ci::gl::Texture bubbleManRunTexture = cinder::loadImage(ci::app::loadResource(BUBBLEMAN_RUN)); mBubbleManRun = new SpriteSheet(); mBubbleManRun->init(bubbleManRunTexture, "./spritesheetdata/bubbleman_run.xml", SpriteSheet::FORMAT_TEXTUREPACKER_GENERIC_XML); TextureGlobals::getInstance()->setSpriteSheet(mBubbleManRun,TextureGlobals::SPRITE_BUBBLEMAN_RUN); TextureGlobals::getInstance()->setSpriteSheet(mBubbleManWave,TextureGlobals::SPRITE_BUBBLEMAN_WAVE); gl::Texture particleTexture0 = loadImage(loadAsset( "ParticleFullON.png" ) ); TextureGlobals::getInstance()->setParticleTexture(particleTexture0,0); gl::Texture particleTexture1 = loadImage(loadAsset( "ParticlePatial01.png" ) ); TextureGlobals::getInstance()->setParticleTexture(particleTexture1,1); gl::Texture particleTexture2 = loadImage(loadAsset( "ParticlePatial02.png" ) ); TextureGlobals::getInstance()->setParticleTexture(particleTexture2,2); gl::Texture particleTexture3 = loadImage(loadAsset( "ParticlePatial03.png" ) ); TextureGlobals::getInstance()->setParticleTexture(particleTexture3,3); gl::Texture particleTexture4 = loadImage(loadAsset( "ParticlePatial04.png" ) ); TextureGlobals::getInstance()->setParticleTexture(particleTexture4,4); gl::Texture particleTexture5 = loadImage(loadAsset( "ParticlePatial05.png" ) ); TextureGlobals::getInstance()->setParticleTexture(particleTexture5,5); gl::Texture particleTexture6 = loadImage(loadAsset( "background-particle.png" ) ); TextureGlobals::getInstance()->setParticleTexture(particleTexture6,6); gl::Texture particleTexture7 = loadImage(loadAsset( "ParticleFullONYellow.png" ) ); TextureGlobals::getInstance()->setParticleTexture(particleTexture6,7); gl::Texture terms1Texture = loadImage(loadAsset( "terms1.png" ) ); TextureGlobals::getInstance()->setParticleTexture(terms1Texture,8); gl::Texture terms2Texture = loadImage(loadAsset( "terms2.png" ) ); TextureGlobals::getInstance()->setParticleTexture(terms2Texture,9); //gl::Texture terms2Texture = loadImage(loadAsset( "terms2.png" ) ); //TextureGlobals::getInstance()->setParticleTexture(particleTexture6,9); myFont = FontRenderer(); fgParticles.setup( 100 ); fgParticles.setRepelClips(repelClips); // TO VIEW ACTIVE SCENE //currentScene = new ActiveScene1(); //currentScene->getSignal()->connect( boost::bind(&TextTestApp::onPassiveSceneComplete, this, ::_1 )); //currentScene->setup( myFont, iconFactory, fgParticles ); currentScene = new PassiveScene1(); currentScene->getSignal()->connect( boost::bind(&TextTestApp::onPassiveSceneComplete, this )); currentScene->setup( myFont, iconFactory, fgParticles, mbackground.gridLayer1 ); iconFactory.init(); bgAnimationTimer = Timer(); significantInteractionTimer = Timer(); setupSkeletonTracker(); }