|
|
_How to use MiniGUI's synchronous update mechanism to reduce screen flicker._
|
|
|
|
|
|
## Introduction
|
|
|
Table of Contents
|
|
|
|
|
|
## Key Points
|
|
|
- [Overview](#overview)
|
|
|
- [Usage](#usage)
|
|
|
- [Restrictions](#restrictions)
|
|
|
|
|
|
## Overview
|
|
|
|
|
|
TBC... |
|
|
## Usage
|
|
|
|
|
|
- Including option `--enable-syncupdate` when configuring MiniGUI.
|
|
|
- Using a shadow NEWGAL engine and implementing `UpdateRects` method
|
|
|
of your NEWGAL engine to update the dirty regions to your real
|
|
|
screen frame buffer.
|
|
|
- Calling `SyncUpdateDC(HDC_SCREEN)` when you want to update the
|
|
|
screen. Generally, you can call this function after calling `EndPaint`
|
|
|
function when handling `MSG_PAINT` message.
|
|
|
|
|
|
## Restrictions
|
|
|
|
|
|
The synchronous update mechanism provides an easy way to reduce
|
|
|
the screen flicker. However, it has the following restrictions:
|
|
|
|
|
|
- It only works with low resolution.
|
|
|
- It may hide a lot of inefficient code in your MiniGUI app.
|
|
|
- It lacks support for hardware acceleration.
|
|
|
|
|
|
Therefore, for modern graphics stack (system shipped with a GPU),
|
|
|
the better way is using off-screen surface and exploiting the
|
|
|
hardware acceleration as far as possible. |