|
1 /* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
2 * |
|
3 * Permission is hereby granted, free of charge, to any person obtaining a |
|
4 * copy of this software and /or associated documentation files |
|
5 * (the "Materials "), to deal in the Materials without restriction, |
|
6 * including without limitation the rights to use, copy, modify, merge, |
|
7 * publish, distribute, sublicense, and/or sell copies of the Materials, |
|
8 * and to permit persons to whom the Materials are furnished to do so, |
|
9 * subject to the following conditions: |
|
10 * |
|
11 * The above copyright notice and this permission notice shall be included |
|
12 * in all copies or substantial portions of the Materials. |
|
13 * |
|
14 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
|
18 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
|
19 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR |
|
20 * THE USE OR OTHER DEALINGS IN THE MATERIALS. |
|
21 * |
|
22 * Initial Contributors: |
|
23 * Nokia Corporation - initial contribution. |
|
24 * |
|
25 * Contributors: |
|
26 * |
|
27 * Description: |
|
28 * |
|
29 */ |
|
30 |
|
31 #ifndef _EGLCONTEXT_H_ |
|
32 #define _EGLCONTEXT_H_ |
|
33 |
|
34 #include <EGL/egl.h> |
|
35 #include "eglInternal.h" |
|
36 #include <vector> |
|
37 |
|
38 class CEGLConfig; |
|
39 class CEGLThread; |
|
40 class CEGLDisplay; |
|
41 |
|
42 class CEGLContext : public RefCountingObject |
|
43 { |
|
44 public: |
|
45 CEGLContext( EGLint processId, CEGLDisplay* display, CEGLConfig* config, EGLenum& clientApi, EGLint& clientVersion, void* clientContext ); |
|
46 ~CEGLContext(void); |
|
47 |
|
48 public: |
|
49 inline EGLint ProcessId() const { return m_processId; } |
|
50 inline EGLenum ClientApi() const { return m_clientApi; } |
|
51 inline EGLint ClientVersion() const { return m_clientVersion; } |
|
52 inline void* ClientContext() const { return m_clientContext; } |
|
53 inline CEGLConfig* Config() const { return m_config; } |
|
54 inline void SetThread( CEGLThread* thread ) { m_thread = thread; } |
|
55 inline CEGLThread* Thread() const { return m_thread; } |
|
56 inline CEGLDisplay* Display() const { return m_display; } |
|
57 |
|
58 inline void SetNativeContext( EGLINativeContextType context ) { m_nativeContext = context; } |
|
59 inline EGLINativeContextType NativeContext() const { return m_nativeContext; } |
|
60 inline void SetNativeGLFucntions( struct EGLINativeGLFunctions* functions ) { m_nativeGLFunctions = functions; } |
|
61 inline struct EGLINativeGLFunctions* NativeGLFunctions() const { return m_nativeGLFunctions; } |
|
62 |
|
63 private: |
|
64 EGLint m_processId; |
|
65 CEGLThread* m_thread; |
|
66 CEGLConfig* m_config; |
|
67 EGLenum m_clientApi; |
|
68 EGLint m_clientVersion; |
|
69 void* m_clientContext; |
|
70 std::vector<CEGLContext*> m_sharedContexts; |
|
71 CEGLDisplay* m_display; |
|
72 EGLINativeContextType m_nativeContext; |
|
73 struct EGLINativeGLFunctions* m_nativeGLFunctions; |
|
74 }; |
|
75 |
|
76 #endif //_EGLCONTEXT_H_ |