Example #1
0
void svvimApp::update() {
  float noise = mPerlinGenerator.fBm(Vec2f(0., app::getElapsedSeconds()));
  
  app::console() << noise << "\n";
  // Update alpha values
  getAlpha();

  if (mPoolWaterMovie)
    mMaskTexture = mPoolWaterMovie.getTexture();
  
  if (mCurrentMovie.isDone()) {
    incrementMovie();
  }
  
  app::console() << 10 * app::getElapsedSeconds() << "\n";
  

  mImageTexture = mCurrentMovie.getTexture();
  
  //mImageTexture = mCurrentBgTexture;
  
  // ...
  
  

}
Example #2
0
void VideoPanApp::update()
{
	if( mMovie.checkNewFrame() ) {
		mMovieFrame = gl::Texture(mMovie.getTexture());
		if( particleCount < maxParticles ) {
			mParticleController.addParticle( gl::Texture(mMovie.getTexture()) );
			particleCount++;
			mMovie.stepForward();
		}
	} else {
		mParticleController.setWidth(mParticleWidth);
		mParticleController.setPixelOffset(mPixelOffset);
		mParticleController.update();
	}
}
Example #3
0
void ProjectionMappingApp::update()
{
	this->updateBezierMesh();// update

	gl::setMatricesWindow(getWindowSize(), false); // 画像の表示を上向きにする
	mFbo.bindFramebuffer();
	gl::clear(Color(0, 0, 0));

	mShader.bind();
	mShader.uniform("diffuseMap", 0);

#if 0
	mMovie.getTexture().bind(0);
#else 
	if (mEditMode == EditMode_EDIT) {
		if (mDispMode == DispMode_MOVIE && mHasMovie) {
			mMovie.getTexture().bind(0);
		} else {
			mDiffuseTex[mDispMode].bind(0);
		}
	} else if (mEditMode == EditMode_RECORD) {
		if (mFrame <= mDuration) {
			gl::Texture::Format texformat;
			texformat.setTargetRect();

			std::string imgName = (boost::format("%s\\%s_%05d.png") % mInImageFolder % mInImageName % mFrame).str();
			if (boost::filesystem::exists(boost::filesystem::path(imgName))) {
				mDiffuseTex[mDispMode] = gl::Texture(loadImage(imgName.c_str()), texformat);
			}
			else {
				mDispMode = DispMode_GUIDE;
				mEditMode = EditMode_EDIT;
			}
		} else {
			mEditMode = EditMode_EDIT;
		}
	}
#endif

	gl::draw(mMesh);
	mShader.unbind();

	mFbo.unbindFramebuffer();
}
Example #4
0
void svvimApp::prepareSettings (Settings *settings) {
  app::console() << "prepareSettings (entering)\n";
  
  mCurrentMovie = qtime::MovieGl(getResourcePath("water-under.m4v"));
  mCurrentMovie.play();
  mCurrentMovie.setVolume(0.);
  
  mFrameTexture = mCurrentMovie.getTexture();
  
  //
  settings->setWindowSize(mCurrentMovie.getWidth(), mCurrentMovie.getHeight());
  settings->setFrameRate(mCurrentMovie.getFramerate()*2);
  settings->setFullScreen(true);
  
  // ...
  app::console() << "prepareSettings (leaving)\n";
}
void QuickTimeSampleApp::update()
{
	if( mMovie )
		mFrameTexture = mMovie.getTexture();
}