diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-09-29 15:32:48 +0200 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-09-29 10:17:47 -0700 |
commit | cc78b74098e02311cc646fe5b82c13641ff705fa (patch) | |
tree | af0219d5611f0984bf3b244a336fbc6074a44cb4 /src/mbgl/gl/types.hpp | |
parent | 15aece8a30dcc1f1f97e28180edda46d05641a2d (diff) | |
download | qtlocation-mapboxgl-cc78b74098e02311cc646fe5b82c13641ff705fa.tar.gz |
[core] remove dependence on gl.h types
Diffstat (limited to 'src/mbgl/gl/types.hpp')
-rw-r--r-- | src/mbgl/gl/types.hpp | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/src/mbgl/gl/types.hpp b/src/mbgl/gl/types.hpp index 94426f5e36..8578a11f66 100644 --- a/src/mbgl/gl/types.hpp +++ b/src/mbgl/gl/types.hpp @@ -5,6 +5,7 @@ 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; @@ -13,5 +14,86 @@ 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 |