home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / rec / games / programm / 5477 < prev    next >
Encoding:
Text File  |  1993-01-21  |  2.0 KB  |  41 lines

  1. Newsgroups: rec.games.programmer
  2. Path: sparky!uunet!usc!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uxa.cso.uiuc.edu!jas37876
  3. From: jas37876@uxa.cso.uiuc.edu (John A. Slagel)
  4. Subject: Re: PC Graphics (animation)
  5. References: <1993Jan21.082235.505680@zeus.calpoly.edu>
  6. Message-ID: <C17tq1.HHs@news.cso.uiuc.edu>
  7. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  8. Organization: University of Illinois at Urbana
  9. Date: Thu, 21 Jan 1993 17:53:58 GMT
  10. Lines: 29
  11.  
  12.    Well, you're headed in the right direction...
  13.  
  14.    I will post some C code in the next day or so to take care
  15.    of multiple keypresses with no typomatic stupid repeat. However,
  16.    this code is in Microsoft C with inline assembler, so if you 
  17.    are using something else, it might take some effort... I also
  18.    have the code in Pascal that someone posted a while back.
  19.  
  20.    To take care of flicker... Use the XLIB04 package.  Set up two
  21.    virtual screens.  Then, you can draw on one while viewing the
  22.    other.  Then, after you're done drawing on the hidden page,
  23.    make the hidden page visable, and then wait for verticle retrace
  24.    and then begin drawing on the now-hidden previous page that was shown.
  25.    Keep looping...  Another good thing to do is to use 3 pages... one
  26.    for the background and 2 for page flipping.  Then, whenever you need
  27.    to erase a "sprite" you can just use a fast display memory to display
  28.    memory copy from the background page on top of the sprite you need
  29.    to erase, and wala, the background is restored!  All the routines
  30.    that you need to do this are in the XLIB04 library.  For three pages,
  31.    you'll need to use 320x200 mode. 320x240 only gives ~2.4 pages or 
  32.    something like that.
  33.  
  34.    Good luck.
  35.  
  36. -- 
  37. -----------------------------------------------------------------------------
  38.  John A. Slagel              "My old man used to tell me, before he left this
  39.  j-slagel1@uiuc.edu           shitty world, never chase buses or women- you
  40.  (217) 337-7930               always get left behind." -The Marlboro Man
  41.