mouse pointer is slow!?!
Blitz3D Forums/Blitz3D Programming/mouse pointer is slow!?!
| ||
Has anyone experienced a problem with mousex/y() On one of my machines its fine, but on another it seems to slowly trail accross the screen as if its buffering each position. BTW Im using a sprite cursor at the mousex/y pos and if i display the hw cursor its ok, but blutz is not reporting its correct pos |
| ||
This is because if you draw the mouse pointer then you will see it when flipping (if double buffer is used). So the speed of this refresh depends on the FPS of your app. To avoid this, do not hide the pointer, and let windows draw it, then its movement is always smooth. And about the incorrect pos, i have tried it and it works ok for me :S |
| ||
only problem is its a full screen app so i want to use a sw cursor |
| ||
on Nvida Hardware, theres a setting in the drivers, "Max frames to render ahead". i found mine was set at 255 and i had huge mouse lag. I set this to 0, and it seemed dandy. I'm not saying this *is* the cure, but it fixed the problem for me. Your mouse pointer isnt slow, its just a few positions behind its current, isnt it? so if you move the mouse, it does the movement, but its delayed by a few ms before it copies it. |
| ||
yes, spot on, thats exactly the prob, but i dont want to have to tell users to change their settings. (its a geforce btw) |
| ||
Heh then theres not alot you can do. I get it in tons of DirectX Apps :( |
| ||
Quick update You *might* be able to flush the mouse,delay 10 for a bit and do a few "flip 0's" in a for loop.. might force the mouse up to date.. :) Try it.. just an idea. Let me know if it works, i need to fix it too :) |
| ||
bugger :P Oh well thanks for your help (again :) |
| ||
*pokes at above idea* No problem :) |
| ||
A best solution is to limit your "game logics" FPS, so you give the Render FPS a priority. This can be done with the fps limit framework in the codearchives, then drawing the mouse before the flip. It looks something like: Calculate period While (not keyhit(1)) -------------------- Calculate Timer for k=1 to ticks GAMELOGICS() next -------------------- RenderWorld DrawMouse Flip Wend This won't solve the problem at all, but will give you more control over logics FPS. |
| ||
This is probably unrelated, but anyway : I had this problem with a lot of blitz apps, but then I noticed it was being caused by my second mouse... Besides my normal mouse, I had a wireless mouse pugged in (well, it's receiver), and when I unplugged this, the problem disappeared. |
| ||
eek. Wireless mouse. They cause that prob too >.< mine is delayed even in winidows, so i dont use it :) |
| ||
hmm thought id fixed it, but no.... :( i trued the flip 0 idea but im using 2d gfx (outside the 3d viewport) and flip 0 seems to cock it all up |
| ||
yes, spot on, thats exactly the prob, but i dont want to have to tell users to change their settings. (its a geforce btw) If the driver setting is the issue, then I don't see a problem with putting a note in the trouble shooting section of the readme.txt (or whatever) explaining how to resolve the issue. Lots of commercial apps have trouble shooting sections explaining how to resolve issues by changing system settings. There are so many different PC setups and hardware that expecting an app to run perfectly on them all is unrealistic, IMO. |
| ||
The more that is rendered the slower it draws... RaGR and I are seeing this in a game we create together as well... The more stuff on the screen the greater the lag. One solution I have been toying with is to draw the mouse pointer OR at least update its position several times in the main game loop. Have not implemented yet... RZ |
| ||
all sorted now, for users who have this problem the latest nvidia drivers seem to fix it automatically |