[oden] Graphics module can create textures directly
This commit is contained in:
parent
4959adc7e6
commit
d2dfa7c401
5 changed files with 69 additions and 6 deletions
|
|
@ -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().
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue