Witam
Jak ustawić prędkość kursora, żeby była taka jak np. w przeglądarce?
Próbowałem w ten sposób ale myszka jest za wolna:
#define UNICODE
#include <allegro.h>
#include <ctime>
#include <fstream>
#include <iostream>
#include <string>
#include <winalleg.h>
int main()
{
set_uformat( U_UTF8 );
get_uformat();
allegro_init();
install_keyboard();
install_timer();
install_mouse();
set_color_depth( 16 );
set_gfx_mode( GFX_AUTODETECT, 800, 600, 0, 0 );
set_mouse_speed( 1, 1 );
clear_to_color( screen, makecol( 239, 235, 184 ) );
BITMAP * pamiec = create_bitmap( 800, 600 );
BITMAP * start = load_bmp( "grafika/start.bmp", default_palette );
BITMAP * start2 = load_bmp( "grafika/start2.bmp", default_palette );
int wyjdz = 0;
int menug = 0;
while( wyjdz != 1 ) {
if( key[ KEY_ESC ] ) wyjdz = 1;
//textprintf_ex( pamiec, font, 20, 20, makecol( 200, 200, 200 ), - 1, "Myszka to %d %d %d", mouse_x, mouse_y, mouse_b );
blit( start, pamiec, 0, 0, 200, 100, 100, 50 );
if( menug == 0 ) {
blit( start2, pamiec, 0, 0, 200, 100, 100, 50 );
}
show_mouse( pamiec );
unscare_mouse();
blit( pamiec, screen, 0, 0, 0, 0, 800, 600 );
clear_to_color( pamiec, makecol( 239, 235, 184 ) );
}
allegro_exit();
return 0;
}
END_OF_MAIN();