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;
|
margin: 0;
|
||||||
padding-left: 3rem;
|
padding-left: 3rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: column;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ export class App {
|
||||||
this.canvas = document.querySelector("canvas");
|
this.canvas = document.querySelector("canvas");
|
||||||
this.canvas.width = window.innerWidth;
|
this.canvas.width = window.innerWidth;
|
||||||
this.canvas.height = window.innerHeight;
|
this.canvas.height = window.innerHeight;
|
||||||
this.gl = this.canvas.getContext("webgl");
|
this.gl = this.canvas.getContext("webgl2");
|
||||||
|
|
||||||
if (this.gl === null) {
|
if (this.gl === null) {
|
||||||
document.querySelector(
|
document.querySelector(
|
||||||
|
|
|
@ -12,12 +12,12 @@ export class Shader {
|
||||||
this.gl.shaderSource(shader, source);
|
this.gl.shaderSource(shader, source);
|
||||||
this.gl.compileShader(shader);
|
this.gl.compileShader(shader);
|
||||||
|
|
||||||
if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {
|
// if (!this.gl.getShaderParameter(shader, this.gl.COMPILE_STATUS)) {
|
||||||
throw new Error(
|
// throw new Error(
|
||||||
"An error occurred compiling the shaders: " +
|
// "An error occurred compiling the shaders: " +
|
||||||
this.gl.getShaderInfoLog(shader)
|
// this.gl.getShaderInfoLog(shader)
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
this.gl.attachShader(this.program, shader);
|
this.gl.attachShader(this.program, shader);
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,12 @@ export class Telemetry {
|
||||||
const framesPerSecond = 1000 / averageFrameTime;
|
const framesPerSecond = 1000 / averageFrameTime;
|
||||||
|
|
||||||
this.el.innerHTML = `
|
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();
|
this.lastFrameTime = this.app.now();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "noeidelon",
|
"name": "noeidelon",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./generators/generate.js",
|
"main": "./generators/generate.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "bun $BUNFLAGS ./generators/generate.ts",
|
"build": "bun $BUNFLAGS ./generators/generate.ts",
|
||||||
"build:watch": "BUNFLAGS=--watch bun run build",
|
"build:watch": "BUNFLAGS=--watch bun run build",
|
||||||
|
|
Loading…
Add table
Reference in a new issue