Clearing framebuffer - loops randomly stop
Posted: Fri Feb 25, 2022 10:15 am
Hello! I made a simple function to clear the framebuffer. The problem is that it stops randomly. I tried it in both virtualbox and qemu. What is causing that?
Screenshots of virtualbox are attached. Thanks in advance!
Code: Select all
void renderer_clear(framebuffer_t* fb) {
uint32_t color = 0xff0000ff;
for(size_t y = 0; y < fb->height; y++) {
uint32_t* pix_ptr = fb->base + fb->pps * y;
for(size_t x = 0; x < fb->width; x++) {
*pix_ptr = color;
pix_ptr++;
}
}
}