abstract class Eagle::Platform::Base

Overview

The interface a platform backend implements. Eagle.platform returns the active one.

Defined in:

eagle/platform/base.cr

Instance Method Summary

Instance Method Detail

abstract def base_path : String #

Folder containing the executable.


abstract def clipboard : String #

Clipboard text.


abstract def clipboard=(s : String) #

Sets the clipboard text.


abstract def close : Nil #

Destroys the window and shuts the backend down.


abstract def close_audio : Nil #

Closes the audio output.


abstract def cursor_visible=(v : Bool) #

Shows or hides the cursor.


abstract def drawable_size : Tuple(Int32, Int32) #

Framebuffer size in pixels.


abstract def fullscreen=(v : Bool) #

Enters or leaves fullscreen.


abstract def gamepad_name(id : Int32) : String | Nil #

The product name of a controller.


abstract def gamepad_rumble(id : Int32, low : Float32, high : Float32, ms : Int32) : Nil #

Vibrates a controller.


abstract def gl_proc(name : String) : Pointer(Void) #

Looks up an OpenGL function pointer.


abstract def message_box(title : String, message : String) : Nil #

Shows a native message box, for fatal errors.


abstract def mouse_position : Vec2 #

Current mouse position.


abstract def now : Float64 #

Monotonic time in seconds.


abstract def open(config : WindowConfig) : Nil #

Creates the window and graphics context.


abstract def open_audio(sample_rate : Int32, buffer_frames : Int32) : Int32 #

Opens a stereo float output. Returns the actual sample rate, or 0 on failure.


abstract def poll_events(& : Event -> ) : Nil #

Yields each pending event.


abstract def pref_path(org : String, app : String) : String #

A writable folder for saves and settings, per organization and app.


abstract def queue_audio(frames : Slice(Float32)) : Nil #

Queues interleaved stereo samples for playback.


abstract def queued_audio_frames : Int32 #

Frames queued and not yet played.


abstract def relative_mouse=(v : Bool) #

Captures or releases the mouse.


abstract def sleep(seconds : Float64) : Nil #

Sleeps for seconds.


abstract def swap : Nil #

Presents the frame.


abstract def text_input=(enabled : Bool) #

Starts or stops OS text input.


abstract def title=(t : String) #

Sets the window title.


abstract def vsync=(v : Bool) #

Turns vsync on or off.


abstract def window_size : Tuple(Int32, Int32) #

Window size in logical points.