diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-03-05 16:58:46 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-03-05 16:58:46 +0100 |
commit | 69a5c0e15fe6053323a4ef5e9cfd3c838458b841 (patch) | |
tree | 4a2c3cbf9371a2e6a4a75f4c396b3c7c375b35ac /linux | |
parent | b97a9778ea5ce75d0de73e5649e644bc2495b44b (diff) | |
download | qtlocation-mapboxgl-69a5c0e15fe6053323a4ef5e9cfd3c838458b841.tar.gz |
better support for gles2
Diffstat (limited to 'linux')
-rw-r--r-- | linux/main.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/linux/main.cpp b/linux/main.cpp index a6814ab92e..319dcf24bd 100644 --- a/linux/main.cpp +++ b/linux/main.cpp @@ -1,8 +1,6 @@ #include <llmr/llmr.hpp> #include <GLFW/glfw3.h> #include <llmr/platform/platform.hpp> -#include <future> -#include <list> #include "settings.hpp" #include "request.hpp" @@ -26,10 +24,24 @@ public: exit(1); } + GLFWmonitor *monitor = nullptr; + +#ifdef GL_ES_VERSION_2_0 + monitor = glfwGetPrimaryMonitor(); + + glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API); + glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); +#endif + + glfwWindowHint(GLFW_RED_BITS, 8); + glfwWindowHint(GLFW_GREEN_BITS, 8); + glfwWindowHint(GLFW_BLUE_BITS, 8); + glfwWindowHint(GLFW_ALPHA_BITS, 8); glfwWindowHint(GLFW_STENCIL_BITS, 8); glfwWindowHint(GLFW_DEPTH_BITS, 16); - window = glfwCreateWindow(1024, 768, "llmr", NULL, NULL); + window = glfwCreateWindow(1024, 768, "llmr", monitor, NULL); if (!window) { glfwTerminate(); fprintf(stderr, "Failed to initialize window\n"); @@ -47,9 +59,9 @@ public: settings.load(); map.setup((double)fb_width / width); - resize(window, 0, 0); + settings.load(); - glfwSwapInterval(1); + resize(window, 0, 0); map.loadSettings(); @@ -60,7 +72,6 @@ public: glfwSetScrollCallback(window, scroll); glfwSetCharCallback(window, character); glfwSetKeyCallback(window, key); - } static void character(GLFWwindow *window, unsigned int codepoint) { |