1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program Tester Core
3 * ----------------------------------------
5 * Copyright 2014 The Android Open Source Project
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 * \brief EGL common defines and types
22 *//*--------------------------------------------------------------------*/
24 #include "egluStaticESLibrary.hpp"
25 #include "tcuFunctionLibrary.hpp"
27 #define STATIC_LIB_NONE 0
28 #define STATIC_LIB_ES20 1
29 #define STATIC_LIB_ES30 2
31 #if !defined(DEQP_GLES3_RUNTIME_LOAD)
32 # if (DE_OS == DE_OS_IOS)
33 # include <OpenGLES/ES3/gl.h>
35 # include <GLES3/gl3.h>
37 # define STATIC_LIB STATIC_LIB_ES30
38 #elif !defined(DEQP_GLES2_RUNTIME_LOAD)
39 # if (DE_OS == DE_OS_IOS)
40 # include <OpenGLES/ES2/gl.h>
42 # include <GLES2/gl2.h>
44 # define STATIC_LIB STATIC_LIB_ES20
46 # define STATIC_LIB STATIC_LIB_NONE
49 // \todo [2014-03-14 pyry] ES3.1 support
54 tcu::FunctionLibrary* createStaticESLibrary (void)
56 #if (STATIC_LIB == STATIC_LIB_NONE)
57 return new tcu::StaticFunctionLibrary(DE_NULL, 0);
59 static const tcu::StaticFunctionLibrary::Entry s_functions[] =
61 #if (STATIC_LIB == STATIC_LIB_ES30)
62 # include "egluStaticES30Library.inl"
63 #elif (STATIC_LIB == STATIC_LIB_ES20)
64 # include "egluStaticES20Library.inl"
66 # error "Unknown STATIC_LIB value"
70 return new tcu::StaticFunctionLibrary(&s_functions[0], DE_LENGTH_OF_ARRAY(s_functions));