Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Mouse flicker in fullscreen

This thread is locked; no one can reply to it. rss feed Print
Mouse flicker in fullscreen
BrknPhoenix
Member #7,304
June 2006

Yep, it's me... again! More questions. Alright, I previously got the mouse to display without any crashes, but I have a new problem.

Firstly, in windowed mode, the mouse displays without flaw. However, when the mode is set to full screen, the mouse flickers like mad. It's the only thing on the screen that does so, and I don't know why.

What are some possible causes for the mouse flickering in fullscreen but not windowed? I'll post the code if need be, but I'm hoping this is a common problem with a common answer :p

Kitty Cat
Member #2,815
October 2002
avatar

You're probably showing the mouse on the screen and using a double buffer blitting the screen. The solution is to try using a hardware cursor, or drawing the mouse sprite to the double buffer before blitting it. Something like this:

/* after setting a video mode */

enable_hardware_cursor();
show_mouse(screen);
if(!(gfx_capabilities&GFX_HW_CURSOR))
   show_mouse(NULL);
...
while(doing_whatever)
{
   ...do whatever...
   if(!(gfx_capabilities&GFX_HW_CURSOR))
      draw_sprite(my_double_buffer, mouse_sprite, mouse_x, mouse_y);
   blit(my_double_buffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);
}

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

BrknPhoenix
Member #7,304
June 2006

Hm, it's fixed now, I just used draw_sprite instead of show_mouse and all of its trappings and now it's fine... I still don't really understand why show_mouse was working in windowed but not fullscreen though, hehe. Oh well >_< Thanks

Evert
Member #794
November 2000
avatar

You probably don't get a hardware cursor in full-screen mode.

Go to: