summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/src/loop.c1
-rw-r--r--src/rendering/src/window.c15
2 files changed, 15 insertions, 1 deletions
diff --git a/src/core/src/loop.c b/src/core/src/loop.c
index dd39db1..49810ef 100644
--- a/src/core/src/loop.c
+++ b/src/core/src/loop.c
@@ -251,6 +251,7 @@ Platform* engine_init(const char* windowtitle, i32 windowWidth, i32 windowHeight
p->bindings_len = 0;
p->cam = &default_camera;
+
glm_ortho_default(45.f, p->cam->per);
// TODO: Add global bindings
diff --git a/src/rendering/src/window.c b/src/rendering/src/window.c
index b755035..a5e7db6 100644
--- a/src/rendering/src/window.c
+++ b/src/rendering/src/window.c
@@ -162,11 +162,24 @@ Window* init_window_glfw(
ret = (Window*)calloc(1, sizeof(Window));
ret->framework = WINDOW_FRAMEWORK_GLFW;
ret->renderer = WINDOW_RENDERER_NONE;
- glm_ivec2_copy(windowsize, ret->windowsize);
ret->window = window;
/* Last parameter is used for the renderer */
ret->context = NULL;
+ {
+ ivec2 wsize;
+ vec2 wscaling;
+ glfwGetWindowContentScale(window, &wscaling[0], &wscaling[1]);
+ glfwGetWindowSize(window, &wsize[0], &wsize[1]);
+
+ ret->windowsize[0] = (i32)((f32)wsize[0] * wscaling[0]);
+ ret->windowsize[1] = (i32)((f32)wsize[1] * wscaling[1]);
+
+ INFO("WINDOW CONTENT SCALING: %.2f x %.2f", wscaling[0], wscaling[1]);
+ INFO("WINDOW SIZE: %d x %d -> %d x %d", wsize[0], wsize[1], ret->windowsize[0], ret->windowsize[1]);
+ }
+
+
window_poll_events = &glfwPollEvents;
//get_time = &platform_get_time_usec;
get_time = &platform_get_time_usec;