Builder

trait Builder[F1[_, _], F2[_, _, _]]

Contains a set of helpful methods to implement basic render loops in a platform agonstic way.

Type parameters:
F1

effect type for stateless loops

F2

effect type for stateful loops

class Object
trait Matchable
class Any
object ImpureRenderLoop.type

Value members

Abstract methods

def singleFrame(renderFrame: F1[Canvas, Unit]): RenderLoop[Unit]

Renders a single frame.

Renders a single frame.

Value parameters:
renderFrame

operation to render the frame and update the state

def statefulRenderLoop[S](renderFrame: F2[Canvas, S, S], frameRate: LoopFrequency, terminateWhen: S => Boolean): RenderLoop[S]

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

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

Value parameters:
frameRate

frame rate limit

renderFrame

operation to render the frame and update the state

terminateWhen

loop termination check

def statelessRenderLoop(renderFrame: F1[Canvas, Unit], frameRate: LoopFrequency): RenderLoop[Unit]

Creates a render loop that keeps no state.

Creates a render loop that keeps no state.

Value parameters:
frameRate

frame rate limit

renderFrame

operation to render the frame