FabGL
ESP32 Display Controller and Graphics Library

◆ setResolution()

void setResolution ( char const *  modeline,
int  viewPortWidth = -1,
int  viewPortHeight = -1,
bool  doubleBuffered = false 
)
inherited

Sets current resolution using linux-like modeline.

Modeline must have following syntax (non case sensitive):

"label" clock_mhz hdisp hsyncstart hsyncend htotal vdisp vsyncstart vsyncend vtotal (+HSync | -HSync) (+VSync | -VSync) [DoubleScan | QuadScan] [FrontPorchBegins | SyncBegins | BackPorchBegins | VisibleBegins] [MultiScanBlank]

In fabglconf.h there are macros with some predefined modelines for common resolutions. When MultiScanBlank and DoubleScan is specified then additional rows are not repeated, but just filled with blank lines.

Parameters
modelineLinux-like modeline as specified above.
viewPortWidthHorizontal viewport size in pixels. If less than zero (-1) it is sized to modeline visible area width.
viewPortHeightVertical viewport size in pixels. If less then zero (-1) it is sized to maximum allocable.
doubleBufferedif True allocates another viewport of the same size to use as back buffer. Make sure there is enough free memory.

Example:

// Use predefined modeline for 640x480@60Hz
VGAController.setResolution(VGA_640x480_60Hz);

// The same of above using modeline string
VGAController.setResolution("\"640x480@60Hz\" 25.175 640 656 752 800 480 490 492 525 -HSync -VSync");

// Set 640x382@60Hz but limit the viewport to 640x350
VGAController.setResolution(VGA_640x382_60Hz, 640, 350);

Definition at line 331 of file vgabasecontroller.cpp.