1 #ifndef DALI_FRAME_CALLBACK_INTERFACE_H
2 #define DALI_FRAME_CALLBACK_INTERFACE_H
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/common/dali-common.h>
30 * @brief This interface should be implemented if a callback is required on every frame.
32 * The Update() method is called from the update-thread after the scene has been updated, and is ready to render.
34 * As this method is called from the update-thread, no event thread APIs (e.g. Actor::Get...) can be called.
35 * This will invariably lead to crashes.
37 * Instead, setting and retrieving the values should be done by using the UpdateProxy class returned as a parameter to
38 * the Update() method.
40 * Actors can be identified using Actor IDs which can be retrieved using Actor::GetId() in the event-thread.
41 * However, calling Actor::GetId() will lead to problems if it is called from the update-thread.
42 * Instead, the Actor IDs should be stored by the implementation of this class or passed via a thread-safe manner from
45 class DALI_CORE_API FrameCallbackInterface
50 * @brief Called from the update-thread after the scene has been updated, and is ready to render.
51 * @param[in] updateProxy Use this to get/set required values for the Actor.
52 * @param[in] elapsedSeconds Time elapsed time since the last frame (in seconds)
53 * @see FrameCallbackInterface
55 virtual void Update( UpdateProxy& updateProxy, float elapsedSeconds ) = 0;
60 * @brief Protected constructor.
62 FrameCallbackInterface() {}
65 * @brief Protected virtual destructor.
67 virtual ~FrameCallbackInterface() {}
72 #endif // DALI_FRAME_CALLBACK_INTERFACE_H