X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Frefraction-effect%2Frefraction-effect-example.cpp;h=d4e0213b60df40a76c7d1d7f30d5793da16ba8fa;hb=ff961cccdcbf1c30b0f53b0da027df855cde2b63;hp=189a7c79c349adade3b3a30d2248a7fa3532dba7;hpb=8703f6e3f98f81e8d500d8c494a6ef50374b3162;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/refraction-effect/refraction-effect-example.cpp b/examples/refraction-effect/refraction-effect-example.cpp index 189a7c7..d4e0213 100644 --- a/examples/refraction-effect/refraction-effect-example.cpp +++ b/examples/refraction-effect/refraction-effect-example.cpp @@ -26,6 +26,7 @@ // INTERNAL INCLUDES #include "shared/view.h" +#include "shared/utility.h" using namespace Dali; @@ -74,19 +75,6 @@ struct LightOffsetConstraint }; /** - * @brief Load an image, scaled-down to no more than the stage dimensions. - * - * Uses image scaling mode SCALE_TO_FILL to resize the image at - * load time to cover the entire stage with pixels with no borders, - * and filter mode BOX_THEN_LINEAR to sample the image with maximum quality. - */ -ResourceImage LoadStageFillingImage( const char * const imagePath ) -{ - Size stageSize = Stage::GetCurrent().GetSize(); - return ResourceImage::New( imagePath, ImageDimensions( stageSize.x, stageSize.y ), Dali::FittingMode::SCALE_TO_FILL, Dali::SamplingMode::BOX_THEN_LINEAR ); -} - -/** * structure of the vertex in the mesh */ struct Vertex @@ -280,9 +268,9 @@ private: mShaderFlat = Shader::New( VERTEX_SHADER_FLAT, FRAGMENT_SHADER_FLAT ); mGeometry = CreateGeometry( MESH_FILES[mCurrentMeshId] ); - Image texture = LoadStageFillingImage( TEXTURE_IMAGES[mCurrentTextureId] ); + Texture texture = DemoHelper::LoadStageFillingTexture( TEXTURE_IMAGES[mCurrentTextureId] ); mTextureSet = TextureSet::New(); - mTextureSet.SetImage( 0u, texture ); + mTextureSet.SetTexture( 0u, texture ); mRenderer = Renderer::New( mGeometry, mShaderFlat ); mRenderer.SetTextures( mTextureSet ); @@ -343,8 +331,8 @@ private: bool OnChangeTexture( Toolkit::Button button ) { mCurrentTextureId = ( mCurrentTextureId + 1 ) % NUM_TEXTURE_IMAGES; - Image texture = LoadStageFillingImage( TEXTURE_IMAGES[mCurrentTextureId] ); - mTextureSet.SetImage( 0u, texture ); + Texture texture = DemoHelper::LoadStageFillingTexture( TEXTURE_IMAGES[mCurrentTextureId] ); + mTextureSet.SetTexture( 0u, texture ); return true; }