Skip to content

Commit

Permalink
remove toggle_borderless_window
Browse files Browse the repository at this point in the history
  • Loading branch information
mega-dean committed Mar 3, 2024
1 parent 0dd9464 commit f12a541
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@

## [Unreleased]

## [0.3.0] - 2024-03-03

- disable borderless window

## [0.2.0] - 2024-03-03

- support larger window sizes
- add some in-game control instructions
- add level 2 enemies
- add enemies to map
- add checksums

## [0.1.0] - 2024-03-01

Expand Down Expand Up @@ -133,6 +140,8 @@

- demo release

[0.3.0]: https://github.com/mega-dean/hallowdale/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/mega-dean/hallowdale/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/mega-dean/hallowdale/compare/v0.0.15...v0.1.0
[0.0.15]: https://github.com/mega-dean/hallowdale/compare/v0.0.14...v0.0.15
[0.0.14]: https://github.com/mega-dean/hallowdale/compare/v0.0.10...v0.0.14
Expand Down
Binary file modified assets/audio/sound-effects/vengeful-spirit.wav
Binary file not shown.
14 changes: 11 additions & 3 deletions src/env.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,19 @@ let (window_w, window_h, window_scale, font_size) : float * float * float * floa
(* Raylib.set_config_flags [ Raylib.ConfigFlags.Window_resizable ]; *)
(* need to run this before get_monitor_w/h *)
Raylib.init_window 100 100 "hallowdale";
Raylib.toggle_borderless_windowed ();
(* TODO figure out why the Windows build is using raylib 0.5.1 instead of 1.2.1
Raylib.toggle_borderless_windowed ();
*)
let monitor = Raylib.get_current_monitor () in
(Raylib.get_monitor_width monitor, Raylib.get_monitor_height monitor)
in
let window_ratio =
let window_ratio, adjust_for_title_bar =
let w_ratio = (monitor_w |> Int.to_float) /. max_width in
let h_ratio = (monitor_h |> Int.to_float) /. max_height in
Float.min w_ratio h_ratio
if w_ratio < h_ratio then
(w_ratio, false)
else
(h_ratio, true)
in
let window_scale =
if development then
Expand All @@ -78,6 +83,9 @@ let (window_w, window_h, window_scale, font_size) : float * float * float * floa
]
else if window_ratio < 0.5 then
failwith "monitor too small :("
else if adjust_for_title_bar then
(* TODO this is approximate, and can be removed when toggle_borderless_windowed is fixed *)
window_ratio *. 0.9
else
window_ratio
in
Expand Down

0 comments on commit f12a541

Please sign in to comment.