Closed sam-falvo closed 8 years ago
We're calling SDL_PollEvent
after every instruction in @stefanberndtsson's Atari ST emulator. But it seems to run quite fine.
SDL 1.2 or SDL 2.0? I'm using SDL 2.0.
In any event, the results speak for themselves; you're free to test the code with and without the for-loop and observe the difference in speed. It's easily a factor of 10x or more improvement in performance on my Linux box.
One bug that I cannot get rid of, again seemingly related to SDL 2.0, is that intermittently, SDL will block event processing until I move the mouse out and back inside of the emulator's window. It doesn't always happen, indicating a race condition between threads that SDL manages, I think. So, if you run the emulator and nothing seems to happen, try killing it and re-running it a few times. Eventually, you'll get proper behavior.
We went from 1.2 to 2.0 a few weeks back.
You're right! Frames per second went from 45 (already acceptable) to 75 on a decent but not top-of-the-line laptop. Hardly a factor 10x, though. But I'll take it!
https://github.com/stefanberndtsson/ostis if you're curious and/or an Atari ST fan.
For me, it sped my emulator up from seconds per frame to frames per second. Though, I've never been very good at writing emulators; I think maybe my code just sucks. :)
This might also make MacOS version run acceptably too!