fluo/window

Types

pub type Context(params) {
  Context(
    draw: fn(render.Renderer, mesh.Mesh, params) -> Nil,
    delta: Float,
    keys_down: List(Key),
    mouse_pos: Position,
    mouse_delta: Position,
    width: Int,
    height: Int,
    color: image.ColorImage,
    depth: image.DepthImage,
    title: String,
  )
}

Constructors

pub type Key {
  KeyA
  KeyB
  KeyC
  KeyD
  KeyE
  KeyF
  KeyG
  KeyH
  KeyI
  KeyJ
  KeyK
  KeyL
  KeyM
  KeyN
  KeyO
  KeyP
  KeyQ
  KeyR
  KeyS
  KeyT
  KeyU
  KeyV
  KeyW
  KeyX
  KeyY
  KeyZ
  ArrowUp
  ArrowDown
  ArrowLeft
  ArrowRight
  Enter
  Space
  Backspace
  Tab
  LShift
  RShift
  LCtrl
  RCtrl
  LAlt
  RAlt
}

Constructors

  • KeyA
  • KeyB
  • KeyC
  • KeyD
  • KeyE
  • KeyF
  • KeyG
  • KeyH
  • KeyI
  • KeyJ
  • KeyK
  • KeyL
  • KeyM
  • KeyN
  • KeyO
  • KeyP
  • KeyQ
  • KeyR
  • KeyS
  • KeyT
  • KeyU
  • KeyV
  • KeyW
  • KeyX
  • KeyY
  • KeyZ
  • ArrowUp
  • ArrowDown
  • ArrowLeft
  • ArrowRight
  • Enter
  • Space
  • Backspace
  • Tab
  • LShift
  • RShift
  • LCtrl
  • RCtrl
  • LAlt
  • RAlt
pub type Position {
  Position(x: Float, y: Float)
}

Constructors

  • Position(x: Float, y: Float)
pub opaque type Window

Values

pub fn color(window: Window) -> image.ColorImage
pub fn create_window(
  title: String,
  width width: Int,
  height height: Int,
) -> Window
pub fn delta(window: Window) -> Float
pub fn depth(window: Window) -> image.DepthImage
pub fn height(window: Window) -> Int
pub fn keys_down(window: Window) -> List(Key)
pub fn loop(
  window: Window,
  state: state,
  callback: fn(Context(params), state) -> state,
) -> Nil
pub fn mouse_delta(window: Window) -> Position
pub fn mouse_position(window: Window) -> Position
pub fn poll_events(window: Window) -> Nil
pub fn present(window: Window) -> Nil
pub fn swap(window: Window, color: image.ColorImage) -> Nil
pub fn title(window: Window) -> String
pub fn width(window: Window) -> Int
pub fn window_should_close(window: Window) -> Bool
Search Document