ClearBackground was not necessary

There is no flickering even if I don’t use the ClearBackground() function.
I also tried drawing a circle like this:

while (true)
{
BeginDrawing();
DrawCircle(40, 40, 10, GREEN);
// ClearBackground(RED);
EndDrawing();
}

Still no flickering.
Why is that?

Hi Mr_JC,

The explanation here outlines imagines that are moving, since the code example given doesn’t involve a moving object it results in a static image. So we don’t get the flicker effect mentioned.

Try changing the code to:

int x = 0;
while (true)
{
BeginDrawing();
DrawCircle(40 + x, 40, 10, GREEN);
// ClearBackground(RED);
EndDrawing();
x = x + 1;
}

And you’ll see what is being talked about more clearly;

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.