emWin GUI_MULTIBUF_Begin without buffer copy

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

    • emWin GUI_MULTIBUF_Begin without buffer copy

      Hi All

      I am using multiple buffers to perform drawing operations using GUI_MULTIBUF_Begin() and GUI_MULTIBUF_End() which works as expected. In my application before every frame that is drawn, the screen (buffer) is cleared using GUI_Clear(). As a result the buffer copy operation in GUI_MULTIBUF_Begin() is of no use and takes up valuable time. Is it possible for me to avoid doing this copy operation, perhaps by implementing my own version of the GUI_MULTIBUF_Begin function?


      I am using libSTemWin_CM7_wc32.a GUI_VERSION 54401.


      Thanks in advance.

      Justin
    • Hi,

      you can set your own copy-buffer-function. In this function you simply do nothing.

      C Source Code

      1. static void _LCD_CopyBuffer(int LayerIndex, int IndexSrc, int IndexDst) {
      2. GUI_USE_PARA(LayerIndex);
      3. GUI_USE_PARA(IndexSrc);
      4. GUI_USE_PARA(IndexDst);
      5. }
      6. LCD_SetDevFunc(0, LCD_DEVFUNC_COPYBUFFER, (void(*)(void))_LCD_CopyBuffer);

      You can call the LCD_SetDevFunc() at the end of LCD_X_Config().

      Regards,
      Sven