A raylib profile with platform = "web" links raylib's PLATFORM_WEB library (GLES2 on WebGL 1, with rmodels) and the PLATFORM_WEB host through Emscripten with ASYNCIFY, so default and custom hosts keep their while PollRaylib() loop. assets and the new preload key mount project directories in the page's file system, and the page lands as index.html/js/wasm/data in build/NAME-PROFILE/. WebP decodes with the authored engine there; AVIF stays native-only. make raylib-web-project-test checks a 3D cube under Kryon UI in private headless Chromium.
26 lines
922 B
HTML
26 lines
922 B
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>Kryon Ziran</title>
|
|
<style>
|
|
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #f8fafc; overscroll-behavior: none; }
|
|
canvas { display: block; width: 100%; height: 100%; outline: none; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<canvas id="canvas" tabindex="0" oncontextmenu="event.preventDefault()"></canvas>
|
|
<script>
|
|
// raylib's PLATFORM_WEB host draws into #canvas. The page records how the
|
|
// program ended in data-kryon for tests and embedding pages.
|
|
var Module = {
|
|
canvas: document.getElementById("canvas"),
|
|
onExit: function(code) { document.body.dataset.kryon = "exit " + code; },
|
|
onAbort: function(reason) { document.body.dataset.kryon = "abort " + reason; }
|
|
};
|
|
</script>
|
|
{{{ SCRIPT }}}
|
|
</body>
|
|
</html>
|