8 lines
351 B
TypeScript
8 lines
351 B
TypeScript
import type { RgbaColor, ScreenRect, WebGlRendererContext } from "./types";
|
|
|
|
export function clearScreenRect(context: WebGlRendererContext, rect: ScreenRect, color: RgbaColor) {
|
|
context.gl.scissor(rect.x, context.canvas.height - rect.y - rect.h, rect.w, rect.h);
|
|
context.gl.clearColor(...color);
|
|
context.gl.clear(context.gl.COLOR_BUFFER_BIT);
|
|
}
|