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
30 #define STATIC_LIB_ES31 3
31 #define STATIC_LIB_ES32 4
33 #if defined(DEQP_GLES32_DIRECT_LINK)
34 # if (DE_OS == DE_OS_IOS)
35 # include <OpenGLES/ES32/gl.h>
37 # include <GLES3/gl32.h>
39 # define STATIC_LIB STATIC_LIB_ES32
40 #elif defined(DEQP_GLES31_DIRECT_LINK)
41 # if (DE_OS == DE_OS_IOS)
42 # include <OpenGLES/ES31/gl.h>
44 # include <GLES3/gl31.h>
46 # define STATIC_LIB STATIC_LIB_ES31
47 #elif defined(DEQP_GLES3_DIRECT_LINK)
48 # if (DE_OS == DE_OS_IOS)
49 # include <OpenGLES/ES3/gl.h>
51 # include <GLES3/gl3.h>
53 # define STATIC_LIB STATIC_LIB_ES30
54 #elif defined(DEQP_GLES2_DIRECT_LINK)
55 # if (DE_OS == DE_OS_IOS)
56 # include <OpenGLES/ES2/gl.h>
58 # include <GLES2/gl2.h>
60 # define STATIC_LIB STATIC_LIB_ES20
62 # define STATIC_LIB STATIC_LIB_NONE
68 tcu::FunctionLibrary* createStaticESLibrary (void)
70 #if (STATIC_LIB == STATIC_LIB_NONE)
71 return new tcu::StaticFunctionLibrary(DE_NULL, 0);
73 static const tcu::StaticFunctionLibrary::Entry s_functions[] =
75 #if (STATIC_LIB == STATIC_LIB_ES32)
76 # include "egluStaticES32Library.inl"
77 #elif (STATIC_LIB == STATIC_LIB_ES31)
78 # include "egluStaticES31Library.inl"
79 #elif (STATIC_LIB == STATIC_LIB_ES30)
80 # include "egluStaticES30Library.inl"
81 #elif (STATIC_LIB == STATIC_LIB_ES20)
82 # include "egluStaticES20Library.inl"
84 # error "Unknown STATIC_LIB value"
88 return new tcu::StaticFunctionLibrary(&s_functions[0], DE_LENGTH_OF_ARRAY(s_functions));