mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-18 14:19:30 -07:00
Double click now toggles full screen. Delayed initializing regl until the camera is set up, so its start time comes after the visitor closes the browser prompt
This commit is contained in:
@@ -44,21 +44,25 @@ export default async (canvas, config) => {
|
||||
canvas.height = Math.ceil(canvas.clientHeight * config.resolution);
|
||||
};
|
||||
window.onresize = resize;
|
||||
// if (document.fullscreenEnabled || document.webkitFullscreenEnabled) {
|
||||
// window.onclick = () => {
|
||||
// if (document.fullscreenElement == null) {
|
||||
// if (canvas.webkitRequestFullscreen != null) {
|
||||
// canvas.webkitRequestFullscreen();
|
||||
// } else {
|
||||
// canvas.requestFullscreen();
|
||||
// }
|
||||
// } else {
|
||||
// document.exitFullscreen();
|
||||
// }
|
||||
// };
|
||||
// }
|
||||
if (document.fullscreenEnabled || document.webkitFullscreenEnabled) {
|
||||
window.ondblclick = () => {
|
||||
if (document.fullscreenElement == null) {
|
||||
if (canvas.webkitRequestFullscreen != null) {
|
||||
canvas.webkitRequestFullscreen();
|
||||
} else {
|
||||
canvas.requestFullscreen();
|
||||
}
|
||||
} else {
|
||||
document.exitFullscreen();
|
||||
}
|
||||
};
|
||||
}
|
||||
resize();
|
||||
|
||||
if (config.useCamera) {
|
||||
await setupCamera();
|
||||
}
|
||||
|
||||
const regl = createREGL({
|
||||
canvas,
|
||||
extensions: ["OES_texture_half_float", "OES_texture_half_float_linear"],
|
||||
@@ -68,10 +72,6 @@ export default async (canvas, config) => {
|
||||
|
||||
const lkg = await getLKG(config.useHoloplay, true);
|
||||
|
||||
if (config.useCamera) {
|
||||
await setupCamera();
|
||||
}
|
||||
|
||||
// All this takes place in a full screen quad.
|
||||
const fullScreenQuad = makeFullScreenQuad(regl);
|
||||
const effectName = config.effect in effects ? config.effect : "plain";
|
||||
|
||||
Reference in New Issue
Block a user