|
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 legacy behaviour of graphics_openglesheaders |
|
15 // The purpose of this source code is to throw an error during compilation |
|
16 // if the contents of the #included header files has any symbol which is not |
|
17 // part of the EGL 1.1 API specification even though later versions of EGL add new |
|
18 // symbols to the namespace in a backwards-compatible way. |
|
19 // This file must be compiled with the legacy setting |
|
20 // |
|
21 |
|
22 // #define __OPENGLESHEADERS_LEGACY_EGL_1_1 |
|
23 // Such a setting would normally be made in an OEM-specific system-wide |
|
24 // included .hrh file. |
|
25 // |
|
26 |
|
27 /** |
|
28 @file |
|
29 @internalTechnology |
|
30 @released |
|
31 */ |
|
32 #include <e32base.h> |
|
33 |
|
34 /* |
|
35 * Include the GLES/egl.h which we want to behave as a legacy EGL 1.1 API. |
|
36 * Note that this file is for legacy reasons is located under the GLES directory. |
|
37 * Note also, we don't include GLES/gl.h as we expect egl.h in EGL 1.1 to do this. |
|
38 */ |
|
39 #include <GLES/egl.h> |
|
40 |
|
41 #ifndef __OPENGLESHEADERS_LEGACY_EGL_1_1 |
|
42 #error "openglesheaders testcase configuration error: macro __OPENGLESHEADERS_LEGACY_EGL_1_1 expected" |
|
43 #endif |
|
44 |
|
45 #ifndef GL_TRUE |
|
46 #error "openglesheaders testcase failure: GLES/egl.h legacy behaviour requires egl.h to include gl.h" |
|
47 #endif |
|
48 |
|
49 #ifndef EGL_DEFAULT_DISPLAY |
|
50 #error "openglesheaders testcase failure: GLES/egl.h legacy behaviour requires egl.h to include egltypes.h" |
|
51 #endif |
|
52 |
|
53 #ifndef EGL_VERSION_1_1 |
|
54 #error "openglesheaders testcase failure: GLES/egl.h legacy behaviour requires EGL 1.1 API to be seen" |
|
55 #endif |
|
56 |
|
57 #ifdef EGL_VERSION_1_2 |
|
58 #error "openglesheaders testcase failure: GLES/egl.h legacy behaviour requires no EGL API symbols beyond EGL API 1.1 to be seen" |
|
59 #endif |
|
60 |
|
61 /* |
|
62 * Make sure that the legacy egltypes.h file does exist in the GLES subdirectory. |
|
63 */ |
|
64 #include <GLES/egltypes.h> |
|
65 |
|
66 #ifndef __LEGACY_EGL_1_1_EGLTYPES_H__ |
|
67 #error "openglesheaders testcase failure: GLES/egltypes.h should re-direct to the legacy egltypes.h, not the system-wide EGL/egltypes.h" |
|
68 #endif |
|
69 |
|
70 GLDEF_C TInt E32Main() |
|
71 { |
|
72 return 0; |
|
73 } |
|
74 |
|
75 // Getting this far without a compilation error indicates success. |