Fixed bundle bugs.
This commit is contained in:
44
ts/main.ts
44
ts/main.ts
@ -1,7 +1,49 @@
|
||||
import { Game, gameSetMain } from "./game/Game";
|
||||
import { Scene } from "./scene/Scene";
|
||||
|
||||
class TestScene extends Scene {
|
||||
private quad:Primitive;
|
||||
private camera:Camera;
|
||||
private shader:Shader;
|
||||
private texture:Texture;
|
||||
|
||||
init() {
|
||||
this.quad = primitiveCreate();
|
||||
quadInit(this.quad, 0,
|
||||
-1, -1, 0, 0,
|
||||
1, 1, 1, 1
|
||||
);
|
||||
|
||||
this.shader = shaderCreate();
|
||||
assetShaderLoad(this.shader,
|
||||
"shaders/textured.vert",
|
||||
"shaders/textured.frag"
|
||||
);
|
||||
|
||||
this.camera = cameraCreate();
|
||||
cameraLookAt(this.camera, 3,3,3, 0,0,0);
|
||||
cameraPerspective(this.camera, 45, 16/9, 0.01, 1000);
|
||||
|
||||
this.texture = textureCreate();
|
||||
assetTextureLoad(this.texture, "test_texture.png");
|
||||
}
|
||||
|
||||
update() {
|
||||
shaderUse(this.shader);
|
||||
shaderUseCamera(this.shader, this.camera);
|
||||
shaderUsePosition(this.shader, 0,0,0, 0,this.game.time.current,0);
|
||||
primitiveDraw(this.quad, 0, -1);
|
||||
}
|
||||
|
||||
dispose() {
|
||||
}
|
||||
}
|
||||
|
||||
class MainGame extends Game {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.setScene(new TestScene(this));
|
||||
}
|
||||
}
|
||||
|
||||
gameSetMain(new MainGame());
|
Reference in New Issue
Block a user