Skip to content

Commit cbccaf1

Browse files
committed
Feature: Bloom can be toggled through "b", for laptops without discrete GPUs.
1 parent 4631b75 commit cbccaf1

5 files changed

Lines changed: 13 additions & 6 deletions

File tree

include/constants.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
#define UI_LEGEND_PANEL_WIDTH 260
9797
#define UI_LEGEND_PANEL_HEIGHT 110
9898
#define UI_HELP_PANEL_WIDTH 340
99-
#define UI_HELP_PANEL_HEIGHT_NORMAL 170
100-
#define UI_HELP_PANEL_HEIGHT_PAUSED 200
99+
#define UI_HELP_PANEL_HEIGHT_NORMAL 194
100+
#define UI_HELP_PANEL_HEIGHT_PAUSED 224
101101
#define UI_DATASET_LEGEND_WIDTH 240
102102
#define UI_DATASET_LEGEND_HEIGHT 130
103103
#define UI_LINE_SPACING 24

include/data_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ typedef struct
4444
bool is_paused;
4545
bool cursor_enabled;
4646
bool show_help;
47+
bool bloom_enabled;
4748
f64 fps_smoothed;
4849
f64 fps_display;
4950
f64 fps_update_timer;

src/app.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ app_update(app_state_t *app_state, f64 dt)
115115
app_state->show_help = !app_state->show_help;
116116
}
117117

118+
if (IsKeyPressed(KEY_B))
119+
{
120+
app_state->bloom_enabled = !app_state->bloom_enabled;
121+
}
122+
118123
camera_update(app_state, dt);
119124

120125
f64 scroll = GetMouseWheelMove();
@@ -197,7 +202,8 @@ i32 app_init(app_state_t *app_state)
197202
app_state->debug = prev_debug;
198203
app_state->cursor_enabled = true;
199204
app_state->show_start_screen = true;
200-
app_state->show_help = false; // Hidden by default for better performance
205+
app_state->show_help = true;
206+
app_state->bloom_enabled = true;
201207

202208
app_state->main_camera.up = (Vector3){0.0f, 1.0f, 0.0f};
203209
app_state->main_camera.fovy = CAMERA_FOV;

src/renderer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ void renderer_draw_frame(app_state_t *app_state)
381381
return;
382382
}
383383

384-
if (app_state->data_to_draw < DRAW_DATA_COUNT)
384+
if (app_state->bloom_enabled && app_state->data_to_draw < DRAW_DATA_COUNT)
385385
{
386386
renderer_ensure_render_targets(app_state);
387387

src/ui.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ ui_draw_help_panel(app_state_t *app_state)
192192
app_state->data_to_draw == DRAW_DATA_B ||
193193
app_state->data_to_draw == DRAW_DATA_ALL);
194194
const char *help_lines = zoom_locked
195-
? "1-4 Dataset\nR Camera mode\nH Toggle help\nF11 Fullscreen"
196-
: "1-4 Dataset\nR Camera mode\nH Toggle help\nF11 Fullscreen\nScroll Zoom";
195+
? "1-4 Dataset\nR Camera mode\nB Toggle bloom\nH Toggle help\nF11 Fullscreen"
196+
: "1-4 Dataset\nR Camera mode\nB Toggle bloom\nH Toggle help\nF11 Fullscreen\nScroll Zoom";
197197
DrawTextEx(app_state->main_font, help_lines, (Vector2){(f32)(help_x + UI_PANEL_PADDING), (f32)line_y}, FONT_SIZE_MEDIUM, 1, TEXT_DIM);
198198

199199
if (app_state->is_paused)

0 commit comments

Comments
 (0)