Skip to content

Commit

Permalink
debugger: fix render bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
redthing1 committed Jul 16, 2024
1 parent f837871 commit c4b0f5d
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions source/re/ng/diag/debugger.d
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ debug class Debugger {
inspector = new Inspector();
console = new Console();
if (!Core.headless) {
ui_bounds = Rectangle(0, 0, Core.window.render_width, Core.window.render_height);
_render_target = RenderExt.create_render_target(cast(int) ui_bounds.width, cast(int) ui_bounds
.height);
Core.log.info(format("debugger info: ui_bounds=%s, resolution=%s",
ui_bounds, Core.default_resolution));
ui_bounds = Rectangle(0, 0, Core.window.screen_width, Core.window.screen_height);
_render_target = RenderExt.create_render_target(
cast(int) ui_bounds.width, cast(int) ui_bounds.height
);
Core.log.info(
format("debugger info: ui_bounds=%s, resolution=%s",
ui_bounds, Core.default_resolution)
);
}
}

Expand All @@ -60,11 +63,6 @@ debug class Debugger {
}

public void render() {
if (!inspector.open && !console.open) {
// nothing to render
return;
}

raylib.BeginTextureMode(_render_target);
raylib.ClearBackground(Colors.BLANK);

Expand All @@ -77,7 +75,7 @@ debug class Debugger {

// draw render target
RenderExt.draw_render_target(_render_target,
Rectangle(0, 0, Core.window.render_width, Core.window.render_height),
Rectangle(0, 0, Core.window.screen_width, Core.window.screen_height),
_render_col
);
}
Expand Down

0 comments on commit c4b0f5d

Please sign in to comment.