Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » bitmaps flicker when moving the mouse

This thread is locked; no one can reply to it. rss feed Print
bitmaps flicker when moving the mouse
DuncanShine
Member #17,479
March 2020

I have this bit of code that's saving the position of the mouse cursor, but it's causing my bitmaps to flicker.

    ALLEGRO_MOUSE_STATE mouseState;      
    
    mouseX = al_get_mouse_state_axis(&mouseState, 0);
    mouseY = al_get_mouse_state_axis(&mouseState, 1);

I've also tried using events to save the position of the cursor, but that still causes flickering.

DanielH
Member #934
January 2001
avatar

what is your drawing code? I doubt this code is the culprit.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

flickering.

That means it is changing position rapidly. That means the values you're reading are changing rapidly. Did you get the mouse state before testing the values?

Go to: