Graphics frame bug?

I have a small program that is drawing frames of a video synced to sound.

I added an optimization so that only pixels that change from frame to frame get set, and so I don't use the graphics clear function. I was also using pd->graphics->setPixel initially.

I found out I could use pd->graphics->getFrame to manipulate the bits directly, and so I tried to swap out the setPixel call for a bit set in this buffer, the problem is that the screen never updates after I change the frame. I tried calling pd->graphics->display, thinking that it would flush the buffer maybe, but it doesn't do anything. However, if I call pd->graphics->clear at the start of the update, then it will change the pixels as expected, but that kind of negates the work I did to set pixels individually if they have changed, and it causes my program to update too slowly to sync with my sound, since I assume every pixel gets drawn to

Is this a bug? Did I maybe miss a call I should have made? Thanks

If you are changing pixels directly in the frame buffer. You need to call markUpdatedRows

Not sure what else your app is doing but I would have thought you wouldn't have any issues drawing a 400x240 bitmap every frame and audio staying in sync.

3 Likes

Thanks! that was totally the issue