sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Test case code for checking current behaviour of graphics_openglesheaders sl@0: // The purpose of this source code is to thrown an error during compilation sl@0: // if the GLES/egl.h header does not re-direct to the system-wide EGL/egl.h sl@0: // The use of GLES/egl.h is a legacy, and kept to ease the transition of sl@0: // applications to using EGL/egl.h instead. sl@0: // This code must be compiled without the legacy setting sl@0: // __OPENGLESHEADERS_LEGACY_EGL_1_1 to ensure that GLES/egl.h re-directs sl@0: // to the system-wide EGL/egl.h sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: @released sl@0: */ sl@0: #include sl@0: sl@0: /* sl@0: * Include the GLES/egl.h which we want to behave as the system-wide EGL API. sl@0: * Note that this file is for legacy reasons is located under the GLES directory. sl@0: * Note also, we don't include GLES/gl.h as we expect GLES egl.h in to do this. sl@0: */ sl@0: #include sl@0: sl@0: #ifdef __OPENGLESHEADERS_LEGACY_EGL_1_1 sl@0: /* sl@0: * If the above macro has been set unexpectedly, then it has most probably sl@0: * arisen because Symbian_OS.hrh defined it. This is an error because Symbian sl@0: * never defines this macro in a Symbian product configuration. sl@0: */ sl@0: #error "openglesheaders testcase configuration error: macro __OPENGLESHEADERS_LEGACY_EGL_1_1 should not be defined" sl@0: #endif sl@0: sl@0: #ifndef GL_TRUE sl@0: #error "openglesheaders testcase failure: GLES/egl.h behaviour requires egl.h to include gl.h" sl@0: #endif sl@0: sl@0: #ifndef EGL_DEFAULT_DISPLAY sl@0: #error "openglesheaders testcase failure: GLES/egl.h behaviour requires egl.h to include egltypes.h" sl@0: #endif sl@0: sl@0: #ifndef EGL_VERSION_1_1 sl@0: #error "openglesheaders testcase failure: GLES/egl.h behaviour requires EGL 1.1 API to be seen" sl@0: #endif sl@0: sl@0: #ifndef EGL_VERSION_1_2 sl@0: #error "openglesheaders testcase failure: GLES/egl.h behaviour requires symbols from all EGL versions to be seen" sl@0: #endif sl@0: sl@0: /* sl@0: * Make sure that the current egltypes.h file does exist in the GLES subdirectory. sl@0: */ sl@0: #include sl@0: sl@0: #ifdef __LEGACY_EGL_1_1_EGLTYPES_H__ sl@0: #error "openglesheaders testcase failure: GLES/egltypes.h should re-direct to the system-wide egltypes.h, not the legacy GLES egltypes.h" sl@0: #endif sl@0: sl@0: GLDEF_C TInt E32Main() sl@0: { sl@0: return 0; sl@0: } sl@0: sl@0: // Getting this far without a compilation error indicates success.