2 * Copyright (c) 2017 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>
22 #include <dali/public-api/common/dali-common.h>
23 #include <dali/integration-api/events/event.h>
24 #include <dali/integration-api/gl-sync-abstraction.h>
25 #include <dali/internal/common/core-impl.h>
33 Core* Core::New( RenderController& renderController,
34 PlatformAbstraction& platformAbstraction,
35 GlAbstraction& glAbstraction,
36 GlSyncAbstraction& glSyncAbstraction,
37 GestureManager& gestureManager,
38 ResourcePolicy::DataRetention policy,
39 bool renderToFboEnabled )
41 Core* instance = new Core;
42 instance->mImpl = new Internal::Core( renderController,
58 ContextNotifierInterface* Core::GetContextNotifier()
60 return mImpl->GetContextNotifier();
63 void Core::ContextCreated()
65 mImpl->ContextCreated();
68 void Core::ContextDestroyed()
70 mImpl->ContextDestroyed();
73 void Core::RecoverFromContextLoss()
75 mImpl->RecoverFromContextLoss();
78 void Core::SurfaceResized(unsigned int width, unsigned int height)
80 mImpl->SurfaceResized(width, height);
83 void Core::SetTopMargin( unsigned int margin )
85 mImpl->SetTopMargin(margin);
88 void Core::SetDpi(unsigned int dpiHorizontal, unsigned int dpiVertical)
90 mImpl->SetDpi(dpiHorizontal, dpiVertical);
93 void Core::SceneCreated()
95 mImpl->SceneCreated();
98 void Core::QueueEvent(const Event& event)
100 mImpl->QueueEvent(event);
103 void Core::ProcessEvents()
105 mImpl->ProcessEvents();
108 unsigned int Core::GetMaximumUpdateCount() const
110 return mImpl->GetMaximumUpdateCount();
113 void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo )
115 mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo );
118 void Core::Render( RenderStatus& status )
120 mImpl->Render( status );
123 SystemOverlay& Core::GetSystemOverlay()
125 return mImpl->GetSystemOverlay();
128 void Core::SetViewMode( ViewMode viewMode )
130 mImpl->SetViewMode( viewMode );
133 ViewMode Core::GetViewMode() const
135 return mImpl->GetViewMode();
138 void Core::SetStereoBase( float stereoBase )
140 mImpl->SetStereoBase( stereoBase );
143 float Core::GetStereoBase() const
145 return mImpl->GetStereoBase();
153 } // namespace Integration