Commit de1fd913be651474ecbcc5212f0a331f0803ac48
[dali_1.2.42] Merge branch 'devel/master'
Change-Id: I96af28a60865083861d7723e9c7583274974513c
Showing
28 changed files
with
853 additions
and
25 deletions
com.samsung.dali-demo.xml
| @@ -221,4 +221,7 @@ | @@ -221,4 +221,7 @@ | ||
| 221 | <ui-application appid="rendering-basic-light.example" exec="/usr/apps/com.samsung.dali-demo/bin/rendering-basic-light.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> | 221 | <ui-application appid="rendering-basic-light.example" exec="/usr/apps/com.samsung.dali-demo/bin/rendering-basic-light.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> |
| 222 | <label>Basic Light</label> | 222 | <label>Basic Light</label> |
| 223 | </ui-application> | 223 | </ui-application> |
| 224 | + <ui-application appid="rendering-skybox.example" exec="/usr/apps/com.samsung.dali-demo/bin/rendering-skybox.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true"> | ||
| 225 | + <label>Skybox</label> | ||
| 226 | + </ui-application> | ||
| 224 | </manifest> | 227 | </manifest> |
demo/dali-demo.cpp
| @@ -48,6 +48,7 @@ int DALI_EXPORT_API main(int argc, char **argv) | @@ -48,6 +48,7 @@ int DALI_EXPORT_API main(int argc, char **argv) | ||
| 48 | demo.AddExample(Example("renderer-stencil.example", DALI_DEMO_STR_TITLE_RENDERER_STENCIL)); | 48 | demo.AddExample(Example("renderer-stencil.example", DALI_DEMO_STR_TITLE_RENDERER_STENCIL)); |
| 49 | demo.AddExample(Example("shadows-and-lights.example", DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS)); | 49 | demo.AddExample(Example("shadows-and-lights.example", DALI_DEMO_STR_TITLE_LIGHTS_AND_SHADOWS)); |
| 50 | demo.AddExample(Example("sparkle.example", DALI_DEMO_STR_TITLE_SPARKLE)); | 50 | demo.AddExample(Example("sparkle.example", DALI_DEMO_STR_TITLE_SPARKLE)); |
| 51 | + demo.AddExample(Example("rendering-skybox.example", DALI_DEMO_STR_TITLE_SKYBOX)); | ||
| 51 | 52 | ||
| 52 | demo.SortAlphabetically( true ); | 53 | demo.SortAlphabetically( true ); |
| 53 | 54 |
examples/rendering-skybox/look-camera.cpp
0 → 100644
| 1 | +/* | ||
| 2 | + * Copyright (c) 2017 Samsung Electronics Co., Ltd. | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + * | ||
| 16 | + */ | ||
| 17 | + | ||
| 18 | +#include "look-camera.h" | ||
| 19 | + | ||
| 20 | +#include <dali/public-api/common/stage.h> | ||
| 21 | +#include <dali/public-api/render-tasks/render-task-list.h> | ||
| 22 | +#include <dali/public-api/render-tasks/render-task.h> | ||
| 23 | +#include <dali/public-api/events/touch-data.h> | ||
| 24 | +#include <dali/public-api/events/touch-event.h> | ||
| 25 | + | ||
| 26 | +using namespace Dali; | ||
| 27 | + | ||
| 28 | +namespace | ||
| 29 | +{ | ||
| 30 | +// Input sensitivity, the larger value, the more sensitive input | ||
| 31 | +// Default value has been chosen empirically | ||
| 32 | +const float CAMERA_SENSITIVITY ( 90.0f ); | ||
| 33 | + | ||
| 34 | +// Vertical angle limit of the camera | ||
| 35 | +const float CAMERA_VERTICAL_LIMIT ( 80.0f ); | ||
| 36 | + | ||
| 37 | +// Position where camera is instantiated by default | ||
| 38 | +const Vector3 CAMERA_DEFAULT_POSITION ( 0.0f, 0.0f, 3.0f ); | ||
| 39 | + | ||
| 40 | +// Field-of-View in degrees | ||
| 41 | +const float CAMERA_DEFAULT_FOV ( 60.0f ); | ||
| 42 | + | ||
| 43 | +// Near plane | ||
| 44 | +const float CAMERA_DEFAULT_NEAR ( 0.1f ); | ||
| 45 | + | ||
| 46 | +// Far plane | ||
| 47 | +const float CAMERA_DEFAULT_FAR ( 100.0f ); | ||
| 48 | + | ||
| 49 | +// Default forward vector | ||
| 50 | +const Vector3 CAMERA_FORWARD ( 0.0f, 0.0f, 1.0f ); | ||
| 51 | + | ||
| 52 | +// Default up vector | ||
| 53 | +const Vector3 CAMERA_UP ( Vector3::YAXIS ); | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +LookCamera::LookCamera() | ||
| 57 | +: mCameraYawPitch( 0.0f, 180.0f ), | ||
| 58 | + mFovY( CAMERA_DEFAULT_FOV ), | ||
| 59 | + mNear( CAMERA_DEFAULT_NEAR ), | ||
| 60 | + mFar( CAMERA_DEFAULT_FAR ), | ||
| 61 | + mCameraPosition( CAMERA_DEFAULT_POSITION ) | ||
| 62 | +{ | ||
| 63 | +} | ||
| 64 | + | ||
| 65 | +LookCamera::~LookCamera() | ||
| 66 | +{ | ||
| 67 | + mTimer.Stop(); | ||
| 68 | + mCameraActor.Remove( mInterceptorActor ); | ||
| 69 | +} | ||
| 70 | + | ||
| 71 | +void LookCamera::Initialise( const Vector3& position, float fovY, float near, float far ) | ||
| 72 | +{ | ||
| 73 | + mFovY = fovY; | ||
| 74 | + mNear = near; | ||
| 75 | + mFar = far; | ||
| 76 | + | ||
| 77 | + // Camera position is shadowed in order to avoid using GetCurrentPosition() | ||
| 78 | + mCameraPosition = position; | ||
| 79 | + | ||
| 80 | + // Initialise default camera | ||
| 81 | + InitialiseDefaultCamera(); | ||
| 82 | + | ||
| 83 | + // Create input interceptor actor | ||
| 84 | + CreateInterceptorActor(); | ||
| 85 | + | ||
| 86 | + // Start timer | ||
| 87 | + mTimer = Timer::New( 16 ); | ||
| 88 | + mTimer.TickSignal().Connect( this, &LookCamera::OnTick ); | ||
| 89 | + mTimer.Start(); | ||
| 90 | +} | ||
| 91 | + | ||
| 92 | +bool LookCamera::OnTick() | ||
| 93 | +{ | ||
| 94 | + Vector2 stageSize = Stage::GetCurrent().GetSize(); | ||
| 95 | + | ||
| 96 | + // --------------------------------------------------------------------- | ||
| 97 | + // update rotation | ||
| 98 | + Vector2 tmp( mScreenLookDelta ); | ||
| 99 | + mScreenLookDelta = Vector2::ZERO; | ||
| 100 | + | ||
| 101 | + float yaw = ( (tmp.y / stageSize.x ) * CAMERA_SENSITIVITY ); | ||
| 102 | + float pitch = ( (tmp.x / stageSize.y ) * CAMERA_SENSITIVITY ); | ||
| 103 | + mCameraYawPitch.x -= yaw; | ||
| 104 | + mCameraYawPitch.y -= pitch; | ||
| 105 | + if( abs( mCameraYawPitch.x ) > CAMERA_VERTICAL_LIMIT ) | ||
| 106 | + { | ||
| 107 | + mCameraYawPitch.x = CAMERA_VERTICAL_LIMIT * ((mCameraYawPitch.x < 0) ? -1.0f : 1.0f ); | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + Quaternion rotation; | ||
| 111 | + Quaternion rotX( Degree( mCameraYawPitch.x), Vector3( 1.0f, 0.0f, 0.0f ) ); | ||
| 112 | + Quaternion rotY( Degree( mCameraYawPitch.y), Vector3( 0.0f, 1.0f, 0.0f ) ); | ||
| 113 | + rotation = ( rotY * rotX ); | ||
| 114 | + | ||
| 115 | + mCameraActor.SetOrientation( rotation ); | ||
| 116 | + | ||
| 117 | + return true; | ||
| 118 | +} | ||
| 119 | + | ||
| 120 | +void LookCamera::InitialiseDefaultCamera() | ||
| 121 | +{ | ||
| 122 | + Stage stage = Stage::GetCurrent(); | ||
| 123 | + mCameraActor = stage.GetRenderTaskList().GetTask(0).GetCameraActor(); | ||
| 124 | + mCameraActor.SetName( "LookCamera" ); | ||
| 125 | + mCameraActor.SetAnchorPoint( AnchorPoint::CENTER ); | ||
| 126 | + mCameraActor.SetParentOrigin( ParentOrigin::CENTER ); | ||
| 127 | + mCameraActor.SetFieldOfView( Radian( Degree( mFovY ) ) ); | ||
| 128 | + | ||
| 129 | + // should be read from file | ||
| 130 | + mCameraActor.SetNearClippingPlane( mNear ); | ||
| 131 | + mCameraActor.SetFarClippingPlane( mFar ); | ||
| 132 | + mCameraActor.SetPosition( mCameraPosition ); | ||
| 133 | +} | ||
| 134 | + | ||
| 135 | +void LookCamera::CreateInterceptorActor() | ||
| 136 | +{ | ||
| 137 | + Stage stage = Stage::GetCurrent(); | ||
| 138 | + | ||
| 139 | + mInterceptorActor = Actor::New(); | ||
| 140 | + mInterceptorActor.SetName( "InputInterceptor" ); | ||
| 141 | + mInterceptorActor.SetSize( Vector3( stage.GetSize().x, stage.GetSize().y, 1 ) ); | ||
| 142 | + mInterceptorActor.SetPosition( Vector3( 0.0, 0.0, 1.0 ) ); | ||
| 143 | + mInterceptorActor.SetAnchorPoint( AnchorPoint::CENTER ); | ||
| 144 | + mInterceptorActor.SetParentOrigin( ParentOrigin::CENTER ); | ||
| 145 | + mCameraActor.Add( mInterceptorActor ); | ||
| 146 | + | ||
| 147 | + // Connect TouchSignal to interceptor actor | ||
| 148 | + mInterceptorActor.TouchSignal().Connect( this, &LookCamera::OnTouch ); | ||
| 149 | +} | ||
| 150 | + | ||
| 151 | +bool LookCamera::OnTouch( Actor actor, const TouchData& touch ) | ||
| 152 | +{ | ||
| 153 | + Stage stage = Stage::GetCurrent(); | ||
| 154 | + | ||
| 155 | + for( int i = 0; i < (int)touch.GetPointCount() && i < 3; ++i ) | ||
| 156 | + { | ||
| 157 | + Vector2 position( touch.GetScreenPosition( i ) ); | ||
| 158 | + | ||
| 159 | + // touch started | ||
| 160 | + if( touch.GetState( i ) == PointState::STARTED ) | ||
| 161 | + { | ||
| 162 | + mOldTouchLookPosition = position; | ||
| 163 | + } | ||
| 164 | + else if( touch.GetState( i ) == PointState::FINISHED || | ||
| 165 | + touch.GetState( i ) == PointState::LEAVE || | ||
| 166 | + touch.GetState( i ) == PointState::INTERRUPTED | ||
| 167 | + ) | ||
| 168 | + { | ||
| 169 | + mScreenLookDelta = Vector2::ZERO; | ||
| 170 | + mOldTouchLookPosition = Vector2::ZERO; | ||
| 171 | + } | ||
| 172 | + else // on motion | ||
| 173 | + { | ||
| 174 | + mScreenLookDelta.x += ( position.x - mOldTouchLookPosition.x ); | ||
| 175 | + mScreenLookDelta.y += ( position.y - mOldTouchLookPosition.y ); | ||
| 176 | + mOldTouchLookPosition = position; | ||
| 177 | + } | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + return true; | ||
| 181 | +} |
examples/rendering-skybox/look-camera.h
0 → 100644
| 1 | +#ifndef LOOK_CAMERA_H | ||
| 2 | +#define LOOK_CAMERA_H | ||
| 3 | + | ||
| 4 | +/* | ||
| 5 | + * Copyright (c) 2017 Samsung Electronics Co., Ltd. | ||
| 6 | + * | ||
| 7 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 8 | + * you may not use this file except in compliance with the License. | ||
| 9 | + * You may obtain a copy of the License at | ||
| 10 | + * | ||
| 11 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 12 | + * | ||
| 13 | + * Unless required by applicable law or agreed to in writing, software | ||
| 14 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 15 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 16 | + * See the License for the specific language governing permissions and | ||
| 17 | + * limitations under the License. | ||
| 18 | + * | ||
| 19 | + */ | ||
| 20 | + | ||
| 21 | +#include <dali/public-api/actors/camera-actor.h> | ||
| 22 | +#include <dali/public-api/adaptor-framework/timer.h> | ||
| 23 | +#include <dali/public-api/math/vector2.h> | ||
| 24 | + | ||
| 25 | +/** | ||
| 26 | + * @brief The LookCamera class | ||
| 27 | + * | ||
| 28 | + * LookCamera handles user input to change the orientation of the default camera. | ||
| 29 | + */ | ||
| 30 | +class LookCamera : public Dali::ConnectionTracker | ||
| 31 | +{ | ||
| 32 | +public: | ||
| 33 | + | ||
| 34 | + /** | ||
| 35 | + * Creates an instance of LookCamera | ||
| 36 | + */ | ||
| 37 | + LookCamera(); | ||
| 38 | + | ||
| 39 | + /** | ||
| 40 | + * Destroys an instance of LookCamera | ||
| 41 | + */ | ||
| 42 | + ~LookCamera(); | ||
| 43 | + | ||
| 44 | + /** | ||
| 45 | + * Initialise with given position, fovY, near, far | ||
| 46 | + * @param[in] position Position of the camera. | ||
| 47 | + * @param[in] fovY Field of view in degrees | ||
| 48 | + * @param[in] near Near plane | ||
| 49 | + * @param[in] far Far Plane | ||
| 50 | + */ | ||
| 51 | + void Initialise( const Dali::Vector3& position, float fov, float near, float far ); | ||
| 52 | + | ||
| 53 | + /** | ||
| 54 | + * Retrieves actor associated with camera object | ||
| 55 | + * @return Returns camera actor | ||
| 56 | + */ | ||
| 57 | + Dali::CameraActor GetCameraActor(); | ||
| 58 | + | ||
| 59 | +private: | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * Sets up a perspective camera using Dali default camera | ||
| 63 | + */ | ||
| 64 | + void InitialiseDefaultCamera(); | ||
| 65 | + | ||
| 66 | + /** | ||
| 67 | + * Creates 'interceptor' actor. Interceptor actor is always parallel | ||
| 68 | + * to the camera and positioned little bit in front of it in order to | ||
| 69 | + * intercept user input. | ||
| 70 | + */ | ||
| 71 | + void CreateInterceptorActor(); | ||
| 72 | + | ||
| 73 | + /** | ||
| 74 | + * Handles onTouch signal on the 'interceptor' actor | ||
| 75 | + * @param[in] actor Actor receiving signal | ||
| 76 | + * @param[in] touch Touch data | ||
| 77 | + */ | ||
| 78 | + bool OnTouch( Dali::Actor actor, const Dali::TouchData& touch ); | ||
| 79 | + | ||
| 80 | + /** | ||
| 81 | + * Handles camera tick() update | ||
| 82 | + * @return true if continue running timer, false otherwise | ||
| 83 | + */ | ||
| 84 | + bool OnTick(); | ||
| 85 | + | ||
| 86 | +private: | ||
| 87 | + | ||
| 88 | + Dali::CameraActor mCameraActor; /// Camera actor | ||
| 89 | + Dali::Actor mInterceptorActor; /// Actor intercepting user input | ||
| 90 | + | ||
| 91 | + Dali::Timer mTimer; /// Per-frame timer | ||
| 92 | + | ||
| 93 | + Dali::Vector2 mScreenLookDelta; /// Look delta vector in screen space | ||
| 94 | + Dali::Vector2 mOldTouchLookPosition; /// Previous look vector in screen space | ||
| 95 | + | ||
| 96 | + Dali::Vector2 mCameraYawPitch; /// Camera yaw-pitch angles | ||
| 97 | + | ||
| 98 | + float mFovY; /// Camera field-of-view | ||
| 99 | + float mNear; /// Near plane | ||
| 100 | + float mFar; /// Far plane | ||
| 101 | + | ||
| 102 | + Dali::Vector3 mCameraPosition; /// Current camera position ( shadowing the actor position ) | ||
| 103 | +}; | ||
| 104 | + | ||
| 105 | +#endif |
examples/rendering-skybox/rendering-skybox.cpp
0 → 100644
| 1 | +/* | ||
| 2 | + * Copyright (c) 2017 Samsung Electronics Co., Ltd. | ||
| 3 | + * | ||
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | + * you may not use this file except in compliance with the License. | ||
| 6 | + * You may obtain a copy of the License at | ||
| 7 | + * | ||
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | + * | ||
| 10 | + * Unless required by applicable law or agreed to in writing, software | ||
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | + * See the License for the specific language governing permissions and | ||
| 14 | + * limitations under the License. | ||
| 15 | + * | ||
| 16 | + */ | ||
| 17 | + | ||
| 18 | +#include <dali/dali.h> | ||
| 19 | +#include <dali-toolkit/dali-toolkit.h> | ||
| 20 | + | ||
| 21 | +#include "look-camera.h" | ||
| 22 | + | ||
| 23 | +using namespace Dali; | ||
| 24 | +using namespace Toolkit; | ||
| 25 | + | ||
| 26 | +namespace | ||
| 27 | +{ | ||
| 28 | + | ||
| 29 | +/* | ||
| 30 | + * Vertex shader for a textured cube | ||
| 31 | + */ | ||
| 32 | +const char* VERTEX_SHADER_CUBE = DALI_COMPOSE_SHADER( | ||
| 33 | +attribute mediump vec3 aPosition;\n // DALi shader builtin | ||
| 34 | +attribute mediump vec2 aTexCoord;\n // DALi shader builtin | ||
| 35 | +uniform mediump mat4 uMvpMatrix;\n // DALi shader builtin | ||
| 36 | +uniform mediump vec3 uSize;\n // DALi shader builtin | ||
| 37 | +\n | ||
| 38 | +varying mediump vec2 vTexCoord;\n | ||
| 39 | +void main()\n | ||
| 40 | +{\n | ||
| 41 | + mediump vec4 vertexPosition = vec4(aPosition, 1.0);\n | ||
| 42 | + vertexPosition.xyz *= uSize;\n | ||
| 43 | + vTexCoord = aTexCoord;\n | ||
| 44 | + gl_Position = uMvpMatrix * vertexPosition;\n | ||
| 45 | +}\n | ||
| 46 | +); | ||
| 47 | + | ||
| 48 | +/* | ||
| 49 | + * Fragment shader for a textured cube | ||
| 50 | + */ | ||
| 51 | +const char* FRAGMENT_SHADER_CUBE = DALI_COMPOSE_SHADER( | ||
| 52 | +uniform sampler2D uTexture;\n | ||
| 53 | +\n | ||
| 54 | +varying mediump vec2 vTexCoord;\n | ||
| 55 | +void main()\n | ||
| 56 | +{\n | ||
| 57 | + mediump vec4 texColor = texture2D( uTexture, vTexCoord );\n | ||
| 58 | + gl_FragColor = texColor;\n | ||
| 59 | +}\n | ||
| 60 | +); | ||
| 61 | + | ||
| 62 | +/* | ||
| 63 | + * Vertex shader for a skybox | ||
| 64 | + */ | ||
| 65 | +const char* VERTEX_SHADER_SKYBOX = DALI_COMPOSE_SHADER( | ||
| 66 | +attribute mediump vec3 aPosition;\n // DALi shader builtin | ||
| 67 | +uniform mediump mat4 uMvpMatrix;\n // DALi shader builtin | ||
| 68 | +\n | ||
| 69 | +varying mediump vec3 vTexCoord;\n | ||
| 70 | +void main()\n | ||
| 71 | +{\n | ||
| 72 | + vTexCoord.x = aPosition.x;\n | ||
| 73 | + vTexCoord.y = -aPosition.y;\n // convert to GL coords | ||
| 74 | + vTexCoord.z = aPosition.z;\n | ||
| 75 | + | ||
| 76 | + mediump vec4 vertexPosition = vec4(aPosition, 1.0);\n | ||
| 77 | + vec4 clipSpacePosition = uMvpMatrix * vertexPosition;\n | ||
| 78 | + gl_Position = clipSpacePosition.xyww;\n // Writes 1.0, the maximum depth value, into the depth buffer. | ||
| 79 | + // This is an optimization to avoid running the fragment shader | ||
| 80 | + // for the pixels hidden by the scene's objects. | ||
| 81 | +}\n | ||
| 82 | +); | ||
| 83 | + | ||
| 84 | +/* | ||
| 85 | + * Fragment shader for a skybox | ||
| 86 | + */ | ||
| 87 | +const char* FRAGMENT_SHADER_SKYBOX = DALI_COMPOSE_SHADER( | ||
| 88 | +uniform samplerCube uSkyBoxTexture;\n | ||
| 89 | +\n | ||
| 90 | +varying mediump vec3 vTexCoord;\n | ||
| 91 | +void main()\n | ||
| 92 | +{\n | ||
| 93 | + mediump vec4 texColor = textureCube( uSkyBoxTexture, vTexCoord );\n | ||
| 94 | + gl_FragColor = texColor;\n | ||
| 95 | +}\n | ||
| 96 | +); | ||
| 97 | + | ||
| 98 | +const float CAMERA_DEFAULT_FOV( 60.0f ); | ||
| 99 | +const float CAMERA_DEFAULT_NEAR( 0.1f ); | ||
| 100 | +const float CAMERA_DEFAULT_FAR( 1000.0f ); | ||
| 101 | +const Vector3 CAMERA_DEFAULT_POSITION( 0.0f, 0.0f, 100.0f ); | ||
| 102 | + | ||
| 103 | +const char* TEXTURE_URL = DEMO_IMAGE_DIR "wood.png"; | ||
| 104 | + | ||
| 105 | +const unsigned int SKYBOX_FACE_COUNT = 6; | ||
| 106 | +const unsigned int SKYBOX_FACE_WIDTH = 2048; | ||
| 107 | +const unsigned int SKYBOX_FACE_HEIGHT = 2048; | ||
| 108 | + | ||
| 109 | +/* | ||
| 110 | + * Credit to Joey do Vries for the following cubemap images | ||
| 111 | + * Take from git://github.com/JoeyDeVries/LearnOpenGL.git | ||
| 112 | + * The images are licensed under the terms of the CC BY 4.0 license: | ||
| 113 | + * https://creativecommons.org/licenses/by/4.0/ | ||
| 114 | + */ | ||
| 115 | +const char* SKYBOX_FACES[ SKYBOX_FACE_COUNT ] = | ||
| 116 | +{ | ||
| 117 | + DEMO_IMAGE_DIR "lake_right.jpg", | ||
| 118 | + DEMO_IMAGE_DIR "lake_left.jpg", | ||
| 119 | + DEMO_IMAGE_DIR "lake_top.jpg", | ||
| 120 | + DEMO_IMAGE_DIR "lake_bottom.jpg", | ||
| 121 | + DEMO_IMAGE_DIR "lake_back.jpg", | ||
| 122 | + DEMO_IMAGE_DIR "lake_front.jpg" | ||
| 123 | +}; | ||
| 124 | + | ||
| 125 | +} | ||
| 126 | + | ||
| 127 | +// This example shows how to create a skybox | ||
| 128 | +// | ||
| 129 | +// Recommended screen size on desktop: 1280x720 | ||
| 130 | +// | ||
| 131 | +class TexturedCubeController : public ConnectionTracker | ||
| 132 | +{ | ||
| 133 | +public: | ||
| 134 | + | ||
| 135 | + TexturedCubeController( Application& application ) | ||
| 136 | + : mApplication( application ) | ||
| 137 | + { | ||
| 138 | + // Connect to the Application's Init signal | ||
| 139 | + mApplication.InitSignal().Connect( this, &TexturedCubeController::Create ); | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + ~TexturedCubeController() | ||
| 143 | + { | ||
| 144 | + // Nothing to do here; | ||
| 145 | + } | ||
| 146 | + | ||
| 147 | + // The Init signal is received once (only) during the Application lifetime | ||
| 148 | + void Create( Application& application ) | ||
| 149 | + { | ||
| 150 | + // Disable indicator. | ||
| 151 | + // It avoids reposition the camera to fit with the indicator height. | ||
| 152 | + Dali::Window winHandle = application.GetWindow(); | ||
| 153 | + winHandle.ShowIndicator( Dali::Window::INVISIBLE ); | ||
| 154 | + | ||
| 155 | + // Get a handle to the stage | ||
| 156 | + Stage stage = Stage::GetCurrent(); | ||
| 157 | + stage.SetBackgroundColor( Color::WHITE ); | ||
| 158 | + | ||
| 159 | + // Step 1. Setup camera | ||
| 160 | + SetupCamera(); | ||
| 161 | + | ||
| 162 | + // Step 2. Create shaders | ||
| 163 | + CreateShaders(); | ||
| 164 | + | ||
| 165 | + // Step 3. Create geometry | ||
| 166 | + CreateCubeGeometry(); | ||
| 167 | + CreateSkyboxGeometry(); | ||
| 168 | + | ||
| 169 | + // Step 4. Display first a cube at the world origin. | ||
| 170 | + // The write on the depth buffer is enabled. | ||
| 171 | + DisplayCube(); | ||
| 172 | + | ||
| 173 | + // Step 5. Display last the skybox surrounding the camera. | ||
| 174 | + // The depth test is enabled, the shader sets 1.0, which is the maximum depth and | ||
| 175 | + // the depth function is set to LESS or EQUAL so the fragment shader will run only | ||
| 176 | + // in those pixels that any other object has written on them. | ||
| 177 | + DisplaySkybox(); | ||
| 178 | + | ||
| 179 | + // Step 6. Play animation to rotate the cube | ||
| 180 | + PlayAnimation(); | ||
| 181 | + | ||
| 182 | + // Respond to key events | ||
| 183 | + stage.KeyEventSignal().Connect( this, &TexturedCubeController::OnKeyEvent ); | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + /** | ||
| 187 | + * @brief Called when any key event is received | ||
| 188 | + * | ||
| 189 | + * Will use this to quit the application if Back or the Escape key is received | ||
| 190 | + * @param[in] event The key event information | ||
| 191 | + */ | ||
| 192 | + void OnKeyEvent( const KeyEvent& event ) | ||
| 193 | + { | ||
| 194 | + if( event.state == KeyEvent::Down ) | ||
| 195 | + { | ||
| 196 | + if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) ) | ||
| 197 | + { | ||
| 198 | + mApplication.Quit(); | ||
| 199 | + } | ||
| 200 | + } | ||
| 201 | + } | ||
| 202 | + | ||
| 203 | + /** | ||
| 204 | + * @brief Setup a perspective camera pointing in the negative Z direction | ||
| 205 | + */ | ||
| 206 | + void SetupCamera() | ||
| 207 | + { | ||
| 208 | + Stage stage = Stage::GetCurrent(); | ||
| 209 | + | ||
| 210 | + RenderTask renderTask = stage.GetRenderTaskList().GetTask( 0 ); | ||
| 211 | + renderTask.SetCullMode( false ); // avoid frustum culling affecting the skybox | ||
| 212 | + | ||
| 213 | + mCamera.Initialise( CAMERA_DEFAULT_POSITION, CAMERA_DEFAULT_FOV, CAMERA_DEFAULT_NEAR, CAMERA_DEFAULT_FAR ); | ||
| 214 | + } | ||
| 215 | + | ||
| 216 | + /** | ||
| 217 | + * Creates a shader using inlined variable VERTEX_SHADER and FRAGMENT_SHADER | ||
| 218 | + * | ||
| 219 | + * Shaders are very basic and all they do is transforming vertices and sampling | ||
| 220 | + * a texture. | ||
| 221 | + */ | ||
| 222 | + void CreateShaders() | ||
| 223 | + { | ||
| 224 | + mShaderCube = Shader::New( VERTEX_SHADER_CUBE, FRAGMENT_SHADER_CUBE ); | ||
| 225 | + mShaderSkybox = Shader::New( VERTEX_SHADER_SKYBOX, FRAGMENT_SHADER_SKYBOX ); | ||
| 226 | + } | ||
| 227 | + | ||
| 228 | + /** | ||
| 229 | + * @brief CreateCubeGeometry | ||
| 230 | + * This function creates a cube geometry including texture coordinates. | ||
| 231 | + * Also it demonstrates using the indexed draw feature by setting an index array. | ||
| 232 | + */ | ||
| 233 | + void CreateCubeGeometry() | ||
| 234 | + { | ||
| 235 | + struct Vertex | ||
| 236 | + { | ||
| 237 | + Vector3 aPosition; | ||
| 238 | + Vector2 aTexCoord; | ||
| 239 | + }; | ||
| 240 | + | ||
| 241 | + Vertex vertices[] = { | ||
| 242 | + { Vector3( 1.0f,-1.0f,-1.0f ), Vector2( 1.0, 1.0 ) }, | ||
| 243 | + { Vector3( -1.0f, 1.0f,-1.0f ), Vector2( 0.0, 0.0 ) }, | ||
| 244 | + { Vector3( 1.0f, 1.0f,-1.0f ), Vector2( 0.0, 1.0 ) }, | ||
| 245 | + { Vector3( -1.0f, 1.0f, 1.0f ), Vector2( 1.0, 1.0 ) }, | ||
| 246 | + { Vector3( 1.0f,-1.0f, 1.0f ), Vector2( 0.0, 0.0 ) }, | ||
| 247 | + { Vector3( 1.0f, 1.0f, 1.0f ), Vector2( 0.0, 1.0 ) }, | ||
| 248 | + { Vector3( 1.0f, 1.0f, 1.0f ), Vector2( 1.0, 1.0 ) }, | ||
| 249 | + { Vector3( 1.0f,-1.0f,-1.0f ), Vector2( 0.0, 0.0 ) }, | ||
| 250 | + { Vector3( 1.0f, 1.0f,-1.0f ), Vector2( 0.0, 1.0 ) }, | ||
| 251 | + { Vector3( 1.0f,-1.0f, 1.0f ), Vector2( 1.0, 1.0 ) }, | ||
| 252 | + { Vector3( -1.0f,-1.0f,-1.0f ), Vector2( 0.0, 0.0 ) }, | ||
| 253 | + { Vector3( 1.0f,-1.0f,-1.0f ), Vector2( 0.0, 1.0 ) }, | ||
| 254 | + { Vector3( -1.0f,-1.0f,-1.0f ), Vector2( 1.0, 1.0 ) }, | ||
| 255 | + { Vector3( -1.0f, 1.0f, 1.0f ), Vector2( 0.0, 0.0 ) }, | ||
| 256 | + { Vector3( -1.0f, 1.0f,-1.0f ), Vector2( 0.0, 1.0 ) }, | ||
| 257 | + { Vector3( 1.0f, 1.0f,-1.0f ), Vector2( 1.0, 1.0 ) }, | ||
| 258 | + { Vector3( -1.0f, 1.0f, 1.0f ), Vector2( 0.0, 0.0 ) }, | ||
| 259 | + { Vector3( 1.0f, 1.0f, 1.0f ), Vector2( 0.0, 1.0 ) }, | ||
| 260 | + { Vector3( 1.0f,-1.0f,-1.0f ), Vector2( 1.0, 1.0 ) }, | ||
| 261 | + { Vector3( -1.0f,-1.0f,-1.0f ), Vector2( 1.0, 0.0 ) }, | ||
| 262 | + { Vector3( -1.0f, 1.0f,-1.0f ), Vector2( 0.0, 0.0 ) }, | ||
| 263 | + { Vector3( -1.0f, 1.0f, 1.0f ), Vector2( 1.0, 1.0 ) }, | ||
| 264 | + { Vector3( -1.0f,-1.0f, 1.0f ), Vector2( 1.0, 0.0 ) }, | ||
| 265 | + { Vector3( 1.0f,-1.0f, 1.0f ), Vector2( 0.0, 0.0 ) }, | ||
| 266 | + { Vector3( 1.0f, 1.0f, 1.0f ), Vector2( 1.0, 1.0 ) }, | ||
| 267 | + { Vector3( 1.0f,-1.0f, 1.0f ), Vector2( 1.0, 0.0 ) }, | ||
| 268 | + { Vector3( 1.0f,-1.0f,-1.0f ), Vector2( 0.0, 0.0 ) }, | ||
| 269 | + { Vector3( 1.0f,-1.0f, 1.0f ), Vector2( 1.0, 1.0 ) }, | ||
| 270 | + { Vector3( -1.0f,-1.0f, 1.0f ), Vector2( 1.0, 0.0 ) }, | ||
| 271 | + { Vector3( -1.0f,-1.0f,-1.0f ), Vector2( 0.0, 0.0 ) }, | ||
| 272 | + { Vector3( -1.0f,-1.0f,-1.0f ), Vector2( 1.0, 1.0 ) }, | ||
| 273 | + { Vector3( -1.0f,-1.0f, 1.0f ), Vector2( 1.0, 0.0 ) }, | ||
| 274 | + { Vector3( -1.0f, 1.0f, 1.0f ), Vector2( 0.0, 0.0 ) }, | ||
| 275 | + { Vector3( 1.0f, 1.0f,-1.0f ), Vector2( 1.0, 1.0 ) }, | ||
| 276 | + { Vector3( -1.0f, 1.0f,-1.0f ), Vector2( 1.0, 0.0 ) }, | ||
| 277 | + { Vector3( -1.0f, 1.0f, 1.0f ), Vector2( 0.0, 0.0 ) }, | ||
| 278 | + }; | ||
| 279 | + | ||
| 280 | + PropertyBuffer vertexBuffer = PropertyBuffer::New( Property::Map() | ||
| 281 | + .Add( "aPosition", Property::VECTOR3 ) | ||
| 282 | + .Add( "aTexCoord", Property::VECTOR2 ) ); | ||
| 283 | + vertexBuffer.SetData( vertices, sizeof(vertices) / sizeof(Vertex) ); | ||
| 284 | + | ||
| 285 | + // create indices | ||
| 286 | + const unsigned short INDEX_CUBE[] = { | ||
| 287 | + 2, 1, 0, | ||
| 288 | + 5, 4, 3, | ||
| 289 | + 8, 7, 6, | ||
| 290 | + 11, 10, 9, | ||
| 291 | + 14, 13, 12, | ||
| 292 | + 17, 16, 15, | ||
| 293 | + 20, 19, 18, | ||
| 294 | + 23, 22, 21, | ||
| 295 | + 26, 25, 24, | ||
| 296 | + 29, 28, 27, | ||
| 297 | + 32, 31, 30, | ||
| 298 | + 35, 34, 33 | ||
| 299 | + }; | ||
| 300 | + | ||
| 301 | + mGeometry = Geometry::New(); | ||
| 302 | + mGeometry.AddVertexBuffer( vertexBuffer ); | ||
| 303 | + mGeometry.SetIndexBuffer( INDEX_CUBE, | ||
| 304 | + sizeof(INDEX_CUBE)/sizeof(INDEX_CUBE[0]) ); | ||
| 305 | + mGeometry.SetType( Geometry::TRIANGLES ); | ||
| 306 | + } | ||
| 307 | + | ||
| 308 | + /** | ||
| 309 | + * @brief CreateCubeGeometry | ||
| 310 | + * This function creates a cube geometry including texture coordinates. | ||
| 311 | + * Also it demonstrates using the indexed draw feature by setting an index array. | ||
| 312 | + */ | ||
| 313 | + void CreateSkyboxGeometry() | ||
| 314 | + { | ||
| 315 | + struct Vertex | ||
| 316 | + { | ||
| 317 | + Vector3 aPosition; | ||
| 318 | + }; | ||
| 319 | + | ||
| 320 | + Vertex skyboxVertices[] = { | ||
| 321 | + // back | ||
| 322 | + { Vector3( -1.0f, 1.0f, -1.0f ) }, | ||
| 323 | + { Vector3( -1.0f, -1.0f, -1.0f ) }, | ||
| 324 | + { Vector3( 1.0f, -1.0f, -1.0f ) }, | ||
| 325 | + { Vector3( 1.0f, -1.0f, -1.0f ) }, | ||
| 326 | + { Vector3( 1.0f, 1.0f, -1.0f ) }, | ||
| 327 | + { Vector3( -1.0f, 1.0f, -1.0f ) }, | ||
| 328 | + | ||
| 329 | + // left | ||
| 330 | + { Vector3( -1.0f, -1.0f, 1.0f ) }, | ||
| 331 | + { Vector3( -1.0f, -1.0f, -1.0f ) }, | ||
| 332 | + { Vector3( -1.0f, 1.0f, -1.0f ) }, | ||
| 333 | + { Vector3( -1.0f, 1.0f, -1.0f ) }, | ||
| 334 | + { Vector3( -1.0f, 1.0f, 1.0f ) }, | ||
| 335 | + { Vector3( -1.0f, -1.0f, 1.0f ) }, | ||
| 336 | + | ||
| 337 | + // right | ||
| 338 | + { Vector3( 1.0f, -1.0f, -1.0f ) }, | ||
| 339 | + { Vector3( 1.0f, -1.0f, 1.0f ) }, | ||
| 340 | + { Vector3( 1.0f, 1.0f, 1.0f ) }, | ||
| 341 | + { Vector3( 1.0f, 1.0f, 1.0f ) }, | ||
| 342 | + { Vector3( 1.0f, 1.0f, -1.0f ) }, | ||
| 343 | + { Vector3( 1.0f, -1.0f, -1.0f ) }, | ||
| 344 | + | ||
| 345 | + // front | ||
| 346 | + { Vector3( -1.0f, -1.0f, 1.0f ) }, | ||
| 347 | + { Vector3( -1.0f, 1.0f, 1.0f ) }, | ||
| 348 | + { Vector3( 1.0f, 1.0f, 1.0f ) }, | ||
| 349 | + { Vector3( 1.0f, 1.0f, 1.0f ) }, | ||
| 350 | + { Vector3( 1.0f, -1.0f, 1.0f ) }, | ||
| 351 | + { Vector3( -1.0f, -1.0f, 1.0f ) }, | ||
| 352 | + | ||
| 353 | + // botton | ||
| 354 | + { Vector3( -1.0f, 1.0f, -1.0f ) }, | ||
| 355 | + { Vector3( 1.0f, 1.0f, -1.0f ) }, | ||
| 356 | + { Vector3( 1.0f, 1.0f, 1.0f ) }, | ||
| 357 | + { Vector3( 1.0f, 1.0f, 1.0f ) }, | ||
| 358 | + { Vector3( -1.0f, 1.0f, 1.0f ) }, | ||
| 359 | + { Vector3( -1.0f, 1.0f, -1.0f ) }, | ||
| 360 | + | ||
| 361 | + // top | ||
| 362 | + { Vector3( -1.0f, -1.0f, -1.0f ) }, | ||
| 363 | + { Vector3( -1.0f, -1.0f, 1.0f ) }, | ||
| 364 | + { Vector3( 1.0f, -1.0f, -1.0f ) }, | ||
| 365 | + { Vector3( 1.0f, -1.0f, -1.0f ) }, | ||
| 366 | + { Vector3( -1.0f, -1.0f, 1.0f ) }, | ||
| 367 | + { Vector3( 1.0f, -1.0f, 1.0f ) } | ||
| 368 | + }; | ||
| 369 | + | ||
| 370 | + PropertyBuffer vertexBuffer = PropertyBuffer::New( Property::Map() | ||
| 371 | + .Add( "aPosition", Property::VECTOR3 ) ); | ||
| 372 | + vertexBuffer.SetData( skyboxVertices, sizeof(skyboxVertices) / sizeof(Vertex) ); | ||
| 373 | + | ||
| 374 | + mSkyboxGeometry = Geometry::New(); | ||
| 375 | + mSkyboxGeometry.AddVertexBuffer( vertexBuffer ); | ||
| 376 | + mSkyboxGeometry.SetType( Geometry::TRIANGLES ); | ||
| 377 | + } | ||
| 378 | + | ||
| 379 | + /** | ||
| 380 | + * Display a cube at the world origin | ||
| 381 | + */ | ||
| 382 | + void DisplayCube() | ||
| 383 | + { | ||
| 384 | + // Load image from file | ||
| 385 | + PixelData pixels = SyncImageLoader::Load( TEXTURE_URL ); | ||
| 386 | + | ||
| 387 | + Texture texture = Texture::New( TextureType::TEXTURE_2D, pixels.GetPixelFormat(), pixels.GetWidth(), pixels.GetHeight() ); | ||
| 388 | + texture.Upload( pixels, 0, 0, 0, 0, pixels.GetWidth(), pixels.GetHeight() ); | ||
| 389 | + | ||
| 390 | + // create TextureSet | ||
| 391 | + mTextureSet = TextureSet::New(); | ||
| 392 | + mTextureSet.SetTexture( 0, texture ); | ||
| 393 | + | ||
| 394 | + mRenderer = Renderer::New( mGeometry, mShaderCube ); | ||
| 395 | + mRenderer.SetTextures( mTextureSet ); | ||
| 396 | + mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 1.0f ); | ||
| 397 | + | ||
| 398 | + // A further optimization would be to enable debug testing instead | ||
| 399 | + mRenderer.SetProperty( Renderer::Property::FACE_CULLING_MODE, FaceCullingMode::BACK ); | ||
| 400 | + | ||
| 401 | + // Enables the write on the depth buffer. | ||
| 402 | + mRenderer.SetProperty( Renderer::Property::DEPTH_WRITE_MODE, DepthWriteMode::ON ); | ||
| 403 | + | ||
| 404 | + mActor = Actor::New(); | ||
| 405 | + mActor.SetName( "Cube" ); | ||
| 406 | + mActor.SetAnchorPoint( AnchorPoint::CENTER ); | ||
| 407 | + mActor.SetParentOrigin( ParentOrigin::CENTER ); | ||
| 408 | + mActor.AddRenderer( mRenderer ); | ||
| 409 | + | ||
| 410 | + mActor.SetSize( 10.f, 10.f, 10.f ); | ||
| 411 | + | ||
| 412 | + Stage stage = Stage::GetCurrent(); | ||
| 413 | + stage.Add( mActor ); | ||
| 414 | + } | ||
| 415 | + | ||
| 416 | + /** | ||
| 417 | + * Display a skybox surrounding the camera | ||
| 418 | + */ | ||
| 419 | + void DisplaySkybox() | ||
| 420 | + { | ||
| 421 | + // Load skybox faces from file | ||
| 422 | + Texture texture = Texture::New( TextureType::TEXTURE_CUBE, Pixel::RGBA8888, SKYBOX_FACE_WIDTH, SKYBOX_FACE_HEIGHT ); | ||
| 423 | + for (unsigned int i = 0; i < SKYBOX_FACE_COUNT; i++) | ||
| 424 | + { | ||
| 425 | + PixelData pixels = SyncImageLoader::Load( SKYBOX_FACES[i] ); | ||
| 426 | + texture.Upload( pixels, CubeMapLayer::POSITIVE_X + i, 0, 0, 0, SKYBOX_FACE_WIDTH, SKYBOX_FACE_HEIGHT ); | ||
| 427 | + } | ||
| 428 | + | ||
| 429 | + // create TextureSet | ||
| 430 | + mSkyboxTextures = TextureSet::New(); | ||
| 431 | + mSkyboxTextures.SetTexture( 0, texture ); | ||
| 432 | + | ||
| 433 | + mSkyboxRenderer = Renderer::New( mSkyboxGeometry, mShaderSkybox ); | ||
| 434 | + mSkyboxRenderer.SetTextures( mSkyboxTextures ); | ||
| 435 | + mSkyboxRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 2.0f ); | ||
| 436 | + | ||
| 437 | + // Enables the depth test. | ||
| 438 | + mSkyboxRenderer.SetProperty( Renderer::Property::DEPTH_TEST_MODE, DepthTestMode::ON ); | ||
| 439 | + | ||
| 440 | + // The fragment shader will run only is those pixels that have the max depth value. | ||
| 441 | + mSkyboxRenderer.SetProperty( Renderer::Property::DEPTH_FUNCTION, DepthFunction::LESS_EQUAL ); | ||
| 442 | + | ||
| 443 | + Stage stage = Stage::GetCurrent(); | ||
| 444 | + | ||
| 445 | + mSkyboxActor = Actor::New(); | ||
| 446 | + mSkyboxActor.SetName( "SkyBox" ); | ||
| 447 | + mSkyboxActor.SetAnchorPoint( AnchorPoint::CENTER ); | ||
| 448 | + mSkyboxActor.SetParentOrigin( ParentOrigin::CENTER ); | ||
| 449 | + mSkyboxActor.SetPosition( CAMERA_DEFAULT_POSITION ); | ||
| 450 | + mSkyboxActor.AddRenderer( mSkyboxRenderer ); | ||
| 451 | + stage.Add( mSkyboxActor ); | ||
| 452 | + } | ||
| 453 | + | ||
| 454 | + /** | ||
| 455 | + * Plays animation | ||
| 456 | + */ | ||
| 457 | + void PlayAnimation() | ||
| 458 | + { | ||
| 459 | + mAnimation = Animation::New( 5.0f ); | ||
| 460 | + mAnimation.SetLooping( true ); | ||
| 461 | + mAnimation.AnimateBy( Property( mActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( 360 )), Vector3::ZAXIS ) ); | ||
| 462 | + mAnimation.AnimateBy( Property( mActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( 360 )), Vector3::YAXIS ) ); | ||
| 463 | + mAnimation.AnimateBy( Property( mActor, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( 360 )), Vector3::XAXIS ) ); | ||
| 464 | + mAnimation.Play(); | ||
| 465 | + } | ||
| 466 | + | ||
| 467 | +private: | ||
| 468 | + Application& mApplication; | ||
| 469 | + | ||
| 470 | + LookCamera mCamera; | ||
| 471 | + | ||
| 472 | + Shader mShaderCube; | ||
| 473 | + Shader mShaderSkybox; | ||
| 474 | + | ||
| 475 | + Geometry mGeometry; | ||
| 476 | + TextureSet mTextureSet; | ||
| 477 | + Renderer mRenderer; | ||
| 478 | + Actor mActor; | ||
| 479 | + Animation mAnimation; | ||
| 480 | + | ||
| 481 | + Geometry mSkyboxGeometry; | ||
| 482 | + TextureSet mSkyboxTextures; | ||
| 483 | + Renderer mSkyboxRenderer; | ||
| 484 | + Actor mSkyboxActor; | ||
| 485 | +}; | ||
| 486 | + | ||
| 487 | +void RunTest( Application& application ) | ||
| 488 | +{ | ||
| 489 | + TexturedCubeController test( application ); | ||
| 490 | + | ||
| 491 | + application.MainLoop(); | ||
| 492 | +} | ||
| 493 | + | ||
| 494 | +// Entry point for Linux & Tizen applications | ||
| 495 | +// | ||
| 496 | +int DALI_EXPORT_API main( int argc, char **argv ) | ||
| 497 | +{ | ||
| 498 | + Application application = Application::New( &argc, &argv ); | ||
| 499 | + | ||
| 500 | + RunTest( application ); | ||
| 501 | + | ||
| 502 | + return 0; | ||
| 503 | +} |
examples/simple-visuals-control/my-control-impl.cpp
| @@ -26,6 +26,7 @@ | @@ -26,6 +26,7 @@ | ||
| 26 | #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h> | 26 | #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h> |
| 27 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> | 27 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> |
| 28 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> | 28 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> |
| 29 | +#include <dali-toolkit/devel-api/controls/control-devel.h> | ||
| 29 | 30 | ||
| 30 | using namespace Dali; | 31 | using namespace Dali; |
| 31 | using namespace Dali::Toolkit; | 32 | using namespace Dali::Toolkit; |
| @@ -102,7 +103,7 @@ void MyControl::SetProperty( BaseObject* object, Property::Index index, const Pr | @@ -102,7 +103,7 @@ void MyControl::SetProperty( BaseObject* object, Property::Index index, const Pr | ||
| 102 | 103 | ||
| 103 | if ( iconVisual ) | 104 | if ( iconVisual ) |
| 104 | { | 105 | { |
| 105 | - impl.RegisterVisual( index, iconVisual ); | 106 | + DevelControl::RegisterVisual( impl, index, iconVisual ); |
| 106 | } | 107 | } |
| 107 | break; | 108 | break; |
| 108 | } | 109 | } |
| @@ -123,7 +124,8 @@ Property::Value MyControl::GetProperty( BaseObject* object, Property::Index prop | @@ -123,7 +124,8 @@ Property::Value MyControl::GetProperty( BaseObject* object, Property::Index prop | ||
| 123 | case Demo::MyControl::Property::ICON_VISUAL: | 124 | case Demo::MyControl::Property::ICON_VISUAL: |
| 124 | { | 125 | { |
| 125 | Property::Map map; | 126 | Property::Map map; |
| 126 | - Toolkit::Visual::Base visual = GetImpl( myControl ).GetVisual( propertyIndex ); | 127 | + MyControl& impl = GetImpl( myControl ); |
| 128 | + Toolkit::Visual::Base visual = DevelControl::GetVisual( impl, propertyIndex ); | ||
| 127 | if ( visual ) | 129 | if ( visual ) |
| 128 | { | 130 | { |
| 129 | visual.CreatePropertyMap( map ); // Creates a Property map containing the Visual that ICON_VISUAL currently is. Can change if state changes. | 131 | visual.CreatePropertyMap( map ); // Creates a Property map containing the Visual that ICON_VISUAL currently is. Can change if state changes. |
examples/styling/image-channel-control-impl.cpp
| @@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||
| 18 | #include <dali-toolkit/dali-toolkit.h> | 18 | #include <dali-toolkit/dali-toolkit.h> |
| 19 | #include <dali/public-api/object/type-registry-helper.h> | 19 | #include <dali/public-api/object/type-registry-helper.h> |
| 20 | #include <dali-toolkit/devel-api/align-enums.h> | 20 | #include <dali-toolkit/devel-api/align-enums.h> |
| 21 | +#include <dali-toolkit/devel-api/controls/control-devel.h> | ||
| 21 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> | 22 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> |
| 22 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> | 23 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> |
| 23 | 24 | ||
| @@ -104,7 +105,7 @@ void ImageChannelControl::SetImage( const std::string& url ) | @@ -104,7 +105,7 @@ void ImageChannelControl::SetImage( const std::string& url ) | ||
| 104 | properties[Dali::Toolkit::ImageVisual::Property::URL] = url; | 105 | properties[Dali::Toolkit::ImageVisual::Property::URL] = url; |
| 105 | 106 | ||
| 106 | mVisual = Toolkit::VisualFactory::Get().CreateVisual( properties ); | 107 | mVisual = Toolkit::VisualFactory::Get().CreateVisual( properties ); |
| 107 | - RegisterVisual( Demo::ImageChannelControl::Property::IMAGE_VISUAL, mVisual ); | 108 | + Toolkit::DevelControl::RegisterVisual( *this, Demo::ImageChannelControl::Property::IMAGE_VISUAL, mVisual ); |
| 108 | mVisual.SetName("imageVisual"); | 109 | mVisual.SetName("imageVisual"); |
| 109 | 110 | ||
| 110 | RelayoutRequest(); | 111 | RelayoutRequest(); |
| @@ -127,14 +128,14 @@ void ImageChannelControl::SetVisibility( bool visibility ) | @@ -127,14 +128,14 @@ void ImageChannelControl::SetVisibility( bool visibility ) | ||
| 127 | { | 128 | { |
| 128 | if( mDisableVisibilityTransition.Count() > 0 ) | 129 | if( mDisableVisibilityTransition.Count() > 0 ) |
| 129 | { | 130 | { |
| 130 | - mAnimation = CreateTransition( mDisableVisibilityTransition ); | 131 | + mAnimation = Toolkit::DevelControl::CreateTransition( *this, mDisableVisibilityTransition ); |
| 131 | } | 132 | } |
| 132 | } | 133 | } |
| 133 | else | 134 | else |
| 134 | { | 135 | { |
| 135 | if( mEnableVisibilityTransition.Count() > 0 ) | 136 | if( mEnableVisibilityTransition.Count() > 0 ) |
| 136 | { | 137 | { |
| 137 | - mAnimation = CreateTransition( mEnableVisibilityTransition ); | 138 | + mAnimation = Toolkit::DevelControl::CreateTransition( *this, mEnableVisibilityTransition ); |
| 138 | } | 139 | } |
| 139 | } | 140 | } |
| 140 | } | 141 | } |
| @@ -236,7 +237,7 @@ void ImageChannelControl::SetProperty( BaseObject* object, Property::Index index | @@ -236,7 +237,7 @@ void ImageChannelControl::SetProperty( BaseObject* object, Property::Index index | ||
| 236 | if( map ) | 237 | if( map ) |
| 237 | { | 238 | { |
| 238 | impl.mVisual = Toolkit::VisualFactory::Get().CreateVisual( *map ); | 239 | impl.mVisual = Toolkit::VisualFactory::Get().CreateVisual( *map ); |
| 239 | - impl.RegisterVisual( Demo::ImageChannelControl::Property::IMAGE_VISUAL, impl.mVisual ); | 240 | + Toolkit::DevelControl::RegisterVisual( impl, Demo::ImageChannelControl::Property::IMAGE_VISUAL, impl.mVisual ); |
| 240 | } | 241 | } |
| 241 | break; | 242 | break; |
| 242 | } | 243 | } |
examples/text-field/text-field-example.cpp
| @@ -43,8 +43,6 @@ namespace | @@ -43,8 +43,6 @@ namespace | ||
| 43 | 43 | ||
| 44 | const float BORDER_WIDTH = 4.0f; | 44 | const float BORDER_WIDTH = 4.0f; |
| 45 | 45 | ||
| 46 | - const Vector3 POPUP_SIZE_FACTOR_TO_PARENT = Vector3( 0.8, 0.25, 0.0 ); | ||
| 47 | - | ||
| 48 | } // unnamed namespace | 46 | } // unnamed namespace |
| 49 | 47 | ||
| 50 | /** | 48 | /** |
| @@ -133,8 +131,8 @@ public: | @@ -133,8 +131,8 @@ public: | ||
| 133 | Popup popup = Popup::New(); | 131 | Popup popup = Popup::New(); |
| 134 | popup.SetParentOrigin( ParentOrigin::CENTER ); | 132 | popup.SetParentOrigin( ParentOrigin::CENTER ); |
| 135 | popup.SetAnchorPoint( AnchorPoint::CENTER ); | 133 | popup.SetAnchorPoint( AnchorPoint::CENTER ); |
| 136 | - popup.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS ); | ||
| 137 | - popup.SetSizeModeFactor( POPUP_SIZE_FACTOR_TO_PARENT ); | 134 | + popup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::WIDTH ); |
| 135 | + popup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT ); | ||
| 138 | popup.TouchSignal().Connect( this, &TextFieldExample::OnPopupTouched ); | 136 | popup.TouchSignal().Connect( this, &TextFieldExample::OnPopupTouched ); |
| 139 | 137 | ||
| 140 | return popup; | 138 | return popup; |
examples/transitions/shadow-button-impl.cpp
| @@ -21,6 +21,7 @@ | @@ -21,6 +21,7 @@ | ||
| 21 | #include <dali-toolkit/devel-api/align-enums.h> | 21 | #include <dali-toolkit/devel-api/align-enums.h> |
| 22 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> | 22 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> |
| 23 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> | 23 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> |
| 24 | +#include <dali-toolkit/devel-api/controls/control-devel.h> | ||
| 24 | 25 | ||
| 25 | #include <cstdio> | 26 | #include <cstdio> |
| 26 | 27 | ||
| @@ -124,7 +125,7 @@ bool ShadowButton::GetActiveState() | @@ -124,7 +125,7 @@ bool ShadowButton::GetActiveState() | ||
| 124 | void ShadowButton::SetCheckState( bool checkState ) | 125 | void ShadowButton::SetCheckState( bool checkState ) |
| 125 | { | 126 | { |
| 126 | mCheckState = checkState; | 127 | mCheckState = checkState; |
| 127 | - EnableVisual( Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, true ); | 128 | + DevelControl::EnableVisual( *this, Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, true ); |
| 128 | if( Self().OnStage() ) | 129 | if( Self().OnStage() ) |
| 129 | { | 130 | { |
| 130 | if( checkState ) | 131 | if( checkState ) |
| @@ -157,7 +158,7 @@ void ShadowButton::StartTransition( Property::Index transitionId ) | @@ -157,7 +158,7 @@ void ShadowButton::StartTransition( Property::Index transitionId ) | ||
| 157 | iter->mAnimation.FinishedSignal().Disconnect( this, &ShadowButton::OnTransitionFinished ); | 158 | iter->mAnimation.FinishedSignal().Disconnect( this, &ShadowButton::OnTransitionFinished ); |
| 158 | } | 159 | } |
| 159 | 160 | ||
| 160 | - iter->mAnimation = CreateTransition( iter->mTransitionData ); | 161 | + iter->mAnimation = DevelControl::CreateTransition( *this, iter->mTransitionData ); |
| 161 | StoreTargetLayouts( iter->mTransitionData ); | 162 | StoreTargetLayouts( iter->mTransitionData ); |
| 162 | 163 | ||
| 163 | iter->mAnimation.FinishedSignal().Connect( this, &ShadowButton::OnTransitionFinished ); | 164 | iter->mAnimation.FinishedSignal().Connect( this, &ShadowButton::OnTransitionFinished ); |
| @@ -189,7 +190,7 @@ void ShadowButton::OnTransitionFinished( Animation& src ) | @@ -189,7 +190,7 @@ void ShadowButton::OnTransitionFinished( Animation& src ) | ||
| 189 | } | 190 | } |
| 190 | case Demo::ShadowButton::Property::UNCHECK_TRANSITION: | 191 | case Demo::ShadowButton::Property::UNCHECK_TRANSITION: |
| 191 | { | 192 | { |
| 192 | - EnableVisual( Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, false ); | 193 | + DevelControl::EnableVisual( *this, Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, false ); |
| 193 | break; | 194 | break; |
| 194 | } | 195 | } |
| 195 | } | 196 | } |
| @@ -352,25 +353,25 @@ void ShadowButton::ResetVisual( | @@ -352,25 +353,25 @@ void ShadowButton::ResetVisual( | ||
| 352 | { | 353 | { |
| 353 | case Demo::ShadowButton::Property::BACKGROUND_VISUAL: | 354 | case Demo::ShadowButton::Property::BACKGROUND_VISUAL: |
| 354 | { | 355 | { |
| 355 | - RegisterVisual( index, visual ); | 356 | + DevelControl::RegisterVisual( *this, index, visual ); |
| 356 | visual.SetDepthIndex(0.0f); | 357 | visual.SetDepthIndex(0.0f); |
| 357 | break; | 358 | break; |
| 358 | } | 359 | } |
| 359 | case Demo::ShadowButton::Property::CHECKBOX_BG_VISUAL: | 360 | case Demo::ShadowButton::Property::CHECKBOX_BG_VISUAL: |
| 360 | { | 361 | { |
| 361 | - RegisterVisual( index, visual ); | 362 | + DevelControl::RegisterVisual( *this, index, visual ); |
| 362 | visual.SetDepthIndex(1.0f); | 363 | visual.SetDepthIndex(1.0f); |
| 363 | break; | 364 | break; |
| 364 | } | 365 | } |
| 365 | case Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL: | 366 | case Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL: |
| 366 | { | 367 | { |
| 367 | - RegisterVisual( index, visual, mCheckState ); | 368 | + DevelControl::RegisterVisual( *this, index, visual, mCheckState ); |
| 368 | visual.SetDepthIndex(2.0f); | 369 | visual.SetDepthIndex(2.0f); |
| 369 | break; | 370 | break; |
| 370 | } | 371 | } |
| 371 | case Demo::ShadowButton::Property::LABEL_VISUAL: | 372 | case Demo::ShadowButton::Property::LABEL_VISUAL: |
| 372 | { | 373 | { |
| 373 | - RegisterVisual( index, visual ); | 374 | + DevelControl::RegisterVisual( *this, index, visual ); |
| 374 | visual.SetDepthIndex(1.0f); | 375 | visual.SetDepthIndex(1.0f); |
| 375 | break; | 376 | break; |
| 376 | } | 377 | } |
| @@ -496,7 +497,7 @@ void ShadowButton::SetProperty( BaseObject* object, Property::Index index, const | @@ -496,7 +497,7 @@ void ShadowButton::SetProperty( BaseObject* object, Property::Index index, const | ||
| 496 | case Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL: | 497 | case Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL: |
| 497 | { | 498 | { |
| 498 | impl.ResetVisual( index, impl.mCheckboxFgVisual, value ); | 499 | impl.ResetVisual( index, impl.mCheckboxFgVisual, value ); |
| 499 | - impl.EnableVisual( Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, impl.mCheckState ); | 500 | + DevelControl::EnableVisual( impl, Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, impl.mCheckState ); |
| 500 | break; | 501 | break; |
| 501 | } | 502 | } |
| 502 | case Demo::ShadowButton::Property::LABEL_VISUAL: | 503 | case Demo::ShadowButton::Property::LABEL_VISUAL: |
examples/visual-transitions/beat-control-impl.cpp
| 1 | /* | 1 | /* |
| 2 | - * Copyright (c) 2016 Samsung Electronics Co., Ltd. | 2 | + * Copyright (c) 2017 Samsung Electronics Co., Ltd. |
| 3 | * | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. | 5 | * you may not use this file except in compliance with the License. |
| @@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||
| 18 | #include <dali-toolkit/dali-toolkit.h> | 18 | #include <dali-toolkit/dali-toolkit.h> |
| 19 | #include <dali/public-api/object/type-registry-helper.h> | 19 | #include <dali/public-api/object/type-registry-helper.h> |
| 20 | #include <dali-toolkit/devel-api/align-enums.h> | 20 | #include <dali-toolkit/devel-api/align-enums.h> |
| 21 | +#include <dali-toolkit/devel-api/controls/control-devel.h> | ||
| 21 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> | 22 | #include <dali-toolkit/devel-api/visual-factory/visual-factory.h> |
| 22 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> | 23 | #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h> |
| 23 | 24 | ||
| @@ -102,7 +103,7 @@ void BeatControl::StartBounceAnimation() | @@ -102,7 +103,7 @@ void BeatControl::StartBounceAnimation() | ||
| 102 | OnBounceAnimationFinished(mAnimation); | 103 | OnBounceAnimationFinished(mAnimation); |
| 103 | } | 104 | } |
| 104 | 105 | ||
| 105 | - mAnimation = CreateTransition( mBounceTransition ); | 106 | + mAnimation = DevelControl::CreateTransition( *this, mBounceTransition ); |
| 106 | mAnimation.FinishedSignal().Connect( this, &BeatControl::OnBounceAnimationFinished ); | 107 | mAnimation.FinishedSignal().Connect( this, &BeatControl::OnBounceAnimationFinished ); |
| 107 | mAnimation.Play(); | 108 | mAnimation.Play(); |
| 108 | mAnimationPlaying |= BOUNCE_ANIMATION_RUNNING; | 109 | mAnimationPlaying |= BOUNCE_ANIMATION_RUNNING; |
| @@ -118,7 +119,7 @@ void BeatControl::StartXAnimation() | @@ -118,7 +119,7 @@ void BeatControl::StartXAnimation() | ||
| 118 | OnXAnimationFinished(mXAnimation); | 119 | OnXAnimationFinished(mXAnimation); |
| 119 | } | 120 | } |
| 120 | 121 | ||
| 121 | - mXAnimation = CreateTransition( mLeftTransition ); | 122 | + mXAnimation = DevelControl::CreateTransition( *this, mLeftTransition ); |
| 122 | mXAnimation.FinishedSignal().Connect( this, &BeatControl::OnXAnimationFinished ); | 123 | mXAnimation.FinishedSignal().Connect( this, &BeatControl::OnXAnimationFinished ); |
| 123 | mXAnimation.Play(); | 124 | mXAnimation.Play(); |
| 124 | mAnimationPlaying |= X_ANIMATION_RUNNING; | 125 | mAnimationPlaying |= X_ANIMATION_RUNNING; |
| @@ -133,7 +134,7 @@ void BeatControl::StartYAnimation() | @@ -133,7 +134,7 @@ void BeatControl::StartYAnimation() | ||
| 133 | OnYAnimationFinished(mYAnimation); | 134 | OnYAnimationFinished(mYAnimation); |
| 134 | } | 135 | } |
| 135 | 136 | ||
| 136 | - mYAnimation = CreateTransition( mUpTransition ); | 137 | + mYAnimation = DevelControl::CreateTransition( *this, mUpTransition ); |
| 137 | mYAnimation.FinishedSignal().Connect( this, &BeatControl::OnYAnimationFinished ); | 138 | mYAnimation.FinishedSignal().Connect( this, &BeatControl::OnYAnimationFinished ); |
| 138 | mYAnimation.Play(); | 139 | mYAnimation.Play(); |
| 139 | mAnimationPlaying |= Y_ANIMATION_RUNNING; | 140 | mAnimationPlaying |= Y_ANIMATION_RUNNING; |
| @@ -148,7 +149,7 @@ void BeatControl::StartFadeAnimation() | @@ -148,7 +149,7 @@ void BeatControl::StartFadeAnimation() | ||
| 148 | OnFadeAnimationFinished(mFadeAnimation); | 149 | OnFadeAnimationFinished(mFadeAnimation); |
| 149 | } | 150 | } |
| 150 | 151 | ||
| 151 | - mFadeAnimation = CreateTransition( mFadeTransition ); | 152 | + mFadeAnimation = DevelControl::CreateTransition( *this, mFadeTransition ); |
| 152 | mFadeAnimation.FinishedSignal().Connect( this, &BeatControl::OnFadeAnimationFinished ); | 153 | mFadeAnimation.FinishedSignal().Connect( this, &BeatControl::OnFadeAnimationFinished ); |
| 153 | mFadeAnimation.Play(); | 154 | mFadeAnimation.Play(); |
| 154 | mAnimationPlaying |= FADE_ANIMATION_RUNNING; | 155 | mAnimationPlaying |= FADE_ANIMATION_RUNNING; |
| @@ -276,7 +277,7 @@ void BeatControl::SetProperty( BaseObject* object, Property::Index index, const | @@ -276,7 +277,7 @@ void BeatControl::SetProperty( BaseObject* object, Property::Index index, const | ||
| 276 | { | 277 | { |
| 277 | // Only register a visual if there is more than just a size setting | 278 | // Only register a visual if there is more than just a size setting |
| 278 | impl.mVisual = Toolkit::VisualFactory::Get().CreateVisual( *map ); | 279 | impl.mVisual = Toolkit::VisualFactory::Get().CreateVisual( *map ); |
| 279 | - impl.RegisterVisual( Demo::BeatControl::Property::BEAT_VISUAL, impl.mVisual ); | 280 | + DevelControl::RegisterVisual( impl, Demo::BeatControl::Property::BEAT_VISUAL, impl.mVisual ); |
| 280 | 281 | ||
| 281 | // We have registered a new visual: must trigger size negotiation | 282 | // We have registered a new visual: must trigger size negotiation |
| 282 | // in order to call SetTransformAndSize on the visual with the right size: | 283 | // in order to call SetTransformAndSize on the visual with the right size: |
packaging/com.samsung.dali-demo.spec
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | 2 | ||
| 3 | Name: com.samsung.dali-demo | 3 | Name: com.samsung.dali-demo |
| 4 | Summary: The OpenGLES Canvas Core Demo | 4 | Summary: The OpenGLES Canvas Core Demo |
| 5 | -Version: 1.2.41 | 5 | +Version: 1.2.42 |
| 6 | Release: 1 | 6 | Release: 1 |
| 7 | Group: System/Libraries | 7 | Group: System/Libraries |
| 8 | License: Apache-2.0 | 8 | License: Apache-2.0 |
resources/images/lake_back.jpg
0 → 100644
462 KB
resources/images/lake_bottom.jpg
0 → 100644
274 KB
resources/images/lake_front.jpg
0 → 100644
723 KB
resources/images/lake_left.jpg
0 → 100644
588 KB
resources/images/lake_right.jpg
0 → 100644
525 KB
resources/images/lake_top.jpg
0 → 100644
338 KB
resources/po/as.po
| @@ -168,3 +168,6 @@ msgstr "রশ্মীয় অগ্রগতি অঙ্কন" | @@ -168,3 +168,6 @@ msgstr "রশ্মীয় অগ্রগতি অঙ্কন" | ||
| 168 | 168 | ||
| 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" | 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" |
| 170 | msgstr "রে মার্চিং" | 170 | msgstr "রে মার্চিং" |
| 171 | + | ||
| 172 | +msgid "DALI_DEMO_STR_TITLE_SKYBOX" | ||
| 173 | +msgstr "Skybox" |
resources/po/de.po
| @@ -168,3 +168,6 @@ msgstr "Radialer Fortschritt zeichnen" | @@ -168,3 +168,6 @@ msgstr "Radialer Fortschritt zeichnen" | ||
| 168 | 168 | ||
| 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" | 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" |
| 170 | msgstr "Ray marschieren" | 170 | msgstr "Ray marschieren" |
| 171 | + | ||
| 172 | +msgid "DALI_DEMO_STR_TITLE_SKYBOX" | ||
| 173 | +msgstr "Skybox" |
resources/po/en_GB.po
| @@ -180,3 +180,6 @@ msgstr "Draw radial progress" | @@ -180,3 +180,6 @@ msgstr "Draw radial progress" | ||
| 180 | 180 | ||
| 181 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" | 181 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" |
| 182 | msgstr "Ray Marching" | 182 | msgstr "Ray Marching" |
| 183 | + | ||
| 184 | +msgid "DALI_DEMO_STR_TITLE_SKYBOX" | ||
| 185 | +msgstr "Skybox" |
resources/po/en_US.po
| @@ -180,3 +180,6 @@ msgstr "Draw radial progress" | @@ -180,3 +180,6 @@ msgstr "Draw radial progress" | ||
| 180 | 180 | ||
| 181 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" | 181 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" |
| 182 | msgstr "Ray Marching" | 182 | msgstr "Ray Marching" |
| 183 | + | ||
| 184 | +msgid "DALI_DEMO_STR_TITLE_SKYBOX" | ||
| 185 | +msgstr "Skybox" |
resources/po/es.po
| @@ -168,3 +168,6 @@ msgstr "Dibujo progreso radial" | @@ -168,3 +168,6 @@ msgstr "Dibujo progreso radial" | ||
| 168 | 168 | ||
| 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" | 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" |
| 170 | msgstr "trazado de rayos" | 170 | msgstr "trazado de rayos" |
| 171 | + | ||
| 172 | +msgid "DALI_DEMO_STR_TITLE_SKYBOX" | ||
| 173 | +msgstr "Skybox" |
resources/po/fi.po
| @@ -168,3 +168,6 @@ msgstr "Piirustus radial edistyminen" | @@ -168,3 +168,6 @@ msgstr "Piirustus radial edistyminen" | ||
| 168 | 168 | ||
| 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" | 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" |
| 170 | msgstr "Ray marssi" | 170 | msgstr "Ray marssi" |
| 171 | + | ||
| 172 | +msgid "DALI_DEMO_STR_TITLE_SKYBOX" | ||
| 173 | +msgstr "Skybox" |
resources/po/ko.po
| @@ -168,3 +168,6 @@ msgstr "방사형 진행 상황 그리기" | @@ -168,3 +168,6 @@ msgstr "방사형 진행 상황 그리기" | ||
| 168 | 168 | ||
| 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" | 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" |
| 170 | msgstr "레이 마칭" | 170 | msgstr "레이 마칭" |
| 171 | + | ||
| 172 | +msgid "DALI_DEMO_STR_TITLE_SKYBOX" | ||
| 173 | +msgstr "Skybox" |
resources/po/ml.po
| @@ -168,3 +168,6 @@ msgstr "റേഡിയൽ à´ªàµà´°àµ‡à´¾à´—തി à´¡àµà´°àµ‡à´¾à´¯à´¿à´‚à´—à | @@ -168,3 +168,6 @@ msgstr "റേഡിയൽ à´ªàµà´°àµ‡à´¾à´—തി à´¡àµà´°àµ‡à´¾à´¯à´¿à´‚à´—à | ||
| 168 | 168 | ||
| 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" | 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" |
| 170 | msgstr "ലൈറàµà´±àµ മാർചàµà´šà´¿à´‚à´—àµ" | 170 | msgstr "ലൈറàµà´±àµ മാർചàµà´šà´¿à´‚à´—àµ" |
| 171 | + | ||
| 172 | +msgid "DALI_DEMO_STR_TITLE_SKYBOX" | ||
| 173 | +msgstr "Skybox" |
resources/po/ur.po
| @@ -168,3 +168,6 @@ msgstr "ریڈیل پیش رفت ڈرائنگ" | @@ -168,3 +168,6 @@ msgstr "ریڈیل پیش رفت ڈرائنگ" | ||
| 168 | 168 | ||
| 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" | 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" |
| 170 | msgstr "رے چلتے" | 170 | msgstr "رے چلتے" |
| 171 | + | ||
| 172 | +msgid "DALI_DEMO_STR_TITLE_SKYBOX" | ||
| 173 | +msgstr "Skybox" |
resources/po/zn_CH.po
| @@ -168,3 +168,6 @@ msgstr "绘制径向进度" | @@ -168,3 +168,6 @@ msgstr "绘制径向进度" | ||
| 168 | 168 | ||
| 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" | 169 | msgid "DALI_DEMO_STR_TITLE_RENDERING_RAY_MARCHING" |
| 170 | msgstr "射线行军" | 170 | msgstr "射线行军" |
| 171 | + | ||
| 172 | +msgid "DALI_DEMO_STR_TITLE_SKYBOX" | ||
| 173 | +msgstr "Skybox" |
shared/dali-demo-strings.h
| @@ -81,6 +81,7 @@ extern "C" | @@ -81,6 +81,7 @@ extern "C" | ||
| 81 | #define DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SIMPLE_VISUALS") | 81 | #define DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SIMPLE_VISUALS") |
| 82 | #define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI") | 82 | #define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI") |
| 83 | #define DALI_DEMO_STR_TITLE_SCROLL_VIEW dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCROLL_VIEW") | 83 | #define DALI_DEMO_STR_TITLE_SCROLL_VIEW dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SCROLL_VIEW") |
| 84 | +#define DALI_DEMO_STR_TITLE_SKYBOX dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SKYBOX") | ||
| 84 | #define DALI_DEMO_STR_TITLE_SPARKLE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SPARKLE") | 85 | #define DALI_DEMO_STR_TITLE_SPARKLE dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_SPARKLE") |
| 85 | #define DALI_DEMO_STR_TITLE_STYLING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_STYLING") | 86 | #define DALI_DEMO_STR_TITLE_STYLING dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_STYLING") |
| 86 | #define DALI_DEMO_STR_TITLE_TEXTURED_MESH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_TEXTURED_MESH") | 87 | #define DALI_DEMO_STR_TITLE_TEXTURED_MESH dgettext(DALI_DEMO_DOMAIN_LOCAL, "DALI_DEMO_STR_TITLE_TEXTURED_MESH") |
| @@ -144,6 +145,7 @@ extern "C" | @@ -144,6 +145,7 @@ extern "C" | ||
| 144 | #define DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL "Simple Visuals Control" | 145 | #define DALI_DEMO_STR_TITLE_SIMPLE_VISUALS_CONTROL "Simple Visuals Control" |
| 145 | #define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI "Script Based UI" | 146 | #define DALI_DEMO_STR_TITLE_SCRIPT_BASED_UI "Script Based UI" |
| 146 | #define DALI_DEMO_STR_TITLE_SCROLL_VIEW "Scroll View" | 147 | #define DALI_DEMO_STR_TITLE_SCROLL_VIEW "Scroll View" |
| 148 | +#define DALI_DEMO_STR_TITLE_SKYBOX "Skybox" | ||
| 147 | #define DALI_DEMO_STR_TITLE_SPARKLE "Sparkle" | 149 | #define DALI_DEMO_STR_TITLE_SPARKLE "Sparkle" |
| 148 | #define DALI_DEMO_STR_TITLE_STYLING "Styling" | 150 | #define DALI_DEMO_STR_TITLE_STYLING "Styling" |
| 149 | #define DALI_DEMO_STR_TITLE_TEXTURED_MESH "Mesh Texture" | 151 | #define DALI_DEMO_STR_TITLE_TEXTURED_MESH "Mesh Texture" |