[oden] Writable Textures and re-work TS API
Now we return Texture objects to make things a little bit more type-safe, at the cost of a small allocation (I hope!)
This commit is contained in:
parent
12cc715873
commit
89045ccbcc
7 changed files with 287 additions and 24 deletions
14
types/graphics-core.d.ts
vendored
14
types/graphics-core.d.ts
vendored
|
|
@ -1,7 +1,9 @@
|
|||
// These are the functions exposed by the native graphics module.
|
||||
//
|
||||
export function cls(r: number, g: number, b: number);
|
||||
|
||||
export function print(msg: string);
|
||||
|
||||
export function spr(
|
||||
x: number,
|
||||
y: number,
|
||||
|
|
@ -12,8 +14,20 @@ export function spr(
|
|||
sw: number,
|
||||
sh: number
|
||||
);
|
||||
|
||||
export function create_texture(
|
||||
buffer: ArrayBuffer,
|
||||
label: string | undefined
|
||||
): number;
|
||||
|
||||
export function use_texture(id: number);
|
||||
|
||||
export function create_writable_texture(
|
||||
width: number,
|
||||
height: number,
|
||||
label: string | undefined
|
||||
): number;
|
||||
|
||||
export function write_to_screen();
|
||||
|
||||
export function write_to_texture(id: number);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue