Mail Archives: djgpp/2002/02/15/03:39:16
Brent Ritchie (Juicer_X AT hotmail DOT com) wrote:
: Hello,
: Sorry for all the posts, but this one is a real nuisance. I can't get my
: FPS function to work right. I installed the timer function but keep getting
: error messages. Here's my code, please tell me what is the matter.
: //code starts
: volatile int last_fps;
: volatile int frame_counter;
: void fps(...)
: {
: last_fps = frame_counter;
: frame_counter = 0;
: }
: END_OF_FUNCTION (fps);
: void init()
: {
: allegro_init();
: install_keyboard();
: set_gfx_mode(GFX_AUTODETECT,800,600,0,0);
: install_timer();
: buffer = create_bitmap(800, 600);
: clear_bitmap(buffer); // zero the memory bitmap
: vsync();
: datafile = load_datafile("head.dat");
: a = (BITMAP*)datafile[0].dat;
: b = (BITMAP*)datafile[1].dat;
: LOCK_FUNCTION (fps);
: LOCK_VARIABLE (last_fps);
: LOCK_VARIABLE (frame_counter);
: install_int (fps,1000);
: }
: Error messages I get:
: test.h:29: cannot convert `void (*)(...)' to `void*' for argument `1' to
: `int_go32_dpmi_lock_code(void*, long unsigned int)'
: test.h:32: cannot convert `void (*)(...)' to `void (*)()' for argument `1'
: to `int install_int(void (*)(), long int)'
Try using C instead of C++. Allegro is C, not C++, unless it has
changed.
Right,
MartinS
- Raw text -