AppLoop

eu.joaocosta.minart.runtime.AppLoop
See theAppLoop companion trait
object AppLoop

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
AppLoop.type

Members list

Type members

Classlikes

trait Definition[State, Settings, Subsystem]

App loop definition that takes the initial settings, initial state and loop frequency.

App loop definition that takes the initial settings, initial state and loop frequency.

Attributes

Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def statefulAppLoop[State](renderFrame: State => (CanvasSubsystem & AudioPlayerSubsystem) => State, terminateWhen: State => Boolean): Definition[State, (Settings, Settings), LowLevelAllSubsystems]

Creates an app loop with a canvas and an audio player that keeps and updates a state on every iteration, terminating when a certain condition is reached.

Creates an app loop with a canvas and an audio player that keeps and updates a state on every iteration, terminating when a certain condition is reached.

Value parameters

renderFrame

operation to render the frame and update the state

terminateWhen

loop termination check

Attributes

def statefulAudioLoop[State](renderFrame: State => AudioPlayer => State, terminateWhen: State => Boolean): Definition[State, Settings, LowLevelAudioPlayer]

Creates an app loop with an audio player that keeps and updates a state on every iteration, terminating when a certain condition is reached.

Creates an app loop with an audio player that keeps and updates a state on every iteration, terminating when a certain condition is reached.

Value parameters

renderFrame

operation to render the frame and update the state

terminateWhen

loop termination check

Attributes

def statefulLoop[State, Settings, Subsystem <: LowLevelSubsystem[Settings]](renderFrame: State => Subsystem => State, terminateWhen: State => Boolean): Definition[State, Settings, Subsystem]

Creates an app loop that keeps and updates a state on every iteration, terminating when a certain condition is reached.

Creates an app loop that keeps and updates a state on every iteration, terminating when a certain condition is reached.

This is a low level operation for custom subsystems. For most use cases, statefulRenderLoop, statefulAudioLoop and statefulAppLoop are preferred.

Value parameters

renderFrame

operation to render the frame and update the state

terminateWhen

loop termination check

Attributes

def statefulRenderLoop[State](renderFrame: State => Canvas => State, terminateWhen: State => Boolean): Definition[State, Settings, LowLevelCanvas]

Creates a render loop with a canvas that keeps and updates a state on every iteration, terminating when a certain condition is reached.

Creates a render loop with a canvas that keeps and updates a state on every iteration, terminating when a certain condition is reached.

Value parameters

renderFrame

operation to render the frame and update the state

terminateWhen

loop termination check

Attributes

Creates an app loop with a canvas and an audio player that keeps no state.

Creates an app loop with a canvas and an audio player that keeps no state.

Value parameters

renderFrame

operation to render the frame

Attributes

Creates an aoo loop with an audio player that keeps no state.

Creates an aoo loop with an audio player that keeps no state.

Value parameters

renderFrame

operation to render the frame

Attributes

def statelessLoop[Settings, Subsystem <: LowLevelSubsystem[Settings]](renderFrame: Subsystem => Unit): Definition[Unit, Settings, Subsystem]

Creates an app loop that keeps no state.

Creates an app loop that keeps no state.

This is a low level operation for custom subsystems. For most use cases, statelessRenderLoop, statelessAudioLoop and statelessAppLoop are preferred.

Value parameters

frameRate

frame rate limit

renderFrame

operation to render the frame

Attributes

Creates a render loop with a canvas that keeps no state.

Creates a render loop with a canvas that keeps no state.

Value parameters

renderFrame

operation to render the frame

Attributes