« All posts

Limn Engine: display.perform() and the hidden fake canvas

Limn Engine's advanced guide explains display.perform(), the dual-canvas rendering pipeline, and why TileMap rendering depends entirely on it.

The 'Level 4: 10x Developer' guide for Limn Engine dives into display.perform(), one of the engine's most consequential internal calls. Invoking it replaces the default setInterval game loop with requestAnimationFrame, producing a loop synced to the monitor's refresh rate and accurate deltaTime values derived from live, high-precision frame timestamps. Crucially, perform() also spins up a hidden second Display instance, activating the engine's dual-canvas rendering pipeline.

This hidden buffer, the 'fake canvas,' caches static content—backgrounds, tiles, fixed decorations—by drawing it once instead of every frame. Rather than issuing thousands of individual draw calls for tiles each frame, the engine blits a single cached image onto the main canvas, while dynamic objects like the player, enemies, and bullets are still redrawn normally on top. A display.once flag governs exactly when this cache gets rebuilt, keeping the whole scheme efficient.

A key takeaway from the guide is that the TileMap system simply will not render without display.perform() being called first, since tiles are drawn to the fake canvas that only perform() creates. Developers who skip this step can set up their levels correctly yet see nothing on screen. Understanding this internal architecture matters for anyone optimizing open-world, multiplayer, or mobile Limn Engine projects for performance.

» SourceDev.to