|
Bmp flicker, noob question |
Nelson Cole
Member #6,043
July 2005
|
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();
|
Ceagon Xylas
Member #5,495
February 2005
|
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); 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); }
|
CosmicR
Member #6,889
February 2006
|
you can still show the mouse to the screen, but you have to hide it first before blitting the buffer. ie hidemouse
|
Nelson Cole
Member #6,043
July 2005
|
Yo guys thanks, i got it working. |
Kitty Cat
Member #2,815
October 2002
|
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. -- |
|