2 * Copyright (c) 2014 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>
26 #include <dali/public-api/common/dali-common.h>
27 #include <dali/integration-api/events/event.h>
28 #include <dali/integration-api/gl-sync-abstraction.h>
29 #include <dali/internal/common/core-impl.h>
37 Core* Core::New(RenderController& renderController, PlatformAbstraction& platformAbstraction,
38 GlAbstraction& glAbstraction, GlSyncAbstraction& glSyncAbstraction, GestureManager& gestureManager, ResourcePolicy::DataRetention policy )
40 Core* instance = new Core;
41 instance->mImpl = new Internal::Core( renderController, platformAbstraction, glAbstraction, glSyncAbstraction, gestureManager, policy );
51 ContextNotifierInterface* Core::GetContextNotifier()
53 return mImpl->GetContextNotifier();
56 // @todo Rename to ResetGlContext
57 void Core::ContextCreated()
59 mImpl->ContextCreated();
62 // @todo Replace with StopRendering that prevents RenderManager from rendering
63 // until we get ResetGLContext again, change ContextCreated to reset gpu buffer cache,
65 void Core::ContextDestroyed()
67 mImpl->ContextDestroyed();
70 void Core::RecoverFromContextLoss()
72 mImpl->RecoverFromContextLoss();
75 void Core::SurfaceResized(unsigned int width, unsigned int height)
77 mImpl->SurfaceResized(width, height);
80 void Core::SetDpi(unsigned int dpiHorizontal, unsigned int dpiVertical)
82 mImpl->SetDpi(dpiHorizontal, dpiVertical);
95 void Core::QueueEvent(const Event& event)
97 mImpl->QueueEvent(event);
100 void Core::ProcessEvents()
102 mImpl->ProcessEvents();
105 void Core::UpdateTouchData(const TouchData& touch)
107 mImpl->UpdateTouchData(touch);
110 unsigned int Core::GetMaximumUpdateCount() const
112 return mImpl->GetMaximumUpdateCount();
115 void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, UpdateStatus& status )
117 mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status );
120 void Core::Render( RenderStatus& status )
122 mImpl->Render( status );
125 SystemOverlay& Core::GetSystemOverlay()
127 return mImpl->GetSystemOverlay();
130 void Core::SetViewMode( ViewMode viewMode )
132 mImpl->SetViewMode( viewMode );
135 ViewMode Core::GetViewMode() const
137 return mImpl->GetViewMode();
140 void Core::SetStereoBase( float stereoBase )
142 mImpl->SetStereoBase( stereoBase );
145 float Core::GetStereoBase() const
147 return mImpl->GetStereoBase();
155 } // namespace Integration