summaryrefslogtreecommitdiff
path: root/include/mbgl/gl
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/gl')
-rw-r--r--include/mbgl/gl/gl.hpp1
-rw-r--r--include/mbgl/gl/gl_values.hpp25
2 files changed, 26 insertions, 0 deletions
diff --git a/include/mbgl/gl/gl.hpp b/include/mbgl/gl/gl.hpp
index 092166ef96..be6405c593 100644
--- a/include/mbgl/gl/gl.hpp
+++ b/include/mbgl/gl/gl.hpp
@@ -21,6 +21,7 @@
#elif TARGET_OS_MAC
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
+ #include <OpenGL/glext.h>
#else
#error Unsupported Apple platform
#endif
diff --git a/include/mbgl/gl/gl_values.hpp b/include/mbgl/gl/gl_values.hpp
index e5ad2380d1..fa3b87c435 100644
--- a/include/mbgl/gl/gl_values.hpp
+++ b/include/mbgl/gl/gl_values.hpp
@@ -271,6 +271,31 @@ struct ActiveTexture {
}
};
+struct BindFramebuffer {
+ using Type = GLint;
+ static void Set(const Type& value) {
+ MBGL_CHECK_ERROR(glBindFramebuffer(GL_FRAMEBUFFER, value));
+ }
+ static Type Get() {
+ Type activeFBO;
+ MBGL_CHECK_ERROR(glGetIntegerv(GL_FRAMEBUFFER_BINDING, &activeFBO));
+ return activeFBO;
+ }
+};
+
+struct Viewport {
+ using Type = std::array<GLint, 4>;
+ static void Set(const Type& value) {
+ MBGL_CHECK_ERROR(glViewport(value[0], value[1], value[2], value[3]));
+ }
+ static Type Get() {
+ Type pos;
+ MBGL_CHECK_ERROR(glGetIntegerv(GL_VIEWPORT, pos.data()));
+ return pos;
+ }
+};
+
+
#ifndef GL_ES_VERSION_2_0
struct PixelZoom {