Skip to content

Commit 8e038c1

Browse files
committed
Fix: Set the window size and render texture to the current display size.
1 parent 3427eeb commit 8e038c1

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

include/constants.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#ifndef CONSTANTS_H
22
#define CONSTANTS_H
33

4-
// @TODO(Victor): Set the render size based on display resolution? after window init.
5-
#define INITIAL_WINDOW_WIDTH 2560
6-
#define INITIAL_WINDOW_HEIGHT 1440
4+
// @NOTE(Victor): Overridden in app.c app_init_platform() to the current monitor size
5+
#define INITIAL_WINDOW_WIDTH 1920
6+
#define INITIAL_WINDOW_HEIGHT 1080
77

88
#define MAX_DATA_POINTS 100000UL
99
#define MAX_REDSHIFT_GALAXIES 100000UL

src/app.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ app_init_platform(app_state_t *app_state)
2121
const char *window_title = TextFormat("Galaxy Visualization v%s", APP_VERSION);
2222
InitWindow(app_state->window_width, app_state->window_height, window_title);
2323

24+
// Set the windows size and render texture size to match the current monitor
25+
const i32 current_monitor = GetCurrentMonitor();
26+
const i32 monitor_width = GetMonitorWidth(current_monitor);
27+
const i32 monitor_height = GetMonitorHeight(current_monitor);
28+
SetWindowSize(monitor_width, monitor_height);
29+
app_state->window_width = monitor_width;
30+
app_state->window_height = monitor_height;
31+
2432
{
2533
Image icon = asset_io_load_image(ASSET_ICON_APP, ".png");
2634
if (icon.data != NULL)

0 commit comments

Comments
 (0)