TINYGL: Refactored while loops into for loops.
TINYGL: Refactored tglPresentBuffer to increase code readability.
TINYGL: Removed magic numbers in computeDirtyRegion