1 #ifndef _GLURENDERCONFIG_HPP
2 #define _GLURENDERCONFIG_HPP
3 /*-------------------------------------------------------------------------
4 * drawElements Quality Program OpenGL ES Utilities
5 * ------------------------------------------------
7 * Copyright 2014 The Android Open Source Project
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief OpenGL rendering configuration.
24 *//*--------------------------------------------------------------------*/
26 #include "tcuDefs.hpp"
27 #include "gluRenderContext.hpp"
37 enum ResetNotificationStrategy
39 RESET_NOTIFICATION_STRATEGY_NOT_SPECIFIED = 0, //!< Not specified, implementation-dependent
40 RESET_NOTIFICATION_STRATEGY_NO_RESET_NOTIFICATION, //!< No reset notification (may not be supported)
41 RESET_NOTIFICATION_STRATEGY_LOSE_CONTEXT_ON_RESET, //!< Lose context on reset (may not be supported)
43 RESET_NOTIFICATION_STRATEGY_LAST
46 /*--------------------------------------------------------------------*//*!
47 * \brief Rendering context configuration.
48 *//*--------------------------------------------------------------------*/
53 SURFACETYPE_DONT_CARE = 0,
54 SURFACETYPE_WINDOW, //!< Native window.
55 SURFACETYPE_OFFSCREEN_NATIVE, //!< Native renderable offscreen buffer, such as pixmap or bitmap.
56 SURFACETYPE_OFFSCREEN_GENERIC, //!< Generic offscreen buffer, such as EGL pbuffer.
63 VISIBILITY_HIDDEN = 0,
65 VISIBILITY_FULLSCREEN,
79 SurfaceType surfaceType;
80 Visibility windowVisibility;
92 ResetNotificationStrategy resetNotificationStrategy;
94 RenderConfig (ContextType type_ = ContextType())
98 , surfaceType (SURFACETYPE_DONT_CARE)
99 , windowVisibility (VISIBILITY_VISIBLE)
101 , redBits (DONT_CARE)
102 , greenBits (DONT_CARE)
103 , blueBits (DONT_CARE)
104 , alphaBits (DONT_CARE)
105 , depthBits (DONT_CARE)
106 , stencilBits (DONT_CARE)
107 , numSamples (DONT_CARE)
108 , resetNotificationStrategy (RESET_NOTIFICATION_STRATEGY_NOT_SPECIFIED)
111 } DE_WARN_UNUSED_TYPE;
115 void parseRenderConfig (RenderConfig* config, const tcu::CommandLine& cmdLine);
116 RenderConfig::Visibility parseWindowVisibility (const tcu::CommandLine& cmdLine);
119 T getValueOrDefault (const RenderConfig& config, const T RenderConfig::*field, T defaultValue)
121 T value = config.*field;
122 return value == (T)RenderConfig::DONT_CARE ? defaultValue : value;
127 #endif // _GLURENDERCONFIG_HPP