Advertisement

Smooth Scrolling and Timing

Started by February 09, 2001 09:21 PM
2 comments, last by Null and Void 23 years, 11 months ago
Well, first of all, to clear the matter, and I am basing my scroll speed on the time that has elapsed. Secondly, I am use the High Performance Timer to do this. Thirdy, I am getting good frame rates (Monitor Max with V-Sync on, over 220+ with V-Sync off). I''m using OpenGL in Windows if that matters any. 640x480, 16 bit, double buffered, no z-buffer or other things like that. Ok, my problem is basicly that my scrolling isn''t real smooth. It gets kind of chunky even though my framerate stays very high while scrolling (at least 57 V-Sync and 170+ No V-Sync) in all of the circumstances that I''ve tested it under. Can anyone give me some advice on how to make it (scrolling) feel/look smoother?
http://www.gdarchive.net/druidgames/
Paste some code? Only way to tell...
Also, have u tried it under different operating systems/computers?
BetaShare - Run Your Beta Right!
Advertisement
Ohhho, I have this problem too.
Any ideas? I use DX8, so it couldn''t be the matrices. I use the HPT too, and a good frame rate. I was thinking of a float - to -int cast somewhere, but that seems unlikely.

------------------------------
BCB DX Library - RAD C++ Game development for BCB
Well, here''s the basic loop I''m using for my engine. I tried to only post the stuff that applies to the situation. So, I removed all the loading code and global variables, but I think you get the idea what my code is doing from this . I adapted Nehe''s high res. timer code into my program, so it works much like his does.

I took a profile of the program, and my fps is more than high enough to make it (theoretically) look smooth...

  void RenderMain(void *pass) {  RenderLandscape(land);  RenderAllSprites();}// --------------BOOL done = false;float last = GetCurrentState(); // <- Time in millisecondswhile(!done) {  if(RIUpdateState(msg)) done = true;  else if(RI_Keys[VK_ESCAPE]) done = true;  else {    if(RI_Mouse.buffered()) {      RI_Mouse.feeditem();    }    current = GetCurrentState();    if(RI_Keys[VK_LEFT]) { SceneCenter.x += (current-last); }    else if(RI_Keys[VK_RIGHT]) { SceneCenter.x -= (current-last); }    else if(RI_Keys[VK_UP]) { SceneCenter.y += (current-last); }    else if(RI_Keys[VK_DOWN]) { SceneCenter.y -= (current-last); }    RIUpdateScene(RenderMain,NULL);    last = current;  }}  




http://www.gdarchive.net/druidgames/

This topic is closed to new replies.

Advertisement