Multiple Buffering

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Multiple Buffering

    Hello.
    Tell me what is more efficient to use for Multiple Buffering:

    VM_MULTIBUF_Enable (1);

    or for each dialog, window

    static void _cbStatus(WM_MESSAGE * pMsg)
    {
    ...
    switch (pMsg->MsgId)
    {
    case WM_PRE_PAINT:
    GUI_MULTIBUF_Begin();
    break;
    case WM_POST_PAINT:
    GUI_MULTIBUF_End();
    break; ...
    }
    }

    The post was edited 1 time, last by Raash ().

  • Hi,

    The first one will be more efficient.

    The second one will cause copy operations for front and back buffers each time the corresponding window gets redrawn. With multiple windows using this method lots of unnecessary copy operations will be performed.

    The method with WM_MULTIBUF_Enable(1) will cause one copy operation for the front/back buffer, draw all invalid windows and show the updated buffer.

    Regards
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • HI,

    Each buffer has to be large enough keep data for the whole display. It gets placed into the same area as the framebuffer. The different buffers have to be placed consecutively.

    When allocating memory for the framebuffer (including memory for multi buffering) you can calculate it like this:

    LCD_X_SIZE * LCD_Y_SIZE * BYTES_PER_PIXEL * NUM_BUFFERS

    Regards
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi,

    Of course you can use Memory Devices with multibuffering.

    If multibuffering is enabled you can not use virtual screens.

    Regards
    Sven
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.