13c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*-------------------------------------------------------------------------
23c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * drawElements Quality Program Tester Core
33c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * ----------------------------------------
43c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
53c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Copyright 2014 The Android Open Source Project
63c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
73c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Licensed under the Apache License, Version 2.0 (the "License");
83c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * you may not use this file except in compliance with the License.
93c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * You may obtain a copy of the License at
103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *      http://www.apache.org/licenses/LICENSE-2.0
123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Unless required by applicable law or agreed to in writing, software
143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * distributed under the License is distributed on an "AS IS" BASIS,
153c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
163c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * See the License for the specific language governing permissions and
173c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * limitations under the License.
183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
193c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*!
203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \file
213c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief EGL common defines and types
223c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
233c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "egluStaticESLibrary.hpp"
253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuFunctionLibrary.hpp"
263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
276ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos#define STATIC_LIB_NONE	0
286ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos#define STATIC_LIB_ES20	1
296ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos#define STATIC_LIB_ES30	2
306ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos
31d98514b6a944f4ef8f008c7381f65563609fd149Pyry Haulos#if !defined(DEQP_GLES3_RUNTIME_LOAD)
323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#	if (DE_OS == DE_OS_IOS)
333c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#		include <OpenGLES/ES3/gl.h>
343c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#	else
353c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#		include <GLES3/gl3.h>
363c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#	endif
376ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos#	define STATIC_LIB STATIC_LIB_ES30
38d98514b6a944f4ef8f008c7381f65563609fd149Pyry Haulos#elif !defined(DEQP_GLES2_RUNTIME_LOAD)
391abab607ca1c1b410881390f9ec47e6be04c207dPyry Haulos#	if (DE_OS == DE_OS_IOS)
401abab607ca1c1b410881390f9ec47e6be04c207dPyry Haulos#		include <OpenGLES/ES2/gl.h>
411abab607ca1c1b410881390f9ec47e6be04c207dPyry Haulos#	else
421abab607ca1c1b410881390f9ec47e6be04c207dPyry Haulos#		include <GLES2/gl2.h>
431abab607ca1c1b410881390f9ec47e6be04c207dPyry Haulos#	endif
446ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos#	define STATIC_LIB STATIC_LIB_ES20
456ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos#else
466ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos#	define STATIC_LIB STATIC_LIB_NONE
473c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#endif
483c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
493c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// \todo [2014-03-14 pyry] ES3.1 support
503c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
513c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace eglu
523c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
533c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
543c827367444ee418f129b2c238299f49d3264554Jarkko Poyrytcu::FunctionLibrary* createStaticESLibrary (void)
553c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
566ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos#if (STATIC_LIB == STATIC_LIB_NONE)
576ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos	return new tcu::StaticFunctionLibrary(DE_NULL, 0);
586ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos#else
593c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	static const tcu::StaticFunctionLibrary::Entry s_functions[] =
603c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
616ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos#if (STATIC_LIB == STATIC_LIB_ES30)
623c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#	include "egluStaticES30Library.inl"
636ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos#elif (STATIC_LIB == STATIC_LIB_ES20)
643c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#	include "egluStaticES20Library.inl"
656ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos#else
666ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos#	error "Unknown STATIC_LIB value"
673c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#endif
683c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	};
693c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
703c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	return new tcu::StaticFunctionLibrary(&s_functions[0], DE_LENGTH_OF_ARRAY(s_functions));
716ced97b127bcd9b9d957980c754de628954ff972Pyry Haulos#endif
723c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}
733c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
743c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // eglu
75