Skip to content

Renderers

Introduction

Deft comes with the following 3 renderers.

NameDescriptionSupport Platforms
SoftBufferCPU renderingWindows/MacOS/Linux
GLGPU renderingWindows/MacOS/Linux/Android
SoftGLCPU rendering, GPU presentationWindows/MacOS/Linux/Android

Usually, GL renderer has better performance, but consumes more memory, and SoftGL is suitable for scenarios where SoftBuffer is not supported but still want to use CPU rendering.

By default, Deft will automatically match a renderer based on the order in the table. If you want to change the default matching order, you can set it as follows.

  1. Create a window and specify the preferredRenderers parameter, for example:
    const window = new Window({
    // prioritize use GL renderers
    preferredRenderers: ["GL", "SoftBuffer"]
    });
  2. Set the DEFT_RENDERERS environment variable, which will take effect for all Deft applications, for example:
    export DEFT_RENDERERS=GL,SoftBuffer