summaryrefslogtreecommitdiff
path: root/platform/glfw
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-03-22 14:20:35 +0100
committerKonstantin Käfer <mail@kkaefer.com>2017-03-28 13:53:19 +0200
commita84aa453a9124867cb285f012abd97077ab2a019 (patch)
tree6181d5a39960df96e6dcd2d5c9d905c537b964fe /platform/glfw
parent3f0f4575e77ef289ca209323c0000cf743ab9db2 (diff)
downloadqtlocation-mapboxgl-a84aa453a9124867cb285f012abd97077ab2a019.tar.gz
[core] Privatize OpenGL/Context headers
Diffstat (limited to 'platform/glfw')
-rw-r--r--platform/glfw/glfw_view.cpp15
-rw-r--r--platform/glfw/glfw_view.hpp2
2 files changed, 6 insertions, 11 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp
index b8cf285bdd..e833478795 100644
--- a/platform/glfw/glfw_view.cpp
+++ b/platform/glfw/glfw_view.cpp
@@ -3,8 +3,6 @@
#include <mbgl/annotation/annotation.hpp>
#include <mbgl/sprite/sprite_image.hpp>
#include <mbgl/style/transition_options.hpp>
-#include <mbgl/gl/gl.hpp>
-#include <mbgl/gl/context.hpp>
#include <mbgl/util/logging.hpp>
#include <mbgl/util/platform.hpp>
#include <mbgl/util/string.hpp>
@@ -129,16 +127,14 @@ void GLFWView::setMap(mbgl::Map *map_) {
map->addAnnotationIcon("default_marker", makeSpriteImage(22, 22, 1));
}
-void GLFWView::updateViewBinding() {
- getContext().bindFramebuffer.setCurrentValue(0);
- assert(mbgl::gl::value::BindFramebuffer::Get() == getContext().bindFramebuffer.getCurrentValue());
- getContext().viewport.setCurrentValue({ 0, 0, getFramebufferSize() });
- assert(mbgl::gl::value::Viewport::Get() == getContext().viewport.getCurrentValue());
+void GLFWView::updateAssumedState() {
+ assumeFramebufferBinding(0);
+ assumeViewportSize(getFramebufferSize());
}
void GLFWView::bind() {
- getContext().bindFramebuffer = 0;
- getContext().viewport = { 0, 0, getFramebufferSize() };
+ setFramebufferBinding(0);
+ setViewportSize(getFramebufferSize());
}
void GLFWView::onKey(GLFWwindow *window, int key, int /*scancode*/, int action, int mods) {
@@ -459,7 +455,6 @@ void GLFWView::run() {
activate();
mbgl::BackendScope scope { *this, mbgl::BackendScope::ScopeType::Implicit };
- updateViewBinding();
map->render(*this);
glfwSwapBuffers(window);
diff --git a/platform/glfw/glfw_view.hpp b/platform/glfw/glfw_view.hpp
index 55f795cd34..1cadae2e0f 100644
--- a/platform/glfw/glfw_view.hpp
+++ b/platform/glfw/glfw_view.hpp
@@ -38,13 +38,13 @@ public:
void run();
// mbgl::View implementation
- void updateViewBinding();
void bind() override;
mbgl::Size getSize() const;
mbgl::Size getFramebufferSize() const;
// mbgl::Backend implementation
void invalidate() override;
+ void updateAssumedState() override;
protected:
// mbgl::Backend implementation