fix typos
use INT_MAX instead of negative values as marker for not setting the swap interval
rename variables and types to make clear the are related to buffer swaps
add support for GLX_EXT_swap_control_tear