-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-// EXTERNAL HEADERS
-#include <sstream>
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
// CLASS HEADER
#include "bubble-effect.h"
+// EXTERNAL HEADERS
+#include <sstream>
+#include <dali/public-api/common/stage.h>
+#include <dali/public-api/images/image.h>
+
namespace Dali
{
std::ostringstream vertexShaderStringStream;
vertexShaderStringStream << "#define NUMBER_OF_BUBBLE "<< numberOfBubble << "\n";
std::string vertexShader(
+ " precision mediump float;\n"
// the gravity applied to the y direction
" uniform float uGravity; \n"
// Width of the texture in pixels
vertexShaderStringStream << vertexShader;
std::string fragmentShader(
+ " precision mediump float;\n"
" varying float vPercentage;\n"
" varying vec2 vEffectTexCoord;\n"
"\n"
" gl_FragColor = fragColor;\n"
" }\n");
- ShaderEffect shaderEffect = ShaderEffect::New( vertexShaderStringStream.str(), fragmentShader,
- GeometryType( GEOMETRY_TYPE_TEXTURED_MESH),
- ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING ) );
+ ShaderEffect shaderEffect = ShaderEffect::New(
+ vertexShaderStringStream.str(),
+ fragmentShader,
+ GeometryType( GEOMETRY_TYPE_TEXTURED_MESH),
+ ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING ) );
+
BubbleEffect handle( shaderEffect );
handle.mNumberOfBubbles = numberOfBubble;
handle.SetMovementArea( Stage::GetCurrent().GetSize() );
-
handle.SetUniform( "uGravity", 50.f );
handle.SetUniform( "uMagnification", 1.f );
handle.SetUniform( "uDynamicScale", 1.f );