... | @@ -34,22 +34,32 @@ Generally, we can use one of the following ways to eliminate this flicker: |
... | @@ -34,22 +34,32 @@ Generally, we can use one of the following ways to eliminate this flicker: |
|
same as the first method.
|
|
same as the first method.
|
|
1. Use the new synchronous update mechanism introduced in MiniGUI 3.2.x.
|
|
1. Use the new synchronous update mechanism introduced in MiniGUI 3.2.x.
|
|
|
|
|
|
This documents describes how to use the synchronous update mechanism to
|
|
This documents describes how to use the new synchronous update mechanism
|
|
reduce the screen flicker.
|
|
to reduce the screen flicker.
|
|
|
|
|
|
## Principle
|
|
## Principle
|
|
|
|
|
|
|
|
Essentially, the new synchronous update mechanism uses a shadow frame
|
|
|
|
buffer for MiniGUI, and refresh the content that needs to be updated to
|
|
|
|
the screen at one time, by calling `SyncUpdateDC` function.
|
|
|
|
|
|
|
|
In this way, we do not need to create and destroy memory DC frequently,
|
|
|
|
so we will get a certain degree of performance improvement.
|
|
|
|
And the MiniGUI app's code can keep as simple as possible.
|
|
|
|
In other words, we can improve the maintainability of the code as well.
|
|
|
|
|
|
## Usage
|
|
## Usage
|
|
|
|
|
|
- Including option `--enable-syncupdate` when configuring MiniGUI.
|
|
- Including option `--enable-syncupdate` when configuring MiniGUI.
|
|
- Using a shadow NEWGAL engine and implementing `UpdateRects` method
|
|
- Using a shadow-like NEWGAL engine and implementing `UpdateRects` method
|
|
of your NEWGAL engine to update the dirty regions to your real
|
|
of your NEWGAL engine to update the dirty regions to your real
|
|
screen frame buffer.
|
|
screen frame buffer.
|
|
- Calling `SyncUpdateDC(HDC_SCREEN)` when you want to update the
|
|
- Calling `SyncUpdateDC(HDC_SCREEN)` when you want to update the
|
|
screen. Generally, you can call this function after calling `EndPaint`
|
|
screen. Generally, you can call this function after calling `EndPaint`
|
|
function when handling `MSG_PAINT` message.
|
|
function when handling `MSG_PAINT` message.
|
|
|
|
|
|
|
|
## Sample
|
|
|
|
|
|
## Restrictions
|
|
## Restrictions
|
|
|
|
|
|
The synchronous update mechanism provides an easy way to reduce
|
|
The synchronous update mechanism provides an easy way to reduce
|
... | | ... | |