JulNadeauCA / libagar

Cross-Platform GUI Toolkit (stable)
https://libagar.org/
BSD 2-Clause "Simplified" License
401 stars 42 forks source link

AG_RedrawOnChange() causes core dump. #57

Closed WallyZambotti closed 4 years ago

WallyZambotti commented 4 years ago

It appears the 1.6.0 version of function AG_RedrawOnChange() does not work.

Sample code provided demonstrating the issue.

Code is both 1.5.0 & 1.6.0 compatible.

Compile command

cc `agar-config --cflags` agartestredraw.c -o agartestredraw `agar-config --libs`

agartestredraw_c.txt

Lines 41 & 42 of this code can be commented/un-commented to change test from:

AG_RedrawOnChange to AG_RedrawOnTick

On tick works for both AGAR 1.5.0 and 1.6.0. On change only seems to work on 1.5.0 and causes the following error message with 1.6.0:

$ ./agartestredraw AG_FatalError: pixmap0: No "" Aborted (core dumped) $

WallyZambotti commented 4 years ago

Please disregard. Error in my code has been identified.

Line:

AG_RedrawOnChange(pixmap, 1000/60, &redraw); // This only seems to work for 1.5.0 but not 1.6.0

should be coded:

AG_BindInt(pixmap, "pixmapstate", &redraw);  // where redraw is an int
AG_RedrawOnChange(pixmap, 1000/60, "pixmapstate");