improve index
This commit is contained in:
parent
f1622d49f4
commit
ea4210526d
5 changed files with 15 additions and 10 deletions
|
@ -29,7 +29,7 @@ ul {
|
|||
margin: 0;
|
||||
padding-left: 3rem;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-direction: column;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ export class App {
|
|||
this.canvas = document.querySelector("canvas");
|
||||
this.canvas.width = window.innerWidth;
|
||||
this.canvas.height = window.innerHeight;
|
||||
this.gl = this.canvas.getContext("webgl");
|
||||
this.gl = this.canvas.getContext("webgl2");
|
||||
|
||||
if (this.gl === null) {
|
||||
document.querySelector(
|
||||
|
|
|
@ -12,12 +12,12 @@ export class Shader {
|
|||
this.gl.shaderSource(shader, source);
|
||||
this.gl.compileShader(shader);
|
||||
|
||||
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {
|
||||
throw new Error(
|
||||
"An error occurred compiling the shaders: " +
|
||||
this.gl.getShaderInfoLog(shader)
|
||||
);
|
||||
}
|
||||
// if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {
|
||||
// throw new Error(
|
||||
// "An error occurred compiling the shaders: " +
|
||||
// this.gl.getShaderInfoLog(shader)
|
||||
// );
|
||||
// }
|
||||
|
||||
this.gl.attachShader(this.program, shader);
|
||||
|
||||
|
|
|
@ -30,7 +30,12 @@ export class Telemetry {
|
|||
const framesPerSecond = 1000 / averageFrameTime;
|
||||
|
||||
this.el.innerHTML = `
|
||||
${framesPerSecond.toFixed(1)} FPS (${averageFrameTime.toFixed(3)} ms)
|
||||
${framesPerSecond.toFixed(1)} FPS (${averageFrameTime.toFixed(
|
||||
3
|
||||
)} ms)<br />
|
||||
bU: ${this.app.registry.onBeforeUpdate.length} | U: ${
|
||||
this.app.registry.onUpdate.length
|
||||
} | aU: ${this.app.registry.onAfterUpdate.length}
|
||||
`;
|
||||
|
||||
this.lastFrameTime = this.app.now();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "noeidelon",
|
||||
"type": "module",
|
||||
"main": "./generators/generate.js",
|
||||
"main": "./generators/generate.ts",
|
||||
"scripts": {
|
||||
"build": "bun $BUNFLAGS ./generators/generate.ts",
|
||||
"build:watch": "BUNFLAGS=--watch bun run build",
|
||||
|
|
Loading…
Add table
Reference in a new issue