summaryrefslogtreecommitdiff
path: root/platform/glfw
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-02-27 18:33:16 +0100
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-03-23 14:50:11 -0700
commit234384ece9c70f2a803ed2b1d1eb55b248ec43d1 (patch)
treea69fa3e64179667d79546f4f3d1b33f041e4ea22 /platform/glfw
parent8e5214144ec4f3a4fb40b7a7e4d8f09fd10dbb78 (diff)
downloadqtlocation-mapboxgl-234384ece9c70f2a803ed2b1d1eb55b248ec43d1.tar.gz
[core] Move OpenGL extension initialization to Backend
Diffstat (limited to 'platform/glfw')
-rw-r--r--platform/glfw/glfw_view.cpp7
-rw-r--r--platform/glfw/glfw_view.hpp6
2 files changed, 9 insertions, 4 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp
index d73b147deb..812b0e32af 100644
--- a/platform/glfw/glfw_view.cpp
+++ b/platform/glfw/glfw_view.cpp
@@ -4,7 +4,6 @@
#include <mbgl/sprite/sprite_image.hpp>
#include <mbgl/style/transition_options.hpp>
#include <mbgl/gl/gl.hpp>
-#include <mbgl/gl/extension.hpp>
#include <mbgl/gl/context.hpp>
#include <mbgl/util/logging.hpp>
#include <mbgl/util/platform.hpp>
@@ -86,8 +85,6 @@ GLFWView::GLFWView(bool fullscreen_, bool benchmark_)
glfwSetScrollCallback(window, onScroll);
glfwSetKeyCallback(window, onKey);
- mbgl::gl::InitializeExtensions(glfwGetProcAddress);
-
glfwGetWindowSize(window, &width, &height);
glfwGetFramebufferSize(window, &fbWidth, &fbHeight);
pixelRatio = static_cast<float>(fbWidth) / width;
@@ -499,6 +496,10 @@ mbgl::Size GLFWView::getFramebufferSize() const {
return { static_cast<uint32_t>(fbWidth), static_cast<uint32_t>(fbHeight) };
}
+mbgl::gl::ProcAddress GLFWView::initializeExtension(const char* name) {
+ return glfwGetProcAddress(name);
+}
+
void GLFWView::activate() {
glfwMakeContextCurrent(window);
}
diff --git a/platform/glfw/glfw_view.hpp b/platform/glfw/glfw_view.hpp
index bfabf6cc68..55f795cd34 100644
--- a/platform/glfw/glfw_view.hpp
+++ b/platform/glfw/glfw_view.hpp
@@ -44,9 +44,13 @@ public:
mbgl::Size getFramebufferSize() const;
// mbgl::Backend implementation
+ void invalidate() override;
+
+protected:
+ // mbgl::Backend implementation
+ mbgl::gl::ProcAddress initializeExtension(const char*) override;
void activate() override;
void deactivate() override;
- void invalidate() override;
private:
// Window callbacks