Compiler Option: -gfx3
 
Selects the opt-in gfxlib3 GPU graphics runtime.

Syntax

-gfx3

Description

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 currently supplies windowed backends for Windows, Linux/X11, and Android, plus the headless Null backend. Desktop mode selection tries Vulkan first and then OpenGL. Android uses OpenGL ES when Vulkan is unavailable. 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.

Example

' Compile with: fbc -gfx3 program.bas
ScreenRes 640, 480, 32
Line (0, 0)-(639, 479), RGB(32, 96, 192), bf
Sleep


A source-level selection is also possible:

#define __FB_GFXLIB3__
#include Once "fbgfx.bi"


Programs that need the GPU-resident surface extensions can include fbgfx3.bi, which selects gfxlib3 automatically.

See also