ESP32 Display Controller and Graphics Library
FabGL Library

www.FabGL.com - 2019-2022 by Fabrizio Di Vittorio (fdivi.nosp@m.tto2.nosp@m.013@g.nosp@m.mail.nosp@m..com)

Demos and Tutorials

FabGL is mainly a Graphics Library for ESP32. It implements several display drivers (for direct VGA output and for I2C and SPI LCD drivers).
FabGL can also get input from a PS/2 Keyboard and a Mouse. ULP core handles PS/2 ports communications, leaving main CPU cores free to perform other tasks.
FabGL also implements: an Audio Engine, a Graphical User Interface (GUI), a Game Engine and an ANSI/VT Terminal.

This library works with ESP32 revision 1 and upper.

VGA output requires a digital to analog converter (DAC): it can be done by three 270 Ohm resistors to have 8 colors, or by 6 resistors to have 64 colors.

There are several fixed and variable width fonts embedded.

Unlimited number of sprites are supported. However big sprites and a large amount of them reduces the frame rate and could generate flickering.

When there is enough memory (on low resolutions like 320x200), it is possible to allocate two screen buffers, so to implement double buffering.
In this case primitives are always drawn on the back buffer.

Except for double buffering or when explicitly disabled, all drawings are performed on vertical retracing (using VGA driver), so no flickering is visible.
If the queue of primitives to draw is not processed before the vertical retracing ends, then it is interrupted and continued at next retracing.

There is a graphical user interface (GUI) with overlapping windows and mouse handling and a lot of widgets (buttons, editboxes, checkboxes, comboboxes, listboxes, etc..).

Finally, there is a sound engine, with multiple channels mixed to a mono output. Each channel can generate sine waveforms, square, etc... or custom sampled data.
Audio output, like VGA output, is generated using DMA. CPU just mixes audio channels and prepares waveforms.

Main classes of FabGL library:

Devices emulation classes:

Other classes:

See VGA output for VGA connection sample schema.

See PS/2 ports for PS/2 connections sample schema.

See Configuring Audio port for audio connection sample schema.

Installation Tutorial

IBM PC Emulator Example

Space Invaders Example

Graphical User Interface - GUI Example

Audio output demo

Serial terminal connected to MBC2 Z80 board

Simple Terminal Out Example

Altair 8800 Emulator

Commodore VIC20 Emulator

Network Terminal Example

Modeline Studio Example

Loopback Terminal Example

Double Buffering Example

Collision Detection Example

Multitasking CP/M Plus Example

Created by Fabrizio Di Vittorio (fdivi.nosp@m.tto2.nosp@m.013@g.nosp@m.mail.nosp@m..com) - http://www.fabgl.com Copyright (c) 2019-2022 Fabrizio Di Vittorio. All rights reserved.

FabGL is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

FabGL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with FabGL. If not, see http://www.gnu.org/licenses/.