-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path__lib.d.ts
More file actions
68 lines (59 loc) · 1.43 KB
/
Copy path__lib.d.ts
File metadata and controls
68 lines (59 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import * as __ from "shadeup/math";
declare namespace ShadeupFiles {
declare namespace __lib {
export {};
}
}
export declare function makeShadeupInstance(
canvas: HTMLCanvasElement,
options?: {
preferredAdapter?: "webgl" | "webgpu";
limits?: GPUSupportedLimits;
ui?: boolean;
}
): Promise<{
/**
* Set to false to pause
*/
playing: boolean;
canvas: HTMLCanvasElement;
adapter: any;
hooks: {
beforeFrame?: () => void;
afterFrame?: () => void;
reset?: () => void;
}[];
start: () => void;
env: {
camera: {
position: __.float3;
rotation: __.float4;
width: __.float;
height: __.float;
fov: __.float;
near: __.float;
far: __.float;
};
camera2d: {
position: __.float2;
zoom: __.float;
};
deltaTime: __.float;
frame: __.int;
keyboard: any;
mouse: any;
screenSize: __.float2;
time: __.float;
};
/**
* Used to pass values into the shadeup env (accessed as env.input("name") inside)
*/
inputValues: Map<string, any>;
enableUI: () => Promise<void>;
loadTextureFromImageLike: (
img: HTMLImageElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas | HTMLVideoElement
) => Promise<__.texture2d<__.float4>>;
loadTexture2dFromURL: (url: string) => Promise<__.texture2d<__.float4>>;
loadModelFromURL: (urlGltf: string) => Promise<__.texture2d<__.float4>>;
files: typeof ShadeupFiles;
}>;