summaryrefslogtreecommitdiff
path: root/platform/glfw
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-11-20 22:39:52 +0100
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-08-27 14:07:40 -0700
commit1e454642c8bc99698d25105fe0034916e2930fe6 (patch)
tree3d9b60c1366033c97dfe51d4285d6bf3edf992ed /platform/glfw
parentfd1ed8ce48fc9eaf6793e852381d8c7e648386af (diff)
downloadqtlocation-mapboxgl-1e454642c8bc99698d25105fe0034916e2930fe6.tar.gz
[build] allow WITH_EGL for macOS as well (SwiftShader) and enable EGL for GLFW
Diffstat (limited to 'platform/glfw')
-rw-r--r--platform/glfw/glfw_view.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/platform/glfw/glfw_view.cpp b/platform/glfw/glfw_view.cpp
index f1cbdbbaeb..9179113139 100644
--- a/platform/glfw/glfw_view.cpp
+++ b/platform/glfw/glfw_view.cpp
@@ -54,13 +54,19 @@ GLFWView::GLFWView(bool fullscreen_, bool benchmark_)
height = videoMode->height;
}
+#if __APPLE__
glfwWindowHint(GLFW_COCOA_GRAPHICS_SWITCHING, GL_TRUE);
+#endif
+
+#if MBGL_WITH_EGL
+ glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
+#endif
#ifdef DEBUG
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
#endif
-#ifdef GL_ES_VERSION_2_0
+#if MBGL_USE_GLES2
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
@@ -652,7 +658,7 @@ void GLFWView::toggle3DExtrusions(bool visible) {
namespace mbgl {
namespace platform {
-#ifndef GL_ES_VERSION_2_0
+#ifndef MBGL_USE_GLES2
void showDebugImage(std::string name, const char *data, size_t width, size_t height) {
glfwInit();