|
Help with installing system |
Jason Marmon
Member #14,859
January 2013
|
I'm trying to install the system in order to use timers in my program, but I'm unsure of what the second argument is. According to the documentation, this is the function: |
Thomas Fjellstrom
Member #476
June 2000
|
Its the crazy syntax used to declare pointers to functions. In this case you can use NULL or atexit (which is a libc function). -- |
Jason Marmon
Member #14,859
January 2013
|
oops, wrong code tags, sorry bout that |
Trent Gamblin
Member #261
April 2000
|
I'd be careful with that. I did that once and on Windows when the program exited, if it was using ALLEGRO_FULLSCREEN_WINDOW the taskbar would be gone. It's a caveat in the A5 Windows port. EDIT: I mean using NULL. Using atexit is fine.
|
Jason Marmon
Member #14,859
January 2013
|
in that case, would you mind explaining how to use atexit? I'm not quite sure how to implement it |
Thomas Fjellstrom
Member #476
June 2000
|
using the function name without the brackets or arguments will evaluate to the function's address. That is, its exactly what al_install_system wants, a function pointer. -- |
Phrasz
Member #10,091
August 2008
|
You can always look at the basics: (and then follow up with his link on pointer arguments)
|
Aikei_c
Member #14,871
January 2013
|
It's strange that nobody else mentioned that, but why don't you just use al_init()? |
Jason Marmon
Member #14,859
January 2013
|
Weird, I have that in the code already...I didn't know al_init() also installs the system. |
|