//var draw = use('draw2d')

prosperon.win = prosperon.engine_start({
  title:`Prosperon [${prosperon.version}-${prosperon.revision}]`,
  width: 1280,
  height: 720,
  high_dpi:0,
  alpha:1,
  fullscreen:0,
  sample_count:1,
  enable_clipboard:true,
  enable_dragndrop: true,
  max_dropped_files: 1,
  swap_interval: 1,
  name: "Prosperon",
  version:prosperon.version + "-" + prosperon.revision,
  identifier: "world.pockle.prosperon",
  creator: "Pockle World LLC",
  copyright: "Copyright Pockle World 2025",
  type: "game",
  url: "https://prosperon.dev"
})

var ren = prosperon.win.make_renderer("vulkan")

function loop() {
  ren.draw_color([1,1,1,1])

  ren.clear()
  ren.draw_color([0,0,0,1])
  ren.fillrect({x:50,y:50,height:50,width:50})
  ren.present()
  $_.delay(loop, 1/60)
}
loop()

$_.delay($_.stop, 3)

var os = use('os')
var actor = use('actor')
var ioguy = {}
ioguy[cell.actor_sym] = {
  id: actor.ioactor()
}

send(ioguy, {
  type: "subscribe",
  actor: $_
})

$_.receiver(e => {
  if (e.type == 'quit')
    os.exit()
  else
    log.console(json.encode(e))
})
