Author Topic: need some folks to test this out  (Read 10496 times)

0 Members and 1 Guest are viewing this topic.

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: need some folks to test this out
« Reply #20 on: October 18, 2007 »
I think you'll have to experiment :)

Jim
Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: need some folks to test this out
« Reply #21 on: October 18, 2007 »
im getting closer i think to smoothness  :)

could you test this for me ill not bother you with this from now honestly  ;D

ive got two demos one at 60 fps syncronized as close with the screen refresh as i can get and the other at 500fps as this is the smoothest i can possibly get on my system, without clamping it runs almost 900 fps.

in the 60hz one i can afford a sleep(10); so this one is by far the kindest to the system.

here is what im doing in my main loop.
Code: [Select]
LARGE_INTEGER Frequency ;
        LONGLONG llTimeDiff ;
        QueryPerformanceFrequency(&Frequency) ;
       
        do
        {
                LARGE_INTEGER liStart ;
                LARGE_INTEGER liStop ;

                QueryPerformanceCounter(&liStart) ;
                     
                while (PeekMessage(&msg, scene_window, 0, 0, PM_NOREMOVE))
                {
                        if (GetMessage(&msg, scene_window, 0,0) < 0)
                                break;
                        TranslateMessage(&msg);
                        DispatchMessage(&msg);
                }
                GenioMain( OffScreenDC , scene_window ) ;
                HDC destdc = GetDC( scene_window ) ;
                BitBlt( destdc , 0 , 0 , SCREEN_X , SCREEN_Y , OffScreenDC , 0 , 0 , SRCCOPY );
                ReleaseDC( scene_window , destdc ) ;
                Sleep(10) ;
               
                QueryPerformanceCounter(&liStop) ;
                llTimeDiff = liStop.QuadPart - liStart.QuadPart ;

                dftDuration = (double) llTimeDiff * 1000.0 / (double) Frequency.QuadPart;
               
                //little wait loop to try get the fps down to 60hz
                do{
                   QueryPerformanceCounter(&liStop);
                   llTimeDiff = liStop.QuadPart - liStart.QuadPart;

                   dftDuration = (double) llTimeDiff * 1000.0 / (double) Frequency.QuadPart;
               
                }while (  dftDuration <= 1000.0/(float)dmScreenSettings.dmDisplayFrequency );     
               
        } while (!quit);

and for my fps counter and delta timing im doing this.
Code: [Select]
float Xfactor = 8 , Yfactor = 8 ;
double FPSTimer , Timer;
int FPS;
char *FramesPerSecond ;
char fname[128];
void GenioMain( HDC hdc, HWND hwnd )
{       
       
        ClearOffScreenHDC();
       
        DeltaF = dftDuration / 14.0 ;
       
        CamX += ( Xfactor * DeltaF ) ;
        CamY += ( Yfactor * DeltaF ) ;
 
        if ( CamX < 0 ){
             CamX = 0 ;
             Xfactor =- Xfactor ;
        }
       
        if ( CamX > 8 * StarMap->width ){
             CamX = 8 * StarMap->width ;
             Xfactor =- Xfactor ;
        }
       
        if ( CamY < 0 ){
             CamY = 0 ;
             Yfactor =- Yfactor ;
        }
       
        if ( CamY > 6 * StarMap->height ){
             CamY = 6 * StarMap->height ;
             Yfactor =- Yfactor ;
        }
       
        for ( int Y = 0 ; Y < 9 ; Y++ ){
             for ( int X = 0 ; X < 12 ; X++ ){
                 SkyDC->SetX( -CamX + ( X * StarMap->width ) ) ;
                 SkyDC->SetY( -CamY + ( Y * StarMap->height ) ) ;
                 SkyDC->Blit( hdc );
            }
        }
       
        FPS += 1;

        Timer += dftDuration ;
        if ( Timer >= FPSTimer ){
            sprintf( fname , "fps: %d" , FPS);
            FPS = 0 ;
            FPSTimer = Timer + 1000.0 ;
        } 
       
        myText->SetCaption( fname );
        myText->DrawText();
       
}

do my timers look ok as im very new to this stuff.

60hz
http://www.4shared.com/file/26780283/f2ec497/test60hz.html?dirPwdVerified=5cf8302d

500hz
http://www.4shared.com/file/26780294/88516075/test500hz.html?dirPwdVerified=5cf8302d
« Last Edit: October 18, 2007 by ninogenio »
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: need some folks to test this out
« Reply #22 on: October 18, 2007 »
Tested the 60 HZ version, it runs nice and smooth, there is some tearing of the image but I think you've probably got it about as close as you can.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: need some folks to test this out
« Reply #23 on: October 18, 2007 »
cheers shockwave im still in the air a little bit as to which version to go for as at least on my system with the 60hz version there is a little tearing but its much kinder to the system where as the 500 fps version runs without tearing and lookes nice and smooth but takes 100% cpu.

ahh choices ehh  :) ill probably go for the 60hz one though.
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: need some folks to test this out
« Reply #24 on: October 18, 2007 »
They're both pretty much perfectly smooth here.  There's no point rendering 500 times a second.  Only 1/5th of those frames are going to be visible, the rest will be dropped or cause tearing.  Use the 60Hz one, and if your extra processing gets too much so it drops below 60, reduce the amount of sleep time.

Jim
Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: need some folks to test this out
« Reply #25 on: October 18, 2007 »
right thats great,

im much happier with the 60hz version it feels about right for me, using gdi drawing tools like lines and polys with brushes and pens the fps hardly gets hit at all.
Challenge Trophies Won:

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: need some folks to test this out
« Reply #26 on: October 19, 2007 »
cheers shockwave im still in the air a little bit as to which version to go for as at least on my system with the 60hz version there is a little tearing but its much kinder to the system where as the 500 fps version runs without tearing and lookes nice and smooth but takes 100% cpu.
...
Same here, on 60fps I got little tearing and at 500fps it is Ok.
Challenge Trophies Won: