Clear background
This commit is contained in:
+2
-1
@@ -1,7 +1,7 @@
|
|||||||
import { AssetManager } from "./assets.ts";
|
import { AssetManager } from "./assets.ts";
|
||||||
import { ClientWorld } from "./client_world.ts";
|
import { ClientWorld } from "./client_world.ts";
|
||||||
import { InputManager } from "./input_manager.ts";
|
import { InputManager } from "./input_manager.ts";
|
||||||
import { begin_drawing, end_drawing, init_font, init_window } from "./renderer/mod.ts";
|
import { begin_drawing, clear_background, end_drawing, init_font, init_window } from "./renderer/mod.ts";
|
||||||
|
|
||||||
await import("./blocks/mod.ts");
|
await import("./blocks/mod.ts");
|
||||||
await import("./items/mod.ts");
|
await import("./items/mod.ts");
|
||||||
@@ -39,6 +39,7 @@ export class ClientLoop {
|
|||||||
const delta = (time - this.last_time) / 1000;
|
const delta = (time - this.last_time) / 1000;
|
||||||
|
|
||||||
begin_drawing();
|
begin_drawing();
|
||||||
|
clear_background(0.69, 0.8, 1, 1.0);
|
||||||
this.world.update(delta);
|
this.world.update(delta);
|
||||||
end_drawing();
|
end_drawing();
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export function init_window(canvas_element: HTMLCanvasElement) {
|
|||||||
canvas.width = 1800;
|
canvas.width = 1800;
|
||||||
canvas.height = 900;
|
canvas.height = 900;
|
||||||
|
|
||||||
const ctx = canvas.getContext("webgl2");
|
const ctx = canvas.getContext("webgl2", { antialias: true, alpha: false });
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
throw new Error("WebGL2 not supported");
|
throw new Error("WebGL2 not supported");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user