summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/types.hpp
blob: 8578a11f66b4e4ae5d9c7a1e58c13cdf08d6deca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#pragma once

#include <cstdint>

namespace mbgl {
namespace gl {

// Mapping based on https://www.opengl.org/wiki/OpenGL_Type
using ProgramID = uint32_t;
using ShaderID = uint32_t;
using BufferID = uint32_t;
using TextureID = uint32_t;
using VertexArrayID = uint32_t;
using FramebufferID = uint32_t;
using RenderbufferID = uint32_t;

using AttributeLocation = int32_t;
using UniformLocation = int32_t;
using TextureUnit = uint8_t;

using DepthValue = double;
using StencilValue = int32_t;
using StencilMaskValue = uint32_t;

enum class BufferType : uint32_t {
    Vertex = 0x8892,
    Element = 0x8893
};

enum class StencilTestFunction : uint32_t {
    Never = 0x0200,
    Less = 0x0201,
    Equal = 0x0202,
    LessEqual = 0x0203,
    Greater = 0x0204,
    NotEqual = 0x0205,
    GreaterEqual = 0x0206,
    Always = 0x0207,
};

enum class StencilTestOperation : uint32_t {
    Keep = 0x1E00,
    Zero = 0x0000,
    Replace = 0x1E01,
    Increment = 0x1E02,
    IncrementWrap = 0x8507,
    Decrement = 0x1E03,
    DecrementWrap = 0x8508,
    Invert = 0x150A,
};

enum class DepthTestFunction : uint32_t {
    Never = 0x0200,
    Less = 0x0201,
    Equal = 0x0202,
    LessEqual = 0x0203,
    Greater = 0x0204,
    NotEqual = 0x0205,
    GreaterEqual = 0x0206,
    Always = 0x0207,
};

enum class BlendSourceFactor : uint32_t {
    Zero = 0x0000,
    One = 0x0001,
    SrcColor = 0x0300,
    OneMinusSrcColor = 0x0301,
    DstColor = 0x0306,
    OneMinusDstColor = 0x0307,
    SrcAlpha = 0x0302,
    OneMinusSrcAlpha = 0x0303,
    DstAlpha = 0x0304,
    OneMinusDstAlpha = 0x0305,
    ConstantColor = 0x8001,
    OneMinusConstantColor = 0x8002,
    ConstantAlpha = 0x8003,
    OneMinusConstantAlpha = 0x8004,
    SrcAlphaSaturate = 0x0308,
};

enum class BlendDestinationFactor : uint32_t {
    Zero = 0x0000,
    One = 0x0001,
    SrcColor = 0x0300,
    OneMinusSrcColor = 0x0301,
    DstColor = 0x0306,
    OneMinusDstColor = 0x0307,
    SrcAlpha = 0x0302,
    OneMinusSrcAlpha = 0x0303,
    DstAlpha = 0x0304,
    OneMinusDstAlpha = 0x0305,
    ConstantColor = 0x8001,
    OneMinusConstantColor = 0x8002,
    ConstantAlpha = 0x8003,
    OneMinusConstantAlpha = 0x8004,
};

} // namespace gl
} // namespace mbgl