www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/02/15/03:39:16

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: eplmst AT lu DOT erisoft DOT se (Martin Stromberg)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro Timers
Date: 15 Feb 2002 08:16:28 GMT
Organization: Ericsson Erisoft AB, Sweden
Lines: 49
Message-ID: <a4ig4s$sis$1@antares.lu.erisoft.se>
References: <gI%a8.29122$Hv5 DOT 3286340 AT news20 DOT bellglobal DOT com>
NNTP-Posting-Host: lws256.lu.erisoft.se
X-Newsreader: TIN [version 1.2 PL2]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019