MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / loadTextureAsync

Function loadTextureAsync

src/textures/index.ts:121–127  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

119declare function bloom_get_render_texture_texture(handle: number): number;
120
121export async function loadTextureAsync(path: string): Promise<Texture> {
122 const stagingHandle = await spawn(() => bloom_stage_texture(path as any));
123 const id = bloom_commit_texture(stagingHandle);
124 const width = bloom_get_texture_width(id);
125 const height = bloom_get_texture_height(id);
126 return { id, width, height };
127}
128
129export function stageTextures(paths: string[]): number[] {
130 return parallelMap(paths, (path: string) => bloom_stage_texture(path as any));

Callers

nothing calls this directly

Calls 4

bloom_stage_textureFunction · 0.50
bloom_commit_textureFunction · 0.50
bloom_get_texture_widthFunction · 0.50
bloom_get_texture_heightFunction · 0.50

Tested by

no test coverage detected