Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix slowdown of _ScreenX and _ScreenY
The commands _ScreenX and _ScreenY got significantly slower due to the need to wait for the GLUT thread to wake up and execute the glutGet() command for them. We've already seen a few programs (including the IDE) where this behavior completely grinds the program to a halt, so we definitely can't keep it. The simple solution here is to not call glutGet() on every _ScreenX/Y command. Instead every time the idle/timer function runs we get the current values for the relevant glutGet() variables and store them. libqb_glut_get() then checks if the value being read is one of the ones we read in the idle/timer functionand if so just returns the last read value. By doing it this way the commands no longer has to wait on the GLUT thread for the result.
- Loading branch information