delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/28/06:40:26

From: "Knutte" <trumpetknutte AT swipnet DOT se>
Newsgroups: comp.os.msdos.djgpp
Subject: Vsync!
Lines: 37
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Message-ID: <6uAn3.7443$ip4.11733@nntpserver.swip.net>
NNTP-Posting-Host: 212.151.247.161
X-Complaints-To: news-abuse AT swip DOT net
X-Trace: nntpserver.swip.net 933155842 212.151.247.161 (Wed, 28 Jul 1999 11:57:22 MET DST)
NNTP-Posting-Date: Wed, 28 Jul 1999 11:57:22 MET DST
Organization: A Customer of Tele2
X-Sender: s-314852 AT d212-151-247-161 DOT swipnet DOT se
Date: Wed, 28 Jul 1999 12:00:53 +0200
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi
Ive just started to use DJGPP and Im "porting" my game written in Watcom to
DJGPP. Everything works fine except that *nothing* seem to happen when i use
vsync().
Can anyone help me with this ?

My main gameloop:  (Its hardly optimized but i think you get the feel...)
  // Main Loop

      while(!key[1]) // Release ESC-key.
               {
                    // Wait for vertical ReTrace.

                vsync();
                rectfill(screen,xBoard,yBoard,xBoard+20,yBoard+50,0); //
Board
                rectfill(screen,xBall,yBall,xBall+10,yBall+10,0); // Ball

                  if(key[72]) yBoard-=5;
                  if(key[80]) yBoard+=5;
                  if (yBoard>=400) yBoard=399;
                  if (yBoard<=29)  yBoard=30;
                   // the ball
                  xBall=xBall+vxBall;
                  yBall=yBall+vyBall;
                  if (xBall<5) vxBall=5;
                  if (xBall>625) vxBall=-5;
                  if (yBall<35) vyBall=3;
                  if (yBall>434) vyBall=-3;

                  // Draw screen
                  draw_sprite(screen, board, xBoard, yBoard);
                  draw_sprite(screen, ball, xBall, yBall);
                    }



- Raw text -


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