1 #ifndef DALI_INTERNAL_SCENE_GRAPH_BUFFERS_H
2 #define DALI_INTERNAL_SCENE_GRAPH_BUFFERS_H
5 * Copyright (c) 2019 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/internal/common/buffer-index.h>
34 * Node values (position etc.) are double-buffered. A SceneGraphBuffers object
35 * can be used to keep track of which buffers are being written or read.
37 class SceneGraphBuffers
41 static BufferIndex INITIAL_EVENT_BUFFER_INDEX; // 0
42 static BufferIndex INITIAL_UPDATE_BUFFER_INDEX; // 1
45 * Create a SceneGraphBuffers object.
50 * Non-virtual destructor; not intended as a base class.
55 * Retrieve the current event-buffer index.
56 * @return The buffer index.
58 BufferIndex GetEventBufferIndex() const { return mEventBufferIndex; }
61 * Retrieve the current update-buffer index.
62 * @return The buffer index.
64 BufferIndex GetUpdateBufferIndex() const { return mUpdateBufferIndex; }
67 * Swap the Event & Update buffer indices.
74 SceneGraphBuffers(const SceneGraphBuffers&);
77 SceneGraphBuffers& operator=(const SceneGraphBuffers& rhs);
81 BufferIndex mEventBufferIndex; ///< 0 or 1 (opposite of mUpdateBufferIndex)
82 BufferIndex mUpdateBufferIndex; ///< 0 or 1 (opposite of mEventBufferIndex)
85 } // namespace SceneGraph
87 } // namespace Internal
91 #endif // DALI_INTERNAL_SCENE_GRAPH_BUFFERS_H