keyboard and mouse slow down execution
I ran NeHe's lesson 09 program on my machine ( P2 400 Mhz ) and it runs fine and fastly. As soon as i start moving the cursor, the execution speed drops greatly and if I press some keys meanwhile it almost stops (close to 9 FPS). But Crimsonland plays fine on my machine (it's a game where you have to constantly move your mouse and press lots of keys), it doesn't slow down a bit. What's wrong? Thanks in advance.
probably ecasue you're using a p2 400 mhz, my p2 came special built and only had a 4mb card, your machine probably isn't up to it.
how does Crimsonland runs so fine, then?
I can even play Virtual Skipper without a problem.
What are their secret? I want to read mouse and keyboard input the way they do, which seems to be the best as it works very well even on my machine.
I can even play Virtual Skipper without a problem.
What are their secret? I want to read mouse and keyboard input the way they do, which seems to be the best as it works very well even on my machine.
Well there is one thing you have to keep in mind - NeHe's tutorials are not universal. They are not always the best approach to solving a problem. I say try other tutorials out and see how they work when you do the mouse and keyboard. I would not be worrying over the fact that one tutorial by someone else does not run quite that well. You will definitly needto try out other tutorials from like Ultimate Game Programming for example. Give a few more examples a try and see if that works. If it does, then you know it's lesson 9, if not, then it may just be the way NeHe works on your comp. Good luck!
- Drew
- Drew
thanks for the tip, I'll try the link you gave me. :)
Actually, I've already tried several approaches (windows-style; SDL; glut...) and none of them could give me the performance the two games I cited above did.
I know this is an outdated machine, but if 1 game can do it (and the games that can are not outdated) then it's just a matter of doing just like it.
Actually, I've already tried several approaches (windows-style; SDL; glut...) and none of them could give me the performance the two games I cited above did.
I know this is an outdated machine, but if 1 game can do it (and the games that can are not outdated) then it's just a matter of doing just like it.
pethaps, but that game probobly does not do a lot of blending, blending sucks a lot of GPU power, besides a 1 ghz CPU can do 333 batches per frame at 30 fps, lesson 9 does 50, a 400 MHz computer can only do 133 batches batches per frame at 30 fps, and if you then add the OS overhead and the blending slowdown, it does not leave you with mutch.
I can't tell what exactly causes the slowdown or how to fix it (besides getting a better computer), perhaps because you computer is allready overworked and your crappy craphics card just can't handle the mouse cursor being draged across the screen, normaly that should not do anything, but still.
allthough the nehe basecode(and lesson 9) is far from optimal there is not really mutch you can do to increase preformance(cpu preformance wise that is), perhaps some implimentations can give you a higher sample rate, but that's more or less about it.
(1 batch = 1 render state change + render geometry primitives)
I can't tell what exactly causes the slowdown or how to fix it (besides getting a better computer), perhaps because you computer is allready overworked and your crappy craphics card just can't handle the mouse cursor being draged across the screen, normaly that should not do anything, but still.
allthough the nehe basecode(and lesson 9) is far from optimal there is not really mutch you can do to increase preformance(cpu preformance wise that is), perhaps some implimentations can give you a higher sample rate, but that's more or less about it.
(1 batch = 1 render state change + render geometry primitives)
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
Quote:
Original post by lc_overlord
pethaps, but that game probobly does not do a lot of blending, blending sucks a lot of GPU power,
Hehe, Crimsonland uses plenty of alpha blending :)
I'm on my way to buying a new computer, but this problem I have now is one that will never get out of my head - I just can't figure it out.
Thanks for the answers, everybody. And Drew, I'll try out what you said (and also the GLFW I discovered through your sig), they're the only possible solutions I have not tested yet.
Quote:
Original post by bitprog
Hehe, Crimsonland uses plenty of alpha blending :)
true, but it doesn't have as many batches, (lesson 9 is horrible in this regard).
IT all works together to form a symfony of lag.
Fortunatly, my 3GHZ - 1GB DDR RAM - GF6800ULTRA computer doesn't have this problem. :D
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement