C problem s allgero
#include <allegro.h>
int main()
{
BITMAP* obrazocek;
allegro_init();
install_mouse();
install_timer();
install_keyboard();
set_color_depth(16);
if (set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 640, 480, 0, 0) != 0)
{
set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
allegro_message("Zlyhala grafika\n%s\n", allegro_error);
return 1;
}
show_mouse(screen);
while( ! keypressed())
{
if (mouse_b & 2)
{
show_mouse(NULL);
putpixel(screen, mouse_x, mouse_y, makecol(255,255,0));
show_mouse(screen);
}
}
readkey();
return 0;
}
END_OF_MAIN();
a SEM JE CHYBA
insert@insert-desktop:~$ cd Plocha
insert@insert-desktop:~/Plocha$ gcc 12.c -o 12 -lalleg-4.2.2
insert@insert-desktop:~/Plocha$ ./12
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 134 (XFree86-VidModeExtension)
Minor opcode of failed request: 10 (XF86VidModeSwitchToMode)
Value in failed request: 0x3800003
Serial number of failed request: 2657563
Current serial number in output stream: 2657569
insert@insert-desktop:~/Plocha$
predom dik za rady
Pre pridávanie komentárov sa musíte prihlásiť.
Inak, skus kompilovat prikazom
gcc priklad.c -o priklad `allegro-config --libs`
. Ak to stale bude padat, mozno mas len nedobru verziu allegra, kedze program samotny je ok.Napadlo mi este, ze skus pozriet pri init_mouse() a init_timer(), ci sa to dobre inicializovalo (pomocou navratovej hodnoty).
poll_mouse() -- je to na refresh udajov z mysky.-.ň
neviem ci som to spravne napisal..
a tiez poll_keyboard()
skus malo bz to pomoct a tu BIitmapu vyhod ak nepouzivas.. sice kompiler by ta na to mal upozornit ak pouzivas warning
takze to bude asik tym ubuntu....
:) len žartujem
kompiloval si si allegro sam alebo si pouzil distribucne?
gcc priklad.c -o priklad `allegro-config --libs` tak mi to urobi presne to iste psuti sa mi to okno nakreslim kratku ciaru a potom mi to sekne az kym neresetnem PC..... a potom som este skusil ctrl+alt+f4 a ptoom spet ctrl+alt+f7 naskocila mi obrazovka aj bez resetnutia ale z strasne malim rozlisenim