blob: 88ddd50ed97d4f2e7f0845ae698559b03084cdcb [file] [log] [blame]
Stephen White03badec2020-11-23 18:50:42 +00001// Copyright 2020 The Dawn Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef DAWNNATIVE_OPENGL_OPENGLVERSION_H_
16#define DAWNNATIVE_OPENGL_OPENGLVERSION_H_
17
18#include "dawn_native/opengl/OpenGLFunctionsBase_autogen.h"
19
20namespace dawn_native { namespace opengl {
21
22 struct OpenGLVersion {
23 public:
24 MaybeError Initialize(GetProcAddress getProc);
25
26 bool IsDesktop() const;
27 bool IsES() const;
28 uint32_t GetMajor() const;
29 uint32_t GetMinor() const;
30 bool IsAtLeast(uint32_t majorVersion, uint32_t minorVersion) const;
31
32 private:
33 enum class Standard {
34 Desktop,
35 ES,
36 };
37 uint32_t mMajorVersion;
38 uint32_t mMinorVersion;
39 Standard mStandard;
40 };
41
42}} // namespace dawn_native::opengl
43
44#endif // DAWNNATIVE_OPENGL_OPENGLVERSION_H_