Optimizing the use of calls to APIs

Updated: April 19, 2023

Device (other than display) drivers are started when they are first needed by a call to an API.

If a driver isn't yet loaded at the time that it's needed by a function call, Screen loads and starts the required driver. Therefore, you might experience pausing or stutter during the time that it takes for the driver to start. To improve the time it takes for your application to start, avoid using in your splash screen application function calls that trigger Screen to start device drivers. For example, avoid making hardware rendering calls because they cause OpenGL ES drivers to start, which are typically slow.

Screen starts only the drivers that are required by a function call. For example, if you make a call that requires only 2D hardware (blitter), then only that device driver is started. However, if you make a call that requires both 2D and 3D hardware rendering, then both the 2D and 3D hardware drivers are started, which can significantly increase the time it takes for your content to show on the display.

See the table below for the drivers that Screen starts, based on the APIs that are used:

Device Driver APIs that trigger Screen to start a driver
2D hardware (blitter) Screen Blit. See note below.

OpenGL ES

OpenGL ES 1.X

OpenGL ES 2.X

OpenGL ES 3.X

OpenVG

OpenCL

EGL

Vulkan

2D hardware (blitter) Screen Blit. See note below.
Display Not applicable

(Screen loads display drivers always when it starts)

Note: Calling screen_flush_blits() or screen_post_window() triggers Screen to start the Blit driver only if screen_blit() or screen_fill() was previously called.