Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Allegro Mouse

This thread is locked; no one can reply to it. rss feed Print
Allegro Mouse
Fishcake
Member #8,704
June 2007
avatar

ok this is whats happening. whenever i move my mouse over some graphic, lets say some tiles i've loaded, there will be white squares drawn behind the mouse. im showing my mouse onto the DoubleBuffer, not the screen :

void blitBuffer(){
  show_mouse(DoubleBuffer);
  blit(DoubleBuffer, screen, 0, 0, 0, 0, DoubleBuffer->w, DoubleBuffer->h);
  clear_to_color(DoubleBuffer, makecol(255,255,255));
}

i tried replacing clear_to_color() with clear(). now black rectangles appear. and when the mouse move over sprites(NPC and stuff), the sprite will flicker. how do i fix that?

Kitty Cat
Member #2,815
October 2002
avatar

Don't use show_mouse on a memory bitmap. Call show_mouse(NULL) at init, and do:
draw_sprite(DoubleBuffer, mouse_sprite, mouse_x, mouse_y);
before blitting the double buffer to the screen.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Fishcake
Member #8,704
June 2007
avatar

woot that was fast :o thank you, it solved the problem! ;D

Go to: