www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/02/14/23:15:04

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: "Brent Ritchie" <Juicer_X AT hotmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Allegro Timers
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Message-ID: <gI%a8.29122$Hv5.3286340@news20.bellglobal.com>
Date: Thu, 14 Feb 2002 22:59:12 -0500
NNTP-Posting-Host: 64.231.112.87
X-Complaints-To: abuse AT sympatico DOT ca
X-Trace: news20.bellglobal.com 1013745548 64.231.112.87 (Thu, 14 Feb 2002 22:59:08 EST)
NNTP-Posting-Date: Thu, 14 Feb 2002 22:59:08 EST
Organization: Bell Sympatico
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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)'

Thanks.


- Raw text -


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