The
-gfx3 option selects gfxlib3 instead of the default gfxlib2 runtime and defines
__FB_GFXLIB3__ before the source is parsed. The compiler does this by pre-including
fbgfx3-option.bi. Applications normally use
-gfx3 or define the selector directly instead of including that small internal selection header. It is equivalent to defining the selector before the first inclusion of
fbgfx.bi.
The compiler records the selection in object metadata, so a separately compiled object carries the correct normal, multithreaded, PIC, or multithreaded PIC gfxlib3 dependency into the final link.
gfxlib3 supplies windowed backends for Windows, Linux/X11, Linux SDL2 KMSDRM, and Android, plus the headless Null backend. Desktop mode selection tries Vulkan first and then OpenGL. Linux KMSDRM and Android use OpenGL ES 3.0. A program can request a specific renderer with the corresponding constants from
fbgfx.bi.
gfxlib3 and gfxlib2 must not be linked into one process. Their public graphics entry points and process-global state are alternatives, not an interoperability boundary.