For some reason I've got this flicker on my mouse pointer, I'm not for sure why everything else draw to the screen seems to be perfectly fine. The following code is all located in the main loop, with the latter in the while. Maybe you can tell me what I've done wrong, thanks.
// Load the custom mouse pointer BITMAP *reticle = load_bitmap("reticle.bmp", NULL); set_mouse_sprite(reticle); set_mouse_sprite_focus(reticle->w/2,reticle->h/2); show_mouse(screen);
// Blit the double buffer vsync(); acquire_screen(); blit(buffer, screen, 0, 0, 0, 0, WIDTH-1, HEIGHT-1); release_screen();
You're drawing the mouse to the screen, not the buffer. Draw it to the buffer and then draw the buffer on the screen like you're already doing.
show_mouse(buffer);
or
show_mouse(NULL); //not sure if you're allowed to use this line... while(game_loop) { draw_spirte(buffer,mouse_sprite,mouse_x,mouse_y); }
you can still show the mouse to the screen, but you have to hide it first before blitting the buffer.
ie
hidemouse
blit buffer to screen
showmouse
Yo guys thanks, i got it working.
Don't use show_mouse on the buffer. It's not safe, and just wastes the CPU by redrawing a lot when it'll never show. Use the show_mouse(NULL) and draw_sprite method.