Re: [AD] install_param_int_ex() doesn't work :(

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Here is the C test program we used for install_param_int_ex(). It should beep once a second, but doesn't (at least for us). It's set up for use with Windows at the moment.



#include "allegro.h"
#include "winalleg.h"



/* WARNING: This is not designed to work in DOS. Don't try! */



void timer_handler(void *param)
{
	(*(int *)param)++;
}



int main()
{
	volatile int counter = 0;
	allegro_init();
	install_timer();
	install_keyboard();
	install_param_int_ex(&timer_handler, (void *)&counter, 1193181);
	while (!keypressed()) {
		while (counter) {
			MessageBeep(0);
			counter--;
		}
	}
	remove_param_int(&timer_handler, (void *)&counter);
	readkey();
	return 0;
}
END_OF_MAIN();



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/