diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-06-01 21:32:26 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-06-13 13:37:41 +0300 |
commit | a05f060153497e1be6515120b65f580f4551f9e0 (patch) | |
tree | b736fe12eebe4bfdac0154c4e45d4dbf26207b57 /src/mbgl/gl/value.cpp | |
parent | 28eb2e635417c7fb8d746a9ed1d76774066098b3 (diff) | |
download | qtlocation-mapboxgl-a05f060153497e1be6515120b65f580f4551f9e0.tar.gz |
[core] Added Backend::{assume,set}ScissorTest
Diffstat (limited to 'src/mbgl/gl/value.cpp')
-rw-r--r-- | src/mbgl/gl/value.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mbgl/gl/value.cpp b/src/mbgl/gl/value.cpp index c081c941f5..32c632d101 100644 --- a/src/mbgl/gl/value.cpp +++ b/src/mbgl/gl/value.cpp @@ -267,6 +267,18 @@ Viewport::Type Viewport::Get() { { static_cast<uint32_t>(viewport[2]), static_cast<uint32_t>(viewport[3]) } }; } +const constexpr ScissorTest::Type ScissorTest::Default; + +void ScissorTest::Set(const Type& value) { + MBGL_CHECK_ERROR(value ? glEnable(GL_SCISSOR_TEST) : glDisable(GL_SCISSOR_TEST)); +} + +ScissorTest::Type ScissorTest::Get() { + Type scissorTest; + MBGL_CHECK_ERROR(scissorTest = glIsEnabled(GL_SCISSOR_TEST)); + return scissorTest; +} + const constexpr BindFramebuffer::Type BindFramebuffer::Default; void BindFramebuffer::Set(const Type& value) { |