2 * Copyright (c) 2019 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/integration-api/processor-interface.h>
26 #include <dali/internal/common/core-impl.h>
34 Core* Core::New( RenderController& renderController,
35 PlatformAbstraction& platformAbstraction,
36 GlAbstraction& glAbstraction,
37 GlSyncAbstraction& glSyncAbstraction,
38 GestureManager& gestureManager,
39 ResourcePolicy::DataRetention policy,
40 RenderToFrameBuffer renderToFboEnabled,
41 DepthBufferAvailable depthBufferAvailable,
42 StencilBufferAvailable stencilBufferAvailable )
44 Core* instance = new Core;
45 instance->mImpl = new Internal::Core( renderController,
53 stencilBufferAvailable );
63 ContextNotifierInterface* Core::GetContextNotifier()
65 return mImpl->GetContextNotifier();
68 void Core::ContextCreated()
70 mImpl->ContextCreated();
73 void Core::ContextDestroyed()
75 mImpl->ContextDestroyed();
78 void Core::RecoverFromContextLoss()
80 mImpl->RecoverFromContextLoss();
83 void Core::SurfaceResized(uint32_t width, uint32_t height)
85 mImpl->SurfaceResized(width, height);
88 void Core::SetTopMargin( uint32_t margin )
90 mImpl->SetTopMargin(margin);
93 void Core::SetDpi( uint32_t dpiHorizontal, uint32_t dpiVertical)
95 mImpl->SetDpi(dpiHorizontal, dpiVertical);
98 void Core::SceneCreated()
100 mImpl->SceneCreated();
103 void Core::QueueEvent(const Event& event)
105 mImpl->QueueEvent(event);
108 void Core::ProcessEvents()
110 mImpl->ProcessEvents();
113 uint32_t Core::GetMaximumUpdateCount() const
115 return mImpl->GetMaximumUpdateCount();
118 void Core::Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo )
120 mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo );
123 void Core::Render( RenderStatus& status, bool forceClear )
125 mImpl->Render( status, forceClear );
128 SystemOverlay& Core::GetSystemOverlay()
130 return mImpl->GetSystemOverlay();
133 void Core::RegisterProcessor( Processor& processor )
135 mImpl->RegisterProcessor( processor );
138 void Core::UnregisterProcessor( Processor& processor )
140 mImpl->UnregisterProcessor( processor );
148 } // namespace Integration