Dark Bit Factory &  Gravity

Dark Bit Factory & Gravity

  • March 09, 2010 *
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Pages: [1]   Go Down

Author Topic: [C#] Tao.Freeglut slowdown on my desktop computer?  (Read 94 times)

0 Members and 1 Guest are viewing this topic.

James_wright_1990

  • C= 64
  • **
  • Karma: 4
  • Offline Offline
  • Posts: 45
    • View Profile
hi, first post in a while been away from my computer for a while.

I reacently ran my space invaders progam on my desktop (i finally got it fixed) and i noticed a large slowdown in game time the code is the same i still use stopwatches to set the laps between updates but for some reason its running at about half the speed. i've uploaded the most recent version as i've spent ages trying to figuer this out and i'm having no luck it works fine on my laptop but not my desktop if anyone could shed some light i would be most apprecetive.

James
Logged
"if debugging is the proccess of removing bugs from software then that means that programming must be the proccess of putting them in" my favourite programming quote.

Jim

  • ADMIN
  • Senior Member
  • ********
  • Karma: 318
  • Offline Offline
  • Posts: 4563
    • View Profile
Re: [C#] Tao.Freeglut slowdown on my desktop computer?
« Reply #1 on: February 05, 2010 »
My guess is it's this that's killing you:
Code: [Select]
Glut.glutTimerFunc(10, new Glut.TimerCallback(Update), 0);
You're trying to get 100fps.  Try setting this to 40 (25fps), or 17 (50fps) instead of 10 and see if it makes the laptop and desktop look more similar (obviously things will move at a different speed due to the different number of calls to Update).

Another thing - on your desktop and laptop have you counted how many calls to Update you get per second?  You can use the StopWatch class to get a very accurate timer.  Those 2 numbers  should really help find out what's going on.
I bet for whatever reason the laptop is doing more calls, perhaps because vsync is turned off on the graphics driver.

Jim
Logged

James_wright_1990

  • C= 64
  • **
  • Karma: 4
  • Offline Offline
  • Posts: 45
    • View Profile
Re: [C#] Tao.Freeglut slowdown on my desktop computer?
« Reply #2 on: February 06, 2010 »
hi

thanks jim this one turns out to be simple programmer (and human) incompetance first i was running an older version without realising (its been a while since i looked at it and i keep a stupid amout of versions documenting every change and forgot to lable the newest one which does use stopwatches), secondly your right i was calling update far to often (causing a slowdown when there was alot to update) and thirdly v sync was on on the graphic card on my desktop. So three for three on silly mistakes will watch for those in the future cheers for the help fixed it now.

cheers
james
« Last Edit: February 06, 2010 by James_wright_1990 »
Logged
"if debugging is the proccess of removing bugs from software then that means that programming must be the proccess of putting them in" my favourite programming quote.

Jim

  • ADMIN
  • Senior Member
  • ********
  • Karma: 318
  • Offline Offline
  • Posts: 4563
    • View Profile
Re: [C#] Tao.Freeglut slowdown on my desktop computer?
« Reply #3 on: February 06, 2010 »
Good news!
Jim
Logged
Pages: [1]   Go Up
 

 

B l a c k R a i n V.2 by C r i p

Page created in 0.165 seconds with 20 queries.