[Tizen] Revert "Remove StereoMode"
[platform/core/uifw/dali-core.git] / dali / integration-api / core.cpp
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/integration-api/core.h>
20
21 // INTERNAL INCLUDES
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>
26
27 namespace Dali
28 {
29
30 namespace Integration
31 {
32
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 )
42 {
43   Core* instance = new Core;
44   instance->mImpl = new Internal::Core( renderController,
45                                         platformAbstraction,
46                                         glAbstraction,
47                                         glSyncAbstraction,
48                                         gestureManager,
49                                         policy,
50                                         renderToFboEnabled,
51                                         depthBufferAvailable,
52                                         stencilBufferAvailable );
53
54   return instance;
55 }
56
57 Core::~Core()
58 {
59   delete mImpl;
60 }
61
62 ContextNotifierInterface* Core::GetContextNotifier()
63 {
64   return mImpl->GetContextNotifier();
65 }
66
67 void Core::ContextCreated()
68 {
69   mImpl->ContextCreated();
70 }
71
72 void Core::ContextDestroyed()
73 {
74   mImpl->ContextDestroyed();
75 }
76
77 void Core::RecoverFromContextLoss()
78 {
79   mImpl->RecoverFromContextLoss();
80 }
81
82 void Core::SurfaceResized(uint32_t width, uint32_t height)
83 {
84   mImpl->SurfaceResized(width, height);
85 }
86
87 void Core::SetTopMargin( uint32_t margin )
88 {
89   mImpl->SetTopMargin(margin);
90 }
91
92 void Core::SetDpi( uint32_t dpiHorizontal, uint32_t dpiVertical)
93 {
94   mImpl->SetDpi(dpiHorizontal, dpiVertical);
95 }
96
97 void Core::SceneCreated()
98 {
99   mImpl->SceneCreated();
100 }
101
102 void Core::QueueEvent(const Event& event)
103 {
104   mImpl->QueueEvent(event);
105 }
106
107 void Core::ProcessEvents()
108 {
109   mImpl->ProcessEvents();
110 }
111
112 uint32_t Core::GetMaximumUpdateCount() const
113 {
114   return mImpl->GetMaximumUpdateCount();
115 }
116
117 void Core::Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo )
118 {
119   mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo );
120 }
121
122 void Core::Render( RenderStatus& status, bool forceClear )
123 {
124   mImpl->Render( status, forceClear );
125 }
126
127 SystemOverlay& Core::GetSystemOverlay()
128 {
129   return mImpl->GetSystemOverlay();
130 }
131
132 void Core::SetViewMode( ViewMode viewMode )
133 {
134   mImpl->SetViewMode( viewMode );
135 }
136
137 ViewMode Core::GetViewMode() const
138 {
139   return mImpl->GetViewMode();
140 }
141
142 void Core::SetStereoBase( float stereoBase )
143 {
144   mImpl->SetStereoBase( stereoBase );
145 }
146
147 float Core::GetStereoBase() const
148 {
149   return mImpl->GetStereoBase();
150 }
151
152 void Core::RegisterProcessor( Processor& processor )
153 {
154   mImpl->RegisterProcessor( processor );
155 }
156
157 void Core::UnregisterProcessor( Processor& processor )
158 {
159   mImpl->UnregisterProcessor( processor );
160 }
161
162 Core::Core()
163 : mImpl( NULL )
164 {
165 }
166
167 } // namespace Integration
168
169 } // namespace Dali