Thread: Faster directx on older pcs

  1. #1
    Registered User Josh Kasten's Avatar
    Join Date
    Jul 2002
    Posts
    109

    Faster directx on older pcs

    The directx exampile program Sprite Animate in the Microsoft DirectX 8.1 SDK gets 15fps on my old pc that has: 1MB graphic card,40MB of DRAM, 200MHZ CPU, and has directx 8.0 on it.
    Now the vary frist C&C that uses directx looks like its getting about 30fps. So how would i set up my programs to get more fames per sec on old pcs?
    int a; don't make a program without it.

  2. #2
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640

    Re: Faster directx on older pcs

    Originally posted by Josh Kasten
    The directx exampile program Sprite Animate in the Microsoft DirectX 8.1 SDK gets 15fps on my old pc that has: 1MB graphic card,40MB of DRAM, 200MHZ CPU, and has directx 8.0 on it.
    Now the vary frist C&C that uses directx looks like its getting about 30fps. So how would i set up my programs to get more fames per sec on old pcs?
    You can in no possible way compare a game's FPS with your
    benchmark's FPS, there are too many different conditions.
    How do you know wich DirectX C&C is using? Is it using DirectX?
    The sprite animation doesn't look to be able to run any faster
    on that system, i'm affraid it's just too slow.

  3. #3
    Registered User Josh Kasten's Avatar
    Join Date
    Jul 2002
    Posts
    109
    Well do you think using directx4 commands will help but what would i change to it so it use directx4's commands?

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Don't count on performance gain when switching to older DirectX
    version's. How are you sure C&C is DirectX? As far as i can
    remember C&C was available for DOS as well.

  5. #5
    Registered User codingmaster's Avatar
    Join Date
    Sep 2002
    Posts
    309
    Command & Conquer 2: Red Alert uses DirectX 5

  6. #6
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640

    Re: Faster directx on older pcs

    Originally posted by Josh Kasten
    the vary frist C&C

  7. #7
    Registered User Josh Kasten's Avatar
    Join Date
    Jul 2002
    Posts
    109
    I've got the win95 verion that comes with directx3 so i know it uses directx.
    int a; don't make a program without it.

  8. #8
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    Actually from what i hear there is a slight decrease in speed from Direct-X 7 to 8, but i doubt it will make that huge a difference.
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  9. #9
    Registered User Josh Kasten's Avatar
    Join Date
    Jul 2002
    Posts
    109
    well could anyone give me the code for how to do the exampile program in dirextx 3,4,or 5?
    int a; don't make a program without it.

  10. #10
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Originally posted by Josh Kasten
    well could anyone give me the code for how to do the exampile program in dirextx 3,4,or 5?
    I don't think the DirectX SDK has these examples, neither
    has ynone else, why? You won't notice speed difference between
    them, instead it might go slower on older versions.

  11. #11
    DirectX 4 never existed

  12. #12
    Registered User Josh Kasten's Avatar
    Join Date
    Jul 2002
    Posts
    109
    I think that my old graphics card doesn't work with directdraw 7 (wtich the exampile program uses) so i really think using an older directdraw would help. On my new pc i get about 17000 frames per sec it has: 667MHZ,192MB SDRAM,64MB gfore2,and directx8.1
    I don't think thats 1000 times better then my old pc so i think using an older verison that my grahpic card works with will help.
    int a; don't make a program without it.

  13. #13
    what program are you getting that framerate on?

  14. #14
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Originally posted by Josh Kasten
    On my new pc i get about 17000 frames per sec it has: 667MHZ,192MB SDRAM,64MB gfore2,and directx8.1
    Haha, No forget it you won't get 17000 FPS, Even if you wouldn't
    draw anything at all.
    DirectX 8.1 should run on any computer that's capable of running
    windows, You might not be able to use all of it's functions tough.
    Don't look back for older DirectX versions, Just use 8.1.

  15. #15
    Registered User Josh Kasten's Avatar
    Join Date
    Jul 2002
    Posts
    109
    It seems that it was doing most of the processing at the Sleep();


    fps.Start();

    if( FAILED( ProcessNextFrame() ) )
    {
    SAFE_DELETE( g_pDisplay );

    MessageBox( hWnd, TEXT("Displaying the next frame failed. ")
    TEXT("The sample will now exit. "), TEXT("DirectDraw Sample"), MB_ICONERROR | MB_OK );
    return FALSE;
    }

    fps.End();

    SetTextColor(hDC,RGB(100,100,255));
    sprintf(buf,"FPS:%d",int(fps.Get()));
    TextOut(hDC,0,0,buf,strlen(buf));
    Sleep(3);


    I then changed it to:




    fps.Start();

    if( FAILED( ProcessNextFrame() ) )
    {
    SAFE_DELETE( g_pDisplay );

    MessageBox( hWnd, TEXT("Displaying the next frame failed. ")
    TEXT("The sample will now exit. "), TEXT("DirectDraw Sample"), MB_ICONERROR | MB_OK );
    return FALSE;
    }

    fps.End();

    if (key)
    {
    SetTextColor(hDC,RGB(100,100,255));
    sprintf(buf,"FPS:%d",int(fps.Get()));
    TextOut(hDC,0,0,buf,strlen(buf));
    Sleep(5);
    }


    and my fames per sec where then 150. I didn't think it would process the rest of the directx code at the sleep but i need the sleep there to see the win32 font. fps where gottin form my fps.h file that almost done with. here it is if you want to see it:


    // FPS.h v1.0 By Josh Kasten
    #include <windows.h> // Needed for SYSTEMTIME

    class FPS
    {
    public:
    double *avg,time2,count;
    unsigned long time1;

    int savg,update_fps;

    FPS();

    void Set(int Update_MS,int FPS_Buf);
    void Start();
    void End();
    double Get();

    unsigned long Getalltime();
    };

    FPS::FPS()
    {
    count=time2=0;
    savg=5;
    update_fps=100;

    avg=new double[savg];

    for(int a=0; a<savg; a++)
    avg[a]=0;
    }

    void FPS::Set(int Update_MS,int FPS_Buf)
    {
    delete []avg;

    update_fps=Update_MS;
    savg=FPS_Buf;
    avg=new double[savg];

    for(int a=0; a<savg; a++)
    avg[a]=0;
    }

    void FPS::Start()
    {
    time1=Getalltime();
    }

    void FPS::End()
    {
    count++;

    time2+=Getalltime()-time1;

    if (update_fps <= time2)
    {
    double *temp=new double[savg];

    for(int a=0; a<savg; a++)
    temp[a]=avg[a];

    avg[0]=1000/(time2/count);

    for(a=1; a<savg; a++)
    avg[a]=temp[a-1];
    delete []temp;

    count=time2=0;
    }
    }

    double FPS::Get()
    {
    int addup=0;

    for(int a=0; a<savg; a++)
    {
    if (avg[a])
    addup+=avg[a];
    else
    break;
    }

    a+=(a<1);
    addup+=(addup<1);

    return addup/a;
    }

    unsigned long FPS::Getalltime()
    {
    SYSTEMTIME temp;

    GetLocalTime(&temp);

    return temp.wMilliseconds+temp.wSecond*1000+temp.wMinute* 60000+temp.wHour*3600000;
    }



    thanks for all the help people i think that opengl and directx could be faster on all pcs it. 150fps on a pc like that i think the hardware can do more than that and only 15fps on my older pc thats really slow. I don't no why this stuff don't go faster
    int a; don't make a program without it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Isometric Tile Engine using DirectX
    By Wraithan in forum Game Programming
    Replies: 3
    Last Post: 07-17-2006, 12:16 PM
  2. DirectSound header issues
    By dxfoo in forum C++ Programming
    Replies: 0
    Last Post: 03-19-2006, 07:16 PM
  3. DirectX - Starting Guide?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-25-2004, 12:49 AM
  4. DirectX or OpenGL for older computer
    By nickname_changed in forum Game Programming
    Replies: 10
    Last Post: 09-01-2003, 06:58 AM
  5. Directx SDK Documentation
    By Zoalord in forum Game Programming
    Replies: 4
    Last Post: 05-08-2003, 06:07 AM