52085014f599f0d0e28f0956dc9790886fcffaae
[platform/core/uifw/dali-adaptor.git] / dali / integration-api / egl-interface.h
1 #ifndef __DALI_INTEGRATION_EGL_INTERFACE_H__
2 #define __DALI_INTEGRATION_EGL_INTERFACE_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 namespace Dali
22 {
23
24 enum ColorDepth
25 {
26   COLOR_DEPTH_24 = 24,
27   COLOR_DEPTH_32 = 32
28 };
29
30 /**
31  * EglInterface provides an interface for managing EGL contexts
32  */
33 class EglInterface
34 {
35 public:
36   /**
37     * Create the OpenGL context.
38     * @return true if successful
39     */
40   virtual bool CreateContext() = 0;
41
42   /**
43    * Make the OpenGL context current
44    */
45   virtual void MakeContextCurrent() = 0;
46
47   /**
48    * Terminate GL
49    */
50   virtual void TerminateGles() = 0;
51
52   /**
53    * Performs an OpenGL swap buffers command
54    */
55   virtual void SwapBuffers() = 0;
56
57   /**
58    * Performs an OpenGL copy buffers command
59    */
60   virtual void CopyBuffers() = 0;
61
62   /**
63    * Performs an EGL wait GL command
64    */
65   virtual void WaitGL() = 0;
66
67 protected:
68   /**
69    * Virtual protected destructor, no deletion through this interface
70    */
71   virtual ~EglInterface() {}
72 };
73
74 } // namespace Dali
75
76 #endif // __DALI_INTEGRATION_EGL_INTERFACE_H__