|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Test case code for checking current behaviour of graphics_openglesheaders |
|
15 // The purpose of this source code is to thrown an error during compilation |
|
16 // if the GLES/egl.h header does not re-direct to the system-wide EGL/egl.h |
|
17 // The use of GLES/egl.h is a legacy, and kept to ease the transition of |
|
18 // applications to using EGL/egl.h instead. |
|
19 // This code must be compiled without the legacy setting |
|
20 // __OPENGLESHEADERS_LEGACY_EGL_1_1 to ensure that GLES/egl.h re-directs |
|
21 // to the system-wide EGL/egl.h |
|
22 // |
|
23 // |
|
24 |
|
25 /** |
|
26 @file |
|
27 @internalTechnology |
|
28 @released |
|
29 */ |
|
30 #include <e32base.h> |
|
31 |
|
32 /* |
|
33 * Include the GLES/egl.h which we want to behave as the system-wide EGL API. |
|
34 * Note that this file is for legacy reasons is located under the GLES directory. |
|
35 * Note also, we don't include GLES/gl.h as we expect GLES egl.h in to do this. |
|
36 */ |
|
37 #include <GLES/egl.h> |
|
38 |
|
39 #ifdef __OPENGLESHEADERS_LEGACY_EGL_1_1 |
|
40 /* |
|
41 * If the above macro has been set unexpectedly, then it has most probably |
|
42 * arisen because Symbian_OS.hrh defined it. This is an error because Symbian |
|
43 * never defines this macro in a Symbian product configuration. |
|
44 */ |
|
45 #error "openglesheaders testcase configuration error: macro __OPENGLESHEADERS_LEGACY_EGL_1_1 should not be defined" |
|
46 #endif |
|
47 |
|
48 #ifndef GL_TRUE |
|
49 #error "openglesheaders testcase failure: GLES/egl.h behaviour requires egl.h to include gl.h" |
|
50 #endif |
|
51 |
|
52 #ifndef EGL_DEFAULT_DISPLAY |
|
53 #error "openglesheaders testcase failure: GLES/egl.h behaviour requires egl.h to include egltypes.h" |
|
54 #endif |
|
55 |
|
56 #ifndef EGL_VERSION_1_1 |
|
57 #error "openglesheaders testcase failure: GLES/egl.h behaviour requires EGL 1.1 API to be seen" |
|
58 #endif |
|
59 |
|
60 #ifndef EGL_VERSION_1_2 |
|
61 #error "openglesheaders testcase failure: GLES/egl.h behaviour requires symbols from all EGL versions to be seen" |
|
62 #endif |
|
63 |
|
64 /* |
|
65 * Make sure that the current egltypes.h file does exist in the GLES subdirectory. |
|
66 */ |
|
67 #include <GLES/egltypes.h> |
|
68 |
|
69 #ifdef __LEGACY_EGL_1_1_EGLTYPES_H__ |
|
70 #error "openglesheaders testcase failure: GLES/egltypes.h should re-direct to the system-wide egltypes.h, not the legacy GLES egltypes.h" |
|
71 #endif |
|
72 |
|
73 GLDEF_C TInt E32Main() |
|
74 { |
|
75 return 0; |
|
76 } |
|
77 |
|
78 // Getting this far without a compilation error indicates success. |