Start maybe working on a native app

This commit is contained in:
2026-11-22 17:38:28 -03:00
parent 681d3afb4d
commit a552883795
31 changed files with 1881 additions and 678 deletions
+3 -2
View File
@@ -3,10 +3,11 @@
import { create_texture, device, push_quad, push_quad_vertices, use_texture } from "./core.ts";
import { Texture } from "./types.ts";
import type { Pixels } from "../png.ts";
export function load_texture(image: HTMLImageElement | ImageBitmap): Texture {
export function load_texture(image: Pixels): Texture {
const texture = create_texture(image.width, image.height);
device.queue.copyExternalImageToTexture({ source: image }, { texture }, [image.width, image.height]);
device.queue.writeTexture({ texture }, image.data, { bytesPerRow: image.width * 4 }, [image.width, image.height]);
return {
tex: texture,