raylib » Forums » Weird behavior with drawText ?
albatros
20 posts

None

#16907 Weird behavior with drawText ?
1 week, 2 days ago Edited by albatros on Dec. 4, 2018, 5:26 p.m.

I had a strange behavior. If I call DrawText too much on each frame, then nothing is Drawn at all. I get a White screen.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
int N = 2200;
for (int i = 0; i < N; i++)
{

    //DrawCircle(40, 40 + i*5, 10, MAROON); 

    DrawText("hello",
    10,         //X
    10 + i*10,  //Y
    10,         //fontsize
    BLACK);
}



The value of N making the bug seems to be changing over time, sometimes N=2000 makes the bug occur, sometimes I have to pump it to N=5000 to have the bug occur

Oddly, if I were to uncomment DrawCicle from the above code, I can put any value of N, the bug doesn't happen.

Or maybe I'm missing something.

None
raysan5
Ray
47 posts / 1 project

I love videogames development.

#16913 Weird behavior with drawText ?
1 week, 2 days ago

It seems related to an overflow of the internal batch system.

There is a mechanism to avoid that but it could happen not to work properly.

Just working on it right now, trying to redesign that system.
albatros
20 posts

None

#16924 Weird behavior with drawText ?
1 week ago

Awesome :)

None