2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali/integration-api/core.h>
26 #include <dali/public-api/common/dali-common.h>
27 #include <dali/integration-api/events/event.h>
28 #include <dali/integration-api/gl-sync-abstraction.h>
29 #include <dali/internal/common/core-impl.h>
37 namespace KeepUpdating
40 const unsigned int NOT_REQUESTED = 0x00; ///< Zero means that no further updates are required
43 const unsigned int STAGE_KEEP_RENDERING = 0x01; ///< Stage::KeepRendering() is being used
44 const unsigned int INCOMING_MESSAGES = 0x02; ///< Event-thread is sending messages to update-thread
45 const unsigned int ANIMATIONS_RUNNING = 0x04; ///< Animations are ongoing
46 const unsigned int DYNAMICS_CHANGED = 0x08; ///< A dynamics simulation is running
47 const unsigned int LOADING_RESOURCES = 0x10; ///< Resources are being loaded
48 const unsigned int NOTIFICATIONS_PENDING = 0x20; ///< Notifications are pending for the event-thread
49 const unsigned int MONITORING_PERFORMANCE = 0x40; ///< The --enable-performance-monitor option is being used
50 const unsigned int RENDER_TASK_SYNC = 0x80; ///< The refresh once render task is waiting for render sync
52 } // namespace KeepUpdating
54 Core* Core::New(RenderController& renderController, PlatformAbstraction& platformAbstraction,
55 GlAbstraction& glAbstraction, GlSyncAbstraction& glSyncAbstraction, GestureManager& gestureManager)
57 Core* instance = new Core;
58 instance->mImpl = new Internal::Core( renderController, platformAbstraction, glAbstraction, glSyncAbstraction, gestureManager );
68 void Core::ContextCreated()
70 mImpl->ContextCreated();
73 void Core::ContextToBeDestroyed()
75 mImpl->ContextToBeDestroyed();
78 void Core::SurfaceResized(unsigned int width, unsigned int height)
80 mImpl->SurfaceResized(width, height);
83 void Core::SetDpi(unsigned int dpiHorizontal, unsigned int dpiVertical)
85 mImpl->SetDpi(dpiHorizontal, dpiVertical);
88 void Core::SetMinimumFrameTimeInterval(unsigned int interval)
90 mImpl->SetMinimumFrameTimeInterval(interval);
103 void Core::QueueEvent(const Event& event)
105 mImpl->QueueEvent(event);
108 void Core::ProcessEvents()
110 mImpl->ProcessEvents();
113 void Core::UpdateTouchData(const TouchData& touch)
115 mImpl->UpdateTouchData(touch);
118 unsigned int Core::GetMaximumUpdateCount() const
120 return mImpl->GetMaximumUpdateCount();
123 void Core::Update( UpdateStatus& status )
125 mImpl->Update( status );
128 void Core::Render( RenderStatus& status )
130 mImpl->Render( status );
143 void Core::VSync( unsigned int frameNumber, unsigned int seconds, unsigned int microseconds )
145 mImpl->VSync( frameNumber, seconds, microseconds );
148 SystemOverlay& Core::GetSystemOverlay()
150 return mImpl->GetSystemOverlay();
153 void Core::SetViewMode( ViewMode viewMode )
155 mImpl->SetViewMode( viewMode );
158 ViewMode Core::GetViewMode() const
160 return mImpl->GetViewMode();
163 void Core::SetStereoBase( float stereoBase )
165 mImpl->SetStereoBase( stereoBase );
168 float Core::GetStereoBase() const
170 return mImpl->GetStereoBase();
178 } // namespace Integration