diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-05-19 14:21:15 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-05-19 14:21:15 +0200 |
commit | 92706445d9054fbe7ad66581c8bd56f4e0de4a69 (patch) | |
tree | 087adf001cf60541a90b62e6f9d0ecf2056493a1 | |
parent | f848868c16ff4b55e0f983e25853589a50d94824 (diff) | |
download | qtlocation-mapboxgl-92706445d9054fbe7ad66581c8bd56f4e0de4a69.tar.gz |
init glfw for debug images + actually copy images over
-rw-r--r-- | common/glfw_view.cpp | 4 | ||||
-rw-r--r-- | src/geometry/sprite_atlas.cpp | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/common/glfw_view.cpp b/common/glfw_view.cpp index 3ef7bc36a9..e03b5ed2fe 100644 --- a/common/glfw_view.cpp +++ b/common/glfw_view.cpp @@ -204,6 +204,8 @@ namespace platform { double elapsed() { return glfwGetTime(); } void show_debug_image(std::string name, const char *data, size_t width, size_t height) { + glfwInit(); + static GLFWwindow *debug_window = nullptr; if (!debug_window) { debug_window = glfwCreateWindow(width, height, name.c_str(), nullptr, nullptr); @@ -233,6 +235,8 @@ void show_debug_image(std::string name, const char *data, size_t width, size_t h void show_color_debug_image(std::string name, const char *data, size_t logical_width, size_t logical_height, size_t width, size_t height) { + glfwInit(); + static GLFWwindow *debug_window = nullptr; if (!debug_window) { debug_window = glfwCreateWindow(logical_width, logical_height, name.c_str(), nullptr, nullptr); diff --git a/src/geometry/sprite_atlas.cpp b/src/geometry/sprite_atlas.cpp index 4f05df6201..1c6afcd306 100644 --- a/src/geometry/sprite_atlas.cpp +++ b/src/geometry/sprite_atlas.cpp @@ -203,7 +203,7 @@ void SpriteAtlas::update(const Sprite &sprite) { Rect<dimension> dst = atlas.getImage(name, sprite); const SpritePosition &src = sprite.getSpritePosition(name); if (src.width == dst.w * atlas.pixelRatio && src.height == dst.h * atlas.pixelRatio && src.pixelRatio == atlas.pixelRatio) { - // atlas.copy(dst, src, sprite); + atlas.copy(dst, src, sprite); return true; } else { fprintf(stderr, "sprite icon dimension mismatch\n"); |