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>
20 #include <dali/integration-api/render-surface.h>
23 #include <dali/public-api/common/dali-common.h>
24 #include <dali/public-api/actors/layer.h>
25 #include <dali/public-api/render-tasks/render-task-list.h>
26 #include <dali/integration-api/events/event.h>
27 #include <dali/integration-api/gl-sync-abstraction.h>
28 #include <dali/integration-api/processor-interface.h>
29 #include <dali/internal/common/core-impl.h>
37 Core* Core::New( RenderController& renderController,
38 PlatformAbstraction& platformAbstraction,
39 GlAbstraction& glAbstraction,
40 GlSyncAbstraction& glSyncAbstraction,
41 ResourcePolicy::DataRetention policy,
42 RenderToFrameBuffer renderToFboEnabled,
43 DepthBufferAvailable depthBufferAvailable,
44 StencilBufferAvailable stencilBufferAvailable )
46 Core* instance = new Core;
47 instance->mImpl = new Internal::Core( renderController,
54 stencilBufferAvailable );
64 void Core::Initialize()
69 ContextNotifierInterface* Core::GetContextNotifier()
71 return mImpl->GetContextNotifier();
74 void Core::ContextCreated()
76 mImpl->ContextCreated();
79 void Core::ContextDestroyed()
81 mImpl->ContextDestroyed();
84 void Core::RecoverFromContextLoss()
86 mImpl->RecoverFromContextLoss();
89 void Core::SurfaceResized( Integration::RenderSurface* surface )
91 mImpl->SurfaceResized(surface);
94 void Core::SceneCreated()
96 mImpl->SceneCreated();
99 void Core::QueueEvent(const Event& event)
101 mImpl->QueueEvent(event);
104 void Core::ProcessEvents()
106 mImpl->ProcessEvents();
109 uint32_t Core::GetMaximumUpdateCount() const
111 return mImpl->GetMaximumUpdateCount();
114 void Core::Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo )
116 mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo );
119 void Core::Render( RenderStatus& status, bool forceClear )
121 mImpl->Render( status, forceClear );
124 void Core::RegisterProcessor( Processor& processor )
126 mImpl->RegisterProcessor( processor );
129 void Core::UnregisterProcessor( Processor& processor )
131 mImpl->UnregisterProcessor( processor );
139 } // namespace Integration