Вот мой код:
Код: Выделить всё
#include
#include
int main(int argc, char* argv[])
{
al_init();
ALLEGRO_DISPLAY* d = al_create_display(256, 256);
al_clear_to_color(al_map_rgb(0, 0, 255));
al_draw_filled_rectangle(64, 64, 192, 192, al_map_rgb(0, 0, 0));
al_flip_display();
al_rest(30);
al_destroy_display(d);
al_uninstall_system();
return 0;
}
Код: Выделить всё
g++ -I "C:\msys64\mingw64\include\" test.cpp -o test.exe -g -lallegro
-lallegro_primitives
Код: Выделить всё
Thread 1 received signal SIGSEGV, Segmentation fault.
al_lock_mutex (mutex=0x0) at C:/dev/allegro_winpkg/universal/allegro/src/threads.c:325
warning: 325 C:/dev/allegro_winpkg/universal/allegro/src/threads.c: No such file or directory
Код: Выделить всё
#0 al_lock_mutex (mutex=0x0) at C:/dev/allegro_winpkg/universal/allegro/src/threads.c:325
#1 0x00007ffc593c82bc in get_display_local_data (display=display@entry=0xdd7130)
at C:/dev/allegro_winpkg/universal/allegro/addons/primitives/prim_directx.cpp:138
#2 0x00007ffc593c9a4b in draw_prim_raw (target=0xdd7410, texture=0x0, vtx=0x5ffd90, decl=0x0, indices=0x0, num_vtx=4,
type=5) at C:/dev/allegro_winpkg/universal/allegro/addons/primitives/prim_directx.cpp:500
#3 0x00007ffc593ca011 in _al_draw_prim_directx (target=target@entry=0xdd7410, texture=texture@entry=0x0,
vtxs=vtxs@entry=0x5ffd90, decl=decl@entry=0x0, start=, start@entry=0, end=,
end@entry=4, type=, type@entry=5)
at C:/dev/allegro_winpkg/universal/allegro/addons/primitives/prim_directx.cpp:656
#4 0x00007ffc593ce048 in al_draw_prim (vtxs=0x5ffd90, decl=0x0, texture=0x0, start=0, end=4, type=5)
at C:/dev/allegro_winpkg/universal/allegro/addons/primitives/primitives.c:104
#5 0x00007ffc593c2784 in al_draw_filled_rectangle (x1=, y1=0, x2=, y2=0, color=...)
at C:/dev/allegro_winpkg/universal/allegro/addons/primitives/high_primitives.c:422
#6 0x00007ff62a84157d in main (argc=1, argv=0xee1b60) at test.cpp:18
Подробнее здесь: https://stackoverflow.com/questions/784 ... -rectangle