Commit 6cf19576d6907b26e9957517301a3b2accd5a741

Authored by Richard
Committed by Richard Huang
1 parent dd293d43

Updated FrameCallback to return value to specify whether we should keep rendering

Change-Id: I9bab06497d830d44188ae3f6e9a59ea1a21d3310
examples/frame-callback/frame-callback.cpp
1 1 /*
2   - * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  2 + * Copyright (c) 2023 Samsung Electronics Co., Ltd.
3 3 *
4 4 * Licensed under the Apache License, Version 2.0 (the "License");
5 5 * you may not use this file except in compliance with the License.
... ... @@ -37,7 +37,7 @@ void FrameCallback::AddId(uint32_t id)
37 37 mActorIdContainer.PushBack(id);
38 38 }
39 39  
40   -void FrameCallback::Update(Dali::UpdateProxy& updateProxy, float /* elapsedSeconds */)
  40 +bool FrameCallback::Update(Dali::UpdateProxy& updateProxy, float /* elapsedSeconds */)
41 41 {
42 42 // Go through Actor ID container and check if we've hit the sides.
43 43 for(auto&& i : mActorIdContainer)
... ... @@ -67,4 +67,7 @@ void FrameCallback::Update(Dali::UpdateProxy& updateProxy, float /* elapsedSecon
67 67 }
68 68 }
69 69 }
  70 +
  71 + // We don't need it to keep rendering.
  72 + return false;
70 73 }
... ...
examples/frame-callback/frame-callback.h
... ... @@ -2,7 +2,7 @@
2 2 #define DEMO_FRAME_CALLBACK_H
3 3  
4 4 /*
5   - * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  5 + * Copyright (c) 2023 Samsung Electronics Co., Ltd.
6 6 *
7 7 * Licensed under the Apache License, Version 2.0 (the "License");
8 8 * you may not use this file except in compliance with the License.
... ... @@ -54,8 +54,9 @@ private:
54 54 * @brief Called when every frame is updated.
55 55 * @param[in] updateProxy Used to set the world-matrix and sizes.
56 56 * @param[in] elapsedSeconds Time elapsed time since the last frame (in seconds)
  57 + * @return Whether we should keep rendering.
57 58 */
58   - virtual void Update(Dali::UpdateProxy& updateProxy, float elapsedSeconds);
  59 + virtual bool Update(Dali::UpdateProxy& updateProxy, float elapsedSeconds);
59 60  
60 61 private:
61 62 Dali::Vector<uint32_t> mActorIdContainer; ///< Container of Actor IDs.
... ...