Method: Ruby2D::Window#initialize
- Defined in:
- lib/ruby2d/window.rb
#initialize(title: 'Ruby 2D', width: 640, height: 480, fps_cap: 60, vsync: true) ⇒ Window
Create a Window
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/ruby2d/window.rb', line 27 def initialize(title: 'Ruby 2D', width: 640, height: 480, fps_cap: 60, vsync: true) # Title of the window @title = title # Window size @width = width @height = height # Frames per second upper limit, and the actual FPS @fps_cap = fps_cap @fps = @fps_cap # Vertical synchronization, set to prevent screen tearing (recommended) @vsync = vsync # Total number of frames that have been rendered @frames = 0 # Renderable objects currently in the window, like a linear scene graph @objects = [] _init_window_defaults _init_event_stores _init_event_registrations _init_procs_dsl_console end |