I'm trying to write a roguelike (not based on Angband, per se, but peeking into its code from time to time, both to see how to do certain things and how NOT to do certain things).
Now, in Angband, when you start smashing random move buttons, everything gets updated immediately - no noticeable movement lag whatsoever.
My SDL-based mini-prototype, however... it's not anywhere near as fast. The screen isn't even 800x600, and redraws on keypresses (that's not entirely true, but a workable approximation). When I mash buttons, there is some really noticable lag - 20-40ms? Not sure.
Anyways. Due to this - since I couldn't find 'em in the code, so it's maybe better to ask the people who have a working understanding of it - I've been wondering:
1) ...what the hell is the underlying graphics-drawing thing? (I'm using the default Win7 binaries)
2) What triggers screen redraws?
3) How heavily is the screen-redrawing routine itself optimized?
Thanks in advance.
Now, in Angband, when you start smashing random move buttons, everything gets updated immediately - no noticeable movement lag whatsoever.
My SDL-based mini-prototype, however... it's not anywhere near as fast. The screen isn't even 800x600, and redraws on keypresses (that's not entirely true, but a workable approximation). When I mash buttons, there is some really noticable lag - 20-40ms? Not sure.
Anyways. Due to this - since I couldn't find 'em in the code, so it's maybe better to ask the people who have a working understanding of it - I've been wondering:
1) ...what the hell is the underlying graphics-drawing thing? (I'm using the default Win7 binaries)
2) What triggers screen redraws?
3) How heavily is the screen-redrawing routine itself optimized?
Thanks in advance.
Comment