Dali 3D User Interface Engine
egl-implementation.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_EGL_IMPLEMENTATION_H__
2 #define __DALI_INTERNAL_EGL_IMPLEMENTATION_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
22 #include <EGL/egl.h>
23 #include <EGL/eglext.h>
25 
26 // INTERNAL INCLUDES
27 #include <adaptors/integration-api/egl-interface.h>
28 
29 namespace Dali
30 {
31 
32 namespace Internal
33 {
34 namespace Adaptor
35 {
36 
40 class EglImplementation : public EglInterface
41 {
42 public:
47 
51  virtual ~EglImplementation();
52 
53 public:
54 
62  bool InitializeGles( EGLNativeDisplayType display, bool isOwnSurface = true );
63 
68  virtual bool CreateContext();
69 
73  void DestroyContext();
74 
78  void DestroySurface();
79 
83  virtual void MakeContextCurrent();
84 
88  void MakeContextNull();
89 
96  void MakeCurrent( EGLNativePixmapType pixmap, EGLSurface eglSurface );
97 
101  virtual void TerminateGles();
102 
107  bool IsGlesInitialized() const;
108 
112  virtual void SwapBuffers();
113 
117  virtual void CopyBuffers();
118 
122  virtual void WaitGL();
123 
129  void ChooseConfig( bool isWindowType, ColorDepth depth );
130 
137  void CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth );
138 
145  EGLSurface CreateSurfacePixmap( EGLNativePixmapType pixmap, ColorDepth depth );
146 
153  bool ReplaceSurfaceWindow( EGLNativeWindowType window );
154 
162  bool ReplaceSurfacePixmap( EGLNativePixmapType pixmap, EGLSurface& eglSurface );
163 
168  EGLDisplay GetDisplay() const;
169 
174  EGLContext GetContext() const;
175 
176 private:
177 
179 
180  EGLNativeDisplayType mEglNativeDisplay;
181 #ifndef EMSCRIPTEN
182  EGLNativeWindowType mEglNativeWindow;
183 #endif
184  EGLNativePixmapType mCurrentEglNativePixmap;
185 
186  EGLDisplay mEglDisplay;
187  EGLConfig mEglConfig;
188  EGLContext mEglContext;
189  EGLSurface mCurrentEglSurface;
190 
194  bool mIsWindow;
195  ColorDepth mColorDepth;
196 };
197 
198 } // namespace Adaptor
199 
200 } // namespace Internal
201 
202 } // namespace Dali
203 
204 #endif // __DALI_INTERNAL_EGL_IMPLEMENTATION_H__
Dali Docs Home
Read more about Dali