delorie.com/archives/browse.cgi | search |
From: | "Damian Yerrick" <web DOT poison AT pineight DOT 8m DOT com> |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | Re: Game Speed |
Date: | Sun, 17 Oct 1999 23:36:06 -0500 |
Organization: | Rose-Hulman Institute of Technology |
Lines: | 46 |
Sender: | AFSAUTH AT yerricde DOT laptop DOT rose-hulman DOT edu |
Message-ID: | <7ue86s$ibv$1@solomon.cs.rose-hulman.edu> |
References: | <H3jO3.7505$Tk DOT 157563 AT news DOT tpnet DOT pl> <MPG DOT 1273deccf87c634798b3ff AT news DOT freeserve DOT net> |
NNTP-Posting-Host: | yerricde.laptop.rose-hulman.edu |
X-Trace: | solomon.cs.rose-hulman.edu 940221468 18815 137.112.205.146 (18 Oct 1999 04:37:48 GMT) |
X-Complaints-To: | news AT cs DOT rose-hulman DOT edu |
NNTP-Posting-Date: | 18 Oct 1999 04:37:48 GMT |
X-Priority: | 3 |
X-MSMail-Priority: | Normal |
X-Newsreader: | Microsoft Outlook Express 5.00.2314.1300 |
X-MIMEOLE: | Produced By Microsoft MimeOLE V5.00.2314.1300 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Reply-To: | djgpp AT delorie DOT com |
Andrew R. Gillett <arg AT whangomatic DOT freeserve DOT co DOT uk> wrote in message news:MPG DOT 1273deccf87c634798b3ff AT news DOT freeserve DOT net... > In comp.os.msdos.djgpp, Snowman wrote: > > Hello everybody > > > > I programmed a simple game in C. > > (I used DJGPP and ALLEGRO) > > But the game runs on different Computers with > > a different speed. > > Is it possible, that the game runs on all > > Computers with a similar speed ? > > Please Help me immidiately . > > Here is a brief outline of what you need to do: > > - Create an interrupt which is called every 60th of a second (or whatever > you want the frame rate to be). Creating an interrupt will use up one of Allegro's interrupt slots. I use one of Allegro's timer handlers whose frequency is 70 Hz. It's called retrace_count > while (not_finished) > { > if (timer_value) > { > // Calculations go here > > if (--timer_value <= 0) > { > timer_value = 0; > > // Draw the graphics here > } > } > } -- Damian Yerrick CM 398, Rose-Hulman Institute of Technology 5500 Wabash Ave Terre Haute, IN 47803 http://come.to/yerrick
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |