aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-07-26 13:02:25 +0200
committerraysan5 <raysan5@gmail.com>2016-07-26 13:02:25 +0200
commit07a375e2d626428f5a1b9f02907120a4b3b3a08a (patch)
tree8814bbb28a8251d8ce4a063c1d028d360516bc24 /src
parent6d68c789891b35f06724bea9436db91f3bd17fcf (diff)
downloadraylib-07a375e2d626428f5a1b9f02907120a4b3b3a08a.tar.gz
raylib-07a375e2d626428f5a1b9f02907120a4b3b3a08a.zip
Corrected issue with HIghDPI display on OSX
Well, not tested yet but it should work...
Diffstat (limited to 'src')
-rw-r--r--src/core.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core.c b/src/core.c
index a3253d79..022fbfe9 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1614,7 +1614,14 @@ static void InitGraphicsDevice(int width, int height)
TraceLog(INFO, "Trying to enable VSYNC");
}
- //glfwGetFramebufferSize(window, &renderWidth, &renderHeight); // Get framebuffer size of current window
+#ifdef __APPLE__
+ // Get framebuffer size of current window
+ // NOTE: Required to handle HighDPI display correctly
+ // TODO: Probably should be added for other systems too or managed
+ // internally by GLFW3 callback: glfwSetFramebufferSizeCallback()
+ glfwGetFramebufferSize(window, &renderWidth, &renderHeight);
+#endif
+
#endif // defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI)
@@ -1765,6 +1772,7 @@ static void InitGraphicsDevice(int width, int height)
#endif // defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI)
// Initialize OpenGL context (states and resources)
+ // NOTE: screenWidth and screenHeight not used, just stored as globals
rlglInit(screenWidth, screenHeight);
// Initialize screen viewport (area of the screen that you will actually draw to)