Files
splatter-tennis/src/dom.js
T

7 lines
514 B
JavaScript

// Canvas handles — imported by everyone, imports nothing (keeps module cycles harmless).
export const cv = document.getElementById('c');
// alpha:false — render() clears the whole frame to an opaque colour anyway, so declaring the canvas
// opaque lets the compositor skip blending a 2.5-megapixel layer 60 times a second (battery, not
// looks). desynchronized is a further no-op-where-unsupported compositor shortcut (Chrome).
export const ctx = cv.getContext('2d', { alpha: false, desynchronized: true });