Beispiel #1
0
repeat(tpf => {
	get('device').tpf = tpf
	dispatch(events.PROCESS_PAINT)
	dispatch(events.FRAME)
	painter.compose(automaton).display(automaton)
	dispatch(events.CLEANUP_PAINT)
}, 'loop')
Beispiel #2
0
repeat(tpf => {
	get('device').tpf = tpf
	dispatch(events.FRAME)
	painter
		.compose(
			scene,
			light,
		)
		.display(light)
}, 'loop')
Beispiel #3
0
repeat(tpf => {
	get('device').tpf = tpf
	dispatch(events.FRAME)
	painter.compose(main).display(main)
}, 'loop')
Beispiel #4
0
import './state/screens'
import './viewport'

import { dispatch, get } from 'shared-utils/painterState'
import { repeat } from 'shared-utils/scheduler'
import { events, painter } from './context'
import {
	mirrorScene,
	scene,
	videoLights,
	videoTextureData,
	videoTextures,
} from './renderer'
import { videos } from './state/videos'

const d = get('device')
d.sizeMultiplier = 1.5

videos.then(vs => {
	function startVideos() {
		vs.forEach(v => v.play())
		d.canvas.removeEventListener('mousedown', startVideos)
		d.canvas.removeEventListener('touchstart', startVideos)
	}
	d.canvas.addEventListener('mousedown', startVideos)
	d.canvas.addEventListener('touchstart', startVideos)

	repeat(tpf => {
		d.tpf = tpf
		dispatch(events.FRAME)
		videoTextures.forEach((t, i) =>