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

Concise view

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

Graph
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def statefulAppLoop[State](renderFrame: State => (Canvas & AudioPlayer) => 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.

Attributes

renderFrame

operation to render the frame and update the state

terminateWhen

loop termination check

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.

Attributes

renderFrame

operation to render the frame and update the state

terminateWhen

loop termination check

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.

Attributes

renderFrame

operation to render the frame and update the state

terminateWhen

loop termination check

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.

Attributes

renderFrame

operation to render the frame and update the state

terminateWhen

loop termination check

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.

Attributes

renderFrame

operation to render the frame

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

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

Attributes

renderFrame

operation to render the frame

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.

Attributes

frameRate

frame rate limit

renderFrame

operation to render the frame

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

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

Attributes

renderFrame

operation to render the frame