Skip to content

Commit 5f0753e

Browse files
author
Blaž Hrastnik
committed
Make the window size same as screen resolution.
1 parent 5db15c3 commit 5f0753e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modules/graphics/mrblib/screen.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def initialize(w, h, fullscreen = true)
1818
create_window w, h
1919
initialize_renderer
2020
initialize_clear_color
21-
initialize_screen_size if !fullscreen?
21+
initialize_screen_size #if !fullscreen?
2222
@vsync = true
2323
end
2424

@@ -35,7 +35,12 @@ def create_window(w, h)
3535
GLFW.window_hint GLFW::OPENGL_PROFILE, GLFW::OPENGL_CORE_PROFILE # for 3.0 and on
3636
Moon::Shader.is_legacy = false
3737

38-
monitor = GLFW.primary_monitor if fullscreen?
38+
if fullscreen?
39+
monitor = GLFW.primary_monitor
40+
vid_mode = monitor.vid_mode
41+
w = vid_mode.width
42+
h = vid_mode.height
43+
end
3944

4045
title = 'Moon Player'
4146
begin

0 commit comments

Comments
 (0)