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 RenderToFrameBuffer renderToFboEnabled,
40 DepthBufferAvailable depthBufferAvailable,
41 StencilBufferAvailable stencilBufferAvailable )
43 Core* instance = new Core;
44 instance->mImpl = new Internal::Core( renderController,
52 stencilBufferAvailable );
62 ContextNotifierInterface* Core::GetContextNotifier()
64 return mImpl->GetContextNotifier();
67 void Core::ContextCreated()
69 mImpl->ContextCreated();
72 void Core::ContextDestroyed()
74 mImpl->ContextDestroyed();
77 void Core::RecoverFromContextLoss()
79 mImpl->RecoverFromContextLoss();
82 void Core::SurfaceResized(unsigned int width, unsigned int height)
84 mImpl->SurfaceResized(width, height);
87 void Core::SetTopMargin( unsigned int margin )
89 mImpl->SetTopMargin(margin);
92 void Core::SetDpi(unsigned int dpiHorizontal, unsigned int dpiVertical)
94 mImpl->SetDpi(dpiHorizontal, dpiVertical);
97 void Core::SceneCreated()
99 mImpl->SceneCreated();
102 void Core::QueueEvent(const Event& event)
104 mImpl->QueueEvent(event);
107 void Core::ProcessEvents()
109 mImpl->ProcessEvents();
112 unsigned int Core::GetMaximumUpdateCount() const
114 return mImpl->GetMaximumUpdateCount();
117 void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo )
119 mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo );
122 void Core::Render( RenderStatus& status, bool forceClear )
124 mImpl->Render( status, forceClear );
127 SystemOverlay& Core::GetSystemOverlay()
129 return mImpl->GetSystemOverlay();
132 void Core::SetViewMode( ViewMode viewMode )
134 mImpl->SetViewMode( viewMode );
137 ViewMode Core::GetViewMode() const
139 return mImpl->GetViewMode();
142 void Core::SetStereoBase( float stereoBase )
144 mImpl->SetStereoBase( stereoBase );
147 float Core::GetStereoBase() const
149 return mImpl->GetStereoBase();
152 void Core::RegisterProcessor( Processor& processor )
154 mImpl->RegisterProcessor( processor );
157 void Core::UnregisterProcessor( Processor& processor )
159 mImpl->UnregisterProcessor( processor );
167 } // namespace Integration