|
Post by kalev on Nov 25, 2016 23:27:26 GMT -8
Hello.
I'm beginner on GD2 ( not in programming ). I try to figure out is it possible to manipulate already activated display list. I know how to do that with pixmaps described in display list. Particulary my display list consist of many builtin widgets one of them is toggle. Can I change the toggle state without writing all display list again.
kalev
|
|
|
Post by jamesbowman on Nov 26, 2016 12:31:11 GMT -8
Well, the general idea with EVE (as in OpenGL) is that you recreate everything for every frame.
This might seem like it would be slow, but the drawing commands execute very quickly, so redrawing the whole screen usually takes under 1/1000th of second. Even the builtin widgets draw very quickly; the Arduino just sends a few bytes over SPI and the EVE draws the entire widget.
|
|
|
Post by kalev on Nov 27, 2016 0:13:32 GMT -8
Thank you James.
But still just for understanding.
1. What happens with display list(dl) during swap. In FTDI doc was said that prepared dl will be active(visible) and currently visible dl become "new". So before cmd_dlstart "new" dl should consist of previously visible dl.
See code from GD library. void GDClass::swap(void) { Display(); cmd_swap(); cmd_loadidentity(); cmd_dlstart(); GDTR.flush(); }
I tried following code:
GD.cmd_dlstart(); GD.ClearColorRGB(170, 170, 0); GD.Clear(1, 1, 1); GD.ColorRGB(255, 255, 255); GD.cmd_bgcolor(0x0055FF); GD.cmd_gauge(150, 140, 80, OPT_FLAT | OPT_NOTICKS | OPT_NOPOINTER, 5, 5, 500, 1000); GD.swap(); GD.ColorRGB(255, 255, 255); GD.cmd_bgcolor(0x005500); GD.cmd_gauge(150, 140, 80, OPT_FLAT | OPT_NOTICKS | OPT_NOPOINTER, 5, 5, 500, 1000); GD.Display(); GD.flush(); // send new dl without swap
delay(1000); GD.cmd_swap(); GD.flush();
delay(1000); GD.cmd_swap(); GD.flush(); delay(1000); GD.cmd_swap(); GD.flush(); delay(1000); GD.cmd_swap(); GD.flush();
Color of gauges should be swaping. First gauge is ok, but second gauge shows as vertical stripe ( correct width ).
|
|
|
Post by kalev on Nov 27, 2016 0:24:41 GMT -8
Hi again.
I already figured out what was problem. In second dl
GD.ClearColorRGB(170, 170, 0); GD.Clear(1, 1, 1);
was missing. Now I understand that two dl are swapable.
|
|
|
Post by jamesbowman on Nov 27, 2016 7:41:24 GMT -8
That is correct... the two display lists are really just 8K RAMs on the FT800. Doing a cmd_swap() exchanges the RAMs.
|
|