FabGL
ESP32 Display Controller and Graphics Library

◆ setResolution()

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

Sets TFT resolution and viewport size.

Viewport size can be larger than display size. You can pan the view using TFTController.setScreenCol() and TFTController.setScreenRow().

Parameters
modelineNative display reoslution. Allowed values like TFT_240x240, TFT_240x320...
viewPortWidthVirtual viewport width. Should be larger or equal to display native width.
viewPortHeightVirtual viewport height. Should be larger or equal to display native height.
doubleBufferedif True allocates another viewport of the same size to use as back buffer.

Example:

DisplayController.setResolution(TFT_240x240);

Implements BaseDisplayController.

Examples
ST7789_TFT/240x240/DoubleBuffer/DoubleBuffer.ino, ST7789_TFT/240x240/FileBrowser/FileBrowser.ino, ST7789_TFT/240x240/SimpleTerminalOut/SimpleTerminalOut.ino, and ST7789_TFT/240x240/Sprites/Sprites.ino.

Definition at line 212 of file TFTControllerGeneric.cpp.