Convert the close callback to a lambda function in Basic2D
Adjust AGL to use std::function instead of callbacks.
Fix minor Linux compile error