Swap buffers is now executed on the end of the render function.
Mouse dectection early development.