class
Eagle::Config
- Eagle::Config
- Reference
- Object
Overview
Settings for the window and the engine loop. Every field has a sensible default.
You rarely build a Config yourself. Pass the fields as named arguments to
Eagle.run, or override App#configure to compute them:
class Game < App
def configure(config : Config) : Nil
config.msaa = 4
config.fixed_fps = 120 # finer physics steps
end
end
Eagle.run(Game, title: "Space Rocks", width: 1280, height: 720, vsync: true)
A few environment variables override the config, which is handy for CI and screenshots:
EAGLE_FRAMES=60quits after 60 frames.EAGLE_SCREENSHOT=out.pngsaves the last frame before quitting.EAGLE_HEADLESS=1hides the window.EAGLE_SIZE=800x600overrides the window size.
Defined in:
eagle/core/engine.crConstructors
-
.new(**opts)
Builds a config from named arguments that match the property names.
Instance Method Summary
-
#assets_dir : String | Nil
Folder that
res://paths resolve against. -
#assets_dir=(assets_dir : String | Nil)
Folder that
res://paths resolve against. -
#audio : Bool
Set to false to skip opening an audio device, for tools and servers.
-
#audio=(audio : Bool)
Set to false to skip opening an audio device, for tools and servers.
-
#clear_color : Color
Background color the screen is cleared to at the start of every frame.
-
#clear_color=(clear_color : Color)
Background color the screen is cleared to at the start of every frame.
-
#fixed_fps : Int32
How many times per second
physics_processandApp#fixed_updaterun, independent of the frame rate. -
#fixed_fps=(fixed_fps : Int32)
How many times per second
physics_processandApp#fixed_updaterun, independent of the frame rate. -
#fullscreen : Bool
Start fullscreen.
-
#fullscreen=(fullscreen : Bool)
Start fullscreen.
-
#height : Int32
Initial window height in logical pixels.
-
#height=(height : Int32)
Initial window height in logical pixels.
-
#hidden : Bool
Open the window hidden, for tests and offscreen rendering.
-
#hidden=(hidden : Bool)
Open the window hidden, for tests and offscreen rendering.
-
#highdpi : Bool
Render at full resolution on Retina and other high-DPI screens.
-
#highdpi=(highdpi : Bool)
Render at full resolution on Retina and other high-DPI screens.
-
#max_fps : Int32
Frame-rate cap used when vsync is off.
-
#max_fps=(max_fps : Int32)
Frame-rate cap used when vsync is off.
-
#msaa : Int32
Multisample anti-aliasing samples (0, 2, 4 or 8).
-
#msaa=(msaa : Int32)
Multisample anti-aliasing samples (0, 2, 4 or 8).
-
#resizable : Bool
Whether the player can resize the window.
-
#resizable=(resizable : Bool)
Whether the player can resize the window.
-
#title : String
Window title.
-
#title=(title : String)
Window title.
-
#vsync : Bool
Sync presentation to the display's refresh rate.
-
#vsync=(vsync : Bool)
Sync presentation to the display's refresh rate.
-
#width : Int32
Initial window width in logical pixels.
-
#width=(width : Int32)
Initial window width in logical pixels.
Constructor Detail
Instance Method Detail
Folder that res:// paths resolve against. nil auto-detects it; see Assets.
Folder that res:// paths resolve against. nil auto-detects it; see Assets.
Background color the screen is cleared to at the start of every frame.
How many times per second physics_process and App#fixed_update run, independent of the frame rate.
How many times per second physics_process and App#fixed_update run, independent of the frame rate.
Multisample anti-aliasing samples (0, 2, 4 or 8). Smooths 3D edges and shape outlines.
Multisample anti-aliasing samples (0, 2, 4 or 8). Smooths 3D edges and shape outlines.
Whether the player can resize the window. App#resize and Node#resized fire when they do.
Whether the player can resize the window. App#resize and Node#resized fire when they do.
Sync presentation to the display's refresh rate. Leave it on unless you are measuring performance.
Sync presentation to the display's refresh rate. Leave it on unless you are measuring performance.