Dali 3D User Interface Engine
core.h
Go to the documentation of this file.
1 #ifndef __DALI_INTEGRATION_CORE_H__
2 #define __DALI_INTEGRATION_CORE_H__
3 
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20 
21 // EXTERNAL INCLUDES
26 
27 namespace Dali
28 {
29 
30 namespace Internal
31 {
32 class Core;
33 }
34 
35 namespace Integration
36 {
37 
38 class Core;
39 class GestureManager;
40 class GlAbstraction;
41 class GlSyncAbstraction;
42 class PlatformAbstraction;
43 class RenderController;
44 class SystemOverlay;
45 struct Event;
46 struct TouchData;
47 
48 
52 namespace KeepUpdating
53 {
54 enum Reasons
55 {
62 };
63 }
64 
69 {
70 public:
71 
76  : keepUpdating(false),
77  needsNotification(false),
78  secondsFromLastFrame( 0.0f )
79  {
80  }
81 
82 public:
83 
88  unsigned int KeepUpdating() { return keepUpdating; }
89 
96 
103 
104 public:
105 
106  unsigned int keepUpdating;
109 };
110 
115 {
116 public:
117 
122  : needsUpdate(false),
123  hasRendered(false)
124  {
125  }
126 
132  void SetNeedsUpdate(bool updateRequired) { needsUpdate = updateRequired; }
133 
138  bool NeedsUpdate() { return needsUpdate; }
139 
143  void SetHasRendered(bool rendered) { hasRendered = rendered; }
144 
149  bool HasRendered() { return hasRendered; }
150 
151 private:
152 
155 };
156 
199 {
200 public:
201 
215  static Core* New(RenderController& renderController,
216  PlatformAbstraction& platformAbstraction,
217  GlAbstraction& glAbstraction,
218  GlSyncAbstraction& glSyncAbstraction,
219  GestureManager& gestureManager,
221 
225  ~Core();
226 
227  // GL Context Lifecycle
228 
232  ContextNotifierInterface* GetContextNotifier();
233 
240  void ContextCreated();
241 
248  void ContextDestroyed();
249 
259  void RecoverFromContextLoss();
260 
269  void SurfaceResized(unsigned int width, unsigned int height);
270 
271  // Core setters
272 
281  void SetDpi(unsigned int dpiHorizontal, unsigned int dpiVertical);
282 
283  // Core Lifecycle
284 
293  void Suspend();
294 
302  void Resume();
303 
307  void SceneCreated();
308 
315  void QueueEvent(const Event& event);
316 
322  void ProcessEvents();
323 
331  void UpdateTouchData(const TouchData& touch);
332 
341  unsigned int GetMaximumUpdateCount() const;
342 
356  void Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, UpdateStatus& status );
357 
364  void Render( RenderStatus& status );
365 
366  // System-level overlay
367 
372  SystemOverlay& GetSystemOverlay();
373 
378  void SetViewMode( ViewMode viewMode );
379 
385  ViewMode GetViewMode() const;
386 
391  void SetStereoBase( float stereoBase );
392 
397  float GetStereoBase() const;
398 
399 private:
400 
404  Core();
405 
411  Core(const Core& core);
412 
418  Core& operator=(const Core& rhs);
419 
420 private:
421 
423 
424 };
425 
426 } // namespace Integration
427 
428 } // namespace Dali
429 
430 #endif // __DALI_INTEGRATION_CORE_H__
Dali Docs Home
Read more about Dali