1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef GLCONTEXT_TYPES_H_
7 #define GLCONTEXT_TYPES_H_
10 #include "mozilla/TypedEnumBits.h"
17 enum class GLContextType
{ Unknown
, WGL
, CGL
, GLX
, EGL
, EAGL
};
19 enum class OriginPos
: uint8_t { TopLeft
, BottomLeft
};
21 enum class CreateContextFlags
: uint16_t {
23 REQUIRE_COMPAT_PROFILE
= 1 << 0,
24 // Force the use of hardware backed GL, don't allow software implementations.
25 FORCE_ENABLE_HARDWARE
= 1 << 1,
26 /* Don't force discrete GPU to be used (if applicable) */
27 ALLOW_OFFLINE_RENDERER
= 1 << 2,
28 // Ask for ES3 if possible
31 NO_VALIDATION
= 1 << 4,
32 PREFER_ROBUSTNESS
= 1 << 5,
34 PROVOKING_VERTEX_DONT_CARE
= 1 << 7,
35 PREFER_EXACT_VERSION
= 1 << 8,
36 PREFER_MULTITHREADED
= 1 << 9,
38 MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(CreateContextFlags
)
40 struct GLContextCreateDesc
{
41 CreateContextFlags flags
= CreateContextFlags::NONE
;
44 struct GLContextDesc final
: public GLContextCreateDesc
{
45 bool isOffscreen
= false;
49 } /* namespace mozilla */
51 #endif /* GLCONTEXT_TYPES_H_ */