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>
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, PlatformAbstraction& platformAbstraction,
34 GlAbstraction& glAbstraction, GlSyncAbstraction& glSyncAbstraction, GestureManager& gestureManager, ResourcePolicy::DataRetention policy )
36 Core* instance = new Core;
37 instance->mImpl = new Internal::Core( renderController, platformAbstraction, glAbstraction, glSyncAbstraction, gestureManager, policy );
47 ContextNotifierInterface* Core::GetContextNotifier()
49 return mImpl->GetContextNotifier();
52 void Core::ContextCreated()
54 mImpl->ContextCreated();
57 void Core::ContextDestroyed()
59 mImpl->ContextDestroyed();
62 void Core::RecoverFromContextLoss()
64 mImpl->RecoverFromContextLoss();
67 void Core::SurfaceResized(unsigned int width, unsigned int height)
69 mImpl->SurfaceResized(width, height);
72 void Core::SetTopMargin( unsigned int margin )
74 mImpl->SetTopMargin(margin);
77 void Core::SetDpi(unsigned int dpiHorizontal, unsigned int dpiVertical)
79 mImpl->SetDpi(dpiHorizontal, dpiVertical);
92 void Core::SceneCreated()
94 mImpl->SceneCreated();
97 void Core::QueueEvent(const Event& event)
99 mImpl->QueueEvent(event);
102 void Core::ProcessEvents()
104 mImpl->ProcessEvents();
107 unsigned int Core::GetMaximumUpdateCount() const
109 return mImpl->GetMaximumUpdateCount();
112 void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, UpdateStatus& status )
114 mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status );
117 void Core::Render( RenderStatus& status )
119 mImpl->Render( status );
122 SystemOverlay& Core::GetSystemOverlay()
124 return mImpl->GetSystemOverlay();
127 void Core::SetViewMode( ViewMode viewMode )
129 mImpl->SetViewMode( viewMode );
132 ViewMode Core::GetViewMode() const
134 return mImpl->GetViewMode();
137 void Core::SetStereoBase( float stereoBase )
139 mImpl->SetStereoBase( stereoBase );
142 float Core::GetStereoBase() const
144 return mImpl->GetStereoBase();
152 } // namespace Integration