From: Frédéric D. <fd...@fr...> - 2012-07-13 13:33:14
|
hello, i begin with allegro 5 and it is the most beautifull library i know : like nithrill in the mines of Moria... I use allegro 5.0.7 and i meet a problem with playing in FULLLSCREEN different kinds of drawings : the display is blurred a little like a very old TV and whatever the resolution. I link with allegro-5.0.7-monolith-mt-debug and allegro-5.0.7-monolith-mt i work with cobeblock and Mingw32, windows 7, Dell XPS15 with a NVIDIA GeForce GT 420M video card. May be i do some thing wrong ? here is the code i test : /*******************************************************************/ #include <allegro5/allegro.h> #include <allegro5/allegro_native_dialog.h> #include <allegro5/allegro_primitives.h> void erreur(const char*txt) { al_show_native_message_box( NULL, "Erreur", txt ,NULL, NULL, 0); exit(EXIT_FAILURE); } int main() { ALLEGRO_DISPLAY*display; ALLEGRO_KEYBOARD_STATE key; ALLEGRO_DISPLAY_MODE mode; if(!al_init()) erreur("initialisation"); if (!al_init_primitives_addon()) erreur("init primitives"); if(!al_install_keyboard()) erreur("install keyboard"); // to have destop résolution al_get_display_mode(al_get_num_display_modes()-1, &mode); // THE FULLSCREEN DOESN'T WORK PROPERLY al_set_new_display_flags(ALLEGRO_FULLSCREEN); display=al_create_display(mode.width,mode.height); if (!display) erreur("create_display"); int scrx=al_get_display_width(display); int scry=al_get_display_height(display); do{ al_get_keyboard_state(&key); int x1=rand()%scrx; int y1=rand()%scry; int x2=rand()%scrx; int y2=rand()%scry; ALLEGRO_COLOR color = al_map_rgba(rand()%255,rand()%255,rand()%255,rand()%255); float thickness = rand()%10 - 5; if (al_key_down(&key,ALLEGRO_KEY_F1)) al_draw_line(x1, y1, x2, y2, color, thickness); al_flip_display(); }while (!al_key_down(&key,ALLEGRO_KEY_ESCAPE)); al_destroy_display(display); } |