First public contribution.
     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".
 
     8 // Initial Contributors:
 
     9 // Nokia Corporation - initial contribution.
 
    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
 
    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.
 
    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.
 
    41 #ifndef __OPENGLESHEADERS_LEGACY_EGL_1_1
 
    42 #error "openglesheaders testcase configuration error: macro __OPENGLESHEADERS_LEGACY_EGL_1_1 expected"
 
    46 #error "openglesheaders testcase failure: GLES/egl.h legacy behaviour requires egl.h to include gl.h"
 
    49 #ifndef EGL_DEFAULT_DISPLAY
 
    50 #error "openglesheaders testcase failure: GLES/egl.h legacy behaviour requires egl.h to include egltypes.h"
 
    53 #ifndef EGL_VERSION_1_1
 
    54 #error "openglesheaders testcase failure: GLES/egl.h legacy behaviour requires EGL 1.1 API to be seen"
 
    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"
 
    62  * Make sure that the legacy egltypes.h file does exist in the GLES subdirectory.
 
    64 #include <GLES/egltypes.h>
 
    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"
 
    70 GLDEF_C TInt E32Main()
 
    75 // Getting this far without a compilation error indicates success.