From 84ea95988c2625646da407fcc25d52305f6115ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Mon, 24 Mar 2014 15:12:30 +0100 Subject: [PATCH] fix glyph debug image on retina --- common/map_view.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/map_view.cpp b/common/map_view.cpp index e151964e3..fef5a4469 100644 --- a/common/map_view.cpp +++ b/common/map_view.cpp @@ -256,7 +256,11 @@ void show_debug_image(std::string name, const char *data, size_t width, size_t h glfwSetWindowSize(debug_window, width, height); glfwMakeContextCurrent(debug_window); - glPixelZoom(1.0, -1.0); + int fb_width, fb_height; + glfwGetFramebufferSize(debug_window, &fb_width, &fb_height); + float scale = (float)fb_width / (float)width; + + glPixelZoom(scale, -scale); glRasterPos2f(-1.0f, 1.0f); glDrawPixels(width, height, GL_LUMINANCE, GL_UNSIGNED_BYTE, data); glfwSwapBuffers(debug_window);