CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2003
    Posts
    18

    Program runs too fast on my pc

    Hi

    I have been trying to write a game in C++ so far the code itself is going great, not having many problems at all.

    But heres the problem

    When i run the program on my pc it runs at a normal speed.

    Yet when i send it to someone else it either doesn't run at all or it runs really really slow (huge difference).

    Im programming using Visual Studio.net 2003 and using GLUT.

    Can anyone help. can send exe or code if it will help.


    Cheers again

    Chris
    Boycee

  2. #2
    Join Date
    Dec 2001
    Location
    Ontario, Canada
    Posts
    2,236
    Thats a fact of life... not all computers are the same speed. You best bet is optimize your code. You may also want to make the game playable on lower speed computers by not making esential functions like movement depend on frame rates (i.e. multithread).

  3. #3
    Join Date
    Nov 2003
    Posts
    18
    thats the thing though, this aint a small difference this is huge.

    so far i have tested on 5 mates pc's

    Laptop p4 2.0 == SLOW
    pc amd 2200 == slow
    pc p3 3.0ghz == fast
    pc amd 2100 == fast
    pc p4 1.8 == fast (( MINE ))

    also the results make no sense.

    ??
    Boycee

  4. #4
    Join Date
    Jul 2003
    Location
    Maryland
    Posts
    762
    Their OS is probably screwed up

  5. #5
    Join Date
    Nov 2003
    Posts
    18
    ok so there must be a way round this you say threading ?

    sounds like an option.

    Im also getting the problem when there are less things on the screen it runs faster too. (ie less collisions to check for)

    Would threading solve this too ?

    If so any links or pointers to helpful web pages would be great, i tried google for threads but cant find any that go into "threads of dummies" detail.

    Cheers again people.
    Boycee

  6. #6
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,721
    you might want to check the display settings ...

    What are the number of pixels in each color ?

    What is the color depth ?

  7. #7
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,721
    you might want to check the display settings ...

    What are the number of pixels in each color ?

    What is the color depth ?

  8. #8
    Join Date
    Nov 2003
    Posts
    18
    RGB Colour

    and there is only 3 colours used so far.
    Boycee

  9. #9
    Join Date
    Aug 2000
    Location
    West Virginia
    Posts
    7,721
    But what is the display color depth on the
    computers that it runs slow on ? true color (24 bit) ?
    high color ?

  10. #10
    Join Date
    Nov 2003
    Posts
    18
    oh sorry same colour depth as mine. 24bit.

    I have uploaded the game to my ftp download it if you want to have a look.

    What i think i have decided to do is make the whole thing a thread and add a sleep function that is equal to start end time - start time. And sleep for that amount inbetween each frame update to ensure things move that the correct rate.

    Well i think this may be the right way to go....
    Boycee

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured