Display double buffering

Hi,
I'm using library GFX for Arduino v1.5.2 on an ESP32-S3 with an RGB panel.

My application needs a reasonably complicated display with moving pointers. The pointers are graphical objects (mostly bitmaps) rather than simple lines.
I have some code that uses lots of floating point maths to display the pointer at an arbitrary angle. The screen has to be completely redrawn when the pointer angle changes. This has associated flicker.

I cannot find double buffering techniques for use with this library, so my approach so far has been to create and off-screen image in a buffer. I've then created a separate GDMA linked list to display this buffer, and swap from the original linked list to the new one. The GFX library functions will now be operating on the original image memory (which is now not displayed). When the redrawing has been done, then the linked lists are swapped and instantly (OK, the next frame) the redrawn image is displayed.
Then I copy the main image into the off-screen buffer, and again swap the linked lists to display that buffer. So, no flicker.
Rinse and repeat.

It works, but seems overly complicated. I know I need the off-screen buffer, but what GFX library can work on multiple frame buffers?

Try LovyanGFX, TFT_eSPI (with Sprites), or LVGL, as they support multiple frame buffers on ESP32-S3. If using PSRAM, ensure the buffer fits. DMA2D can help with faster rendering. Meanwhile, you can watch free movies online on FreeCine to relax.

I suspect you mean the adafruit library, but if you provide a link to what you are actually using that does help.

Doesn't seem that complex, it is after all just the changing of pointers.

The header file for the library says it's a re-write from Adafruit, and is described in the library manager tab as "GFX Library for Arduino" by moon on our nation.
Oh, I'm using the Arduino IDE 2.3.4.

Yeah, I guess it's not that complicated once the linked list has been set up and memory reserved for the "off-screen" buffer. As you say, it's only a pointer change.

Still al ink to the github repository would be easier for me to have a look.

The GFX library probably uses virtual void functions for drawPixel() which the hardware specific liibrary then implements. So most likely the GFX library may not actually be the correct place to look.

IDE version is (and should be) completely irrelevant. ESP32 core version might be relevant though but i doubt it is in this case.

Clicking more info gives: GFX Library

Great and the code ? because how you actually write and to what is relevant i guess. Still i doubt if there is all that much room for improvement.

This is the rotate bitmap code (that I found on these forums - I think).
I've actually just tested it and it does not give a perfect result.
If I rotate a simple rectangle, for example, then there are missing pixels. I thought that might happen. It's all to do with looping through the source image, and not the destination.

void drawRotatedBitmap(int16_t x, int16_t y, const uint8_t *bitmap, uint16_t angle) {

  uint8_t w = pgm_read_byte(bitmap++);
  uint8_t h = pgm_read_byte(bitmap++);

  int16_t rotatedx, rotatedy;
  uint8_t data = 0;

  float  cosa = cos(angle * 0.0174532925), sina = sin(angle * 0.0174532925);

  x = x - ((w * cosa / 2) - (h * sina / 2));
  y = y - ((h * cosa / 2) + (w * sina / 2));

  for (int16_t j = 0; j < h; j++) {
    for (int16_t i = 0; i < w; i++ ) {
      if ((j * w + i) & 7) data <<= 1;
      else      data   = pgm_read_byte(bitmap++);

      rotatedx = 0.5 + x + ((i * cosa) - (j * sina));
      rotatedy = 0.5 + y + ((j * cosa) + (i * sina));

      if (data & 0x80) tft.drawPixel(rotatedx, rotatedy, ST7735_WHITE);
      //else            display.drawPixel(newx, newy, 0);
    }
  }
}