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/gl-context-helper-abstraction.h>
29 #include <dali/integration-api/processor-interface.h>
30 #include <dali/internal/common/core-impl.h>
38 Core* Core::New( RenderController& renderController,
39 PlatformAbstraction& platformAbstraction,
40 GlAbstraction& glAbstraction,
41 GlSyncAbstraction& glSyncAbstraction,
42 GlContextHelperAbstraction& glContextHelperAbstraction,
43 ResourcePolicy::DataRetention policy,
44 RenderToFrameBuffer renderToFboEnabled,
45 DepthBufferAvailable depthBufferAvailable,
46 StencilBufferAvailable stencilBufferAvailable )
48 Core* instance = new Core;
49 instance->mImpl = new Internal::Core( renderController,
53 glContextHelperAbstraction,
57 stencilBufferAvailable );
67 void Core::Initialize()
72 ContextNotifierInterface* Core::GetContextNotifier()
74 return mImpl->GetContextNotifier();
77 void Core::ContextCreated()
79 mImpl->ContextCreated();
82 void Core::ContextDestroyed()
84 mImpl->ContextDestroyed();
87 void Core::RecoverFromContextLoss()
89 mImpl->RecoverFromContextLoss();
92 void Core::SurfaceDeleted( Integration::RenderSurface* surface )
94 mImpl->SurfaceDeleted(surface);
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 uint32_t Core::GetMaximumUpdateCount() const
114 return mImpl->GetMaximumUpdateCount();
117 void Core::Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo )
119 mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo );
122 void Core::Render( RenderStatus& status, bool forceClear, bool uploadOnly )
124 mImpl->Render( status, forceClear, uploadOnly );
127 void Core::RegisterProcessor( Processor& processor )
129 mImpl->RegisterProcessor( processor );
132 void Core::UnregisterProcessor( Processor& processor )
134 mImpl->UnregisterProcessor( processor );
142 } // namespace Integration