dev c++ pobieranie kordynatów myszki:)(alegro)

0

witam mam taki kod(testowy)

#include <allegro.h>
#include <stdio.h>

int main() 
{	
	allegro_init();
	install_keyboard();
	install_mouse();
    show_mouse(screen);
    set_color_depth(32);
	set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 700, 0, 0);

	BITMAP *buffer = create_bitmap(640, 700);
	clear_to_color(screen, 0x333333);
    char napis[50];
    int red = makecol(255,0,0);
    int white = makecol(255,255,255);
    int x1=100;
    int x2=400;
    int y1=100;
    int y2=400;
    int xmouse,ymouse;
    rectfill(screen,x1,y1,x2,y2,white);
    
    xmouse= mouse_x;
    ymouse=mouse_y;
    sprintf(napis,"[ %d %d ]",xmouse,ymouse);
	textout_centre_ex(screen, font, napis, 320, 5, 0xFFFFFF, 0x333333);
	
	readkey();
	
	destroy_bitmap(buffer);
	
	return 0;
}
END_OF_MAIN();

 

czemu kiedy wjeżdżam myszką na ekran gdzie jest program myszka znika?
kiedy dałem metode show_mouse?

0
dokumentacja Allegro którą powinieneś był przeczytać zanim przyleciałeś na forum napisał(a)

[show_mouse] Tells Allegro to display a mouse pointer on the screen. This will only work if the timer module has been installed. The mouse pointer will be drawn onto the specified bitmap, which should normally be `screen' (see later for information about bitmaps). To hide the mouse pointer, call show_mouse(NULL).

0

tzn czytałem dokumentacja bo tam znalazłem tą metode
i najgorsze że w szkole normalnie mi działał ale jak w domu to robie to już nie chce się pokazać i nie liczy tych kordynatów;/

0
  • nie zabardzo rozumie co mam zrobić z tym co mi dałeś a dokładnie to :This will only work if the timer module has been installed.
    P.S przepraszam z double post nie wiem jak edytować xD
0

ok zrobiłem nie musiałem nic robić co mi podesłać, ale dzieki

//mozna close

1 użytkowników online, w tym zalogowanych: 0, gości: 1