From: Kimmo Hoikka Date: Thu, 6 Dec 2018 15:01:10 +0000 (+0000) Subject: change metaball demos to use the simplified version of FrameBuffer API X-Git-Tag: submit/tizen/20181210.053315~1^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F53%2F194653%2F1;p=platform%2Fcore%2Fuifw%2Fdali-demo.git change metaball demos to use the simplified version of FrameBuffer API Change-Id: I8bbbfb7ba38ce07c9f137d2499cd671d10368c01 --- diff --git a/examples/metaball-explosion/metaball-explosion-example.cpp b/examples/metaball-explosion/metaball-explosion-example.cpp index a7fdd824..d5332d71 100644 --- a/examples/metaball-explosion/metaball-explosion-example.cpp +++ b/examples/metaball-explosion/metaball-explosion-example.cpp @@ -218,7 +218,6 @@ private: // Data Texture mBackgroundTexture; FrameBuffer mMetaballFBO; - Texture mMetaballFBOTexture; Actor mMetaballRoot; MetaballInfo mMetaballs[METABALL_NUMBER]; @@ -312,7 +311,6 @@ MetaballExplosionController::MetaballExplosionController( Application& applicati mScreenSize(), mBackgroundTexture(), mMetaballFBO(), - mMetaballFBOTexture(), mMetaballRoot(), mMetaballs(), mPositionIndex(), @@ -474,11 +472,7 @@ void MetaballExplosionController::CreateMetaballImage() // Create an FBO and a render task to create to render the metaballs with a fragment shader Stage stage = Stage::GetCurrent(); - mMetaballFBO = FrameBuffer::New( mScreenSize.x, mScreenSize.y, FrameBuffer::Attachment::NONE ); - mMetaballFBOTexture = Texture::New( Dali::TextureType::TEXTURE_2D, - Pixel::RGB888, - mScreenSize.x, mScreenSize.y ); - mMetaballFBO.AttachColorTexture( mMetaballFBOTexture ); + mMetaballFBO = FrameBuffer::New( mScreenSize.x, mScreenSize.y ); stage.Add(mMetaballRoot); @@ -501,7 +495,7 @@ void MetaballExplosionController::CreateComposition() // Create new texture set auto textureSet = TextureSet::New(); textureSet.SetTexture( 0u, mBackgroundTexture ); - textureSet.SetTexture( 1u, mMetaballFBOTexture ); + textureSet.SetTexture( 1u, mMetaballFBO.GetColorTexture() ); // Create geometry Geometry metaballGeom = CreateGeometry( false ); diff --git a/examples/metaball-refrac/metaball-refrac-example.cpp b/examples/metaball-refrac/metaball-refrac-example.cpp index 8d1def83..b73c6b95 100644 --- a/examples/metaball-refrac/metaball-refrac-example.cpp +++ b/examples/metaball-refrac/metaball-refrac-example.cpp @@ -210,7 +210,6 @@ private: // Data Texture mBackgroundTexture; FrameBuffer mMetaballFBO; - Texture mMetaballFBOTexture; Actor mMetaballRoot; MetaballInfo mMetaballs[METABALL_NUMBER]; @@ -451,11 +450,7 @@ void MetaballRefracController::CreateMetaballImage() { // Create an FBO and a render task to create to render the metaballs with a fragment shader Stage stage = Stage::GetCurrent(); - mMetaballFBO = FrameBuffer::New( mScreenSize.x, mScreenSize.y, FrameBuffer::Attachment::NONE ); - mMetaballFBOTexture = Texture::New( Dali::TextureType::TEXTURE_2D, - Pixel::RGB888, - mScreenSize.x, mScreenSize.y ); - mMetaballFBO.AttachColorTexture( mMetaballFBOTexture ); + mMetaballFBO = FrameBuffer::New( mScreenSize.x, mScreenSize.y ); stage.Add(mMetaballRoot); @@ -478,7 +473,7 @@ void MetaballRefracController::CreateComposition() // Create new texture set mTextureSetRefraction = TextureSet::New(); mTextureSetRefraction.SetTexture( 0u, mBackgroundTexture ); - mTextureSetRefraction.SetTexture( 1u, mMetaballFBOTexture ); + mTextureSetRefraction.SetTexture( 1u, mMetaballFBO.GetColorTexture() ); // Create normal shader mShaderNormal = Shader::New( METABALL_VERTEX_SHADER, FRAG_SHADER );