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::SurfaceResized( unsigned int width, unsigned int height, int orientation )
89 mImpl->SurfaceResized(width, height, orientation);
92 void Core::SetTopMargin( unsigned int margin )
94 mImpl->SetTopMargin(margin);
97 void Core::SetDpi(unsigned int dpiHorizontal, unsigned int dpiVertical)
99 mImpl->SetDpi(dpiHorizontal, dpiVertical);
102 void Core::SceneCreated()
104 mImpl->SceneCreated();
107 void Core::QueueEvent(const Event& event)
109 mImpl->QueueEvent(event);
112 void Core::ProcessEvents()
114 mImpl->ProcessEvents();
117 unsigned int Core::GetMaximumUpdateCount() const
119 return mImpl->GetMaximumUpdateCount();
122 void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo )
124 mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo );
127 void Core::Render( RenderStatus& status )
129 mImpl->Render( status );
132 SystemOverlay& Core::GetSystemOverlay()
134 return mImpl->GetSystemOverlay();
137 void Core::SetViewMode( ViewMode viewMode )
139 mImpl->SetViewMode( viewMode );
142 ViewMode Core::GetViewMode() const
144 return mImpl->GetViewMode();
147 void Core::SetStereoBase( float stereoBase )
149 mImpl->SetStereoBase( stereoBase );
152 float Core::GetStereoBase() const
154 return mImpl->GetStereoBase();
162 } // namespace Integration