forked from sketchpunk/FunWithWebGL2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfungiApp.js
32 lines (26 loc) · 978 Bytes
/
fungiApp.js
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
FungiApp = {
renderLoop :null,
mainCamera :null,
ctrlCamera :null,
debugLines :null,
gridFloor :null,
uboTransform :null,
lblFPS :null,
scene :[],
startup:function(){
Fungi.Init("FungiCanvas").fClearColor("FFFFFF").fFitScreen(1,1).fClear();
this.uboTransform = Fungi.Shaders.UBO.createTransformUBO();
this.mainCamera = new Fungi.CameraOrbit().setPosition(0,0.5,5).setEulerDegrees(-15,45,0);
this.ctrlCamera = new Fungi.KBMCtrl().addHandler("camera",new Fungi.KBMCtrl_Viewport(this.mainCamera),true);
this.renderLoop = new Fungi.RenderLoop(onRender);
this.debugLines = Fungi.Debug.Lines.getRenderable().update();
this.gridFloor = Fungi.Debug.GridFloor.getRenderable()
this.scene.push(this.debugLines,this.gridFloor);
this.lblFPS = document.getElementById("lblFPS");
setInterval(function(){ FungiApp.lblFPS.innerHTML = FungiApp.renderLoop.fps; },200);
},
update:function(){
this.mainCamera.update();
Fungi.gl.fClear();
}
};