|
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 _EGLOS_H_ |
|
32 #define _EGLOS_H_ |
|
33 |
|
34 #include "eglInternal.h" |
|
35 #include "EGLConfig.h" |
|
36 |
|
37 class CEGLDisplay; |
|
38 |
|
39 class CEGLOs |
|
40 { |
|
41 public: |
|
42 static void InitializeLock( EGLI_LOCK *lock ); |
|
43 static void GetLock( EGLI_LOCK *lock ); |
|
44 static void ReleaseLock(EGLI_LOCK *lock ); |
|
45 static void DestroyLock( EGLI_LOCK *lock ); |
|
46 |
|
47 static void ConfigToNativePixelFormat( const CEGLConfig& config, EGLINativePixelFormatType* nativeFormat ); |
|
48 static EGLINativeContextType CreateNativeContext( const CEGLConfig& config, EGLINativeDisplayType display, EGLINativeContextType shareContext ); |
|
49 static EGLINativeContextType CurrentNativeContext(); |
|
50 static EGLINativeDisplayType CurrentNativeSurface(); |
|
51 static bool MakeNativeContextCurrent( struct EGLINativeGLFunctions* func, EGLINativeDisplayType draw, EGLINativeDisplayType read, EGLINativeContextType context ); |
|
52 static bool DestroyNativeContext( EGLINativeContextType context ); |
|
53 static bool InitializeNativeGLFunctions( struct EGLINativeGLFunctions* func, EGLINativeDisplayType display, EGLINativeContextType context ); |
|
54 static struct EGLINativePbufferContainer* CreateNativePbuffer( EGLINativeDisplayType display, |
|
55 const CEGLConfig& config, EGLint width, EGLint height, EGLBoolean largestPbuffer, |
|
56 EGLint textureFormat, EGLint textureTarget ); |
|
57 static bool DestroyNativePbuffer( struct EGLINativePbufferContainer* container ); |
|
58 |
|
59 static EGLINativeDisplayType CreateDefaultDisplay(); |
|
60 static void DestroyDefaultDisplay( EGLINativeDisplayType display ); |
|
61 static EGLINativeWindowType CreateNativeWindow( int width, int height ); |
|
62 static void DestroyNativeWindow( EGLINativeWindowType wnd ); |
|
63 |
|
64 static bool IsValidNativeDisplay( EGLINativeDisplayType dsp ); |
|
65 static bool IsValidNativeWindow( EGLINativeWindowType wnd ); |
|
66 static bool GetNativeWindowSize( EGLINativeWindowType wnd, int& width, int& height ); |
|
67 static EGLIOsWindowContext* CreateOSWindowContext( EGLINativeWindowType wnd, const CEGLConfig& config ); |
|
68 static void DestroyOSWindowContext( EGLIOsWindowContext* context ); |
|
69 static void BlitToOSWindow( EGLenum api, CEGLDisplay* display, EGLIOsWindowContext* context, void* buf, int width, int height, int stride ); |
|
70 |
|
71 static EGLILibraryHandle LoadHostGL(); |
|
72 static void* GetGLProcAddress(EGLILibraryHandle& libraryHandle, const char* proc); |
|
73 static bool FreeClientLibrary(EGLILibraryHandle& libraryHandle); |
|
74 |
|
75 static IEGLtoVGInterface* LoadVGInterface( EGLILibraryHandle& libraryHandle ); |
|
76 static IEGLtoGLESInterface* LoadGLES1Interface( EGLILibraryHandle& libraryHandle ); |
|
77 static IEGLtoGLES2Interface* LoadGLES2Interface( EGLILibraryHandle& libraryHandle ); |
|
78 }; |
|
79 |
|
80 #endif //_EGLOS_H_ |