Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/caviar/src/renderers/webgl/2d.ts>WebGLRenderer2D

⚡ Blazing fast, modern, Game Engine powered by WebGPU for Deno and the browser
Go to Latest
class WebGLRenderer2D
import { WebGLRenderer2D } from "https://deno.land/x/caviar@2.1.7/src/renderers/webgl/2d.ts";

Constructors

new
WebGLRenderer2D(canvas: Canvas)

Properties

private
backgroundColor: RGBA
private
buffers: Map<string, EntityBuffers>
private
location: ProgramInfo2d
private
program: WebGLProgram
eventManager: EventManager

Methods

private
_render(entity: Entity): void
private
_start(entity: Entity): void
private
colorNorm(rgba: RGBA): RGBA
private
renderImage(entity: Image | AtlasSprite | Sprite): void
private
renderRectangle(entity: Rectangle): void
private
setupImage(entity: Image | AtlasSprite): void
private
setupRectangle(entity: Rectangle): void
render(entities: Entity[]): void
setBackground(color: RGBA): void
start(entities: Entity[]): void