#include <ggi/ggi.h> int ggiSetDisplayFrame(ggi_visual_t vis, int frameno); int ggiSetWriteFrame(ggi_visual_t vis, int frameno); int ggiSetReadFrame(ggi_visual_t vis, int frameno); int ggiGetDisplayFrame(ggi_visual_t vis); int ggiGetWriteFrame(ggi_visual_t vis); int ggiGetReadFrame(ggi_visual_t vis);
ggiSetDisplayFrame sets the frame that gets displayed.
ggiSetWriteFrame sets the frame for write operations such as ggiPuts(3) and ggiPutHLine(3).
ggiSetReadFrame sets the frame for read operations, like ggiGetPixel(3) and the ggiCrossBlit(3) source.
ggiGetDisplayFrame reports the frame currently displayed.
ggiGetWriteFrame reports the frame currently written to.
ggiSetReadFrame reports the frame currently read from.
Frames are numbered from 0 to the number of frames requested minus 1.
The ggiGet*Frame functions never fail.
This is because they display the frame during rendering. Unless you know what you do, never set the same frame to write and display mode.
Wrong (causes flickering):
ggiSetWriteFrame(vis, framenr); ggiSetDisplayFrame(vis, framenr); /* render here */
Right:
ggiSetWriteFrame(vis, framenr); /* render here */ ggiSetDisplayFrame(vis, framenr);