BeginBatchDraw

The function is used to begin batch drawing mode. After execution, any drawing operations will be temporarily not output to the graphics windows until call function flushBatchDraw or EndBatchDraw.

void BeginBatchDraw();

Parameters

None

Return Value

None

Examples

The following code implements a circle that moves from left to right with a more noticeable flicker.
Cancel the three comments in the main function to implement the batch drawing feature, which eliminates flickering.

#include <graphics.h>

int main()
{
	initgraph(640,480);

	setlinecolor(WHITE);
	setfillcolor(RED);

	// BeginBatchDraw();
	for(int i=50; i<600; i++)
	{
		circle(i, 100, 40);
		floodfill(i, 100, WHITE);
		// FlushBatchDraw();
		Sleep(10);
		cleardevice();
	}

	// EndBatchDraw();

	closegraph();
}