13c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#ifndef _GLURENDERCONFIG_HPP
23c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#define _GLURENDERCONFIG_HPP
33c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*-------------------------------------------------------------------------
43c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * drawElements Quality Program OpenGL ES Utilities
53c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * ------------------------------------------------
63c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
73c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Copyright 2014 The Android Open Source Project
83c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
93c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Licensed under the Apache License, Version 2.0 (the "License");
103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * you may not use this file except in compliance with the License.
113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * You may obtain a copy of the License at
123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *      http://www.apache.org/licenses/LICENSE-2.0
143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
153c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Unless required by applicable law or agreed to in writing, software
163c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * distributed under the License is distributed on an "AS IS" BASIS,
173c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * See the License for the specific language governing permissions and
193c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * limitations under the License.
203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
213c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*!
223c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \file
233c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief OpenGL rendering configuration.
243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "tcuDefs.hpp"
273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include "gluRenderContext.hpp"
283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
293c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace tcu
303c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
313c827367444ee418f129b2c238299f49d3264554Jarkko Poyryclass CommandLine;
323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}
333c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
343c827367444ee418f129b2c238299f49d3264554Jarkko Poyrynamespace glu
353c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
363c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
373c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*--------------------------------------------------------------------*//*!
383c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * \brief Rendering context configuration.
393c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *//*--------------------------------------------------------------------*/
403c827367444ee418f129b2c238299f49d3264554Jarkko Poyrystruct RenderConfig
413c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
423c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	enum SurfaceType
433c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
443c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		SURFACETYPE_DONT_CARE = 0,
453c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		SURFACETYPE_WINDOW,				//!< Native window.
463c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		SURFACETYPE_OFFSCREEN_NATIVE,	//!< Native renderable offscreen buffer, such as pixmap or bitmap.
473c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		SURFACETYPE_OFFSCREEN_GENERIC,	//!< Generic offscreen buffer, such as EGL pbuffer.
483c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
493c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		SURFACETYPE_LAST
503c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	};
513c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
523c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	enum Visibility
533c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
543c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		VISIBILITY_HIDDEN = 0,
553c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		VISIBILITY_VISIBLE,
563c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		VISIBILITY_FULLSCREEN,
573c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
583c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		VISIBILITY_LAST
593c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	};
603c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
613c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	enum
623c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
633c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		DONT_CARE = -1
643c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	};
653c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
663c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	ContextType			type;
673c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
683c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int					width;
693c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int					height;
703c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	SurfaceType			surfaceType;
713c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	Visibility			windowVisibility;
723c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
733c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int					id;
743c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
753c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int					redBits;
763c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int					greenBits;
773c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int					blueBits;
783c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int					alphaBits;
793c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int					depthBits;
803c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int					stencilBits;
813c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	int					numSamples;
823c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
833c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	RenderConfig (ContextType type_ = ContextType())
843c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		: type				(type_)
853c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, width				(DONT_CARE)
863c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, height			(DONT_CARE)
873c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, surfaceType		(SURFACETYPE_DONT_CARE)
883c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, windowVisibility	(VISIBILITY_VISIBLE)
893c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, id				(DONT_CARE)
903c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, redBits			(DONT_CARE)
913c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, greenBits			(DONT_CARE)
923c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, blueBits			(DONT_CARE)
933c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, alphaBits			(DONT_CARE)
943c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, depthBits			(DONT_CARE)
953c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, stencilBits		(DONT_CARE)
963c827367444ee418f129b2c238299f49d3264554Jarkko Poyry		, numSamples		(DONT_CARE)
973c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	{
983c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	}
9993df37596ea66700965094b3aa2830cf4f2ca5aaJarkko Pöyry} DE_WARN_UNUSED_TYPE;
1003c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1013c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// Utilities
1023c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1033c827367444ee418f129b2c238299f49d3264554Jarkko Poyryvoid						parseRenderConfig		(RenderConfig* config, const tcu::CommandLine& cmdLine);
1043c827367444ee418f129b2c238299f49d3264554Jarkko PoyryRenderConfig::Visibility	parseWindowVisibility	(const tcu::CommandLine& cmdLine);
1053c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1063c827367444ee418f129b2c238299f49d3264554Jarkko Poyrytemplate<typename T>
1073c827367444ee418f129b2c238299f49d3264554Jarkko PoyryT getValueOrDefault (const RenderConfig& config, const T RenderConfig::*field, T defaultValue)
1083c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{
1093c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	T value = config.*field;
1103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry	return value == (T)RenderConfig::DONT_CARE ? defaultValue : value;
1113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}
1123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} // glu
1143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
1153c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#endif // _GLURENDERCONFIG_HPP
116