FabGL
ESP32 VGA Controller and Graphics Library
FabGL Library

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


This is a VGA Controller, PS/2 Keyboard and Mouse Controller, Graphics Library, Audio Engine, Graphical User Interface (GUI), Game Engine and ANSI/VT Terminal for the ESP32.
This library works with ESP32 revision 1 or 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.

Three fixed width fonts are embedded to best represents 80x25 or 132x25 text screen, at 640x350 resolution. However other fonts are embedded, even with variable width.

Sprites can have up to 64 colors (RGB, 2 bits per channel + transparency).
A sprite has associated one o more bitmaps, even of different size. Bitmaps (frames) can be selected in sequence to create animations.
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 drawing primitives always draw on the back buffer.

Except for double buffering or when explicitly disabled, all drawings are performed on vertical retracing, 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.


The main classes of FabGL library are:

See Configuring VGA outputs for VGA connection sample schema.

See Configuring PS/2 port for PS/2 connection sample schema.

See Configuring Audio port for audio connection sample schema.


Space Invaders Example


Graphical User Interface - GUI Example


Audio output demo


Simple Terminal Out Example


Altair 8800 Emulator


Network Terminal Example


Modeline Studio Example


Loopback Terminal Example


Double Buffering Example


Collision Detection 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 Fabrizio Di Vittorio.
All rights reserved.

This file is part of FabGL Library.

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/.