summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authoreiko <[email protected]>2018-03-30 12:07:15 -0400
committerTom Black <[email protected]>2018-05-06 17:56:39 -0700
commit36754d58e1e17c11cc243f896d63cd9e1daf95ed (patch)
tree662336f7034eddaf52bf11b51b69e6c06e42ac8c /lib
parent3a7f63f64159b21f4ec5c4e64aa36eafcacf567f (diff)
downloadruby2d-36754d58e1e17c11cc243f896d63cd9e1daf95ed.tar.gz
ruby2d-36754d58e1e17c11cc243f896d63cd9e1daf95ed.zip
Enable setting and getting custom fps_cap
Diffstat (limited to 'lib')
-rw-r--r--lib/ruby2d/window.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ruby2d/window.rb b/lib/ruby2d/window.rb
index 686c6b0..021353d 100644
--- a/lib/ruby2d/window.rb
+++ b/lib/ruby2d/window.rb
@@ -25,9 +25,9 @@ module Ruby2D
@fullscreen = false
@highdpi = false
@frames = 0
- @fps_cap = args[:fps] || 60
+ @fps_cap = args[:fps_cap] || 60
@fps = @fps_cap
- @vsync = args[:vsync] || true
+ @vsync = args[:vsync] || true
@mouse_x, @mouse_y = 0, 0
@objects = []
@event_key = 0
@@ -76,6 +76,7 @@ module Ruby2D
when :highdpi; @highdpi
when :frames; @frames
when :fps; @fps
+ when :fps_cap; @fps_cap
when :mouse_x; @mouse_x
when :mouse_y; @mouse_y
when :diagnostics; @diagnostics
@@ -90,6 +91,7 @@ module Ruby2D
end
@width = opts[:width] || @width
@height = opts[:height] || @height
+ @fps_cap = opts[:fps_cap] || @fps_cap
@viewport_width = opts[:viewport_width] || @viewport_width
@viewport_height = opts[:viewport_height] || @viewport_height
@resizable = opts[:resizable] || @resizable