Skip to content

Commit

Permalink
Disable scissor mode due to a raylib bug on macOS when running in ful…
Browse files Browse the repository at this point in the history
…lscreen
  • Loading branch information
ashn-dot-dev committed Jan 15, 2024
1 parent aff45cd commit 6b0c95b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ main(void)
BeginDrawing();
ClearBackground(BLACK);

if (IsKeyPressed(KEY_F1)) {
ToggleFullscreen();
}

smol_handle_input(&ctx);
mu_begin(&ctx);

Expand Down
4 changes: 4 additions & 0 deletions demo.sunder
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ func main() void {
BeginDrawing();
ClearBackground(BLACK);

if IsKeyPressed(KEY_F1) {
ToggleFullscreen();
}

smol::handle_input(ui.context);
mu_begin(ui.context);

Expand Down
8 changes: 6 additions & 2 deletions smolui.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ smol_handle_input(mu_Context* ctx)
void
smol_render(mu_Context* ctx)
{
BeginScissorMode(0, 0, GetScreenWidth(), GetScreenHeight());
// XXX: Scissor mode is broken for raylib 5.0 on macOS. It appears that
// behavior of scissor mode on raylib 5.0 does not properly handle high-DPI
// displays on macOS when running in fullscreen mode.
/* BeginScissorMode(0, 0, GetScreenWidth(), GetScreenHeight()); */

mu_Command* cmd = NULL;
while (mu_next_command(ctx, &cmd)) {
Expand Down Expand Up @@ -232,5 +235,6 @@ smol_render(mu_Context* ctx)
}
}

EndScissorMode();
// XXX: Scissor mode is broken for raylib 5.0 on macOS.
/* EndScissorMode(); */
}

0 comments on commit 6b0c95b

Please sign in to comment.