let GL say Hello World
This commit is contained in:
@@ -1 +0,0 @@
|
||||
console.log("Hello World!")
|
||||
16
src/main.ts
Normal file
16
src/main.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
main();
|
||||
|
||||
function main() {
|
||||
const canvas: HTMLCanvasElement = <HTMLCanvasElement>document.getElementById("window");
|
||||
const gl = canvas.getContext("webgl");
|
||||
|
||||
if (!gl) {
|
||||
alert("Unable to initialize WebGL. Your browser or machine may not support it.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Setze clear color auf schwarz, vollständig sichtbar
|
||||
gl.clearColor(0.0, 1.0, 0.0, 1.0);
|
||||
// Lösche den color buffer mit definierter clear color
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
}
|
||||
Reference in New Issue
Block a user