FabGL
ESP32 VGA Controller and Graphics Library
|
void fabgl::VGAControllerClass::setResolution | ( | char const * | modeline, |
int | viewPortWidth = -1 , |
||
int | viewPortHeight = -1 , |
||
bool | doubleBuffered = false |
||
) |
Set 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] [FrontPorchBegins | SyncBegins | BackPorchBegins | VisibleBegins]
In fabglconf.h there are macros with some predefined modelines for common resolutions.
modeline | Linux-like modeline as specified above. |
viewPortWidth | Horizontal viewport size in pixels. If less than zero (-1) it is sized to modeline visible area width. |
viewPortHeight | Vertical viewport size in pixels. If less then zero (-1) it is sized to maximum allocable. |
doubleBuffered | if 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);