Line data Source code
1 : /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/. */
5 :
6 : #ifndef GLCONTEXT_TYPES_H_
7 : #define GLCONTEXT_TYPES_H_
8 :
9 : #include "GLTypes.h"
10 : #include "mozilla/TypedEnumBits.h"
11 :
12 : namespace mozilla {
13 : namespace gl {
14 :
15 : class GLContext;
16 :
17 : enum class GLContextType {
18 : Unknown,
19 : WGL,
20 : CGL,
21 : GLX,
22 : EGL,
23 : EAGL
24 : };
25 :
26 : enum class OriginPos : uint8_t {
27 : TopLeft,
28 : BottomLeft
29 : };
30 :
31 : struct GLFormats
32 : {
33 : // Constructs a zeroed object:
34 : GLFormats();
35 :
36 : GLenum color_texInternalFormat;
37 : GLenum color_texFormat;
38 : GLenum color_texType;
39 : GLenum color_rbFormat;
40 :
41 : GLenum depthStencil;
42 : GLenum depth;
43 : GLenum stencil;
44 :
45 : GLsizei samples;
46 : };
47 :
48 : enum class CreateContextFlags : int8_t {
49 : NONE = 0,
50 : REQUIRE_COMPAT_PROFILE = 1 << 0,
51 : // Force the use of hardware backed GL, don't allow software implementations.
52 : FORCE_ENABLE_HARDWARE = 1 << 1,
53 : /* Don't force discrete GPU to be used (if applicable) */
54 : ALLOW_OFFLINE_RENDERER = 1 << 2,
55 : // Ask for ES3 if possible
56 : PREFER_ES3 = 1 << 3,
57 :
58 : NO_VALIDATION = 1 << 4,
59 : PREFER_ROBUSTNESS = 1 << 5,
60 : };
61 0 : MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(CreateContextFlags)
62 :
63 : } /* namespace gl */
64 : } /* namespace mozilla */
65 :
66 : #endif /* GLCONTEXT_TYPES_H_ */
|