[oden] Graphics module can create textures directly

This commit is contained in:
John Doty 2023-06-30 06:28:57 -07:00
parent 4959adc7e6
commit d2dfa7c401
5 changed files with 69 additions and 6 deletions

View file

@ -52,6 +52,19 @@ export function spr(
core.spr(x, y, w, h, sx, sy, sw, sh);
}
/**
* Create a texture based on the loaded buffer.
*
* @param buffer The underlying bytes that make up the texture image.
* @param label The label to put onto the texture (for debugging).
*/
export function create_texture(
buffer: ArrayBuffer,
label: string | undefined = undefined
): number {
return core.create_texture(buffer, label);
}
/**
* Set the specified texture as the current texture for calls to e.g. spr().
*