Files
cell/tests/sdl_video.js
John Alanbrook db1afb6477
Some checks failed
Build and Deploy / build-macos (push) Failing after 6s
Build and Deploy / build-windows (CLANG64) (push) Has been cancelled
Build and Deploy / package-dist (push) Has been cancelled
Build and Deploy / deploy-itch (push) Has been cancelled
Build and Deploy / deploy-gitea (push) Has been cancelled
Build and Deploy / build-linux (push) Has been cancelled
drop message sends if message has no return instead of throw error
2025-05-26 09:27:58 -05:00

28 lines
716 B
JavaScript

var video = use('sdl_video')
var window
var renderer
var act = {__ACTORDATA__:{id:video}}
function handle_response(data)
{
if (data.error)
console.log(json.encode(data))
}
send(act, {kind:"window", op: "create"}, ({id}) => {
window = id
console.log(`made window id ${id}`)
send(act, {kind:"window", op:"makeRenderer", id: window}, ({id}) => {
renderer = id
console.log(`made renderer with id ${id}`)
send(act, {kind:"renderer", id: renderer, op:"set", prop: "drawColor", value:[0.6,0.4,0.5,1]})
send(act, {kind:"renderer", id: renderer, op:"clear"}, handle_response)
send(act, {kind:"renderer", id: renderer, op: "present"}, handle_response)
})
})
$_.delay($_.stop, 2)